Core/Pets: add ghoul reactions to owner emotes. thx joshwhedon

This commit is contained in:
Kandera
2012-06-11 12:26:10 -04:00
parent 042f825400
commit 9fe66cafbe
2 changed files with 19 additions and 0 deletions

View File

@@ -532,3 +532,21 @@ bool PetAI::CanAttack(Unit* target)
// default, though we shouldn't ever get here
return false;
}
void PetAI::ReceiveEmote(Player* player, uint32 emote)
{
sLog->outError("recieved emote : %d", emote);
if (me->GetOwnerGUID() && me->GetOwnerGUID() == player->GetGUID())
switch (emote)
{
case TEXT_EMOTE_COWER:
if (me->isPet() && me->ToPet()->IsPetGhoul())
me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
break;
case TEXT_EMOTE_ANGRY:
if (me->isPet() && me->ToPet()->IsPetGhoul())
me->HandleEmoteCommand(EMOTE_ONESHOT_COWER);
break;
}
}

View File

@@ -42,6 +42,7 @@ class PetAI : public CreatureAI
void MovementInform(uint32 moveType, uint32 data);
void OwnerDamagedBy(Unit* attacker);
void OwnerAttacked(Unit* target);
void ReceiveEmote(Player* player, uint32 textEmote);
private:
bool _isVisible(Unit*) const;