diff options
author | Spp <spp@jorge.gr> | 2012-11-26 08:43:29 +0100 |
---|---|---|
committer | Spp <spp@jorge.gr> | 2012-11-26 08:43:29 +0100 |
commit | 8ae0f2332c9f3d34f602acdaeb5409d9cb56ab79 (patch) | |
tree | 5afe17de42ae9399c730cccfaa876608f84b69ba /src | |
parent | fdf0c32857c804701e7a25b27e59b11f2a306116 (diff) | |
parent | 941be9cdc473713f97ad505114bcb32f7e3350ef (diff) |
Merge branch 'master' into 4.3.4
Conflicts:
src/server/game/Battlefield/Zones/BattlefieldWG.cpp
src/server/game/Conditions/ConditionMgr.cpp
src/server/game/Entities/Unit/Unit.cpp
src/server/game/Server/WorldSession.cpp
src/server/game/Server/WorldSocket.cpp
src/server/game/Spells/SpellEffects.cpp
src/server/scripts/EasternKingdoms/stormwind_city.cpp
src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp
src/server/scripts/Kalimdor/azshara.cpp
Diffstat (limited to 'src')
58 files changed, 1372 insertions, 1424 deletions
diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index dc7d7caaf19..0352a87351a 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -3189,7 +3189,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements() if (!result) { - sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 completed achievements. DB table `character_achievement` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 realm first completed achievements. DB table `character_achievement` is empty."); return; } @@ -3215,7 +3215,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu completed achievements in %u ms", (unsigned long)m_allCompletedAchievements.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu realm first completed achievements in %u ms", (unsigned long)m_allCompletedAchievements.size(), GetMSTimeDiffToNow(oldMSTime)); } void AchievementGlobalMgr::LoadRewards() diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index 968e1eea7f1..b0ad965f310 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -465,10 +465,9 @@ WorldPacket Battlefield::BuildWarningAnnPacket(std::string const& msg) void Battlefield::SendWarningToAllInZone(uint32 entry) { - if (Unit* unit = sObjectAccessor->FindUnit(StalkerGuid)) - if (Creature* stalker = unit->ToCreature()) - // FIXME: replaced CHAT_TYPE_END with CHAT_MSG_BG_SYSTEM_NEUTRAL to fix compile, it's a guessed change :/ - sCreatureTextMgr->SendChat(stalker, (uint8) entry, 0, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_ADDON, TEXT_RANGE_ZONE); + if (Creature* stalker = GetCreature(StalkerGuid)) + // FIXME: replaced CHAT_TYPE_END with CHAT_MSG_BG_SYSTEM_NEUTRAL to fix compile, it's a guessed change :/ + sCreatureTextMgr->SendChat(stalker, (uint8) entry, 0, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_ADDON, TEXT_RANGE_ZONE); } /*void Battlefield::SendWarningToAllInWar(int32 entry,...) @@ -488,9 +487,8 @@ void Battlefield::SendWarningToAllInZone(uint32 entry) void Battlefield::SendWarningToPlayer(Player* player, uint32 entry) { if (player) - if (Unit* unit = sObjectAccessor->FindUnit(StalkerGuid)) - if (Creature* stalker = unit->ToCreature()) - sCreatureTextMgr->SendChat(stalker, (uint8)entry, player->GetGUID()); + if (Creature* stalker = GetCreature(StalkerGuid)) + sCreatureTextMgr->SendChat(stalker, (uint8)entry, player->GetGUID()); } void Battlefield::SendUpdateWorldState(uint32 field, uint32 value) @@ -743,7 +741,7 @@ void BfGraveyard::Resurrect() // Check if the player is in world and on the good graveyard if (player->IsInWorld()) - if (Unit* spirit = sObjectAccessor->FindUnit(m_SpiritGuide[m_ControlTeam])) + if (Creature* spirit = m_Bf->GetCreature(m_SpiritGuide[m_ControlTeam])) spirit->CastSpell(spirit, SPELL_SPIRIT_HEAL, true); // Resurect player @@ -793,6 +791,18 @@ void BfGraveyard::RelocateDeadPlayers() } } +bool BfGraveyard::HasNpc(uint64 guid) +{ + if (!m_SpiritGuide[0] || !m_SpiritGuide[1]) + return false; + + if (!m_Bf->GetCreature(m_SpiritGuide[0]) || + !m_Bf->GetCreature(m_SpiritGuide[1])) + return false; + + return (m_SpiritGuide[0] == guid || m_SpiritGuide[1] == guid); +} + // ******************************************************* // *************** End Spirit Guide system *************** // ******************************************************* @@ -866,11 +876,25 @@ GameObject* Battlefield::SpawnGameObject(uint32 entry, float x, float y, float z return go; } +Creature* Battlefield::GetCreature(uint64 GUID) +{ + if (!m_Map) + return NULL; + return m_Map->GetCreature(GUID); +} + +GameObject* Battlefield::GetGameObject(uint64 GUID) +{ + if (!m_Map) + return NULL; + return m_Map->GetGameObject(GUID); +} + // ******************************************************* // ******************* CapturePoint ********************** // ******************************************************* -BfCapturePoint::BfCapturePoint(Battlefield* battlefield) : m_Bf(battlefield), m_capturePoint(NULL) +BfCapturePoint::BfCapturePoint(Battlefield* battlefield) : m_Bf(battlefield), m_capturePointGUID(0) { m_team = TEAM_NEUTRAL; m_value = 0; @@ -885,19 +909,24 @@ BfCapturePoint::BfCapturePoint(Battlefield* battlefield) : m_Bf(battlefield), m_ bool BfCapturePoint::HandlePlayerEnter(Player* player) { - if (m_capturePoint) + if (m_capturePointGUID) { - player->SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldState1, 1); - player->SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldstate2, uint32(ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f))); - player->SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldstate3, m_neutralValuePct); + if (GameObject* capturePoint = m_Bf->GetGameObject(m_capturePointGUID)) + { + player->SendUpdateWorldState(capturePoint->GetGOInfo()->capturePoint.worldState1, 1); + player->SendUpdateWorldState(capturePoint->GetGOInfo()->capturePoint.worldstate2, uint32(ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f))); + player->SendUpdateWorldState(capturePoint->GetGOInfo()->capturePoint.worldstate3, m_neutralValuePct); + } } + return m_activePlayers[player->GetTeamId()].insert(player->GetGUID()).second; } GuidSet::iterator BfCapturePoint::HandlePlayerLeave(Player* player) { - if (m_capturePoint) - player->SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldState1, 0); + if (m_capturePointGUID) + if (GameObject* capturePoint = m_Bf->GetGameObject(m_capturePointGUID)) + player->SendUpdateWorldState(capturePoint->GetGOInfo()->capturePoint.worldState1, 0); GuidSet::iterator current = m_activePlayers[player->GetTeamId()].find(player->GetGUID()); @@ -910,15 +939,18 @@ GuidSet::iterator BfCapturePoint::HandlePlayerLeave(Player* player) void BfCapturePoint::SendChangePhase() { - if (!m_capturePoint) + if (!m_capturePointGUID) return; - - // send this too, sometimes the slider disappears, dunno why :( - SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldState1, 1); - // send these updates to only the ones in this objective - SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldstate2, (uint32) ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f)); - // send this too, sometimes it resets :S - SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldstate3, m_neutralValuePct); + + if (GameObject* capturePoint = m_Bf->GetGameObject(m_capturePointGUID)) + { + // send this too, sometimes the slider disappears, dunno why :( + SendUpdateWorldState(capturePoint->GetGOInfo()->capturePoint.worldState1, 1); + // send these updates to only the ones in this objective + SendUpdateWorldState(capturePoint->GetGOInfo()->capturePoint.worldstate2, (uint32) ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f)); + // send this too, sometimes it resets :S + SendUpdateWorldState(capturePoint->GetGOInfo()->capturePoint.worldstate3, m_neutralValuePct); + } } bool BfCapturePoint::SetCapturePointData(GameObject* capturePoint) @@ -927,7 +959,7 @@ bool BfCapturePoint::SetCapturePointData(GameObject* capturePoint) sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Creating capture point %u", capturePoint->GetEntry()); - m_capturePoint = capturePoint; + m_capturePointGUID = MAKE_NEW_GUID(capturePoint->GetGUIDLow(), capturePoint->GetEntry(), HIGHGUID_GAMEOBJECT); // check info existence GameObjectTemplate const* goinfo = capturePoint->GetGOInfo(); @@ -957,13 +989,22 @@ bool BfCapturePoint::SetCapturePointData(GameObject* capturePoint) return true; } +GameObject* BfCapturePoint::GetCapturePointGo() +{ + return m_Bf->GetGameObject(m_capturePointGUID); +} + bool BfCapturePoint::DelCapturePoint() { - if (m_capturePoint) + if (m_capturePointGUID) { - m_capturePoint->SetRespawnTime(0); // not save respawn time - m_capturePoint->Delete(); - m_capturePoint = NULL; + if (GameObject* capturePoint = m_Bf->GetGameObject(m_capturePointGUID)) + { + capturePoint->SetRespawnTime(0); // not save respawn time + capturePoint->Delete(); + capturePoint = NULL; + } + m_capturePointGUID = 0; } return true; @@ -971,37 +1012,40 @@ bool BfCapturePoint::DelCapturePoint() bool BfCapturePoint::Update(uint32 diff) { - if (!m_capturePoint) + if (!m_capturePointGUID) return false; - float radius = m_capturePoint->GetGOInfo()->capturePoint.radius; - - for (uint8 team = 0; team < 2; ++team) + if (GameObject* capturePoint = m_Bf->GetGameObject(m_capturePointGUID)) { - for (GuidSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end();) + float radius = capturePoint->GetGOInfo()->capturePoint.radius; + + for (uint8 team = 0; team < 2; ++team) { - if (Player* player = sObjectAccessor->FindPlayer(*itr)) + for (GuidSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end();) { - if (!m_capturePoint->IsWithinDistInMap(player, radius) || !player->IsOutdoorPvPActive()) - itr = HandlePlayerLeave(player); + if (Player* player = sObjectAccessor->FindPlayer(*itr)) + { + if (!capturePoint->IsWithinDistInMap(player, radius) || !player->IsOutdoorPvPActive()) + itr = HandlePlayerLeave(player); + else + ++itr; + } else ++itr; } - else - ++itr; } - } - - std::list<Player*> players; - Trinity::AnyPlayerInObjectRangeCheck checker(m_capturePoint, radius); - Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(m_capturePoint, players, checker); - m_capturePoint->VisitNearbyWorldObject(radius, searcher); - - for (std::list<Player*>::iterator itr = players.begin(); itr != players.end(); ++itr) - if ((*itr)->IsOutdoorPvPActive()) - if (m_activePlayers[(*itr)->GetTeamId()].insert((*itr)->GetGUID()).second) - HandlePlayerEnter(*itr); + std::list<Player*> players; + Trinity::AnyPlayerInObjectRangeCheck checker(capturePoint, radius); + Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(capturePoint, players, checker); + capturePoint->VisitNearbyWorldObject(radius, searcher); + + for (std::list<Player*>::iterator itr = players.begin(); itr != players.end(); ++itr) + if ((*itr)->IsOutdoorPvPActive()) + if (m_activePlayers[(*itr)->GetTeamId()].insert((*itr)->GetGUID()).second) + HandlePlayerEnter(*itr); + } + // get the difference of numbers float fact_diff = ((float) m_activePlayers[0].size() - (float) m_activePlayers[1].size()) * diff / BATTLEFIELD_OBJECTIVE_UPDATE_INTERVAL; if (G3D::fuzzyEq(fact_diff, 0.0f)) diff --git a/src/server/game/Battlefield/Battlefield.h b/src/server/game/Battlefield/Battlefield.h index bcadc877eea..f17a7666d67 100644 --- a/src/server/game/Battlefield/Battlefield.h +++ b/src/server/game/Battlefield/Battlefield.h @@ -104,8 +104,9 @@ class BfCapturePoint virtual void SendChangePhase(); bool SetCapturePointData(GameObject* capturePoint); - GameObject* GetCapturePointGo() { return m_capturePoint; } - + GameObject* GetCapturePointGo(); + uint32 GetCapturePointEntry(){ return m_capturePointEntry; } + TeamId GetTeamId() { return m_team; } protected: bool DelCapturePoint(); @@ -138,7 +139,7 @@ class BfCapturePoint uint32 m_capturePointEntry; // Gameobject related to that capture point - GameObject* m_capturePoint; + uint64 m_capturePointGUID; }; class BfGraveyard @@ -172,17 +173,7 @@ class BfGraveyard void RelocateDeadPlayers(); // Check if this graveyard has a spirit guide - bool HasNpc(uint64 guid) - { - if (!m_SpiritGuide[0] || !m_SpiritGuide[1]) - return false; - - if (!sObjectAccessor->FindUnit(m_SpiritGuide[0]) || - !sObjectAccessor->FindUnit(m_SpiritGuide[1])) - return false; - - return (m_SpiritGuide[0] == guid || m_SpiritGuide[1] == guid); - } + bool HasNpc(uint64 guid); // Check if a player is in this graveyard's ressurect queue bool HasPlayer(uint64 guid) { return m_ResurrectQueue.find(guid) != m_ResurrectQueue.end(); } @@ -301,6 +292,9 @@ class Battlefield : public ZoneScript Creature* SpawnCreature(uint32 entry, Position pos, TeamId team); GameObject* SpawnGameObject(uint32 entry, float x, float y, float z, float o); + Creature* GetCreature(uint64 GUID); + GameObject* GetGameObject(uint64 GUID); + // Script-methods /// Called on start @@ -381,6 +375,7 @@ class Battlefield : public ZoneScript uint32 m_BattleId; // BattleID (for packet) uint32 m_ZoneId; // ZoneID of Wintergrasp = 4197 uint32 m_MapId; // MapId where is Battlefield + Map* m_Map; uint32 m_MaxPlayer; // Maximum number of player that participated to Battlefield uint32 m_MinPlayer; // Minimum number of player for Battlefield start uint32 m_MinLevel; // Required level to participate at Battlefield @@ -416,7 +411,7 @@ class Battlefield : public ZoneScript void BroadcastPacketToWar(WorldPacket& data) const; // CapturePoint system - void AddCapturePoint(BfCapturePoint* cp) { m_capturePoints[cp->GetCapturePointGo()->GetEntry()] = cp; } + void AddCapturePoint(BfCapturePoint* cp) { m_capturePoints[cp->GetCapturePointEntry()] = cp; } BfCapturePoint* GetCapturePoint(uint32 lowguid) const { diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index 0865df03d34..63f95e159af 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -22,6 +22,7 @@ #include "BattlefieldWG.h" #include "AchievementMgr.h" +#include "MapManager.h" #include "ObjectMgr.h" #include "Opcodes.h" #include "Player.h" @@ -55,6 +56,7 @@ bool BattlefieldWG::SetupBattlefield() m_BattleId = BATTLEFIELD_BATTLEID_WG; m_ZoneId = BATTLEFIELD_WG_ZONEID; m_MapId = BATTLEFIELD_WG_MAPID; + m_Map = sMapMgr->FindMap(m_MapId, 0); m_MaxPlayer = sWorld->getIntConfig(CONFIG_WINTERGRASP_PLR_MAX); m_IsEnabled = sWorld->getBoolConfig(CONFIG_WINTERGRASP_ENABLE); @@ -142,9 +144,8 @@ bool BattlefieldWG::SetupBattlefield() // Hide NPCs from the Attacker's team in the keep for (GuidSet::const_iterator itr = KeepCreature[GetAttackerTeam()].begin(); itr != KeepCreature[GetAttackerTeam()].end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - HideNpc(creature); + if (Creature* creature = GetCreature(*itr)) + HideNpc(creature); // Spawn Horde NPCs outside the keep for (uint8 i = 0; i < WG_OUTSIDE_ALLIANCE_NPC; i++) @@ -158,9 +159,8 @@ bool BattlefieldWG::SetupBattlefield() // Hide units outside the keep that are defenders for (GuidSet::const_iterator itr = OutsideCreature[GetDefenderTeam()].begin(); itr != OutsideCreature[GetDefenderTeam()].end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - HideNpc(creature); + if (Creature* creature = GetCreature(*itr)) + HideNpc(creature); // Spawn turrets and hide them per default for (uint8 i = 0; i < WG_MAX_TURRET; i++) @@ -177,20 +177,24 @@ bool BattlefieldWG::SetupBattlefield() // Spawn all gameobjects for (uint8 i = 0; i < WG_MAX_OBJ; i++) { - GameObject* go = SpawnGameObject(WGGameObjectBuilding[i].entry, WGGameObjectBuilding[i].x, WGGameObjectBuilding[i].y, WGGameObjectBuilding[i].z, WGGameObjectBuilding[i].o); - BfWGGameObjectBuilding* b = new BfWGGameObjectBuilding(this); - b->Init(go, WGGameObjectBuilding[i].type, WGGameObjectBuilding[i].WorldState, WGGameObjectBuilding[i].nameId); - if (!IsEnabled() && go->GetEntry() == GO_WINTERGRASP_VAULT_GATE) - go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); - BuildingsInZone.insert(b); + if (GameObject* go = SpawnGameObject(WGGameObjectBuilding[i].entry, WGGameObjectBuilding[i].x, WGGameObjectBuilding[i].y, WGGameObjectBuilding[i].z, WGGameObjectBuilding[i].o)) + { + BfWGGameObjectBuilding* b = new BfWGGameObjectBuilding(this); + b->Init(go, WGGameObjectBuilding[i].type, WGGameObjectBuilding[i].WorldState, WGGameObjectBuilding[i].nameId); + if (!IsEnabled() && go->GetEntry() == GO_WINTERGRASP_VAULT_GATE) + go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); + BuildingsInZone.insert(b); + } } // Spawning portal defender for (uint8 i = 0; i < WG_MAX_TELEPORTER; i++) { - GameObject* go = SpawnGameObject(WGPortalDefenderData[i].entry, WGPortalDefenderData[i].x, WGPortalDefenderData[i].y, WGPortalDefenderData[i].z, WGPortalDefenderData[i].o); - DefenderPortalList.insert(go); - go->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[GetDefenderTeam()]); + if (GameObject* go = SpawnGameObject(WGPortalDefenderData[i].entry, WGPortalDefenderData[i].x, WGPortalDefenderData[i].y, WGPortalDefenderData[i].z, WGPortalDefenderData[i].o)) + { + DefenderPortalList.insert(go->GetGUID()); + go->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[GetDefenderTeam()]); + } } UpdateCounterVehicle(true); @@ -216,13 +220,13 @@ bool BattlefieldWG::Update(uint32 diff) void BattlefieldWG::OnBattleStart() { // Spawn titan relic - m_titansRelic = SpawnGameObject(GO_WINTERGRASP_TITAN_S_RELIC, 5440.0f, 2840.8f, 430.43f, 0); - if (m_titansRelic) + if (GameObject* relic = SpawnGameObject(GO_WINTERGRASP_TITAN_S_RELIC, 5440.0f, 2840.8f, 430.43f, 0)) { // Update faction of relic, only attacker can click on - m_titansRelic->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[GetAttackerTeam()]); + relic->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[GetAttackerTeam()]); // Set in use (not allow to click on before last door is broken) - m_titansRelic->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); + relic->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); + m_titansRelicGUID = relic->GetGUID(); } else sLog->outError(LOG_FILTER_BATTLEFIELD, "WG: Failed to spawn titan relic."); @@ -231,13 +235,10 @@ void BattlefieldWG::OnBattleStart() // Update tower visibility and update faction for (GuidSet::const_iterator itr = CanonList.begin(); itr != CanonList.end(); ++itr) { - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) + if (Creature* creature = GetCreature(*itr)) { - if (Creature* creature = unit->ToCreature()) - { - ShowNpc(creature, true); - creature->setFaction(WintergraspFaction[GetDefenderTeam()]); - } + ShowNpc(creature, true); + creature->setFaction(WintergraspFaction[GetDefenderTeam()]); } } @@ -307,21 +308,19 @@ void BattlefieldWG::UpdateCounterVehicle(bool init) void BattlefieldWG::OnBattleEnd(bool endByTimer) { // Remove relic - if (m_titansRelic) - m_titansRelic->RemoveFromWorld(); - m_titansRelic = NULL; + if (m_titansRelicGUID) + if (GameObject* relic = GetGameObject(m_titansRelicGUID)) + relic->RemoveFromWorld(); + m_titansRelicGUID = 0; // Remove turret for (GuidSet::const_iterator itr = CanonList.begin(); itr != CanonList.end(); ++itr) { - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) + if (Creature* creature = GetCreature(*itr)) { - if (Creature* creature = unit->ToCreature()) - { - if (!endByTimer) - creature->setFaction(WintergraspFaction[GetDefenderTeam()]); - HideNpc(creature); - } + if (!endByTimer) + creature->setFaction(WintergraspFaction[GetDefenderTeam()]); + HideNpc(creature); } } @@ -329,25 +328,21 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer) { // Change all npc in keep for (GuidSet::const_iterator itr = KeepCreature[GetAttackerTeam()].begin(); itr != KeepCreature[GetAttackerTeam()].end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - HideNpc(creature); + if (Creature* creature = GetCreature(*itr)) + HideNpc(creature); for (GuidSet::const_iterator itr = KeepCreature[GetDefenderTeam()].begin(); itr != KeepCreature[GetDefenderTeam()].end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - ShowNpc(creature, true); + if (Creature* creature = GetCreature(*itr)) + ShowNpc(creature, true); // Change all npc out of keep for (GuidSet::const_iterator itr = OutsideCreature[GetDefenderTeam()].begin(); itr != OutsideCreature[GetDefenderTeam()].end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - HideNpc(creature); + if (Creature* creature = GetCreature(*itr)) + HideNpc(creature); for (GuidSet::const_iterator itr = OutsideCreature[GetAttackerTeam()].begin(); itr != OutsideCreature[GetAttackerTeam()].end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - ShowNpc(creature, true); + if (Creature* creature = GetCreature(*itr)) + ShowNpc(creature, true); } // Update all graveyard, control is to defender when no wartime @@ -355,15 +350,18 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer) if (BfGraveyard* graveyard = GetGraveyardById(i)) graveyard->GiveControlTo(GetDefenderTeam()); - for (GameObjectSet::const_iterator itr = m_KeepGameObject[GetDefenderTeam()].begin(); itr != m_KeepGameObject[GetDefenderTeam()].end(); ++itr) - (*itr)->SetRespawnTime(RESPAWN_IMMEDIATELY); + for (GuidSet::const_iterator itr = m_KeepGameObject[GetDefenderTeam()].begin(); itr != m_KeepGameObject[GetDefenderTeam()].end(); ++itr) + if (GameObject* object = GetGameObject(*itr)) + object->SetRespawnTime(RESPAWN_IMMEDIATELY); - for (GameObjectSet::const_iterator itr = m_KeepGameObject[GetAttackerTeam()].begin(); itr != m_KeepGameObject[GetAttackerTeam()].end(); ++itr) - (*itr)->SetRespawnTime(RESPAWN_ONE_DAY); + for (GuidSet::const_iterator itr = m_KeepGameObject[GetAttackerTeam()].begin(); itr != m_KeepGameObject[GetAttackerTeam()].end(); ++itr) + if (GameObject* object = GetGameObject(*itr)) + object->SetRespawnTime(RESPAWN_ONE_DAY); // Update portal defender faction - for (GameObjectSet::const_iterator itr = DefenderPortalList.begin(); itr != DefenderPortalList.end(); ++itr) - (*itr)->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[GetDefenderTeam()]); + for (GuidSet::const_iterator itr = DefenderPortalList.begin(); itr != DefenderPortalList.end(); ++itr) + if (GameObject* portal = GetGameObject(*itr)) + portal->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[GetDefenderTeam()]); // Saving data for (GameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr) @@ -398,10 +396,9 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer) m_PlayersInWar[team].clear(); for (GuidSet::const_iterator itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - if (creature->IsVehicle()) - creature->GetVehicleKit()->Dismiss(); + if (Creature* creature = GetCreature(*itr)) + if (creature->IsVehicle()) + creature->GetVehicleKit()->Dismiss(); m_vehicles[team].clear(); } @@ -650,18 +647,15 @@ void BattlefieldWG::HandleKill(Player* killer, Unit* victim) for (GuidSet::const_iterator itr = KeepCreature[GetOtherTeam(killerTeam)].begin(); itr != KeepCreature[GetOtherTeam(killerTeam)].end(); ++itr) { - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) + if (Creature* creature = GetCreature(*itr)) { - if (Creature* creature = unit->ToCreature()) + if (victim->GetEntry() == creature->GetEntry() && !again) { - if (victim->GetEntry() == creature->GetEntry() && !again) - { - again = true; - for (GuidSet::const_iterator iter = m_PlayersInWar[killerTeam].begin(); iter != m_PlayersInWar[killerTeam].end(); ++iter) - if (Player* player = sObjectAccessor->FindPlayer(*iter)) - if (player->GetDistance2d(killer) < 40.0f) - PromotePlayer(player); - } + again = true; + for (GuidSet::const_iterator iter = m_PlayersInWar[killerTeam].begin(); iter != m_PlayersInWar[killerTeam].end(); ++iter) + if (Player* player = sObjectAccessor->FindPlayer(*iter)) + if (player->GetDistance2d(killer) < 40.0f) + PromotePlayer(player); } } } @@ -938,22 +932,25 @@ void BattlefieldWG::ProcessEvent(WorldObject *obj, uint32 eventId) { if (CanInteractWithRelic()) EndBattle(false); - else - GetRelic()->SetRespawnTime(RESPAWN_IMMEDIATELY); + else if (GameObject* relic = GetRelic()) + relic->SetRespawnTime(RESPAWN_IMMEDIATELY); } // if destroy or damage event, search the wall/tower and update worldstate/send warning message for (GameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr) { - if (go->GetEntry() == (*itr)->m_Build->GetEntry()) + if (GameObject* build = GetGameObject((*itr)->m_BuildGUID)) { - if ((*itr)->m_Build->GetGOInfo()->building.damagedEvent == eventId) - (*itr)->Damaged(); + if (go->GetEntry() == build->GetEntry()) + { + if (build->GetGOInfo()->building.damagedEvent == eventId) + (*itr)->Damaged(); - if ((*itr)->m_Build->GetGOInfo()->building.destroyedEvent == eventId) - (*itr)->Destroyed(); + if (build->GetGOInfo()->building.destroyedEvent == eventId) + (*itr)->Destroyed(); - break; + break; + } } } } @@ -1009,9 +1006,8 @@ void BattlefieldWG::UpdateTenacity() player->RemoveAurasDueToSpell(SPELL_TENACITY); for (GuidSet::const_iterator itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - creature->RemoveAurasDueToSpell(SPELL_TENACITY_VEHICLE); + if (Creature* creature = GetCreature(*itr)) + creature->RemoveAurasDueToSpell(SPELL_TENACITY_VEHICLE); } // Apply new buff @@ -1037,9 +1033,8 @@ void BattlefieldWG::UpdateTenacity() player->SetAuraStack(SPELL_TENACITY, player, newStack); for (GuidSet::const_iterator itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - creature->SetAuraStack(SPELL_TENACITY_VEHICLE, creature, newStack); + if (Creature* creature = GetCreature(*itr)) + creature->SetAuraStack(SPELL_TENACITY_VEHICLE, creature, newStack); if (buff_honor != 0) { @@ -1047,9 +1042,8 @@ void BattlefieldWG::UpdateTenacity() if (Player* player = sObjectAccessor->FindPlayer(*itr)) player->CastSpell(player, buff_honor, true); for (GuidSet::const_iterator itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - creature->CastSpell(creature, buff_honor, true); + if (Creature* creature = GetCreature(*itr)) + creature->CastSpell(creature, buff_honor, true); } } } diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index bd616167e8b..73ec858e965 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -383,10 +383,10 @@ class BattlefieldWG : public Battlefield bool SetupBattlefield(); /// Return pointer to relic object - GameObject* GetRelic() { return m_titansRelic; } + GameObject* GetRelic() { return GetGameObject(m_titansRelicGUID); } /// Define relic object - void SetRelic(GameObject* relic) { m_titansRelic = relic; } + void SetRelic(uint64 relicGUID) { m_titansRelicGUID = relicGUID; } /// Check if players can interact with the relic (Only if the last door has been broken) bool CanInteractWithRelic() { return m_isRelicInteractible; } @@ -420,8 +420,8 @@ class BattlefieldWG : public Battlefield Workshop WorkshopsList; - GameObjectSet DefenderPortalList; - GameObjectSet m_KeepGameObject[2]; + GuidSet DefenderPortalList; + GuidSet m_KeepGameObject[2]; GameObjectBuilding BuildingsInZone; GuidSet m_vehicles[2]; @@ -432,7 +432,7 @@ class BattlefieldWG : public Battlefield uint32 m_tenacityStack; uint32 m_saveTimer; - GameObject* m_titansRelic; + uint64 m_titansRelicGUID; }; uint32 const VehNumWorldState[] = { 3680, 3490 }; @@ -1065,7 +1065,7 @@ struct BfWGGameObjectBuilding { m_WG = WG; m_Team = 0; - m_Build = NULL; + m_BuildGUID = 0; m_Type = 0; m_WorldState = 0; m_State = 0; @@ -1079,7 +1079,7 @@ struct BfWGGameObjectBuilding BattlefieldWG* m_WG; // Linked gameobject - GameObject* m_Build; + uint64 m_BuildGUID; // eWGGameObjectBuildingType uint32 m_Type; @@ -1094,7 +1094,7 @@ struct BfWGGameObjectBuilding uint32 m_NameId; // GameObject associations - GameObjectSet m_GameObjectList[2]; + GuidSet m_GameObjectList[2]; // Creature associations GuidSet m_CreatureBottomList[2]; @@ -1120,20 +1120,23 @@ struct BfWGGameObjectBuilding break; } - // Rebuild gameobject - if (m_Build->IsDestructibleBuilding()) + if (GameObject* build = m_WG->GetGameObject(m_BuildGUID)) { - m_Build->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, NULL, true); - if (m_Build->GetEntry() == GO_WINTERGRASP_VAULT_GATE) - if (GameObject* go = m_Build->FindNearestGameObject(GO_WINTERGRASP_KEEP_COLLISION_WALL, 10.0f)) - go->EnableCollision(true); - - // Update worldstate - m_State = BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT - (m_Team * 3); - m_WG->SendUpdateWorldState(m_WorldState, m_State); + // Rebuild gameobject + if (build->IsDestructibleBuilding()) + { + build->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, NULL, true); + if (build->GetEntry() == GO_WINTERGRASP_VAULT_GATE) + if (GameObject* go = build->FindNearestGameObject(GO_WINTERGRASP_KEEP_COLLISION_WALL, 50.0f)) + go->EnableCollision(true); + + // Update worldstate + m_State = BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT - (m_Team * 3); + m_WG->SendUpdateWorldState(m_WorldState, m_State); + } + UpdateCreatureAndGo(); + build->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[m_Team]); } - UpdateCreatureAndGo(); - m_Build->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[m_Team]); } // Called when associated gameobject is damaged @@ -1148,14 +1151,12 @@ struct BfWGGameObjectBuilding m_WG->SendWarningToAllInZone(m_NameId); for (GuidSet::const_iterator itr = m_CreatureTopList[m_WG->GetAttackerTeam()].begin(); itr != m_CreatureTopList[m_WG->GetAttackerTeam()].end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - m_WG->HideNpc(creature); + if (Creature* creature = m_WG->GetCreature(*itr)) + m_WG->HideNpc(creature); for (GuidSet::const_iterator itr = m_TurretTopList.begin(); itr != m_TurretTopList.end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - m_WG->HideNpc(creature); + if (Creature* creature = m_WG->GetCreature(*itr)) + m_WG->HideNpc(creature); if (m_Type == BATTLEFIELD_WG_OBJECTTYPE_KEEP_TOWER) m_WG->UpdateDamagedTowerCount(m_WG->GetDefenderTeam()); @@ -1182,8 +1183,9 @@ struct BfWGGameObjectBuilding m_WG->UpdatedDestroyedTowerCount(TeamId(m_Team)); break; case BATTLEFIELD_WG_OBJECTTYPE_DOOR_LAST: - if (GameObject* go = m_Build->FindNearestGameObject(GO_WINTERGRASP_KEEP_COLLISION_WALL, 10.0f)) - go->EnableCollision(false); + if (GameObject* build = m_WG->GetGameObject(m_BuildGUID)) + if (GameObject* go = build->FindNearestGameObject(GO_WINTERGRASP_KEEP_COLLISION_WALL, 10.0f)) + go->EnableCollision(false); m_WG->SetRelicInteractible(true); if (m_WG->GetRelic()) m_WG->GetRelic()->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); @@ -1197,8 +1199,11 @@ struct BfWGGameObjectBuilding void Init(GameObject* go, uint32 type, uint32 worldstate, uint32 nameid) { + if (!go) + return; + // GameObject associated to object - m_Build = go; + m_BuildGUID = go->GetGUID(); // Type of building (WALL/TOWER/DOOR) m_Type = type; @@ -1226,23 +1231,20 @@ struct BfWGGameObjectBuilding } m_State = sWorld->getWorldState(m_WorldState); - if (m_Build) + switch (m_State) { - switch (m_State) - { - case BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT: - case BATTLEFIELD_WG_OBJECTSTATE_HORDE_INTACT: - m_Build->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, NULL, true); - break; - case BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_DESTROY: - case BATTLEFIELD_WG_OBJECTSTATE_HORDE_DESTROY: - m_Build->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); - break; - case BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_DAMAGE: - case BATTLEFIELD_WG_OBJECTSTATE_HORDE_DAMAGE: - m_Build->SetDestructibleState(GO_DESTRUCTIBLE_DAMAGED); - break; - } + case BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT: + case BATTLEFIELD_WG_OBJECTSTATE_HORDE_INTACT: + go->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, NULL, true); + break; + case BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_DESTROY: + case BATTLEFIELD_WG_OBJECTSTATE_HORDE_DESTROY: + go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); + break; + case BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_DAMAGE: + case BATTLEFIELD_WG_OBJECTSTATE_HORDE_DAMAGE: + go->SetDestructibleState(GO_DESTRUCTIBLE_DAMAGED); + break; } int32 towerid = -1; @@ -1278,9 +1280,9 @@ struct BfWGGameObjectBuilding { WintergraspObjectPositionData gobData = AttackTowers[towerid - 4].GameObject[i]; if (GameObject* go = m_WG->SpawnGameObject(gobData.entryHorde, gobData.x, gobData.y, gobData.z, gobData.o)) - m_GameObjectList[TEAM_HORDE].insert(go); + m_GameObjectList[TEAM_HORDE].insert(go->GetGUID()); if (GameObject* go = m_WG->SpawnGameObject(gobData.entryAlliance, gobData.x, gobData.y, gobData.z, gobData.o)) - m_GameObjectList[TEAM_ALLIANCE].insert(go); + m_GameObjectList[TEAM_ALLIANCE].insert(go->GetGUID()); } // Spawn associate npc bottom @@ -1364,64 +1366,59 @@ struct BfWGGameObjectBuilding void UpdateCreatureAndGo() { for (GuidSet::const_iterator itr = m_CreatureTopList[m_WG->GetDefenderTeam()].begin(); itr != m_CreatureTopList[m_WG->GetDefenderTeam()].end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - m_WG->HideNpc(creature); + if (Creature* creature = m_WG->GetCreature(*itr)) + m_WG->HideNpc(creature); for (GuidSet::const_iterator itr = m_CreatureTopList[m_WG->GetAttackerTeam()].begin(); itr != m_CreatureTopList[m_WG->GetAttackerTeam()].end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - m_WG->ShowNpc(creature, true); + if (Creature* creature = m_WG->GetCreature(*itr)) + m_WG->ShowNpc(creature, true); for (GuidSet::const_iterator itr = m_CreatureBottomList[m_WG->GetDefenderTeam()].begin(); itr != m_CreatureBottomList[m_WG->GetDefenderTeam()].end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - m_WG->HideNpc(creature); + if (Creature* creature = m_WG->GetCreature(*itr)) + m_WG->HideNpc(creature); for (GuidSet::const_iterator itr = m_CreatureBottomList[m_WG->GetAttackerTeam()].begin(); itr != m_CreatureBottomList[m_WG->GetAttackerTeam()].end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - m_WG->ShowNpc(creature, true); + if (Creature* creature = m_WG->GetCreature(*itr)) + m_WG->ShowNpc(creature, true); - for (GameObjectSet::const_iterator itr = m_GameObjectList[m_WG->GetDefenderTeam()].begin(); itr != m_GameObjectList[m_WG->GetDefenderTeam()].end(); ++itr) - (*itr)->SetRespawnTime(RESPAWN_ONE_DAY); + for (GuidSet::const_iterator itr = m_GameObjectList[m_WG->GetDefenderTeam()].begin(); itr != m_GameObjectList[m_WG->GetDefenderTeam()].end(); ++itr) + if (GameObject* object = m_WG->GetGameObject(*itr)) + object->SetRespawnTime(RESPAWN_ONE_DAY); - for (GameObjectSet::const_iterator itr = m_GameObjectList[m_WG->GetAttackerTeam()].begin(); itr != m_GameObjectList[m_WG->GetAttackerTeam()].end(); ++itr) - (*itr)->SetRespawnTime(RESPAWN_IMMEDIATELY); + for (GuidSet::const_iterator itr = m_GameObjectList[m_WG->GetAttackerTeam()].begin(); itr != m_GameObjectList[m_WG->GetAttackerTeam()].end(); ++itr) + if (GameObject* object = m_WG->GetGameObject(*itr)) + object->SetRespawnTime(RESPAWN_IMMEDIATELY); } void UpdateTurretAttack(bool disable) { for (GuidSet::const_iterator itr = m_TowerCannonBottomList.begin(); itr != m_TowerCannonBottomList.end(); ++itr) { - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) + if (Creature* creature = m_WG->GetCreature(*itr)) { - if (Creature* creature = unit->ToCreature()) + if (GameObject* build = m_WG->GetGameObject(m_BuildGUID)) { - if (m_Build) - { - if (disable) - m_WG->HideNpc(creature); - else - m_WG->ShowNpc(creature, true); + if (disable) + m_WG->HideNpc(creature); + else + m_WG->ShowNpc(creature, true); - switch (m_Build->GetEntry()) + switch (build->GetEntry()) + { + case GO_WINTERGRASP_FORTRESS_TOWER_1: + case GO_WINTERGRASP_FORTRESS_TOWER_2: + case GO_WINTERGRASP_FORTRESS_TOWER_3: + case GO_WINTERGRASP_FORTRESS_TOWER_4: + { + creature->setFaction(WintergraspFaction[m_WG->GetDefenderTeam()]); + break; + } + case GO_WINTERGRASP_SHADOWSIGHT_TOWER: + case GO_WINTERGRASP_WINTER_S_EDGE_TOWER: + case GO_WINTERGRASP_FLAMEWATCH_TOWER: { - case GO_WINTERGRASP_FORTRESS_TOWER_1: - case GO_WINTERGRASP_FORTRESS_TOWER_2: - case GO_WINTERGRASP_FORTRESS_TOWER_3: - case GO_WINTERGRASP_FORTRESS_TOWER_4: - { - creature->setFaction(WintergraspFaction[m_WG->GetDefenderTeam()]); - break; - } - case GO_WINTERGRASP_SHADOWSIGHT_TOWER: - case GO_WINTERGRASP_WINTER_S_EDGE_TOWER: - case GO_WINTERGRASP_FLAMEWATCH_TOWER: - { - creature->setFaction(WintergraspFaction[m_WG->GetAttackerTeam()]); - break; - } + creature->setFaction(WintergraspFaction[m_WG->GetAttackerTeam()]); + break; } } } @@ -1430,34 +1427,31 @@ struct BfWGGameObjectBuilding for (GuidSet::const_iterator itr = m_TurretTopList.begin(); itr != m_TurretTopList.end(); ++itr) { - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) + if (Creature* creature = m_WG->GetCreature(*itr)) { - if (Creature* creature = unit->ToCreature()) + if (GameObject* build = m_WG->GetGameObject(m_BuildGUID)) { - if (m_Build) - { - if (disable) - m_WG->HideNpc(creature); - else - m_WG->ShowNpc(creature, true); + if (disable) + m_WG->HideNpc(creature); + else + m_WG->ShowNpc(creature, true); - switch (m_Build->GetEntry()) + switch (build->GetEntry()) + { + case GO_WINTERGRASP_FORTRESS_TOWER_1: + case GO_WINTERGRASP_FORTRESS_TOWER_2: + case GO_WINTERGRASP_FORTRESS_TOWER_3: + case GO_WINTERGRASP_FORTRESS_TOWER_4: { - case GO_WINTERGRASP_FORTRESS_TOWER_1: - case GO_WINTERGRASP_FORTRESS_TOWER_2: - case GO_WINTERGRASP_FORTRESS_TOWER_3: - case GO_WINTERGRASP_FORTRESS_TOWER_4: - { - creature->setFaction(WintergraspFaction[m_WG->GetDefenderTeam()]); - break; - } - case GO_WINTERGRASP_SHADOWSIGHT_TOWER: - case GO_WINTERGRASP_WINTER_S_EDGE_TOWER: - case GO_WINTERGRASP_FLAMEWATCH_TOWER: - { - creature->setFaction(WintergraspFaction[m_WG->GetAttackerTeam()]); - break; - } + creature->setFaction(WintergraspFaction[m_WG->GetDefenderTeam()]); + break; + } + case GO_WINTERGRASP_SHADOWSIGHT_TOWER: + case GO_WINTERGRASP_WINTER_S_EDGE_TOWER: + case GO_WINTERGRASP_FLAMEWATCH_TOWER: + { + creature->setFaction(WintergraspFaction[m_WG->GetAttackerTeam()]); + break; } } } @@ -1544,19 +1538,19 @@ struct WGWorkshop struct WintergraspWorkshopData { BattlefieldWG* m_WG; // Pointer to wintergrasp - GameObject* m_Build; + uint64 m_BuildGUID; uint32 m_Type; uint32 m_State; // For worldstate uint32 m_WorldState; uint32 m_TeamControl; // Team witch control the workshop GuidSet m_CreatureOnPoint[2]; // Contain all Creature associate to this point - GameObjectSet m_GameObjectOnPoint[2]; // Contain all Gameobject associate to this point + GuidSet m_GameObjectOnPoint[2]; // Contain all Gameobject associate to this point uint32 m_NameId; // Id of trinity_string witch contain name of this node, using for alert message WintergraspWorkshopData(BattlefieldWG* WG) { m_WG = WG; - m_Build = NULL; + m_BuildGUID = 0; m_Type = 0; m_State = 0; m_WorldState = 0; @@ -1578,9 +1572,9 @@ struct WintergraspWorkshopData void AddGameObject(WintergraspObjectPositionData obj) { if (GameObject* gameobject = m_WG->SpawnGameObject(obj.entryHorde, obj.x, obj.y, obj.z, obj.o)) - m_GameObjectOnPoint[TEAM_HORDE].insert(gameobject); + m_GameObjectOnPoint[TEAM_HORDE].insert(gameobject->GetGUID()); if (GameObject* gameobject = m_WG->SpawnGameObject(obj.entryAlliance, obj.x, obj.y, obj.z, obj.o)) - m_GameObjectOnPoint[TEAM_ALLIANCE].insert(gameobject); + m_GameObjectOnPoint[TEAM_ALLIANCE].insert(gameobject->GetGUID()); } // Init method, setup variable @@ -1607,23 +1601,23 @@ struct WintergraspWorkshopData { // Show Alliance creature for (GuidSet::const_iterator itr = m_CreatureOnPoint[TEAM_ALLIANCE].begin(); itr != m_CreatureOnPoint[TEAM_ALLIANCE].end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - m_WG->ShowNpc(creature, creature->GetEntry() != 30499); + if (Creature* creature = m_WG->GetCreature(*itr)) + m_WG->ShowNpc(creature, creature->GetEntry() != 30499); // Hide Horde creature for (GuidSet::const_iterator itr = m_CreatureOnPoint[TEAM_HORDE].begin(); itr != m_CreatureOnPoint[TEAM_HORDE].end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - m_WG->HideNpc(creature); + if (Creature* creature = m_WG->GetCreature(*itr)) + m_WG->HideNpc(creature); // Show Alliance gameobject - for (GameObjectSet::const_iterator itr = m_GameObjectOnPoint[TEAM_ALLIANCE].begin(); itr != m_GameObjectOnPoint[TEAM_ALLIANCE].end(); ++itr) - (*itr)->SetRespawnTime(RESPAWN_IMMEDIATELY); + for (GuidSet::const_iterator itr = m_GameObjectOnPoint[TEAM_ALLIANCE].begin(); itr != m_GameObjectOnPoint[TEAM_ALLIANCE].end(); ++itr) + if (GameObject* object = m_WG->GetGameObject(*itr)) + object->SetRespawnTime(RESPAWN_IMMEDIATELY); // Hide Horde gameobject - for (GameObjectSet::const_iterator itr = m_GameObjectOnPoint[TEAM_HORDE].begin(); itr != m_GameObjectOnPoint[TEAM_HORDE].end(); ++itr) - (*itr)->SetRespawnTime(RESPAWN_ONE_DAY); + for (GuidSet::const_iterator itr = m_GameObjectOnPoint[TEAM_HORDE].begin(); itr != m_GameObjectOnPoint[TEAM_HORDE].end(); ++itr) + if (GameObject* object = m_WG->GetGameObject(*itr)) + object->SetRespawnTime(RESPAWN_ONE_DAY); // Updating worldstate @@ -1646,23 +1640,23 @@ struct WintergraspWorkshopData { // Show Horde creature for (GuidSet::const_iterator itr = m_CreatureOnPoint[TEAM_HORDE].begin(); itr != m_CreatureOnPoint[TEAM_HORDE].end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - m_WG->ShowNpc(creature, creature->GetEntry() != 30400); + if (Creature* creature = m_WG->GetCreature(*itr)) + m_WG->ShowNpc(creature, creature->GetEntry() != 30400); // Hide Alliance creature for (GuidSet::const_iterator itr = m_CreatureOnPoint[TEAM_ALLIANCE].begin(); itr != m_CreatureOnPoint[TEAM_ALLIANCE].end(); ++itr) - if (Unit* unit = sObjectAccessor->FindUnit(*itr)) - if (Creature* creature = unit->ToCreature()) - m_WG->HideNpc(creature); + if (Creature* creature = m_WG->GetCreature(*itr)) + m_WG->HideNpc(creature); // Hide Alliance gameobject - for (GameObjectSet::const_iterator itr = m_GameObjectOnPoint[TEAM_ALLIANCE].begin(); itr != m_GameObjectOnPoint[TEAM_ALLIANCE].end(); ++itr) - (*itr)->SetRespawnTime(RESPAWN_ONE_DAY); + for (GuidSet::const_iterator itr = m_GameObjectOnPoint[TEAM_ALLIANCE].begin(); itr != m_GameObjectOnPoint[TEAM_ALLIANCE].end(); ++itr) + if (GameObject* object = m_WG->GetGameObject(*itr)) + object->SetRespawnTime(RESPAWN_ONE_DAY); // Show Horde gameobject - for (GameObjectSet::const_iterator itr = m_GameObjectOnPoint[TEAM_HORDE].begin(); itr != m_GameObjectOnPoint[TEAM_HORDE].end(); ++itr) - (*itr)->SetRespawnTime(RESPAWN_IMMEDIATELY); + for (GuidSet::const_iterator itr = m_GameObjectOnPoint[TEAM_HORDE].begin(); itr != m_GameObjectOnPoint[TEAM_HORDE].end(); ++itr) + if (GameObject* object = m_WG->GetGameObject(*itr)) + object->SetRespawnTime(RESPAWN_IMMEDIATELY); // Update worlstate m_State = BATTLEFIELD_WG_OBJECTSTATE_HORDE_INTACT; diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 881d0e3296b..16220d17170 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1322,6 +1322,9 @@ void Battleground::EventPlayerLoggedIn(Player* player) void Battleground::EventPlayerLoggedOut(Player* player) { uint64 guid = player->GetGUID(); + if (!IsPlayerInBattleground(guid)) // Check if this player really is in battleground (might be a GM who teleported inside) + return; + // player is correct pointer, it is checked in WorldSession::LogoutPlayer() m_OfflineQueue.push_back(player->GetGUID()); m_Players[guid].OfflineRemoveTime = sWorld->GetGameTime() + MAX_OFFLINE_TIME; @@ -1332,8 +1335,8 @@ void Battleground::EventPlayerLoggedOut(Player* player) // 1 player is logging out, if it is the last, then end arena! if (isArena()) - if (GetAlivePlayersCountByTeam(player->GetTeam()) <= 1 && GetPlayersCountByTeam(GetOtherTeam(player->GetTeam()))) - EndBattleground(GetOtherTeam(player->GetTeam())); + if (GetAlivePlayersCountByTeam(player->GetBGTeam()) <= 1 && GetPlayersCountByTeam(GetOtherTeam(player->GetBGTeam()))) + EndBattleground(GetOtherTeam(player->GetBGTeam())); } } diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index f5edafec655..79c4f1accab 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -1013,8 +1013,8 @@ void BattlegroundMgr::CreateInitialBattlegrounds() data.MaxPlayersPerTeam = fields[2].GetUInt16(); data.LevelMin = fields[3].GetUInt8(); data.LevelMax = fields[4].GetUInt8(); - uint8 spawn = fields[9].GetUInt8(); - data.StartMaxDist = float(spawn * spawn); + float dist = fields[9].GetFloat(); + data.StartMaxDist = dist * dist; data.scriptId = sObjectMgr->GetScriptId(fields[11].GetCString()); data.BattlegroundName = bl->name; diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index 7bada252da6..8ce7d7d2139 100755 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -297,7 +297,7 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b SendToOne(&data, good); return; } - + Player* bad = sObjectAccessor->FindPlayerByName(badname); uint64 victim = bad ? bad->GetGUID() : 0; if (!victim || !IsOn(victim)) @@ -403,7 +403,7 @@ void Channel::Password(Player const* player, std::string const& pass) SendToOne(&data, guid); return; } - + if (!playersStore[guid].IsModerator() && !AccountMgr::IsGMAccount(player->GetSession()->GetSecurity())) { WorldPacket data; @@ -479,7 +479,7 @@ void Channel::SetOwner(Player const* player, std::string const& newname) uint64 guid = player->GetGUID(); uint32 sec = player->GetSession()->GetSecurity(); - if (!IsOn(guid) || (!AccountMgr::IsGMAccount(sec) && guid != _ownerGUID)) + if (!IsOn(guid)) { WorldPacket data; MakeNotMember(&data); @@ -487,9 +487,17 @@ void Channel::SetOwner(Player const* player, std::string const& newname) return; } + if (!AccountMgr::IsGMAccount(sec) && guid != _ownerGUID) + { + WorldPacket data; + MakeNotOwner(&data); + SendToOne(&data, guid); + return; + } + Player* newp = sObjectAccessor->FindPlayerByName(newname); uint64 victim = newp ? newp->GetGUID() : 0; - + if (!victim || !IsOn(victim) || (newp->GetTeam() != player->GetTeam() && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))) { @@ -600,8 +608,6 @@ void Channel::Say(uint64 guid, std::string const& what, uint32 lang) if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) lang = LANG_UNIVERSAL; - Player* player = ObjectAccessor::FindPlayer(guid); - if (!IsOn(guid)) { WorldPacket data; @@ -609,7 +615,7 @@ void Channel::Say(uint64 guid, std::string const& what, uint32 lang) SendToOne(&data, guid); return; } - + if (playersStore[guid].IsMuted()) { WorldPacket data; @@ -621,12 +627,13 @@ void Channel::Say(uint64 guid, std::string const& what, uint32 lang) WorldPacket data(SMSG_MESSAGECHAT, 1 + 4 + 8 + 4 + _name.size() + 8 + 4 + what.size() + 1); data << uint8(CHAT_MSG_CHANNEL); data << uint32(lang); - data << guid; + data << uint64(guid); data << uint32(0); data << _name; - data << guid; - data << what.size() + 1; + data << uint64(guid); + data << uint32(what.size() + 1); data << what; + Player* player = ObjectAccessor::FindPlayer(guid); data << uint8(player ? player->GetChatTag() : 0); SendToAll(&data, !playersStore[guid].IsModerator() ? guid : false); diff --git a/src/server/game/Chat/Channels/ChannelMgr.cpp b/src/server/game/Chat/Channels/ChannelMgr.cpp index b903f15c9a8..2ec7ed199ba 100755 --- a/src/server/game/Chat/Channels/ChannelMgr.cpp +++ b/src/server/game/Chat/Channels/ChannelMgr.cpp @@ -43,7 +43,7 @@ ChannelMgr* ChannelMgr::forTeam(uint32 team) return NULL; } -Channel* ChannelMgr::GetJoinChannel(std::string const& name, uint32 channel_id) +Channel* ChannelMgr::GetJoinChannel(std::string const& name, uint32 channelId) { std::wstring wname; Utf8toWStr(name, wname); @@ -53,7 +53,7 @@ Channel* ChannelMgr::GetJoinChannel(std::string const& name, uint32 channel_id) if (i == channels.end()) { - Channel* nchan = new Channel(name, channel_id, team); + Channel* nchan = new Channel(name, channelId, team); channels[wname] = nchan; return nchan; } diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 3b825a7b8f0..544e3087614 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -739,12 +739,11 @@ void ConditionMgr::LoadConditions(bool isReload) } QueryResult result = WorldDatabase.Query("SELECT SourceTypeOrReferenceId, SourceGroup, SourceEntry, SourceId, ElseGroup, ConditionTypeOrReference, ConditionTarget, " - " ConditionValue1, ConditionValue2, ConditionValue3, NegativeCondition, ErrorTextId, ScriptName FROM conditions"); + " ConditionValue1, ConditionValue2, ConditionValue3, NegativeCondition, ErrorType, ErrorTextId, ScriptName FROM conditions"); if (!result) { - sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 conditions. DB table `conditions` is empty!"); - + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 conditions. DB table `conditions` is empty!"); return; } @@ -755,19 +754,20 @@ void ConditionMgr::LoadConditions(bool isReload) Field* fields = result->Fetch(); Condition* cond = new Condition(); - int32 iSourceTypeOrReferenceId = fields[0].GetInt32(); + int32 iSourceTypeOrReferenceId = fields[0].GetInt32(); cond->SourceGroup = fields[1].GetUInt32(); cond->SourceEntry = fields[2].GetInt32(); cond->SourceId = fields[3].GetInt32(); cond->ElseGroup = fields[4].GetUInt32(); - int32 iConditionTypeOrReference = fields[5].GetInt32(); + int32 iConditionTypeOrReference = fields[5].GetInt32(); cond->ConditionTarget = fields[6].GetUInt8(); cond->ConditionValue1 = fields[7].GetUInt32(); cond->ConditionValue2 = fields[8].GetUInt32(); cond->ConditionValue3 = fields[9].GetUInt32(); cond->NegativeCondition = fields[10].GetUInt8(); - cond->ErrorTextId = fields[11].GetUInt32(); - cond->ScriptId = sObjectMgr->GetScriptId(fields[12].GetCString()); + cond->ErrorType = fields[11].GetUInt32(); + cond->ErrorTextId = fields[12].GetUInt32(); + cond->ScriptId = sObjectMgr->GetScriptId(fields[13].GetCString()); if (iConditionTypeOrReference >= 0) cond->ConditionType = ConditionTypes(iConditionTypeOrReference); @@ -844,6 +844,18 @@ void ConditionMgr::LoadConditions(bool isReload) continue; } + if (cond->ErrorType && cond->SourceType != CONDITION_SOURCE_TYPE_SPELL) + { + sLog->outError(LOG_FILTER_SQL, "Condition type %u entry %i can't have ErrorType (%u), set to 0!", uint32(cond->SourceType), cond->SourceEntry, cond->ErrorType); + cond->ErrorType = 0; + } + + if (cond->ErrorTextId && !cond->ErrorType) + { + sLog->outError(LOG_FILTER_SQL, "Condition type %u entry %i has any ErrorType, ErrorTextId (%u) is set, set to 0!", uint32(cond->SourceType), cond->SourceEntry, cond->ErrorTextId); + cond->ErrorTextId = 0; + } + if (cond->SourceGroup) { bool valid = false; @@ -1444,7 +1456,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) if (cond->ConditionTarget >= cond->GetMaxAvailableConditionTargets()) { - sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, has incorrect ConditionTarget set, ignoring.", cond->SourceType, cond->SourceEntry); + sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u, SourceGroup %u in `condition` table, has incorrect ConditionTarget set, ignoring.", cond->SourceType, cond->SourceEntry, cond->SourceGroup); return false; } diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index f8f40972337..99f200b4228 100755 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -181,6 +181,7 @@ struct Condition uint32 ConditionValue1; uint32 ConditionValue2; uint32 ConditionValue3; + uint32 ErrorType; uint32 ErrorTextId; uint32 ReferenceId; uint32 ScriptId; @@ -199,6 +200,7 @@ struct Condition ConditionValue2 = 0; ConditionValue3 = 0; ReferenceId = 0; + ErrorType = 0; ErrorTextId = 0; ScriptId = 0; NegativeCondition = false; diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 37f723f5c1f..458b4ea7706 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -953,30 +953,6 @@ bool Creature::isCanTrainingAndResetTalentsOf(Player* player) const && player->getClass() == GetCreatureTemplate()->trainer_class; } -void Creature::AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint32 /*MovementFlags*/, uint8 /*type*/) -{ - /* uint32 timeElap = getMSTime(); - if ((timeElap - m_startMove) < m_moveTime) - { - oX = (dX - oX) * ((timeElap - m_startMove) / m_moveTime); - oY = (dY - oY) * ((timeElap - m_startMove) / m_moveTime); - } - else - { - oX = dX; - oY = dY; - } - - dX = x; - dY = y; - m_orientation = atan2((oY - dY), (oX - dX)); - - m_startMove = getMSTime(); - m_moveTime = time;*/ - float speed = GetDistance(x, y, z) / ((float)time * 0.001f); - MonsterMoveWithSpeed(x, y, z, speed); -} - Player* Creature::GetLootRecipient() const { if (!m_lootRecipient) diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 4a410f4a41d..4651adb7006 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -520,7 +520,6 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature bool AIM_Initialize(CreatureAI* ai = NULL); void Motion_Initialize(); - void AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint32 MovementFlags, uint8 type); CreatureAI* AI() const { return (CreatureAI*)i_AI; } bool SetWalk(bool enable); diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 6be78ec2fb5..eec50095a91 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1026,7 +1026,7 @@ Item* Item::CloneItem(uint32 count, Player const* player) const newItem->SetUInt32Value(ITEM_FIELD_CREATOR, GetUInt32Value(ITEM_FIELD_CREATOR)); newItem->SetUInt32Value(ITEM_FIELD_GIFTCREATOR, GetUInt32Value(ITEM_FIELD_GIFTCREATOR)); - newItem->SetUInt32Value(ITEM_FIELD_FLAGS, GetUInt32Value(ITEM_FIELD_FLAGS)); + newItem->SetUInt32Value(ITEM_FIELD_FLAGS, GetUInt32Value(ITEM_FIELD_FLAGS) & ~(ITEM_FLAG_REFUNDABLE | ITEM_FLAG_BOP_TRADEABLE)); newItem->SetUInt32Value(ITEM_FIELD_DURATION, GetUInt32Value(ITEM_FIELD_DURATION)); // player CAN be NULL in which case we must not update random properties because that accesses player's item update queue if (player) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 5de54a9d974..ebf25ddb575 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -12369,10 +12369,10 @@ void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool // if this original item then it need create record in inventory // in case trade we already have item in other player inventory pLastItem->SetState(in_characterInventoryDB ? ITEM_CHANGED : ITEM_NEW, this); - } - if (pLastItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE)) - AddTradeableItem(pLastItem); + if (pLastItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE)) + AddTradeableItem(pLastItem); + } } void Player::DestroyItem(uint8 bag, uint8 slot, bool update) @@ -17885,8 +17885,14 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F AllowedLooterSet looters; for (Tokenizer::const_iterator itr = GUIDlist.begin(); itr != GUIDlist.end(); ++itr) looters.insert(atol(*itr)); - item->SetSoulboundTradeable(looters); - AddTradeableItem(item); + + if (looters.size() > 1 && item->GetTemplate()->GetMaxStackSize() == 1 && item->IsSoulBound()) + { + item->SetSoulboundTradeable(looters); + AddTradeableItem(item); + } + else + item->ClearSoulboundTradeable(this); } else { diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 66bc030623c..43bbf8eb02a 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -15907,316 +15907,319 @@ uint32 Unit::GetCombatRatingDamageReduction(CombatRating cr, float rate, float c return CalculatePct(damage, percent); } -uint32 Unit::GetModelForForm(ShapeshiftForm form) +uint32 Unit::GetModelForForm(ShapeshiftForm form) const { - switch (form) + if (GetTypeId() == TYPEID_PLAYER) { - case FORM_CAT: - // Based on Hair color - if (getRace() == RACE_NIGHTELF) - { - uint8 hairColor = GetByteValue(PLAYER_BYTES, 3); - switch (hairColor) - { - case 7: // Violet - case 8: - return 29405; - case 3: // Light Blue - return 29406; - case 0: // Green - case 1: // Light Green - case 2: // Dark Green - return 29407; - case 4: // White - return 29408; - default: // original - Dark Blue - return 892; - } - } - else if (getRace() == RACE_TROLL) - { - uint8 hairColor = GetByteValue(PLAYER_BYTES, 3); - switch (hairColor) - { - case 0: // Red - case 1: - return 33668; - case 2: // Yellow - case 3: - return 33667; - case 4: // Blue - case 5: - case 6: - return 33666; - case 7: // Purple - case 10: - return 33665; - default: // original - white - return 33669; - } - } - else if (getRace() == RACE_WORGEN) - { - // Based on Skin color - uint8 skinColor = GetByteValue(PLAYER_BYTES, 0); - // Male - if (getGender() == GENDER_MALE) - { - switch (skinColor) - { - case 1: // Brown - return 33662; - case 2: // Black - case 7: - return 33661; - case 4: // yellow - return 33664; - case 3: // White - case 5: - return 33663; - default: // original - Gray - return 33660; - } - } - // Female - else + switch (form) + { + case FORM_CAT: + // Based on Hair color + if (getRace() == RACE_NIGHTELF) { - switch (skinColor) + uint8 hairColor = GetByteValue(PLAYER_BYTES, 3); + switch (hairColor) { - case 5: // Brown - case 6: - return 33662; - case 7: // Black + case 7: // Violet case 8: - return 33661; - case 3: // yellow - case 4: - return 33664; - case 2: // White - return 33663; - default: // original - Gray - return 33660; + return 29405; + case 3: // Light Blue + return 29406; + case 0: // Green + case 1: // Light Green + case 2: // Dark Green + return 29407; + case 4: // White + return 29408; + default: // original - Dark Blue + return 892; } } - } - // Based on Skin color - else if (getRace() == RACE_TAUREN) - { - uint8 skinColor = GetByteValue(PLAYER_BYTES, 0); - // Male - if (getGender() == GENDER_MALE) + else if (getRace() == RACE_TROLL) { - switch (skinColor) + uint8 hairColor = GetByteValue(PLAYER_BYTES, 3); + switch (hairColor) { - case 12: // White - case 13: - case 14: - case 18: // Completly White - return 29409; - case 9: // Light Brown - case 10: - case 11: - return 29410; - case 6: // Brown - case 7: - case 8: - return 29411; - case 0: // Dark + case 0: // Red case 1: - case 2: - case 3: // Dark Grey - case 4: + return 33668; + case 2: // Yellow + case 3: + return 33667; + case 4: // Blue case 5: - return 29412; - default: // original - Grey - return 8571; + case 6: + return 33666; + case 7: // Purple + case 10: + return 33665; + default: // original - white + return 33669; } } - // Female - else + else if (getRace() == RACE_WORGEN) { - switch (skinColor) + // Based on Skin color + uint8 skinColor = GetByteValue(PLAYER_BYTES, 0); + // Male + if (getGender() == GENDER_MALE) { - case 10: // White - return 29409; - case 6: // Light Brown - case 7: - return 29410; - case 4: // Brown - case 5: - return 29411; - case 0: // Dark - case 1: - case 2: - case 3: - return 29412; - default: // original - Grey - return 8571; + switch (skinColor) + { + case 1: // Brown + return 33662; + case 2: // Black + case 7: + return 33661; + case 4: // yellow + return 33664; + case 3: // White + case 5: + return 33663; + default: // original - Gray + return 33660; + } + } + // Female + else + { + switch (skinColor) + { + case 5: // Brown + case 6: + return 33662; + case 7: // Black + case 8: + return 33661; + case 3: // yellow + case 4: + return 33664; + case 2: // White + return 33663; + default: // original - Gray + return 33660; + } } } - } - else if (Player::TeamForRace(getRace()) == ALLIANCE) - return 892; - else - return 8571; - case FORM_BEAR: - // Based on Hair color - if (getRace() == RACE_NIGHTELF) - { - uint8 hairColor = GetByteValue(PLAYER_BYTES, 3); - switch (hairColor) - { - case 0: // Green - case 1: // Light Green - case 2: // Dark Green - return 29413; // 29415? - case 6: // Dark Blue - return 29414; - case 4: // White - return 29416; - case 3: // Light Blue - return 29417; - default: // original - Violet - return 2281; - } - } - else if (getRace() == RACE_TROLL) - { - uint8 hairColor = GetByteValue(PLAYER_BYTES, 3); - switch (hairColor) - { - case 0: // Red - case 1: - return 33657; - case 2: // Yellow - case 3: - return 33659; - case 7: // Purple - case 10: - return 33656; - case 8: // White - case 9: - case 11: - case 12: - return 33658; - default: // original - Blue - return 33655; - } - } - else if (getRace() == RACE_WORGEN) - { // Based on Skin color - uint8 skinColor = GetByteValue(PLAYER_BYTES, 0); - // Male - if (getGender() == GENDER_MALE) + else if (getRace() == RACE_TAUREN) { - switch (skinColor) + uint8 skinColor = GetByteValue(PLAYER_BYTES, 0); + // Male + if (getGender() == GENDER_MALE) { - case 1: // Brown - return 33652; - case 2: // Black - case 7: - return 33651; - case 4: // Yellow - return 33653; - case 3: // White - case 5: - return 33654; - default: // original - Gray - return 33650; + switch (skinColor) + { + case 12: // White + case 13: + case 14: + case 18: // Completly White + return 29409; + case 9: // Light Brown + case 10: + case 11: + return 29410; + case 6: // Brown + case 7: + case 8: + return 29411; + case 0: // Dark + case 1: + case 2: + case 3: // Dark Grey + case 4: + case 5: + return 29412; + default: // original - Grey + return 8571; + } + } + // Female + else + { + switch (skinColor) + { + case 10: // White + return 29409; + case 6: // Light Brown + case 7: + return 29410; + case 4: // Brown + case 5: + return 29411; + case 0: // Dark + case 1: + case 2: + case 3: + return 29412; + default: // original - Grey + return 8571; + } } } - // Female + else if (Player::TeamForRace(getRace()) == ALLIANCE) + return 892; else + return 8571; + case FORM_BEAR: + // Based on Hair color + if (getRace() == RACE_NIGHTELF) { - switch (skinColor) + uint8 hairColor = GetByteValue(PLAYER_BYTES, 3); + switch (hairColor) { - case 5: // Brown - case 6: - return 33652; - case 7: // Black - case 8: - return 33651; - case 3: // yellow - case 4: - return 33654; - case 2: // White - return 33653; - default: // original - Gray - return 33650; + case 0: // Green + case 1: // Light Green + case 2: // Dark Green + return 29413; // 29415? + case 6: // Dark Blue + return 29414; + case 4: // White + return 29416; + case 3: // Light Blue + return 29417; + default: // original - Violet + return 2281; } } - } - // Based on Skin color - else if (getRace() == RACE_TAUREN) - { - uint8 skinColor = GetByteValue(PLAYER_BYTES, 0); - // Male - if (getGender() == GENDER_MALE) + else if (getRace() == RACE_TROLL) { - switch (skinColor) + uint8 hairColor = GetByteValue(PLAYER_BYTES, 3); + switch (hairColor) { - case 0: // Dark (Black) + case 0: // Red case 1: - case 2: - return 29418; - case 3: // White - case 4: - case 5: - case 12: - case 13: - case 14: - return 29419; - case 9: // Light Brown/Grey + return 33657; + case 2: // Yellow + case 3: + return 33659; + case 7: // Purple case 10: + return 33656; + case 8: // White + case 9: case 11: - case 15: - case 16: - case 17: - return 29420; - case 18: // Completly White - return 29421; - default: // original - Brown - return 2289; + case 12: + return 33658; + default: // original - Blue + return 33655; } } - // Female - else + else if (getRace() == RACE_WORGEN) { - switch (skinColor) + // Based on Skin color + uint8 skinColor = GetByteValue(PLAYER_BYTES, 0); + // Male + if (getGender() == GENDER_MALE) { - case 0: // Dark (Black) - case 1: - return 29418; - case 2: // White - case 3: - return 29419; - case 6: // Light Brown/Grey - case 7: - case 8: - case 9: - return 29420; - case 10: // Completly White - return 29421; - default: // original - Brown - return 2289; + switch (skinColor) + { + case 1: // Brown + return 33652; + case 2: // Black + case 7: + return 33651; + case 4: // Yellow + return 33653; + case 3: // White + case 5: + return 33654; + default: // original - Gray + return 33650; + } + } + // Female + else + { + switch (skinColor) + { + case 5: // Brown + case 6: + return 33652; + case 7: // Black + case 8: + return 33651; + case 3: // yellow + case 4: + return 33654; + case 2: // White + return 33653; + default: // original - Gray + return 33650; + } } } - } - else if (Player::TeamForRace(getRace()) == ALLIANCE) - return 2281; - else - return 2289; - case FORM_FLIGHT: - if (Player::TeamForRace(getRace()) == ALLIANCE) - return 20857; - return 20872; - case FORM_FLIGHT_EPIC: - if (Player::TeamForRace(getRace()) == ALLIANCE) - return 21243; - return 21244; - default: - break; + // Based on Skin color + else if (getRace() == RACE_TAUREN) + { + uint8 skinColor = GetByteValue(PLAYER_BYTES, 0); + // Male + if (getGender() == GENDER_MALE) + { + switch (skinColor) + { + case 0: // Dark (Black) + case 1: + case 2: + return 29418; + case 3: // White + case 4: + case 5: + case 12: + case 13: + case 14: + return 29419; + case 9: // Light Brown/Grey + case 10: + case 11: + case 15: + case 16: + case 17: + return 29420; + case 18: // Completly White + return 29421; + default: // original - Brown + return 2289; + } + } + // Female + else + { + switch (skinColor) + { + case 0: // Dark (Black) + case 1: + return 29418; + case 2: // White + case 3: + return 29419; + case 6: // Light Brown/Grey + case 7: + case 8: + case 9: + return 29420; + case 10: // Completly White + return 29421; + default: // original - Brown + return 2289; + } + } + } + else if (Player::TeamForRace(getRace()) == ALLIANCE) + return 2281; + else + return 2289; + case FORM_FLIGHT: + if (Player::TeamForRace(getRace()) == ALLIANCE) + return 20857; + return 20872; + case FORM_FLIGHT_EPIC: + if (Player::TeamForRace(getRace()) == ALLIANCE) + return 21243; + return 21244; + default: + break; + } } uint32 modelid = 0; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 4dfe5ec1a00..11f78275f24 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2134,7 +2134,7 @@ class Unit : public WorldObject void AddPetAura(PetAura const* petSpell); void RemovePetAura(PetAura const* petSpell); - uint32 GetModelForForm(ShapeshiftForm form); + uint32 GetModelForForm(ShapeshiftForm form) const; uint32 GetModelForTotem(PlayerTotemType totemType); void SetReducedThreatPercent(uint32 pct, uint64 guid) diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index d221a8ac80d..e85a888e01c 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -52,15 +52,8 @@ void WorldSession::HandleClientCastFlags(WorldPacket& recvPacket, uint8 castFlag recvPacket >> hasMovementData; if (hasMovementData) { - recvPacket.rfinish(); - // movement packet for caster of the spell - /*recvPacket.read_skip<uint32>(); // MSG_MOVE_STOP - hardcoded in client - uint64 guid; - recvPacket.readPackGUID(guid); - - MovementInfo movementInfo; - movementInfo.guid = guid; - ReadMovementInfo(recvPacket, &movementInfo);*/ + recvPacket.SetOpcode(Opcodes(recvPacket.read<uint32>())); + HandleMovementOpcodes(recvPacket); } } else if (castFlags & 0x8) // Archaeology diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 8a7a1cec33a..6576b470a7f 100755 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -86,8 +86,7 @@ enum TrinityStrings LANG_CONNECTED_PLAYERS = 60, LANG_ACCOUNT_ADDON = 61, LANG_IMPROPER_VALUE = 62, - LANG_CANT_DO_NOW = 63, - // Room for more level 0 64-99 not used + // Room for more level 0 63-99 not used // level 1 chat LANG_GLOBAL_NOTIFY = 100, diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 6c2315ddc69..38da442ca5b 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -90,7 +90,6 @@ void AddSC_npc_innkeeper(); void AddSC_npcs_special(); void AddSC_npc_taxi(); void AddSC_achievement_scripts(); -void AddSC_event_scripts(); //eastern kingdoms void AddSC_alterac_valley(); //Alterac Valley @@ -595,6 +594,9 @@ void AddSC_shattrath_city(); void AddSC_terokkar_forest(); void AddSC_zangarmarsh(); +// Events +void AddSC_event_childrens_week(); + // battlegrounds // outdoor pvp @@ -706,7 +708,6 @@ void AddWorldScripts() AddSC_npc_taxi(); AddSC_achievement_scripts(); AddSC_chat_log(); - AddSC_event_scripts(); #endif } @@ -1230,6 +1231,13 @@ void AddNorthrendScripts() #endif } +void AddEventScripts() +{ +#ifdef SCRIPTS + AddSC_event_childrens_week(); +#endif +} + void AddOutdoorPvPScripts() { #ifdef SCRIPTS diff --git a/src/server/game/Scripting/ScriptLoader.h b/src/server/game/Scripting/ScriptLoader.h index 0db6917a0d4..04ab3215551 100644 --- a/src/server/game/Scripting/ScriptLoader.h +++ b/src/server/game/Scripting/ScriptLoader.h @@ -27,6 +27,7 @@ void AddEasternKingdomsScripts(); void AddKalimdorScripts(); void AddOutlandScripts(); void AddNorthrendScripts(); +void AddEventScripts(); void AddBattlegroundScripts(); void AddOutdoorPvPScripts(); void AddCustomScripts(); diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 72e1a472c06..27e5e2d8d2b 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -283,7 +283,10 @@ void WorldSession::LogUnexpectedOpcode(WorldPacket* packet, const char* status, /// Logging helper for unexpected opcodes void WorldSession::LogUnprocessedTail(WorldPacket* packet) { - sLog->outError(LOG_FILTER_OPCODES, "Unprocessed tail data (read stop at %u from %u) Opcode %s from %s", + if (!sLog->ShouldLog(LOG_FILTER_OPCODES, LOG_LEVEL_TRACE) || packet->rpos() >= packet->wpos()) + return; + + sLog->outTrace(LOG_FILTER_OPCODES, "Unprocessed tail data (read stop at %u from %u) Opcode %s from %s", uint32(packet->rpos()), uint32(packet->wpos()), GetOpcodeNameForLogging(packet->GetOpcode()).c_str(), GetPlayerInfo().c_str()); packet->print_storage(); } @@ -344,8 +347,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) { sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); (this->*opHandle->Handler)(*packet); - if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE) && packet->rpos() < packet->wpos()) - LogUnprocessedTail(packet); + LogUnprocessedTail(packet); } // lag can cause STATUS_LOGGEDIN opcodes to arrive after the player started a transfer break; @@ -358,8 +360,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) // not expected _player or must checked in packet hanlder sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); (this->*opHandle->Handler)(*packet); - if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE) && packet->rpos() < packet->wpos()) - LogUnprocessedTail(packet); + LogUnprocessedTail(packet); } break; case STATUS_TRANSFER: @@ -371,8 +372,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) { sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); (this->*opHandle->Handler)(*packet); - if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE) && packet->rpos() < packet->wpos()) - LogUnprocessedTail(packet); + LogUnprocessedTail(packet); } break; case STATUS_AUTHED: @@ -390,8 +390,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); (this->*opHandle->Handler)(*packet); - if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE) && packet->rpos() < packet->wpos()) - LogUnprocessedTail(packet); + LogUnprocessedTail(packet); break; case STATUS_NEVER: sLog->outError(LOG_FILTER_OPCODES, "Received not allowed opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str() diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 73f19ba3f3c..435f65cb5d8 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -173,7 +173,8 @@ int WorldSocket::SendPacket(WorldPacket const& pct) pkt = &buff; } - sLog->outInfo(LOG_FILTER_OPCODES, "S->C: %s", GetOpcodeNameForLogging(pkt->GetOpcode()).c_str()); + if (m_Session) + sLog->outTrace(LOG_FILTER_OPCODES, "S->C: %s %s", m_Session->GetPlayerInfo().c_str(), GetOpcodeNameForLogging(pkt->GetOpcode()).c_str()); sScriptMgr->OnPacketSend(this, *pkt); @@ -678,7 +679,8 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) sPacketLog->LogPacket(*new_pct, CLIENT_TO_SERVER); std::string opcodeName = GetOpcodeNameForLogging(opcode); - sLog->outInfo(LOG_FILTER_OPCODES, "C->S: %s", opcodeName.c_str()); + if (m_Session) + sLog->outTrace(LOG_FILTER_OPCODES, "C->S: %s %s", m_Session->GetPlayerInfo().c_str(), opcodeName.c_str()); try { @@ -696,7 +698,7 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return HandleAuthSession(*new_pct); case CMSG_KEEP_ALIVE: - sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", GetOpcodeNameForLogging(opcode).c_str()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", opcodeName.c_str()); sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return 0; case CMSG_LOG_DISCONNECT: diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 4c22328cd26..b38d5f085b6 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4884,17 +4884,12 @@ SpellCastResult Spell::CheckCast(bool strict) ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL, m_spellInfo->Id); if (!conditions.empty() && !sConditionMgr->IsObjectMeetToConditions(condInfo, conditions)) { - // send error msg to player if condition failed and text message available - // TODO: using WorldSession::SendNotification is not blizzlike - if (Player* playerCaster = m_caster->ToPlayer()) + // mLastFailedCondition can be NULL if there was an error processing the condition in Condition::Meets (i.e. wrong data for ConditionTarget or others) + if (condInfo.mLastFailedCondition && condInfo.mLastFailedCondition->ErrorType) { - // mLastFailedCondition can be NULL if there was an error processing the condition in Condition::Meets (i.e. wrong data for ConditionTarget or others) - if (playerCaster->GetSession() && condInfo.mLastFailedCondition - && condInfo.mLastFailedCondition->ErrorTextId) - { - playerCaster->GetSession()->SendNotification(condInfo.mLastFailedCondition->ErrorTextId); - return SPELL_FAILED_DONT_REPORT; - } + if (condInfo.mLastFailedCondition->ErrorType == SPELL_FAILED_CUSTOM_ERROR) + m_customError = SpellCustomErrors(condInfo.mLastFailedCondition->ErrorTextId); + return SpellCastResult(condInfo.mLastFailedCondition->ErrorType); } if (!condInfo.mLastFailedCondition || !condInfo.mLastFailedCondition->ConditionTarget) return SPELL_FAILED_CASTER_AURASTATE; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 11368e990f5..94cd924681e 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -5123,12 +5123,11 @@ void Spell::EffectDurabilityDamage(SpellEffIndex effIndex) int32 slot = m_spellInfo->Effects[effIndex].MiscValue; - // FIXME: some spells effects have value -1/-2 - // Possibly its mean -1 all player equipped items and -2 all items + // -1 means all player equipped items and -2 all items if (slot < 0) { unitTarget->ToPlayer()->DurabilityPointsLossAll(damage, (slot < -1)); - ExecuteLogEffectDurabilityDamage(effIndex, unitTarget, -1, -1); // -1 -1 pair triggers SPELL_DURABILITY_DAMAGE_ALL event + ExecuteLogEffectDurabilityDamage(effIndex, unitTarget, -1, -1); return; } diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 8078b09baa3..1958ed4ea54 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -936,16 +936,9 @@ public: //No args required for players if (handler->GetSession() && AccountMgr::IsPlayerAccount(handler->GetSession()->GetSecurity())) { - Player* player = handler->GetSession()->GetPlayer(); - if (player->isInFlight() || player->isInCombat()) - { - handler->SendSysMessage(LANG_CANT_DO_NOW); - handler->SetSentErrorMessage(true); - return false; - } - - //7355: "Stuck" - player->CastSpell(player, 7355, false); + // 7355: "Stuck" + if (Player* player = handler->GetSession()->GetPlayer()) + player->CastSpell(player, 7355, false); return true; } @@ -966,8 +959,13 @@ public: if (player->isInFlight() || player->isInCombat()) { - handler->SendSysMessage(LANG_CANT_DO_NOW); - handler->SetSentErrorMessage(true); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(7355); + if (!spellInfo) + return false; + + if (Player* caster = handler->GetSession()->GetPlayer()) + Spell::SendCastResult(caster, spellInfo, 0, SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW); + return false; } diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp index fdb6a5da320..af61c723ca3 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp @@ -22,8 +22,8 @@ enum Yells { YELL_AGGRO = 0, YELL_EVADE = 1, - YELL_RESPAWN1 = -1810010, // no creature_text - YELL_RESPAWN2 = -1810011, // no creature_text + //YELL_RESPAWN1 = -1810010, // Missing in database + //YELL_RESPAWN2 = -1810011, // Missing in database YELL_RANDOM = 2, YELL_SPELL = 3, }; @@ -64,12 +64,6 @@ public: Talk(YELL_AGGRO); } - void JustRespawned() - { - Reset(); - DoScriptText(RAND(YELL_RESPAWN1, YELL_RESPAWN2), me); - } - void UpdateAI(const uint32 diff) { if (!UpdateVictim()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp index b5283900eb0..5b5787b2ab8 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp @@ -101,12 +101,12 @@ public: // npc_grimstone enum GrimstoneTexts { - SCRIPT_TEXT1 = -1230003, - SCRIPT_TEXT2 = -1230004, - SCRIPT_TEXT3 = -1230005, - SCRIPT_TEXT4 = -1230006, - SCRIPT_TEXT5 = -1230007, - SCRIPT_TEXT6 = -1230008 + SAY_TEXT1 = 0, + SAY_TEXT2 = 1, + SAY_TEXT3 = 2, + SAY_TEXT4 = 3, + SAY_TEXT5 = 4, + SAY_TEXT6 = 5 }; //TODO: implement quest part of event (different end boss) @@ -186,12 +186,12 @@ public: switch (waypointId) { case 0: - DoScriptText(SCRIPT_TEXT1, me);//2 + Talk(SAY_TEXT1); CanWalk = false; Event_Timer = 5000; break; case 1: - DoScriptText(SCRIPT_TEXT2, me);//4 + Talk(SAY_TEXT2); CanWalk = false; Event_Timer = 5000; break; @@ -199,10 +199,10 @@ public: CanWalk = false; break; case 3: - DoScriptText(SCRIPT_TEXT3, me);//5 + Talk(SAY_TEXT3); break; case 4: - DoScriptText(SCRIPT_TEXT4, me);//6 + Talk(SAY_TEXT4); CanWalk = false; Event_Timer = 5000; break; @@ -272,7 +272,7 @@ public: switch (EventPhase) { case 0: - DoScriptText(SCRIPT_TEXT5, me);//1 + Talk(SAY_TEXT5); HandleGameObject(DATA_ARENA4, false); Start(false, false); CanWalk = true; @@ -307,7 +307,7 @@ public: case 7: me->SetVisible(true); HandleGameObject(DATA_ARENA1, false); - DoScriptText(SCRIPT_TEXT6, me);//4 + Talk(SAY_TEXT6); CanWalk = true; Event_Timer = 0; break; @@ -1178,7 +1178,7 @@ public: // npc_rocknot enum RocknotSays { - SAY_GOT_BEER = -1230000 + SAY_GOT_BEER = 0 }; enum RocknotSpells @@ -1215,7 +1215,7 @@ public: //keep track of amount in instance script, returns SPECIAL if amount ok and event in progress if (instance->GetData(TYPE_BAR) == SPECIAL) { - DoScriptText(SAY_GOT_BEER, creature); + creature->AI()->Talk(SAY_GOT_BEER); creature->CastSpell(creature, SPELL_DRUNKEN_RAGE, false); if (npc_escortAI* escortAI = CAST_AI(npc_rocknot::npc_rocknotAI, creature->AI())) diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp index 204fa3177e7..bad4d8735b7 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp @@ -22,8 +22,8 @@ enum Yells { - SAY_AGGRO = -1230001, - SAY_SLAY = -1230002 + SAY_AGGRO = 0, + SAY_SLAY = 1 }; enum Spells @@ -63,13 +63,13 @@ public: void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); me->CallForHelp(VISIBLE_RANGE); } void KilledUnit(Unit* /*victim*/) { - DoScriptText(SAY_SLAY, me); + Talk(SAY_SLAY); } void JustDied(Unit* /*killer*/) diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp index 40f8b2507e3..2aab7739d8d 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp @@ -19,10 +19,11 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" -enum Spells +enum Grizzle { - SPELL_GROUNDTREMOR = 6524, - SPELL_FRENZY = 28371 + SPELL_GROUNDTREMOR = 6524, + SPELL_FRENZY = 28371, + EMOTE_FRENZY_KILL = 0 }; class boss_grizzle : public CreatureScript @@ -69,7 +70,7 @@ public: if (Frenzy_Timer <= diff) { DoCast(me, SPELL_FRENZY); - DoScriptText(EMOTE_GENERIC_FRENZY_KILL, me); + Talk(EMOTE_FRENZY_KILL); Frenzy_Timer = 15000; } else Frenzy_Timer -= diff; diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp index ceca6330152..d05b6220441 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp @@ -28,8 +28,8 @@ EndScriptData */ enum Say { - SAY_AGGRO = -1469000, - SAY_LEASH = -1469001 + SAY_AGGRO = 0, + SAY_LEASH = 1, }; enum Spells @@ -69,7 +69,7 @@ public: void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); DoZoneInCombat(); } @@ -110,7 +110,7 @@ public: } else KnockBack_Timer -= diff; if (EnterEvadeIfOutOfCombatArea(diff)) - DoScriptText(SAY_LEASH, me); + Talk(SAY_LEASH); DoMeleeAttackIfReady(); } diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp index 9beb3bb10fe..8f12ab3f2e8 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp @@ -28,8 +28,8 @@ EndScriptData */ enum Emotes { - EMOTE_FRENZY = -1469002, - EMOTE_SHIMMER = -1469003 + EMOTE_FRENZY = 0, + EMOTE_SHIMMER = 1, }; enum Spells @@ -219,7 +219,7 @@ public: DoCast(me, spell); CurrentVurln_Spell = spell; - DoScriptText(EMOTE_SHIMMER, me); + Talk(EMOTE_SHIMMER); Shimmer_Timer = 45000; } else Shimmer_Timer -= diff; @@ -280,7 +280,7 @@ public: if (Frenzy_Timer <= diff) { DoCast(me, SPELL_FRENZY); - DoScriptText(EMOTE_FRENZY, me); + Talk(EMOTE_FRENZY); Frenzy_Timer = urand(10000, 15000); } else Frenzy_Timer -= diff; diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp index e84ccd0e160..b191d2fbb02 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp @@ -28,7 +28,7 @@ EndScriptData */ enum Emotes { - EMOTE_FRENZY = -1469031 + EMOTE_FRENZY = 0, }; enum Spells @@ -93,7 +93,7 @@ public: //Frenzy_Timer if (Frenzy_Timer <= diff) { - DoScriptText(EMOTE_FRENZY, me); + Talk(EMOTE_FRENZY); DoCast(me, SPELL_FRENZY); Frenzy_Timer = urand(8000, 10000); } else Frenzy_Timer -= diff; diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp index 787fbe5312b..5a3c72054b4 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp @@ -28,22 +28,20 @@ EndScriptData */ enum Say { - SAY_AGGRO = -1469007, - SAY_XHEALTH = -1469008, - SAY_SHADOWFLAME = -1469009, - SAY_RAISE_SKELETONS = -1469010, - SAY_SLAY = -1469011, - SAY_DEATH = -1469012, - - SAY_MAGE = -1469013, - SAY_WARRIOR = -1469014, - SAY_DRUID = -1469015, - SAY_PRIEST = -1469016, - SAY_PALADIN = -1469017, - SAY_SHAMAN = -1469018, - SAY_WARLOCK = -1469019, - SAY_HUNTER = -1469020, - SAY_ROGUE = -1469021 + SAY_RANDOM = 0, + SAY_RAISE_SKELETONS = 1, + SAY_SLAY = 2, + SAY_DEATH = 3, + + SAY_MAGE = 4, + SAY_WARRIOR = 5, + SAY_DRUID = 6, + SAY_PRIEST = 7, + SAY_PALADIN = 8, + SAY_SHAMAN = 9, + SAY_WARLOCK = 10, + SAY_HUNTER = 11, + SAY_ROGUE = 12, }; enum Spells @@ -109,17 +107,17 @@ public: if (rand()%5) return; - DoScriptText(SAY_SLAY, me, Victim); + Talk(SAY_SLAY, Victim->GetGUID()); } void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); } void EnterCombat(Unit* who) { - DoScriptText(RAND(SAY_XHEALTH, SAY_AGGRO, SAY_SHADOWFLAME), me); + Talk(SAY_RANDOM); DoCast(who, SPELL_SHADOWFLAME_INITIAL); DoZoneInCombat(); @@ -184,39 +182,39 @@ public: switch (urand(0, 8)) { case 0: - DoScriptText(SAY_MAGE, me); + Talk(SAY_MAGE); DoCast(me, SPELL_MAGE); break; case 1: - DoScriptText(SAY_WARRIOR, me); + Talk(SAY_WARRIOR); DoCast(me, SPELL_WARRIOR); break; case 2: - DoScriptText(SAY_DRUID, me); + Talk(SAY_DRUID); DoCast(me, SPELL_DRUID); break; case 3: - DoScriptText(SAY_PRIEST, me); + Talk(SAY_PRIEST); DoCast(me, SPELL_PRIEST); break; case 4: - DoScriptText(SAY_PALADIN, me); + Talk(SAY_PALADIN); DoCast(me, SPELL_PALADIN); break; case 5: - DoScriptText(SAY_SHAMAN, me); + Talk(SAY_SHAMAN); DoCast(me, SPELL_SHAMAN); break; case 6: - DoScriptText(SAY_WARLOCK, me); + Talk(SAY_WARLOCK); DoCast(me, SPELL_WARLOCK); break; case 7: - DoScriptText(SAY_HUNTER, me); + Talk(SAY_HUNTER); DoCast(me, SPELL_HUNTER); break; case 8: - DoScriptText(SAY_ROGUE, me); + Talk(SAY_ROGUE); DoCast(me, SPELL_ROGUE); break; } @@ -228,7 +226,7 @@ public: if (!Phase3 && HealthBelowPct(20)) { Phase3 = true; - DoScriptText(SAY_RAISE_SKELETONS, me); + Talk(SAY_RAISE_SKELETONS); } DoMeleeAttackIfReady(); diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp index 04eca3586cc..577516383b2 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp @@ -30,10 +30,10 @@ EndScriptData */ enum Say { - SAY_EGGS_BROKEN1 = -1469022, - SAY_EGGS_BROKEN2 = -1469023, - SAY_EGGS_BROKEN3 = -1469024, - SAY_DEATH = -1469025 + SAY_EGGS_BROKEN1 = 0, + SAY_EGGS_BROKEN2 = 1, + SAY_EGGS_BROKEN3 = 2, + SAY_DEATH = 3, }; enum Spells diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp index 359f218cd5c..6ffe30d2c50 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp @@ -30,11 +30,11 @@ EndScriptData */ enum Says { - SAY_LINE1 = -1469026, - SAY_LINE2 = -1469027, - SAY_LINE3 = -1469028, - SAY_HALFLIFE = -1469029, - SAY_KILLTARGET = -1469030 + SAY_LINE1 = 0, + SAY_LINE2 = 1, + SAY_LINE3 = 2, + SAY_HALFLIFE = 3, + SAY_KILLTARGET = 4 }; #define GOSSIP_ITEM "Start Event <Needs Gossip Text>" @@ -130,7 +130,7 @@ public: PlayerGUID = target->GetGUID(); //10 seconds - DoScriptText(SAY_LINE1, me); + Talk(SAY_LINE1); SpeechTimer = 10000; SpeechNum = 0; @@ -144,7 +144,7 @@ public: if (rand()%5) return; - DoScriptText(SAY_KILLTARGET, me, victim); + Talk(SAY_KILLTARGET, victim->GetGUID()); } void EnterCombat(Unit* /*who*/) @@ -167,13 +167,13 @@ public: { case 0: //16 seconds till next line - DoScriptText(SAY_LINE2, me); + Talk(SAY_LINE2); SpeechTimer = 16000; ++SpeechNum; break; case 1: //This one is actually 16 seconds but we only go to 10 seconds because he starts attacking after he says "I must fight this!" - DoScriptText(SAY_LINE3, me); + Talk(SAY_LINE3); SpeechTimer = 10000; ++SpeechNum; break; @@ -198,7 +198,7 @@ public: // Yell if hp lower than 15% if (HealthBelowPct(15) && !HasYelled) { - DoScriptText(SAY_HALFLIFE, me); + Talk(SAY_HALFLIFE); HasYelled = true; } diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp index f107fd7c5ec..712f7fbe8c5 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp @@ -35,7 +35,7 @@ enum eSpels EQUIP_SWORD = 5191, EQUIP_MACE = 7230, - SAY_AGGRO = -1036001 + SAY_AGGRO = 0, }; class boss_mr_smite : public CreatureScript @@ -82,7 +82,7 @@ public: void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); } bool bCheckChances() diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index 0c3c046a2e0..84d0cd6b4c4 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -29,45 +29,55 @@ EndScriptData */ #include "WorldPacket.h" #include "Opcodes.h" -#define SAY_AGGRO -1585023 //This yell should be done when the room is cleared. For now, set it as a movelineofsight yell. -#define SAY_PHOENIX -1585024 -#define SAY_FLAMESTRIKE -1585025 -#define SAY_GRAVITY_LAPSE -1585026 -#define SAY_TIRED -1585027 -#define SAY_RECAST_GRAVITY -1585028 -#define SAY_DEATH -1585029 +enum Says +{ + SAY_AGGRO = 0, //This yell should be done when the room is cleared. For now, set it as a movelineofsight yell. + SAY_PHOENIX = 1, + SAY_FLAMESTRIKE = 2, + SAY_GRAVITY_LAPSE = 3, + SAY_TIRED = 4, + SAY_RECAST_GRAVITY = 5, + SAY_DEATH = 6 +}; -/*** Spells ***/ -// Phase 1 spells -#define SPELL_FIREBALL_NORMAL 44189 // Deals 2700-3300 damage at current target -#define SPELL_FIREBALL_HEROIC 46164 // 4950-6050 +enum Spells +{ + // Phase 1 spells + SPELL_FIREBALL_NORMAL = 44189, // Deals 2700-3300 damage at current target + SPELL_FIREBALL_HEROIC = 46164, // 4950-6050 -#define SPELL_PHOENIX 44194 // Summons a phoenix (Doesn't work?) -#define SPELL_PHOENIX_BURN 44197 // A spell Phoenix uses to damage everything around -#define SPELL_REBIRTH_DMG 44196 // DMG if a Phoenix rebirth happen + SPELL_PHOENIX = 44194, // Summons a phoenix (Doesn't work?) + SPELL_PHOENIX_BURN = 44197, // A spell Phoenix uses to damage everything around + SPELL_REBIRTH_DMG = 44196, // DMG if a Phoenix rebirth happen -#define SPELL_FLAMESTRIKE1_NORMAL 44190 // Damage part -#define SPELL_FLAMESTRIKE1_HEROIC 46163 // Heroic damage part -#define SPELL_FLAMESTRIKE2 44191 // Flamestrike indicator before the damage -#define SPELL_FLAMESTRIKE3 44192 // Summons the trigger + animation (projectile) + SPELL_FLAMESTRIKE1_NORMAL = 44190, // Damage part + SPELL_FLAMESTRIKE1_HEROIC = 46163, // Heroic damage part + SPELL_FLAMESTRIKE2 = 44191, // Flamestrike indicator before the damage + SPELL_FLAMESTRIKE3 = 44192, // Summons the trigger + animation (projectile) -#define SPELL_SHOCK_BARRIER 46165 // Heroic only; 10k damage shield, followed by Pyroblast -#define SPELL_PYROBLAST 36819 // Heroic only; 45-55k fire damage + SPELL_SHOCK_BARRIER = 46165, // Heroic only; 10k damage shield, followed by Pyroblast + SPELL_PYROBLAST = 36819, // Heroic only; 45-55k fire damage // Phase 2 spells -#define SPELL_GRAVITY_LAPSE_INITIAL 44224 // Cast at the beginning of every Gravity Lapse -#define SPELL_GRAVITY_LAPSE_CHANNEL 44251 // Channeled; blue beam animation to every enemy in range -#define SPELL_TELEPORT_CENTER 44218 // Should teleport people to the center. Requires DB entry in spell_target_position. -#define SPELL_GRAVITY_LAPSE_FLY 44227 // Hastens flyspeed and allows flying for 1 minute. For some reason removes 44226. -#define SPELL_GRAVITY_LAPSE_DOT 44226 // Knocks up in the air and applies a 300 DPS DoT. -#define SPELL_ARCANE_SPHERE_PASSIVE 44263 // Passive auras on Arcane Spheres -#define SPELL_POWER_FEEDBACK 44233 // Stuns him, making him take 50% more damage for 10 seconds. Cast after Gravity Lapse - -/*** Creatures ***/ -#define CREATURE_PHOENIX 24674 -#define CREATURE_PHOENIX_EGG 24675 -#define CREATURE_ARCANE_SPHERE 24708 + SPELL_GRAVITY_LAPSE_INITIAL = 44224, // Cast at the beginning of every Gravity Lapse + SPELL_GRAVITY_LAPSE_CHANNEL = 44251, // Channeled; blue beam animation to every enemy in range + SPELL_TELEPORT_CENTER = 44218, // Should teleport people to the center. Requires DB entry in spell_target_position. + SPELL_GRAVITY_LAPSE_FLY = 44227, // Hastens flyspeed and allows flying for 1 minute. For some reason removes 44226. + SPELL_GRAVITY_LAPSE_DOT = 44226, // Knocks up in the air and applies a 300 DPS DoT. + SPELL_ARCANE_SPHERE_PASSIVE = 44263, // Passive auras on Arcane Spheres + SPELL_POWER_FEEDBACK = 44233 // Stuns him, making him take 50% more damage for 10 seconds. Cast after Gravity Lapse +}; + + + +enum Creatures +{ + CREATURE_PHOENIX = 24674, + CREATURE_PHOENIX_EGG = 24675, + CREATURE_ARCANE_SPHERE = 24708 +}; + /** Locations **/ float KaelLocations[3][2]= @@ -146,7 +156,7 @@ public: void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (!instance) return; @@ -176,7 +186,7 @@ public: { if (!HasTaunted && me->IsWithinDistInMap(who, 40.0f)) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); HasTaunted = true; } @@ -315,7 +325,7 @@ public: Phoenix->AI()->AttackStart(target); } - DoScriptText(SAY_PHOENIX, me); + Talk(SAY_PHOENIX); PhoenixTimer = 60000; } else PhoenixTimer -= diff; @@ -327,7 +337,7 @@ public: me->InterruptSpell(CURRENT_CHANNELED_SPELL); me->InterruptSpell(CURRENT_GENERIC_SPELL); DoCast(target, SPELL_FLAMESTRIKE3, true); - DoScriptText(SAY_FLAMESTRIKE, me); + Talk(SAY_FLAMESTRIKE); } FlameStrikeTimer = urand(15000, 25000); } else FlameStrikeTimer -= diff; @@ -357,14 +367,14 @@ public: case 0: if (FirstGravityLapse) // Different yells at 50%, and at every following Gravity Lapse { - DoScriptText(SAY_GRAVITY_LAPSE, me); + Talk(SAY_GRAVITY_LAPSE); FirstGravityLapse = false; if (instance) instance->SetData(DATA_KAELTHAS_STATUES, 1); } else - DoScriptText(SAY_RECAST_GRAVITY, me); + Talk(SAY_RECAST_GRAVITY); DoCast(me, SPELL_GRAVITY_LAPSE_INITIAL); GravityLapseTimer = 2000 + diff;// Don't interrupt the visual spell @@ -407,7 +417,7 @@ public: case 4: me->InterruptNonMeleeSpells(false); - DoScriptText(SAY_TIRED, me); + Talk(SAY_TIRED); DoCast(me, SPELL_POWER_FEEDBACK); RemoveGravityLapse(); GravityLapseTimer = 10000; diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp index 2af417381a5..b2cf2336024 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp @@ -34,25 +34,25 @@ struct Speech static Speech LackeyDeath[]= { - {-1585013}, - {-1585014}, - {-1585015}, - {-1585016}, + {1}, + {2}, + {3}, + {4}, }; static Speech PlayerDeath[]= { - {-1585017}, - {-1585018}, - {-1585019}, - {-1585020}, - {-1585021}, + {5}, + {6}, + {7}, + {8}, + {9}, }; enum eEnums { - SAY_AGGRO = -1585012, - SAY_DEATH = -1585022, + SAY_AGGRO = 0, + SAY_DEATH = 10, SPELL_DISPEL_MAGIC = 27609, SPELL_FLASH_HEAL = 17843, @@ -144,7 +144,7 @@ public: void EnterCombat(Unit* who) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) { @@ -216,7 +216,7 @@ public: if (victim->GetTypeId() != TYPEID_PLAYER) return; - DoScriptText(PlayerDeath[PlayersKilled].id, me); + Talk(PlayerDeath[PlayersKilled].id); if (PlayersKilled < 4) ++PlayersKilled; @@ -224,7 +224,7 @@ public: void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (!instance) return; @@ -415,7 +415,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI return; //should delrissa really yell if dead? - DoScriptText(LackeyDeath[uiLackeyDeathCount].id, pDelrissa); + pDelrissa->AI()->Talk(LackeyDeath[uiLackeyDeathCount].id); instance->SetData(DATA_DELRISSA_DEATH_COUNT, SPECIAL); diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp index 7b79c18239e..4d9bd1f2192 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp @@ -27,30 +27,37 @@ EndScriptData */ #include "ScriptedCreature.h" #include "magisters_terrace.h" -#define SAY_AGGRO -1585000 -#define SAY_ENERGY -1585001 -#define SAY_EMPOWERED -1585002 -#define SAY_KILL_1 -1585003 -#define SAY_KILL_2 -1585004 -#define SAY_DEATH -1585005 -#define EMOTE_CRYSTAL -1585006 - -//Crystal effect spells -#define SPELL_FEL_CRYSTAL_COSMETIC 44374 -#define SPELL_FEL_CRYSTAL_DUMMY 44329 -#define SPELL_FEL_CRYSTAL_VISUAL 44355 -#define SPELL_MANA_RAGE 44320 // This spell triggers 44321, which changes scale and regens mana Requires an entry in spell_script_target +enum Says +{ + SAY_AGGRO = 0, + SAY_ENERGY = 1, + SAY_EMPOWERED = 2, + SAY_KILL = 3, + SAY_DEATH = 4, + EMOTE_CRYSTAL = 5 +}; -//Selin's spells -#define SPELL_DRAIN_LIFE 44294 -#define SPELL_FEL_EXPLOSION 44314 +enum Spells +{ + //Crystal effect spells + SPELL_FEL_CRYSTAL_COSMETIC = 44374, + SPELL_FEL_CRYSTAL_DUMMY = 44329, + SPELL_FEL_CRYSTAL_VISUAL = 44355, + SPELL_MANA_RAGE = 44320, // This spell triggers 44321, which changes scale and regens mana Requires an entry in spell_script_target -#define SPELL_DRAIN_MANA 46153 // Heroic only + //Selin's spells + SPELL_DRAIN_LIFE = 44294, + SPELL_FEL_EXPLOSION = 44314, -#define CRYSTALS_NUMBER 5 -#define DATA_CRYSTALS 6 + SPELL_DRAIN_MANA = 46153 // Heroic only +}; -#define CREATURE_FEL_CRYSTAL 24722 +enum Misc +{ + CRYSTALS_NUMBER = 5, + DATA_CRYSTALS = 6, + CREATURE_FEL_CRYSTAL = 24722 +}; class boss_selin_fireheart : public CreatureScript { @@ -161,8 +168,8 @@ public: } if (CrystalChosen) { - DoScriptText(SAY_ENERGY, me); - DoScriptText(EMOTE_CRYSTAL, me); + Talk(SAY_ENERGY); + Talk(EMOTE_CRYSTAL); CrystalChosen->CastSpell(CrystalChosen, SPELL_FEL_CRYSTAL_COSMETIC, true); @@ -192,14 +199,14 @@ public: void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); if (instance) instance->SetData(DATA_SELIN_EVENT, IN_PROGRESS); } void KilledUnit(Unit* /*victim*/) { - DoScriptText(RAND(SAY_KILL_1, SAY_KILL_2), me); + Talk(SAY_KILL); } void MovementInform(uint32 type, uint32 id) @@ -226,7 +233,7 @@ public: void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (!instance) return; @@ -293,7 +300,7 @@ public: IsDraining = false; DrainingCrystal = false; - DoScriptText(SAY_EMPOWERED, me); + Talk(SAY_EMPOWERED); Unit* CrystalChosen = Unit::GetUnit(*me, CrystalGUID); if (CrystalChosen && CrystalChosen->isAlive()) diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp index 34682683ee3..31821623878 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp @@ -29,11 +29,11 @@ EndScriptData */ enum eEnums { - SAY_AGGRO = -1585007, - SAY_ENERGY = -1585008, - SAY_OVERLOAD = -1585009, - SAY_KILL = -1585010, - EMOTE_DISCHARGE_ENERGY = -1585011, + SAY_AGGRO = 0, + SAY_ENERGY = 1, + SAY_OVERLOAD = 2, + SAY_KILL = 3, + EMOTE_DISCHARGE_ENERGY = 4, //is this text for real? //#define SAY_DEATH "What...happen...ed." @@ -99,7 +99,7 @@ public: void KilledUnit(Unit* /*victim*/) { - DoScriptText(SAY_KILL, me); + Talk(SAY_KILL); } void JustDied(Unit* /*killer*/) @@ -110,7 +110,7 @@ public: void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); if (instance) instance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS); @@ -144,8 +144,8 @@ public: else ++IntervalHealthAmount; - DoScriptText(SAY_ENERGY, me); - DoScriptText(EMOTE_DISCHARGE_ENERGY, me); + Talk(SAY_ENERGY); + Talk(EMOTE_DISCHARGE_ENERGY); if (IsHeroic()) { diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp index fa99078cedb..5e5cc0ffab8 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp @@ -30,7 +30,7 @@ EndScriptData */ enum Texts { - EMOTE_LOWHP = -1409002, + EMOTE_LOWHP = 0, }; enum Spells @@ -149,7 +149,7 @@ class mob_core_rager : public CreatureScript if (pGolemagg->isAlive()) { me->AddAura(SPELL_GOLEMAGG_TRUST, me); - DoScriptText(EMOTE_LOWHP, me); + Talk(EMOTE_LOWHP); me->SetFullHealth(); } } diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp index 9d48d04cf07..edd8905ff4a 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp @@ -29,17 +29,17 @@ EndScriptData */ enum Texts { - SAY_REINFORCEMENTS1 = -1409013, - SAY_REINFORCEMENTS2 = -1409014, - SAY_HAND = -1409015, - SAY_WRATH = -1409016, - SAY_KILL = -1409017, - SAY_MAGMABURST = -1409018, - SAY_SUMMON_MAJ = -1409008, - SAY_ARRIVAL1_RAG = -1409009, - SAY_ARRIVAL2_MAJ = -1409010, - SAY_ARRIVAL3_RAG = -1409011, - SAY_ARRIVAL5_RAG = -1409012, + SAY_SUMMON_MAJ = 0, + SAY_ARRIVAL1_RAG = 1, + SAY_ARRIVAL2_MAJ = 2, + SAY_ARRIVAL3_RAG = 3, + SAY_ARRIVAL5_RAG = 4, + SAY_REINFORCEMENTS1 = 5, + SAY_REINFORCEMENTS2 = 6, + SAY_HAND = 7, + SAY_WRATH = 8, + SAY_KILL = 9, + SAY_MAGMABURST = 10 }; enum Spells @@ -112,7 +112,7 @@ class boss_ragnaros : public CreatureScript void KilledUnit(Unit* /*victim*/) { if (urand(0, 99) < 25) - DoScriptText(SAY_KILL, me); + Talk(SAY_KILL); } void UpdateAI(const uint32 diff) @@ -137,16 +137,16 @@ class boss_ragnaros : public CreatureScript switch (eventId) { case EVENT_INTRO_1: - DoScriptText(SAY_ARRIVAL1_RAG, me); + Talk(SAY_ARRIVAL1_RAG); break; case EVENT_INTRO_2: - DoScriptText(SAY_ARRIVAL3_RAG, me); + Talk(SAY_ARRIVAL3_RAG); break; case EVENT_INTRO_3: me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK1H); break; case EVENT_INTRO_4: - DoScriptText(SAY_ARRIVAL5_RAG, me); + Talk(SAY_ARRIVAL5_RAG); if (instance) if (Creature* executus = Unit::GetCreature(*me, instance->GetData64(BOSS_MAJORDOMO_EXECUTUS))) me->Kill(executus); @@ -205,13 +205,13 @@ class boss_ragnaros : public CreatureScript case EVENT_WRATH_OF_RAGNAROS: DoCastVictim(SPELL_WRATH_OF_RAGNAROS); if (urand(0, 1)) - DoScriptText(SAY_WRATH, me); + Talk(SAY_WRATH); events.ScheduleEvent(EVENT_WRATH_OF_RAGNAROS, 25000); break; case EVENT_HAND_OF_RAGNAROS: DoCast(me, SPELL_HAND_OF_RAGNAROS); if (urand(0, 1)) - DoScriptText(SAY_HAND, me); + Talk(SAY_HAND); events.ScheduleEvent(EVENT_HAND_OF_RAGNAROS, 20000); break; case EVENT_LAVA_BURST: @@ -229,7 +229,7 @@ class boss_ragnaros : public CreatureScript if (!_hasYelledMagmaBurst) { //Say our dialog - DoScriptText(SAY_MAGMABURST, me); + Talk(SAY_MAGMABURST); _hasYelledMagmaBurst = true; } } @@ -256,7 +256,7 @@ class boss_ragnaros : public CreatureScript if (!_hasSubmergedOnce) { - DoScriptText(SAY_REINFORCEMENTS1, me); + Talk(SAY_REINFORCEMENTS1); // summon 8 elementals for (uint8 i = 0; i < 8; ++i) @@ -272,7 +272,7 @@ class boss_ragnaros : public CreatureScript } else { - DoScriptText(SAY_REINFORCEMENTS2, me); + Talk(SAY_REINFORCEMENTS2); for (uint8 i = 0; i < 8; ++i) if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 7a6e9aab31d..78fc8d127b2 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -25,28 +25,27 @@ // texts signed for creature 28939 but used for 28939, 28940, 28610 enum win_friends { - SAY_PERSUADE1 = -1609501, - SAY_PERSUADE2 = -1609502, - SAY_PERSUADE3 = -1609503, - SAY_PERSUADE4 = -1609504, - SAY_PERSUADE5 = -1609505, - SAY_PERSUADE6 = -1609506, - SAY_PERSUADE7 = -1609507, - SAY_CRUSADER1 = -1609508, - SAY_CRUSADER2 = -1609509, - SAY_CRUSADER3 = -1609510, - SAY_CRUSADER4 = -1609511, - SAY_CRUSADER5 = -1609512, - SAY_CRUSADER6 = -1609513, - SAY_PERSUADED1 = -1609514, - SAY_PERSUADED2 = -1609515, - SAY_PERSUADED3 = -1609516, - SAY_PERSUADED4 = -1609517, - SAY_PERSUADED5 = -1609518, - SAY_PERSUADED6 = -1609519, - SPELL_PERSUASIVE_STRIKE = 52781 + SAY_CRUSADER = 1, + SAY_PERSUADED1 = 2, + SAY_PERSUADED2 = 3, + SAY_PERSUADED3 = 4, + SAY_PERSUADED4 = 5, + SAY_PERSUADED6 = 6, + SPELL_PERSUASIVE_STRIKE = 52781, + SPELL_THREAT_PULSE = 58111, + QUEST_HOW_TO_WIN_FRIENDS = 12720, }; +#define SAY_PERSUADED5 "LIES! The pain you are about to endure will be talked about for years to come!" + +#define SAY_PERSUADE1 "I'll tear the secrets from your soul! Tell me about the \"Crimson Dawn\" and your life may be spared!" +#define SAY_PERSUADE2 "Tell me what you know about \"Crimson Dawn\" or the beatings will continue!" +#define SAY_PERSUADE3 "I'm through being courteous with your kind, human! What is the \"Crimson Dawn\"?" +#define SAY_PERSUADE4 "Is your life worth so little? Just tell me what I need to know about \"Crimson Dawn\" and I'll end your suffering quickly." +#define SAY_PERSUADE5 "I can keep this up for a very long time, Scarlet dog! Tell me about the \"Crimson Dawn\"!" +#define SAY_PERSUADE6 "What is the \"Crimson Dawn\"?" +#define SAY_PERSUADE7 "\"Crimson Dawn\"! What is it! Speak!" + class npc_crusade_persuaded : public CreatureScript { public: @@ -61,97 +60,119 @@ public: { npc_crusade_persuadedAI(Creature* creature) : ScriptedAI(creature) {} - uint32 uiSpeech_timer; - uint32 uiSpeech_counter; - uint64 uiPlayerGUID; + uint32 speechTimer; + uint32 speechCounter; + uint64 playerGUID; void Reset() { - uiSpeech_timer = 0; - uiSpeech_counter = 0; - uiPlayerGUID = 0; + speechTimer = 0; + speechCounter = 0; + playerGUID = 0; me->SetReactState(REACT_AGGRESSIVE); me->RestoreFaction(); } void SpellHit(Unit* caster, const SpellInfo* spell) { - if (spell->Id == SPELL_PERSUASIVE_STRIKE && caster->GetTypeId() == TYPEID_PLAYER && me->isAlive() && !uiSpeech_counter) + if (spell->Id == SPELL_PERSUASIVE_STRIKE && caster->GetTypeId() == TYPEID_PLAYER && me->isAlive() && !speechCounter) { - if (CAST_PLR(caster)->GetQuestStatus(12720) == QUEST_STATUS_INCOMPLETE) + if (Player* player = caster->ToPlayer()) { - uiPlayerGUID = caster->GetGUID(); - uiSpeech_timer = 1000; - uiSpeech_counter = 1; - me->setFaction(caster->getFaction()); - me->CombatStop(true); - me->GetMotionMaster()->MoveIdle(); - me->SetReactState(REACT_PASSIVE); - DoCastAOE(58111, true); - - DoScriptText(RAND(SAY_PERSUADE1, SAY_PERSUADE2, SAY_PERSUADE3, - SAY_PERSUADE4, SAY_PERSUADE5, SAY_PERSUADE6, - SAY_PERSUADE7), caster); - - DoScriptText(RAND(SAY_CRUSADER1, SAY_CRUSADER2, SAY_CRUSADER3, - SAY_CRUSADER4, SAY_CRUSADER5, SAY_CRUSADER6), me); + if (player->GetQuestStatus(QUEST_HOW_TO_WIN_FRIENDS) == QUEST_STATUS_INCOMPLETE) + { + playerGUID = player->GetGUID(); + speechTimer = 1000; + speechCounter = 1; + me->setFaction(player->getFaction()); + me->CombatStop(true); + me->GetMotionMaster()->MoveIdle(); + me->SetReactState(REACT_PASSIVE); + DoCastAOE(SPELL_THREAT_PULSE, true); + + switch (urand(1, 7)) + { + case 1: + player->Say(SAY_PERSUADE1, LANG_UNIVERSAL); + break; + case 2: + player->Say(SAY_PERSUADE2, LANG_UNIVERSAL); + break; + case 3: + player->Say(SAY_PERSUADE3, LANG_UNIVERSAL); + break; + case 4: + player->Say(SAY_PERSUADE4, LANG_UNIVERSAL); + break; + case 5: + player->Say(SAY_PERSUADE5, LANG_UNIVERSAL); + break; + case 6: + player->Say(SAY_PERSUADE6, LANG_UNIVERSAL); + break; + case 7: + player->Say(SAY_PERSUADE7, LANG_UNIVERSAL); + break; + } + Talk(SAY_CRUSADER); + } } } } void UpdateAI(const uint32 diff) { - if (uiSpeech_counter) + if (speechCounter) { - if (uiSpeech_timer <= diff) + if (speechTimer <= diff) { - Player* player = Unit::GetPlayer(*me, uiPlayerGUID); + Player* player = Unit::GetPlayer(*me, playerGUID); if (!player) { EnterEvadeMode(); return; } - switch (uiSpeech_counter) + switch (speechCounter) { case 1: - DoScriptText(SAY_PERSUADED1, me); - uiSpeech_timer = 8000; + Talk(SAY_PERSUADED1); + speechTimer = 8000; break; case 2: - DoScriptText(SAY_PERSUADED2, me); - uiSpeech_timer = 8000; + Talk(SAY_PERSUADED2); + speechTimer = 8000; break; case 3: - DoScriptText(SAY_PERSUADED3, me); - uiSpeech_timer = 8000; + Talk(SAY_PERSUADED3); + speechTimer = 8000; break; case 4: - DoScriptText(SAY_PERSUADED4, me); - uiSpeech_timer = 8000; + Talk(SAY_PERSUADED4); + speechTimer = 8000; break; case 5: - DoScriptText(SAY_PERSUADED5, player); - uiSpeech_timer = 8000; + player->Say(SAY_PERSUADED5, LANG_UNIVERSAL); + speechTimer = 8000; break; case 6: - DoScriptText(SAY_PERSUADED6, me); + Talk(SAY_PERSUADED6); player->Kill(me); - //me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - //me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - uiSpeech_counter = 0; - player->GroupEventHappens(12720, me); + speechCounter = 0; + player->GroupEventHappens(QUEST_HOW_TO_WIN_FRIENDS, me); return; } - ++uiSpeech_counter; - DoCastAOE(58111, true); - } else uiSpeech_timer -= diff; + ++speechCounter; + DoCastAOE(SPELL_THREAT_PULSE, true); + + } else + speechTimer -= diff; return; } @@ -171,16 +192,16 @@ public: enum eKoltira { - SAY_BREAKOUT1 = -1609561, - SAY_BREAKOUT2 = -1609562, - SAY_BREAKOUT3 = -1609563, - SAY_BREAKOUT4 = -1609564, - SAY_BREAKOUT5 = -1609565, - SAY_BREAKOUT6 = -1609566, - SAY_BREAKOUT7 = -1609567, - SAY_BREAKOUT8 = -1609568, - SAY_BREAKOUT9 = -1609569, - SAY_BREAKOUT10 = -1609570, + SAY_BREAKOUT1 = 0, + SAY_BREAKOUT2 = 1, + SAY_BREAKOUT3 = 2, + SAY_BREAKOUT4 = 3, + SAY_BREAKOUT5 = 4, + SAY_BREAKOUT6 = 5, + SAY_BREAKOUT7 = 6, + SAY_BREAKOUT8 = 7, + SAY_BREAKOUT9 = 8, + SAY_BREAKOUT10 = 9, SPELL_KOLTIRA_TRANSFORM = 52899, SPELL_ANTI_MAGIC_ZONE = 52894, @@ -247,7 +268,7 @@ public: switch (waypointId) { case 0: - DoScriptText(SAY_BREAKOUT1, me); + Talk(SAY_BREAKOUT1); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); break; case 1: @@ -262,7 +283,7 @@ public: case 3: SetEscortPaused(true); me->SetStandState(UNIT_STAND_STATE_KNEEL); - DoScriptText(SAY_BREAKOUT2, me); + Talk(SAY_BREAKOUT2); DoCast(me, SPELL_ANTI_MAGIC_ZONE); // cast again that makes bubble up break; case 4: @@ -306,22 +327,22 @@ public: switch (m_uiWave) { case 0: - DoScriptText(SAY_BREAKOUT3, me); + Talk(SAY_BREAKOUT3); SummonAcolyte(3); m_uiWave_Timer = 20000; break; case 1: - DoScriptText(SAY_BREAKOUT4, me); + Talk(SAY_BREAKOUT4); SummonAcolyte(3); m_uiWave_Timer = 20000; break; case 2: - DoScriptText(SAY_BREAKOUT5, me); + Talk(SAY_BREAKOUT5); SummonAcolyte(4); m_uiWave_Timer = 20000; break; case 3: - DoScriptText(SAY_BREAKOUT6, me); + Talk(SAY_BREAKOUT6); me->SummonCreature(NPC_HIGH_INQUISITOR_VALROTH, 1642.329f, -6045.818f, 127.583f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); m_uiWave_Timer = 1000; break; @@ -331,7 +352,7 @@ public: if (!temp || !temp->isAlive()) { - DoScriptText(SAY_BREAKOUT8, me); + Talk(SAY_BREAKOUT8); m_uiWave_Timer = 5000; } else @@ -342,13 +363,13 @@ public: break; } case 5: - DoScriptText(SAY_BREAKOUT9, me); + Talk(SAY_BREAKOUT9); me->RemoveAurasDueToSpell(SPELL_ANTI_MAGIC_ZONE); // i do not know why the armor will also be removed m_uiWave_Timer = 2500; break; case 6: - DoScriptText(SAY_BREAKOUT10, me); + Talk(SAY_BREAKOUT10); SetEscortPaused(false); break; } @@ -366,8 +387,8 @@ public: //Scarlet courier enum ScarletCourierEnum { - SAY_TREE1 = -1609531, - SAY_TREE2 = -1609532, + SAY_TREE1 = 0, + SAY_TREE2 = 1, SPELL_SHOOT = 52818, GO_INCONSPICUOUS_TREE = 191144, NPC_SCARLET_COURIER = 29076 @@ -399,7 +420,7 @@ public: void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_TREE2, me); + Talk(SAY_TREE2); me->Dismount(); uiStage = 0; } @@ -425,7 +446,7 @@ public: me->SetWalk(true); if (GameObject* tree = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f)) { - DoScriptText(SAY_TREE1, me); + Talk(SAY_TREE1); float x, y, z; tree->GetContactPoint(me, x, y, z); me->GetMotionMaster()->MovePoint(1, x, y, z); @@ -455,12 +476,10 @@ public: enum valroth { - SAY_VALROTH1 = -1609581, - SAY_VALROTH2 = -1609582, - SAY_VALROTH3 = -1609583, - SAY_VALROTH4 = -1609584, - SAY_VALROTH5 = -1609585, - SAY_VALROTH6 = -1609586, + //SAY_VALROTH1 = 0, Unused + SAY_VALROTH_AGGRO = 1, + SAY_VALROTH_RAND = 2, + SAY_VALROTH_DEATH = 3, SPELL_RENEW = 38210, SPELL_INQUISITOR_PENANCE = 52922, SPELL_VALROTH_SMITE = 52926, @@ -494,7 +513,7 @@ public: void EnterCombat(Unit* who) { - DoScriptText(SAY_VALROTH2, me); + Talk(SAY_VALROTH_AGGRO); DoCast(who, SPELL_VALROTH_SMITE); } @@ -527,12 +546,12 @@ public: void Shout() { if (rand()%100 < 15) - DoScriptText(RAND(SAY_VALROTH3, SAY_VALROTH4, SAY_VALROTH5), me); + Talk(SAY_VALROTH_RAND); } void JustDied(Unit* killer) { - DoScriptText(SAY_VALROTH6, me); + Talk(SAY_VALROTH_DEATH); killer->CastSpell(me, SPELL_SUMMON_VALROTH_REMAINS, true); } }; @@ -545,60 +564,60 @@ public: //used by 29032, 29061, 29065, 29067, 29068, 29070, 29074, 29072, 29073, 29071 but signed for 29032 enum SpecialSurprise { - SAY_EXEC_START_1 = -1609025, // speech for all - SAY_EXEC_START_2 = -1609026, - SAY_EXEC_START_3 = -1609027, - SAY_EXEC_PROG_1 = -1609028, - SAY_EXEC_PROG_2 = -1609029, - SAY_EXEC_PROG_3 = -1609030, - SAY_EXEC_PROG_4 = -1609031, - SAY_EXEC_PROG_5 = -1609032, - SAY_EXEC_PROG_6 = -1609033, - SAY_EXEC_PROG_7 = -1609034, - SAY_EXEC_NAME_1 = -1609035, - SAY_EXEC_NAME_2 = -1609036, - SAY_EXEC_RECOG_1 = -1609037, - SAY_EXEC_RECOG_2 = -1609038, - SAY_EXEC_RECOG_3 = -1609039, - SAY_EXEC_RECOG_4 = -1609040, - SAY_EXEC_RECOG_5 = -1609041, - SAY_EXEC_RECOG_6 = -1609042, - SAY_EXEC_NOREM_1 = -1609043, - SAY_EXEC_NOREM_2 = -1609044, - SAY_EXEC_NOREM_3 = -1609045, - SAY_EXEC_NOREM_4 = -1609046, - SAY_EXEC_NOREM_5 = -1609047, - SAY_EXEC_NOREM_6 = -1609048, - SAY_EXEC_NOREM_7 = -1609049, - SAY_EXEC_NOREM_8 = -1609050, - SAY_EXEC_NOREM_9 = -1609051, - SAY_EXEC_THINK_1 = -1609052, - SAY_EXEC_THINK_2 = -1609053, - SAY_EXEC_THINK_3 = -1609054, - SAY_EXEC_THINK_4 = -1609055, - SAY_EXEC_THINK_5 = -1609056, - SAY_EXEC_THINK_6 = -1609057, - SAY_EXEC_THINK_7 = -1609058, - SAY_EXEC_THINK_8 = -1609059, - SAY_EXEC_THINK_9 = -1609060, - SAY_EXEC_THINK_10 = -1609061, - SAY_EXEC_LISTEN_1 = -1609062, - SAY_EXEC_LISTEN_2 = -1609063, - SAY_EXEC_LISTEN_3 = -1609064, - SAY_EXEC_LISTEN_4 = -1609065, - SAY_PLAGUEFIST = -1609066, - SAY_EXEC_TIME_1 = -1609067, - SAY_EXEC_TIME_2 = -1609068, - SAY_EXEC_TIME_3 = -1609069, - SAY_EXEC_TIME_4 = -1609070, - SAY_EXEC_TIME_5 = -1609071, - SAY_EXEC_TIME_6 = -1609072, - SAY_EXEC_TIME_7 = -1609073, - SAY_EXEC_TIME_8 = -1609074, - SAY_EXEC_TIME_9 = -1609075, - SAY_EXEC_TIME_10 = -1609076, - SAY_EXEC_WAITING = -1609077, - EMOTE_DIES = -1609078, + SAY_EXEC_START_1 = 0, // speech for all + SAY_EXEC_START_2 = 1, + SAY_EXEC_START_3 = 2, + SAY_EXEC_PROG_1 = 3, + SAY_EXEC_PROG_2 = 4, + SAY_EXEC_PROG_3 = 5, + SAY_EXEC_PROG_4 = 6, + SAY_EXEC_PROG_5 = 7, + SAY_EXEC_PROG_6 = 8, + SAY_EXEC_PROG_7 = 9, + SAY_EXEC_NAME_1 = 10, + SAY_EXEC_NAME_2 = 11, + SAY_EXEC_RECOG_1 = 12, + SAY_EXEC_RECOG_2 = 13, + SAY_EXEC_RECOG_3 = 14, + SAY_EXEC_RECOG_4 = 15, + SAY_EXEC_RECOG_5 = 16, + SAY_EXEC_RECOG_6 = 17, + SAY_EXEC_NOREM_1 = 18, + SAY_EXEC_NOREM_2 = 19, + SAY_EXEC_NOREM_3 = 20, + SAY_EXEC_NOREM_4 = 21, + SAY_EXEC_NOREM_5 = 22, + SAY_EXEC_NOREM_6 = 23, + SAY_EXEC_NOREM_7 = 24, + SAY_EXEC_NOREM_8 = 25, + SAY_EXEC_NOREM_9 = 26, + SAY_EXEC_THINK_1 = 27, + SAY_EXEC_THINK_2 = 28, + SAY_EXEC_THINK_3 = 29, + SAY_EXEC_THINK_4 = 30, + SAY_EXEC_THINK_5 = 31, + SAY_EXEC_THINK_6 = 32, + SAY_EXEC_THINK_7 = 33, + SAY_EXEC_THINK_8 = 34, + SAY_EXEC_THINK_9 = 35, + SAY_EXEC_THINK_10 = 36, + SAY_EXEC_LISTEN_1 = 37, + SAY_EXEC_LISTEN_2 = 38, + SAY_EXEC_LISTEN_3 = 39, + SAY_EXEC_LISTEN_4 = 40, + SAY_PLAGUEFIST = 41, + SAY_EXEC_TIME_1 = 42, + SAY_EXEC_TIME_2 = 43, + SAY_EXEC_TIME_3 = 44, + SAY_EXEC_TIME_4 = 45, + SAY_EXEC_TIME_5 = 46, + SAY_EXEC_TIME_6 = 47, + SAY_EXEC_TIME_7 = 48, + SAY_EXEC_TIME_8 = 49, + SAY_EXEC_TIME_9 = 50, + SAY_EXEC_TIME_10 = 51, + SAY_EXEC_WAITING = 52, + EMOTE_DIES = 53, NPC_PLAGUEFIST = 29053 }; @@ -709,28 +728,28 @@ public: case RACE_HUMAN: switch (ExecuteSpeech_Counter) { - case 0: DoScriptText(SAY_EXEC_START_1, me, player); break; + case 0: Talk(SAY_EXEC_START_1, player->GetGUID()); break; case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_5, me, player); break; - case 3: DoScriptText(SAY_EXEC_NAME_1, me, player); break; - case 4: DoScriptText(SAY_EXEC_RECOG_1, me, player); break; - case 5: DoScriptText(SAY_EXEC_NOREM_5, me, player); break; - case 6: DoScriptText(SAY_EXEC_THINK_7, me, player); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, player); break; + case 2: Talk(SAY_EXEC_PROG_5, player->GetGUID()); break; + case 3: Talk(SAY_EXEC_NAME_1, player->GetGUID()); break; + case 4: Talk(SAY_EXEC_RECOG_1, player->GetGUID()); break; + case 5: Talk(SAY_EXEC_NOREM_5, player->GetGUID()); break; + case 6: Talk(SAY_EXEC_THINK_7, player->GetGUID()); break; + case 7: Talk(SAY_EXEC_LISTEN_1, player->GetGUID()); break; case 8: if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, player); + Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID()); break; case 9: - DoScriptText(SAY_EXEC_TIME_6, me, player); + Talk(SAY_EXEC_TIME_6, player->GetGUID()); me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: - DoScriptText(SAY_EXEC_WAITING, me, player); + Talk(SAY_EXEC_WAITING, player->GetGUID()); break; case 11: - DoScriptText(EMOTE_DIES, me); + Talk(EMOTE_DIES); me->setDeathState(JUST_DIED); me->SetHealth(0); return; @@ -739,28 +758,28 @@ public: case RACE_ORC: switch (ExecuteSpeech_Counter) { - case 0: DoScriptText(SAY_EXEC_START_1, me, player); break; + case 0: Talk(SAY_EXEC_START_1, player->GetGUID()); break; case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_6, me, player); break; - case 3: DoScriptText(SAY_EXEC_NAME_1, me, player); break; - case 4: DoScriptText(SAY_EXEC_RECOG_1, me, player); break; - case 5: DoScriptText(SAY_EXEC_NOREM_7, me, player); break; - case 6: DoScriptText(SAY_EXEC_THINK_8, me, player); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, player); break; + case 2: Talk(SAY_EXEC_PROG_6, player->GetGUID()); break; + case 3: Talk(SAY_EXEC_NAME_1, player->GetGUID()); break; + case 4: Talk(SAY_EXEC_RECOG_1, player->GetGUID()); break; + case 5: Talk(SAY_EXEC_NOREM_7, player->GetGUID()); break; + case 6: Talk(SAY_EXEC_THINK_8, player->GetGUID()); break; + case 7: Talk(SAY_EXEC_LISTEN_1, player->GetGUID()); break; case 8: if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, player); + Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID()); break; case 9: - DoScriptText(SAY_EXEC_TIME_8, me, player); + Talk(SAY_EXEC_TIME_8, player->GetGUID()); me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: - DoScriptText(SAY_EXEC_WAITING, me, player); + Talk(SAY_EXEC_WAITING, player->GetGUID()); break; case 11: - DoScriptText(EMOTE_DIES, me); + Talk(EMOTE_DIES); me->setDeathState(JUST_DIED); me->SetHealth(0); return; @@ -769,28 +788,28 @@ public: case RACE_DWARF: switch (ExecuteSpeech_Counter) { - case 0: DoScriptText(SAY_EXEC_START_2, me, player); break; + case 0: Talk(SAY_EXEC_START_2, player->GetGUID()); break; case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_2, me, player); break; - case 3: DoScriptText(SAY_EXEC_NAME_1, me, player); break; - case 4: DoScriptText(SAY_EXEC_RECOG_3, me, player); break; - case 5: DoScriptText(SAY_EXEC_NOREM_2, me, player); break; - case 6: DoScriptText(SAY_EXEC_THINK_5, me, player); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_2, me, player); break; + case 2: Talk(SAY_EXEC_PROG_2, player->GetGUID()); break; + case 3: Talk(SAY_EXEC_NAME_1, player->GetGUID()); break; + case 4: Talk(SAY_EXEC_RECOG_3, player->GetGUID()); break; + case 5: Talk(SAY_EXEC_NOREM_2, player->GetGUID()); break; + case 6: Talk(SAY_EXEC_THINK_5, player->GetGUID()); break; + case 7: Talk(SAY_EXEC_LISTEN_2, player->GetGUID()); break; case 8: if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, player); + Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID()); break; case 9: - DoScriptText(SAY_EXEC_TIME_3, me, player); + Talk(SAY_EXEC_TIME_3, player->GetGUID()); me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: - DoScriptText(SAY_EXEC_WAITING, me, player); + Talk(SAY_EXEC_WAITING, player->GetGUID()); break; case 11: - DoScriptText(EMOTE_DIES, me); + Talk(EMOTE_DIES); me->setDeathState(JUST_DIED); me->SetHealth(0); return; @@ -799,28 +818,28 @@ public: case RACE_NIGHTELF: switch (ExecuteSpeech_Counter) { - case 0: DoScriptText(SAY_EXEC_START_1, me, player); break; + case 0: Talk(SAY_EXEC_START_1, player->GetGUID()); break; case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_5, me, player); break; - case 3: DoScriptText(SAY_EXEC_NAME_1, me, player); break; - case 4: DoScriptText(SAY_EXEC_RECOG_1, me, player); break; - case 5: DoScriptText(SAY_EXEC_NOREM_6, me, player); break; - case 6: DoScriptText(SAY_EXEC_THINK_2, me, player); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, player); break; + case 2: Talk(SAY_EXEC_PROG_5, player->GetGUID()); break; + case 3: Talk(SAY_EXEC_NAME_1, player->GetGUID()); break; + case 4: Talk(SAY_EXEC_RECOG_1, player->GetGUID()); break; + case 5: Talk(SAY_EXEC_NOREM_6, player->GetGUID()); break; + case 6: Talk(SAY_EXEC_THINK_2, player->GetGUID()); break; + case 7: Talk(SAY_EXEC_LISTEN_1, player->GetGUID()); break; case 8: if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, player); + Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID()); break; case 9: - DoScriptText(SAY_EXEC_TIME_7, me, player); + Talk(SAY_EXEC_TIME_7, player->GetGUID()); me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: - DoScriptText(SAY_EXEC_WAITING, me, player); + Talk(SAY_EXEC_WAITING, player->GetGUID()); break; case 11: - DoScriptText(EMOTE_DIES, me); + Talk(EMOTE_DIES); me->setDeathState(JUST_DIED); me->SetHealth(0); return; @@ -829,28 +848,28 @@ public: case RACE_UNDEAD_PLAYER: switch (ExecuteSpeech_Counter) { - case 0: DoScriptText(SAY_EXEC_START_1, me, player); break; + case 0: Talk(SAY_EXEC_START_1, player->GetGUID()); break; case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_3, me, player); break; - case 3: DoScriptText(SAY_EXEC_NAME_1, me, player); break; - case 4: DoScriptText(SAY_EXEC_RECOG_4, me, player); break; - case 5: DoScriptText(SAY_EXEC_NOREM_3, me, player); break; - case 6: DoScriptText(SAY_EXEC_THINK_1, me, player); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_3, me, player); break; + case 2: Talk(SAY_EXEC_PROG_3, player->GetGUID()); break; + case 3: Talk(SAY_EXEC_NAME_1, player->GetGUID()); break; + case 4: Talk(SAY_EXEC_RECOG_4, player->GetGUID()); break; + case 5: Talk(SAY_EXEC_NOREM_3, player->GetGUID()); break; + case 6: Talk(SAY_EXEC_THINK_1, player->GetGUID()); break; + case 7: Talk(SAY_EXEC_LISTEN_3, player->GetGUID()); break; case 8: if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, player); + Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID()); break; case 9: - DoScriptText(SAY_EXEC_TIME_4, me, player); + Talk(SAY_EXEC_TIME_4, player->GetGUID()); me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: - DoScriptText(SAY_EXEC_WAITING, me, player); + Talk(SAY_EXEC_WAITING, player->GetGUID()); break; case 11: - DoScriptText(EMOTE_DIES, me); + Talk(EMOTE_DIES); me->setDeathState(JUST_DIED); me->SetHealth(0); return; @@ -859,28 +878,28 @@ public: case RACE_TAUREN: switch (ExecuteSpeech_Counter) { - case 0: DoScriptText(SAY_EXEC_START_1, me, player); break; + case 0: Talk(SAY_EXEC_START_1, player->GetGUID()); break; case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_1, me, player); break; - case 3: DoScriptText(SAY_EXEC_NAME_1, me, player); break; - case 4: DoScriptText(SAY_EXEC_RECOG_5, me, player); break; - case 5: DoScriptText(SAY_EXEC_NOREM_8, me, player); break; - case 6: DoScriptText(SAY_EXEC_THINK_9, me, player); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, player); break; + case 2: Talk(SAY_EXEC_PROG_1, player->GetGUID()); break; + case 3: Talk(SAY_EXEC_NAME_1, player->GetGUID()); break; + case 4: Talk(SAY_EXEC_RECOG_5, player->GetGUID()); break; + case 5: Talk(SAY_EXEC_NOREM_8, player->GetGUID()); break; + case 6: Talk(SAY_EXEC_THINK_9, player->GetGUID()); break; + case 7: Talk(SAY_EXEC_LISTEN_1, player->GetGUID()); break; case 8: if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, player); + Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID()); break; case 9: - DoScriptText(SAY_EXEC_TIME_9, me, player); + Talk(SAY_EXEC_TIME_9, player->GetGUID()); me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: - DoScriptText(SAY_EXEC_WAITING, me, player); + Talk(SAY_EXEC_WAITING, player->GetGUID()); break; case 11: - DoScriptText(EMOTE_DIES, me); + Talk(EMOTE_DIES); me->setDeathState(JUST_DIED); me->SetHealth(0); return; @@ -889,28 +908,28 @@ public: case RACE_GNOME: switch (ExecuteSpeech_Counter) { - case 0: DoScriptText(SAY_EXEC_START_1, me, player); break; + case 0: Talk(SAY_EXEC_START_1, player->GetGUID()); break; case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_4, me, player); break; - case 3: DoScriptText(SAY_EXEC_NAME_1, me, player); break; - case 4: DoScriptText(SAY_EXEC_RECOG_1, me, player); break; - case 5: DoScriptText(SAY_EXEC_NOREM_4, me, player); break; - case 6: DoScriptText(SAY_EXEC_THINK_6, me, player); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, player); break; + case 2: Talk(SAY_EXEC_PROG_4, player->GetGUID()); break; + case 3: Talk(SAY_EXEC_NAME_1, player->GetGUID()); break; + case 4: Talk(SAY_EXEC_RECOG_1, player->GetGUID()); break; + case 5: Talk(SAY_EXEC_NOREM_4, player->GetGUID()); break; + case 6: Talk(SAY_EXEC_THINK_6, player->GetGUID()); break; + case 7: Talk(SAY_EXEC_LISTEN_1, player->GetGUID()); break; case 8: if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, player); + Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID()); break; case 9: - DoScriptText(SAY_EXEC_TIME_5, me, player); + Talk(SAY_EXEC_TIME_5, player->GetGUID()); me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: - DoScriptText(SAY_EXEC_WAITING, me, player); + Talk(SAY_EXEC_WAITING, player->GetGUID()); break; case 11: - DoScriptText(EMOTE_DIES, me); + Talk(EMOTE_DIES); me->setDeathState(JUST_DIED); me->SetHealth(0); return; @@ -919,28 +938,28 @@ public: case RACE_TROLL: switch (ExecuteSpeech_Counter) { - case 0: DoScriptText(SAY_EXEC_START_3, me, player); break; + case 0: Talk(SAY_EXEC_START_3, player->GetGUID()); break; case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_7, me, player); break; - case 3: DoScriptText(SAY_EXEC_NAME_2, me, player); break; - case 4: DoScriptText(SAY_EXEC_RECOG_6, me, player); break; - case 5: DoScriptText(SAY_EXEC_NOREM_9, me, player); break; - case 6: DoScriptText(SAY_EXEC_THINK_10, me, player); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_4, me, player); break; + case 2: Talk(SAY_EXEC_PROG_7, player->GetGUID()); break; + case 3: Talk(SAY_EXEC_NAME_2, player->GetGUID()); break; + case 4: Talk(SAY_EXEC_RECOG_6, player->GetGUID()); break; + case 5: Talk(SAY_EXEC_NOREM_9, player->GetGUID()); break; + case 6: Talk(SAY_EXEC_THINK_10, player->GetGUID()); break; + case 7: Talk(SAY_EXEC_LISTEN_4, player->GetGUID()); break; case 8: if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, player); + Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID()); break; case 9: - DoScriptText(SAY_EXEC_TIME_10, me, player); + Talk(SAY_EXEC_TIME_10, player->GetGUID()); me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: - DoScriptText(SAY_EXEC_WAITING, me, player); + Talk(SAY_EXEC_WAITING, player->GetGUID()); break; case 11: - DoScriptText(EMOTE_DIES, me); + Talk(EMOTE_DIES); me->setDeathState(JUST_DIED); me->SetHealth(0); return; @@ -949,28 +968,28 @@ public: case RACE_BLOODELF: switch (ExecuteSpeech_Counter) { - case 0: DoScriptText(SAY_EXEC_START_1, me, player); break; + case 0: Talk(SAY_EXEC_START_1, player->GetGUID()); break; case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_1, me, player); break; - case 3: DoScriptText(SAY_EXEC_NAME_1, me, player); break; - case 4: DoScriptText(SAY_EXEC_RECOG_1, me, player); break; + case 2: Talk(SAY_EXEC_PROG_1, player->GetGUID()); break; + case 3: Talk(SAY_EXEC_NAME_1, player->GetGUID()); break; + case 4: Talk(SAY_EXEC_RECOG_1, player->GetGUID()); break; //case 5: //unknown - case 6: DoScriptText(SAY_EXEC_THINK_3, me, player); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, player); break; + case 6: Talk(SAY_EXEC_THINK_3, player->GetGUID()); break; + case 7: Talk(SAY_EXEC_LISTEN_1, player->GetGUID()); break; case 8: if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, player); + Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID()); break; case 9: - DoScriptText(SAY_EXEC_TIME_1, me, player); + Talk(SAY_EXEC_TIME_1, player->GetGUID()); me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: - DoScriptText(SAY_EXEC_WAITING, me, player); + Talk(SAY_EXEC_WAITING, player->GetGUID()); break; case 11: - DoScriptText(EMOTE_DIES, me); + Talk(EMOTE_DIES); me->setDeathState(JUST_DIED); me->SetHealth(0); return; @@ -979,28 +998,28 @@ public: case RACE_DRAENEI: switch (ExecuteSpeech_Counter) { - case 0: DoScriptText(SAY_EXEC_START_1, me, player); break; + case 0: Talk(SAY_EXEC_START_1, player->GetGUID()); break; case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_1, me, player); break; - case 3: DoScriptText(SAY_EXEC_NAME_1, me, player); break; - case 4: DoScriptText(SAY_EXEC_RECOG_2, me, player); break; - case 5: DoScriptText(SAY_EXEC_NOREM_1, me, player); break; - case 6: DoScriptText(SAY_EXEC_THINK_4, me, player); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, player); break; + case 2: Talk(SAY_EXEC_PROG_1, player->GetGUID()); break; + case 3: Talk(SAY_EXEC_NAME_1, player->GetGUID()); break; + case 4: Talk(SAY_EXEC_RECOG_2, player->GetGUID()); break; + case 5: Talk(SAY_EXEC_NOREM_1, player->GetGUID()); break; + case 6: Talk(SAY_EXEC_THINK_4, player->GetGUID()); break; + case 7: Talk(SAY_EXEC_LISTEN_1, player->GetGUID()); break; case 8: if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, player); + Plaguefist->AI()->Talk(SAY_PLAGUEFIST, player->GetGUID()); break; case 9: - DoScriptText(SAY_EXEC_TIME_2, me, player); + Talk(SAY_EXEC_TIME_2, player->GetGUID()); me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; case 10: - DoScriptText(SAY_EXEC_WAITING, me, player); + Talk(SAY_EXEC_WAITING, player->GetGUID()); break; case 11: - DoScriptText(EMOTE_DIES, me); + Talk(EMOTE_DIES); me->setDeathState(JUST_DIED); me->SetHealth(0); return; diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 686f5954e77..8f410cf62bc 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -51,93 +51,78 @@ enum mograine WORLD_STATE_COUNTDOWN = 3603, WORLD_STATE_EVENT_BEGIN = 3605, - SAY_LIGHT_OF_DAWN01 = -1609201, // pre text - SAY_LIGHT_OF_DAWN02 = -1609202, - SAY_LIGHT_OF_DAWN03 = -1609203, - SAY_LIGHT_OF_DAWN04 = -1609204, // intro - SAY_LIGHT_OF_DAWN05 = -1609205, - SAY_LIGHT_OF_DAWN06 = -1609206, - SAY_LIGHT_OF_DAWN07 = -1609207, // During the fight - Korfax, Champion of the Light - SAY_LIGHT_OF_DAWN08 = -1609208, // Lord Maxwell Tyrosus - SAY_LIGHT_OF_DAWN09 = -1609209, // Highlord Darion Mograine - SAY_LIGHT_OF_DAWN10 = -1609210, - SAY_LIGHT_OF_DAWN11 = -1609211, - SAY_LIGHT_OF_DAWN12 = -1609212, - SAY_LIGHT_OF_DAWN13 = -1609213, - SAY_LIGHT_OF_DAWN14 = -1609214, - SAY_LIGHT_OF_DAWN15 = -1609215, - SAY_LIGHT_OF_DAWN16 = -1609216, - SAY_LIGHT_OF_DAWN17 = -1609217, - SAY_LIGHT_OF_DAWN18 = -1609218, - SAY_LIGHT_OF_DAWN19 = -1609219, - SAY_LIGHT_OF_DAWN20 = -1609220, - SAY_LIGHT_OF_DAWN21 = -1609221, - SAY_LIGHT_OF_DAWN22 = -1609222, - SAY_LIGHT_OF_DAWN23 = -1609223, - SAY_LIGHT_OF_DAWN24 = -1609224, - SAY_LIGHT_OF_DAWN25 = -1609225, // After the fight - SAY_LIGHT_OF_DAWN26 = -1609226, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN27 = -1609227, // Highlord Darion Mograine - SAY_LIGHT_OF_DAWN28 = -1609228, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN29 = -1609229, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN30 = -1609230, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN31 = -1609231, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN32 = -1609232, // Highlord Alexandros Mograine - SAY_LIGHT_OF_DAWN33 = -1609233, // Highlord Darion Mograine - SAY_LIGHT_OF_DAWN34 = -1609234, // Highlord Darion Mograine - SAY_LIGHT_OF_DAWN35 = -1609235, // Darion Mograine - SAY_LIGHT_OF_DAWN36 = -1609236, // Darion Mograine - SAY_LIGHT_OF_DAWN37 = -1609237, // Highlord Alexandros Mograine - SAY_LIGHT_OF_DAWN38 = -1609238, // Darion Mograine - SAY_LIGHT_OF_DAWN39 = -1609239, // Highlord Alexandros Mograine - SAY_LIGHT_OF_DAWN40 = -1609240, // Darion Mograine - SAY_LIGHT_OF_DAWN41 = -1609241, // Highlord Alexandros Mograine - SAY_LIGHT_OF_DAWN42 = -1609242, // Highlord Alexandros Mograine - SAY_LIGHT_OF_DAWN43 = -1609243, // The Lich King - SAY_LIGHT_OF_DAWN44 = -1609244, // Highlord Darion Mograine - SAY_LIGHT_OF_DAWN45 = -1609245, // The Lich King - SAY_LIGHT_OF_DAWN46 = -1609246, // The Lich King - SAY_LIGHT_OF_DAWN47 = -1609247, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN48 = -1609248, // The Lich King - SAY_LIGHT_OF_DAWN49 = -1609249, // The Lich King - SAY_LIGHT_OF_DAWN50 = -1609250, // Lord Maxwell Tyrosus - SAY_LIGHT_OF_DAWN51 = -1609251, // The Lich King - SAY_LIGHT_OF_DAWN52 = -1609252, // Highlord Darion Mograine - SAY_LIGHT_OF_DAWN53 = -1609253, // Highlord Darion Mograine - SAY_LIGHT_OF_DAWN54 = -1609254, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN55 = -1609255, // The Lich King - SAY_LIGHT_OF_DAWN56 = -1609256, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN57 = -1609257, // The Lich King - SAY_LIGHT_OF_DAWN58 = -1609258, // The Lich King - SAY_LIGHT_OF_DAWN59 = -1609259, // The Lich King - SAY_LIGHT_OF_DAWN60 = -1609260, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN61 = -1609261, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN62 = -1609262, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN63 = -1609263, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN64 = -1609264, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN65 = -1609265, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN66 = -1609266, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN67 = -1609267, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN68 = -1609268, // Highlord Darion Mograine - - EMOTE_LIGHT_OF_DAWN01 = -1609269, // Emotes - EMOTE_LIGHT_OF_DAWN02 = -1609270, - EMOTE_LIGHT_OF_DAWN03 = -1609271, - EMOTE_LIGHT_OF_DAWN04 = -1609272, - EMOTE_LIGHT_OF_DAWN05 = -1609273, - EMOTE_LIGHT_OF_DAWN06 = -1609274, - EMOTE_LIGHT_OF_DAWN07 = -1609275, - EMOTE_LIGHT_OF_DAWN08 = -1609276, - EMOTE_LIGHT_OF_DAWN09 = -1609277, - EMOTE_LIGHT_OF_DAWN10 = -1609278, - EMOTE_LIGHT_OF_DAWN11 = -1609279, - EMOTE_LIGHT_OF_DAWN12 = -1609280, - EMOTE_LIGHT_OF_DAWN13 = -1609281, - EMOTE_LIGHT_OF_DAWN14 = -1609282, - EMOTE_LIGHT_OF_DAWN15 = -1609283, - EMOTE_LIGHT_OF_DAWN16 = -1609284, - EMOTE_LIGHT_OF_DAWN17 = -1609285, - EMOTE_LIGHT_OF_DAWN18 = -1609286, + SAY_LIGHT_OF_DAWN01 = 0, // pre text + SAY_LIGHT_OF_DAWN02 = 1, + SAY_LIGHT_OF_DAWN03 = 2, + SAY_LIGHT_OF_DAWN04 = 3, // intro + SAY_LIGHT_OF_DAWN05 = 4, + SAY_LIGHT_OF_DAWN06 = 5, + SAY_LIGHT_OF_DAWN07 = 6, // During the fight - Korfax, Champion of the Light + SAY_LIGHT_OF_DAWN08 = 7, // Lord Maxwell Tyrosus + SAY_LIGHT_OF_DAWN09 = 8, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN25 = 24, // After the fight + SAY_LIGHT_OF_DAWN26 = 25, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN27 = 26, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN28 = 27, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN29 = 28, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN30 = 29, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN31 = 30, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN32 = 31, // Highlord Alexandros Mograine + SAY_LIGHT_OF_DAWN33 = 32, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN34 = 33, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN35 = 34, // Darion Mograine + SAY_LIGHT_OF_DAWN36 = 35, // Darion Mograine + SAY_LIGHT_OF_DAWN37 = 36, // Highlord Alexandros Mograine + SAY_LIGHT_OF_DAWN38 = 37, // Darion Mograine + SAY_LIGHT_OF_DAWN39 = 38, // Highlord Alexandros Mograine + SAY_LIGHT_OF_DAWN40 = 39, // Darion Mograine + SAY_LIGHT_OF_DAWN41 = 40, // Highlord Alexandros Mograine + SAY_LIGHT_OF_DAWN42 = 41, // Highlord Alexandros Mograine + SAY_LIGHT_OF_DAWN43 = 42, // The Lich King + SAY_LIGHT_OF_DAWN44 = 43, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN45 = 44, // The Lich King + SAY_LIGHT_OF_DAWN46 = 45, // The Lich King + SAY_LIGHT_OF_DAWN47 = 46, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN48 = 47, // The Lich King + SAY_LIGHT_OF_DAWN49 = 48, // The Lich King + SAY_LIGHT_OF_DAWN50 = 49, // Lord Maxwell Tyrosus + SAY_LIGHT_OF_DAWN51 = 50, // The Lich King + SAY_LIGHT_OF_DAWN52 = 51, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN53 = 52, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN54 = 53, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN55 = 54, // The Lich King + SAY_LIGHT_OF_DAWN56 = 55, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN57 = 56, // The Lich King + SAY_LIGHT_OF_DAWN58 = 57, // The Lich King + SAY_LIGHT_OF_DAWN59 = 58, // The Lich King + SAY_LIGHT_OF_DAWN60 = 59, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN61 = 60, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN62 = 61, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN63 = 62, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN64 = 63, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN65 = 64, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN66 = 65, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN67 = 66, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN68 = 67, // Highlord Darion Mograine + + EMOTE_LIGHT_OF_DAWN01 = 68, // Emotes + EMOTE_LIGHT_OF_DAWN02 = 69, + EMOTE_LIGHT_OF_DAWN03 = 70, + EMOTE_LIGHT_OF_DAWN04 = 71, + EMOTE_LIGHT_OF_DAWN05 = 72, + EMOTE_LIGHT_OF_DAWN06 = 73, + EMOTE_LIGHT_OF_DAWN07 = 74, + EMOTE_LIGHT_OF_DAWN08 = 75, + EMOTE_LIGHT_OF_DAWN09 = 76, + EMOTE_LIGHT_OF_DAWN10 = 77, + EMOTE_LIGHT_OF_DAWN11 = 78, + EMOTE_LIGHT_OF_DAWN12 = 79, + EMOTE_LIGHT_OF_DAWN13 = 80, + EMOTE_LIGHT_OF_DAWN14 = 81, + EMOTE_LIGHT_OF_DAWN15 = 82, + EMOTE_LIGHT_OF_DAWN16 = 83, + EMOTE_LIGHT_OF_DAWN17 = 84, + EMOTE_LIGHT_OF_DAWN18 = 85, GO_LIGHT_OF_DAWN = 191330, SPELL_THE_LIGHT_OF_DAWN_Q = 53606, // quest credit @@ -512,9 +497,9 @@ public: SetHoldState(true); SpawnNPC(); if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN07, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN07); if (Creature* temp = Unit::GetCreature(*me, uiMaxwellGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN08, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN08); for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) NPCChangeTarget(uiGhoulGUID[i]); @@ -546,7 +531,7 @@ public: { //Unit* pTirion = Unit::GetCreature(*me, uiTirionGUID); - DoScriptText(EMOTE_LIGHT_OF_DAWN05, me); + Talk(EMOTE_LIGHT_OF_DAWN05); if (me->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) me->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); if (Creature* temp = Unit::GetCreature(*me, uiKoltiraGUID)) @@ -583,7 +568,7 @@ public: } break; case 4: - DoScriptText(SAY_LIGHT_OF_DAWN27, me); + Talk(SAY_LIGHT_OF_DAWN27); me->SetStandState(UNIT_STAND_STATE_KNEEL); if (Creature* temp = Unit::GetCreature(*me, uiKoltiraGUID)) @@ -593,7 +578,7 @@ public: SetHoldState(true); break; case 5: - DoScriptText(SAY_LIGHT_OF_DAWN33, me); + Talk(SAY_LIGHT_OF_DAWN33); SetHoldState(true); break; case 6: @@ -609,7 +594,7 @@ public: me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_UNEQUIP)); if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) me->CastSpell(temp, SPELL_ASHBRINGER, true); - DoScriptText(EMOTE_LIGHT_OF_DAWN14, me); + Talk(EMOTE_LIGHT_OF_DAWN14); SetHoldState(true); break; } @@ -645,7 +630,7 @@ public: break; case 2: - DoScriptText(SAY_LIGHT_OF_DAWN04, me); + Talk(SAY_LIGHT_OF_DAWN04); if (Creature* pKoltira = GetClosestCreatureWithEntry(me, NPC_KOLTIRA_DEATHWEAVER, 50.0f)) uiKoltiraGUID = pKoltira->GetGUID(); if (Creature* pOrbaz = GetClosestCreatureWithEntry(me, NPC_ORBAZ_BLOODBANE, 50.0f)) @@ -656,7 +641,7 @@ public: break; case 3: // rise - DoScriptText(SAY_LIGHT_OF_DAWN05, me); + Talk(SAY_LIGHT_OF_DAWN05); JumpToNextStep(3000); break; @@ -734,7 +719,7 @@ public: break; case 8: // summon announce - DoScriptText(SAY_LIGHT_OF_DAWN06, me); + Talk(SAY_LIGHT_OF_DAWN06); JumpToNextStep(5000); break; @@ -773,34 +758,34 @@ public: // ******* After battle ***************************************************************** case 11: // Tirion starts to speak if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN28, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN28); JumpToNextStep(21000); break; case 12: if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN29, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN29); JumpToNextStep(13000); break; case 13: if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN30, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN30); JumpToNextStep(13000); break; case 14: me->SetStandState(UNIT_STAND_STATE_STAND); - DoScriptText(SAY_LIGHT_OF_DAWN31, me); + Talk(SAY_LIGHT_OF_DAWN31); JumpToNextStep(7000); break; case 15: // summon gate - if (Unit* temp = me->SummonCreature(NPC_HIGHLORD_ALEXANDROS_MOGRAINE, LightofDawnLoc[22].x, LightofDawnLoc[22].y, LightofDawnLoc[22].z, LightofDawnLoc[22].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) + if (Creature* temp = me->SummonCreature(NPC_HIGHLORD_ALEXANDROS_MOGRAINE, LightofDawnLoc[22].x, LightofDawnLoc[22].y, LightofDawnLoc[22].z, LightofDawnLoc[22].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) { temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); temp->CastSpell(temp, SPELL_ALEXANDROS_MOGRAINE_SPAWN, true); - DoScriptText(EMOTE_LIGHT_OF_DAWN06, temp); + temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN06); uiAlexandrosGUID = temp->GetGUID(); } JumpToNextStep(4000); @@ -811,7 +796,7 @@ public: { temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[23].x, LightofDawnLoc[23].y, LightofDawnLoc[23].z); - DoScriptText(SAY_LIGHT_OF_DAWN32, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN32); } SetHoldState(false); // makes darion turns back JumpToNextStep(5000); @@ -819,14 +804,14 @@ public: case 17: me->SetStandState(UNIT_STAND_STATE_KNEEL); - DoScriptText(SAY_LIGHT_OF_DAWN34, me); + Talk(SAY_LIGHT_OF_DAWN34); JumpToNextStep(5000); break; case 18: // Darion's spirit out - if (Unit* temp = me->SummonCreature(NPC_DARION_MOGRAINE, LightofDawnLoc[24].x, LightofDawnLoc[24].y, LightofDawnLoc[24].z, LightofDawnLoc[24].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) + if (Creature* temp = me->SummonCreature(NPC_DARION_MOGRAINE, LightofDawnLoc[24].x, LightofDawnLoc[24].y, LightofDawnLoc[24].z, LightofDawnLoc[24].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) { - DoScriptText(SAY_LIGHT_OF_DAWN35, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN35); temp->SetWalk(false); uiDarionGUID = temp->GetGUID(); } @@ -836,7 +821,7 @@ public: case 19: // runs to father if (Creature* temp = Unit::GetCreature(*me, uiDarionGUID)) { - DoScriptText(EMOTE_LIGHT_OF_DAWN07, temp); + temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN07); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[25].x, LightofDawnLoc[25].y, LightofDawnLoc[25].z); } JumpToNextStep(4000); @@ -844,31 +829,31 @@ public: case 20: if (Creature* temp = Unit::GetCreature(*me, uiDarionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN36, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN36); JumpToNextStep(4000); break; case 21: if (Creature* temp = Unit::GetCreature(*me, uiDarionGUID)) - DoScriptText(EMOTE_LIGHT_OF_DAWN08, temp); + temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN08); JumpToNextStep(4000); break; case 22: if (Creature* temp = Unit::GetCreature(*me, uiAlexandrosGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN37, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN37); JumpToNextStep(8000); break; case 23: if (Creature* temp = Unit::GetCreature(*me, uiDarionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN38, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN38); JumpToNextStep(8000); break; case 24: if (Creature* temp = Unit::GetCreature(*me, uiAlexandrosGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN39, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN39); if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) // Tirion moves forward here temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[1].x, LightofDawnLoc[1].y, LightofDawnLoc[1].z); @@ -878,13 +863,13 @@ public: case 25: if (Creature* temp = Unit::GetCreature(*me, uiDarionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN40, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN40); JumpToNextStep(11000); break; case 26: if (Creature* temp = Unit::GetCreature(*me, uiAlexandrosGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN41, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN41); JumpToNextStep(5000); break; @@ -896,14 +881,14 @@ public: case 28: if (Creature* temp = Unit::GetCreature(*me, uiAlexandrosGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN42, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN42); JumpToNextStep(6000); break; case 29: // lich king spawns - if (Unit* temp = me->SummonCreature(NPC_THE_LICH_KING, LightofDawnLoc[26].x, LightofDawnLoc[26].y, LightofDawnLoc[26].z, LightofDawnLoc[26].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) + if (Creature* temp = me->SummonCreature(NPC_THE_LICH_KING, LightofDawnLoc[26].x, LightofDawnLoc[26].y, LightofDawnLoc[26].z, LightofDawnLoc[26].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) { - DoScriptText(SAY_LIGHT_OF_DAWN43, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN43); uiLichKingGUID = temp->GetGUID(); if (Unit* pAlex = Unit::GetCreature(*me, uiAlexandrosGUID)) temp->CastSpell(pAlex, SPELL_SOUL_FEAST_ALEX, false); @@ -914,21 +899,21 @@ public: case 30: if (Creature* temp = Unit::GetCreature(*me, uiAlexandrosGUID)) // just hide him { - DoScriptText(EMOTE_LIGHT_OF_DAWN09, temp); + temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN09); temp->SetVisible(false); } if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) { temp->InterruptNonMeleeSpells(false); - DoScriptText(SAY_LIGHT_OF_DAWN45, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN45); } JumpToNextStep(3000); break; case 31: me->SetStandState(UNIT_STAND_STATE_STAND); - DoScriptText(EMOTE_LIGHT_OF_DAWN10, me); - DoScriptText(SAY_LIGHT_OF_DAWN44, me); + Talk(EMOTE_LIGHT_OF_DAWN10); + Talk(SAY_LIGHT_OF_DAWN44); JumpToNextStep(3000); break; @@ -952,7 +937,7 @@ public: if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) { temp->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - DoScriptText(SAY_LIGHT_OF_DAWN46, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN46); } me->SetSpeed(MOVE_RUN, 6.0f); me->SetStandState(UNIT_STAND_STATE_DEAD); @@ -967,33 +952,33 @@ public: case 38: if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN47, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN47); JumpToNextStep(8000); break; case 39: if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN48, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN48); JumpToNextStep(15000); break; case 40: if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN49, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN49); JumpToNextStep(17000); break; case 41: // Lich king - Apocalypse if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) { - DoScriptText(EMOTE_LIGHT_OF_DAWN11, temp); - DoScriptText(SAY_LIGHT_OF_DAWN51, temp); - if (Unit* pTirion = Unit::GetCreature(*me, uiTirionGUID)) + temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN11); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN51); + if (Creature* pTirion = Unit::GetCreature(*me, uiTirionGUID)) { pTirion->SetStandState(UNIT_STAND_STATE_KNEEL); //temp->CastSpell(pTirion, SPELL_APOCALYPSE, false); // not working temp->CastSpell(pTirion, SPELL_SOUL_FEAST_TIRION, false); - DoScriptText(EMOTE_LIGHT_OF_DAWN12, pTirion); + pTirion->AI()->Talk(EMOTE_LIGHT_OF_DAWN12); } } JumpToNextStep(2000); @@ -1035,7 +1020,7 @@ public: temp->SetWalk(false); temp->SetSpeed(MOVE_RUN, 2.0f); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); - DoScriptText(SAY_LIGHT_OF_DAWN50, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN50); } if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) { @@ -1058,7 +1043,7 @@ public: case 43: // They all got kicked if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(EMOTE_LIGHT_OF_DAWN13, temp); + temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN13); if (Creature* temp = Unit::GetCreature(*me, uiMaxwellGUID)) { @@ -1107,7 +1092,7 @@ public: break; case 45: - DoScriptText(SAY_LIGHT_OF_DAWN52, me); + Talk(SAY_LIGHT_OF_DAWN52); JumpToNextStep(5000); break; @@ -1115,14 +1100,14 @@ public: me->SetSpeed(MOVE_RUN, 1.0f); me->SetWalk(true); me->SetStandState(UNIT_STAND_STATE_STAND); - DoScriptText(SAY_LIGHT_OF_DAWN53, me); + Talk(SAY_LIGHT_OF_DAWN53); SetHoldState(false); // Darion throws sword JumpToNextStep(7000); break; case 47: // Ashbringer rebirth me->SetStandState(UNIT_STAND_STATE_KNEEL); - DoScriptText(EMOTE_LIGHT_OF_DAWN15, me); + Talk(EMOTE_LIGHT_OF_DAWN15); if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) { temp->SetStandState(UNIT_STAND_STATE_STAND); @@ -1150,26 +1135,26 @@ public: case 49: if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN54, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN54); JumpToNextStep(4000); break; case 50: if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN55, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN55); JumpToNextStep(5000); break; case 51: if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN56, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN56); JumpToNextStep(1000); break; case 52: // Tiron charges if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) { - DoScriptText(EMOTE_LIGHT_OF_DAWN16, temp); + temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN16); temp->CastSpell(temp, SPELL_TIRION_CHARGE, false); // jumping charge temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); temp->SetSpeed(MOVE_RUN, 3.0f); // workarounds, make Tirion still running @@ -1183,7 +1168,7 @@ public: case 53: if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN57, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN57); JumpToNextStep(1000); break; @@ -1211,13 +1196,13 @@ public: case 57: if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN58, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN58); JumpToNextStep(10000); break; case 58: if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN59, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN59); JumpToNextStep(10000); break; @@ -1236,7 +1221,7 @@ public: case 60: if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) // Lich king disappears here { - DoScriptText(EMOTE_LIGHT_OF_DAWN17, temp); + temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN17); temp->Kill(temp); } JumpToNextStep(10000); @@ -1244,7 +1229,7 @@ public: case 61: if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN60, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN60); JumpToNextStep(3000); break; @@ -1261,50 +1246,50 @@ public: if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) { temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[8].x, LightofDawnLoc[8].y, LightofDawnLoc[8].z); - DoScriptText(SAY_LIGHT_OF_DAWN61, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN61); } JumpToNextStep(15000); break; case 64: if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN62, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN62); JumpToNextStep(7000); break; case 65: if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN63, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN63); JumpToNextStep(10000); break; case 66: if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN64, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN64); JumpToNextStep(11000); break; case 67: if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN65, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN65); JumpToNextStep(10000); break; case 68: if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN66, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN66); JumpToNextStep(8000); break; case 69: if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN67, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN67); JumpToNextStep(10000); break; case 70: me->SetStandState(UNIT_STAND_STATE_STAND); - DoScriptText(SAY_LIGHT_OF_DAWN68, me); + Talk(SAY_LIGHT_OF_DAWN68); JumpToNextStep(10000); break; @@ -1382,12 +1367,7 @@ public: if (uiFight_speech <= diff) { - DoScriptText(RAND(SAY_LIGHT_OF_DAWN09, SAY_LIGHT_OF_DAWN10, SAY_LIGHT_OF_DAWN11, - SAY_LIGHT_OF_DAWN12, SAY_LIGHT_OF_DAWN13, SAY_LIGHT_OF_DAWN14, - SAY_LIGHT_OF_DAWN15, SAY_LIGHT_OF_DAWN16, SAY_LIGHT_OF_DAWN17, - SAY_LIGHT_OF_DAWN18, SAY_LIGHT_OF_DAWN19, SAY_LIGHT_OF_DAWN20, - SAY_LIGHT_OF_DAWN21, SAY_LIGHT_OF_DAWN22, SAY_LIGHT_OF_DAWN23, - SAY_LIGHT_OF_DAWN24), me); + Talk(SAY_LIGHT_OF_DAWN09); uiFight_speech = urand(15000, 20000); } else uiFight_speech -= diff; @@ -1420,11 +1400,11 @@ public: if (uiFight_duration <= diff + 5000) { if (!uiTirionGUID) - if (Unit* temp = me->SummonCreature(NPC_HIGHLORD_TIRION_FORDRING, LightofDawnLoc[0].x, LightofDawnLoc[0].y, LightofDawnLoc[0].z, 1.528f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000)) + if (Creature* temp = me->SummonCreature(NPC_HIGHLORD_TIRION_FORDRING, LightofDawnLoc[0].x, LightofDawnLoc[0].y, LightofDawnLoc[0].z, 1.528f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000)) { temp->setFaction(me->getFaction()); temp->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_UNEQUIP)); - DoScriptText(SAY_LIGHT_OF_DAWN25, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN25); uiTirionGUID = temp->GetGUID(); } } @@ -1501,7 +1481,7 @@ public: } if (Creature* temp = Unit::GetCreature(*me, uiOrbazGUID)) - DoScriptText(EMOTE_LIGHT_OF_DAWN04, temp); + temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN04); if (Creature* temp = Unit::GetCreature(*me, uiThassarianGUID)) { @@ -1516,7 +1496,7 @@ public: } if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN26, temp); + temp->AI()->Talk(SAY_LIGHT_OF_DAWN26); SetHoldState(false); diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp index 5151268b70d..08aa86d6a06 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp @@ -29,6 +29,7 @@ EndScriptData */ enum eEnums { + EMOTE_FRENZY_KILL = 0, SPELL_REND = 16509, SPELL_BACKHAND = 18103, SPELL_FRENZY = 8269 @@ -103,7 +104,7 @@ public: if (m_uiFrenzy_Timer <= uiDiff) { DoCast(me, SPELL_FRENZY); - DoScriptText(EMOTE_GENERIC_FRENZY_KILL, me); + Talk(EMOTE_FRENZY_KILL); m_uiFrenzy_Timer = 120000; } diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp index 3c7771612e2..dd3e591bf61 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp @@ -28,6 +28,7 @@ EndScriptData */ enum eEnums { + EMOTE_FRENZY_KILL = 0, SPELL_FLAMESTRIKE = 18399, SPELL_BLAST_WAVE = 16046, SPELL_FIRESHIELD = 19626, @@ -88,7 +89,7 @@ public: if (m_uiFrenzy_Timer <= uiDiff) { DoCast(me, SPELL_FRENZY); - DoScriptText(EMOTE_GENERIC_FRENZY_KILL, me); + Talk(EMOTE_FRENZY_KILL); m_uiFrenzy_Timer = 24000; } diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/ghostlands.cpp index 268e8891845..5465a918169 100644 --- a/src/server/scripts/EasternKingdoms/ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/ghostlands.cpp @@ -74,18 +74,18 @@ public: enum eEnums { - SAY_START = -1000140, - SAY_PROGRESS1 = -1000141, - SAY_PROGRESS2 = -1000142, - SAY_PROGRESS3 = -1000143, - SAY_END1 = -1000144, - SAY_END2 = -1000145, - SAY_CAPTAIN_ANSWER = -1000146, + SAY_START = 0, + SAY_PROGRESS1 = 1, + SAY_PROGRESS2 = 2, + SAY_PROGRESS3 = 3, + SAY_END1 = 4, + SAY_END2 = 5, + SAY_CAPTAIN_ANSWER = 0, QUEST_ESCAPE_FROM_THE_CATACOMBS = 9212, - GO_CAGE = 181152, - NPC_CAPTAIN_HELIOS = 16220, - FACTION_SMOON_E = 1603, + GO_CAGE = 181152, + NPC_CAPTAIN_HELIOS = 16220, + FACTION_SMOON_E = 1603 }; class npc_ranger_lilatha : public CreatureScript @@ -109,18 +109,18 @@ public: me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) Cage->SetGoState(GO_STATE_ACTIVE); - DoScriptText(SAY_START, me, player); + Talk(SAY_START, player->GetGUID()); break; case 5: - DoScriptText(SAY_PROGRESS1, me, player); + Talk(SAY_PROGRESS1, player->GetGUID()); break; case 11: - DoScriptText(SAY_PROGRESS2, me, player); + Talk(SAY_PROGRESS2, player->GetGUID()); me->SetOrientation(4.762841f); break; case 18: { - DoScriptText(SAY_PROGRESS3, me, player); + Talk(SAY_PROGRESS3, player->GetGUID()); Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0); Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0); if (Summ1 && Summ2) @@ -143,14 +143,14 @@ public: break; case 32: me->SetOrientation(2.978281f); - DoScriptText(SAY_END1, me, player); + Talk(SAY_END1, player->GetGUID()); break; case 33: me->SetOrientation(5.858011f); - DoScriptText(SAY_END2, me, player); - Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50); + Talk(SAY_END2, player->GetGUID()); + Creature* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50); if (CaptainHelios) - DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player); + CaptainHelios->AI()->Talk(SAY_CAPTAIN_ANSWER, player->GetGUID()); break; } } diff --git a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp index 28af25d39de..d8e9a9ae49a 100644 --- a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp +++ b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp @@ -37,7 +37,7 @@ EndContentData */ #######*/ enum eStillbladeData { - SAY_HEAL = -1000193, + SAY_HEAL = 0, QUEST_REDEEMING_THE_DEAD = 9685, SPELL_SHIMMERING_VESSEL = 31225, @@ -98,7 +98,7 @@ public: me->SetStandState(UNIT_STAND_STATE_STAND); me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); //me->RemoveAllAuras(); - DoScriptText(SAY_HEAL, me); + Talk(SAY_HEAL); spellHit = true; } } diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp index 2f3c00cf67a..ef7d3ed3877 100644 --- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/stormwind_city.cpp @@ -16,23 +16,6 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Stormwind_City -SD%Complete: 0 -SDComment: -SDCategory: Stormwind City -EndScriptData */ - -/* ContentData -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "ScriptedEscortAI.h" -#include "Player.h" - - void AddSC_stormwind_city() { } diff --git a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp index 78e4e055ff2..0356fd170b1 100644 --- a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp +++ b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp @@ -16,11 +16,6 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedEscortAI.h" -#include "Player.h" - void AddSC_swamp_of_sorrows() { } diff --git a/src/server/scripts/EasternKingdoms/westfall.cpp b/src/server/scripts/EasternKingdoms/westfall.cpp index c6cf1b4361c..16ba171928c 100644 --- a/src/server/scripts/EasternKingdoms/westfall.cpp +++ b/src/server/scripts/EasternKingdoms/westfall.cpp @@ -39,11 +39,11 @@ EndContentData */ enum eEnums { - SAY_DS_START = -1000293, - SAY_DS_DOWN_1 = -1000294, - SAY_DS_DOWN_2 = -1000295, - SAY_DS_DOWN_3 = -1000296, - SAY_DS_PROLOGUE = -1000297, + SAY_DS_START = 0, + SAY_DS_DOWN_1 = 1, + SAY_DS_DOWN_2 = 2, + SAY_DS_DOWN_3 = 3, + SAY_DS_PROLOGUE = 4, SPELL_SHOOT = 6660, QUEST_TOME_VALOR = 1651, @@ -60,7 +60,7 @@ public: { if (quest->GetQuestId() == QUEST_TOME_VALOR) { - DoScriptText(SAY_DS_START, creature); + creature->AI()->Talk(SAY_DS_START); if (npc_escortAI* pEscortAI = CAST_AI(npc_daphne_stilwell::npc_daphne_stilwellAI, creature->AI())) pEscortAI->Start(true, true, player->GetGUID()); @@ -88,13 +88,13 @@ public: switch (uiWPHolder) { case 7: - DoScriptText(SAY_DS_DOWN_1, me); + Talk(SAY_DS_DOWN_1); break; case 8: - DoScriptText(SAY_DS_DOWN_2, me); + Talk(SAY_DS_DOWN_2); break; case 9: - DoScriptText(SAY_DS_DOWN_3, me); + Talk(SAY_DS_DOWN_3); break; } } @@ -143,7 +143,7 @@ public: SetRun(false); break; case 11: - DoScriptText(SAY_DS_PROLOGUE, me); + Talk(SAY_DS_PROLOGUE); break; case 13: SetEquipmentSlots(true); @@ -197,12 +197,14 @@ public: /*###### ## npc_defias_traitor ######*/ +enum DefiasSays +{ + SAY_START = 0, + SAY_PROGRESS = 1, + SAY_END = 2, + SAY_AGGRO = 3 +}; -#define SAY_START -1000101 -#define SAY_PROGRESS -1000102 -#define SAY_END -1000103 -#define SAY_AGGRO_1 -1000104 -#define SAY_AGGRO_2 -1000105 #define QUEST_DEFIAS_BROTHERHOOD 155 @@ -218,7 +220,7 @@ public: if (npc_escortAI* pEscortAI = CAST_AI(npc_defias_traitor::npc_defias_traitorAI, creature->AI())) pEscortAI->Start(true, true, player->GetGUID()); - DoScriptText(SAY_START, creature, player); + creature->AI()->Talk(SAY_START, player->GetGUID()); } return true; @@ -245,10 +247,10 @@ public: SetRun(false); break; case 36: - DoScriptText(SAY_PROGRESS, me, player); + Talk(SAY_PROGRESS, player->GetGUID()); break; case 44: - DoScriptText(SAY_END, me, player); + Talk(SAY_END, player->GetGUID()); player->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD, me); break; } @@ -256,7 +258,7 @@ public: void EnterCombat(Unit* who) { - DoScriptText(RAND(SAY_AGGRO_1, SAY_AGGRO_2), me, who); + Talk(SAY_AGGRO, who->GetGUID()); } void Reset() {} diff --git a/src/server/scripts/Events/CMakeLists.txt b/src/server/scripts/Events/CMakeLists.txt index d8be052d645..00bdaa9cb0c 100644 --- a/src/server/scripts/Events/CMakeLists.txt +++ b/src/server/scripts/Events/CMakeLists.txt @@ -11,7 +11,6 @@ set(scripts_STAT_SRCS ${scripts_STAT_SRCS} Events/childrens_week.cpp - Events/event.cpp ) message(" -> Prepared: Events") diff --git a/src/server/scripts/Events/event.cpp b/src/server/scripts/Events/event.cpp deleted file mode 100644 index d77ef2b78c1..00000000000 --- a/src/server/scripts/Events/event.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -void AddSC_event_childrens_week(); - -void AddSC_event_scripts() -{ - AddSC_event_childrens_week(); -} diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp index 79e264f09cf..1357fcaf356 100644 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ b/src/server/scripts/Kalimdor/azshara.cpp @@ -16,23 +16,6 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Azshara -SD%Complete: 0 -SDComment: Quest support: -SDCategory: Azshara -EndScriptData */ - -/* ContentData -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "Player.h" -#include "SpellInfo.h" -#include "WorldSession.h" - void AddSC_azshara() { } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index a950a74e59c..4727504a4bd 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -553,6 +553,12 @@ class boss_professor_putricide : public CreatureScript return 0; } + void SetData(uint32 id, uint32 data) + { + if (id == DATA_EXPERIMENT_STAGE) + _experimentState = bool(data); + } + void UpdateAI(uint32 const diff) { if ((!(events.GetPhaseMask() & PHASE_MASK_NOT_SELF) && !UpdateVictim()) || !CheckInRoom()) @@ -1007,7 +1013,7 @@ class spell_putricide_unstable_experiment : public SpellScriptLoader Creature* creature = GetCaster()->ToCreature(); uint32 stage = creature->AI()->GetData(DATA_EXPERIMENT_STAGE); - creature->AI()->SetData(DATA_EXPERIMENT_STAGE, !stage); + creature->AI()->SetData(DATA_EXPERIMENT_STAGE, stage ^ true); Creature* target = NULL; std::list<Creature*> creList; diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index 6eed82991b8..bbc26de85eb 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -29,7 +29,6 @@ npc_corastrasza npc_jenny npc_sinkhole_kill_credit npc_khunok_the_behemoth -npc_scourge_prisoner mob_nerubar_victim npc_keristrasza npc_nesingwary_trapper @@ -387,41 +386,6 @@ public: }; /*###### -## npc_scourge_prisoner -######*/ - -enum eScourgePrisoner -{ - GO_SCOURGE_CAGE = 187867 -}; - -class npc_scourge_prisoner : public CreatureScript -{ -public: - npc_scourge_prisoner() : CreatureScript("npc_scourge_prisoner") { } - - struct npc_scourge_prisonerAI : public ScriptedAI - { - npc_scourge_prisonerAI(Creature* creature) : ScriptedAI (creature){} - - void Reset() - { - me->SetReactState(REACT_PASSIVE); - - if (GameObject* go = me->FindNearestGameObject(GO_SCOURGE_CAGE, 5.0f)) - if (go->GetGoState() == GO_STATE_ACTIVE) - go->SetGoState(GO_STATE_READY); - } - - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_scourge_prisonerAI(creature); - } -}; - -/*###### ## npc_jenny ######*/ @@ -2548,7 +2512,6 @@ void AddSC_borean_tundra() new npc_corastrasza(); new npc_iruk(); new mob_nerubar_victim(); - new npc_scourge_prisoner(); new npc_jenny(); new npc_fezzix_geartwist(); new npc_nesingwary_trapper(); diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index 65677959135..a8f65b0bc9b 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -366,7 +366,7 @@ class boss_lethon : public CreatureScript { Position targetPos; target->GetPosition(&targetPos); - me->GetMap()->SummonCreature(NPC_SPIRIT_SHADE, targetPos, NULL, 50000, (Unit*)this); + me->SummonCreature(NPC_SPIRIT_SHADE, targetPos, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 50000); } } |