//La funzione iswatcher mi dice se un player sta spectando, ovvero se appartiene alla arenawatcher map bool IsWatcher(uint32 guid) { ArenaWatcherMap::iterator itr = ArenaWatcherPlayers.find(guid); if (itr != ArenaWatcherPlayers.end()) return true; return false; }
void ArenaWatcherEnd(Player* player) { uint32 guid = player->GetGUIDLow(); if (!IsWatcher(guid)) return; if (ArenaWatcherSilence) player->GetSession()->m_muteTime = ArenaWatcherPlayers[guid].mutetime; ArenaWatcherMap::iterator itr = ArenaWatcherPlayers.find(guid); if (itr != ArenaWatcherPlayers.end()) { ArenaWatcherPlayers.erase(itr); player->ResurrectPlayer(100.0f, false); player->SetGMVisible(true); player->SetGameMaster(false); player->SetAcceptWhispers(true); //player->SendMovementSetCanFly(false); //player->SetDisableGravity(false); player->SetCanFly(false); player->SetSpeed(MOVE_WALK, 1.0f, true); player->SetSpeed(MOVE_RUN, 1.0f, true); player->SetSpeed(MOVE_SWIM, 1.0f, true); player->SetSpeed(MOVE_FLIGHT, 1.0f, true); } }
void ArenaWatcherEnd(Player* player) { if(player){ uint32 guid = player->GetGUIDLow(); // Se sono un watcher, ripristino il mio stato normale dopo essere stato teletrasportato fuori dall'arena ArenaWatcherMap::iterator itr = ArenaWatcherPlayers.find(guid); if (itr != ArenaWatcherPlayers.end()) { // Eseguo prima i re-setup con le variabili salvate dentro alla mappa if (ArenaWatcherSilence) player->GetSession()->m_muteTime = ArenaWatcherPlayers[guid].mutetime; player->setFaction(ArenaWatcherPlayers[guid].faction); // Cancello l'occorrenza nella mappa ArenaWatcherPlayers.erase(itr); // Operazioni di riabilitazione player player->ResurrectPlayer(100.0f, false); player->SetAcceptWhispers(true); player->RemoveUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); player->SetSpeed(MOVE_WALK, 1.0f, true); player->SetSpeed(MOVE_RUN, 1.0f, true); player->SetSpeed(MOVE_SWIM, 1.0f, true); player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED ); player->SetVisible(true); player->SetSpectator(false); } } }
void OnConfigLoad(bool reload) { ArenaWatcherEnable = sConfigMgr->GetBoolDefault("ArenaWatcher.Enable", false); ArenaWatcherOnlyGM = sConfigMgr->GetBoolDefault("ArenaWatcher.OnlyGM", false); ArenaWatcherOnlyRated = sConfigMgr->GetBoolDefault("ArenaWatcher.OnlyRated", false); ArenaWatcherToPlayers = sConfigMgr->GetBoolDefault("ArenaWatcher.ToPlayers", false); ArenaWatcherSilence = sConfigMgr->GetBoolDefault("ArenaWatcher.Silence", false); ArenaWatcherFly = sConfigMgr->GetBoolDefault("ArenaWatcher.Fly", false); ArenaWatcherSpeed = sConfigMgr->GetFloatDefault("ArenaWatcher.Speed", 3.0f); if (!reload) ArenaWatcherPlayers.clear(); }
void OnConfigLoad(bool reload) { sLog->outInfo(LOG_FILTER_WORLDSERVER,"Loading Sceicco's Arena System Watcher..."); ArenaWatcherEnable = ConfigMgr::GetBoolDefault("ArenaWatcher.Enable", true); ArenaWatcherOnlyGM = ConfigMgr::GetBoolDefault("ArenaWatcher.OnlyGM", false); ArenaWatcherOnlyRated = ConfigMgr::GetBoolDefault("ArenaWatcher.OnlyRated", false); ArenaWatcherToPlayers = ConfigMgr::GetBoolDefault("ArenaWatcher.ToPlayers", true); ArenaWatcherSilence = ConfigMgr::GetBoolDefault("ArenaWatcher.Silence", false); ArenaWatcherSpeed = ConfigMgr::GetFloatDefault("ArenaWatcher.Speed", 3.0f); if (!reload) ArenaWatcherPlayers.clear(); }