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