Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local info = [[
- Name: Invisible Monster Attacker
- Description: Executes an AoE when monsters go invisible
- Author: Cavitt Glover (Syntax)
- Version: 1.0.00 (updated 04.25.2012)]]
- local config = {
- attacks = {
- --[[
- runes/spells should be prioritized from top to bottom, eg: exori gran will be attempted before exori or exori mas.
- aggressive:
- 0 = attack triggers when no players are in the area.
- 1 = attack triggers when only war enemies and skulled players, noone else.
- 2 = attack triggers when innocents are in the area but not when friendlies are.
- 3 = attack triggers when friendlies are in the area but not when innocents are.
- 4 = attack triggers without any regards to players in the area.
- ]]
- --{spell="exori gran", threshold=5, mana=50, radius=1, aggressive=0},
- {rune=3191, threshold=2, radius=6, aggressive=4},
- --{spell="exori mas", threshold =7, mana=80, radius=4, aggressive=0}
- }
- }
- local attack = false
- local function think()
- local target = Creature.GetByID(Self.TargetID)
- if(target:isVisible() and target:isAlive() and target:isValid())then -- target is visible, record it
- attack = true
- elseif(not target:isVisible() and attack)then -- creature went invisible, attack it
- attack = false -- for next check
- for _, info in ipairs(config.attacks)do
- local check = getTargetsInArea(Self.Position(), info.radius, info.aggressiveness, true)
- if(check)then -- if it's not false from a security check, continue
- if(info.spell)then
- Self.Cast(info.spell, info.mana)
- elseif(info.rune)then
- Self.UseItemWithMyPosition(info.rune)
- end
- wait(2000,2500)
- end
- end
- end
- end
- print(info)
- wait(5000)
- while (true) do
- think()
- wait(500)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement