本文整理汇总了C++中GetFlagPickerGUID函数的典型用法代码示例。如果您正苦于以下问题:C++ GetFlagPickerGUID函数的具体用法?C++ GetFlagPickerGUID怎么用?C++ GetFlagPickerGUID使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetFlagPickerGUID函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetFlagPicker
void BattlegroundEY::EventPlayerDroppedFlag(Player *Source)
{
if (GetStatus() != STATUS_IN_PROGRESS)
{
// if not running, do not cast things at the dropper player, neither send unnecessary messages
// just take off the aura
if (IsFlagPickedup() && GetFlagPickerGUID() == Source->GetGUID())
{
SetFlagPicker(0);
Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
}
return;
}
if (!IsFlagPickedup())
return;
if (GetFlagPickerGUID() != Source->GetGUID())
return;
SetFlagPicker(0);
Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
m_FlagState = BG_EY_FLAG_STATE_ON_GROUND;
m_FlagsTimer = BG_EY_FLAG_RESPAWN_TIME;
Source->CastSpell(Source, SPELL_RECENTLY_DROPPED_FLAG, true);
Source->CastSpell(Source, BG_EY_PLAYER_DROPPED_FLAG_SPELL, true);
//this does not work correctly :((it should remove flag carrier name)
UpdateWorldState(NETHERSTORM_FLAG_STATE_HORDE, BG_EY_FLAG_STATE_WAIT_RESPAWN);
UpdateWorldState(NETHERSTORM_FLAG_STATE_ALLIANCE, BG_EY_FLAG_STATE_WAIT_RESPAWN);
if (Source->GetTeam() == ALLIANCE)
SendMessageToAll(LANG_BG_EY_DROPPED_FLAG, CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL);
else
SendMessageToAll(LANG_BG_EY_DROPPED_FLAG, CHAT_MSG_BG_SYSTEM_HORDE, NULL);
}
示例2: switch
void BattlegroundWS::HandleAreaTrigger(Player* player, uint32 trigger, bool entered)
{
//uint32 SpellId = 0;
//uint64 buff_guid = 0;
switch (trigger)
{
case 8965: // Horde Start
case 8966: // Alliance Start
if (GetStatus() == STATUS_WAIT_JOIN && !entered)
TeleportPlayerToExploitLocation(player);
break;
case 3686: // Alliance elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in Battleground::Update().
//buff_guid = BgObjects[BG_WS_OBJECT_SPEEDBUFF_1];
break;
case 3687: // Horde elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in Battleground::Update().
//buff_guid = BgObjects[BG_WS_OBJECT_SPEEDBUFF_2];
break;
case 3706: // Alliance elixir of regeneration spawn
//buff_guid = BgObjects[BG_WS_OBJECT_REGENBUFF_1];
break;
case 3708: // Horde elixir of regeneration spawn
//buff_guid = BgObjects[BG_WS_OBJECT_REGENBUFF_2];
break;
case 3707: // Alliance elixir of berserk spawn
//buff_guid = BgObjects[BG_WS_OBJECT_BERSERKBUFF_1];
break;
case 3709: // Horde elixir of berserk spawn
//buff_guid = BgObjects[BG_WS_OBJECT_BERSERKBUFF_2];
break;
case 3646: // Alliance Flag spawn
if (_flagState[TEAM_HORDE] && !_flagState[TEAM_ALLIANCE])
if (GetFlagPickerGUID(TEAM_HORDE) == player->GetGUID())
EventPlayerCapturedFlag(player);
break;
case 3647: // Horde Flag spawn
if (_flagState[TEAM_ALLIANCE] && !_flagState[TEAM_HORDE])
if (GetFlagPickerGUID(TEAM_ALLIANCE) == player->GetGUID())
EventPlayerCapturedFlag(player);
break;
case 3649: // unk1
case 3688: // unk2
case 4628: // unk3
case 4629: // unk4
break;
default:
Battleground::HandleAreaTrigger(player, trigger, entered);
break;
}
//if (buff_guid)
// HandleTriggerBuff(buff_guid, player);
}
示例3: switch
void BattlegroundWS::HandleAreaTrigger(Player* Source, uint32 Trigger)
{
// this is wrong way to implement these things. On official it done by gameobject spell cast.
if (GetStatus() != STATUS_IN_PROGRESS)
return;
//uint32 SpellId = 0;
//uint64 buff_guid = 0;
switch (Trigger)
{
case 3686: // Alliance elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in Battleground::Update().
//buff_guid = _BgObjects[BG_WS_OBJECT_SPEEDBUFF_1];
break;
case 3687: // Horde elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in Battleground::Update().
//buff_guid = _BgObjects[BG_WS_OBJECT_SPEEDBUFF_2];
break;
case 3706: // Alliance elixir of regeneration spawn
//buff_guid = _BgObjects[BG_WS_OBJECT_REGENBUFF_1];
break;
case 3708: // Horde elixir of regeneration spawn
//buff_guid = _BgObjects[BG_WS_OBJECT_REGENBUFF_2];
break;
case 3707: // Alliance elixir of berserk spawn
//buff_guid = _BgObjects[BG_WS_OBJECT_BERSERKBUFF_1];
break;
case 3709: // Horde elixir of berserk spawn
//buff_guid = _BgObjects[BG_WS_OBJECT_BERSERKBUFF_2];
break;
case 3646: // Alliance Flag spawn
if (m_FlagState[BG_TEAM_HORDE] && !m_FlagState[BG_TEAM_ALLIANCE])
if (GetFlagPickerGUID(BG_TEAM_ALLIANCE) == Source->GetGUID())
EventPlayerCapturedFlag(Source);
break;
case 3647: // Horde Flag spawn
if (m_FlagState[BG_TEAM_ALLIANCE] && !m_FlagState[BG_TEAM_HORDE])
if (GetFlagPickerGUID(BG_TEAM_ALLIANCE) == Source->GetGUID())
EventPlayerCapturedFlag(Source);
break;
case 3649: // unk1
case 3688: // unk2
case 4628: // unk3
case 4629: // unk4
break;
default:
sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
//Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
break;
}
//if (buff_guid)
// HandleTriggerBuff(buff_guid, Source);
}
示例4: switch
void BattlegroundEY::HandleAreaTrigger(Player *Source, uint32 Trigger)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
if (!Source->isAlive()) //hack code, must be removed later
return;
switch(Trigger)
{
case TR_BLOOD_ELF_POINT:
if (m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BLOOD_ELF] == Source->GetTeam())
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_BLOOD_ELF);
break;
case TR_FEL_REAVER_POINT:
if (m_PointState[FEL_REAVER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[FEL_REAVER] == Source->GetTeam())
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_FEL_REAVER);
break;
case TR_MAGE_TOWER_POINT:
if (m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[MAGE_TOWER] == Source->GetTeam())
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_MAGE_TOWER);
break;
case TR_DRAENEI_RUINS_POINT:
if (m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[DRAENEI_RUINS] == Source->GetTeam())
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_DRAENEI_RUINS);
break;
case 4512:
case 4515:
case 4517:
case 4519:
case 4530:
case 4531:
case 4568:
case 4569:
case 4570:
case 4571:
case 5866:
break;
default:
sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
break;
}
}
示例5: EventPlayerCapturedFlag
void BattlegroundEY::EventPlayerCapturedFlag(Player* player, uint32 BgObjectType)
{
if (GetStatus() != STATUS_IN_PROGRESS || GetFlagPickerGUID() != player->GetGUID())
return;
SetFlagPicker(ObjectGuid::Empty);
m_FlagState = BG_EY_FLAG_STATE_WAIT_RESPAWN;
player->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
if (player->GetTeam() == ALLIANCE)
{
SendBroadcastText(BG_EY_TEXT_ALLIANCE_CAPTURED_FLAG, CHAT_MSG_BG_SYSTEM_ALLIANCE, player);
PlaySoundToAll(BG_EY_SOUND_FLAG_CAPTURED_ALLIANCE);
}
else
{
SendBroadcastText(BG_EY_TEXT_HORDE_CAPTURED_FLAG, CHAT_MSG_BG_SYSTEM_HORDE, player);
PlaySoundToAll(BG_EY_SOUND_FLAG_CAPTURED_HORDE);
}
SpawnBGObject(BgObjectType, RESPAWN_IMMEDIATELY);
m_FlagsTimer = BG_EY_FLAG_RESPAWN_TIME;
m_FlagCapturedBgObjectType = BgObjectType;
uint8 team_id = player->GetTeam() == ALLIANCE ? TEAM_ALLIANCE : TEAM_HORDE;
if (m_TeamPointsCount[team_id] > 0)
AddPoints(player->GetTeam(), BG_EY_FlagPoints[m_TeamPointsCount[team_id] - 1]);
UpdatePlayerScore(player, SCORE_FLAG_CAPTURES, 1);
}
示例6: switch
void BattlegroundEY::HandleAreaTrigger(Player* player, uint32 trigger)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
if (!player->IsAlive()) //hack code, must be removed later
return;
switch (trigger)
{
case TR_BLOOD_ELF_POINT:
if (m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BLOOD_ELF] == player->GetTeam())
if (m_FlagState && GetFlagPickerGUID() == player->GetGUID())
EventPlayerCapturedFlag(player, BG_EY_OBJECT_FLAG_BLOOD_ELF);
break;
case TR_FEL_REAVER_POINT:
if (m_PointState[FEL_REAVER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[FEL_REAVER] == player->GetTeam())
if (m_FlagState && GetFlagPickerGUID() == player->GetGUID())
EventPlayerCapturedFlag(player, BG_EY_OBJECT_FLAG_FEL_REAVER);
break;
case TR_MAGE_TOWER_POINT:
if (m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[MAGE_TOWER] == player->GetTeam())
if (m_FlagState && GetFlagPickerGUID() == player->GetGUID())
EventPlayerCapturedFlag(player, BG_EY_OBJECT_FLAG_MAGE_TOWER);
break;
case TR_DRAENEI_RUINS_POINT:
if (m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[DRAENEI_RUINS] == player->GetTeam())
if (m_FlagState && GetFlagPickerGUID() == player->GetGUID())
EventPlayerCapturedFlag(player, BG_EY_OBJECT_FLAG_DRAENEI_RUINS);
break;
case 4512:
case 4515:
case 4517:
case 4519:
case 4530:
case 4531:
case 4568:
case 4569:
case 4570:
case 4571:
case 5866:
break;
default:
Battleground::HandleAreaTrigger(player, trigger);
break;
}
}
示例7: switch
void BattlegroundEY::HandleAreaTrigger(Player* Source, uint32 Trigger)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
if (!Source->isAlive())
return;
switch (Trigger)
{
case TR_BLOOD_ELF_POINT:
if (m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BLOOD_ELF] == Source->GetBGTeam())
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_BLOOD_ELF);
break;
case TR_FEL_REAVER_POINT:
if (m_PointState[FEL_REAVER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[FEL_REAVER] == Source->GetBGTeam())
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_FEL_REAVER);
break;
case TR_MAGE_TOWER_POINT:
if (m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[MAGE_TOWER] == Source->GetBGTeam())
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_MAGE_TOWER);
break;
case TR_DRAENEI_RUINS_POINT:
if (m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[DRAENEI_RUINS] == Source->GetBGTeam())
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
EventPlayerCapturedFlag(Source, BG_EY_OBJECT_FLAG_DRAENEI_RUINS);
break;
case 4512:
case 4515:
case 4517:
case 4519:
case 4530:
case 4531:
case 4568:
case 4569:
case 4570:
case 4571:
case 5866:
break;
default: break;
}
}
示例8: SetFlagPicker
void BattleGroundEY::EventPlayerDroppedFlag(Player *Source)
{
if(GetStatus() != STATUS_IN_PROGRESS)
{
// if not running, do not cast things at the dropper player, neither send unnecessary messages
// just take off the aura
if(IsFlagPickedup() && GetFlagPickerGUID() == Source->GetGUID())
{
SetFlagPicker(0);
Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
}
return;
}
if(!IsFlagPickedup())
return;
if(GetFlagPickerGUID() != Source->GetGUID())
return;
const char *message = "";
uint8 type = 0;
SetFlagPicker(0);
Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
m_FlagState = BG_EY_FLAG_STATE_ON_GROUND;
m_FlagsTimer = BG_EY_FLAG_RESPAWN_TIME;
Source->CastSpell(Source, SPELL_RECENTLY_DROPPED_FLAG, true);
Source->CastSpell(Source, BG_EY_PLAYER_DROPPED_FLAG_SPELL, true);
if(Source->GetTeam() == ALLIANCE)
{
message = GetMangosString(LANG_BG_EY_DROPPED_FLAG);
type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
}
else
{
message = GetMangosString(LANG_BG_EY_DROPPED_FLAG);
type = CHAT_MSG_BG_SYSTEM_HORDE;
}
//this does not work correctly :( (it should remove flag carrier name)
UpdateWorldState(NETHERSTORM_FLAG_STATE_HORDE, BG_EY_FLAG_STATE_WAIT_RESPAWN);
UpdateWorldState(NETHERSTORM_FLAG_STATE_ALLIANCE, BG_EY_FLAG_STATE_WAIT_RESPAWN);
WorldPacket data;
ChatHandler::FillMessageData(&data, Source->GetSession(), type, LANG_UNIVERSAL, NULL, Source->GetGUID(), message, NULL);
SendPacketToAll(&data);
}
示例9: switch
void BattlegroundWS::HandleAreaTrigger(Player* player, uint32 trigger)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
switch (trigger)
{
case 3686: // Alliance elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in Battleground::Update().
//buff_guid = BgObjects[BG_WS_OBJECT_SPEEDBUFF_1];
break;
case 3687: // Horde elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in Battleground::Update().
//buff_guid = BgObjects[BG_WS_OBJECT_SPEEDBUFF_2];
break;
case 3706: // Alliance elixir of regeneration spawn
//buff_guid = BgObjects[BG_WS_OBJECT_REGENBUFF_1];
break;
case 3708: // Horde elixir of regeneration spawn
//buff_guid = BgObjects[BG_WS_OBJECT_REGENBUFF_2];
break;
case 3707: // Alliance elixir of berserk spawn
//buff_guid = BgObjects[BG_WS_OBJECT_BERSERKBUFF_1];
break;
case 3709: // Horde elixir of berserk spawn
//buff_guid = BgObjects[BG_WS_OBJECT_BERSERKBUFF_2];
break;
case 3646: // Alliance Flag spawn
if (_flagState[BG_TEAM_HORDE] && !_flagState[BG_TEAM_ALLIANCE])
if (GetFlagPickerGUID(BG_TEAM_HORDE) == player->GetGUID())
EventPlayerCapturedFlag(player);
break;
case 3647: // Horde Flag spawn
if (_flagState[BG_TEAM_ALLIANCE] && !_flagState[BG_TEAM_HORDE])
if (GetFlagPickerGUID(BG_TEAM_ALLIANCE) == player->GetGUID())
EventPlayerCapturedFlag(player);
break;
case 3649: // unk1
case 3688: // unk2
case 4628: // unk3
case 4629: // unk4
break;
default:
Battleground::HandleAreaTrigger(player, trigger);
break;
}
}
示例10: if
void BattlegroundEY::UpdatePointStatuses()
{
_400Ally40Horde = 0;
for(uint8 point = 0; point < EY_POINTS_MAX; ++point)
{
if(m_PlayersNearPoint[point].empty())
continue;
//count new point bar status:
m_PointBarStatus[point] += (m_CurrentPointPlayersCount[2 * point] - m_CurrentPointPlayersCount[2 * point + 1] < BG_EY_POINT_MAX_CAPTURERS_COUNT) ? m_CurrentPointPlayersCount[2 * point] - m_CurrentPointPlayersCount[2 * point + 1] : BG_EY_POINT_MAX_CAPTURERS_COUNT;
if(m_PointBarStatus[point] > BG_EY_PROGRESS_BAR_ALI_CONTROLLED) {
m_PointBarStatus[point] = BG_EY_PROGRESS_BAR_ALI_CONTROLLED;
_400Ally40Horde += 10;
} else if(m_PointBarStatus[point] < BG_EY_PROGRESS_BAR_HORDE_CONTROLLED) {
_400Ally40Horde += 100;
m_PointBarStatus[point] = BG_EY_PROGRESS_BAR_HORDE_CONTROLLED;
}
uint32 pointOwnerTeamId = 0;
//find which team should own this point
if(m_PointBarStatus[point] <= BG_EY_PROGRESS_BAR_NEUTRAL_LOW)
pointOwnerTeamId = HORDE;
else if(m_PointBarStatus[point] >= BG_EY_PROGRESS_BAR_NEUTRAL_HIGH)
pointOwnerTeamId = ALLIANCE;
else
pointOwnerTeamId = EY_POINT_NO_OWNER;
for(uint8 i = 0; i < m_PlayersNearPoint[point].size(); ++i)
{
Player* plr = sObjectMgr->GetPlayer(m_PlayersNearPoint[point][i]);
if(plr)
{
this->UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[point], plr);
//if point owner changed we must evoke event!
if(pointOwnerTeamId != m_PointOwnedByTeam[point])
{
//point was uncontrolled and player is from team which captured point
if(m_PointState[point] == EY_POINT_STATE_UNCONTROLLED && plr->GetTeam() == pointOwnerTeamId)
this->EventTeamCapturedPoint(plr, point);
//point was under control and player isn't from team which controlled it
if(m_PointState[point] == EY_POINT_UNDER_CONTROL && plr->GetTeam() != m_PointOwnedByTeam[point])
this->EventTeamLostPoint(plr, point);
}
if(point == FEL_REAVER && m_PointOwnedByTeam[point] == plr->GetTeam()) // hack fix for Fel Reaver Ruins
{
if(m_FlagState && GetFlagPickerGUID() == plr->GetGUID())
if(plr->GetDistance2d(2044.0f,1730.0f) < 7.0f)
EventPlayerCapturedFlag(plr, BG_EY_OBJECT_FLAG_FEL_REAVER);
}
}
}
}
}
示例11: if
void BattlegroundEY::UpdatePointStatuses()
{
for (uint8 point = 0; point < EY_POINTS_MAX; ++point)
{
if (m_PlayersNearPoint[point].empty())
continue;
// Count new point bar status:
m_PointBarStatus[point] += (m_CurrentPointPlayersCount[2 * point] - m_CurrentPointPlayersCount[2 * point + 1] < BG_EY_POINT_MAX_CAPTURERS_COUNT) ? m_CurrentPointPlayersCount[2 * point] - m_CurrentPointPlayersCount[2 * point + 1] : BG_EY_POINT_MAX_CAPTURERS_COUNT;
if (m_PointBarStatus[point] > BG_EY_PROGRESS_BAR_ALI_CONTROLLED) // Point is full Alliance.
m_PointBarStatus[point] = BG_EY_PROGRESS_BAR_ALI_CONTROLLED;
if (m_PointBarStatus[point] < BG_EY_PROGRESS_BAR_HORDE_CONTROLLED) // Point is full Horde.
m_PointBarStatus[point] = BG_EY_PROGRESS_BAR_HORDE_CONTROLLED;
uint32 pointOwnerTeamId = 0;
// Find which team should own this point.
if (m_PointBarStatus[point] <= BG_EY_PROGRESS_BAR_NEUTRAL_LOW)
pointOwnerTeamId = HORDE;
else if (m_PointBarStatus[point] >= BG_EY_PROGRESS_BAR_NEUTRAL_HIGH)
pointOwnerTeamId = ALLIANCE;
else
pointOwnerTeamId = EY_POINT_NO_OWNER;
for (uint8 i = 0; i < m_PlayersNearPoint[point].size(); ++i)
{
Player* player = ObjectAccessor::FindPlayer(m_PlayersNearPoint[point][i]);
if (player)
{
UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[point], player);
// If the point owner changed we must evoke the event!
if (pointOwnerTeamId != m_PointOwnedByTeam[point])
{
// The point was uncontrolled and the player is from the team which captured the point.
if (m_PointState[point] == EY_POINT_STATE_UNCONTROLLED && player->GetBGTeam() == pointOwnerTeamId)
this->EventTeamCapturedPoint(player, point);
// The point was under control andthe player isn't from the team which controlled it.
if (m_PointState[point] == EY_POINT_UNDER_CONTROL && player->GetBGTeam() != m_PointOwnedByTeam[point])
this->EventTeamLostPoint(player, point);
}
// Fix for Fel Reaver Ruins.
if (point == FEL_REAVER && m_PointOwnedByTeam[point] == player->GetBGTeam())
if (m_FlagState && GetFlagPickerGUID() == player->GetGUID())
if (player->GetDistance2d(2044.0f, 1730.0f) < 2.0f)
EventPlayerCapturedFlag(player, BG_EY_OBJECT_FLAG_FEL_REAVER);
}
}
}
}
示例12: switch
void BattlegroundTP::HandleAreaTrigger(Player* player, uint32 trigger)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
//uint32 SpellId = 0;
//uint64 buff_guid = 0;
switch (trigger)
{
case 5904: // Alliance Flag spawn
if (_flagState[TEAM_HORDE] && !_flagState[TEAM_ALLIANCE])
if (GetFlagPickerGUID(TEAM_HORDE) == player->GetGUID())
EventPlayerCapturedFlag(player);
break;
case 5905: // Horde Flag spawn
if (_flagState[TEAM_ALLIANCE] && !_flagState[TEAM_HORDE])
if (GetFlagPickerGUID(TEAM_ALLIANCE) == player->GetGUID())
EventPlayerCapturedFlag(player);
break;
case 5908: // Horde Tower
case 5909: // Twin Peak House big
case 5910: // Horde House
case 5911: // Twin Peak House small
case 5914: // Alliance Start right
case 5916: // Alliance Start
case 5917: // Alliance Start left
case 5918: // Horde Start
case 5920: // Horde Start Front entrance
case 5921: // Horde Start left Water channel
break;
default:
Battleground::HandleAreaTrigger(player, trigger);
break;
}
//if (buff_guid)
// HandleTriggerBuff(buff_guid, Source);
}
示例13: AddPoints
void BattleGroundEY::Update(uint32 diff)
{
BattleGround::Update(diff);
if (GetStatus() == STATUS_IN_PROGRESS)
{
m_PointAddingTimer -= diff;
if (m_PointAddingTimer <= 0)
{
m_PointAddingTimer = BG_EY_FPOINTS_TICK_TIME;
if (m_TeamPointsCount[BG_TEAM_ALLIANCE] > 0)
AddPoints(ALLIANCE, BG_EY_TickPoints[m_TeamPointsCount[BG_TEAM_ALLIANCE] - 1]);
if (m_TeamPointsCount[BG_TEAM_HORDE] > 0)
AddPoints(HORDE, BG_EY_TickPoints[m_TeamPointsCount[BG_TEAM_HORDE] - 1]);
}
if (m_FlagState == BG_EY_FLAG_STATE_WAIT_RESPAWN || m_FlagState == BG_EY_FLAG_STATE_ON_GROUND)
{
m_FlagsTimer -= diff;
if (m_FlagsTimer < 0)
{
m_FlagsTimer = 0;
if (m_FlagState == BG_EY_FLAG_STATE_WAIT_RESPAWN)
RespawnFlag(true);
else
RespawnFlagAfterDrop();
}
}
m_TowerCapCheckTimer -= diff;
if (m_TowerCapCheckTimer <= 0)
{
//check if player joined point
/*I used this order of calls, because although we will check if one player is in gameobject's distance 2 times
but we can count of players on current point in CheckSomeoneLeftPoint
*/
CheckSomeoneJoinedPoint();
//check if player left point
CheckSomeoneLeftPoint();
UpdatePointStatuses();
m_TowerCapCheckTimer = BG_EY_FPOINTS_TICK_TIME;
}
// areatrigger for Fel Reaver was removed? so:
if (m_FlagState)
if (Player* plr = sObjectMgr.GetPlayer(GetFlagPickerGUID()))
if (plr->GetDistance2d(2043.99f, 1729.91f) < 2)
if (m_PointState[BG_EY_NODE_FEL_REAVER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_FEL_REAVER] == plr->GetTeam())
EventPlayerCapturedFlag(plr, BG_EY_NODE_FEL_REAVER);
}
}
示例14: if
void BattlegroundEY::UpdatePointStatuses()
{
for (uint8 point = 0; point < EY_POINTS_MAX; ++point)
{
if (m_PlayersNearPoint[point].empty())
continue;
//count new point bar status:
m_PointBarStatus[point] += (m_CurrentPointPlayersCount[2 * point] - m_CurrentPointPlayersCount[2 * point + 1] < BG_EY_POINT_MAX_CAPTURERS_COUNT) ? m_CurrentPointPlayersCount[2 * point] - m_CurrentPointPlayersCount[2 * point + 1] : BG_EY_POINT_MAX_CAPTURERS_COUNT;
if (m_PointBarStatus[point] > BG_EY_PROGRESS_BAR_ALI_CONTROLLED)
//point is fully alliance's
m_PointBarStatus[point] = BG_EY_PROGRESS_BAR_ALI_CONTROLLED;
if (m_PointBarStatus[point] < BG_EY_PROGRESS_BAR_HORDE_CONTROLLED)
//point is fully horde's
m_PointBarStatus[point] = BG_EY_PROGRESS_BAR_HORDE_CONTROLLED;
uint32 pointOwnerTeamId = 0;
//find which team should own this point
if (m_PointBarStatus[point] <= BG_EY_PROGRESS_BAR_NEUTRAL_LOW)
pointOwnerTeamId = HORDE;
else if (m_PointBarStatus[point] >= BG_EY_PROGRESS_BAR_NEUTRAL_HIGH)
pointOwnerTeamId = ALLIANCE;
else
pointOwnerTeamId = EY_POINT_NO_OWNER;
for (uint8 i = 0; i < m_PlayersNearPoint[point].size(); ++i)
{
Player* player = ObjectAccessor::FindPlayer(m_PlayersNearPoint[point][i]);
if (player)
{
this->UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[point], player);
//if point owner changed we must evoke event!
if (pointOwnerTeamId != m_PointOwnedByTeam[point])
{
//point was uncontrolled and player is from team which captured point
if (m_PointState[point] == EY_POINT_STATE_UNCONTROLLED && player->GetTeam() == pointOwnerTeamId)
this->EventTeamCapturedPoint(player, point);
//point was under control and player isn't from team which controlled it
if (m_PointState[point] == EY_POINT_UNDER_CONTROL && player->GetTeam() != m_PointOwnedByTeam[point])
this->EventTeamLostPoint(player, point);
}
/// @workaround The original AreaTrigger is covered by a bigger one and not triggered on client side.
if (point == FEL_REAVER && m_PointOwnedByTeam[point] == player->GetTeam())
if (m_FlagState && GetFlagPickerGUID() == player->GetGUID())
if (player->GetDistance(2044.0f, 1729.729f, 1190.03f) < 3.0f)
EventPlayerCapturedFlag(player, BG_EY_OBJECT_FLAG_FEL_REAVER);
}
}
}
}
示例15: EventPlayerCapturedFlag
void BattleGroundEY::EventPlayerCapturedFlag(Player *Source, uint32 BgObjectType)
{
if(GetStatus() != STATUS_IN_PROGRESS || GetFlagPickerGUID() != Source->GetGUID())
return;
uint8 type = 0;
uint8 team_id = 0;
const char *message = "";
SetFlagPicker(0);
m_FlagState = BG_EY_FLAG_STATE_WAIT_RESPAWN;
Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
if(Source->GetTeam() == ALLIANCE)
{
PlaySoundToAll(BG_EY_SOUND_FLAG_CAPTURED_ALLIANCE);
team_id = BG_TEAM_ALLIANCE;
message = GetMangosString(LANG_BG_EY_CAPTURED_FLAG_A);
type = CHAT_MSG_BG_SYSTEM_ALLIANCE;
}
else
{
PlaySoundToAll(BG_EY_SOUND_FLAG_CAPTURED_HORDE);
team_id = BG_TEAM_HORDE;
message = GetMangosString(LANG_BG_EY_CAPTURED_FLAG_H);
type = CHAT_MSG_BG_SYSTEM_HORDE;
}
SpawnBGObject(BgObjectType, RESPAWN_IMMEDIATELY);
m_FlagsTimer = BG_EY_FLAG_RESPAWN_TIME;
m_FlagCapturedBgObjectType = BgObjectType;
WorldPacket data;
ChatHandler::FillMessageData(&data, Source->GetSession(), type, LANG_UNIVERSAL, NULL, Source->GetGUID(), message, NULL);
SendPacketToAll(&data);
if(m_TeamPointsCount[team_id] > 0)
AddPoints(Source->GetTeam(), BG_EY_FlagPoints[m_TeamPointsCount[team_id] - 1]);
UpdatePlayerScore(Source, SCORE_FLAG_CAPTURES, 1);
}