Advertisement
MrTrala

Perfect Spell + SD + Direction

Mar 25th, 2016
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.40 KB | None | 0 0
  1. --[[
  2.     Perfect Sd + Spell Combo (with direction and pvpSafe) for ArchLight
  3.     Version 2.5 - PRIV VERSION (Ownership; Mr Trilo)
  4.     by Mr Trala
  5.  
  6. Instructions:
  7. Remember to change the "words" and the "cooldown" for your spell.
  8. You can get your custom cooldown (if you are in an otserver).
  9. Just checking the "icon" that pop up when you use any spell.
  10. Ex;
  11.  
  12. "Exana Gran Restora" equals to the exhausted of "Utura Gran" so;
  13. words = "exana gran restora", cooldown = "utura gran".
  14.  
  15. You can keep adding spells just like this:
  16. Adding the next number, ex;
  17. the last in this script is "spells[3]" so you just need to add the next one ie: "spells[4]".
  18. -
  19. If your attack needs direction "exevo tera hur", "exevo vis hur", etc, put "nDirection" as "true".
  20. If your attack is an AOE put "pSafe" as "true" (so you would NOT cast it if ppl is around you).
  21.  
  22. That's It!
  23. Have fun!
  24.    
  25. Credits;
  26. Unix -- Idea
  27. Corn -- Idea
  28. Mr Trala -- Programmer & Tester
  29. ]]
  30.  
  31. config = {
  32.     Dist = 7, -- Don't change anything here.
  33.     SdID = 3154 -- Change to your respective Sd ID <<
  34. }
  35.  
  36.  
  37. spells = {}
  38. spells[1] = {words = "exevo tera hur", cooldown = "exevo tera hur", nDirection = true, pSafe = false}
  39. spells[2] = {words = "exevo gran mas frigo", cooldown = "exevo gran mas frigo", nDirection = false, pSafe = false}
  40. spells[3] = {words = "exevo gran mas tera", cooldown = "exevo gran mas tera", nDirection = false, pSafe = false}
  41.  
  42. function spellssf()
  43. for i = 1, #spells do
  44.         local sps = spells[i]
  45.         local trg = Creature.GetByID(Self.TargetID())
  46.         local pos, toPos = getSelfPosition(), trg:Position()
  47.         local dir = pos.x > toPos.x and WEST or pos.x < toPos.x and EAST or pos.y > toPos.y and NORTH or SOUTH
  48.         local am = 0
  49.     for name, c in Creature.iPlayers(config.Dist) do
  50.         if c:isValid() and c:isAlive() and not Self.isInPz() and c:isOnScreen() and sps.pSafe then
  51.             am = am +1
  52.         end
  53.     end
  54.             if Self.CanCastSpell(sps.words) and Self.GetSpellCooldown(sps.cooldown) == 0 and trg:isTarget() then
  55.                 if trg:isAlive() and trg:DistanceFromSelf() <= config.Dist and am <= 0 then
  56.                     if sps.nDirection then
  57.                         Self.Turn(dir)
  58.                         wait(500, 1050)
  59.                         Self.Say(sps.words)
  60.                         Self.UseItemWithTarget(config.SdID)
  61.                         wait(1900, 2000)
  62.                     else
  63.                         wait(500, 1050)
  64.                         Self.Say(sps.words)
  65.                         Self.UseItemWithTarget(config.SdID)
  66.                         wait(1900, 2000)
  67.                     end
  68.                 end
  69.             end
  70.     end
  71. end
  72.  
  73. registerEventListener(TIMER_TICK, "spellssf")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement