Facebook
From alan, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 221
  1. -- Shooter by Mihelox --
  2.  
  3. -- Exori --
  4. Weak_Spell = "Exori"
  5. Weak_Spell_Mana = 115
  6. Weak_Creature_Count = 2
  7.  
  8. -- Exori Gran --
  9. Strong_Spell = "Exori Gran"
  10. Strong_Spell_Mana = 340
  11. Strong_Creature_Count = 3
  12.  
  13. -- Exori Gran Ico --
  14. Misc_Spell_One = "Exori Gran Ico"
  15. Misc_Spell_One_Mana = 300
  16. Misc_Spell_One_Count = 1
  17.  
  18. -- Exori Ico --
  19. Misc_Spell_Two = "Exori Ico"
  20. Misc_Spell_Two_Mana = 30
  21. Misc_Spell_Two_Count = 1
  22.  
  23. -- Exori Hur --
  24. Misc_Spell_Three = "Exori Hur"
  25. Misc_Spell_Three_Mana = 40
  26. Misc_Spell_Three_Count = 1
  27.  
  28. -- Utori Kor --
  29. Misc_Spell_Four = "Utori Kor"
  30. Misc_Spell_Four_Mana = 30
  31. Misc_Spell_Four_Count = 1
  32.  
  33. -- Blocked --
  34. blockedCreatures = {'Ghost', 'Ghoul'}
  35.  
  36. -- Utito Tempo --
  37. Utito_Tempo = true
  38. Utito_Count = 1
  39. Utito_Mana = 500
  40.  
  41. -- Timers --
  42. Add_Timer = 0
  43. Human_Timer = 0
  44.  
  45. -- Functions --
  46. print('Shooter By Mihelox Version: 1.9')
  47. local HumanTimerHUD = HUD.CreateTextDisplay(283, 15, "Human_Timer: ", 255, 255, 255)
  48. local TimerHUD = HUD.CreateTextDisplay(375, 15, Human_Timer.."", 0, 255, 0)
  49.  
  50. function GetSelfSpectators()
  51.     player = 0
  52.     local c = Self.GetSpectators()
  53.     for i = 1, #c do
  54.         if c[i]:isPlayer() and not c[i]:isPartyMember() then
  55.             player = player + 1
  56.         end
  57.     end
  58.     return player
  59. end
  60.  
  61. function GetSelfMonsterCount()
  62.     self = Self.Position()
  63.     monster = 0
  64.     for _, c in Creature.iMonsters() do
  65.         if Self.DistanceFromPosition(c:Position().x, c:Position().y, c:Position().z) == 1 and not table.find(blockedCreatures, c:Name()) then
  66.             monster = monster + 1
  67.         end
  68.     end
  69.     return monster
  70. end
  71.  
  72. function GetRealTarget()
  73.     for _, c in Creature.iMonsters(7) do
  74.         if Self.TargetID() ~= 0 then
  75.             if c:ID() == Self.TargetID() then
  76.                 if Self.DistanceFromPosition(c:Position().x, c:Position().y, c:Position().z) == 1 then
  77.                     return true
  78.                 end
  79.             end
  80.         end
  81.     end
  82.     return false
  83. end
  84.  
  85. function CheckPlayersInDistance(distance)
  86.     count = 0
  87.     for _, c in Creature.iPlayers(distance) do
  88.         if not c:isPartyMember() then
  89.             count = count + 1
  90.         end
  91.     end
  92.     return count
  93. end
  94.  
  95. function GetHumanTimer()
  96.     if CheckPlayersInDistance(3) == 0 then
  97.         if os.clock()-Add_Timer >= 0.51 then
  98.             Human_Timer = Human_Timer + 1
  99.             Add_Timer = os.clock()
  100.         end
  101.     else
  102.         Human_Timer = 0
  103.         Add_Timer = os.clock()
  104.     end
  105.     TimerHUD:SetText(Human_Timer .."")
  106. end
  107.  
  108. Spell_Timer = 0
  109. function MagicShooter()
  110.         GetHumanTimer()
  111.     Timer = math.random(15, 17)
  112.     if Utito_Tempo then
  113.         if not getSelfFlag("strenghthened") then
  114.             if GetSelfMonsterCount() >= Utito_Count then
  115.                 if Self.TargetID() ~= 0 and Self.Mana() >= Utito_Mana then
  116.                     if GetRealTarget() and os.clock()-Spell_Timer >= 0.1 then
  117.                         Self.Say('Utito Tempo')
  118.                         Spell_Timer = os.clock()
  119.                     end
  120.                 end
  121.             end
  122.         end
  123.     end
  124.     if Human_Timer >= Timer then
  125.         if Self.TargetID() ~= 0 then
  126.             if GetSelfMonsterCount() >= Strong_Creature_Count then
  127.                 if Self.Mana() >= Strong_Spell_Mana then
  128.                     if os.clock() - Spell_Timer >= 1 and Self.CanCastSpell(Strong_Spell) then    
  129.                         Self.Say(Strong_Spell)
  130.                         Spell_Timer = os.clock()
  131.                     end
  132.                 end
  133.             end
  134.             if GetSelfMonsterCount() >= Weak_Creature_Count then
  135.                 if Self.Mana() >= Weak_Spell_Mana then
  136.                     if os.clock() - Spell_Timer >= 1 and Self.CanCastSpell(Weak_Spell) then    
  137.                         Self.Say(Weak_Spell)
  138.                         Spell_Timer = os.clock()
  139.                     end
  140.                 end
  141.             end
  142.         end
  143.     end
  144.     if Self.TargetID() ~= 0 then
  145.         if GetSelfMonsterCount() == Misc_Spell_One_Count or Human_Timer < 14 then
  146.             if Self.Mana() >= Misc_Spell_One_Mana then
  147.                 if os.clock() - Spell_Timer >= 1 and Self.CanCastSpell(Misc_Spell_One) then    
  148.                     Self.Say(Misc_Spell_One)
  149.                     Spell_Timer = os.clock()
  150.                 end
  151.             end
  152.         end
  153.     end
  154.     if Self.TargetID() ~= 0 then
  155.         if GetSelfMonsterCount() == Misc_Spell_Two_Count or Human_Timer < 14 then
  156.             if Self.Mana() >= Misc_Spell_Two_Mana then
  157.                 if os.clock() - Spell_Timer >= 1 and Self.CanCastSpell(Misc_Spell_Two) then    
  158.                     Self.Say(Misc_Spell_Two)
  159.                     Spell_Timer = os.clock()
  160.                 end
  161.             end
  162.         end
  163.     end
  164.     if Self.TargetID() ~= 0 then
  165.         if GetSelfMonsterCount() == Misc_Spell_Three_Count or Human_Timer < 14 then
  166.             if Self.Mana() >= Misc_Spell_Three_Mana then
  167.                 if os.clock() - Spell_Timer >= 1 and Self.CanCastSpell(Misc_Spell_Three) then    
  168.                     Self.Say(Misc_Spell_Three)
  169.                     Spell_Timer = os.clock()
  170.                 end
  171.             end
  172.         end
  173.     end
  174.     if Self.TargetID() ~= 0 then
  175.         if GetSelfMonsterCount() == Misc_Spell_Three_Four or Human_Timer < 14 then
  176.             if Self.Mana() >= Misc_Spell_Four_Mana then
  177.                 if os.clock() - Spell_Timer >= 1 and Self.CanCastSpell(Misc_Spell_Four) then    
  178.                     Self.Say(Misc_Spell_Four)
  179.                     Spell_Timer = os.clock()
  180.                 end
  181.             end
  182.         end
  183.     end
  184. end
  185.  
  186. Module.New('Shooter', function()
  187.         MagicShooter()
  188. end)