- -- Shooter by Mihelox --
- -- Exori --
- Weak_Spell = "Exori"
- Weak_Spell_Mana = 115
- Weak_Creature_Count = 2
- -- Exori Gran --
- Strong_Spell = "Exori Gran"
- Strong_Spell_Mana = 340
- Strong_Creature_Count = 3
- -- Exori Gran Ico --
- Misc_Spell_One = "Exori Gran Ico"
- Misc_Spell_One_Mana = 300
- Misc_Spell_One_Count = 1
- -- Exori Ico --
- Misc_Spell_Two = "Exori Ico"
- Misc_Spell_Two_Mana = 30
- Misc_Spell_Two_Count = 1
- -- Exori Hur --
- Misc_Spell_Three = "Exori Hur"
- Misc_Spell_Three_Mana = 40
- Misc_Spell_Three_Count = 1
- -- Utori Kor --
- Misc_Spell_Four = "Utori Kor"
- Misc_Spell_Four_Mana = 30
- Misc_Spell_Four_Count = 1
- -- Blocked --
- blockedCreatures = {'Ghost', 'Ghoul'}
- -- Utito Tempo --
- Utito_Tempo = true
- Utito_Count = 1
- Utito_Mana = 500
- -- Timers --
- Add_Timer = 0
- Human_Timer = 0
- -- Functions --
- print('Shooter By Mihelox Version: 1.9')
- local HumanTimerHUD = HUD.CreateTextDisplay(283, 15, "Human_Timer: ", 255, 255, 255)
- local TimerHUD = HUD.CreateTextDisplay(375, 15, Human_Timer.."", 0, 255, 0)
- function GetSelfSpectators()
- player = 0
- local c = Self.GetSpectators()
- for i = 1, #c do
- if c[i]:isPlayer() and not c[i]:isPartyMember() then
- player = player + 1
- end
- end
- return player
- end
- function GetSelfMonsterCount()
- self = Self.Position()
- monster = 0
- for _, c in Creature.iMonsters() do
- if Self.DistanceFromPosition(c:Position().x, c:Position().y, c:Position().z) == 1 and not table.find(blockedCreatures, c:Name()) then
- monster = monster + 1
- end
- end
- return monster
- end
- function GetRealTarget()
- for _, c in Creature.iMonsters(7) do
- if Self.TargetID() ~= 0 then
- if c:ID() == Self.TargetID() then
- if Self.DistanceFromPosition(c:Position().x, c:Position().y, c:Position().z) == 1 then
- return true
- end
- end
- end
- end
- return false
- end
- function CheckPlayersInDistance(distance)
- count = 0
- for _, c in Creature.iPlayers(distance) do
- if not c:isPartyMember() then
- count = count + 1
- end
- end
- return count
- end
- function GetHumanTimer()
- if CheckPlayersInDistance(3) == 0 then
- if os.clock()-Add_Timer >= 0.51 then
- Human_Timer = Human_Timer + 1
- Add_Timer = os.clock()
- end
- else
- Human_Timer = 0
- Add_Timer = os.clock()
- end
- TimerHUD:SetText(Human_Timer .."")
- end
- Spell_Timer = 0
- function MagicShooter()
- GetHumanTimer()
- Timer = math.random(15, 17)
- if Utito_Tempo then
- if not getSelfFlag("strenghthened") then
- if GetSelfMonsterCount() >= Utito_Count then
- if Self.TargetID() ~= 0 and Self.Mana() >= Utito_Mana then
- if GetRealTarget() and os.clock()-Spell_Timer >= 0.1 then
- Self.Say('Utito Tempo')
- Spell_Timer = os.clock()
- end
- end
- end
- end
- end
- if Human_Timer >= Timer then
- if Self.TargetID() ~= 0 then
- if GetSelfMonsterCount() >= Strong_Creature_Count then
- if Self.Mana() >= Strong_Spell_Mana then
- if os.clock() - Spell_Timer >= 1 and Self.CanCastSpell(Strong_Spell) then
- Self.Say(Strong_Spell)
- Spell_Timer = os.clock()
- end
- end
- end
- if GetSelfMonsterCount() >= Weak_Creature_Count then
- if Self.Mana() >= Weak_Spell_Mana then
- if os.clock() - Spell_Timer >= 1 and Self.CanCastSpell(Weak_Spell) then
- Self.Say(Weak_Spell)
- Spell_Timer = os.clock()
- end
- end
- end
- end
- end
- if Self.TargetID() ~= 0 then
- if GetSelfMonsterCount() == Misc_Spell_One_Count or Human_Timer < 14 then
- if Self.Mana() >= Misc_Spell_One_Mana then
- if os.clock() - Spell_Timer >= 1 and Self.CanCastSpell(Misc_Spell_One) then
- Self.Say(Misc_Spell_One)
- Spell_Timer = os.clock()
- end
- end
- end
- end
- if Self.TargetID() ~= 0 then
- if GetSelfMonsterCount() == Misc_Spell_Two_Count or Human_Timer < 14 then
- if Self.Mana() >= Misc_Spell_Two_Mana then
- if os.clock() - Spell_Timer >= 1 and Self.CanCastSpell(Misc_Spell_Two) then
- Self.Say(Misc_Spell_Two)
- Spell_Timer = os.clock()
- end
- end
- end
- end
- if Self.TargetID() ~= 0 then
- if GetSelfMonsterCount() == Misc_Spell_Three_Count or Human_Timer < 14 then
- if Self.Mana() >= Misc_Spell_Three_Mana then
- if os.clock() - Spell_Timer >= 1 and Self.CanCastSpell(Misc_Spell_Three) then
- Self.Say(Misc_Spell_Three)
- Spell_Timer = os.clock()
- end
- end
- end
- end
- if Self.TargetID() ~= 0 then
- if GetSelfMonsterCount() == Misc_Spell_Three_Four or Human_Timer < 14 then
- if Self.Mana() >= Misc_Spell_Four_Mana then
- if os.clock() - Spell_Timer >= 1 and Self.CanCastSpell(Misc_Spell_Four) then
- Self.Say(Misc_Spell_Four)
- Spell_Timer = os.clock()
- end
- end
- end
- end
- end
- Module.New('Shooter', function()
- MagicShooter()
- end)