void Arena::OnStart() { /* remove arena readyness buff */ for(uint32 i = 0; i < 2; ++i) { for(set<PlayerPointer >::iterator itr = m_players[i].begin(); itr != m_players[i].end(); ++itr) { PlayerPointer plr = *itr; plr->RemoveAura(ARENA_PREPARATION); } } /* open gates */ for(set< GameObjectPointer >::iterator itr = m_gates.begin(); itr != m_gates.end(); ++itr) { (*itr)->SetUInt32Value(GAMEOBJECT_FLAGS, 64); (*itr)->SetByte(GAMEOBJECT_BYTES_1,GAMEOBJECT_BYTES_STATE, 0); } m_started = true; /* Incase all players left */ UpdatePlayerCounts(); // soundz! PlaySoundToAll(SOUND_BATTLEGROUND_BEGIN); sEventMgr.RemoveEvents(shared_from_this(), EVENT_ARENA_SHADOW_SIGHT); sEventMgr.AddEvent(TO_CBATTLEGROUND(shared_from_this()), &CBattleground::HookOnShadowSight, EVENT_ARENA_SHADOW_SIGHT, 90000, 1,0); }
void Arena::OnRemovePlayer(PlayerPointer plr) { /* remove arena readyness buff */ plr->m_deathVision = false; if( plr->m_isGmInvisible ) return; plr->RemoveAura(ARENA_PREPARATION); /* plr left arena, call HookOnPlayerDeath as if he died */ HookOnPlayerDeath(plr); plr->RemoveAura(32724+plr->m_bgTeam); plr->RemoveFFAPvPFlag(); plr->m_bgRatedQueue = false; }
void AreatriggerHook(PlayerPointer pPlayer, uint32 triggerID) { if(!pPlayer) return; if(triggerID == ALLIANCE_RETURN || triggerID == HORDE_RETURN) { if(pPlayer->HasAura(SILITHYST_SPELL)) // if we doesn't have it, do nothing { pPlayer->RemoveAura(SILITHYST_SPELL); /* Rewards */ pPlayer->CastSpell(pPlayer, TRACES_OF_SILITHYST, true); pPlayer->m_honorPoints += REWARD_HONOR; pPlayer->ModStanding(REWARD_REPUTATION_FACTION, REWARD_REPUTATION_VALUE); uint32 quest = pPlayer->GetTeam() == ALLIANCE ? ALLIANCE_SILITHYST_QUEST : HORDE_SILITHYST_QUEST; QuestLogEntry* qle = pPlayer->GetQuestLogForEntry(quest); if(qle) qle->SendQuestComplete(); /***********/ if(locked) return; silithyst_gathered[ pPlayer->GetTeam() ]++; uint32 worldstate = pPlayer->GetTeam() == ALLIANCE ? WORLDSTATE_SILITHUS_GATHERED_ALLIANCE : WORLDSTATE_SILITHUS_GATHERED_HORDE; pPlayer->GetMapMgr()->GetStateManager().UpdateWorldState(worldstate , silithyst_gathered[ pPlayer->GetTeam() ]); if(silithyst_gathered[ pPlayer->GetTeam() ] >= SILITHYST_MAX) { locked = true; // we win, so opposite team must wait for server restart winners = pPlayer->GetTeam(); pPlayer->GetMapMgr()->CastSpellOnPlayers(winners, CENARION_FAVOR); pPlayer->GetMapMgr()->RemovePositiveAuraFromPlayers(winners == ALLIANCE ? HORDE : ALLIANCE, CENARION_FAVOR); } } } }
void ArathiBasin::OnRemovePlayer(PlayerPointer plr) { plr->RemoveAura(BG_PREPARATION); }