Aeronx
Intermediate OT User
- Joined
- Dec 17, 2015
- Messages
- 736
- Solutions
- 9
- Reaction score
- 121
Hello otlanders, i've been doing some testing on spells for a new system i'm working on.
This spell should be casted by master and executed by summon. Instead is casted on master.
I did some spells for healing or damage and they work perfectly, but for some reason, "taunt" spell
is resisting me. Here's the script:
Also, tested this with the same result. It works but is used on master, not from summon.
Any help would be welcome! thanks!
This spell should be casted by master and executed by summon. Instead is casted on master.
I did some spells for healing or damage and they work perfectly, but for some reason, "taunt" spell
is resisting me. Here's the script:
Code:
function onTargetCreature(cid, target)
local summons = getCreatureSummons(cid)
local target = summons:getMaster():getTarget()
if summons ~= nil and #summons > 0 then
for i = 1, #summons do
return doChallengeCreature(summons[i], target)
end
end
return true
end
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
combat:setArea(createCombatArea(AREA_SQUARE1X1))
combat:setCallback(CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
function onCastSpell(cid, var)
return combat:execute(cid, var)
end
Also, tested this with the same result. It works but is used on master, not from summon.
Code:
function onTargetCreature(cid, target)
local summons = getCreatureSummons(cid)
local target = summons:getMaster():getTarget()
if summons ~= nil and #summons > 0 then
for i = 1, #summons do
return doChallengeCreature(summons[i], target)
end
end
return true
end
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
combat:setArea(createCombatArea(AREA_SQUARE1X1))
combat:setCallback(CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
function onCastSpell(cid, var)
local summons = getCreatureSummons(cid)
if summons ~= nil and #summons > 0 then
for i = 1, #summons do
return combat:execute(summons[i], var)
end
end
return true
end