• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

spell attacking all monsters on the screen

vexler222

Member
Joined
Apr 22, 2012
Messages
355
Solutions
6
Reaction score
12
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
 

Forby

Advanced OT User
Joined
Jul 24, 2011
Messages
119
Reaction score
239
I think you need to add the function to shoot the projectile. start & end should be player and target position respecitively.

Lua:
doSendDistanceShoot(start_position, end_position, CONST_ANI_HOLY)
 
Top