would like to change the script to make it work at 0.4 - 0.3.6 Tibi I try but I still get an error. Any help with change this script its realy hard
first i change script to spell and 0 dmg on monster maybe attack 3 monster per skill but 0 dmg . . why
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)
function onCastSpell(cid, var)
local ret = doCombat(cid, combat, var)
if not ret then
return false
end
local target = variantToNumber(var)
doTargetCombatHealth(cid,target,COMBAT_PHYSICAL,-20,-80,CONST_ME_NONE,false)
if target ~= 0 then
local throws = 0
for _, position in pairs(getArea(getCreaturePosition(target), 2, 2)) do
local tmp = getTopCreature(position).uid
if tmp ~= 0 and tmp ~= cid and tmp ~= target then
if doCombat(cid, combat, numberToVariant(tmp)) then
doTargetCombatHealth(cid,tmp,COMBAT_PHYSICAL, -20, -80, CONST_ME_NONE,false)
throws = throws + 1
if throws >= 2 then
break
end
end
end
end
end
return ret
end