mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-19 03:45:43 +00:00
feat(Core/Players): PlayerFlag helpers (#11294)
* feat(Core/Players): PlayerFlag helpers * Update Player.h * fix build
This commit is contained in:
@@ -345,7 +345,7 @@ bool OPvPCapturePointNA::HandleCustomSpell(Player* player, uint32 spellId, GameO
|
||||
nodes[0] = FlightPathStartNodes[NA_ROOST_N];
|
||||
nodes[1] = FlightPathEndNodes[NA_ROOST_N];
|
||||
player->ActivateTaxiPathTo(nodes);
|
||||
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
|
||||
player->SetPlayerFlag(PLAYER_FLAGS_IN_PVP);
|
||||
player->UpdatePvP(true, true);
|
||||
retval = true;
|
||||
break;
|
||||
@@ -353,7 +353,7 @@ bool OPvPCapturePointNA::HandleCustomSpell(Player* player, uint32 spellId, GameO
|
||||
nodes[0] = FlightPathStartNodes[NA_ROOST_S];
|
||||
nodes[1] = FlightPathEndNodes[NA_ROOST_S];
|
||||
player->ActivateTaxiPathTo(nodes);
|
||||
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
|
||||
player->SetPlayerFlag(PLAYER_FLAGS_IN_PVP);
|
||||
player->UpdatePvP(true, true);
|
||||
retval = true;
|
||||
break;
|
||||
@@ -361,7 +361,7 @@ bool OPvPCapturePointNA::HandleCustomSpell(Player* player, uint32 spellId, GameO
|
||||
nodes[0] = FlightPathStartNodes[NA_ROOST_W];
|
||||
nodes[1] = FlightPathEndNodes[NA_ROOST_W];
|
||||
player->ActivateTaxiPathTo(nodes);
|
||||
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
|
||||
player->SetPlayerFlag(PLAYER_FLAGS_IN_PVP);
|
||||
player->UpdatePvP(true, true);
|
||||
retval = true;
|
||||
break;
|
||||
@@ -369,7 +369,7 @@ bool OPvPCapturePointNA::HandleCustomSpell(Player* player, uint32 spellId, GameO
|
||||
nodes[0] = FlightPathStartNodes[NA_ROOST_E];
|
||||
nodes[1] = FlightPathEndNodes[NA_ROOST_E];
|
||||
player->ActivateTaxiPathTo(nodes);
|
||||
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
|
||||
player->SetPlayerFlag(PLAYER_FLAGS_IN_PVP);
|
||||
player->UpdatePvP(true, true);
|
||||
retval = true;
|
||||
break;
|
||||
|
||||
@@ -1984,7 +1984,7 @@ public:
|
||||
bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
ClearGossipMenuFor(player);
|
||||
bool noXPGain = player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN);
|
||||
bool noXPGain = player->HasPlayerFlag(PLAYER_FLAGS_NO_XP_GAIN);
|
||||
bool doSwitch = false;
|
||||
auto toggleXpCost = sWorld->getIntConfig(CONFIG_TOGGLE_XP_COST);
|
||||
|
||||
@@ -2012,12 +2012,12 @@ public:
|
||||
else if (noXPGain)
|
||||
{
|
||||
player->ModifyMoney(-toggleXpCost);
|
||||
player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN);
|
||||
player->RemovePlayerFlag(PLAYER_FLAGS_NO_XP_GAIN);
|
||||
}
|
||||
else if (!noXPGain)
|
||||
{
|
||||
player->ModifyMoney(-toggleXpCost);
|
||||
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN);
|
||||
player->SetPlayerFlag(PLAYER_FLAGS_NO_XP_GAIN);
|
||||
}
|
||||
}
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
|
||||
Reference in New Issue
Block a user