vexler222
Active Member
- Joined
- Apr 22, 2012
- Messages
- 714
- Solutions
- 15
- Reaction score
- 46
Hi, can someone add to this script distance magic effect? Cuz when i use it i see magic effect on creature but not distance effect
Code:
function onCastSpell(cid, var)
local formula = {
min = (getPlayerLevel(cid)/3 + getPlayerMagLevel(cid)*23.5),
max = (getPlayerLevel(cid)/3 + getPlayerMagLevel(cid)*26.5),
}
local pos, creatures = getThingPos(cid), {}
for x = pos.x - 7, pos.x + 7 do
for y = pos.y - 5, pos.y + 5 do
local v = getTopCreature({x=x, y=y, z=pos.z}).uid
if isPlayer(v) or isMonster(v) and v ~= cid then
if isSightClear(getThingPos(cid), getThingPos(v), false) then
table.insert(creatures, v)
end
end
end
end
if #creatures > 0 then
for _, c in ipairs(creatures) do
if isCreature(c) then
doTargetCombatHealth(cid, c, COMBAT_DROWNDAMAGE, - formula.min, - formula.max, 101)
end
end
return true
end
doSendMagicEffect(getCreaturePosition(cid), 2)
return false
end