diff options
33 files changed, 509 insertions, 247 deletions
diff --git a/sql/updates/world/2012_09_27_01_world_custodian_of_time.sql b/sql/updates/world/2012_09_27_01_world_custodian_of_time.sql new file mode 100644 index 00000000000..5396bd3e7f0 --- /dev/null +++ b/sql/updates/world/2012_09_27_01_world_custodian_of_time.sql @@ -0,0 +1,18 @@ +-- Custodian of Time's Whispers for quest 10277 +DELETE FROM `script_texts` WHERE `entry` IN (-1000217,-1000218,-1000219,-1000220,-1000221,-1000222,-1000223,-1000224,-1000225,-1000226,-1000227,-1000228,-1000229,-1000230); +DELETE FROM `creature_text` WHERE `entry`=20129; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(20129,0,0, 'Greetings, $N. I will guide you through the cavern. Please try and keep up.',15,0,100,0,0,0, 'WHISPER_CUSTODIAN_1'), +(20129,1,0, 'We do not know if the Caverns of Time have always been accessible to mortals. Truly, it is impossible to tell as the Timeless One is in perpetual motion, changing our timeways as he sees fit. What you see now may very well not exist tomorrow. You may wake up and have no memory of this place.',15,0,100,0,0,0, 'WHISPER_CUSTODIAN_2'), +(20129,2,0, 'It is strange, I know... Most mortals cannot actually comprehend what they see here, as often, what they see is not anchored within their own perception of reality.',15,0,100,0,0,0, 'WHISPER_CUSTODIAN_3'), +(20129,3,0, 'Follow me, please.',15,0,100,0,0,0, 'WHISPER_CUSTODIAN_4'), +(20129,4,0, 'There are only two truths to be found here: First, that time is chaotic, always in flux, and completely malleable and second, perception does not dictate reality.',15,0,100,0,0,0, 'WHISPER_CUSTODIAN_5'), +(20129,5,0, 'As custodians of time, we watch over and care for Nozdormu''s realm. The master is away at the moment, which means that attempts are being made to dramatically alter time. The master never meddles in the affairs of mortals but instead corrects the alterations made to time by others. He is reactionary in this regard.',15,0,100,0,0,0, 'WHISPER_CUSTODIAN_6'), +(20129,6,0, 'For normal maintenance of time, the Keepers of Time are sufficient caretakers. We are able to deal with most ordinary disturbances. I speak of little things, such as rogue mages changing something in the past to elevate their status or wealth in the present.',15,0,100,0,0,0, 'WHISPER_CUSTODIAN_7'), +(20129,7,0, 'These tunnels that you see are called timeways. They are infinite in number. The ones that currently exist in your reality are what the master has deemed as ''trouble spots.'' These trouble spots may differ completely in theme but they always share a cause. That is, their existence is a result of the same temporal disturbance. Remember that should you venture inside one...',15,0,100,0,0,0, 'WHISPER_CUSTODIAN_8'), +(20129,8,0, 'This timeway is in great disarray! We have agents inside right now attempting to restore order. What information I have indicates that Thrall''s freedom is in jeopardy. A malevolent organization known as the Infinite Dragonflight is trying to prevent his escape. I fear without outside assistance, all will be lost.',15,0,100,0,0,0, 'WHISPER_CUSTODIAN_9'), +(20129,9,0, 'We have very little information on this timeway. Sa''at has been dispatched and is currently inside. The data we have gathered from his correspondence is that the Infinite Dragonflight are once again attempting to alter time. Could it be that the opening of the Dark Portal is being targeted for sabotage? Let us hope not...',15,0,100,0,0,0, 'WHISPER_CUSTODIAN_10'), +(20129,10,0, 'This timeway collapsed and reformed. The result was Stratholme of yore. What could possibly be happening inside?',15,0,100,0,0,0, 'WHISPER_CUSTODIAN_11'), +(20129,11,0, 'The timeways are currently ranked in order from least catastrophic to most catastrophic. Note that they are all classified as catastrophic, meaning that any single one of these timeways collapsing would mean that your world would end. We only classify them in such a way so that the heroes and adventurers that are sent here know which timeway best suits their abilities.',15,0,100,0,0,0, 'WHISPER_CUSTODIAN_12'), +(20129,12,0, 'All we know of this timeway is that it leads to Mount Hyjal. The Infinite Dragonflight have gone to great lengths to prevent our involvement. We know next to nothing, mortal. Soridormi is currently attempting to break through the timeway''s defenses but has thus far been unsuccessful. You might be our only hope of breaking through and resolving the conflict.',15,0,100,0,0,0, 'WHISPER_CUSTODIAN_13'), +(20129,13,0, 'Our time is at an end $N. I would wish you luck, if such a thing existed.',15,0,100,0,0,0, 'WHISPER_CUSTODIAN_14'); diff --git a/sql/updates/world/2012_09_28_00_world_creature_model_info.sql b/sql/updates/world/2012_09_28_00_world_creature_model_info.sql new file mode 100644 index 00000000000..48134d7bbed --- /dev/null +++ b/sql/updates/world/2012_09_28_00_world_creature_model_info.sql @@ -0,0 +1 @@ +UPDATE `creature_model_info` SET `combat_reach`=10 WHERE `modelid`=28787; diff --git a/sql/updates/world/2012_09_29_00_world_creature_model_info.sql b/sql/updates/world/2012_09_29_00_world_creature_model_info.sql new file mode 100644 index 00000000000..0c63a0b2f73 --- /dev/null +++ b/sql/updates/world/2012_09_29_00_world_creature_model_info.sql @@ -0,0 +1,21 @@ +-- VoA +UPDATE `creature_model_info` SET `bounding_radius`=0.3875,`combat_reach`=7.5 WHERE `modelid`=29524; -- Koralon +UPDATE `creature_model_info` SET `bounding_radius`=0.465,`combat_reach`=7.5 WHERE `modelid`=27108; -- Emalon +UPDATE `creature_model_info` SET `bounding_radius`=0.465,`combat_reach`=9 WHERE `modelid`=31089; -- Toravon +UPDATE `creature_model_info` SET `bounding_radius`=0.465,`combat_reach`=7.5 WHERE `modelid`=26967; -- Archavon + +-- ToCr +UPDATE `creature_model_info` SET `bounding_radius`=1.085,`combat_reach`=10.5 WHERE `modelid`=29614; -- Gormok +UPDATE `creature_model_info` SET `bounding_radius`=1.55,`combat_reach`=5 WHERE `modelid`=29815; -- Acidmaw +UPDATE `creature_model_info` SET `bounding_radius`=1.24,`combat_reach`=12 WHERE `modelid`=24564; -- Dreadscale +UPDATE `creature_model_info` SET `bounding_radius`=4,`combat_reach`=14 WHERE `modelid`=21601; -- Icehowl +UPDATE `creature_model_info` SET `bounding_radius`=1.52778,`combat_reach`=5 WHERE `modelid`=29615; -- Jaraxxus +UPDATE `creature_model_info` SET `bounding_radius`=1.5,`combat_reach`=9 WHERE `modelid`=29267; -- Eydis Darkbane +UPDATE `creature_model_info` SET `bounding_radius`=1.5,`combat_reach`=9 WHERE `modelid`=29240; -- Fjola Lightbane +UPDATE `creature_model_info` SET `bounding_radius`=1.5,`combat_reach`=2.25 WHERE `modelid`=29773; -- Saamul +UPDATE `creature_model_info` SET `bounding_radius`=0.459,`combat_reach`=2.25 WHERE `modelid`=29774; -- Baelnor Lightbearer +UPDATE `creature_model_info` SET `bounding_radius`=0.312,`combat_reach`=2.25 WHERE `modelid`=29776; -- Irieth Shadowstep +UPDATE `creature_model_info` SET `bounding_radius`=0.52785,`combat_reach`=2.5875 WHERE `modelid`=29777; -- Serissa Grimdabbler +UPDATE `creature_model_info` SET `bounding_radius`=0.312,`combat_reach`=2.25 WHERE `modelid`=29778; -- Brienna Nightfell +UPDATE `creature_model_info` SET `bounding_radius`=1.5,`combat_reach`=2.25 WHERE `modelid`=29779; -- Shocuul +UPDATE `creature_model_info` SET `bounding_radius`=0.4511,`combat_reach`=2.6 WHERE `modelid`=29780; -- Melador Valestrider / Erin Misthoof diff --git a/sql/updates/world/2012_09_29_01_world_creature_text.sql b/sql/updates/world/2012_09_29_01_world_creature_text.sql new file mode 100644 index 00000000000..8fde66d2e6e --- /dev/null +++ b/sql/updates/world/2012_09_29_01_world_creature_text.sql @@ -0,0 +1,24 @@ +-- Mimiron +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1603259 AND -1603240; +DELETE FROM `creature_text` WHERE `entry`=33350; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(33350,0,0, 'Oh, my! I wasn''t expecting company! The workshop is such a mess! How embarrassing!',14,0,100,0,0,15611, 'Mimiron SAY_AGGRO'), +(33350,1,0, 'Now why would you go and do something like that? Didn''t you see the sign that said ''DO NOT PUSH THIS BUTTON!''? How will we finish testing with the self-destruct mechanism active?',14,0,100,0,0,15629, 'Mimiron SAY_HARDMODE_ON'), +(33350,2,0, 'We haven''t much time, friends! You''re going to help me test out my latest and greatest creation. Now, before you change your minds, remember, that you kind of owe it to me after the mess you made with the XT-002.',14,0,100,0,0,15612, 'Mimiron SAY_MKII_ACTIVATE'), +(33350,3,0, 'MEDIC!',14,0,100,0,0,15613, 'Mimiron SAY_MKII_SLAY_1'), +(33350,3,1, 'I can fix that... or, maybe not! Sheesh, what a mess...',14,0,100,0,0,15614, 'Mimiron SAY_MKII_SLAY_2'), +(33350,4,0, 'WONDERFUL! Positively marvelous results! Hull integrity at 98.9 percent! Barely a dent! Moving right along.',14,0,100,0,0,15615, 'Mimiron SAY_MKII_DEATH'), +(33350,5,0, 'Behold the VX-001 Anti-personnel Assault Cannon! You might want to take cover.',14,0,100,0,0,15616, 'Mimiron SAY_VX001_ACTIVATE'), +(33350,6,0, 'Fascinating. I think they call that a "clean kill".',14,0,100,0,0,15617, 'Mimiron SAY_VX001_SLAY_1'), +(33350,6,1, 'Note to self: Cannon highly effective against flesh.',14,0,100,0,0,15618, 'Mimiron SAY_VX001_SLAY_2'), +(33350,7,0, 'Thank you, friends! Your efforts have yielded some fantastic data! Now, where did I put- oh, there it is!',14,0,100,0,0,15619, 'Mimiron SAY_VX001_DEATH'), +(33350,8,0, 'Isn''t it beautiful? I call it the magnificent aerial command unit!',14,0,100,0,0,15620, 'Mimiron SAY_AERIAL_ACTIVATE'), +(33350,9,0, 'Outplayed!',14,0,100,0,0,15621, 'Mimiron SAY_AERIAL_SLAY_1'), +(33350,9,1, 'You can do better than that!',14,0,100,0,0,15622, 'Mimiron SAY_AERIAL_SLAY_2'), +(33350,10,0, 'Preliminary testing phase complete. Now comes the true test!!',14,0,100,0,0,15623, 'Mimiron SAY_AERIAL_DEATH'), +(33350,11,0, 'Gaze upon its magnificence! Bask in its glorious, um, glory! I present you... V-07-TR-0N!',14,0,100,0,0,15624, 'Mimiron SAY_V07TRON_ACTIVATE'), +(33350,12,0, 'Prognosis: Negative!',14,0,100,0,0,15625, 'Mimiron SAY_V07TRON_SLAY_1'), +(33350,12,1, 'You''re not going to get up from that one, friend.',14,0,100,0,0,15626, 'Mimiron SAY_V07TRON_SLAY_2'), +(33350,13,0, 'It would appear that I''ve made a slight miscalculation. I allowed my mind to be corrupted by the fiend in the prison, overriding my primary directive. All systems seem to be functional now. Clear.',14,0,100,0,0,15627, 'Mimiron SAY_V07TRON_DEATH'), +(33350,14,0, 'Oh, my! It would seem that we are out of time, my friends!',14,0,100,0,0,15628, 'Mimiron SAY_BERSERK'), +(33350,15,0, 'Combat matrix enhanced. Behold wonderous rapidity!',14,0,100,0,0,15630, 'Mimiron SAY_YS_HELP'); diff --git a/sql/updates/world/2012_09_30_00_world_creature_text.sql b/sql/updates/world/2012_09_30_00_world_creature_text.sql new file mode 100644 index 00000000000..e0f9f210d7b --- /dev/null +++ b/sql/updates/world/2012_09_30_00_world_creature_text.sql @@ -0,0 +1,12 @@ +-- AzjolNerub/Ahnkahet/Elder Nadox +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1619020 AND -1619014; +DELETE FROM `creature_text` WHERE `entry`=29309; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(29309,0,0, 'The secrets of the deep shall remain hidden.',14,0,100,0,0,14033, 'SAY_AGGRO'), +(29309,1,0, 'Sleep now, in the cold dark.',14,0,100,0,0,14036, 'SAY_SLAY_1'), +(29309,1,1, 'For the Lich King!',14,0,100,0,0,14037, 'SAY_SLAY_2'), +(29309,1,2, 'Perhaps we will be allies soon.',14,0,100,0,0,14038, 'SAY_SLAY_3'), +(29309,2,0, 'Master, is my service complete?',14,0,100,0,0,14039, 'SAY_DEATH'), +(29309,3,0, 'The young must not grow hungry...',14,0,100,0,0,14034, 'SAY_EGG_SAC_1'), +(29309,3,1, 'Shhhad ak kereeesshh chak-k-k!',14,0,100,0,0,14035, 'SAY_EGG_SAC_2'), +(29309,4,0, 'An Ahn''kahar Guardian hatches!',16,0,100,0,0,14035, 'EMOTE_HATCHES'); diff --git a/sql/updates/world/2012_09_30_01_world_player_factionchange_titles.sql b/sql/updates/world/2012_09_30_01_world_player_factionchange_titles.sql new file mode 100644 index 00000000000..99d7fc871d8 --- /dev/null +++ b/sql/updates/world/2012_09_30_01_world_player_factionchange_titles.sql @@ -0,0 +1,32 @@ +-- Title converter +DROP TABLE IF EXISTS `player_factionchange_titles`; +CREATE TABLE `player_factionchange_titles` ( + `alliance_id` int(8) NOT NULL, + `horde_id` int(8) NOT NULL, + PRIMARY KEY (`alliance_id`,`horde_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +DELETE FROM `player_factionchange_titles` WHERE `alliance_id` IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,48,75,113,126,146,147,148,149); +INSERT INTO `player_factionchange_titles` (`alliance_id`,`horde_id`) VALUES +(1, 15), +(2, 16), +(3, 17), +(4, 18), +(5, 19), +(6, 20), +(7, 21), +(8, 22), +(9, 23), +(10, 24), +(11, 25), +(12, 26), +(13, 27), +(14, 28), +(48, 47), +(75, 76), +(113, 153), +(126, 127), +(146, 152), +(147, 154), +(148, 151), +(149, 150); diff --git a/sql/updates/world/2012_09_30_02_world_creature_text.sql b/sql/updates/world/2012_09_30_02_world_creature_text.sql new file mode 100644 index 00000000000..81e77bcd682 --- /dev/null +++ b/sql/updates/world/2012_09_30_02_world_creature_text.sql @@ -0,0 +1,12 @@ +-- AzjolNerub/Ahnkahet/Herald Volazj +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1619036 AND -1619030; +DELETE FROM `creature_text` WHERE `entry`=29311; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(29311,0,0, 'Shgla''yos plahf mh''naus.', 14,0,100,0,0,14043, 'SAY_AGGRO_1'), +(29311,0,1, 'They who dine on lost souls know only hunger.', 15, 0, 100, 0, 0, 14043, 'SAY_AGGRO_2'), +(29311,1,0, 'Ywaq puul skshgn: on''ma yeh''glu zuq.', 14,0,100,0,0,14045, 'SAY_SLAY_1'), +(29311,1,1, 'Ywaq ma phgwa''cul hnakf.',14,0,100,0,0,14046, 'SAY_SLAY_2'), +(29311,1,2, 'Ywaq maq oou; ywaq maq ssaggh. Ywaq ma shg''fhn.',14,0,100,0,0,14047, 'SAY_SLAY_3'), +(29311,2,0, 'Iilth vwah, uhn''agth fhssh za.', 14, 0, 100, 0, 0, 14048, 'SAY_DEATH_1'), +(29311,2,1, 'Where one falls, many shall take its place.', 15, 0, 100, 0, 0, 14048, 'SAY_DEATH_2'), +(29311,3,0, 'Gul''kafh an''shel. Yoq''al shn ky ywaq nuul.', 14, 0, 100, 0, 0, 14044, 'SAY_PHASE');
\ No newline at end of file diff --git a/sql/updates/world/2012_XXX_XX_XX_world_creature_text.sql b/sql/updates/world/2012_XXX_XX_XX_world_creature_text.sql new file mode 100644 index 00000000000..a591f8cfb7c --- /dev/null +++ b/sql/updates/world/2012_XXX_XX_XX_world_creature_text.sql @@ -0,0 +1,18 @@ +-- AzjolNerub/Ahnkahet/Jedoga Shadowseeker +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1619013 AND -1619000; +DELETE FROM `creature_text` WHERE `entry`=29310; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(29310, 0, 0, 'These are sacred halls! Your intrusion will be met with death!', 14, 0, 100, 0, 0, 14343, 'SAY_AGGRO'), +(29310, 1, 0, 'Who among you is devoted?', 14, 0, 100, 0, 0, 14343, 'SAY_SACRIFICE_1_1'), +(29310, 1, 1, 'You there! Step forward!', 14, 0, 100, 0, 0, 14343, 'SAY_SACRIFICE_1_2'), +(29310, 2, 0, 'Yogg-Saron, grant me your power!', 14, 0, 100, 0, 0, 14343, 'SAY_SACRIFICE_2_1'), +(29310, 2, 1, 'Master, a gift for you!', 14, 0, 100, 0, 0, 14343, 'SAY_SACRIFICE_2_2'), +(29310, 3, 0, 'Glory to Yogg-Saron!', 14, 0, 100, 0, 0, 0, 'SAY_SLAY_1'), +(29310, 3, 1, 'You are unworthy!', 14, 0, 100, 0, 0, 0, 'SAY_SLAY_2'), +(29310, 3, 2, 'Get up! You haven''t suffered enough.', 14, 0, 100, 0, 0, 14350, 'SAY_SLAY_3'), +(29310, 4, 0, 'Do not expect your sacrilege... to go unpunished.', 14, 0, 100, 0, 0, 0, 'SAY_DEATH'), +(29310, 5, 0, 'The elements themselves will rise up against the civilized world! Only the faithful will be spared!', 14, 0, 100, 0, 0, 14352, 'SAY_PREACHING_1'), +(29310, 5, 1, 'Immortality can be yours, but only if you pledge yourself fully to Yogg-Saron!', 14, 0, 100, 0, 0, 14353, 'SAY_PREACHING_2'), +(29310, 5, 2, 'Here, on the very borders of his domain, you will experience power you could have never imagined!', 14, 0, 100, 0, 0, 0, 'SAY_PREACHING_3'), +(29310, 5, 3, 'You have traveled long and risked much to be here! Your devotion shall be rewarded.', 14, 0, 100, 0, 0, 0, 'SAY_PREACHING_4'), +(29310, 5, 4, 'The faithful shall be exalted! But there is more work to be done. We will press on until all of Azeroth lies beneath his shadow!', 14, 0, 100, 0, 0, 0, 'SAY_PREACHING_5'); diff --git a/src/server/game/Battlefield/Battlefield.h b/src/server/game/Battlefield/Battlefield.h index 480aafbeb42..2ca6a2e3f96 100644 --- a/src/server/game/Battlefield/Battlefield.h +++ b/src/server/game/Battlefield/Battlefield.h @@ -211,9 +211,6 @@ class Battlefield : public ZoneScript /// Call this to init the Battlefield virtual bool SetupBattlefield() { return true; } - /// Generate packet which contain all worldstatedata of area - virtual void FillInitialWorldStates(WorldPacket& /*data*/) {} - /// Update data of a worldstate to all players present in zone void SendUpdateWorldState(uint32 field, uint32 value); @@ -330,7 +327,8 @@ class Battlefield : public ZoneScript virtual void DoCompleteOrIncrementAchievement(uint32 /*achievement*/, Player* /*player*/, uint8 /*incrementNumber = 1*/) {}; /// Send all worldstate data to all player in zone. - virtual void SendInitWorldStatesToAll() {}; + virtual void SendInitWorldStatesToAll() = 0; + virtual void FillInitialWorldStates(WorldPacket& /*data*/) = 0; /// Return if we can use mount in battlefield bool CanFlyIn() { return !m_isActive; } diff --git a/src/server/game/Battlefield/BattlefieldMgr.h b/src/server/game/Battlefield/BattlefieldMgr.h index 4ee37e424fd..1ec1f3b1151 100644 --- a/src/server/game/Battlefield/BattlefieldMgr.h +++ b/src/server/game/Battlefield/BattlefieldMgr.h @@ -46,10 +46,10 @@ class BattlefieldMgr // called when player resurrects void HandlePlayerResurrects(Player * player, uint32 areaflag); // return assigned battlefield - Battlefield *GetBattlefieldToZoneId(uint32 zoneid); - Battlefield *GetBattlefieldByBattleId(uint32 battleid); + Battlefield* GetBattlefieldToZoneId(uint32 zoneid); + Battlefield* GetBattlefieldByBattleId(uint32 battleid); - ZoneScript *GetZoneScript(uint32 zoneId); + ZoneScript* GetZoneScript(uint32 zoneId); void AddZone(uint32 zoneid, Battlefield * handle); diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index 2270bcf7927..de1ee1785d8 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -612,33 +612,26 @@ void BattlefieldWG::OnCreatureRemove(Creature* /*creature*/) void BattlefieldWG::OnGameObjectCreate(GameObject* go) { - bool isWorkshop = false; uint8 workshopId = 0; switch (go->GetEntry()) { case GO_WINTERGRASP_FACTORY_BANNER_NE: - isWorkshop = true; workshopId = BATTLEFIELD_WG_WORKSHOP_NE; break; case GO_WINTERGRASP_FACTORY_BANNER_NW: - isWorkshop = true; workshopId = BATTLEFIELD_WG_WORKSHOP_NW; break; case GO_WINTERGRASP_FACTORY_BANNER_SE: - isWorkshop = true; workshopId = BATTLEFIELD_WG_WORKSHOP_SE; break; case GO_WINTERGRASP_FACTORY_BANNER_SW: - isWorkshop = true; workshopId = BATTLEFIELD_WG_WORKSHOP_SW; break; - + default: + return; } - if (!isWorkshop) - return; - for (Workshop::const_iterator itr = WorkshopsList.begin(); itr != WorkshopsList.end(); ++itr) { if (WGWorkshop* workshop = (*itr)) @@ -851,20 +844,13 @@ uint32 BattlefieldWG::GetData(uint32 data) return Battlefield::GetData(data); } -// Method sending worldsate to player -WorldPacket BattlefieldWG::BuildInitWorldStates() -{ - WorldPacket data(SMSG_INIT_WORLD_STATES, (4 + 4 + 4 + 2 + (BuildingsInZone.size() * 8) + (WorkshopsList.size() * 8))); - - data << uint32(m_MapId); - data << uint32(m_ZoneId); - data << uint32(0); - data << uint16(4 + 2 + 4 + BuildingsInZone.size() + WorkshopsList.size()); +void BattlefieldWG::FillInitialWorldStates(WorldPacket& data) +{ data << uint32(BATTLEFIELD_WG_WORLD_STATE_ATTACKER) << uint32(GetAttackerTeam()); data << uint32(BATTLEFIELD_WG_WORLD_STATE_DEFENDER) << uint32(GetDefenderTeam()); - data << uint32(BATTLEFIELD_WG_WORLD_STATE_ACTIVE) << uint32(IsWarTime()? 0 : 1); // Note: cleanup these two, their names look awkward - data << uint32(BATTLEFIELD_WG_WORLD_STATE_SHOW_WORLDSTATE) << uint32(IsWarTime()? 1 : 0); + data << uint32(BATTLEFIELD_WG_WORLD_STATE_ACTIVE) << uint32(IsWarTime() ? 0 : 1); // Note: cleanup these two, their names look awkward + data << uint32(BATTLEFIELD_WG_WORLD_STATE_SHOW_WORLDSTATE) << uint32(IsWarTime() ? 1 : 0); for (uint32 i = 0; i < 2; ++i) data << ClockWorldState[i] << uint32(time(NULL) + (m_Timer / 1000)); @@ -880,23 +866,28 @@ WorldPacket BattlefieldWG::BuildInitWorldStates() for (Workshop::const_iterator itr = WorkshopsList.begin(); itr != WorkshopsList.end(); ++itr) if (*itr) data << WorkshopsData[(*itr)->workshopId].worldstate << (*itr)->state; - - return data; } void BattlefieldWG::SendInitWorldStatesTo(Player* player) { - WorldPacket data = BuildInitWorldStates(); + WorldPacket data(SMSG_INIT_WORLD_STATES, (4 + 4 + 4 + 2 + (BuildingsInZone.size() * 8) + (WorkshopsList.size() * 8))); + + data << uint32(m_MapId); + data << uint32(m_ZoneId); + data << uint32(0); + data << uint16(10 + BuildingsInZone.size() + WorkshopsList.size()); // Number of fields + + FillInitialWorldStates(data); + player->GetSession()->SendPacket(&data); } void BattlefieldWG::SendInitWorldStatesToAll() { - WorldPacket data = BuildInitWorldStates(); for (uint8 team = 0; team < 2; team++) for (GuidSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr) if (Player* player = sObjectAccessor->FindPlayer(*itr)) - player->GetSession()->SendPacket(&data); + SendInitWorldStatesTo(player); } void BattlefieldWG::BrokenWallOrTower(TeamId /*team*/) diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index 11510e1ea98..323f7f2b13d 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -26,12 +26,6 @@ #include "GroupMgr.h" #include "Battlefield.h" -uint32 const VehNumWorldState[2] = { 3680, 3490 }; -uint32 const MaxVehNumWorldState[2] = { 3681, 3491 }; -uint32 const ClockWorldState[2] = { 3781, 4354 }; -uint32 const WintergraspFaction[3] = { 1732, 1735, 35 }; -float const WintergraspStalkerPos[4] = { 0, 0, 0, 0 }; - class BattlefieldWG; class WintergraspCapturePoint; @@ -404,9 +398,9 @@ class BattlefieldWG : public Battlefield void UpdateVehicleCountWG(); void UpdateCounterVehicle(bool init); - WorldPacket BuildInitWorldStates(); void SendInitWorldStatesTo(Player* player); void SendInitWorldStatesToAll(); + void FillInitialWorldStates(WorldPacket& data); void HandleKill(Player* killer, Unit* victim); void OnUnitDeath(Unit* unit); @@ -421,6 +415,7 @@ class BattlefieldWG : public Battlefield uint8 GetSpiritGraveyardId(uint32 areaId); uint32 GetData(uint32 data); + protected: bool m_isRelicInteractible; @@ -441,6 +436,12 @@ class BattlefieldWG : public Battlefield GameObject* m_titansRelic; }; +uint32 const VehNumWorldState[] = { 3680, 3490 }; +uint32 const MaxVehNumWorldState[] = { 3681, 3491 }; +uint32 const ClockWorldState[] = { 3781, 4354 }; +uint32 const WintergraspFaction[] = { 1732, 1735, 35 }; +float const WintergraspStalkerPos[] = { 0, 0, 0, 0 }; + uint8 const WG_MAX_OBJ = 32; uint8 const WG_KEEPGAMEOBJECT_MAX = 44; uint8 const WG_MAX_TURRET = 15; @@ -448,6 +449,7 @@ uint8 const WG_MAX_KEEP_NPC = 39; uint8 const WG_MAX_OUTSIDE_NPC = 14; uint8 const WG_OUTSIDE_ALLIANCE_NPC = 7; uint8 const WG_MAX_TELEPORTER = 12; +uint8 const WG_MAX_WORKSHOP = 6; enum WintergraspGameObjectBuildingType { @@ -1112,8 +1114,6 @@ const WintergraspTowerCannonData TowerCannon[WG_MAX_TOWER_CANNON] = // *****************WorkShop Data & Element***************** // ********************************************************* -uint8 const WG_MAX_WORKSHOP = 6; - struct WGWorkshopData { uint8 id; diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 647f55c4ffa..05fc4e68e8c 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1940,8 +1940,6 @@ void Battleground::RewardXPAtKill(Player* killer, Player* victim) void Battleground::HandleAreaTrigger(Player* player, uint32 trigger) { - sLog->outError(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger %u in Battleground %u. Player coords (x: %f, y: %f, z: %f)", + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Unhandled AreaTrigger %u in Battleground %u. Player coords (x: %f, y: %f, z: %f)", trigger, player->GetMapId(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); - if (player->isGameMaster()) - player->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", trigger); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index dfd7af583a5..e91c5122604 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -236,6 +236,7 @@ void BattlegroundAB::HandleAreaTrigger(Player* player, uint32 trigger) case 3870: // Black Smith case 4020: // Unk1 case 4021: // Unk2 + case 4674: // Unk3 //break; default: Battleground::HandleAreaTrigger(player, trigger); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h index c7ee4c62504..f7487a46653 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h @@ -105,11 +105,11 @@ enum EYBattlegroundObjectEntry enum EYBattlegroundPointsTrigger { TR_BLOOD_ELF_POINT = 4476, - TR_FEL_REAVER_POINT = 4514, + TR_FEL_REAVER_POINT = 4514, TR_MAGE_TOWER_POINT = 4516, TR_DRAENEI_RUINS_POINT = 4518, TR_BLOOD_ELF_BUFF = 4568, - TR_FEL_REAVER_BUFF = 4569, + TR_FEL_REAVER_BUFF = 4569, TR_MAGE_TOWER_BUFF = 4570, TR_DRAENEI_RUINS_BUFF = 4571 }; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index a50553d2fa3..024c570d174 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -65,7 +65,7 @@ void BattlegroundWS::PostUpdateImpl(uint32 diff) { if (GetStatus() == STATUS_IN_PROGRESS) { - if (GetStartTime() >= 25*MINUTE*IN_MILLISECONDS) + if (GetStartTime() >= 27*MINUTE*IN_MILLISECONDS) { if (GetTeamScore(ALLIANCE) == 0) { @@ -83,7 +83,8 @@ void BattlegroundWS::PostUpdateImpl(uint32 diff) else EndBattleground(ALLIANCE); } - else if (GetStartTime() > uint32(_minutesElapsed * MINUTE * IN_MILLISECONDS)) + // first update needed after 1 minute of game already in progress + else if (GetStartTime() > uint32(_minutesElapsed * MINUTE * IN_MILLISECONDS) + 3 * MINUTE * IN_MILLISECONDS) { ++_minutesElapsed; UpdateWorldState(BG_WS_STATE_TIMER, 25 - _minutesElapsed); @@ -159,6 +160,17 @@ void BattlegroundWS::PostUpdateImpl(uint32 diff) } else { + if (Player* player = ObjectAccessor::FindPlayer(m_FlagKeepers[0])) + { + player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); + player->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT); + } + if (Player* player = ObjectAccessor::FindPlayer(m_FlagKeepers[1])) + { + player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); + player->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT); + } + _flagSpellForceTimer = 0; //reset timer. _flagDebuffState = 0; } @@ -826,23 +838,17 @@ void BattlegroundWS::FillInitialWorldStates(WorldPacket& data) data << uint32(BG_WS_FLAG_CAPTURES_MAX) << uint32(BG_WS_MAX_TEAM_SCORE); - if (GetStatus() == STATUS_IN_PROGRESS) - { - data << uint32(BG_WS_STATE_TIMER_ACTIVE) << uint32(1); - data << uint32(BG_WS_STATE_TIMER) << uint32(25-_minutesElapsed); - } - else - data << uint32(BG_WS_STATE_TIMER_ACTIVE) << uint32(0); - if (_flagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_ON_PLAYER) - data << uint32(BG_WS_FLAG_STATE_ALLIANCE) << uint32(2); + data << uint32(BG_WS_FLAG_STATE_HORDE) << uint32(2); else - data << uint32(BG_WS_FLAG_STATE_ALLIANCE) << uint32(1); + data << uint32(BG_WS_FLAG_STATE_HORDE) << uint32(1); if (_flagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_PLAYER) - data << uint32(BG_WS_FLAG_STATE_HORDE) << uint32(2); + data << uint32(BG_WS_FLAG_STATE_ALLIANCE) << uint32(2); else - data << uint32(BG_WS_FLAG_STATE_HORDE) << uint32(1); + data << uint32(BG_WS_FLAG_STATE_ALLIANCE) << uint32(1); + data << uint32(BG_WS_STATE_TIMER_ACTIVE) << uint32(1); + data << uint32(BG_WS_STATE_TIMER) << uint32(25 - _minutesElapsed); } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b560f829306..d8a2694fc22 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -76,6 +76,7 @@ #include "AccountMgr.h" #include "Battlefield.h" #include "BattlefieldMgr.h" +#include "BattlefieldWG.h" #define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS) @@ -9041,6 +9042,7 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) uint32 mapid = GetMapId(); OutdoorPvP* pvp = sOutdoorPvPMgr->GetOutdoorPvPToZoneId(zoneid); InstanceScript* instance = GetInstanceScript(); + Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(zoneid); sLog->outDebug(LOG_FILTER_NETWORKIO, "Sending SMSG_INIT_WORLD_STATES to Map: %u, Zone: %u", mapid, zoneid); @@ -9076,7 +9078,7 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) NumberOfFields = 83; break; case 3277: - NumberOfFields = 16; + NumberOfFields = 18; break; case 3358: case 3820: @@ -9114,6 +9116,10 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) case 4273: // Ulduar NumberOfFields = 10; break; + case 4197: // Wintergrasp + /// Use the max here, and fill with zeros if missing. + NumberOfFields = 10 + WG_MAX_OBJ + WG_MAX_WORKSHOP; + break; default: NumberOfFields = 12; break; @@ -9123,6 +9129,7 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) data << uint32(mapid); // mapid data << uint32(zoneid); // zone id data << uint32(areaid); // area id, new 2.1.0 + size_t countPos = data.wpos(); data << uint16(NumberOfFields); // count of uint64 blocks data << uint32(0x8d8) << uint32(0x0); // 1 data << uint32(0x8d7) << uint32(0x0); // 2 @@ -9668,6 +9675,16 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) data << uint32(4131) << uint32(0); // 10 WORLDSTATE_CRATES_REVEALED } break; + // Wintergrasp + case 4197: + if (bf && bf->GetTypeId() == BATTLEFIELD_WG) + { + bf->FillInitialWorldStates(data); + break; + } + else + data.put<uint16>(countPos, 12); + // No break here, intended. default: data << uint32(0x914) << uint32(0x0); // 7 data << uint32(0x913) << uint32(0x0); // 8 @@ -9677,6 +9694,7 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) } GetSession()->SendPacket(&data); SendBGWeekendWorldStates(); + SendBattlefieldWorldStates(); } void Player::SendBGWeekendWorldStates() @@ -9694,6 +9712,24 @@ void Player::SendBGWeekendWorldStates() } } +void Player::SendBattlefieldWorldStates() +{ + /// Send misc stuff that needs to be sent on every login, like the battle timers. + if (sWorld->getBoolConfig(CONFIG_WINTERGRASP_ENABLE)) + { + if (BattlefieldWG* wg = (BattlefieldWG*)sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG)) + { + if (wg->IsWarTime()) + SendUpdateWorldState(ClockWorldState[1], uint32(time(NULL))); + else // Time to next battle + { + uint32 timer = wg->GetTimer() / 1000; + SendUpdateWorldState(ClockWorldState[1], time(NULL) + timer); + } + } + } +} + uint32 Player::GetXPRestBonus(uint32 xp) { uint32 rested_bonus = (uint32)GetRestBonus(); // xp for each rested bonus @@ -21755,6 +21791,14 @@ inline void UpdateVisibilityOf_helper(std::set<uint64>& s64, T* target, std::set } template<> +inline void UpdateVisibilityOf_helper(std::set<uint64>& s64, GameObject* target, std::set<Unit*>& /*v*/) +{ + // Don't update only GAMEOBJECT_TYPE_TRANSPORT (or all transports and destructible buildings?) + if ((target->GetGOInfo()->type != GAMEOBJECT_TYPE_TRANSPORT)) + s64.insert(target->GetGUID()); +} + +template<> inline void UpdateVisibilityOf_helper(std::set<uint64>& s64, Creature* target, std::set<Unit*>& v) { s64.insert(target->GetGUID()); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 0decacd6258..82e91985b04 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2125,6 +2125,7 @@ class Player : public Unit, public GridObject<Player> void SendUpdateWorldState(uint32 Field, uint32 Value); void SendDirectMessage(WorldPacket* data); void SendBGWeekendWorldStates(); + void SendBattlefieldWorldStates(); void SendAurasForTarget(Unit* target); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index fb6f2678e58..0a3876c6946 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6673,7 +6673,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere { victim->CastCustomSpell(beaconTarget, triggered_spell_id, &basepoints0, NULL, NULL, true, 0, triggeredByAura); return true; - } + } else return false; } @@ -11579,7 +11579,9 @@ bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) cons SpellImmuneList const& list = m_spellImmune[IMMUNITY_STATE]; for (SpellImmuneList::const_iterator itr = list.begin(); itr != list.end(); ++itr) if (itr->type == aura) - return true; + if (!(spellInfo->AttributesEx3 & SPELL_ATTR3_IGNORE_HIT_RESULT)) + return true; + // Check for immune to application of harmful magical effects AuraEffectList const& immuneAuraApply = GetAuraEffectsByType(SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL); for (AuraEffectList::const_iterator iter = immuneAuraApply.begin(); iter != immuneAuraApply.end(); ++iter) diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 7d94e0ad209..5ef9efa0396 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -8605,6 +8605,41 @@ void ObjectMgr::LoadFactionChangeReputations() sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u faction change reputation pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } +void ObjectMgr::LoadFactionChangeTitles() +{ + uint32 oldMSTime = getMSTime(); + + QueryResult result = WorldDatabase.Query("SELECT alliance_id, horde_id FROM player_factionchange_titles"); + + if (!result) + { + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 faction change title pairs. DB table `player_factionchange_title` is empty."); + return; + } + + uint32 count = 0; + + do + { + Field* fields = result->Fetch(); + + uint32 alliance = fields[0].GetUInt32(); + uint32 horde = fields[1].GetUInt32(); + + if (!sCharTitlesStore.LookupEntry(alliance)) + sLog->outError(LOG_FILTER_SQL, "Title %u referenced in `player_factionchange_title` does not exist, pair skipped!", alliance); + else if (!sCharTitlesStore.LookupEntry(horde)) + sLog->outError(LOG_FILTER_SQL, "Title %u referenced in `player_factionchange_title` does not exist, pair skipped!", horde); + else + FactionChange_Titles[alliance] = horde; + + ++count; + } + while (result->NextRow()); + + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u faction change title pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); +} + GameObjectTemplate const* ObjectMgr::GetGameObjectTemplate(uint32 entry) { GameObjectTemplateContainer::const_iterator itr = _gameObjectTemplateStore.find(entry); diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index a6d1dc6c386..bbd95e22685 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -1139,11 +1139,13 @@ class ObjectMgr CharacterConversionMap FactionChange_Items; CharacterConversionMap FactionChange_Spells; CharacterConversionMap FactionChange_Reputation; + CharacterConversionMap FactionChange_Titles; void LoadFactionChangeAchievements(); void LoadFactionChangeItems(); void LoadFactionChangeSpells(); void LoadFactionChangeReputations(); + void LoadFactionChangeTitles(); private: // first free id for selected id type diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index 3bae430ad2c..5c8860cc900 100755 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -324,8 +324,8 @@ void WorldSession::HandleBattlefieldListOpcode(WorldPacket &recv_data) uint8 fromWhere; recv_data >> fromWhere; // 0 - battlemaster (lua: ShowBattlefieldList), 1 - UI (lua: RequestBattlegroundInstanceInfo) - uint8 unk1; - recv_data >> unk1; // Unknown 3.2.2 + uint8 canGainXP; + recv_data >> canGainXP; // players with locked xp have their own bg queue on retail BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(bgTypeId); if (!bl) diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 39cf0d6b3cf..8f98135aafb 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1644,6 +1644,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) uint32 level = uint32(fields[1].GetUInt8()); uint32 at_loginFlags = fields[2].GetUInt16(); uint32 used_loginFlag = ((recv_data.GetOpcode() == CMSG_CHAR_RACE_CHANGE) ? AT_LOGIN_CHANGE_RACE : AT_LOGIN_CHANGE_FACTION); + char const* knownTitlesStr = fields[3].GetCString(); if (!sObjectMgr->GetPlayerInfo(race, playerClass)) { @@ -2014,6 +2015,70 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) stmt->setUInt32(2, lowGuid); trans->Append(stmt); } + + // Title conversion + if (knownTitlesStr) + { + const uint32 ktcount = KNOWN_TITLES_SIZE * 2; + uint32 knownTitles[ktcount]; + Tokens tokens(knownTitlesStr, ' ', ktcount); + + if (tokens.size() != ktcount) + return; + + for (uint32 index = 0; index < ktcount; ++index) + knownTitles[index] = atol(tokens[index]); + + for (std::map<uint32, uint32>::const_iterator it = sObjectMgr->FactionChange_Titles.begin(); it != sObjectMgr->FactionChange_Titles.end(); ++it) + { + uint32 title_alliance = it->first; + uint32 title_horde = it->second; + + CharTitlesEntry const* atitleInfo = sCharTitlesStore.LookupEntry(title_alliance); + CharTitlesEntry const* htitleInfo = sCharTitlesStore.LookupEntry(title_horde); + // new team + if (team == BG_TEAM_ALLIANCE) + { + uint32 bitIndex = htitleInfo->bit_index; + uint32 index = bitIndex / 32; + uint32 old_flag = 1 << (bitIndex % 32); + uint32 new_flag = 1 << (atitleInfo->bit_index % 32); + if (knownTitles[index] & old_flag) + { + knownTitles[index] &= ~old_flag; + // use index of the new title + knownTitles[atitleInfo->bit_index / 32] |= new_flag; + } + } + else + { + uint32 bitIndex = atitleInfo->bit_index; + uint32 index = bitIndex / 32; + uint32 old_flag = 1 << (bitIndex % 32); + uint32 new_flag = 1 << (htitleInfo->bit_index % 32); + if (knownTitles[index] & old_flag) + { + knownTitles[index] &= ~old_flag; + // use index of the new title + knownTitles[htitleInfo->bit_index / 32] |= new_flag; + } + } + + std::ostringstream ss; + for (uint32 index = 0; index < ktcount; ++index) + ss << knownTitles[index] << ' '; + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_TITLES_FACTION_CHANGE); + stmt->setString(0, ss.str().c_str()); + stmt->setUInt32(1, lowGuid); + trans->Append(stmt); + + // unset any currently chosen title + stmt = CharacterDatabase.GetPreparedStatement(CHAR_RES_CHAR_TITLES_FACTION_CHANGE); + stmt->setUInt32(0, lowGuid); + trans->Append(stmt); + } + } } CharacterDatabase.CommitTransaction(trans); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 1d1fb45b74e..6ef3932252a 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1617,6 +1617,9 @@ void World::SetInitialWorldSettings() sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading faction change reputation pairs..."); sObjectMgr->LoadFactionChangeReputations(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading faction change title pairs..."); + sObjectMgr->LoadFactionChangeTitles(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading GM tickets..."); sTicketMgr->LoadTickets(); diff --git a/src/server/scripts/Kalimdor/tanaris.cpp b/src/server/scripts/Kalimdor/tanaris.cpp index 9b742b495bb..417c8b338c7 100644 --- a/src/server/scripts/Kalimdor/tanaris.cpp +++ b/src/server/scripts/Kalimdor/tanaris.cpp @@ -150,20 +150,20 @@ public: enum CustodianOfTime { - WHISPER_CUSTODIAN_1 = -1000217, - WHISPER_CUSTODIAN_2 = -1000218, - WHISPER_CUSTODIAN_3 = -1000219, - WHISPER_CUSTODIAN_4 = -1000220, - WHISPER_CUSTODIAN_5 = -1000221, - WHISPER_CUSTODIAN_6 = -1000222, - WHISPER_CUSTODIAN_7 = -1000223, - WHISPER_CUSTODIAN_8 = -1000224, - WHISPER_CUSTODIAN_9 = -1000225, - WHISPER_CUSTODIAN_10 = -1000226, - WHISPER_CUSTODIAN_11 = -1000227, - WHISPER_CUSTODIAN_12 = -1000228, - WHISPER_CUSTODIAN_13 = -1000229, - WHISPER_CUSTODIAN_14 = -1000230 + WHISPER_CUSTODIAN_1 = 0, + WHISPER_CUSTODIAN_2 = 1, + WHISPER_CUSTODIAN_3 = 2, + WHISPER_CUSTODIAN_4 = 3, + WHISPER_CUSTODIAN_5 = 4, + WHISPER_CUSTODIAN_6 = 5, + WHISPER_CUSTODIAN_7 = 6, + WHISPER_CUSTODIAN_8 = 7, + WHISPER_CUSTODIAN_9 = 8, + WHISPER_CUSTODIAN_10 = 9, + WHISPER_CUSTODIAN_11 = 10, + WHISPER_CUSTODIAN_12 = 11, + WHISPER_CUSTODIAN_13 = 12, + WHISPER_CUSTODIAN_14 = 13 }; class npc_custodian_of_time : public CreatureScript @@ -187,58 +187,58 @@ public: switch (waypointId) { case 0: - DoScriptText(WHISPER_CUSTODIAN_1, me, player); + Talk(WHISPER_CUSTODIAN_1, player->GetGUID()); break; case 1: - DoScriptText(WHISPER_CUSTODIAN_2, me, player); + Talk(WHISPER_CUSTODIAN_2, player->GetGUID()); break; case 2: - DoScriptText(WHISPER_CUSTODIAN_3, me, player); + Talk(WHISPER_CUSTODIAN_3, player->GetGUID()); break; case 3: - DoScriptText(WHISPER_CUSTODIAN_4, me, player); + Talk(WHISPER_CUSTODIAN_4, player->GetGUID()); break; case 5: - DoScriptText(WHISPER_CUSTODIAN_5, me, player); + Talk(WHISPER_CUSTODIAN_5, player->GetGUID()); break; case 6: - DoScriptText(WHISPER_CUSTODIAN_6, me, player); + Talk(WHISPER_CUSTODIAN_6, player->GetGUID()); break; case 7: - DoScriptText(WHISPER_CUSTODIAN_7, me, player); + Talk(WHISPER_CUSTODIAN_7, player->GetGUID()); break; case 8: - DoScriptText(WHISPER_CUSTODIAN_8, me, player); + Talk(WHISPER_CUSTODIAN_8, player->GetGUID()); break; case 9: - DoScriptText(WHISPER_CUSTODIAN_9, me, player); + Talk(WHISPER_CUSTODIAN_9, player->GetGUID()); break; case 10: - DoScriptText(WHISPER_CUSTODIAN_4, me, player); + Talk(WHISPER_CUSTODIAN_4, player->GetGUID()); break; case 13: - DoScriptText(WHISPER_CUSTODIAN_10, me, player); + Talk(WHISPER_CUSTODIAN_10, player->GetGUID()); break; case 14: - DoScriptText(WHISPER_CUSTODIAN_4, me, player); + Talk(WHISPER_CUSTODIAN_4, player->GetGUID()); break; case 16: - DoScriptText(WHISPER_CUSTODIAN_11, me, player); + Talk(WHISPER_CUSTODIAN_11, player->GetGUID()); break; case 17: - DoScriptText(WHISPER_CUSTODIAN_12, me, player); + Talk(WHISPER_CUSTODIAN_12, player->GetGUID()); break; case 18: - DoScriptText(WHISPER_CUSTODIAN_4, me, player); + Talk(WHISPER_CUSTODIAN_4, player->GetGUID()); break; case 22: - DoScriptText(WHISPER_CUSTODIAN_13, me, player); + Talk(WHISPER_CUSTODIAN_13, player->GetGUID()); break; case 23: - DoScriptText(WHISPER_CUSTODIAN_4, me, player); + Talk(WHISPER_CUSTODIAN_4, player->GetGUID()); break; case 24: - DoScriptText(WHISPER_CUSTODIAN_14, me, player); + Talk(WHISPER_CUSTODIAN_14, player->GetGUID()); DoCast(player, 34883); // below here is temporary workaround, to be removed when spell works properly player->AreaExploredOrEventHappens(10277); diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp index 7f4da5666ff..9274a016e2f 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp @@ -19,16 +19,13 @@ #include "ScriptedCreature.h" #include "ahnkahet.h" -//not in db enum Yells { - SAY_AGGRO = -1619014, - SAY_SLAY_1 = -1619015, - SAY_SLAY_2 = -1619016, - SAY_SLAY_3 = -1619017, - SAY_DEATH = -1619018, - SAY_EGG_SAC_1 = -1619019, - SAY_EGG_SAC_2 = -1619020 + SAY_AGGRO = 0, + SAY_SLAY = 1, + SAY_DEATH = 2, + SAY_EGG_SAC = 3, + EMOTE_HATCHES = 4 }; enum Spells @@ -50,8 +47,6 @@ enum Creatures #define ACTION_AHNKAHAR_GUARDIAN_DEAD 1 #define DATA_RESPECT_YOUR_ELDERS 2 -#define EMOTE_HATCHES "An Ahn'kahar Guardian hatches!" - class boss_elder_nadox : public CreatureScript { public: @@ -61,7 +56,7 @@ class boss_elder_nadox : public CreatureScript { boss_elder_nadoxAI(Creature* creature) : ScriptedAI(creature) { - instance = me->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiPlagueTimer; @@ -78,16 +73,13 @@ class boss_elder_nadox : public CreatureScript void Reset() { - uiPlagueTimer = 13000; - uiRagueTimer = 20000; - + uiPlagueTimer = 13000; + uiRagueTimer = 20000; uiSwarmerSpawnTimer = 10000; - uiGuardSpawnTimer = 25000; - - uiEnrageTimer = 5000; - - bGuardSpawned = false; - respectYourElders = true; + uiGuardSpawnTimer = 25000; + uiEnrageTimer = 5000; + bGuardSpawned = false; + respectYourElders = true; if (instance) instance->SetData(DATA_ELDER_NADOX_EVENT, NOT_STARTED); @@ -95,7 +87,7 @@ class boss_elder_nadox : public CreatureScript void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_AGGRO); if (instance) instance->SetData(DATA_ELDER_NADOX_EVENT, IN_PROGRESS); @@ -103,12 +95,12 @@ class boss_elder_nadox : public CreatureScript void KilledUnit(Unit* /*who*/) { - DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me); + Talk(SAY_SLAY); } void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_SLAY_3, me); //SAY_SLAY_3 on death? + Talk(SAY_DEATH); if (instance) instance->SetData(DATA_ELDER_NADOX_EVENT, DONE); @@ -135,7 +127,7 @@ class boss_elder_nadox : public CreatureScript if (uiPlagueTimer <= diff) { - DoCast(me->getVictim(), SPELL_BROOD_PLAGUE); + DoCastVictim(SPELL_BROOD_PLAGUE); uiPlagueTimer = 15000; } else @@ -160,7 +152,7 @@ class boss_elder_nadox : public CreatureScript DoCast(me, SPELL_SUMMON_SWARMERS, true); DoCast(me, SPELL_SUMMON_SWARMERS); if (urand(1, 3) == 3) // 33% chance of dialog - DoScriptText(RAND(SAY_EGG_SAC_1, SAY_EGG_SAC_2), me); + Talk(SAY_EGG_SAC); uiSwarmerSpawnTimer = 10000; } @@ -169,7 +161,7 @@ class boss_elder_nadox : public CreatureScript if (!bGuardSpawned && uiGuardSpawnTimer <= diff) { - me->MonsterTextEmote(EMOTE_HATCHES, me->GetGUID(), true); + Talk(EMOTE_HATCHES, me->GetGUID()); DoCast(me, SPELL_SUMMON_SWARM_GUARD); bGuardSpawned = true; } @@ -217,7 +209,7 @@ class mob_ahnkahar_nerubian : public CreatureScript { mob_ahnkahar_nerubianAI(Creature* creature) : ScriptedAI(creature) { - instance = me->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -237,9 +229,7 @@ class mob_ahnkahar_nerubian : public CreatureScript Nadox->AI()->DoAction(ACTION_AHNKAHAR_GUARDIAN_DEAD); } - void EnterCombat(Unit* /*who*/) - { - } + void EnterCombat(Unit* /*who*/) {} void UpdateAI(uint32 const diff) { @@ -300,9 +290,7 @@ public: class achievement_respect_your_elders : public AchievementCriteriaScript { public: - achievement_respect_your_elders() : AchievementCriteriaScript("achievement_respect_your_elders") - { - } + achievement_respect_your_elders() : AchievementCriteriaScript("achievement_respect_your_elders") {} bool OnCheck(Player* /*player*/, Unit* target) { diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp index e81d58b4ef3..3a937942118 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp @@ -44,16 +44,13 @@ enum Creatures MOB_TWISTED_VISAGE = 30625 }; -//not in db + enum Yells { - SAY_AGGRO = -1619030, - SAY_SLAY_1 = -1619031, - SAY_SLAY_2 = -1619032, - SAY_SLAY_3 = -1619033, - SAY_DEATH_1 = -1619034, - SAY_DEATH_2 = -1619035, - SAY_PHASE = -1619036 + SAY_AGGRO = 0, + SAY_SLAY = 1, + SAY_DEATH = 2, + SAY_PHASE = 3 }; enum Achievements @@ -177,7 +174,7 @@ public: void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); if (instance) { @@ -300,7 +297,7 @@ public: void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH_1, me); + Talk(SAY_DEATH); if (instance) instance->SetData(DATA_HERALD_VOLAZJ, DONE); @@ -311,7 +308,7 @@ public: void KilledUnit(Unit* /*victim*/) { - DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me); + Talk(SAY_SLAY); } }; diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp index 7c167fb9c27..02dcc04abd6 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp @@ -23,22 +23,15 @@ #include "ScriptedCreature.h" #include "ahnkahet.h" + enum Yells { - TEXT_AGGRO = -1619000, - TEXT_SACRIFICE_1_1 = -1619001, - TEXT_SACRIFICE_1_2 = -1619002, - TEXT_SACRIFICE_2_1 = -1619003, - TEXT_SACRIFICE_2_2 = -1619004, - TEXT_SLAY_1 = -1619005, - TEXT_SLAY_2 = -1619006, - TEXT_SLAY_3 = -1619007, - TEXT_DEATH = -1619008, - TEXT_PREACHING_1 = -1619009, - TEXT_PREACHING_2 = -1619010, - TEXT_PREACHING_3 = -1619011, - TEXT_PREACHING_4 = -1619012, - TEXT_PREACHING_5 = -1619013 + TEXT_AGGRO = 0, + TEXT_SACRIFICE_1 = 1, + TEXT_SACRIFICE_2 = 2, + TEXT_SLAY = 3, + TEXT_DEATH = 4, + TEXT_PREACHING = 5 }; enum Spells @@ -129,7 +122,7 @@ public: if (!instance || (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_JEDOGA_CONTROLLER)) return; - DoScriptText(TEXT_AGGRO, me); + Talk(TEXT_AGGRO); me->SetInCombatWithZone(); instance->SetData(DATA_JEDOGA_SHADOWSEEKER_EVENT, IN_PROGRESS); } @@ -147,12 +140,12 @@ public: if (!Victim || Victim->GetTypeId() != TYPEID_PLAYER) return; - DoScriptText(RAND(TEXT_SLAY_1, TEXT_SLAY_2, TEXT_SLAY_3), me); + Talk(TEXT_SLAY); } void JustDied(Unit* /*killer*/) { - DoScriptText(TEXT_DEATH, me); + Talk(TEXT_DEATH); if (instance) instance->SetData(DATA_JEDOGA_SHADOWSEEKER_EVENT, DONE); } @@ -178,7 +171,7 @@ public: if (!bPreDone && who->GetTypeId() == TYPEID_PLAYER && me->GetDistance(who) < 100.0f) { - DoScriptText(RAND(TEXT_PREACHING_1, TEXT_PREACHING_2, TEXT_PREACHING_3, TEXT_PREACHING_4, TEXT_PREACHING_5), me); + Talk(TEXT_PREACHING); bPreDone = true; } @@ -270,7 +263,7 @@ public: if (opfer) { - DoScriptText(RAND(TEXT_SACRIFICE_1_1, TEXT_SACRIFICE_1_2), me); + Talk(TEXT_SACRIFICE_1); instance->SetData64(DATA_ADD_JEDOGA_OPFER, opfer); } else bCanDown = true; @@ -278,7 +271,7 @@ public: void Opfern() { - DoScriptText(RAND(TEXT_SACRIFICE_2_1, TEXT_SACRIFICE_2_2), me); + Talk(TEXT_SACRIFICE_2); me->InterruptNonMeleeSpells(false); DoCast(me, SPELL_GIFT_OF_THE_HERALD, false); @@ -534,11 +527,11 @@ public: { npc_jedogas_aufseher_triggerAI(Creature* creature) : Scripted_NoMovementAI(creature) { - instance = creature->GetInstanceScript(); - bRemoved = false; - bRemoved2 = false; - bCasted = false; - bCasted2 = false; + instance = creature->GetInstanceScript(); + bRemoved = false; + bRemoved2 = false; + bCasted = false; + bCasted2 = false; } InstanceScript* instance; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp index 98b3a6b658b..6a4a5255293 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp @@ -21,97 +21,93 @@ enum Yells { - SAY_AGGRO = -1603240, - SAY_HARDMODE_ON = -1603241, - SAY_MKII_ACTIVATE = -1603242, - SAY_MKII_SLAY_1 = -1603243, - SAY_MKII_SLAY_2 = -1603244, - SAY_MKII_DEATH = -1603245, - SAY_VX001_ACTIVATE = -1603246, - SAY_VX001_SLAY_1 = -1603247, - SAY_VX001_SLAY_2 = -1603248, - SAY_VX001_DEATH = -1603249, - SAY_AERIAL_ACTIVATE = -1603250, - SAY_AERIAL_SLAY_1 = -1603251, - SAY_AERIAL_SLAY_2 = -1603252, - SAY_AERIAL_DEATH = -1603253, - SAY_V07TRON_ACTIVATE = -1603254, - SAY_V07TRON_SLAY_1 = -1603255, - SAY_V07TRON_SLAY_2 = -1603256, - SAY_V07TRON_DEATH = -1603257, - SAY_BERSERK = -1603258, - SAY_YS_HELP = -1603259, + SAY_AGGRO = 0, + SAY_HARDMODE_ON = 1, + SAY_MKII_ACTIVATE = 2, + SAY_MKII_SLAY = 3, + SAY_MKII_DEATH = 4, + SAY_VX001_ACTIVATE = 5, + SAY_VX001_SLAY = 6, + SAY_VX001_DEATH = 7, + SAY_AERIAL_ACTIVATE = 8, + SAY_AERIAL_SLAY = 9, + SAY_AERIAL_DEATH = 10, + SAY_V07TRON_ACTIVATE = 11, + SAY_V07TRON_SLAY = 12, + SAY_V07TRON_DEATH = 13, + SAY_BERSERK = 14, + SAY_YS_HELP = 15 }; enum Spells { - SPELL_JETPACK = 63341, - SPELL_EMERGENCY_MODE = 64582, - SPELL_SELF_REPAIR = 64383, - SPELL_MAGNETIC_CORE = 64444, - // Leviathan MK II - SPELL_FLAME_SUPPRESSANT_MK = 64570, - SPELL_NAPALM_SHELL = 63666, - SPELL_PLASMA_BLAST = 62977, - SPELL_PROXIMITY_MINES = 63027, - SPELL_SHOCK_BLAST = 63631, - // VX 001 - SPELL_FLAME_SUPPRESSANT_VX = 65192, - SPELL_FROSTBOMB = 64623, - SPELL_HAND_PULSE = 64348, - SPELL_SPINNING_UP = 63414, - SPELL_RAPID_BURST = 63387, - SPELL_P3WX2_LASER_BARRAGE = 63293, - SPELL_ROCKET_STRIKE = 63041, - SPELL_HEAT_WAVE = 63677, - // Aerial Command Unit - SPELL_PLASMA_BALL = 63689, - // Additonal spells - SPELL_MAGNETIC_FIELD = 64668, - SPELL_DEAFENING_SIREN = 64616, - SPELL_WATER_SPRAY = 64619, - SPELL_FROST_BOMB_HARD_MODE = 64627, - SPELL_EXPLOSION = 66351, - SPELL_DISARM = 1842, - SPELL_RIDE_VEHICLE = 46598, - SPELL_TRIGGER_MISSILE = 65347, + SPELL_JETPACK = 63341, + SPELL_EMERGENCY_MODE = 64582, + SPELL_SELF_REPAIR = 64383, + SPELL_MAGNETIC_CORE = 64444, + // Leviathan MK II + SPELL_FLAME_SUPPRESSANT_MK = 64570, + SPELL_NAPALM_SHELL = 63666, + SPELL_PLASMA_BLAST = 62977, + SPELL_PROXIMITY_MINES = 63027, + SPELL_SHOCK_BLAST = 63631, + // VX 001 + SPELL_FLAME_SUPPRESSANT_VX = 65192, + SPELL_FROSTBOMB = 64623, + SPELL_HAND_PULSE = 64348, + SPELL_SPINNING_UP = 63414, + SPELL_RAPID_BURST = 63387, + SPELL_P3WX2_LASER_BARRAGE = 63293, + SPELL_ROCKET_STRIKE = 63041, + SPELL_HEAT_WAVE = 63677, + // Aerial Command Unit + SPELL_PLASMA_BALL = 63689, + // Additonal spells + SPELL_MAGNETIC_FIELD = 64668, + SPELL_DEAFENING_SIREN = 64616, + SPELL_WATER_SPRAY = 64619, + SPELL_FROST_BOMB_HARD_MODE = 64627, + SPELL_EXPLOSION = 66351, + SPELL_DISARM = 1842, + SPELL_RIDE_VEHICLE = 46598, + SPELL_TRIGGER_MISSILE = 65347, }; enum Npc { - NPC_ASSAULT_BOT = 34057, - NPC_BOMB_BOT = 33836, - NPC_JUNK_BOT = 33855, - NPC_EMERGENCE_FIRE_BOT = 34147, - NPC_FROST_BOMB = 34149, + NPC_ASSAULT_BOT = 34057, + NPC_BOMB_BOT = 33836, + NPC_JUNK_BOT = 33855, + NPC_EMERGENCE_FIRE_BOT = 34147, + NPC_FROST_BOMB = 34149, }; class spell_ulduar_proximity_mines : public SpellScriptLoader { - public: - spell_ulduar_proximity_mines() : SpellScriptLoader("spell_ulduar_proximity_mines") { } + public: + spell_ulduar_proximity_mines() : SpellScriptLoader("spell_ulduar_proximity_mines") { } - class spell_ulduar_proximity_minesSpellScript : public SpellScript - { - PrepareSpellScript(spell_ulduar_proximity_minesSpellScript) + class spell_ulduar_proximity_minesSpellScript : public SpellScript + { + PrepareSpellScript(spell_ulduar_proximity_minesSpellScript) - void HandleScript(SpellEffIndex effIndex) - { - PreventHitDefaultEffect(effIndex); - for (uint8 i = 0; i < 10; ++i) - GetCaster()->CastSpell(GetCaster(), SPELL_TRIGGER_MISSILE, true); - } + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + for (uint8 i = 0; i < 10; ++i) + GetCaster()->CastSpell(GetCaster(), SPELL_TRIGGER_MISSILE, true); + } - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_ulduar_proximity_minesSpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_ulduar_proximity_minesSpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; - SpellScript* GetSpellScript() const - { - return new spell_ulduar_proximity_minesSpellScript(); - } + SpellScript* GetSpellScript() const + { + return new spell_ulduar_proximity_minesSpellScript(); + } }; void AddSC_boss_mimiron() diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index e8e938dc06b..6038b7ed9d6 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -369,7 +369,7 @@ class boss_razorscale : public CreatureScript void MovementInform(uint32 type, uint32 id) { - if (type == POINT_MOTION_TYPE && id == 1) + if (type == EFFECT_MOTION_TYPE && id == 1) { phase = PHASE_GROUND; events.SetPhase(PHASE_GROUND); @@ -407,7 +407,7 @@ class boss_razorscale : public CreatureScript if (HarpoonCounter == RAID_MODE(2, 4)) { HarpoonCounter = 0; - me->GetMotionMaster()->MovePoint(1, RazorGround); + me->GetMotionMaster()->MoveLand(1, RazorGround); } if (phase == PHASE_GROUND) @@ -423,7 +423,7 @@ class boss_razorscale : public CreatureScript me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_PASSIVE); me->AttackStop(); - me->GetMotionMaster()->MovePoint(0, RazorFlight); + me->GetMotionMaster()->MoveTakeoff(0, RazorFlight); events.ScheduleEvent(EVENT_FIREBALL, 7000, 0, PHASE_FLIGHT); events.ScheduleEvent(EVENT_DEVOURING, 10000, 0, PHASE_FLIGHT); events.ScheduleEvent(EVENT_SUMMON, 5000, 0, PHASE_FLIGHT); @@ -525,7 +525,7 @@ class boss_razorscale : public CreatureScript phase = PHASE_PERMAGROUND; events.SetPhase(PHASE_PERMAGROUND); me->SetCanFly(false); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED); me->SetReactState(REACT_AGGRESSIVE); me->RemoveAurasDueToSpell(SPELL_HARPOON_TRIGGER); me->SetSpeed(MOVE_FLIGHT, 1.0f, true); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 0102c3cb1ae..7be80088101 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -627,7 +627,7 @@ class spell_pal_divine_sacrifice : public SpellScriptLoader bool Load() { - + if (Unit* caster = GetCaster()) { if (caster->GetTypeId() == TYPEID_PLAYER) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index c7a283c94d7..add782cf517 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -420,7 +420,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_CHAR_GUID_NAME_BY_ACC, "SELECT guid, name FROM characters WHERE account = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_POOL_QUEST_SAVE, "SELECT quest_id FROM pool_quest_save WHERE pool_id = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_CHARACTER_AT_LOGIN, "SELECT at_login FROM characters WHERE guid = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_CLASS_LVL_AT_LOGIN, "SELECT class, level, at_login FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_CLASS_LVL_AT_LOGIN, "SELECT class, level, at_login, knownTitles FROM characters WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_INSTANCE, "SELECT data, completedEncounters FROM instance WHERE map = ? AND id = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_PET_SPELL_LIST, "SELECT DISTINCT pet_spell.spell FROM pet_spell, character_pet WHERE character_pet.owner = ? AND character_pet.id = pet_spell.guid AND character_pet.id <> ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_CHAR_PET, "SELECT id FROM character_pet WHERE owner = ? AND id <> ?", CONNECTION_SYNCH); @@ -499,6 +499,8 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_UPD_CHAR_SPELL_FACTION_CHANGE, "UPDATE character_spell SET spell = ? where spell = ? AND guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_REP_BY_FACTION, "DELETE FROM character_reputation WHERE faction = ? AND guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_CHAR_REP_FACTION_CHANGE, "UPDATE character_reputation SET faction = ? where faction = ? AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_TITLES_FACTION_CHANGE, "UPDATE characters SET knownTitles = ? WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_RES_CHAR_TITLES_FACTION_CHANGE, "UPDATE characters SET chosenTitle = 0 WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_SPELL_COOLDOWN, "DELETE FROM character_spell_cooldown WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHARACTER, "DELETE FROM characters WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_ACTION, "DELETE FROM character_action WHERE guid = ?", CONNECTION_ASYNC); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 823ad874de9..fedf0022fcc 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -462,6 +462,8 @@ enum CharacterDatabaseStatements CHAR_UPD_CHAR_SPELL_FACTION_CHANGE, CHAR_DEL_CHAR_REP_BY_FACTION, CHAR_UPD_CHAR_REP_FACTION_CHANGE, + CHAR_UPD_CHAR_TITLES_FACTION_CHANGE, + CHAR_RES_CHAR_TITLES_FACTION_CHANGE, CHAR_DEL_CHAR_SPELL_COOLDOWN, CHAR_DEL_CHARACTER, CHAR_DEL_CHAR_ACTION, |