Add own function to send AI_Reaction packet. by NoFantasy
--HG-- branch : trunk
This commit is contained in:
@@ -2094,6 +2094,18 @@ Unit* Creature::SelectNearestTarget(float dist) const
|
|||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Creature::SendAIReaction(AiReaction reactionType)
|
||||||
|
{
|
||||||
|
WorldPacket data(SMSG_AI_REACTION, 12);
|
||||||
|
|
||||||
|
data << uint64(GetGUID());
|
||||||
|
data << uint32(reactionType);
|
||||||
|
|
||||||
|
((WorldObject*)this)->SendMessageToSet(&data, true);
|
||||||
|
|
||||||
|
sLog.outDebug("WORLD: Sent SMSG_AI_REACTION, type %u.", reactionType);
|
||||||
|
}
|
||||||
|
|
||||||
void Creature::CallAssistance()
|
void Creature::CallAssistance()
|
||||||
{
|
{
|
||||||
if( !m_AlreadyCallAssistance && getVictim() && !isPet() && !isCharmed())
|
if( !m_AlreadyCallAssistance && getVictim() && !isPet() && !isCharmed())
|
||||||
|
|||||||
@@ -640,6 +640,8 @@ class TRINITY_DLL_SPEC Creature : public Unit
|
|||||||
bool canStartAttack(Unit const* u, bool force) const;
|
bool canStartAttack(Unit const* u, bool force) const;
|
||||||
float GetAttackDistance(Unit const* pl) const;
|
float GetAttackDistance(Unit const* pl) const;
|
||||||
|
|
||||||
|
void SendAIReaction(AiReaction reactionType);
|
||||||
|
|
||||||
Unit* SelectNearestTarget(float dist = 0) const;
|
Unit* SelectNearestTarget(float dist = 0) const;
|
||||||
void DoFleeToGetAssistance();
|
void DoFleeToGetAssistance();
|
||||||
void CallForHelp(float fRadius);
|
void CallForHelp(float fRadius);
|
||||||
|
|||||||
@@ -2449,8 +2449,8 @@ enum PetDiet
|
|||||||
enum AiReaction
|
enum AiReaction
|
||||||
{
|
{
|
||||||
AI_REACTION_UNK1 = 1,
|
AI_REACTION_UNK1 = 1,
|
||||||
AI_REACTION_AGGRO = 2,
|
AI_REACTION_AGGRO = 2, // trigger aggro sound to play, if defined in dbc
|
||||||
AI_REACTION_UNK3 = 3,
|
AI_REACTION_UNK3 = 3, // seen happen at polymorph, possible when AI not in control of self?
|
||||||
AI_REACTION_UNK4 = 4
|
AI_REACTION_UNK4 = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+1
-5
@@ -8616,11 +8616,7 @@ bool Unit::Attack(Unit *victim, bool meleeAttack)
|
|||||||
victim->SetInCombatWith(this);
|
victim->SetInCombatWith(this);
|
||||||
AddThreat(victim, 0.0f);
|
AddThreat(victim, 0.0f);
|
||||||
|
|
||||||
WorldPacket data(SMSG_AI_REACTION, 12);
|
((Creature*)this)->SendAIReaction(AI_REACTION_AGGRO);
|
||||||
data << uint64(GetGUID());
|
|
||||||
data << uint32(AI_REACTION_AGGRO); // Aggro sound
|
|
||||||
((WorldObject*)this)->SendMessageToSet(&data, true);
|
|
||||||
|
|
||||||
((Creature*)this)->CallAssistance();
|
((Creature*)this)->CallAssistance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user