diff options
47 files changed, 1086 insertions, 624 deletions
diff --git a/sql/updates/world/2013_08_16_01_world_hor.sql b/sql/updates/world/2013_08_06_01_world_hor.sql index c9b8ccf8266..c9b8ccf8266 100644 --- a/sql/updates/world/2013_08_16_01_world_hor.sql +++ b/sql/updates/world/2013_08_06_01_world_hor.sql diff --git a/sql/updates/world/2013_08_06_02_world_command.sql b/sql/updates/world/2013_08_06_02_world_command.sql new file mode 100644 index 00000000000..2787cf079cf --- /dev/null +++ b/sql/updates/world/2013_08_06_02_world_command.sql @@ -0,0 +1,3 @@ +DELETE FROM `command` WHERE `name`='reload gameobject_questender'; +INSERT INTO `command` (`name`, `security`, `help`) VALUES +('reload gameobject_questender', 3, 'Syntax: .reload gameobject_questender\\nReload gameobject_questender table.'); diff --git a/sql/updates/world/2013_08_06_03_world_area_4522.sql b/sql/updates/world/2013_08_06_03_world_area_4522.sql new file mode 100644 index 00000000000..63ac8c4aeac --- /dev/null +++ b/sql/updates/world/2013_08_06_03_world_area_4522.sql @@ -0,0 +1,95 @@ +SET @CGUID := 120649; +SET @HULKING_HORROR := 31411; +SET @HULKING_HORROR1 := 31413; +SET @KRENDELL := 31444; +SET @V_COMMANDO := 31414; +SET @UPPER_CUT := 10966; +SET @INF_BITE := 49861; +SET @COSMETIC_EXP := 46225; +SET @FLAME_PATCH := 42344; +SET @FC_PITFALL := 59398; +SET @AURA_FALL := 59396; +SET @ASPELL := 59073; +SET @HSPELL := 59087; +SET @AREA := 4522; + +-- Setting new spawns to appropriate phase, and older spawns to their own appropriate phase also. +UPDATE `creature_template` SET `minlevel`=79, `maxlevel`=80, `exp`=2, `faction_A`=2043, `faction_H`=2043, `speed_run`=1.28968, `mindmg`=422, `maxdmg`=586, `attackpower`=642, `minrangedmg`=345, `maxrangedmg`=509, `rangedattackpower`=103 WHERE `entry`=31413; +UPDATE `creature_template` SET AIName = 'SmartAI' WHERE entry IN (@HULKING_HORROR,@HULKING_HORROR1); +UPDATE `creature` SET `phaseMask` = 2 WHERE id IN (@KRENDELL,@V_COMMANDO,@HULKING_HORROR); +UPDATE `creature` SET `phaseMask` = 8 WHERE id = @HULKING_HORROR1; +UPDATE `gameobject` SET `phaseMask` = 10 WHERE id IN (193401,193400); +UPDATE `creature` SET `phaseMask` = 10 WHERE id IN (31641, 31644); + +-- Phasing zone to both Alliance and Horde sides so they don't collide with the npc's there. +DELETE FROM `spell_area` WHERE `spell` IN (@HSPELL,@ASPELL) AND `area`=@AREA; +INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`,`quest_start_status`,`quest_end_status`) VALUES +(@HSPELL,@AREA,13258,13282,0, 690,2,1,66,43), -- Horde version +(@ASPELL,@AREA,13386,13392,0,1101,2,1,66,43); -- Alliance version + +-- Missing Hulking Horrors +DELETE FROM `creature` WHERE guid BETWEEN @CGUID AND @CGUID+22; +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES +(@CGUID, 31413, 571, 1, 8, 23681, 0, 5814.02, 1985.69, 503.881, 2.51188, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+1, 31413, 571, 1, 8, 23681, 0, 5816.86, 1943.29, 507.56, 3.40633, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+2, 31413, 571, 1, 8, 23681, 0, 5863.57, 1984, 507.648, 5.88321, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+3, 31413, 571, 1, 8, 23681, 0, 5778.56, 1957.5, 503.857, 3.27375, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+4, 31413, 571, 1, 8, 23681, 0, 5732.14, 1937.82, 506.014, 5.41257, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+5, 31413, 571, 1, 8, 23681, 0, 5706.3, 1977.47, 503.911, 4.05224, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+6, 31413, 571, 1, 8, 23681, 0, 5685.71, 1974.25, 503.863, 2.57831, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+7, 31413, 571, 1, 8, 23681, 0, 5673.84, 2094.37, 503.889, 5.52857, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+8, 31413, 571, 1, 8, 23681, 0, 5831.47, 2106.11, 503.89, 6.24962, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+9, 31413, 571, 1, 8, 23681, 0, 5826.33, 2149.32, 505.746, 2.48705, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+10, 31413, 571, 1, 8, 23681, 0, 5754.92, 2151.17, 503.91, 1.93734, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+11, 31413, 571, 1, 8, 23681, 0, 5775.43, 2193.86, 512.998, 0.776427, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+12, 31413, 571, 1, 8, 23681, 0, 5729.88, 2136.62, 503.894, 1.79434, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+13, 31413, 571, 1, 8, 23681, 0, 5782.62, 2140.68, 503.9, 0.783972, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+14, 31413, 571, 1, 8, 23681, 0, 5754.13, 2174.58, 506.181, 1.25723, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+15, 31413, 571, 1, 8, 23681, 0, 5650.03, 2055.57, 503.868, 0.939173, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+16, 31413, 571, 1, 8, 23681, 0, 5660.07, 2125.83, 505.943, 0.534949, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+17, 31413, 571, 1, 8, 23681, 0, 5700.89, 2148.91, 503.999, 5.77704, 300, 0, 0, 12175, 0, 0, 0, 0, 0), +(@CGUID+18, 31413, 571, 1, 8, 23681, 0, 5651.27, 2007.15, 504.97, 1.98891, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+19, 31413, 571, 1, 8, 23681, 0, 5858.93, 2108.63, 505.124, 2.30257, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+20, 31413, 571, 1, 8, 23681, 0, 5688.14, 2001.98, 503.924, 0.151243, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+21, 31413, 571, 1, 8, 23681, 0, 5845.64, 2080.43, 503.97, 2.90496, 300, 5, 0, 12175, 0, 1, 0, 0, 0), +(@CGUID+22, 31413, 571, 1, 8, 23681, 0, 5876.8, 2037.78, 506.147, 0.498635, 300, 0, 0, 12175, 0, 0, 0, 0, 0); + +-- Conditions for Aura fall +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 13 and `SourceEntry` = @AURA_FALL; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, @AURA_FALL, 0, 0, 31, 0, 3, 31641, 0, 0, 0, 0, '', 'Aura fall hits only pitfall npc'); + +-- Saronite bomb should blow-up the player into the pit +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=193400; +DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=193400; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(193400, 1, 0, 0, 19, 0, 100, 0, 13389, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, 123287, 31644, 0, 0, 0, 0, 0, 'Saronite Bomb Stack - On quest accept - Set Data'), +(193400, 1, 1, 0, 19, 0, 100, 0, 13263, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, 123287, 31644, 0, 0, 0, 0, 0, 'Saronite Bomb Stack - On quest accept - Set Data'); + +-- Cosmetic Explosion bunny +UPDATE `creature_template` SET AIName = 'SmartAI' WHERE entry = 31644; +DELETE FROM `smart_scripts` WHERE `entryorguid`=31644 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(31644, 0, 0, 1, 38, 0, 100, 0, 1, 1, 0, 0, 11, @COSMETIC_EXP, 2, 0, 0, 0, 0, 9, 31644, 20, 40, 0, 0, 0, 0, 'Cosmetic Trigger - On Data set - Cosmetic Explosion'), +(31644, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 11, @FLAME_PATCH, 2, 0, 0, 0, 0, 9, 31644, 20, 40, 0, 0, 0, 0, 'Cosmetic Trigger - On Link - Cast flame patch on npc''s'), +(31644, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 12, 31641, 1, 0, 0, 0, 0, 21, 10, 0, 0, 0, 0, 0, 0, 'Saronite Bomb Stack - On Link - Summon Pitfall bunny'); + +-- "Fall" vehicle bunny +UPDATE `creature_template` SET AIName = 'SmartAI', `speed_walk`=20.1429, `speed_run`=20.1429 WHERE entry = 31641; +DELETE FROM `smart_scripts` WHERE `entryorguid`=31641 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(31641, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 11, @FC_PITFALL, 2, 0, 0, 0, 0, 21, 100, 0, 0, 0, 0, 0, 0, 'Pitfall bunny - On respawn - Cast FC pitfall'), +(31641, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 5756.644, 2050.579, 480.6346, 0, 'Pitfall bunny - On Link - Go to PoS'); + +-- Hulking Horror phase 2 +DELETE FROM `smart_scripts` WHERE `entryorguid`=@HULKING_HORROR AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@HULKING_HORROR,0,0,0,0,0,100,0,8000,16000,24000,32000,11,@INF_BITE,0,0,0,0,0,5,0,0,0,0,0,0,0,'Hulking Horror - In Combat - Cast Infected Bite'), +(@HULKING_HORROR,0,1,0,0,0,100,0,4000,9000,14000,19000,11,@UPPER_CUT,0,0,0,0,0,5,0,0,0,0,0,0,0,'Hulking Horror - In Combat - Cast Uppercut'), +(@HULKING_HORROR,0,2,0,6,0,100,0,0,0,0,0,33,31413,0,0,0,0,0,5,0,0,0,0,0,0,0,'Hulking Horror - On Death - Killcredit'); + +-- Hulking Horrors phase 8 +DELETE FROM `smart_scripts` WHERE `entryorguid`=@HULKING_HORROR1 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@HULKING_HORROR1,0,0,0,0,0,100,0,8000,16000,24000,32000,11,@INF_BITE,0,0,0,0,0,5,0,0,0,0,0,0,0,'Hulking Horror - In Combat - Cast Infected Bite'), +(@HULKING_HORROR1,0,1,0,0,0,100,0,4000,9000,14000,19000,11,@UPPER_CUT,0,0,0,0,0,5,0,0,0,0,0,0,0,'Hulking Horror - In Combat - Cast Uppercut'); diff --git a/sql/updates/world/2013_08_06_04_world_sai.sql b/sql/updates/world/2013_08_06_04_world_sai.sql new file mode 100644 index 00000000000..54124c1ea41 --- /dev/null +++ b/sql/updates/world/2013_08_06_04_world_sai.sql @@ -0,0 +1,35 @@ +-- Into The Wild Green Yonder (13045) +SET @NPC_CAPTURED := 30407; -- Captured Crusader +SET @NPC_SKYTALON := 30500; -- Argent Skytalon (not the mount) +SET @NPC_SKYTALON_MOUNT := 30228; -- Argent Skytalon (mount) + +UPDATE `creature_template` SET `faction_A`=2070,`faction_H`=2070 WHERE `entry`=@NPC_SKYTALON; +UPDATE `creature_template` SET `npcflag`=0 WHERE `entry`=@NPC_SKYTALON_MOUNT; + +-- Re-vamped SAI script +UPDATE `creature_template` SET `npcflag`=0,`AIName`='SmartAI' WHERE `entry`=@NPC_CAPTURED; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@NPC_CAPTURED; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@NPC_CAPTURED,0,0,1,25,0,100,0,0,0,0,0,75,56726,0,0,0,0,0,1,0,0,0,0,0,0,0,'Apply aura on reset, linking to id 1'), +(@NPC_CAPTURED,0,1,0,61,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'set phasemask to 1'), +(@NPC_CAPTURED,0,2,0,1,1,100,0,4000,4000,4000,4000,10,70,22,0,0,0,0,1,0,0,0,0,0,0,0,'play emote OOC in phase 1'), +(@NPC_CAPTURED,0,3,4,8,1,100,0,56683,0,0,0,11,56687,0,0,0,0,0,7,0,0,0,0,0,0,0,'Mount proto drake on spell hit, linking to id 4'), +(@NPC_CAPTURED,0,4,5,61,1,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Say text , linking to id 5'), +(@NPC_CAPTURED,0,5,0,61,1,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'set phasemask to 2'), +(@NPC_CAPTURED,0,6,0,1,2,100,0,8000,8000,8000,8000,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Say text OOC in phase 2, starting with 8sec delay, then repeat every 8 secs'), +(@NPC_CAPTURED,0,7,8,23,2,100,0,56687,0,1000,1000,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'say text if does not have ride aura(check every 1 sec), linking to id 8'), +(@NPC_CAPTURED,0,8,9,61,2,100,0,0,0,0,0,41,5000,0,0,0,0,0,1,0,0,0,0,0,0,0,'set despawn timer for 5 secs, linking to id 9'), +(@NPC_CAPTURED,0,9,0,61,2,100,0,0,0,0,0,22,4,0,0,0,0,0,1,0,0,0,0,0,0,0,'set phase to 4'); +-- Re-vamped spellclick +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=@NPC_SKYTALON; +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type`) VALUES +-- Proper value +(@NPC_SKYTALON,56922,2,0); +-- rRe-vamped condition +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=18 AND `SourceEntry`=56922) OR (`SourceTypeOrReferenceId`=17 AND `SourceEntry`=56684) OR (`SourceTypeOrReferenceId`=13 AND `SourceEntry`=56683); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(18,@NPC_SKYTALON,56922,0,0,8,0,13045,0,0,1,0,'','Forbidden rewarded quest for spellclick'), +(18,@NPC_SKYTALON,56922,0,0,9,0,13045,0,0,0,0,'','Required quest active for spellclick'), +(13,1,56683,0,0,31,0,3,@NPC_CAPTURED,0,0,0,'','Grab Captured Crusader targets Captured Crusader'), +(17,0,56684,0,0,30,0,192523,15,0,0,0,'','Spell focus for Drop Off Captured Crusader'), +(17,0,56684,0,0,29,0,@NPC_CAPTURED,10,0,0,0,'','Drop Off Captured Crusader requires a Captured Crusader'); diff --git a/sql/updates/world/2013_08_06_05_world_misc.sql b/sql/updates/world/2013_08_06_05_world_misc.sql new file mode 100644 index 00000000000..15193cc2d09 --- /dev/null +++ b/sql/updates/world/2013_08_06_05_world_misc.sql @@ -0,0 +1,333 @@ +-- The Last Line Of Defense (13086) +SET @NEXT := 142412; +SET @PATH := @NEXT * 10; + +DELETE FROM `spell_script_names` WHERE `spell_id` IN (57412,57385); +INSERT INTO `spell_script_names`(`spell_id`, `ScriptName`) VALUES +(57412,'spell_q13086_cannons_target'), +(57385,'spell_q13086_cannons_target'); + +-- Forgotten Depths Slayer SAI ID: 30593 +UPDATE `creature_template` SET `speed_walk`=5,`movementtype`=1,`faction_A`=2068, `faction_H`=2068,`AIName`= 'SmartAI' WHERE `entry`= 30593; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=30593; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(30593,0,1,0,0,0,100,0,1000,5000,2500,6500,11,54185,0,0,0,0,0,2,0,0,0,0,0,0,0,'Combat - Claw Slash'); + +-- Adds 70 Forgotten Depths Slayers for phase 64 ID: 30593 +DELETE FROM `creature` WHERE `id`=30593; +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `MovementType`) VALUES +(@NEXT+1, 30593, 571, 1, 64, 6442.551758, 222.894867, 397.353943, 2.7317, 5, 60, 0, 1), +(@NEXT+2, 30593, 571, 1, 64, 6437.940430, 215.351151, 397.798889, 0.929563, 5, 60, 0, 1), +(@NEXT+3, 30593, 571, 1, 64, 6419.338379, 239.908859, 396.095978, 2.1122, 5, 60, 0, 1), +(@NEXT+4, 30593, 571, 1, 64, 6428.831055, 239.908859, 396.763702, 3.5549, 5, 60, 0, 1), +(@NEXT+5, 30593, 571, 1, 64, 6400.702148, 236.755035, 395.685333, 1.32629, 5, 60, 0, 1), +(@NEXT+6, 30593, 571, 1, 64, 6410.955078, 249.759094, 396.454742, 2.77181, 5, 60, 0, 1), +(@NEXT+7, 30593, 571, 1, 64, 6367.340820, 183.807068, 391.614655, 0.501217, 5, 60, 0, 1), +(@NEXT+8, 30593, 571, 1, 64, 6382.062500, 176.836975, 393.132507, 1.22528, 5, 60, 0, 1), +(@NEXT+9, 30593, 571, 1, 64, 6357.964355, 158.979782, 391.124756, 2.99677, 5, 60, 0, 1), +(@NEXT+10, 30593, 571, 1, 64, 6373.327537, 146.681412, 392.788330, 3.35221, 5, 60, 0, 1), +(@NEXT+11, 30593, 571, 1, 64, 6343.335938, 173.300323, 389.862518, 4.18409, 5, 60, 0, 1), +(@NEXT+12, 30593, 571, 1, 64, 6335.788086, 148.828232, 389.702972, 3.19711, 5, 60, 0, 1), +(@NEXT+13, 30593, 571, 1, 64, 6347.954590, 129.882919, 3391.126984, 2.81552, 5, 60, 0, 1), +(@NEXT+14, 30593, 571, 1, 64, 6333.287109, 88.245689, 391.002228, 5.84132, 5, 60, 0, 1), +(@NEXT+15, 30593, 571, 1, 64, 6336.879395, 71.525627, 390.192871, 0.785398, 5, 60, 0, 1), +(@NEXT+16, 30593, 571, 1, 64, 6318.244629, 32.249405, 391.493988, 2.1325, 5, 60, 0, 1), +(@NEXT+17, 30593, 571, 1, 64, 6312.728320, 8.393217, 392.626587, 0.291176, 5, 60, 0, 1), +(@NEXT+18, 30593, 571, 1, 64, 6326.704590, 107.359123, 391.002045, 0.919091, 5, 60, 0, 1), +(@NEXT+19, 30593, 571, 1, 64, 6301.972656, 119.744209, 389.925903, 1.55615, 5, 60, 0, 1), +(@NEXT+20, 30593, 571, 1, 64, 6266.120117, 148.388809, 383.515961, 1.84373, 5, 60, 0, 1), +(@NEXT+21, 30593, 571, 1, 64, 6251.726074, 153.168182, 381.629669, 1.80125, 5, 60, 0, 1), +(@NEXT+22, 30593, 571, 1, 64, 6229.003418, 145.614822, 379.721741, 5.84095, 5, 60, 0, 1), +(@NEXT+23, 30593, 571, 1, 64, 6284.683082, 214.294250, 388.699188, 2.78648, 5, 60, 0, 1), +(@NEXT+24, 30593, 571, 1, 64, 6302.265625, 212.301346, 390.488556, 3.48219, 5, 60, 0, 1), +(@NEXT+25, 30593, 571, 1, 64, 6299.725098, 226.082626, 391.288788, 5.13205, 5, 60, 0, 1), +(@NEXT+26, 30593, 571, 1, 64, 6200.917969, 220.434753, 383.776184, 2.88047, 5, 60, 0, 1), +(@NEXT+27, 30593, 571, 1, 64, 6200.930664, 234.127823, 384.630798, 1.50529, 5, 60, 0, 1), +(@NEXT+28, 30593, 571, 1, 64, 6190.595703, 225.242371, 382.554016, 4.4761, 5, 60, 0, 1), +(@NEXT+29, 30593, 571, 1, 64, 6189.209961, 210.502823, 381.877960, 2.11574, 5, 60, 0, 1), +(@NEXT+30, 30593, 571, 1, 64, 6176.683594, 213.375336, 380.395172, 0.763302, 5, 60, 0, 1), +(@NEXT+31, 30593, 571, 1, 64, 6113.089844, 156.401672, 369.398804, 5.60417, 5, 60, 0, 1), +(@NEXT+32, 30593, 571, 1, 64, 6103.571289, 140.684174, 367.524414, 0.430917, 5, 60, 0, 1), +(@NEXT+33, 30593, 571, 1, 64, 6093.838867, 143.838867, 367.781097, 6.10437, 5, 60, 0, 1), +(@NEXT+34, 30593, 571, 1, 64, 6090.764160, 141.764160, 365.786255, 5.91518, 5, 60, 0, 1), +(@NEXT+35, 30593, 571, 1, 64, 6079.681641, 141.840958, 366.456573, 5.91108, 5, 60, 0, 1), +(@NEXT+36, 30593, 571, 1, 64, 6062.076660, 155.683197, 363.868896, 2.05191, 5, 60, 0, 1), +(@NEXT+37, 30593, 571, 1, 64, 6076.666016, 163.742477, 362.454651, 3.57468, 5, 60, 0, 1), +(@NEXT+38, 30593, 571, 1, 64, 6088.131348, 179.086304, 360.483307, 5.6035, 5, 60, 0, 1), +(@NEXT+39, 30593, 571, 1, 64, 6098.503418, 176.307312, 364.942688, 5.6035, 5, 60, 0, 1), +(@NEXT+40, 30593, 571, 1, 64, 6090.764160, 155.876968, 365.786255, 5.6035, 5, 60, 0, 1), +(@NEXT+41, 30593, 571, 1, 64, 6338.830566, 70.974663, 390.432343, 5.6035, 5, 60, 0, 1), +(@NEXT+42, 30593, 571, 1, 64, 6339.270508, 63.711479, 389.662994, 5.6035, 5, 60, 0, 1), +(@NEXT+43, 30593, 571, 1, 64, 6282.305176, 128.449188, 386.556244, 5.6035, 5, 60, 0, 1), +(@NEXT+44, 30593, 571, 1, 64, 6267.317383, 130.918854, 384.601959, 5.6035, 5, 60, 0, 1), +(@NEXT+45, 30593, 571, 1, 64, 6182.309082, 94.777863, 377.689959, 5.6035, 5, 60, 0, 1), +(@NEXT+46, 30593, 571, 1, 64, 6157.960383, 89.072354, 371.833959, 5.6035, 5, 60, 0, 1), +(@NEXT+47, 30593, 571, 1, 64, 6236.617383, 113.980854, 380.351959, 5.6035, 5, 60, 0, 1), +(@NEXT+48, 30593, 571, 1, 64, 6295.647383, 137.418854, 387.451959, 5.6035, 5, 60, 0, 1), +(@NEXT+49, 30593, 571, 1, 64, 6200.917969, 220.434753, 383.776184, 2.88047, 5, 60, 0, 1), +(@NEXT+50, 30593, 571, 1, 64, 6200.930664, 234.127823, 384.630798, 1.50529, 5, 60, 0, 1), +(@NEXT+51, 30593, 571, 1, 64, 6190.595703, 225.242371, 382.554016, 4.4761, 5, 60, 0, 1), +(@NEXT+52, 30593, 571, 1, 64, 6189.209961, 210.502823, 381.877960, 2.11574, 5, 60, 0, 1), +(@NEXT+53, 30593, 571, 1, 64, 6176.683594, 213.375336, 380.395172, 0.763302, 5, 60, 0, 1), +(@NEXT+54, 30593, 571, 1, 64, 6113.089844, 156.401672, 369.398804, 5.60417, 5, 60, 0, 1), +(@NEXT+55, 30593, 571, 1, 64, 6103.571289, 140.684174, 367.524414, 0.430917, 5, 60, 0, 1), +(@NEXT+56, 30593, 571, 1, 64, 6093.838867, 143.838867, 367.781097, 6.10437, 5, 60, 0, 1), +(@NEXT+57, 30593, 571, 1, 64, 6090.764160, 141.764160, 365.786255, 5.91518, 5, 60, 0, 1), +(@NEXT+58, 30593, 571, 1, 64, 6079.681641, 141.840958, 366.456573, 5.91108, 5, 60, 0, 1), +(@NEXT+59, 30593, 571, 1, 64, 6062.076660, 155.683197, 363.868896, 2.05191, 5, 60, 0, 1), +(@NEXT+60, 30593, 571, 1, 64, 6076.666016, 163.742477, 362.454651, 3.57468, 5, 60, 0, 1), +(@NEXT+61, 30593, 571, 1, 64, 6088.131348, 179.086304, 360.483307, 5.6035, 5, 60, 0, 1), +(@NEXT+62, 30593, 571, 1, 64, 6098.503418, 176.307312, 364.942688, 5.6035, 5, 60, 0, 1), +(@NEXT+63, 30593, 571, 1, 64, 6090.764160, 155.876968, 365.786255, 5.6035, 5, 60, 0, 1), +(@NEXT+64, 30593, 571, 1, 64, 6338.830566, 70.974663, 390.432343, 5.6035, 5, 60, 0, 1), +(@NEXT+65, 30593, 571, 1, 64, 6339.270508, 63.711479, 389.662994, 5.6035, 5, 60, 0, 1), +(@NEXT+66, 30593, 571, 1, 64, 6282.305176, 128.449188, 386.556244, 5.6035, 5, 60, 0, 1), +(@NEXT+67, 30593, 571, 1, 64, 6267.317383, 130.918854, 384.601959, 5.6035, 5, 60, 0, 1), +(@NEXT+68, 30593, 571, 1, 64, 6182.309082, 94.777863, 377.689959, 5.6035, 5, 60, 0, 1), +(@NEXT+69, 30593, 571, 1, 64, 6157.960383, 89.072354, 371.833959, 5.6035, 5, 60, 0, 1), +(@NEXT+70, 30593, 571, 1, 64, 6236.617383, 113.980854, 380.351959, 5.6035, 5, 60, 0, 1); + +-- Frostbrood Destroyers 5 +UPDATE `creature_template` SET `maxlevel`=80,`minlevel`=80,`exp`=2,`InhabitType`=7,`speed_walk`=3,`mindmg` = 1170,`dmg_multiplier` = 2,`attackpower` = 342,`maxdmg` = 3470,`movementtype`=1,`faction_A`=2068, `faction_H`=2068,`AIName`= 'SmartAI' WHERE `entry`= 30575; +DELETE FROM `creature` WHERE `id`=30575; +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES +(@NEXT+71, 30575,571,1,64,6097.870117, 58.331299, 380.506012, 0.138359, 75,20,1), +(@NEXT+72, 30575,571,1,64,6243.700195, 183.362000, 392.515015, 4.594332, 75,20,1), +(@NEXT+73, 30575,571,1,64,6313.589844, 154.557999, 397.022003, 4.739780, 75,20,1), +(@NEXT+74, 30575,571,1,64,6331.450195, 53.939301, 399.138000, 2.973792, 75,20,1), +(@NEXT+75, 30575,571,1,64,6187.290039, 131.792999, 386.451996, 3.173792, 75,20,1); + +-- Hover mode for Frostbroods +DELETE FROM `creature_template_addon` WHERE `entry`=30575; +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(30575,0,0,33554432,0,0,''); + +-- Pathing +-- Slayers reinforcements left on main path +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+1; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+1; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES +(@NEXT+1,@PATH+1,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+1; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+1,1,6442.551758, 222.894867, 397.353943,0,2,0,100,0), +(@PATH+1,2,6337.383789,113.591568,391.210876,6000,2,0,100,0), +(@PATH+1,3,6299.144531,126.174286,391.081909,6000,2,0,100,0); + +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+2; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+2; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES +(@NEXT+2,@PATH+2,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+2; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+2,1,6437.940430,215.351151,397.798889,0,2,0,100,0), +(@PATH+2,2,6327.383789,143.591568,391.210876,6000,2,0,100,0), +(@PATH+2,3,6296.544531,76.174286,391.081909,6000,2,0,100,0); + +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+3; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+3; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES +(@NEXT+3,@PATH+3,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+3; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+3,1,6419.338379,239.908859,396.095978,0,2,0,100,0), +(@PATH+3,2,6317.383789,115.591568,391.210876,6000,2,0,100,0), +(@PATH+3,3,6294.144531,126.174286,391.081909,6000,2,0,100,0); + +-- Slayers reinforcements right on main path +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+4; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+4; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES +(@NEXT+4,@PATH+4,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+4; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+4,1, 6428.831055, 239.908859, 396.763702,0,2,0,100,0), +(@PATH+4,2,6346.144531,126.174286,391.081909,6000,2,0,100,0), +(@PATH+4,3,6297.353789,80.591568,391.210876,6000,2,0,100,0); + +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+5; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+5; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES +(@NEXT+5,@PATH+5,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+5; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+5,1, 6400.702148, 236.755035, 395.685333,0,2,0,100,0), +(@PATH+5,2,6356.144531,106.174286,391.081909,6000,2,0,100,0), +(@PATH+5,3,6398.383789,70.591568,391.210876,6000,2,0,100,0); + +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+6; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+6; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES +(@NEXT+6,@PATH+6,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+6; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+6,1, 6410.955078, 249.759094, 396.454742,0,2,0,100,0), +(@PATH+6,2,6376.144531,116.174286,391.081909,6000,2,0,100,0), +(@PATH+6,3,6295.383789,65.591568,391.210876,6000,2,0,100,0); + +-- Slayers reinforcements on the rear +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+31; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+31; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES +(@NEXT+31,@PATH+7,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+7; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+7,1, 6113.089844, 156.401672, 369.398804,0,2,0,100,0), +(@PATH+7,2,6175.009766,125.577263,369.434753,6000,2,0,100,0), +(@PATH+7,3,6109.930176,49.710854,369.404419,6000,2,0,100,0); + +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+32; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+32; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NEXT+32,@PATH+8,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+8; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+8,1, 6103.571289, 140.684174, 368.524414,0,2,0,100,0), +(@PATH+8,2,6165.009766,119.577263,369.434753,6000,2,0,100,0), +(@PATH+8,3,6118.930176,64.710854,369.404419,6000,2,0,100,0); + +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+33; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+33; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NEXT+33,@PATH+9,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+9; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+9,1, 6093.838867, 143.838867, 368.781097,0,2,0,100,0), +(@PATH+9,2,6171.009766,114.577263,369.434753,6000,2,0,100,0), +(@PATH+9,3,6114.930176,61.710854,369.404419,6000,2,0,100,0); + +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+34; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+34; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NEXT+34,@PATH+10,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+10; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+10,1, 6090.764160, 141.764160, 369.786255,0,2,0,100,0), +(@PATH+10,2,6183.009766,109.577263,369.434753,6000,2,0,100,0), +(@PATH+10,3,6109.930176,57.710854,369.404419,6000,2,0,100,0); + +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+35; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+35; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NEXT+35,@PATH+11,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+11; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+11,1, 6079.681641, 141.840958, 369.456573,0,2,0,100,0), +(@PATH+11,2,6180.009766,121.577263,369.434753,6000,2,0,100,0), +(@PATH+11,3,6124.930176,70.710854,369.404419,6000,2,0,100,0); + +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+36; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+36; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NEXT+36,@PATH+12,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+12; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+12,1, 6062.076660, 155.683197, 369.868896,0,2,0,100,0), +(@PATH+12,2,6114.930176,74.710854,368.404419,6000,2,0,100,0), +(@PATH+12,3,6187.009766,111.577263,369.434753,6000,2,0,100,0); + +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+37; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+37; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NEXT+37,@PATH+13,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+13; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+13,1, 6076.666016, 163.742477, 369.454651,0,2,0,100,0), +(@PATH+13,2,6117.930176,55.710854,369.404419,6000,2,0,100,0), +(@PATH+13,3,6178.009766,112.577263,369.434753,6000,2,0,100,0); + +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+38; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+38; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NEXT+38,@PATH+14,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+14; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+14,1, 6088.131348, 179.086304, 372.483307,0,2,0,100,0), +(@PATH+14,2,6115.930176,73.710854,369.404419,6000,2,0,100,0), +(@PATH+14,3,6185.009766,119.577263,369.434753,6000,2,0,100,0); + +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+39; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+39; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NEXT+39,@PATH+15,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+15; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+15,1, 6098.503418, 176.307312, 369.942688,0,2,0,100,0), +(@PATH+15,2,6115.930176,51.710854,369.404419,6000,2,0,100,0), +(@PATH+15,3,6185.009766,110.577263,369.434753,6000,2,0,100,0); + +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+40; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+40; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NEXT+40,@PATH+16,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+16; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+16,1, 6090.764160, 155.876968, 368.786255,0,2,0,100,0), +(@PATH+16,2,6112.930176,61.710854,369.404419,6000,2,0,100,0), +(@PATH+16,3,6176.009766,114.577263,370.434753,6000,2,0,100,0); + +-- Slayers from West to both parts +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+26; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+26; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NEXT+26,@PATH+17,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+17; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+17,1, 6200.917969, 220.434753, 372.776184,0,2,0,100,0), +(@PATH+17,2,6346.144531,126.174286,372.081909,6000,2,0,100,0), +(@PATH+17,3,6287.383789,80.591568,372.210876,6000,2,0,100,0); + +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+27; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+27; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NEXT+27,@PATH+19,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+19; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+19,1, 6200.917969, 220.434753, 372.776184,0,2,0,100,0), +(@PATH+19,2,6356.144531,106.174286,372.081909,6000,2,0,100,0), +(@PATH+19,3,6395.383789,70.591568,372.210876,6000,2,0,100,0); + +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+28; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+28; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NEXT+28,@PATH+20,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+20; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+20,1, 6190.595703, 225.242371, 372.554016,0,2,0,100,0), +(@PATH+20,2,6175.009766,125.577263,372.434753,6000,2,0,100,0), +(@PATH+20,3,6104.930176,59.710854,372.404419,6000,2,0,100,0); + +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+29; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+29; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES +(@NEXT+29,@PATH+21,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+21; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+21,1, 6189.209961, 210.502823, 372.877960,0,2,0,100,0), +(@PATH+21,2,6171.009766,119.577263,372.434753,6000,2,0,100,0), +(@PATH+21,3,6118.930176,64.710854,372.404419,6000,2,0,100,0); + +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NEXT+29; +DELETE FROM `creature_addon` WHERE `guid`=@NEXT+29; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES +(@NEXT+29,@PATH+22,1,0, ''); + +DELETE FROM `waypoint_data` WHERE `id`=@PATH+22; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH+22,1, 6176.683594, 213.375336, 372.395172,0,2,0,100,0), +(@PATH+22,2,6173.009766,117.577263,372.434753,6000,2,0,100,0), +(@PATH+22,3,6118.930176,63.710854,372.404419,6000,2,0,100,0); + +-- Turrets +UPDATE `creature_template` SET `faction_A`=2231,`faction_H`=2231,`unit_flags`=16777220,`npcflag`=16777216,`vehicleid`=292 WHERE `entry`=30236; +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=30236; +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type`) VALUES +(30236,57573,1,0); diff --git a/sql/updates/world/2013_08_07_00_world_creature_template.sql b/sql/updates/world/2013_08_07_00_world_creature_template.sql new file mode 100644 index 00000000000..21372e0180b --- /dev/null +++ b/sql/updates/world/2013_08_07_00_world_creature_template.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `faction_A`=35,`faction_H`=35 WHERE `entry`=30236; diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 0c80945e357..04940858062 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -922,7 +922,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u (*itr)->ToPlayer()->KilledMonsterCredit(e.action.killedMonster.creature); TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player %u, Killcredit: %u", (*itr)->GetGUIDLow(), e.action.killedMonster.creature); - } + } else if (IsUnit(*itr)) // Special handling for vehicles if (Vehicle* vehicle = (*itr)->ToUnit()->GetVehicleKit()) for (SeatMap::iterator itr = vehicle->Seats.begin(); itr != vehicle->Seats.end(); ++itr) diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index 4075ffa4de9..a9f178685d9 100644 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -549,10 +549,9 @@ bool AccountMgr::HasPermission(uint32 accountId, uint32 permissionId, uint32 rea return false; } - RBACData* rbac = new RBACData(accountId, "", realmId); - rbac->LoadFromDB(); - bool hasPermission = rbac->HasPermission(permissionId); - delete rbac; + RBACData rbac(accountId, "", realmId); + rbac.LoadFromDB(); + bool hasPermission = rbac.HasPermission(permissionId); TC_LOG_DEBUG(LOG_FILTER_RBAC, "AccountMgr::HasPermission [AccountId: %u, PermissionId: %u, realmId: %d]: %u", accountId, permissionId, realmId, hasPermission); diff --git a/src/server/game/Accounts/RBAC.cpp b/src/server/game/Accounts/RBAC.cpp index bceae019eec..763b1584431 100644 --- a/src/server/game/Accounts/RBAC.cpp +++ b/src/server/game/Accounts/RBAC.cpp @@ -18,6 +18,7 @@ #include "RBAC.h"
#include "AccountMgr.h"
#include "DatabaseEnv.h"
+#include "Log.h"
void RBACRole::GrantPermission(uint32 permissionId)
{
diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index b97ea196a0a..10f00c0a279 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -213,7 +213,7 @@ class RBACData: public RBACObject * }
* @endcode
*/
- bool HasPermission(uint32 permission) { return _globalPerms.test(permission); }
+ bool HasPermission(uint32 permission) const { return _globalPerms.test(permission); }
// Functions enabled to be used by command system
/// Returns all the granted permissions (after computation)
diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 1fd6a5b8f03..f86146520e3 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -19,7 +19,6 @@ #include "AchievementMgr.h" #include "ArenaTeam.h" #include "ArenaTeamMgr.h" -#include "BattlegroundAB.h" #include "Battleground.h" #include "CellImpl.h" #include "Common.h" diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 000107dfa56..c134e47d007 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -551,6 +551,7 @@ inline void Battleground::_ProcessJoin(uint32 diff) WorldPacket status; BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(m_TypeID, GetArenaType()); uint32 queueSlot = player->GetBattlegroundQueueIndex(bgQueueTypeId); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&status, this, player, queueSlot, STATUS_IN_PROGRESS, player->GetBattlegroundQueueJoinTime(m_TypeID), GetElapsedTime(), GetArenaType()); player->GetSession()->SendPacket(&status); @@ -673,20 +674,19 @@ void Battleground::SendPacketToAll(WorldPacket* packet) { for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) if (Player* player = _GetPlayer(itr, "SendPacketToAll")) - player->GetSession()->SendPacket(packet); + player->SendDirectMessage(packet); } void Battleground::SendPacketToTeam(uint32 TeamID, WorldPacket* packet, Player* sender, bool self) { for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) + { if (Player* player = _GetPlayerForTeam(TeamID, itr, "SendPacketToTeam")) + { if (self || sender != player) - { - WorldSession* session = player->GetSession(); - TC_LOG_DEBUG(LOG_FILTER_BATTLEGROUND, "%s %s - SendPacketToTeam %u, Player: %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str(), - session->GetPlayerInfo().c_str(), TeamID, sender ? sender->GetName().c_str() : "null"); - session->SendPacket(packet); - } + player->SendDirectMessage(packet); + } + } } void Battleground::PlaySoundToAll(uint32 SoundID) @@ -703,7 +703,7 @@ void Battleground::PlaySoundToTeam(uint32 SoundID, uint32 TeamID) if (Player* player = _GetPlayerForTeam(TeamID, itr, "PlaySoundToTeam")) { sBattlegroundMgr->BuildPlaySoundPacket(&data, SoundID); - player->GetSession()->SendPacket(&data); + player->SendDirectMessage(&data); } } @@ -728,7 +728,7 @@ void Battleground::YellToAll(Creature* creature, char const* text, uint32 langua { WorldPacket data(SMSG_MESSAGECHAT, 200); creature->BuildMonsterChat(&data, CHAT_MSG_MONSTER_YELL, text, language, creature->GetName(), itr->first); - player->GetSession()->SendPacket(&data); + player->SendDirectMessage(&data); } } @@ -754,11 +754,11 @@ void Battleground::UpdateWorldState(uint32 Field, uint32 Value) SendPacketToAll(&data); } -void Battleground::UpdateWorldStateForPlayer(uint32 Field, uint32 Value, Player* Source) +void Battleground::UpdateWorldStateForPlayer(uint32 field, uint32 value, Player* player) { WorldPacket data; - sBattlegroundMgr->BuildUpdateWorldStatePacket(&data, Field, Value); - Source->GetSession()->SendPacket(&data); + sBattlegroundMgr->BuildUpdateWorldStatePacket(&data, field, value); + player->SendDirectMessage(&data); } void Battleground::EndBattleground(uint32 winner) @@ -970,11 +970,11 @@ void Battleground::EndBattleground(uint32 winner) BlockMovement(player); - player->GetSession()->SendPacket(&pvpLogData); + player->SendDirectMessage(&pvpLogData); WorldPacket data; sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, player->GetBattlegroundQueueJoinTime(GetTypeID()), GetElapsedTime(), GetArenaType()); - player->GetSession()->SendPacket(&data); + player->SendDirectMessage(&data); player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND, 1); } @@ -1079,7 +1079,7 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac { WorldPacket data; sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_NONE, player->GetBattlegroundQueueJoinTime(bgTypeId), 0, 0); - player->GetSession()->SendPacket(&data); + player->SendDirectMessage(&data); } // this call is important, because player, when joins to battleground, this method is not called, so it must be called when leaving bg @@ -1803,8 +1803,7 @@ void Battleground::SendWarningToAll(int32 entry, ...) data << (uint8)0; // added in 4.2.0, unk for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) if (Player* player = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER))) - if (player->GetSession()) - player->GetSession()->SendPacket(&data); + player->SendDirectMessage(&data); } void Battleground::SendMessage2ToAll(int32 entry, ChatMsg type, Player const* source, int32 arg1, int32 arg2) @@ -1936,10 +1935,10 @@ void Battleground::PlayerAddedToBGCheckIfBGIsRunning(Player* player) BlockMovement(player); sBattlegroundMgr->BuildPvpLogDataPacket(&data, this); - player->GetSession()->SendPacket(&data); + player->SendDirectMessage(&data); sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, player->GetBattlegroundQueueJoinTime(GetTypeID()), GetElapsedTime(), GetArenaType()); - player->GetSession()->SendPacket(&data); + player->SendDirectMessage(&data); } uint32 Battleground::GetAlivePlayersCountByTeam(uint32 Team) const @@ -2043,3 +2042,9 @@ void Battleground::HandleAreaTrigger(Player* player, uint32 trigger) TC_LOG_DEBUG(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()); } + +bool Battleground::CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) +{ + TC_LOG_ERROR(LOG_FILTER_BATTLEGROUND, "Battleground::CheckAchievementCriteriaMeet: No implementation for criteria %u", criteriaId); + return false; +} diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index 0a8d5075cc9..37ea3e5d82a 100644 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -29,21 +29,20 @@ class Group; class Player; class WorldPacket; class BattlegroundMap; -class BattlegroundAV; -class BattlegroundWS; -class BattlegroundAB; -class BattlegroundNA; -class BattlegroundBE; -class BattlegroundEY; -class BattlegroundRL; -class BattlegroundSA; -class BattlegroundDS; -class BattlegroundRV; -class BattlegroundIC; struct PvPDifficultyEntry; struct WorldSafeLocsEntry; +enum BattlegroundCriteriaId +{ + BG_CRITERIA_CHECK_RESILIENT_VICTORY, + BG_CRITERIA_CHECK_SAVE_THE_DAY, + BG_CRITERIA_CHECK_EVERYTHING_COUNTS, + BG_CRITERIA_CHECK_AV_PERFECTION, + BG_CRITERIA_CHECK_DEFENSE_OF_THE_ANCIENTS, + BG_CRITERIA_CHECK_NOT_EVEN_A_SCRATCH, +}; + enum BattlegroundSounds { SOUND_HORDE_WINS = 8454, @@ -303,8 +302,9 @@ class Battleground virtual void DestroyGate(Player* /*player*/, GameObject* /*go*/) {} /* achievement req. */ - virtual bool IsAllNodesConrolledByTeam(uint32 /*team*/) const { return false; } + virtual bool IsAllNodesControlledByTeam(uint32 /*team*/) const { return false; } void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry); + virtual bool CheckAchievementCriteriaMeet(uint32 /*criteriaId*/, Player const* /*player*/, Unit const* /*target*/ = NULL, uint32 /*miscvalue1*/ = 0); /* Battleground */ // Get methods: @@ -438,7 +438,7 @@ class Battleground void RewardHonorToTeam(uint32 Honor, uint32 TeamID); void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID); void UpdateWorldState(uint32 Field, uint32 Value); - void UpdateWorldStateForPlayer(uint32 Field, uint32 Value, Player* Source); + void UpdateWorldStateForPlayer(uint32 Field, uint32 Value, Player* player); void EndBattleground(uint32 winner); void BlockMovement(Player* player); @@ -453,7 +453,7 @@ class Battleground Group* GetBgRaid(uint32 TeamID) const { return TeamID == ALLIANCE ? m_BgRaids[TEAM_ALLIANCE] : m_BgRaids[TEAM_HORDE]; } void SetBgRaid(uint32 TeamID, Group* bg_raid); - virtual void UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor = true); + virtual void UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true); static TeamId GetTeamIndexByTeamId(uint32 Team) { return Team == ALLIANCE ? TEAM_ALLIANCE : TEAM_HORDE; } uint32 GetPlayersCountByTeam(uint32 Team) const { return m_PlayersCount[GetTeamIndexByTeamId(Team)]; } @@ -482,7 +482,7 @@ class Battleground // Triggers handle // must be implemented in BG subclass - virtual void HandleAreaTrigger(Player* /*Source*/, uint32 /*Trigger*/); + virtual void HandleAreaTrigger(Player* /*player*/, uint32 /*Trigger*/); // must be implemented in BG subclass if need AND call base class generic code virtual void HandleKillPlayer(Player* player, Player* killer); virtual void HandleKillUnit(Creature* /*unit*/, Player* /*killer*/); @@ -546,43 +546,13 @@ class Battleground virtual uint64 GetFlagPickerGUID(int32 /*team*/ = -1) const { return 0; } virtual void SetDroppedFlagGUID(uint64 /*guid*/, int32 /*team*/ = -1) {} + virtual void HandleQuestComplete(uint32 /*questid*/, Player* /*player*/) {} + virtual bool CanActivateGO(int32 /*entry*/, uint32 /*team*/) const { return true; } + virtual bool IsSpellAllowed(uint32 /*spellId*/, Player const* /*player*/) const { return true; } uint32 GetTeamScore(uint32 TeamID) const; virtual uint32 GetPrematureWinner(); - BattlegroundAV* ToBattlegroundAV() { if (GetTypeID() == BATTLEGROUND_AV) return reinterpret_cast<BattlegroundAV*>(this); else return NULL; } - BattlegroundAV const* ToBattlegroundAV() const { if (GetTypeID() == BATTLEGROUND_AV) return reinterpret_cast<const BattlegroundAV*>(this); else return NULL; } - - BattlegroundWS* ToBattlegroundWS() { if (GetTypeID() == BATTLEGROUND_WS) return reinterpret_cast<BattlegroundWS*>(this); else return NULL; } - BattlegroundWS const* ToBattlegroundWS() const { if (GetTypeID() == BATTLEGROUND_WS) return reinterpret_cast<const BattlegroundWS*>(this); else return NULL; } - - BattlegroundAB* ToBattlegroundAB() { if (GetTypeID() == BATTLEGROUND_AB) return reinterpret_cast<BattlegroundAB*>(this); else return NULL; } - BattlegroundAB const* ToBattlegroundAB() const { if (GetTypeID() == BATTLEGROUND_AB) return reinterpret_cast<const BattlegroundAB*>(this); else return NULL; } - - BattlegroundNA* ToBattlegroundNA() { if (GetTypeID() == BATTLEGROUND_NA) return reinterpret_cast<BattlegroundNA*>(this); else return NULL; } - BattlegroundNA const* ToBattlegroundNA() const { if (GetTypeID() == BATTLEGROUND_NA) return reinterpret_cast<const BattlegroundNA*>(this); else return NULL; } - - BattlegroundBE* ToBattlegroundBE() { if (GetTypeID() == BATTLEGROUND_BE) return reinterpret_cast<BattlegroundBE*>(this); else return NULL; } - BattlegroundBE const* ToBattlegroundBE() const { if (GetTypeID() == BATTLEGROUND_BE) return reinterpret_cast<const BattlegroundBE*>(this); else return NULL; } - - BattlegroundEY* ToBattlegroundEY() { if (GetTypeID() == BATTLEGROUND_EY) return reinterpret_cast<BattlegroundEY*>(this); else return NULL; } - BattlegroundEY const* ToBattlegroundEY() const { if (GetTypeID() == BATTLEGROUND_EY) return reinterpret_cast<const BattlegroundEY*>(this); else return NULL; } - - BattlegroundRL* ToBattlegroundRL() { if (GetTypeID() == BATTLEGROUND_RL) return reinterpret_cast<BattlegroundRL*>(this); else return NULL; } - BattlegroundRL const* ToBattlegroundRL() const { if (GetTypeID() == BATTLEGROUND_RL) return reinterpret_cast<const BattlegroundRL*>(this); else return NULL; } - - BattlegroundSA* ToBattlegroundSA() { if (GetTypeID() == BATTLEGROUND_SA) return reinterpret_cast<BattlegroundSA*>(this); else return NULL; } - BattlegroundSA const* ToBattlegroundSA() const { if (GetTypeID() == BATTLEGROUND_SA) return reinterpret_cast<const BattlegroundSA*>(this); else return NULL; } - - BattlegroundDS* ToBattlegroundDS() { if (GetTypeID() == BATTLEGROUND_DS) return reinterpret_cast<BattlegroundDS*>(this); else return NULL; } - BattlegroundDS const* ToBattlegroundDS() const { if (GetTypeID() == BATTLEGROUND_DS) return reinterpret_cast<const BattlegroundDS*>(this); else return NULL; } - - BattlegroundRV* ToBattlegroundRV() { if (GetTypeID() == BATTLEGROUND_RV) return reinterpret_cast<BattlegroundRV*>(this); else return NULL; } - BattlegroundRV const* ToBattlegroundRV() const { if (GetTypeID() == BATTLEGROUND_RV) return reinterpret_cast<const BattlegroundRV*>(this); else return NULL; } - - BattlegroundIC* ToBattlegroundIC() { if (GetTypeID() == BATTLEGROUND_IC) return reinterpret_cast<BattlegroundIC*>(this); else return NULL; } - BattlegroundIC const* ToBattlegroundIC() const { if (GetTypeID() == BATTLEGROUND_IC) return reinterpret_cast<const BattlegroundIC*>(this); else return NULL; } - protected: // this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends Battleground void EndNow(); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index 2114fc4ef66..da292d050e9 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -111,23 +111,28 @@ void BattlegroundAB::PostUpdateImpl(uint32 diff) int points = team_points[team]; if (!points) continue; + m_lastTick[team] += diff; + if (m_lastTick[team] > BG_AB_TickIntervals[points]) { m_lastTick[team] -= BG_AB_TickIntervals[points]; m_TeamScores[team] += BG_AB_TickPoints[points]; m_HonorScoreTics[team] += BG_AB_TickPoints[points]; m_ReputationScoreTics[team] += BG_AB_TickPoints[points]; + if (m_ReputationScoreTics[team] >= m_ReputationTics) { (team == TEAM_ALLIANCE) ? RewardReputationToTeam(509, 10, ALLIANCE) : RewardReputationToTeam(510, 10, HORDE); m_ReputationScoreTics[team] -= m_ReputationTics; } + if (m_HonorScoreTics[team] >= m_HonorTics) { RewardHonorToTeam(GetBonusHonorFromKill(1), (team == TEAM_ALLIANCE) ? ALLIANCE : HORDE); m_HonorScoreTics[team] -= m_HonorTics; } + if (!m_IsInformedNearVictory && m_TeamScores[team] > BG_AB_WARNING_NEAR_VICTORY_SCORE) { if (team == TEAM_ALLIANCE) @@ -140,9 +145,10 @@ void BattlegroundAB::PostUpdateImpl(uint32 diff) if (m_TeamScores[team] > BG_AB_MAX_TEAM_SCORE) m_TeamScores[team] = BG_AB_MAX_TEAM_SCORE; + if (team == TEAM_ALLIANCE) UpdateWorldState(BG_AB_OP_RESOURCES_ALLY, m_TeamScores[team]); - if (team == TEAM_HORDE) + else if (team == TEAM_HORDE) UpdateWorldState(BG_AB_OP_RESOURCES_HORDE, m_TeamScores[team]); // update achievement flags // we increased m_TeamScores[team] so we just need to check if it is 500 more than other teams resources @@ -155,7 +161,7 @@ void BattlegroundAB::PostUpdateImpl(uint32 diff) // Test win condition if (m_TeamScores[TEAM_ALLIANCE] >= BG_AB_MAX_TEAM_SCORE) EndBattleground(ALLIANCE); - if (m_TeamScores[TEAM_HORDE] >= BG_AB_MAX_TEAM_SCORE) + else if (m_TeamScores[TEAM_HORDE] >= BG_AB_MAX_TEAM_SCORE) EndBattleground(HORDE); } } @@ -397,8 +403,7 @@ void BattlegroundAB::_NodeDeOccupied(uint8 node) RelocateDeadPlayers(BgCreatures[node]); - if (BgCreatures[node]) - DelCreature(node); + DelCreature(node); // buff object isn't despawned } @@ -696,7 +701,7 @@ void BattlegroundAB::UpdatePlayerScore(Player* Source, uint32 type, uint32 value } } -bool BattlegroundAB::IsAllNodesConrolledByTeam(uint32 team) const +bool BattlegroundAB::IsAllNodesControlledByTeam(uint32 team) const { uint32 count = 0; for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i) @@ -706,3 +711,14 @@ bool BattlegroundAB::IsAllNodesConrolledByTeam(uint32 team) const return count == BG_AB_DYNAMIC_NODES_COUNT; } + +bool BattlegroundAB::CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* player, Unit const* target, uint32 miscvalue) +{ + switch (criteriaId) + { + case BG_CRITERIA_CHECK_RESILIENT_VICTORY: + return m_TeamScores500Disadvantage[GetTeamIndexByTeamId(player->GetTeam())]; + } + + return Battleground::CheckAchievementCriteriaMeet(criteriaId, player, target, miscvalue); +} diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h index 3467cf56ba6..81a2e899634 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h @@ -270,8 +270,8 @@ class BattlegroundAB : public Battleground void EventPlayerClickedOnFlag(Player* source, GameObject* target_obj); /* achievement req. */ - bool IsAllNodesConrolledByTeam(uint32 team) const; // overwrited - bool IsTeamScores500Disadvantage(uint32 team) const { return m_TeamScores500Disadvantage[GetTeamIndexByTeamId(team)]; } + bool IsAllNodesControlledByTeam(uint32 team) const; + bool CheckAchievementCriteriaMeet(uint32 /*criteriaId*/, Player const* /*player*/, Unit const* /*target*/ = NULL, uint32 /*miscvalue1*/ = 0); uint32 GetPrematureWinner(); private: diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index a72b1eb4eb1..3be95a86ca8 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -445,7 +445,7 @@ void BattlegroundAV::StartingEventOpenDoors() DoorOpen(BG_AV_OBJECT_DOOR_A); // Achievement: The Alterac Blitz - StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, AV_EVENT_START_BATTLE); + StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, BG_AV_EVENT_START_BATTLE); } void BattlegroundAV::AddPlayer(Player* player) @@ -733,7 +733,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial) return; } -bool BattlegroundAV::PlayerCanDoMineQuest(int32 GOId, uint32 team) +bool BattlegroundAV::CanActivateGO(int32 GOId, uint32 team) const { if (GOId == BG_AV_OBJECTID_MINE_N) return (m_Mine_Owner[AV_NORTH_MINE] == team); @@ -1621,63 +1621,67 @@ void BattlegroundAV::ResetBGSubclass() DelCreature(i); } -bool BattlegroundAV::IsBothMinesControlledByTeam(uint32 team) const +bool BattlegroundAV::CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* source, Unit const* target, uint32 miscValue) { - for (uint8 mine = 0; mine < 2; mine++) - if (m_Mine_Owner[mine] != team) - return false; - - return true; -} - -bool BattlegroundAV::IsAllTowersControlledAndCaptainAlive(uint32 team) const -{ - if (team == ALLIANCE) + uint8 team = source->GetTeam(); + switch (criteriaId) { - for (BG_AV_Nodes i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_STONEHEART_BUNKER; ++i) // alliance towers controlled - { - if (m_Nodes[i].State == POINT_CONTROLED) - { - if (m_Nodes[i].Owner != ALLIANCE) + case BG_CRITERIA_CHECK_EVERYTHING_COUNTS: + for (uint8 mine = 0; mine < 2; mine++) + if (m_Mine_Owner[mine] != team) return false; - } - else - return false; - } - - for (BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_TOWER; i <= BG_AV_NODES_FROSTWOLF_WTOWER; ++i) // horde towers destroyed - if (m_Nodes[i].State != POINT_DESTROYED) - return false; - if (!m_CaptainAlive[0]) - return false; - - return true; - } - else if (team == HORDE) - { - for (BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_TOWER; i <= BG_AV_NODES_FROSTWOLF_WTOWER; ++i) // horde towers controlled + return true; + case BG_CRITERIA_CHECK_AV_PERFECTION: { - if (m_Nodes[i].State == POINT_CONTROLED) + if (team == ALLIANCE) { - if (m_Nodes[i].Owner != HORDE) + for (BG_AV_Nodes i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_STONEHEART_BUNKER; ++i) // alliance towers controlled + { + if (m_Nodes[i].State == POINT_CONTROLED) + { + if (m_Nodes[i].Owner != ALLIANCE) + return false; + } + else + return false; + } + + for (BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_TOWER; i <= BG_AV_NODES_FROSTWOLF_WTOWER; ++i) // horde towers destroyed + if (m_Nodes[i].State != POINT_DESTROYED) + return false; + + if (!m_CaptainAlive[0]) return false; + + return true; } - else - return false; - } + else if (team == HORDE) + { + for (BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_TOWER; i <= BG_AV_NODES_FROSTWOLF_WTOWER; ++i) // horde towers controlled + { + if (m_Nodes[i].State == POINT_CONTROLED) + { + if (m_Nodes[i].Owner != HORDE) + return false; + } + else + return false; + } - for (BG_AV_Nodes i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_STONEHEART_BUNKER; ++i) // alliance towers destroyed - if (m_Nodes[i].State != POINT_DESTROYED) - return false; + for (BG_AV_Nodes i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_STONEHEART_BUNKER; ++i) // alliance towers destroyed + if (m_Nodes[i].State != POINT_DESTROYED) + return false; - if (!m_CaptainAlive[1]) - return false; + if (!m_CaptainAlive[1]) + return false; - return true; + return true; + } + } } - return false; + return Battleground::CheckAchievementCriteriaMeet(criteriaId, source, target, miscValue); } uint32 BattlegroundAV::GetPrematureWinner() diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h index bbe3b064c35..439fc656925 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h @@ -50,7 +50,7 @@ #define BG_AV_KILL_SURVIVING_CAPTAIN 2 #define BG_AV_REP_SURVIVING_CAPTAIN 125 -#define AV_EVENT_START_BATTLE 9166 // Achievement: The Alterac Blitz +#define BG_AV_EVENT_START_BATTLE 9166 // Achievement: The Alterac Blitz enum BG_AV_Sounds { /// @todo: get out if there comes a sound when neutral team captures mine @@ -1527,7 +1527,8 @@ inline BG_AV_Nodes &operator++(BG_AV_Nodes &i){ return i = BG_AV_Nodes(i + 1); } struct BattlegroundAVScore : public BattlegroundScore { - BattlegroundAVScore() : GraveyardsAssaulted(0), GraveyardsDefended(0), TowersAssaulted(0), TowersDefended(0), MinesCaptured(0), LeadersKilled(0), SecondaryObjectives(0) { } + BattlegroundAVScore() : GraveyardsAssaulted(0), GraveyardsDefended(0), TowersAssaulted(0), + TowersDefended(0), MinesCaptured(0), LeadersKilled(0), SecondaryObjectives(0) { } ~BattlegroundAVScore() { } uint32 GraveyardsAssaulted; uint32 GraveyardsDefended; @@ -1550,28 +1551,27 @@ class BattlegroundAV : public Battleground void StartingEventOpenDoors(); void RemovePlayer(Player* player, uint64 guid, uint32 team); - void HandleAreaTrigger(Player* Source, uint32 Trigger); + void HandleAreaTrigger(Player* player, uint32 trigger); bool SetupBattleground(); void ResetBGSubclass(); /*general stuff*/ void UpdateScore(uint16 team, int16 points); - void UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor = true); + void UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true); /*handlestuff*/ //these are functions which get called from extern void EventPlayerClickedOnFlag(Player* source, GameObject* target_obj); void HandleKillPlayer(Player* player, Player* killer); void HandleKillUnit(Creature* unit, Player* killer); void HandleQuestComplete(uint32 questid, Player* player); - bool PlayerCanDoMineQuest(int32 GOId, uint32 team); + bool CanActivateGO(int32 GOId, uint32 team) const; void EndBattleground(uint32 winner); WorldSafeLocsEntry const* GetClosestGraveYard(Player* player); - /* achievement req. */ - bool IsBothMinesControlledByTeam(uint32 team) const; - bool IsAllTowersControlledAndCaptainAlive(uint32 team) const; + // Achievement: Av perfection and Everything counts + bool CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* source, Unit const* target = NULL, uint32 miscvalue1 = 0); uint32 GetPrematureWinner(); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp index 41b372bfee8..b49ae97493c 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp @@ -142,12 +142,10 @@ bool BattlegroundBE::SetupBattleground() void BattlegroundBE::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor) { - BattlegroundScoreMap::iterator itr = PlayerScores.find(Source->GetGUID()); if (itr == PlayerScores.end()) // player not found... return; //there is nothing special in this score Battleground::UpdatePlayerScore(Source, type, value, doAddHonor); - } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp index fac4c08d70d..83965884029 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp @@ -33,7 +33,6 @@ BattlegroundDS::BattlegroundDS() StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S; StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S; StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE; - //we must set messageIds StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE; StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS; StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp index c87fd3db8ca..95808065d62 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -122,7 +122,7 @@ void BattlegroundEY::StartingEventOpenDoors() } // Achievement: Flurry - StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EY_EVENT_START_BATTLE); + StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, BG_EY_EVENT_START_BATTLE); } void BattlegroundEY::AddPoints(uint32 Team, uint32 Points) @@ -591,16 +591,16 @@ void BattlegroundEY::HandleKillPlayer(Player* player, Player* killer) EventPlayerDroppedFlag(player); } -void BattlegroundEY::EventPlayerDroppedFlag(Player* Source) +void BattlegroundEY::EventPlayerDroppedFlag(Player* player) { if (GetStatus() != STATUS_IN_PROGRESS) { // if not running, do not cast things at the dropper player, neither send unnecessary messages // just take off the aura - if (IsFlagPickedup() && GetFlagPickerGUID() == Source->GetGUID()) + if (IsFlagPickedup() && GetFlagPickerGUID() == player->GetGUID()) { SetFlagPicker(0); - Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL); + player->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL); } return; } @@ -608,31 +608,31 @@ void BattlegroundEY::EventPlayerDroppedFlag(Player* Source) if (!IsFlagPickedup()) return; - if (GetFlagPickerGUID() != Source->GetGUID()) + if (GetFlagPickerGUID() != player->GetGUID()) return; SetFlagPicker(0); - Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL); + player->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL); m_FlagState = BG_EY_FLAG_STATE_ON_GROUND; m_FlagsTimer = BG_EY_FLAG_RESPAWN_TIME; - Source->CastSpell(Source, SPELL_RECENTLY_DROPPED_FLAG, true); - Source->CastSpell(Source, BG_EY_PLAYER_DROPPED_FLAG_SPELL, true); + player->CastSpell(player, SPELL_RECENTLY_DROPPED_FLAG, true); + player->CastSpell(player, BG_EY_PLAYER_DROPPED_FLAG_SPELL, true); //this does not work correctly :((it should remove flag carrier name) UpdateWorldState(NETHERSTORM_FLAG_STATE_HORDE, BG_EY_FLAG_STATE_WAIT_RESPAWN); UpdateWorldState(NETHERSTORM_FLAG_STATE_ALLIANCE, BG_EY_FLAG_STATE_WAIT_RESPAWN); - if (Source->GetTeam() == ALLIANCE) + if (player->GetTeam() == ALLIANCE) SendMessageToAll(LANG_BG_EY_DROPPED_FLAG, CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL); else SendMessageToAll(LANG_BG_EY_DROPPED_FLAG, CHAT_MSG_BG_SYSTEM_HORDE, NULL); } -void BattlegroundEY::EventPlayerClickedOnFlag(Player* Source, GameObject* target_obj) +void BattlegroundEY::EventPlayerClickedOnFlag(Player* player, GameObject* target_obj) { - if (GetStatus() != STATUS_IN_PROGRESS || IsFlagPickedup() || !Source->IsWithinDistInMap(target_obj, 10)) + if (GetStatus() != STATUS_IN_PROGRESS || IsFlagPickedup() || !player->IsWithinDistInMap(target_obj, 10)) return; - if (Source->GetTeam() == ALLIANCE) + if (player->GetTeam() == ALLIANCE) { UpdateWorldState(NETHERSTORM_FLAG_STATE_ALLIANCE, BG_EY_FLAG_STATE_ON_PLAYER); PlaySoundToAll(BG_EY_SOUND_FLAG_PICKED_UP_ALLIANCE); @@ -648,18 +648,18 @@ void BattlegroundEY::EventPlayerClickedOnFlag(Player* Source, GameObject* target m_FlagState = BG_EY_FLAG_STATE_ON_PLAYER; SpawnBGObject(BG_EY_OBJECT_FLAG_NETHERSTORM, RESPAWN_ONE_DAY); - SetFlagPicker(Source->GetGUID()); + SetFlagPicker(player->GetGUID()); //get flag aura on player - Source->CastSpell(Source, BG_EY_NETHERSTORM_FLAG_SPELL, true); - Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT); + player->CastSpell(player, BG_EY_NETHERSTORM_FLAG_SPELL, true); + player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT); - if (Source->GetTeam() == ALLIANCE) - PSendMessageToAll(LANG_BG_EY_HAS_TAKEN_FLAG, CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL, Source->GetName().c_str()); + if (player->GetTeam() == ALLIANCE) + PSendMessageToAll(LANG_BG_EY_HAS_TAKEN_FLAG, CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL, player->GetName().c_str()); else - PSendMessageToAll(LANG_BG_EY_HAS_TAKEN_FLAG, CHAT_MSG_BG_SYSTEM_HORDE, NULL, Source->GetName().c_str()); + PSendMessageToAll(LANG_BG_EY_HAS_TAKEN_FLAG, CHAT_MSG_BG_SYSTEM_HORDE, NULL, player->GetName().c_str()); } -void BattlegroundEY::EventTeamLostPoint(Player* Source, uint32 Point) +void BattlegroundEY::EventTeamLostPoint(Player* player, uint32 Point) { if (GetStatus() != STATUS_IN_PROGRESS) return; @@ -695,9 +695,9 @@ void BattlegroundEY::EventTeamLostPoint(Player* Source, uint32 Point) m_PointState[Point] = EY_POINT_NO_OWNER; if (Team == ALLIANCE) - SendMessageToAll(m_LosingPointTypes[Point].MessageIdAlliance, CHAT_MSG_BG_SYSTEM_ALLIANCE, Source); + SendMessageToAll(m_LosingPointTypes[Point].MessageIdAlliance, CHAT_MSG_BG_SYSTEM_ALLIANCE, player); else - SendMessageToAll(m_LosingPointTypes[Point].MessageIdHorde, CHAT_MSG_BG_SYSTEM_HORDE, Source); + SendMessageToAll(m_LosingPointTypes[Point].MessageIdHorde, CHAT_MSG_BG_SYSTEM_HORDE, player); UpdatePointsIcons(Team, Point); UpdatePointsCount(Team); @@ -707,12 +707,12 @@ void BattlegroundEY::EventTeamLostPoint(Player* Source, uint32 Point) DelCreature(Point + 6);//NULL checks are in DelCreature! 0-5 spirit guides } -void BattlegroundEY::EventTeamCapturedPoint(Player* Source, uint32 Point) +void BattlegroundEY::EventTeamCapturedPoint(Player* player, uint32 Point) { if (GetStatus() != STATUS_IN_PROGRESS) return; - uint32 Team = Source->GetTeam(); + uint32 Team = player->GetTeam(); SpawnBGObject(m_CapturingPointTypes[Point].DespawnNeutralObjectType, RESPAWN_ONE_DAY); SpawnBGObject(m_CapturingPointTypes[Point].DespawnNeutralObjectType + 1, RESPAWN_ONE_DAY); @@ -739,9 +739,9 @@ void BattlegroundEY::EventTeamCapturedPoint(Player* Source, uint32 Point) m_PointState[Point] = EY_POINT_UNDER_CONTROL; if (Team == ALLIANCE) - SendMessageToAll(m_CapturingPointTypes[Point].MessageIdAlliance, CHAT_MSG_BG_SYSTEM_ALLIANCE, Source); + SendMessageToAll(m_CapturingPointTypes[Point].MessageIdAlliance, CHAT_MSG_BG_SYSTEM_ALLIANCE, player); else - SendMessageToAll(m_CapturingPointTypes[Point].MessageIdHorde, CHAT_MSG_BG_SYSTEM_HORDE, Source); + SendMessageToAll(m_CapturingPointTypes[Point].MessageIdHorde, CHAT_MSG_BG_SYSTEM_HORDE, player); if (BgCreatures[Point]) DelCreature(Point); @@ -774,18 +774,18 @@ void BattlegroundEY::EventTeamCapturedPoint(Player* Source, uint32 Point) } } -void BattlegroundEY::EventPlayerCapturedFlag(Player* Source, uint32 BgObjectType) +void BattlegroundEY::EventPlayerCapturedFlag(Player* player, uint32 BgObjectType) { - if (GetStatus() != STATUS_IN_PROGRESS || GetFlagPickerGUID() != Source->GetGUID()) + if (GetStatus() != STATUS_IN_PROGRESS || GetFlagPickerGUID() != player->GetGUID()) return; SetFlagPicker(0); m_FlagState = BG_EY_FLAG_STATE_WAIT_RESPAWN; - Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL); + player->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL); - Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT); + player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT); - if (Source->GetTeam() == ALLIANCE) + if (player->GetTeam() == ALLIANCE) PlaySoundToAll(BG_EY_SOUND_FLAG_CAPTURED_ALLIANCE); else PlaySoundToAll(BG_EY_SOUND_FLAG_CAPTURED_HORDE); @@ -796,26 +796,26 @@ void BattlegroundEY::EventPlayerCapturedFlag(Player* Source, uint32 BgObjectType m_FlagCapturedBgObjectType = BgObjectType; uint8 team_id = 0; - if (Source->GetTeam() == ALLIANCE) + if (player->GetTeam() == ALLIANCE) { team_id = TEAM_ALLIANCE; - SendMessageToAll(LANG_BG_EY_CAPTURED_FLAG_A, CHAT_MSG_BG_SYSTEM_ALLIANCE, Source); + SendMessageToAll(LANG_BG_EY_CAPTURED_FLAG_A, CHAT_MSG_BG_SYSTEM_ALLIANCE, player); } else { team_id = TEAM_HORDE; - SendMessageToAll(LANG_BG_EY_CAPTURED_FLAG_H, CHAT_MSG_BG_SYSTEM_HORDE, Source); + SendMessageToAll(LANG_BG_EY_CAPTURED_FLAG_H, CHAT_MSG_BG_SYSTEM_HORDE, player); } if (m_TeamPointsCount[team_id] > 0) - AddPoints(Source->GetTeam(), BG_EY_FlagPoints[m_TeamPointsCount[team_id] - 1]); + AddPoints(player->GetTeam(), BG_EY_FlagPoints[m_TeamPointsCount[team_id] - 1]); - UpdatePlayerScore(Source, SCORE_FLAG_CAPTURES, 1); + UpdatePlayerScore(player, SCORE_FLAG_CAPTURES, 1); } -void BattlegroundEY::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor) +void BattlegroundEY::UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor) { - BattlegroundScoreMap::iterator itr = PlayerScores.find(Source->GetGUID()); + BattlegroundScoreMap::iterator itr = PlayerScores.find(player->GetGUID()); if (itr == PlayerScores.end()) // player not found return; @@ -823,10 +823,10 @@ void BattlegroundEY::UpdatePlayerScore(Player* Source, uint32 type, uint32 value { case SCORE_FLAG_CAPTURES: // flags captured ((BattlegroundEYScore*)itr->second)->FlagCaptures += value; - Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, EY_OBJECTIVE_CAPTURE_FLAG); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, EY_OBJECTIVE_CAPTURE_FLAG); break; default: - Battleground::UpdatePlayerScore(Source, type, value, doAddHonor); + Battleground::UpdatePlayerScore(player, type, value, doAddHonor); break; } } @@ -934,7 +934,7 @@ WorldSafeLocsEntry const* BattlegroundEY::GetClosestGraveYard(Player* player) return nearestEntry; } -bool BattlegroundEY::IsAllNodesConrolledByTeam(uint32 team) const +bool BattlegroundEY::IsAllNodesControlledByTeam(uint32 team) const { uint32 count = 0; for (int i = 0; i < EY_POINTS_MAX; ++i) @@ -952,4 +952,4 @@ uint32 BattlegroundEY::GetPrematureWinner() return HORDE; return Battleground::GetPrematureWinner(); -}
\ No newline at end of file +} diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h index 72c6a42b5db..f03b458e7ff 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h @@ -24,6 +24,7 @@ enum BG_EY_Misc { + BG_EY_EVENT_START_BATTLE = 13180, // Achievement: Flurry BG_EY_FLAG_RESPAWN_TIME = (8*IN_MILLISECONDS), BG_EY_FPOINTS_TICK_TIME = (2*IN_MILLISECONDS) }; @@ -219,8 +220,6 @@ enum EYBattlegroundObjectTypes #define BG_EY_NotEYWeekendHonorTicks 260 #define BG_EY_EYWeekendHonorTicks 160 -#define EY_EVENT_START_BATTLE 13180 // Achievement: Flurry - enum BG_EY_Score { BG_EY_WARNING_NEAR_VICTORY_SCORE = 1400, @@ -368,7 +367,7 @@ class BattlegroundEY : public Battleground void EventPlayerDroppedFlag(Player* Source); /* achievement req. */ - bool IsAllNodesConrolledByTeam(uint32 team) const; + bool IsAllNodesControlledByTeam(uint32 team) const; uint32 GetPrematureWinner(); private: diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index 7e0034eca6e..56e2c413228 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -84,7 +84,7 @@ void BattlegroundIC::SendTransportInit(Player* player) WorldPacket packet; transData.BuildPacket(&packet); - player->GetSession()->SendPacket(&packet); + player->SendDirectMessage(&packet); } void BattlegroundIC::DoAction(uint32 action, uint64 var) @@ -290,19 +290,6 @@ void BattlegroundIC::StartingEventOpenDoors() } } -bool BattlegroundIC::IsAllNodesConrolledByTeam(uint32 team) const -{ - uint32 count = 0; - ICNodeState controlledState = team == ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H; - for (int i = 0; i < NODE_TYPE_WORKSHOP; ++i) - { - if (nodePoint[i].nodeState == controlledState) - ++count; - } - - return count == NODE_TYPE_WORKSHOP; -} - void BattlegroundIC::AddPlayer(Player* player) { Battleground::AddPlayer(player); @@ -335,23 +322,23 @@ void BattlegroundIC::HandleAreaTrigger(Player* player, uint32 trigger) /// @hack: this spell should be cast by npc 22515 (World Trigger) and not by the player if (trigger == 5555 && player->GetTeamId() == TEAM_HORDE) { - if (GateStatus[BG_IC_A_FRONT] != BG_IC_GATE_DESTROYED - && GateStatus[BG_IC_A_WEST] != BG_IC_GATE_DESTROYED + if (GateStatus[BG_IC_A_FRONT] != BG_IC_GATE_DESTROYED + && GateStatus[BG_IC_A_WEST] != BG_IC_GATE_DESTROYED && GateStatus[BG_IC_A_EAST] != BG_IC_GATE_DESTROYED) player->CastSpell(player, SPELL_BACK_DOOR_JOB_ACHIEVEMENT, true); } else if (trigger == 5535 && player->GetTeamId() == TEAM_ALLIANCE) { - if (GateStatus[BG_IC_H_FRONT] != BG_IC_GATE_DESTROYED - && GateStatus[BG_IC_H_WEST] != BG_IC_GATE_DESTROYED + if (GateStatus[BG_IC_H_FRONT] != BG_IC_GATE_DESTROYED + && GateStatus[BG_IC_H_WEST] != BG_IC_GATE_DESTROYED && GateStatus[BG_IC_H_EAST] != BG_IC_GATE_DESTROYED) player->CastSpell(player, SPELL_BACK_DOOR_JOB_ACHIEVEMENT, true); } } -void BattlegroundIC::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor) +void BattlegroundIC::UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor) { - std::map<uint64, BattlegroundScore*>::iterator itr = PlayerScores.find(Source->GetGUID()); + std::map<uint64, BattlegroundScore*>::iterator itr = PlayerScores.find(player->GetGUID()); if (itr == PlayerScores.end()) // player not found... return; @@ -365,7 +352,7 @@ void BattlegroundIC::UpdatePlayerScore(Player* Source, uint32 type, uint32 value ((BattlegroundICScore*)itr->second)->BasesDefended += value; break; default: - Battleground::UpdatePlayerScore(Source, type, value, doAddHonor); + Battleground::UpdatePlayerScore(player, type, value, doAddHonor); break; } } @@ -888,8 +875,8 @@ WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveYard(Player* player) // If so, select the closest node to place ghost on if (!nodes.empty()) { - float plr_x = player->GetPositionX(); - float plr_y = player->GetPositionY(); + float player_x = player->GetPositionX(); + float player_y = player->GetPositionY(); float mindist = 999999.0f; for (uint8 i = 0; i < nodes.size(); ++i) @@ -897,7 +884,7 @@ WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveYard(Player* player) WorldSafeLocsEntry const*entry = sWorldSafeLocsStore.LookupEntry(BG_IC_GraveyardIds[nodes[i]]); if (!entry) continue; - float dist = (entry->x - plr_x)*(entry->x - plr_x)+(entry->y - plr_y)*(entry->y - plr_y); + float dist = (entry->x - player_x)*(entry->x - player_x)+(entry->y - player_y)*(entry->y - player_y); if (mindist > dist) { mindist = dist; @@ -958,3 +945,35 @@ Transport* BattlegroundIC::CreateTransport(uint32 goEntry, uint32 period) return t; } + +bool BattlegroundIC::IsAllNodesControlledByTeam(uint32 team) const +{ + uint32 count = 0; + ICNodeState controlledState = team == ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H; + for (int i = 0; i < NODE_TYPE_WORKSHOP; ++i) + { + if (nodePoint[i].nodeState == controlledState) + ++count; + } + + return count == NODE_TYPE_WORKSHOP; +} + +bool BattlegroundIC::IsSpellAllowed(uint32 spellId, Player const* player) const +{ + switch (spellId) + { + case SPELL_OIL_REFINERY: + case SPELL_QUARRY: + { + uint32 team = player->GetTeamId(); + uint8 nodeType = spellId = SPELL_OIL_REFINERY ? NODE_TYPE_REFINERY : NODE_TYPE_QUARRY; + uint8 nodeState = team == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H; + return GetNodeState(nodeType) == nodeState; + } + default: + break; + } + + return true; +} diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h index e8249dc777a..34d03a5d92c 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h @@ -868,7 +868,7 @@ class BattlegroundIC : public Battleground void PostUpdateImpl(uint32 diff); void RemovePlayer(Player* player, uint64 guid, uint32 team); - void HandleAreaTrigger(Player* Source, uint32 Trigger); + void HandleAreaTrigger(Player* player, uint32 trigger); bool SetupBattleground(); void SpawnLeader(uint32 teamid); void HandleKillUnit(Creature* unit, Player* killer); @@ -882,7 +882,7 @@ class BattlegroundIC : public Battleground WorldSafeLocsEntry const* GetClosestGraveYard(Player* player); /* Scorekeeping */ - void UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor = true); + void UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true); void FillInitialWorldStates(WorldPacket& data); @@ -892,7 +892,9 @@ class BattlegroundIC : public Battleground uint32 GetNodeState(uint8 nodeType) const { return (uint8)nodePoint[nodeType].nodeState; } - bool IsAllNodesConrolledByTeam(uint32 team) const; // overwrited + bool IsAllNodesControlledByTeam(uint32 team) const; + + bool IsSpellAllowed(uint32 spellId, Player const* player) const; private: uint32 closeFortressDoorsTimer; bool doorsClosed; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index 24c989d76dd..60430238690 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -56,8 +56,8 @@ void BattlegroundSA::Reset() GateStatus[i] = BG_SA_GATE_OK; ShipsStarted = false; gateDestroyed = false; - _notEvenAScratch[TEAM_ALLIANCE] = true; - _notEvenAScratch[TEAM_HORDE] = true; + _allVehiclesAlive[TEAM_ALLIANCE] = true; + _allVehiclesAlive[TEAM_HORDE] = true; Status = BG_SA_WARMUP; } @@ -274,7 +274,7 @@ void BattlegroundSA::StartShips() WorldPacket pkt; GetBGObject(i)->BuildValuesUpdateBlockForPlayer(&data, p); data.BuildPacket(&pkt); - p->GetSession()->SendPacket(&pkt); + p->SendDirectMessage(&pkt); } } } @@ -566,7 +566,7 @@ void BattlegroundSA::HandleKillUnit(Creature* creature, Player* killer) if (creature->GetEntry() == NPC_DEMOLISHER_SA) { UpdatePlayerScore(killer, SCORE_DESTROYED_DEMOLISHER, 1); - _notEvenAScratch[Attackers] = false; + _allVehiclesAlive[Attackers] = false; } } @@ -948,7 +948,7 @@ void BattlegroundSA::SendTransportInit(Player* player) GetBGObject(BG_SA_BOAT_TWO)->BuildCreateUpdateBlockForPlayer(&transData, player); WorldPacket packet; transData.BuildPacket(&packet); - player->GetSession()->SendPacket(&packet); + player->SendDirectMessage(&packet); } } @@ -963,6 +963,20 @@ void BattlegroundSA::SendTransportsRemove(Player* player) GetBGObject(BG_SA_BOAT_TWO)->BuildOutOfRangeUpdateBlock(&transData); WorldPacket packet; transData.BuildPacket(&packet); - player->GetSession()->SendPacket(&packet); + player->SendDirectMessage(&packet); } } + +bool BattlegroundSA::CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* source, Unit const* target, uint32 miscValue) +{ + switch (criteriaId) + { + case BG_CRITERIA_CHECK_NOT_EVEN_A_SCRATCH: + return _allVehiclesAlive[GetTeamIndexByTeamId(source->GetTeam())]; + case BG_CRITERIA_CHECK_DEFENSE_OF_THE_ANCIENTS: + if (source->GetTeamId() != Attackers && !gateDestroyed) + return true; + } + + return Battleground::CheckAchievementCriteriaMeet(criteriaId, source, target, miscValue); +} diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h index aa3106d237f..c50721c4591 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h @@ -543,7 +543,7 @@ class BattlegroundSA : public Battleground bool gateDestroyed; // Achievement: Not Even a Scratch - bool notEvenAScratch(uint32 team) const { return _notEvenAScratch[GetTeamIndexByTeamId(team)]; } + bool CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* source, Unit const* target = NULL, uint32 miscvalue1 = 0); /// Id of attacker team TeamId Attackers; @@ -627,6 +627,6 @@ class BattlegroundSA : public Battleground std::map<uint32/*id*/, uint32/*timer*/> DemoliserRespawnList; // Achievement: Not Even a Scratch - bool _notEvenAScratch[BG_TEAMS_COUNT]; + bool _allVehiclesAlive[BG_TEAMS_COUNT]; }; #endif diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index c35b39719fc..bdbd2873131 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -274,15 +274,15 @@ void BattlegroundWS::RespawnFlagAfterDrop(uint32 team) _bothFlagsKept = false; } -void BattlegroundWS::EventPlayerCapturedFlag(Player* Source) +void BattlegroundWS::EventPlayerCapturedFlag(Player* player) { if (GetStatus() != STATUS_IN_PROGRESS) return; uint32 winner = 0; - Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT); - if (Source->GetTeam() == ALLIANCE) + player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT); + if (player->GetTeam() == ALLIANCE) { if (!IsHordeFlagPickedup()) return; @@ -290,11 +290,12 @@ void BattlegroundWS::EventPlayerCapturedFlag(Player* Source) // horde flag in base (but not respawned yet) _flagState[TEAM_HORDE] = BG_WS_FLAG_STATE_WAIT_RESPAWN; // Drop Horde Flag from Player - Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG); + player->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG); if (_flagDebuffState == 1) - Source->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); - if (_flagDebuffState == 2) - Source->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT); + player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); + else if (_flagDebuffState == 2) + player->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT); + if (GetTeamScore(TEAM_ALLIANCE) < BG_WS_MAX_TEAM_SCORE) AddPoint(ALLIANCE, 1); PlaySoundToAll(BG_WS_SOUND_FLAG_CAPTURED_ALLIANCE); @@ -308,34 +309,35 @@ void BattlegroundWS::EventPlayerCapturedFlag(Player* Source) // alliance flag in base (but not respawned yet) _flagState[TEAM_ALLIANCE] = BG_WS_FLAG_STATE_WAIT_RESPAWN; // Drop Alliance Flag from Player - Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG); + player->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG); if (_flagDebuffState == 1) - Source->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); - if (_flagDebuffState == 2) - Source->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT); + player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); + else if (_flagDebuffState == 2) + player->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT); + if (GetTeamScore(TEAM_HORDE) < BG_WS_MAX_TEAM_SCORE) AddPoint(HORDE, 1); PlaySoundToAll(BG_WS_SOUND_FLAG_CAPTURED_HORDE); RewardReputationToTeam(889, m_ReputationCapture, HORDE); } //for flag capture is reward 2 honorable kills - RewardHonorToTeam(GetBonusHonorFromKill(2), Source->GetTeam()); + RewardHonorToTeam(GetBonusHonorFromKill(2), player->GetTeam()); SpawnBGObject(BG_WS_OBJECT_H_FLAG, BG_WS_FLAG_RESPAWN_TIME); SpawnBGObject(BG_WS_OBJECT_A_FLAG, BG_WS_FLAG_RESPAWN_TIME); - if (Source->GetTeam() == ALLIANCE) - SendMessageToAll(LANG_BG_WS_CAPTURED_HF, CHAT_MSG_BG_SYSTEM_ALLIANCE, Source); + if (player->GetTeam() == ALLIANCE) + SendMessageToAll(LANG_BG_WS_CAPTURED_HF, CHAT_MSG_BG_SYSTEM_ALLIANCE, player); else - SendMessageToAll(LANG_BG_WS_CAPTURED_AF, CHAT_MSG_BG_SYSTEM_HORDE, Source); + SendMessageToAll(LANG_BG_WS_CAPTURED_AF, CHAT_MSG_BG_SYSTEM_HORDE, player); - UpdateFlagState(Source->GetTeam(), 1); // flag state none - UpdateTeamScore(Source->GetTeamId()); + UpdateFlagState(player->GetTeam(), 1); // flag state none + UpdateTeamScore(player->GetTeamId()); // only flag capture should be updated - UpdatePlayerScore(Source, SCORE_FLAG_CAPTURES, 1); // +1 flag captures + UpdatePlayerScore(player, SCORE_FLAG_CAPTURES, 1); // +1 flag captures // update last flag capture to be used if teamscore is equal - SetLastFlagCapture(Source->GetTeam()); + SetLastFlagCapture(player->GetTeam()); if (GetTeamScore(TEAM_ALLIANCE) == BG_WS_MAX_TEAM_SCORE) winner = ALLIANCE; @@ -356,34 +358,36 @@ void BattlegroundWS::EventPlayerCapturedFlag(Player* Source) } else { - _flagsTimer[GetTeamIndexByTeamId(Source->GetTeam()) ? 0 : 1] = BG_WS_FLAG_RESPAWN_TIME; + _flagsTimer[GetTeamIndexByTeamId(player->GetTeam()) ? 0 : 1] = BG_WS_FLAG_RESPAWN_TIME; } } -void BattlegroundWS::EventPlayerDroppedFlag(Player* Source) +void BattlegroundWS::EventPlayerDroppedFlag(Player* player) { if (GetStatus() != STATUS_IN_PROGRESS) { // if not running, do not cast things at the dropper player (prevent spawning the "dropped" flag), neither send unnecessary messages // just take off the aura - if (Source->GetTeam() == ALLIANCE) + if (player->GetTeam() == ALLIANCE) { if (!IsHordeFlagPickedup()) return; - if (GetFlagPickerGUID(TEAM_HORDE) == Source->GetGUID()) + + if (GetFlagPickerGUID(TEAM_HORDE) == player->GetGUID()) { SetHordeFlagPicker(0); - Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG); + player->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG); } } else { if (!IsAllianceFlagPickedup()) return; - if (GetFlagPickerGUID(TEAM_ALLIANCE) == Source->GetGUID()) + + if (GetFlagPickerGUID(TEAM_ALLIANCE) == player->GetGUID()) { SetAllianceFlagPicker(0); - Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG); + player->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG); } } return; @@ -391,20 +395,20 @@ void BattlegroundWS::EventPlayerDroppedFlag(Player* Source) bool set = false; - if (Source->GetTeam() == ALLIANCE) + if (player->GetTeam() == ALLIANCE) { if (!IsHordeFlagPickedup()) return; - if (GetFlagPickerGUID(TEAM_HORDE) == Source->GetGUID()) + if (GetFlagPickerGUID(TEAM_HORDE) == player->GetGUID()) { SetHordeFlagPicker(0); - Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG); + player->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG); if (_flagDebuffState == 1) - Source->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); - if (_flagDebuffState == 2) - Source->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT); + player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); + else if (_flagDebuffState == 2) + player->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT); _flagState[TEAM_HORDE] = BG_WS_FLAG_STATE_ON_GROUND; - Source->CastSpell(Source, BG_WS_SPELL_WARSONG_FLAG_DROPPED, true); + player->CastSpell(player, BG_WS_SPELL_WARSONG_FLAG_DROPPED, true); set = true; } } @@ -412,41 +416,41 @@ void BattlegroundWS::EventPlayerDroppedFlag(Player* Source) { if (!IsAllianceFlagPickedup()) return; - if (GetFlagPickerGUID(TEAM_ALLIANCE) == Source->GetGUID()) + if (GetFlagPickerGUID(TEAM_ALLIANCE) == player->GetGUID()) { SetAllianceFlagPicker(0); - Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG); + player->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG); if (_flagDebuffState == 1) - Source->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); - if (_flagDebuffState == 2) - Source->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT); + player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); + else if (_flagDebuffState == 2) + player->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT); _flagState[TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_GROUND; - Source->CastSpell(Source, BG_WS_SPELL_SILVERWING_FLAG_DROPPED, true); + player->CastSpell(player, BG_WS_SPELL_SILVERWING_FLAG_DROPPED, true); set = true; } } if (set) { - Source->CastSpell(Source, SPELL_RECENTLY_DROPPED_FLAG, true); - UpdateFlagState(Source->GetTeam(), 1); + player->CastSpell(player, SPELL_RECENTLY_DROPPED_FLAG, true); + UpdateFlagState(player->GetTeam(), 1); - if (Source->GetTeam() == ALLIANCE) + if (player->GetTeam() == ALLIANCE) { - SendMessageToAll(LANG_BG_WS_DROPPED_HF, CHAT_MSG_BG_SYSTEM_HORDE, Source); + SendMessageToAll(LANG_BG_WS_DROPPED_HF, CHAT_MSG_BG_SYSTEM_HORDE, player); UpdateWorldState(BG_WS_FLAG_UNK_HORDE, uint32(-1)); } else { - SendMessageToAll(LANG_BG_WS_DROPPED_AF, CHAT_MSG_BG_SYSTEM_ALLIANCE, Source); + SendMessageToAll(LANG_BG_WS_DROPPED_AF, CHAT_MSG_BG_SYSTEM_ALLIANCE, player); UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, uint32(-1)); } - _flagsDropTimer[GetTeamIndexByTeamId(Source->GetTeam()) ? 0 : 1] = BG_WS_FLAG_DROP_TIME; + _flagsDropTimer[GetTeamIndexByTeamId(player->GetTeam()) ? 0 : 1] = BG_WS_FLAG_DROP_TIME; } } -void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target_obj) +void BattlegroundWS::EventPlayerClickedOnFlag(Player* player, GameObject* target_obj) { if (GetStatus() != STATUS_IN_PROGRESS) return; @@ -455,48 +459,48 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target ChatMsg type = CHAT_MSG_BG_SYSTEM_NEUTRAL; //alliance flag picked up from base - if (Source->GetTeam() == HORDE && GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_BASE + if (player->GetTeam() == HORDE && GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_BASE && BgObjects[BG_WS_OBJECT_A_FLAG] == target_obj->GetGUID()) { message_id = LANG_BG_WS_PICKEDUP_AF; type = CHAT_MSG_BG_SYSTEM_HORDE; PlaySoundToAll(BG_WS_SOUND_ALLIANCE_FLAG_PICKED_UP); SpawnBGObject(BG_WS_OBJECT_A_FLAG, RESPAWN_ONE_DAY); - SetAllianceFlagPicker(Source->GetGUID()); + SetAllianceFlagPicker(player->GetGUID()); _flagState[TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_PLAYER; //update world state to show correct flag carrier UpdateFlagState(HORDE, BG_WS_FLAG_STATE_ON_PLAYER); UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, 1); - Source->CastSpell(Source, BG_WS_SPELL_SILVERWING_FLAG, true); - Source->StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET, BG_WS_SPELL_SILVERWING_FLAG_PICKED); + player->CastSpell(player, BG_WS_SPELL_SILVERWING_FLAG, true); + player->StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET, BG_WS_SPELL_SILVERWING_FLAG_PICKED); if (_flagState[1] == BG_WS_FLAG_STATE_ON_PLAYER) _bothFlagsKept = true; } //horde flag picked up from base - if (Source->GetTeam() == ALLIANCE && GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_BASE + if (player->GetTeam() == ALLIANCE && GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_BASE && BgObjects[BG_WS_OBJECT_H_FLAG] == target_obj->GetGUID()) { message_id = LANG_BG_WS_PICKEDUP_HF; type = CHAT_MSG_BG_SYSTEM_ALLIANCE; PlaySoundToAll(BG_WS_SOUND_HORDE_FLAG_PICKED_UP); SpawnBGObject(BG_WS_OBJECT_H_FLAG, RESPAWN_ONE_DAY); - SetHordeFlagPicker(Source->GetGUID()); + SetHordeFlagPicker(player->GetGUID()); _flagState[TEAM_HORDE] = BG_WS_FLAG_STATE_ON_PLAYER; //update world state to show correct flag carrier UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_ON_PLAYER); UpdateWorldState(BG_WS_FLAG_UNK_HORDE, 1); - Source->CastSpell(Source, BG_WS_SPELL_WARSONG_FLAG, true); - Source->StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET, BG_WS_SPELL_WARSONG_FLAG_PICKED); + player->CastSpell(player, BG_WS_SPELL_WARSONG_FLAG, true); + player->StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET, BG_WS_SPELL_WARSONG_FLAG_PICKED); if (_flagState[0] == BG_WS_FLAG_STATE_ON_PLAYER) _bothFlagsKept = true; } //Alliance flag on ground(not in base) (returned or picked up again from ground!) - if (GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10) + if (GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_GROUND && player->IsWithinDistInMap(target_obj, 10) && target_obj->GetGOInfo()->entry == BG_OBJECT_A_FLAG_GROUND_WS_ENTRY) { - if (Source->GetTeam() == ALLIANCE) + if (player->GetTeam() == ALLIANCE) { message_id = LANG_BG_WS_RETURNED_AF; type = CHAT_MSG_BG_SYSTEM_ALLIANCE; @@ -504,7 +508,7 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target RespawnFlag(ALLIANCE, false); SpawnBGObject(BG_WS_OBJECT_A_FLAG, RESPAWN_IMMEDIATELY); PlaySoundToAll(BG_WS_SOUND_FLAG_RETURNED); - UpdatePlayerScore(Source, SCORE_FLAG_RETURNS, 1); + UpdatePlayerScore(player, SCORE_FLAG_RETURNS, 1); _bothFlagsKept = false; } else @@ -513,14 +517,14 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target type = CHAT_MSG_BG_SYSTEM_HORDE; PlaySoundToAll(BG_WS_SOUND_ALLIANCE_FLAG_PICKED_UP); SpawnBGObject(BG_WS_OBJECT_A_FLAG, RESPAWN_ONE_DAY); - SetAllianceFlagPicker(Source->GetGUID()); - Source->CastSpell(Source, BG_WS_SPELL_SILVERWING_FLAG, true); + SetAllianceFlagPicker(player->GetGUID()); + player->CastSpell(player, BG_WS_SPELL_SILVERWING_FLAG, true); _flagState[TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_PLAYER; UpdateFlagState(HORDE, BG_WS_FLAG_STATE_ON_PLAYER); if (_flagDebuffState == 1) - Source->CastSpell(Source, WS_SPELL_FOCUSED_ASSAULT, true); - if (_flagDebuffState == 2) - Source->CastSpell(Source, WS_SPELL_BRUTAL_ASSAULT, true); + player->CastSpell(player, WS_SPELL_FOCUSED_ASSAULT, true); + else if (_flagDebuffState == 2) + player->CastSpell(player, WS_SPELL_BRUTAL_ASSAULT, true); UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, 1); } //called in HandleGameObjectUseOpcode: @@ -528,10 +532,10 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target } //Horde flag on ground(not in base) (returned or picked up again) - if (GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10) + if (GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && player->IsWithinDistInMap(target_obj, 10) && target_obj->GetGOInfo()->entry == BG_OBJECT_H_FLAG_GROUND_WS_ENTRY) { - if (Source->GetTeam() == HORDE) + if (player->GetTeam() == HORDE) { message_id = LANG_BG_WS_RETURNED_HF; type = CHAT_MSG_BG_SYSTEM_HORDE; @@ -539,7 +543,7 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target RespawnFlag(HORDE, false); SpawnBGObject(BG_WS_OBJECT_H_FLAG, RESPAWN_IMMEDIATELY); PlaySoundToAll(BG_WS_SOUND_FLAG_RETURNED); - UpdatePlayerScore(Source, SCORE_FLAG_RETURNS, 1); + UpdatePlayerScore(player, SCORE_FLAG_RETURNS, 1); _bothFlagsKept = false; } else @@ -548,14 +552,14 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target type = CHAT_MSG_BG_SYSTEM_ALLIANCE; PlaySoundToAll(BG_WS_SOUND_HORDE_FLAG_PICKED_UP); SpawnBGObject(BG_WS_OBJECT_H_FLAG, RESPAWN_ONE_DAY); - SetHordeFlagPicker(Source->GetGUID()); - Source->CastSpell(Source, BG_WS_SPELL_WARSONG_FLAG, true); + SetHordeFlagPicker(player->GetGUID()); + player->CastSpell(player, BG_WS_SPELL_WARSONG_FLAG, true); _flagState[TEAM_HORDE] = BG_WS_FLAG_STATE_ON_PLAYER; UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_ON_PLAYER); if (_flagDebuffState == 1) - Source->CastSpell(Source, WS_SPELL_FOCUSED_ASSAULT, true); - if (_flagDebuffState == 2) - Source->CastSpell(Source, WS_SPELL_BRUTAL_ASSAULT, true); + player->CastSpell(player, WS_SPELL_FOCUSED_ASSAULT, true); + else if (_flagDebuffState == 2) + player->CastSpell(player, WS_SPELL_BRUTAL_ASSAULT, true); UpdateWorldState(BG_WS_FLAG_UNK_HORDE, 1); } //called in HandleGameObjectUseOpcode: @@ -565,8 +569,8 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target if (!message_id) return; - SendMessageToAll(message_id, type, Source); - Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT); + SendMessageToAll(message_id, type, player); + player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT); } void BattlegroundWS::RemovePlayer(Player* player, uint64 guid, uint32 /*team*/) @@ -660,7 +664,7 @@ void BattlegroundWS::HandleAreaTrigger(Player* player, uint32 trigger) } //if (buff_guid) - // HandleTriggerBuff(buff_guid, Source); + // HandleTriggerBuff(buff_guid, player); } bool BattlegroundWS::SetupBattleground() @@ -773,9 +777,9 @@ void BattlegroundWS::HandleKillPlayer(Player* player, Player* killer) Battleground::HandleKillPlayer(player, killer); } -void BattlegroundWS::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor) +void BattlegroundWS::UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor) { - BattlegroundScoreMap::iterator itr = PlayerScores.find(Source->GetGUID()); + BattlegroundScoreMap::iterator itr = PlayerScores.find(player->GetGUID()); if (itr == PlayerScores.end()) // player not found return; @@ -783,14 +787,14 @@ void BattlegroundWS::UpdatePlayerScore(Player* Source, uint32 type, uint32 value { case SCORE_FLAG_CAPTURES: // flags captured ((BattlegroundWGScore*)itr->second)->FlagCaptures += value; - Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, WS_OBJECTIVE_CAPTURE_FLAG); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, WS_OBJECTIVE_CAPTURE_FLAG); break; case SCORE_FLAG_RETURNS: // flags returned ((BattlegroundWGScore*)itr->second)->FlagReturns += value; - Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, WS_OBJECTIVE_RETURN_FLAG); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, WS_OBJECTIVE_RETURN_FLAG); break; default: - Battleground::UpdatePlayerScore(Source, type, value, doAddHonor); + Battleground::UpdatePlayerScore(player, type, value, doAddHonor); break; } } @@ -867,3 +871,16 @@ uint32 BattlegroundWS::GetPrematureWinner() return Battleground::GetPrematureWinner(); } + +bool BattlegroundWS::CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* player, Unit const* target, uint32 miscValue) +{ + switch (criteriaId) + { + case BG_CRITERIA_CHECK_SAVE_THE_DAY: + if (GetFlagState(player->GetTeam()) == BG_WS_FLAG_STATE_ON_BASE) + return true; + break; + } + + return Battleground::CheckAchievementCriteriaMeet(criteriaId, player, target, miscValue); +} diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.h b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h index 3501999963f..4b95fcf6afd 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h @@ -182,12 +182,12 @@ class BattlegroundWS : public Battleground uint8 GetFlagState(uint32 team) { return _flagState[GetTeamIndexByTeamId(team)]; } /* Battleground Events */ - void EventPlayerDroppedFlag(Player* Source); - void EventPlayerClickedOnFlag(Player* Source, GameObject* target_obj); - void EventPlayerCapturedFlag(Player* Source); + void EventPlayerDroppedFlag(Player* player); + void EventPlayerClickedOnFlag(Player* player, GameObject* target_obj); + void EventPlayerCapturedFlag(Player* player); void RemovePlayer(Player* player, uint64 guid, uint32 team); - void HandleAreaTrigger(Player* Source, uint32 Trigger); + void HandleAreaTrigger(Player* player, uint32 trigger); void HandleKillPlayer(Player* player, Player* killer); bool SetupBattleground(); void Reset(); @@ -197,7 +197,7 @@ class BattlegroundWS : public Battleground void UpdateFlagState(uint32 team, uint32 value); void SetLastFlagCapture(uint32 team) { _lastFlagCaptureTeam = team; } void UpdateTeamScore(uint32 team); - void UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor = true); + void UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true); void SetDroppedFlagGUID(uint64 guid, int32 team = -1) { if (team == TEAM_ALLIANCE || team == TEAM_HORDE) @@ -213,6 +213,10 @@ class BattlegroundWS : public Battleground void RemovePoint(uint32 TeamID, uint32 Points = 1) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] -= Points; } uint32 GetPrematureWinner(); + + /* Achievements*/ + bool CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* source, Unit const* target = NULL, uint32 miscvalue1 = 0); + private: uint64 m_FlagKeepers[2]; // 0 - alliance, 1 - horde uint64 m_DroppedFlagGUID[2]; diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 14a933f781b..d92a77d51b6 100644 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -161,7 +161,7 @@ enum InstanceInfo INSTANCE_INFO_BOSS_STATE }; -enum +enum MaxConditionTargets { MAX_CONDITION_TARGETS = 3 }; diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index af51e91ad1b..d29e0800776 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -446,7 +446,7 @@ void LFGMgr::InitializeLockedDungeons(Player* player, uint8 level /* = 0 */) void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const std::string& comment) { if (!player || !player->GetSession() || dungeons.empty()) - return; + return; Group* grp = player->GetGroup(); uint64 guid = player->GetGUID(); diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 9aaf45737ce..df0a4055beb 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -17,7 +17,7 @@ */ #include "GameObjectAI.h" -#include "BattlegroundAV.h" +#include "Battleground.h" #include "CellImpl.h" #include "CreatureAISelector.h" #include "DynamicTree.h" @@ -325,7 +325,7 @@ void GameObject::Update(uint32 diff) WorldPacket packet; BuildValuesUpdateBlockForPlayer(&udata, caster->ToPlayer()); udata.BuildPacket(&packet); - caster->ToPlayer()->GetSession()->SendPacket(&packet); + caster->ToPlayer()->SendDirectMessage(&packet); SendCustomAnim(GetGoAnimProgress()); } @@ -374,7 +374,7 @@ void GameObject::Update(uint32 diff) caster->ToPlayer()->RemoveGameObject(this, false); WorldPacket data(SMSG_FISH_ESCAPED, 0); - caster->ToPlayer()->GetSession()->SendPacket(&data); + caster->ToPlayer()->SendDirectMessage(&data); } // can be delete m_lootState = GO_JUST_DEACTIVATED; @@ -873,7 +873,9 @@ bool GameObject::IsDynTransport() const bool GameObject::IsDestructibleBuilding() const { GameObjectTemplate const* gInfo = GetGOInfo(); - if (!gInfo) return false; + if (!gInfo) + return false; + return gInfo->type == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING; } @@ -949,12 +951,8 @@ bool GameObject::ActivateToQuest(Player* target) const { if (LootTemplates_Gameobject.HaveQuestLootForPlayer(GetGOInfo()->GetLootId(), target)) { - /// @todo fix this hack - //look for battlegroundAV for some objects which are only activated after mine gots captured by own team - if (GetEntry() == BG_AV_OBJECTID_MINE_N || GetEntry() == BG_AV_OBJECTID_MINE_S) - if (Battleground* bg = target->GetBattleground()) - if (bg->GetTypeID(true) == BATTLEGROUND_AV && !bg->ToBattlegroundAV()->PlayerCanDoMineQuest(GetEntry(), target->GetTeam())) - return false; + if (Battleground const* bg = target->GetBattleground()) + return bg->CanActivateGO(GetEntry(), target->GetTeam()); return true; } break; @@ -1243,7 +1241,7 @@ void GameObject::Use(Unit* user) { WorldPacket data(SMSG_GAMEOBJECT_PAGETEXT, 8); data << GetGUID(); - player->GetSession()->SendPacket(&data); + player->SendDirectMessage(&data); } else if (info->goober.gossipID) { @@ -1385,7 +1383,7 @@ void GameObject::Use(Unit* user) SetLootState(GO_JUST_DEACTIVATED); WorldPacket data(SMSG_FISH_NOT_HOOKED, 0); - player->GetSession()->SendPacket(&data); + player->SendDirectMessage(&data); break; } } @@ -1648,7 +1646,7 @@ void GameObject::Use(Unit* user) player->TeleportTo(GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET); WorldPacket data(SMSG_ENABLE_BARBER_SHOP, 0); - player->GetSession()->SendPacket(&data); + player->SendDirectMessage(&data); player->SetStandState(UNIT_STAND_STATE_SIT_LOW_CHAIR+info->barberChair.chairheight); return; @@ -1844,7 +1842,7 @@ void GameObject::ModifyHealth(int32 change, Unit* attackerOrHealer /*= NULL*/, u data << uint32(-change); // change < 0 triggers SPELL_BUILDING_HEAL combat log event // change >= 0 triggers SPELL_BUILDING_DAMAGE event data << uint32(spellId); - player->GetSession()->SendPacket(&data); + player->SendDirectMessage(&data); } GameObjectDestructibleState newState = GetDestructibleState(); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f8390cecbe9..c0b7b889753 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -25,7 +25,6 @@ #include "BattlefieldMgr.h" #include "BattlefieldWG.h" #include "Battleground.h" -#include "BattlegroundAV.h" #include "BattlegroundMgr.h" #include "CellImpl.h" #include "Channel.h" @@ -9003,22 +9002,12 @@ void Player::SendLoot(uint64 guid, LootType loot_type) if (go->getLootState() == GO_READY) { uint32 lootid = go->GetGOInfo()->GetLootId(); - - /// @todo fix this big hack - if ((go->GetEntry() == BG_AV_OBJECTID_MINE_N || go->GetEntry() == BG_AV_OBJECTID_MINE_S)) - { - if (Battleground* bg = GetBattleground()) + if (Battleground* bg = GetBattleground()) + if (!bg->CanActivateGO(go->GetEntry(), GetTeam())) { - if (bg->GetTypeID(true) == BATTLEGROUND_AV) - { - if (!bg->ToBattlegroundAV()->PlayerCanDoMineQuest(go->GetEntry(), GetTeam())) - { - SendLootRelease(guid); - return; - } - } + SendLootRelease(guid); + return; } - } if (lootid) { diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index c7bc141dd7f..6ce88249f0f 100644 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -29,7 +29,6 @@ #include "ObjectAccessor.h" #include "Group.h" #include "Battleground.h" -#include "BattlegroundAV.h" #include "ScriptMgr.h" #include "GameObjectAI.h" @@ -523,7 +522,11 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recvData) TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, questId = %u", uint32(GUID_LOPART(playerGuid)), questId); - Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, playerGuid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); + Quest const* quest = sObjectMgr->GetQuestTemplate(questId); + if (!quest) + return; + + Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, playerGuid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT); if (!object || !object->hasInvolvedQuest(questId)) return; @@ -534,45 +537,33 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recvData) return; } - if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) + if (!_player->CanSeeStartQuest(quest) && _player->GetQuestStatus(questId) == QUEST_STATUS_NONE) { - if (autoCompleteMode && !quest->HasFlag(QUEST_FLAGS_AUTO_SUBMIT)) - { - TC_LOG_ERROR(LOG_FILTER_NETWORKIO, "Possible hacking attempt: Player %s [playerGuid: %u] tried to complete questId [entry: %u] by auto-submit flag for quest witch not suport it.", - _player->GetName().c_str(), _player->GetGUIDLow(), questId); - return; - } + TC_LOG_ERROR(LOG_FILTER_NETWORKIO, "Possible hacking attempt: Player %s [guid: %u] tried to complete quest [entry: %u] without being in possession of the quest!", + _player->GetName().c_str(), _player->GetGUIDLow(), questId); + return; + } - if (!_player->CanSeeStartQuest(quest) && _player->GetQuestStatus(questId) == QUEST_STATUS_NONE) - { - TC_LOG_ERROR(LOG_FILTER_NETWORKIO, "Possible hacking attempt: Player %s [playerGuid: %u] tried to complete questId [entry: %u] without being in possession of the questId!", - _player->GetName().c_str(), _player->GetGUIDLow(), questId); - return; - } - /// @todo need a virtual function - if (_player->InBattleground()) - if (Battleground* bg = _player->GetBattleground()) - if (bg->GetTypeID() == BATTLEGROUND_AV) - bg->ToBattlegroundAV()->HandleQuestComplete(questId, _player); + if (Battleground* bg = _player->GetBattleground()) + bg->HandleQuestComplete(questId, _player); - if (_player->GetQuestStatus(questId) != QUEST_STATUS_COMPLETE) - { - if (quest->IsRepeatable()) - _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, playerGuid, _player->CanCompleteRepeatableQuest(quest), false); - else - _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, playerGuid, _player->CanRewardQuest(quest, false), false); - } + if (_player->GetQuestStatus(questId) != QUEST_STATUS_COMPLETE) + { + if (quest->IsRepeatable()) + _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, playerGuid, _player->CanCompleteRepeatableQuest(quest), false); else - { - if (quest->GetReqItemsCount()) // some items required - _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, playerGuid, _player->CanRewardQuest(quest, false), false); - else // no items required - _player->PlayerTalkClass->SendQuestGiverOfferReward(quest, playerGuid, !autoCompleteMode); - } - - if (Creature* creature = object->ToCreature()) - sScriptMgr->OnQuestComplete(_player, creature, quest); + _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, playerGuid, _player->CanRewardQuest(quest, false), false); + } + else + { + if (quest->GetReqItemsCount()) // some items required + _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, playerGuid, _player->CanRewardQuest(quest, false), false); + else // no items required + _player->PlayerTalkClass->SendQuestGiverOfferReward(quest, playerGuid, true); } + + if (Creature* creature = object->ToCreature()) + sScriptMgr->OnQuestComplete(_player, creature, quest); } void WorldSession::HandleQuestgiverQuestAutoLaunch(WorldPacket& /*recvPacket*/) @@ -588,66 +579,70 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) if (!_player->CanShareQuest(questId)) return; - TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PUSHQUESTTOPARTY quest = %u", questId); + TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PUSHQUESTTOPARTY questId = %u", questId); - if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) + Quest const* quest = sObjectMgr->GetQuestTemplate(questId); + if (!quest) + return; + + Player * const sender = GetPlayer(); + + Group* group = sender->GetGroup(); + if (!group) + return; + + for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { - if (Group* group = _player->GetGroup()) - { - for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) - { - Player* player = itr->GetSource(); + Player* receiver = itr->GetSource(); - if (!player || player == _player) // skip self - continue; + if (!receiver || receiver == sender) + continue; - if (!player->SatisfyQuestStatus(quest, false)) - { - _player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_HAVE_QUEST); - continue; - } + if (!receiver->SatisfyQuestStatus(quest, false)) + { + sender->SendPushToPartyResponse(receiver, QUEST_PARTY_MSG_HAVE_QUEST); + continue; + } - if (player->GetQuestStatus(questId) == QUEST_STATUS_COMPLETE) - { - _player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_FINISH_QUEST); - continue; - } + if (receiver->GetQuestStatus(questId) == QUEST_STATUS_COMPLETE) + { + sender->SendPushToPartyResponse(receiver, QUEST_PARTY_MSG_FINISH_QUEST); + continue; + } - if (!player->CanTakeQuest(quest, false)) - { - _player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_CANT_TAKE_QUEST); - continue; - } + if (!receiver->CanTakeQuest(quest, false)) + { + sender->SendPushToPartyResponse(receiver, QUEST_PARTY_MSG_CANT_TAKE_QUEST); + continue; + } - if (!player->SatisfyQuestLog(false)) - { - _player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_LOG_FULL); - continue; - } + if (!receiver->SatisfyQuestLog(false)) + { + sender->SendPushToPartyResponse(receiver, QUEST_PARTY_MSG_LOG_FULL); + continue; + } - if (player->GetDivider() != 0) - { - _player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_BUSY); - continue; - } + if (receiver->GetDivider() != 0) + { + sender->SendPushToPartyResponse(receiver, QUEST_PARTY_MSG_BUSY); + continue; + } - _player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_SHARING_QUEST); + sender->SendPushToPartyResponse(receiver, QUEST_PARTY_MSG_SHARING_QUEST); - if (quest->IsAutoAccept() && player->CanAddQuest(quest, true) && player->CanTakeQuest(quest, true)) - { - player->AddQuest(quest, _player); - if (player->CanCompleteQuest(questId)) - player->CompleteQuest(questId); - } + if (quest->IsAutoAccept() && receiver->CanAddQuest(quest, true) && receiver->CanTakeQuest(quest, true)) + { + receiver->AddQuest(quest, sender); + if (receiver->CanCompleteQuest(questId)) + receiver->CompleteQuest(questId); + } - if ((quest->IsAutoComplete() && quest->IsRepeatable() && !quest->IsDailyOrWeekly()) || quest->HasFlag(QUEST_FLAGS_AUTOCOMPLETE)) - player->PlayerTalkClass->SendQuestGiverRequestItems(quest, _player->GetGUID(), player->CanCompleteRepeatableQuest(quest), true); - else - { - player->SetDivider(_player->GetGUID()); - player->PlayerTalkClass->SendQuestGiverQuestDetails(quest, _player->GetGUID(), true); - } - } + if ((quest->IsAutoComplete() && quest->IsRepeatable() && !quest->IsDailyOrWeekly()) || quest->HasFlag(QUEST_FLAGS_AUTOCOMPLETE)) + receiver->PlayerTalkClass->SendQuestGiverRequestItems(quest, sender->GetGUID(), receiver->CanCompleteRepeatableQuest(quest), true); + else + { + receiver->SetDivider(sender->GetGUID()); + receiver->PlayerTalkClass->SendQuestGiverQuestDetails(quest, sender->GetGUID(), true); } } } @@ -669,7 +664,7 @@ void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket) WorldPacket data(MSG_QUEST_PUSH_RESULT, 8 + 4 + 1); data << uint64(_player->GetGUID()); data << uint8(msg); // valid values: 0-8 - player->GetSession()->SendPacket(&data); + player->SendDirectMessage(&data); _player->SetDivider(0); } } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 54a6116fb04..6ac0564d433 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -45,8 +45,6 @@ #include "CreatureAI.h" #include "BattlegroundMgr.h" #include "Battleground.h" -#include "BattlegroundEY.h" -#include "BattlegroundWS.h" #include "OutdoorPvPMgr.h" #include "Language.h" #include "SocialMgr.h" diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 5643b7d8449..25b84edc227 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -29,7 +29,6 @@ #include "BattlegroundMgr.h" #include "CreatureAI.h" #include "MapManager.h" -#include "BattlegroundIC.h" #include "BattlefieldWG.h" #include "BattlefieldMgr.h" #include "Player.h" @@ -358,7 +357,7 @@ bool SpellMgr::IsSpellValid(SpellInfo const* spellInfo, Player* player, bool msg if (!spellInfo) return false; - bool need_check_reagents = false; + bool needCheckReagents = false; // check effects for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) @@ -401,7 +400,7 @@ bool SpellMgr::IsSpellValid(SpellInfo const* spellInfo, Player* player, bool msg return false; } - need_check_reagents = true; + needCheckReagents = true; break; } case SPELL_EFFECT_LEARN_SPELL: @@ -423,7 +422,7 @@ bool SpellMgr::IsSpellValid(SpellInfo const* spellInfo, Player* player, bool msg } } - if (need_check_reagents) + if (needCheckReagents) { for (uint8 j = 0; j < MAX_SPELL_REAGENTS; ++j) { @@ -447,7 +446,7 @@ bool SpellMgr::IsSpellValid(SpellInfo const* spellInfo, Player* player, bool msg uint32 SpellMgr::GetSpellDifficultyId(uint32 spellId) const { SpellDifficultySearcherMap::const_iterator i = mSpellDifficultySearcherMap.find(spellId); - return i == mSpellDifficultySearcherMap.end() ? 0 : (*i).second; + return i == mSpellDifficultySearcherMap.end() ? 0 : i->second; } void SpellMgr::SetSpellDifficultyId(uint32 spellId, uint32 id) @@ -1102,7 +1101,13 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 if (!player || (auraSpell > 0 && !player->HasAura(auraSpell)) || (auraSpell < 0 && player->HasAura(-auraSpell))) return false; - // Extra conditions -- leaving the possibility add extra conditions... + if (player) + { + if (Battleground* bg = player->GetBattleground()) + return bg->IsSpellAllowed(spellId, player); + } + + // Extra conditions switch (spellId) { case 91604: // No fly Zone - Wintergrasp @@ -1115,21 +1120,6 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 return false; break; } - case 68719: // Oil Refinery - Isle of Conquest. - case 68720: // Quarry - Isle of Conquest. - { - if (!player || player->GetBattlegroundTypeId() != BATTLEGROUND_IC || !player->GetBattleground()) - return false; - - uint8 nodeType = spellId == 68719 ? NODE_TYPE_REFINERY : NODE_TYPE_QUARRY; - uint8 nodeState = player->GetTeamId() == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H; - - BattlegroundIC* pIC = player->GetBattleground()->ToBattlegroundIC(); - if (pIC->GetNodeState(nodeType) == nodeState) - return true; - - return false; - } case 56618: // Horde Controls Factory Phase Shift case 56617: // Alliance Controls Factory Phase Shift { @@ -1669,7 +1659,7 @@ void SpellMgr::LoadSpellTargetPositions() SpellInfo const* spellInfo = GetSpellInfo(Spell_ID); if (!spellInfo) { - TC_LOG_ERROR(LOG_FILTER_SQL, "Spell (ID:%u) listed in `spell_target_position` does not exist.", Spell_ID); + TC_LOG_ERROR(LOG_FILTER_SQL, "Spell (Id: %u) listed in `spell_target_position` does not exist.", Spell_ID); continue; } diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp index f59dbb785a8..c8d83a54e1e 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp @@ -400,12 +400,12 @@ public: ## go_shallow_grave ######*/ -enum +enum ShallowGrave { - ZOMBIE = 7286, - DEAD_HERO = 7276, - ZOMBIE_CHANCE = 65, - DEAD_HERO_CHANCE = 10 + NPC_ZOMBIE = 7286, + NPC_DEAD_HERO = 7276, + CHANCE_ZOMBIE = 65, + CHANCE_DEAD_HERO = 10 }; class go_shallow_grave : public GameObjectScript @@ -419,11 +419,11 @@ public: if (go->GetUseCount() == 0) { uint32 randomchance = urand(0, 100); - if (randomchance < ZOMBIE_CHANCE) - go->SummonCreature(ZOMBIE, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); + if (randomchance < CHANCE_ZOMBIE) + go->SummonCreature(NPC_ZOMBIE, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); else - if ((randomchance - ZOMBIE_CHANCE) < DEAD_HERO_CHANCE) - go->SummonCreature(DEAD_HERO, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); + if ((randomchance - CHANCE_ZOMBIE) < CHANCE_DEAD_HERO) + go->SummonCreature(NPC_DEAD_HERO, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); } go->AddUse(); return false; diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp index 7771451894e..05e758f5cf9 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp @@ -52,7 +52,7 @@ enum Yells SAY_INTRO = 5 }; -enum +enum Misc { ACHIEV_TIMED_START_EVENT = 20381, }; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index b590b963c34..fdf39519409 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -99,7 +99,7 @@ static _Messages _GossipMessage[]= {MSG_ANUBARAK, GOSSIP_ACTION_INFO_DEF + 6, true, BOSS_ANUBARAK} }; -enum +enum Messages { NUM_MESSAGES = 6 }; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h index 0d64655db77..17e4f2869c6 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h @@ -5,7 +5,7 @@ #ifndef DEF_CRUSADER_H #define DEF_CRUSADER_H -enum +enum DataTypes { BOSS_BEASTS = 0, BOSS_JARAXXUS = 1, @@ -28,12 +28,18 @@ enum INCREASE = 501, DECREASE = 502, +}; +enum SpellIds +{ SPELL_WILFRED_PORTAL = 68424, SPELL_JARAXXUS_CHAINS = 67924, SPELL_CORPSE_TELEPORT = 69016, SPELL_DESTROY_FLOOR_KNOCKUP = 68193, +}; +enum MiscData +{ DESPAWN_TIME = 300000, DISPLAYID_DESTROYED_FLOOR = 9060 diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index 7fddfd861c2..6408417e902 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -198,7 +198,7 @@ enum Events EVENT_CLOSE_FROSTWORN_DOOR, }; -enum Enum +enum Misc { ACTION_START_INTRO, ACTION_SKIP_INTRO, @@ -744,7 +744,7 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript void JustDied(Unit* /*Killer*/) OVERRIDE { - if (_instance) + if (_instance) _instance->SetData(DATA_ESCAPE_EVENT, FAIL); } @@ -893,7 +893,7 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript case EVENT_ESCAPE_13: if (Creature* lichking = me->GetCreature(*me, _lichkingGUID)) { - lichking->AI()->DoCast(lichking, SPELL_REMORSELESS_WINTER, true); + lichking->AI()->DoCast(lichking, SPELL_REMORSELESS_WINTER, true); lichking->AI()->DoCast(lichking, SPELL_SUMMON_RISE_WITCH_DOCTOR); lichking->GetMotionMaster()->MoveIdle(); lichking->GetMotionMaster()->MoveChase(me); @@ -901,9 +901,9 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript if (Creature* walltarget = me->SummonCreature(NPC_ICE_WALL,IceWalls[0].GetPositionX(), IceWalls[0].GetPositionY(), IceWalls[0].GetPositionZ(), IceWalls[0].GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN, 720000)) { _walltargetGUID = walltarget->GetGUID(); - walltarget->AI()->DoCast(walltarget, SPELL_SUMMON_ICE_WALL); + walltarget->AI()->DoCast(walltarget, SPELL_SUMMON_ICE_WALL); walltarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); - me->Attack(walltarget,false); + me->Attack(walltarget,false); } me->GetMotionMaster()->MovePoint(0, NpcJainaOrSylvanasEscapeRoute[3]); _events.ScheduleEvent(EVENT_ESCAPE_14, 8000); @@ -921,7 +921,7 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript else me->AI()->Talk(SAY_SYLVANAS_ESCAPE_2); } - } + } _events.ScheduleEvent(EVENT_ESCAPE_15, 1000); break; case EVENT_ESCAPE_15: @@ -966,7 +966,7 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript else me->RemoveAurasDueToSpell(SPELL_SYLVANAS_DESTROY_ICE_WALL); } - if (_icewall && _icewall < 4) + if (_icewall && _icewall < 4) me->GetMotionMaster()->MovePoint(0, NpcJainaOrSylvanasEscapeRoute[_icewall + 3]); _events.ScheduleEvent(EVENT_ESCAPE_18, 2000); break; @@ -991,7 +991,7 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript if (Creature* walltarget = me->SummonCreature(NPC_ICE_WALL, IceWalls[_icewall].GetPositionX(), IceWalls[_icewall].GetPositionY(), IceWalls[_icewall].GetPositionZ(), IceWalls[_icewall].GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN, 720000)) { _walltargetGUID = walltarget->GetGUID(); - walltarget->AI()->DoCast(walltarget, SPELL_SUMMON_ICE_WALL); + walltarget->AI()->DoCast(walltarget, SPELL_SUMMON_ICE_WALL); walltarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->Attack(walltarget,false); } @@ -1028,9 +1028,9 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript if (Creature* lichking = me->GetCreature(*me, _lichkingGUID)) { if (_icewall && _icewall < 3) - lichking->AI()->DoCast(lichking, SPELL_SUMMON_RISE_WITCH_DOCTOR); + lichking->AI()->DoCast(lichking, SPELL_SUMMON_RISE_WITCH_DOCTOR); else - lichking->AI()->DoCast(lichking, SPELL_SUMMON_LUMBERING_ABOMINATION); + lichking->AI()->DoCast(lichking, SPELL_SUMMON_LUMBERING_ABOMINATION); } if (_icewall == 3) _events.ScheduleEvent(EVENT_ESCAPE_21, 16000); // last wall, really far @@ -1826,20 +1826,20 @@ class npc_raging_ghoul : public CreatureScript { public: npc_raging_ghoul() : CreatureScript("npc_raging_ghoul") { } - + struct npc_raging_ghoulAI : public ScriptedAI { npc_raging_ghoulAI(Creature* creature) : ScriptedAI(creature) { - _instance = me->GetInstanceScript(); + _instance = me->GetInstanceScript(); } - + InstanceScript* _instance; uint32 _emergeTimer; bool _doEmerge; bool _doJump; uint64 _leaderGUID; - + void Reset() OVERRIDE { _emergeTimer = 4000; @@ -1847,47 +1847,47 @@ public: _doJump = false; if (_instance && _instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS) _instance->SetData(DATA_SUMMONS, 1); - + } - + void IsSummonedBy(Unit*) OVERRIDE { DoCast(me, SPELL_EMERGE_VISUAL); DoZoneInCombat(me, 100.00f); } - + void JustDied(Unit* /*killer*/) OVERRIDE { if (_instance) _instance->SetData(DATA_SUMMONS, 0); } - + void AttackStart(Unit* who) OVERRIDE { if (!who) return; - + if (!_doEmerge) return; - + ScriptedAI::AttackStart(who); } - + void UpdateAI(uint32 diff) OVERRIDE { if (!_instance) return; - + if (_instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS) { _leaderGUID = _instance->GetData64(DATA_ESCAPE_LEADER); Creature* leader = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_ESCAPE_LEADER)); - + if (_doEmerge != true) { if (_emergeTimer < diff) { - _doEmerge = true; + _doEmerge = true; if (leader) { DoResetThreat(); @@ -1898,7 +1898,7 @@ public: else _emergeTimer -= diff; } - + if (me->Attack(leader,true))/*(Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150.0f))*/ { if (!_doJump && me->IsWithinDistInMap(leader, 30.0f) && !me->IsWithinDistInMap(leader, 5.0f)) @@ -1913,7 +1913,7 @@ public: DoMeleeAttackIfReady(); } }; - + CreatureAI* GetAI(Creature* creature) const OVERRIDE { return new npc_raging_ghoulAI(creature); @@ -1924,14 +1924,14 @@ class npc_risen_witch_doctor : public CreatureScript { public: npc_risen_witch_doctor() : CreatureScript("npc_risen_witch_doctor") { } - + struct npc_risen_witch_doctorAI : public ScriptedAI { npc_risen_witch_doctorAI(Creature* creature) : ScriptedAI(creature) { - _instance = me->GetInstanceScript(); + _instance = me->GetInstanceScript(); } - + InstanceScript* _instance; uint32 _emergeTimer; bool _doEmerge; @@ -1939,7 +1939,7 @@ public: uint32 _boltTimer; uint32 _boltVolleyTimer; uint32 _curseTimer; - + void Reset() OVERRIDE { _emergeTimer = 5000; @@ -1951,36 +1951,36 @@ public: if (_instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS) _instance->SetData(DATA_SUMMONS, 1); } - + void IsSummonedBy(Unit*) OVERRIDE { DoCast(me, SPELL_EMERGE_VISUAL); DoZoneInCombat(me, 100.00f); } - + void JustDied(Unit* /*killer*/) OVERRIDE { - if (_instance) + if (_instance) _instance->SetData(DATA_SUMMONS, 0); - + } - + void AttackStart(Unit* who) OVERRIDE { if (!who) return; - + if (_doEmerge == false) return; - + ScriptedAI::AttackStart(who); } - + void UpdateAI(uint32 diff) OVERRIDE { if (!_instance) return; - + if (_instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS) { if (_doEmerge != true) @@ -1989,7 +1989,7 @@ public: { _doEmerge = true; _leaderGUID = _instance->GetData64(DATA_ESCAPE_LEADER); - + if (Creature* leader = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_ESCAPE_LEADER))) { DoResetThreat(); @@ -2000,25 +2000,25 @@ public: else _emergeTimer -= diff; } - + if (_curseTimer < diff) { if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM)) DoCast(target, SPELL_COURSE_OF_DOOM); _curseTimer = urand(10000, 15000); - } - else + } + else _curseTimer -= diff; - + if (_boltTimer < diff) { if (Unit *target = SelectTarget(SELECT_TARGET_TOPAGGRO)) DoCast(target, SPELL_SHADOW_BOLT); _boltTimer = urand(2000, 3000); - } - else + } + else _boltTimer -= diff; - + if (_boltVolleyTimer < diff) { if (Unit *target = SelectTarget(SELECT_TARGET_TOPAGGRO)) @@ -2033,7 +2033,7 @@ public: DoMeleeAttackIfReady(); } }; - + CreatureAI* GetAI(Creature* creature) const OVERRIDE { return new npc_risen_witch_doctorAI(creature); @@ -2045,20 +2045,20 @@ class npc_lumbering_abomination : public CreatureScript { public: npc_lumbering_abomination() : CreatureScript("npc_lumbering_abomination") { } - + struct npc_lumbering_abominationAI : public ScriptedAI { npc_lumbering_abominationAI(Creature* creature) : ScriptedAI(creature) { - _instance = me->GetInstanceScript(); + _instance = me->GetInstanceScript(); } - + InstanceScript* _instance; uint64 _leaderGUID; bool _doWalk; uint32 _strikeTimer; uint32 _vomitTimer; - + void Reset() OVERRIDE { _doWalk = false; @@ -2066,20 +2066,20 @@ public: _strikeTimer = 6000; if (_instance) if (_instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS) - _instance->SetData(DATA_SUMMONS, 1); + _instance->SetData(DATA_SUMMONS, 1); } - + void IsSummonedBy(Unit*) OVERRIDE { DoCast(me, SPELL_EMERGE_VISUAL); DoZoneInCombat(me, 100.00f); } - + void UpdateAI(uint32 diff) OVERRIDE { if (!_instance) return; - + if (_instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS) { if (_doWalk != true) @@ -2101,7 +2101,7 @@ public: } else _strikeTimer -= diff; - + if (_vomitTimer < diff) { if (Unit *target = SelectTarget(SELECT_TARGET_TOPAGGRO)) @@ -2115,15 +2115,15 @@ public: me->DespawnOrUnsummon(); DoMeleeAttackIfReady(); } - + void JustDied(Unit* /*killer*/) OVERRIDE { - if (_instance) + if (_instance) _instance->SetData(DATA_SUMMONS, 0); } - + }; - + CreatureAI* GetAI(Creature* creature) const OVERRIDE { return new npc_lumbering_abominationAI(creature); @@ -2145,7 +2145,7 @@ void AddSC_halls_of_reflection() new npc_tortured_rifleman(); new npc_raging_ghoul(); new npc_risen_witch_doctor(); - new npc_lumbering_abomination(); + new npc_lumbering_abomination(); new npc_frostworn_general(); new npc_spiritual_reflection(); } diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp index c5c1811d30e..a026a6636d4 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp @@ -181,7 +181,7 @@ public: HandleGameObject(0, true, go); else HandleGameObject(0, false, go); - break; + break; case GO_CAVE: _caveGUID = go->GetGUID(); go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND); @@ -255,17 +255,17 @@ public: if (_teamInInstance == ALLIANCE) instance->SummonCreature(NPC_JAINA_PART2, JainaSpawnPos2); else - instance->SummonCreature(NPC_SYLVANAS_PART2, SylvanasSpawnPos2); + instance->SummonCreature(NPC_SYLVANAS_PART2, SylvanasSpawnPos2); } - _frostwornGeneral = data; - break; + _frostwornGeneral = data; + break; case DATA_ESCAPE_EVENT: if (data == IN_PROGRESS) { if (!_escapeevent) if (Creature* jaina_or_sylvanas = instance->GetCreature(_jainaOrSylvanasPart2GUID)) jaina_or_sylvanas->AI()->DoAction(ACTION_START_ESCAPING); - } + } else if (data == NOT_STARTED) { if (Creature* jaina_or_sylvanas = instance->GetCreature(_jainaOrSylvanasPart2GUID)) @@ -287,7 +287,7 @@ public: if (Creature* jaina_or_sylvanas = instance->GetCreature(_jainaOrSylvanasPart2GUID)) jaina_or_sylvanas->AI()->DoAction(ACTION_WALL_BROKEN); } - } + } else if (data == 1) _mobsaticewall++; break; @@ -489,9 +489,9 @@ public: case DATA_FROSTMOURNE: return _frostmourneGUID; case DATA_ESCAPE_LEADER: - return _jainaOrSylvanasPart2GUID; + return _jainaOrSylvanasPart2GUID; case DATA_CAVE_IN: - return _caveGUID; + return _caveGUID; default: break; } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp index 45e0855bb4f..928ffd14dea 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp @@ -19,24 +19,21 @@ #include "ScriptedCreature.h" #include "naxxramas.h" -enum Anubrekhan +enum Says { SAY_AGGRO = 0, SAY_GREET = 1, - SAY_SLAY = 2, - - NPC_CRYPT_GUARD = 16573 + SAY_SLAY = 2 }; -const Position GuardSummonPos = {3333.72f, -3476.30f, 287.1f, 6.2801f}; +Position const GuardSummonPos = {3333.72f, -3476.30f, 287.1f, 6.2801f}; enum Events { - EVENT_NONE, - EVENT_IMPALE, + EVENT_IMPALE = 1, EVENT_LOCUST, EVENT_SPAWN_GUARDIAN_NORMAL, - EVENT_BERSERK, + EVENT_BERSERK }; enum Spells @@ -47,12 +44,12 @@ enum Spells SPELL_LOCUST_SWARM_25 = 54021, SPELL_SUMMON_CORPSE_SCARABS_PLR = 29105, // This spawns 5 corpse scarabs on top of player SPELL_SUMMON_CORPSE_SCARABS_MOB = 28864, // This spawns 10 corpse scarabs on top of dead guards - SPELL_BERSERK = 27680, + SPELL_BERSERK = 27680 }; -enum +enum Misc { - ACHIEV_TIMED_START_EVENT = 9891, + ACHIEV_TIMED_START_EVENT = 9891 }; class boss_anubrekhan : public CreatureScript diff --git a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp index 935d29ff783..bf3e7706f4d 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp @@ -25,7 +25,7 @@ enum Spells H_SPELL_HATEFUL_STRIKE = 59192, SPELL_FRENZY = 28131, SPELL_BERSERK = 26662, - SPELL_SLIME_BOLT = 32309, + SPELL_SLIME_BOLT = 32309 }; enum Yells @@ -45,9 +45,9 @@ enum Events EVENT_SLIME }; -enum +enum Misc { - ACHIEV_MAKE_QUICK_WERK_OF_HIM_STARTING_EVENT = 10286, + ACHIEV_MAKE_QUICK_WERK_OF_HIM_STARTING_EVENT = 10286 }; class boss_patchwerk : public CreatureScript diff --git a/src/server/scripts/Northrend/Naxxramas/naxxramas.h b/src/server/scripts/Northrend/Naxxramas/naxxramas.h index 10b26e278bb..a71d573bf20 100644 --- a/src/server/scripts/Northrend/Naxxramas/naxxramas.h +++ b/src/server/scripts/Northrend/Naxxramas/naxxramas.h @@ -84,6 +84,7 @@ enum CreaturesIds NPC_STALAGG = 15929, NPC_SAPPHIRON = 15989, NPC_KEL_THUZAD = 15990, + NPC_CRYPT_GUARD = 16573, NPC_NAXXRAMAS_FOLLOWER = 16505, NPC_FOLLOWER_WORSHIPPER = 16506, NPC_DK_UNDERSTUDY = 16803 diff --git a/src/server/scripts/Outland/zone_netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp index 7c419243c20..7e99275adbd 100644 --- a/src/server/scripts/Outland/zone_netherstorm.cpp +++ b/src/server/scripts/Outland/zone_netherstorm.cpp @@ -936,10 +936,10 @@ public: ## npc_maxx_a_million ######*/ -enum +enum MaxxAMillion { - QUEST_MARK_V_IS_ALIVE = 10191, - GO_DRAENEI_MACHINE = 183771 + QUEST_MARK_V_IS_ALIVE = 10191, + GO_DRAENEI_MACHINE = 183771 }; class npc_maxx_a_million_escort : public CreatureScript diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index d87278cefc0..10cc62a8a91 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1785,6 +1785,40 @@ class spell_q12847_summon_soul_moveto_bunny : public SpellScriptLoader } }; +class spell_q13086_cannons_target : public SpellScriptLoader +{ + public: + spell_q13086_cannons_target() : SpellScriptLoader("spell_q13086_cannons_target") { } + + class spell_q13086_cannons_target_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q13086_cannons_target_SpellScript); + + bool Validate(SpellInfo const* spellInfo) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].CalcValue())) + return false; + return true; + } + + void HandleEffectDummy(SpellEffIndex /*effIndex*/) + { + if (WorldLocation const* pos = GetExplTargetDest()) + GetCaster()->CastSpell(pos->GetPositionX(), pos->GetPositionY(), pos->GetPositionZ(), GetEffectValue(), true); + } + + void Register() OVERRIDE + { + OnEffectHit += SpellEffectFn(spell_q13086_cannons_target_SpellScript::HandleEffectDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_q13086_cannons_target_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -1829,4 +1863,5 @@ void AddSC_quest_spell_scripts() new spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy(); new spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon(); new spell_q12847_summon_soul_moveto_bunny(); + new spell_q13086_cannons_target(); } diff --git a/src/server/scripts/World/achievement_scripts.cpp b/src/server/scripts/World/achievement_scripts.cpp index 0243b08e80e..94e448bd9bc 100644 --- a/src/server/scripts/World/achievement_scripts.cpp +++ b/src/server/scripts/World/achievement_scripts.cpp @@ -16,12 +16,8 @@ */ #include "ScriptMgr.h" - -#include "BattlegroundAB.h" -#include "BattlegroundWS.h" -#include "BattlegroundIC.h" #include "BattlegroundSA.h" -#include "BattlegroundAV.h" +#include "BattlegroundIC.h" #include "Vehicle.h" #include "Player.h" #include "Creature.h" @@ -31,19 +27,12 @@ class achievement_resilient_victory : public AchievementCriteriaScript public: achievement_resilient_victory() : AchievementCriteriaScript("achievement_resilient_victory") { } - bool OnCheck(Player* source, Unit* /*target*/) OVERRIDE + bool OnCheck(Player* source, Unit* target) OVERRIDE { - Battleground* bg = source->GetBattleground(); - if (!bg) - return false; - - if (bg->GetTypeID(true) != BATTLEGROUND_AB) - return false; - - if (!bg->ToBattlegroundAB()->IsTeamScores500Disadvantage(source->GetTeam())) - return false; + if (Battleground* bg = source->GetBattleground()) + return bg->CheckAchievementCriteriaMeet(BG_CRITERIA_CHECK_RESILIENT_VICTORY, source, target); - return true; + return false; } }; @@ -54,14 +43,10 @@ class achievement_bg_control_all_nodes : public AchievementCriteriaScript bool OnCheck(Player* source, Unit* /*target*/) OVERRIDE { - Battleground* bg = source->GetBattleground(); - if (!bg) - return false; - - if (!bg->IsAllNodesConrolledByTeam(source->GetTeam())) - return false; + if (Battleground* bg = source->GetBattleground()) + return bg->IsAllNodesControlledByTeam(source->GetTeam()); - return true; + return false; } }; @@ -72,21 +57,9 @@ class achievement_save_the_day : public AchievementCriteriaScript bool OnCheck(Player* source, Unit* target) OVERRIDE { - if (!target) - return false; - - if (Player const* player = target->ToPlayer()) - { - Battleground* bg = source->GetBattleground(); - if (!bg) - return false; + if (Battleground* bg = source->GetBattleground()) + return bg->CheckAchievementCriteriaMeet(BG_CRITERIA_CHECK_SAVE_THE_DAY, source, target); - if (bg->GetTypeID(true) != BATTLEGROUND_WS) - return false; - - if (bg->ToBattlegroundWS()->GetFlagState(player->GetTeam()) == BG_WS_FLAG_STATE_ON_BASE) - return true; - } return false; } }; @@ -200,17 +173,10 @@ class achievement_everything_counts : public AchievementCriteriaScript public: achievement_everything_counts() : AchievementCriteriaScript("achievement_everything_counts") { } - bool OnCheck(Player* source, Unit* /*target*/) OVERRIDE + bool OnCheck(Player* source, Unit* target) OVERRIDE { - Battleground* bg = source->GetBattleground(); - if (!bg) - return false; - - if (bg->GetTypeID(true) != BATTLEGROUND_AV) - return false; - - if (bg->ToBattlegroundAV()->IsBothMinesControlledByTeam(source->GetTeam())) - return true; + if (Battleground* bg = source->GetBattleground()) + return bg->CheckAchievementCriteriaMeet(BG_CRITERIA_CHECK_EVERYTHING_COUNTS, source, target); return false; } @@ -221,17 +187,10 @@ class achievement_bg_av_perfection : public AchievementCriteriaScript public: achievement_bg_av_perfection() : AchievementCriteriaScript("achievement_bg_av_perfection") { } - bool OnCheck(Player* source, Unit* /*target*/) OVERRIDE + bool OnCheck(Player* source, Unit* target) OVERRIDE { - Battleground* bg = source->GetBattleground(); - if (!bg) - return false; - - if (bg->GetTypeID(true) != BATTLEGROUND_AV) - return false; - - if (bg->ToBattlegroundAV()->IsAllTowersControlledAndCaptainAlive(source->GetTeam())) - return true; + if (Battleground* bg = source->GetBattleground()) + return bg->CheckAchievementCriteriaMeet(BG_CRITERIA_CHECK_AV_PERFECTION, source, target); return false; } @@ -240,24 +199,12 @@ class achievement_bg_av_perfection : public AchievementCriteriaScript class achievement_bg_sa_defense_of_ancients : public AchievementCriteriaScript { public: - achievement_bg_sa_defense_of_ancients() : AchievementCriteriaScript("achievement_bg_sa_defense_of_ancients") - { - } + achievement_bg_sa_defense_of_ancients() : AchievementCriteriaScript("achievement_bg_sa_defense_of_ancients") { } - bool OnCheck(Player* player, Unit* /*target*/) OVERRIDE + bool OnCheck(Player* source, Unit* target) OVERRIDE { - if (!player) - return false; - - Battleground* battleground = player->GetBattleground(); - if (!battleground) - return false; - - if (player->GetTeamId() == battleground->ToBattlegroundSA()->Attackers) - return false; - - if (!battleground->ToBattlegroundSA()->gateDestroyed) - return true; + if (Battleground* bg = source->GetBattleground()) + return bg->CheckAchievementCriteriaMeet(BG_CRITERIA_CHECK_DEFENSE_OF_THE_ANCIENTS, source, target); return false; } @@ -299,17 +246,10 @@ class achievement_not_even_a_scratch : public AchievementCriteriaScript public: achievement_not_even_a_scratch() : AchievementCriteriaScript("achievement_not_even_a_scratch") { } - bool OnCheck(Player* source, Unit* /*target*/) OVERRIDE + bool OnCheck(Player* source, Unit* target) OVERRIDE { - if (!source) - return false; - - Battleground* battleground = source->GetBattleground(); - if (!battleground) - return false; - - if (battleground->ToBattlegroundSA()->notEvenAScratch(source->GetTeam())) - return true; + if (Battleground* bg = source->GetBattleground()) + return bg->CheckAchievementCriteriaMeet(BG_CRITERIA_CHECK_NOT_EVEN_A_SCRATCH, source, target); return false; } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 6f867a47fc3..b236c277251 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -273,7 +273,7 @@ public: ## npc_lunaclaw_spirit ######*/ -enum +enum LunaclawSpirit { QUEST_BODY_HEART_A = 6001, QUEST_BODY_HEART_H = 6002, |