Hello i was bored and made a little script for Mall Guards.
it isin't a guard that attacks on pvp or something just simply casting spells at enemys.
Code:
function guard_OnCombat(Unit, Event)
Unit:RegisterEvent("guard_Charge", 111, 1)
Unit:RegisterEvent("guard_MortalStrike", 30000, 0)
Unit:RegisterEvent("guard_Whirlwind", 40000, 0)
end
function guard_Charge(pUnit, Event)
pUnit:FullCastSpellOnTarget(22911, pUnit:GetMainTank())
end
function guard_MortalStrike(pUnit, Event)
pUnit:FullCastSpellOnTarget(16856, pUnit:GetMainTank())
end
function guard_Whirlwind(pUnit, Event)
pUnit:FullCastSpellOnTarget(15578, pUnit:GetMainTank())
end
function guard_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
function guard_OnDied(Unit, Event)
Unit:RemoveEvents()
end
function guard_OnKilledTarget(Unit, Event)
Unit:SendChatMessage(11, 0, "Stay out of This mall!")
end
RegisterUnitEvent(npc id, 1, "guard_OnCombat")
RegisterUnitEvent(npc id, 2, "guard_OnLeaveCombat")
RegisterUnitEvent(npc id, 3, "guard_OnKilledTarget")
RegisterUnitEvent(npc id, 4, "guard_OnDied")
Change the things in red to
Guard = change to your guards name
Npc Id = change to your Guards Entry I
Save this as a lua file in ure ascent scripts folder and it should work!
enjoy :wave: