1. -- Defined Guards:
  2. local NPC_DREADGUARD = 13839
  3. -- Global Functions:
  4. -- local SPELL_FACE_TARGET = 6655 -- [PH] Spell used to make the guard target the player. Not working.
  5. local EMOTE_ACTIVE = 0
  6. function EMOTE_SALUTE(event, delay, pCall, creature)
  7. if (creature:IsInCombat() == false) then
  8. creature:Emote(66)
  9. creature:RegisterEvent(RESET_POSITION, 4500, 1)
  10. end
  11. end
  12. function RESET_POSITION(event, delay, pCall, creature)
  13. local D_X, D_Y, D_Z, D_O = creature:GetHomePosition() -- D_ = Default
  14. creature:SetFacing(D_O)
  15. EMOTE_ACTIVE = 0
  16. end
  17. -- UNDERCITY - Royal Dreadguard
  18. function DREADGUARD_RecieveEmote(event, creature, player, emoteid)
  19. if (EMOTE_ACTIVE == 0 and emoteid == 78 and player:IsHorde() == true) then -- TEXTEMOTE_SALUTE
  20. local P_O = player:GetO() - 3 -- P_ = Player
  21. EMOTE_ACTIVE = 1
  22. creature:SetFacing(P_O)
  23. creature:RegisterEvent(EMOTE_SALUTE, 2000, 1)
  24. end
  25. end
  26. RegisterCreatureEvent(NPC_DREADGUARD, 8, DREADGUARD_RecieveEmote)