diff options
-rw-r--r-- | sql/updates/world/master/2022_07_12_00_world.sql | 8 | ||||
-rw-r--r-- | src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp | 42 |
2 files changed, 22 insertions, 28 deletions
diff --git a/sql/updates/world/master/2022_07_12_00_world.sql b/sql/updates/world/master/2022_07_12_00_world.sql new file mode 100644 index 00000000000..ca8ba7baa7d --- /dev/null +++ b/sql/updates/world/master/2022_07_12_00_world.sql @@ -0,0 +1,8 @@ +DELETE FROM `world_state` WHERE `ID` IN (3590,3591,3592,3603,3604,3605); +INSERT INTO `world_state` VALUES +(3590,300,'609',NULL,'','Ebon Hold - Forces of the Light remaining'), +(3591,10000,'609',NULL,'','Ebon Hold - Forces of the Scourge Remaining'), +(3592,0,'609',NULL,'','Ebon Hold - Show Forces Remaining'), +(3603,0,'609',NULL,'','Ebon Hold - Show Minutes until battle'), +(3604,0,'609',NULL,'','Ebon Hold - Minutes until battle'), +(3605,0,'609',NULL,'','Ebon Hold - Battle in progress'); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index e35ee1725a8..7382f0be781 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -16,17 +16,14 @@ */ #include "ScriptMgr.h" -#include "GameObject.h" #include "Map.h" #include "MotionMaster.h" #include "ObjectAccessor.h" -#include "ObjectMgr.h" #include "Player.h" #include "ScriptedEscortAI.h" #include "ScriptedGossip.h" -#include "SpellInfo.h" -#include "SpellScript.h" #include "TemporarySummon.h" +#include "WorldStateMgr.h" #define LESS_MOB // if you do not have a good server and do not want it to be laggy as hell //Light of Dawn @@ -54,9 +51,12 @@ enum mograine ENCOUNTER_TOTAL_DAWN = 300, // Total number ENCOUNTER_TOTAL_SCOURGE = 10000, - WORLD_STATE_REMAINS = 3592, - WORLD_STATE_COUNTDOWN = 3603, - WORLD_STATE_EVENT_BEGIN = 3605, + WORLD_STATE_FORCES_OF_THE_LIGHT_REMAINING = 3590, + WORLD_STATE_FORCES_OF_THE_SCOURGE_REMAINING = 3591, + WORLD_STATE_SHOW_FORCES_REMAINING = 3592, + WORLD_STATE_SHOW_MINUTES_UNTIL_BATTLE = 3603, + WORLD_STATE_MINUTES_UNTIL_BATTLE = 3604, + WORLD_STATE_BATTLE_IN_PROGRESS = 3605, SAY_LIGHT_OF_DAWN01 = 0, // pre text SAY_LIGHT_OF_DAWN02 = 1, @@ -224,20 +224,6 @@ enum mograine SPELL_THUNDER = 53630 }; -void UpdateWorldState(Map* map, uint32 id, uint32 state) -{ - Map::PlayerList const& players = map->GetPlayers(); - - if (!players.isEmpty()) - { - for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* player = itr->GetSource()) - player->SendUpdateWorldState(id, state); - } - } -} - Position const LightofDawnLoc[] = { {2281.335f, -5300.409f, 85.170f, 0}, // 0 Tirion Fordring loc @@ -354,9 +340,9 @@ public: me->Mount(25279); me->SetVisible(true); - UpdateWorldState(me->GetMap(), WORLD_STATE_REMAINS, 0); - //UpdateWorldState(me->GetMap(), WORLD_STATE_COUNTDOWN, 0); - UpdateWorldState(me->GetMap(), WORLD_STATE_EVENT_BEGIN, 0); + sWorldStateMgr->SetValue(WORLD_STATE_SHOW_FORCES_REMAINING, 0, false, me->GetMap()); + //sWorldStateMgr->SetValue(WORLD_STATE_SHOW_MINUTES_UNTIL_BATTLE, 0, false, me->GetMap()); + sWorldStateMgr->SetValue(WORLD_STATE_BATTLE_IN_PROGRESS, 0, false, me->GetMap()); if (Creature* temp = ObjectAccessor::GetCreature(*me, uiTirionGUID)) temp->setDeathState(JUST_DIED); @@ -594,13 +580,13 @@ public: switch (uiStep) { case 0: // countdown - //UpdateWorldState(me->GetMap(), WORLD_STATE_COUNTDOWN, 1); + //sWorldStateMgr->SetValue(WORLD_STATE_SHOW_MINUTES_UNTIL_BATTLE, 1, false, me->GetMap()); break; case 1: // just delay - //UpdateWorldState(me->GetMap(), WORLD_STATE_REMAINS, 1); - UpdateWorldState(me->GetMap(), WORLD_STATE_COUNTDOWN, 0); - UpdateWorldState(me->GetMap(), WORLD_STATE_EVENT_BEGIN, 1); + //sWorldStateMgr->SetValue(WORLD_STATE_SHOW_FORCES_REMAINING, 1, false, me->GetMap()); + sWorldStateMgr->SetValue(WORLD_STATE_SHOW_MINUTES_UNTIL_BATTLE, 0, false, me->GetMap()); + sWorldStateMgr->SetValue(WORLD_STATE_BATTLE_IN_PROGRESS, 1, false, me->GetMap()); me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP); JumpToNextStep(3000); break; |