dantexd
Member
- Joined
- Sep 1, 2010
- Messages
- 97
- Reaction score
- 23
Can someone help me here. I`ve been trying to edit this to understand more from it and to recreate this script on other spells but im stuck.
So basicly its a script that hits twice within a delay and shows some magic effects.
The problem is when hitting only showing the same effect after each hit. (Instead of nr of effects)
I am trying to edit position of the different effects with this.
So basicly its a script that hits twice within a delay and shows some magic effects.
The problem is when hitting only showing the same effect after each hit. (Instead of nr of effects)
Lua:
local config = {
efecto1 = 64, -- efeito q ira aparacer a cada teleport.
efecto2 = 72, -- efeito q ira aparecer ao hitar no alvo
hits = 2, -- quantos hits vai dar
delay = 1200, -- intervalo de tempo a cada hit
mindmg = 11000,
maxdmg = 12000,
damage = COMBAT_PHYSICALDAMAGE -- tipo do dano
}
spell1 = {
start1 = function (cid, target, markpos, hits)
if not isCreature(cid) then return true end
if not isCreature(target) or hits < 1 then
return true
end
posAv = validPos(getThingPos(target))
rand = #posAv == 1 and 1 or #posAv - 1
doAreaCombatHealth(cid, config.damage, getThingPos(target), 0, -config.mindmg, -config.maxdmg, config.efecto1)
addEvent(spell1.start1, config.delay, cid, target, markpos, hits - 1)
end
}
spell2 = {
start2 = function (cid, target, markpos, hits)
if not isCreature(cid) then return true end
if not isCreature(target) or hits < 2 then
return true
end
posAv = validPos(getThingPos(target))
rand = #posAv == 1 and 1 or #posAv - 1
doAreaCombatHealth(cid, config.damage, getThingPos(target), 0, -config.mindmg, -config.maxdmg, config.efecto2)
addEvent(spell2.start2, 100, cid, target, markpos, hits - 1)
end
}
function onCastSpell(cid)
local position1 = {x=getThingPosition(getCreatureTarget(cid)).x, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z}
local position2 = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z}
target = getCreatureTarget(cid)
if target then
spell1.start1(cid, target, getThingPos(cid), config.hits)
doSendMagicEffect(position1, 180)
doSendMagicEffect(position1, 212)
spell2.start2(cid, target, getThingPos(cid), config.hits)
end
return true
end
I am trying to edit position of the different effects with this.
Lua:
local position1 = {x=getThingPosition(getCreatureTarget(cid)).x, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z}
Last edited: