What's new

Pare skryptow do naprawy [rep+]

Poufny

Senior User
Joined
Jul 31, 2009
Messages
662
Reaction score
46
Age
31
Oto, skrypty, i ich bledy ;)

1. Animacje nie pojawiaja sie nad [x,y,z] pozycjami. Napisy rowniez.
Code:
 --[[
        Talking Tp/signs/tiles for TFS 0.3+
        by Maxi (Shawak)
]]--

        local text = {
        --X pos,Y pos, Z pos, text
        [1] = {pos = {999,995,7}, text = {"Exp"}},
        [2] = {pos = {997,995,7}, text = {"Depo"}},
        [3] = {pos = {1001,995,7}, text = {"Sklepy"}},
        [4] = {pos = {1003,995,7}, text = {"Questy"}},
        [5] = {pos = {1063,1004,7}, text = {"Back"}},
        [6] = {pos = {998,1004,7}, text = {"Wars RED"}},
        [7] = {pos = {998,1005,7}, text = {"Wars GREEN"}},
        [8] = {pos = {1002,1004,7}, text = {"Bomberman"}},
        [9] = {pos = {1002,1005,7}, text = {"Bomberman"}},
        [10] = {pos = {996,999,7}, text = {"-=VIP=-"}},
        [11] = {pos = {1060,978,7}, text = {"Back"}},
        [12] = {pos = {994,1000,7}, text = {"Free VIp"}}
        }

        local effects = {
        --X pos,Y pos, Z pos, text
        [1] = {pos = {999,995,7}, effect = {18}},
        [2] = {pos = {997,995,7}, effect = {19}},
        [3] = {pos = {1001,995,7}, effect = {21}},
        [4] = {pos = {1003,995,7}, effect = {21}},
        [5] = {pos = {1063,1004,7}, effect = {21}},
        [6] = {pos = {998,1004,7}, effect = {21}},
        [7] = {pos = {998,1005,7}, effect = {21}},
        [8] = {pos = {1002,1004,7}, effect = {21}},
        [9] = {pos = (1002,1005,7}, effect = {21}},
        [10] = {pos = {996,999,7}, effect = {21}},
        [11] = {pos = {1060,978,7}, effect = {21}},
        [12] = {pos = {994,1000,7}, effect = {22}}
        }

function onThink(interval, lastExecution)
        for _, area in pairs(text) do
                doSendAnimatedText({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.text[1], math.random(01,255))
        end
        for _, area in pairs(effects) do
                doSendMagicEffect({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.effect[1])
        end
        return TRUE
end

2.Owy czar dla palla, nie zadaje obrazen.
Code:
-- Massive Arrow Wave by Gelio
local combat = createCombatObject()
-- Oczywi?cie te parametry mo?emy zmienia?
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 664.5, 5, 2.7, 640)
local obszar = {
poziomo = 9,   -- Na ile kratek w poziomie szuka celow
pionowo = 9    -- Na ile kratek w pionie szuka celow
}
local manaPerTarget = 200    -- Ile many ma zabiera? przy kazdym strzale
function onCastSpell(cid, var)
local specs = getSpectators(getCreaturePosition(cid), obszar.poziomo, obszar.pionowo, FALSE)
for i=1, #specs do
	if((getCreatureMana(cid) > manaPerTarget or isPlayer(cid) == FALSE) and isNpc(specs[i]) == FALSE and getTilePzInfo(getCreaturePosition(specs[i])) == FALSE) then
		local target = specs[i]
		if(target ~= cid) then
			local targetPos = getCreaturePosition(target)
			if(isSightClear == nil or isSightClear(getCreaturePosition(cid), targetPos, FALSE) == TRUE) then
				doCombat(cid, combat, numberToVariant(target))
				if(isPlayer(cid) == TRUE) then
					doCreatureAddMana(cid, -manaPerTarget)
					doPlayerAddSpentMana(cid, manaPerTarget)
				end
			end
		end
	else
		break
	end
end
if(#specs == 1) then
	doPlayerSendCancel(cid,"You do not have any target.")
end
return TRUE
end

3. Przy kazdym zkleciu, wyskakuje blad w silniku, lecz spelle dzialaja. Nie spowoduje to crash, czy czegos? :p
 

lolej66

Advanced User
Joined
Aug 3, 2008
Messages
320
Reaction score
17
Odp: Pare skryptow do naprawy [rep+]

Co do czaru prosz? o podanie nazwy bo nie wiem kt?ry to z czar?w dla paladyna je?li b?d? wiedzia? dam ci dzia?aj?cy skrypt.
 

Dubler

Lua Factory =)
Joined
Apr 8, 2009
Messages
1,874
Reaction score
112
Odp: Pare skryptow do naprawy [rep+]

1.
jakie? bugi z konsoli?
2.
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 664.5, 5, 2.7, 640)
zamie? na:
Code:
setCombatFormula(combat, COMBAT_FORMULA_SKILL, -664. -5, -5, -2.7, -640)
3.
pokaz te bledy
 

Maniucza

Advanced User
Joined
Jan 18, 2009
Messages
374
Reaction score
57
Odp: Pare skryptow do naprawy [rep+]

Witaj,

Ad.1
Data/Globalevents/Globalevents.xml Dodaj:
PHP:
 <globalevent name="effects" interval="2" event="script" value="effects.lua"/>

Data/globalevents/scripts/effects.lua zr?b plik i dodaj;
PHP:
local text =  
{
    [1] = {pos = {1095, 1217, 7}, text = {"text 1"}},
    [2] = {pos = {1096, 1217, 7}, text = {"text 2"}},
    [3] = {pos = {1097, 1217, 7}, text = {"text 3"}},
    [4] = {pos = {1098, 1217, 7}, text = {"text 4"}}
}

local effects = 
{
    [1] = {pos = {1095, 1217, 7}, effect = {18}},
    [2] = {pos = {1096, 1217, 7}, effect = {19}},
    [3] = {pos = {1097, 1217, 7}, effect = {21}},
	[4] = {pos = {1098, 1217, 7}, effect = {22}}
}

function onThink(interval, lastExecution)
    for _, area in pairs(text) do
		doSendAnimatedText({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.text[1], math.random(01, 255))
    end
        
	for _, area in pairs(effects) do
       doSendMagicEffect({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.effect[1])
    end
return true
end

W tym skrypcie pozmieniaj tylko pozycje.
 

Poufny

Senior User
Joined
Jul 31, 2009
Messages
662
Reaction score
46
Age
31
Odp: Pare skryptow do naprawy [rep+]

@UP
No mam ten skrypt, tylko dorobilem w nim troche 'napisow' Moze to jest przyczyna bledu?
@lolej, to czar z tego forum.
@Dubler
No wlasnie zadnych nie ma.
Co do 3. Juz bledu nie ma.. moze dlatego ze poprawiles mi ten czar? :)
 
Top