Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. local combat = createCombatObject()
  2. setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
  3. setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497)
  4.  
  5. local from = {
  6. {x = 32353, y = 31886, z = 7},
  7. {x = 32325, y = 31899, z = 8}
  8. }
  9.  
  10. local to = {
  11. {x = 32384, y = 31904, z = 7},
  12. {x = 32341, y = 31911, z = 8}
  13. }
  14.  
  15. function onCastSpell(cid, var)
  16. if isInRange(getPlayerPosition(cid), from[1], to[1]) or isInRange(getPlayerPosition(cid), from[2], to[2]) then
  17. return doPlayerSendCancel(cid, "Sorry, not possible.")
  18. else
  19. local pos = variantToPosition(var)
  20. if getTileInfo(getThingPos(cid)).protection or getTileInfo(pos).protection then
  21. return not doPlayerSendDefaultCancel(cid, RETURNVALUE_ACTIONNOTPERMITTEDINPROTECTIONZONE)
  22. end
  23.  
  24. return doCombat(cid, combat, var)
  25. end
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement