• 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!

Magic wall throw only Horizontal

Salvus

Well-Known Member
Joined
Feb 7, 2019
Messages
102
Solutions
1
Reaction score
69
How to make this script to throw magic wall only horizontal?


Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_MAGICWALL)

local areacombate = {
    {1, 3, 1},
}

combat:setArea(createCombatArea(areacombate))

function onCastSpell(creature, variant, isHotkey)
    local actionId = 1050
    local target = getTileInfo(variant:getPosition()).actionid
    
    if target == actionId then
        creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can not use the magic wall on this tile")
        return false
    end
    return combat:execute(creature, variant)
end
 
Back
Top