Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local combat = createCombatObject()
- setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
- setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497)
- local from = {
- {x = 32353, y = 31886, z = 7},
- {x = 32325, y = 31899, z = 8}
- }
- local to = {
- {x = 32384, y = 31904, z = 7},
- {x = 32341, y = 31911, z = 8}
- }
- function onCastSpell(cid, var)
- if isInRange(getPlayerPosition(cid), from[1], to[1]) or isInRange(getPlayerPosition(cid), from[2], to[2]) then
- return doPlayerSendCancel(cid, "Sorry, not possible.")
- else
- local pos = variantToPosition(var)
- if getTileInfo(getThingPos(cid)).protection or getTileInfo(pos).protection then
- return not doPlayerSendDefaultCancel(cid, RETURNVALUE_ACTIONNOTPERMITTEDINPROTECTIONZONE)
- end
- return doCombat(cid, combat, var)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement