mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 01:29:07 +00:00
feat(Core/Misc): implement ObjectGuid class (port from TC) (#4885)
This commit is contained in:
@@ -50,7 +50,6 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
|
||||
mDespawnState = 0;
|
||||
|
||||
mEscortInvokerCheckTimer = 1000;
|
||||
mFollowGuid = 0;
|
||||
mFollowDist = 0;
|
||||
mFollowAngle = 0;
|
||||
mFollowCredit = 0;
|
||||
@@ -297,7 +296,7 @@ void SmartAI::EndPath(bool fail)
|
||||
if (!groupGuy || !player->IsInMap(groupGuy))
|
||||
continue;
|
||||
|
||||
if (!fail && groupGuy->IsAtGroupRewardDistance(me) && !groupGuy->GetCorpse())
|
||||
if (!fail && groupGuy->IsAtGroupRewardDistance(me) && !groupGuy->HasCorpse())
|
||||
groupGuy->AreaExploredOrEventHappens(mEscortQuestID);
|
||||
else if (fail && groupGuy->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE)
|
||||
groupGuy->FailQuest(mEscortQuestID);
|
||||
@@ -305,7 +304,7 @@ void SmartAI::EndPath(bool fail)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!fail && player->IsAtGroupRewardDistance(me) && !player->GetCorpse())
|
||||
if (!fail && player->IsAtGroupRewardDistance(me) && !player->HasCorpse())
|
||||
player->GroupEventHappens(mEscortQuestID, me);
|
||||
else if (fail && player->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE)
|
||||
player->FailQuest(mEscortQuestID);
|
||||
@@ -318,7 +317,7 @@ void SmartAI::EndPath(bool fail)
|
||||
if (GetScript()->IsPlayer((*iter)))
|
||||
{
|
||||
Player* player = (*iter)->ToPlayer();
|
||||
if (!fail && player->IsAtGroupRewardDistance(me) && !player->GetCorpse())
|
||||
if (!fail && player->IsAtGroupRewardDistance(me) && !player->HasCorpse())
|
||||
player->AreaExploredOrEventHappens(mEscortQuestID);
|
||||
else if (fail && player->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE)
|
||||
player->FailQuest(mEscortQuestID);
|
||||
@@ -616,7 +615,7 @@ void SmartAI::EnterEvadeMode()
|
||||
if (!me->IsAlive() || me->IsInEvadeMode())
|
||||
return;
|
||||
|
||||
if (IS_PLAYER_GUID(me->GetCharmerGUID()) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_POSSESSED))
|
||||
if (me->GetCharmerGUID().IsPlayer() || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_POSSESSED))
|
||||
{
|
||||
me->AttackStop();
|
||||
return;
|
||||
@@ -688,7 +687,7 @@ bool SmartAI::CanAIAttack(const Unit* /*who*/) const
|
||||
bool SmartAI::AssistPlayerInCombat(Unit* who)
|
||||
{
|
||||
// Xinef: if unit has no victim, or victim is player controlled thing
|
||||
if (!who->GetVictim() || IS_PLAYER_GUID(who->GetCharmerOrOwnerOrOwnGUID()))
|
||||
if (!who->GetVictim() || who->GetCharmerOrOwnerOrOwnGUID().IsPlayer())
|
||||
return false;
|
||||
|
||||
//experimental (unknown) flag not present
|
||||
@@ -696,7 +695,7 @@ bool SmartAI::AssistPlayerInCombat(Unit* who)
|
||||
return false;
|
||||
|
||||
// Xinef: victim of unit has to be a player controlled unit
|
||||
if (!IS_PLAYER_GUID(who->GetVictim()->GetCharmerOrOwnerOrOwnGUID()))
|
||||
if (!who->GetVictim()->GetCharmerOrOwnerOrOwnGUID().IsPlayer())
|
||||
return false;
|
||||
|
||||
// Xinef: Check if victim can be assisted
|
||||
@@ -724,7 +723,7 @@ void SmartAI::JustRespawned()
|
||||
mJustReset = true;
|
||||
JustReachedHome();
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_RESPAWN);
|
||||
mFollowGuid = 0;//do not reset follower on Reset(), we need it after combat evade
|
||||
mFollowGuid.Clear();//do not reset follower on Reset(), we need it after combat evade
|
||||
mFollowDist = 0;
|
||||
mFollowAngle = 0;
|
||||
mFollowCredit = 0;
|
||||
@@ -900,13 +899,13 @@ void SmartAI::SetData(uint32 id, uint32 value)
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, nullptr, id, value);
|
||||
}
|
||||
|
||||
void SmartAI::SetGUID(uint64 /*guid*/, int32 /*id*/)
|
||||
void SmartAI::SetGUID(ObjectGuid /*guid*/, int32 /*id*/)
|
||||
{
|
||||
}
|
||||
|
||||
uint64 SmartAI::GetGUID(int32 /*id*/) const
|
||||
ObjectGuid SmartAI::GetGUID(int32 /*id*/) const
|
||||
{
|
||||
return 0;
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
void SmartAI::SetRun(bool run)
|
||||
@@ -1014,7 +1013,7 @@ void SmartAI::SetFollow(Unit* target, float dist, float angle, uint32 credit, ui
|
||||
|
||||
void SmartAI::StopFollow(bool complete)
|
||||
{
|
||||
mFollowGuid = 0;
|
||||
mFollowGuid.Clear();
|
||||
mFollowDist = 0;
|
||||
mFollowAngle = 0;
|
||||
mFollowCredit = 0;
|
||||
|
||||
Reference in New Issue
Block a user