diff options
38 files changed, 214 insertions, 61 deletions
diff --git a/sql/updates/world/2014_04_19_00_world_misc.sql b/sql/updates/world/2014_04_19_00_world_misc.sql new file mode 100644 index 00000000000..138f0bd8904 --- /dev/null +++ b/sql/updates/world/2014_04_19_00_world_misc.sql @@ -0,0 +1,117 @@ +-- Augmented Arcane Prison +DELETE FROM `gossip_menu_option` WHERE `menu_id` in(9253); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUES +(9253, 0, 0, 'I seem to have lost the Augmented Arcane Prison. Did I leave it here with you?', 25369, 1, 1, 0, 0, 0, 0, '', 0); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN(9253); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, 9253, 0, 0, 0, 8, 0, 11943, 0, 0, 0, 0, 0, '', 'Gossip Option requires The Cell Rewarded'), +(15, 9253, 0, 0, 0, 2, 0, 35671, 1, 0, 1, 0, 0, '', 'Gossip Option requires Player does not Augmented Arcane Prison'), +(15, 9253, 0, 0, 0, 8, 0, 11967, 0, 0, 1, 0, 0, '', 'Gossip Option requires Mustering the Reds not rewarded'); + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN(26117); + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(26117) 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 +(26117,0,0,1,62,0,100,0,9253,0,0,0,85,46764,2,0,0,0,0,7,0,0,0,0,0,0,0,'Raelorasz - On Gossip Option 0 Selected - Invoker cast Push Arcane Prison'), +(26117,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Raelorasz - Link - Close Gossip'); + +-- Spectrecles +DELETE FROM `gossip_menu_option` WHERE `menu_id` in(8383,8392); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUES +(8383, 1, 0, 'Hildagard, I need a new pair of goggles.', 19443, 1, 1, 0, 0, 0, 0, '', 0), -- Spectrecles T2 +(8392, 0, 0, 'Zorus, I need a new pair of goggles.', 19564, 1, 1, 0, 0, 0, 0, '', 0), -- Spectrecles T1 +(8383, 0, 0, 'Hildagard, I need a new pair of goggles.', 19443, 1, 1, 0, 0, 0, 0, '', 0), -- Spectrecles T1 +(8392, 1, 0, 'Zorus, I need a new pair of goggles.', 19564, 1, 1, 0, 0, 0, 0, '', 0); -- Spectrecles T2 + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN(8383,8392); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, 8383, 0, 0, 0, 9, 0, 10625, 0, 0, 0, 0, 0, '', 'Gossip Option requires Spectrecles taken'), +(15, 8392, 0, 0, 0, 9, 0, 10643, 0, 0, 0, 0, 0, '', 'Gossip Option requires Harbringers of Shadowmoon taken'), +(15, 8383, 0, 0, 0, 2, 0, 30719, 1, 0, 1, 0, 0, '', 'Gossip Option requires Player does not have Spectrecles T1'), +(15, 8392, 0, 0, 0, 2, 0, 30719, 1, 0, 1, 0, 0, '', 'Gossip Option requires Player does not have Spectrecles T1'), +(15, 8383, 1, 0, 0, 9, 0, 10633, 0, 0, 0, 0, 0, '', 'Gossip Option requires Teron Gorefiend - Lore and Legend taken'), +(15, 8392, 1, 0, 0, 9, 0, 10644, 0, 0, 0, 0, 0, '', 'Gossip Option requires Teron Gorefiend - Lore and Legend taken'), +(15, 8383, 1, 0, 0, 2, 0, 30721, 1, 0, 1, 0, 0, '', 'Gossip Option requires Player does not have Spectrecles T2'), +(15, 8392, 1, 0, 0, 2, 0, 30721, 1, 0, 1, 0, 0, '', 'Gossip Option requires Player does not have Spectrecles T2'), +(15, 8383, 1, 0, 1, 8, 0, 10633, 0, 0, 0, 0, 0, '', 'Gossip Option requires Teron Gorefiend - Lore and Legend rewarded'), +(15, 8392, 1, 0, 1, 8, 0, 10644, 0, 0, 0, 0, 0, '', 'Gossip Option requires Teron Gorefiend - Lore and Legend rewarded'), +(15, 8383, 1, 0, 1, 2, 0, 30721, 1, 0, 1, 0, 0, '', 'Gossip Option requires Player does not have Spectrecles T2'), +(15, 8392, 1, 0, 1, 2, 0, 30721, 1, 0, 1, 0, 0, '', 'Gossip Option requires Player does not have Spectrecles T2'), +(15, 8383, 1, 0, 2, 28, 0, 10633, 0, 0, 0, 0, 0, '', 'Gossip Option requires Teron Gorefiend - Lore and Legend Complete'), +(15, 8392, 1, 0, 2, 28, 0, 10644, 0, 0, 0, 0, 0, '', 'Gossip Option requires Teron Gorefiend - Lore and Legend Complete'), +(15, 8383, 1, 0, 2, 2, 0, 30721, 1, 0, 1, 0, 0, '', 'Gossip Option requires Player does not have Spectrecles T2'), +(15, 8392, 1, 0, 2, 2, 0, 30721, 1, 0, 1, 0, 0, '', 'Gossip Option requires Player does not have Spectrecles T2'); + +UPDATE creature_template SET AIName='SmartAI' WHERE entry IN(21772,21774); + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(21772,21774) 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 +(21772,0,0,2,62,0,100,0,8383,0,0,0,85,37602,2,0,0,0,0,7,0,0,0,0,0,0,0,'Chief Apothecary Hildagard - On Gossip Option 0 Selected - Invoker cast Replace Lost Spectrecles T1'), +(21772,0,1,2,62,0,100,0,8383,1,0,0,85,37700,2,0,0,0,0,7,0,0,0,0,0,0,0,'Chief Apothecary Hildagard - On Gossip Option 1 Selected - Invoker cast Replace Lost Spectrecles T2'), +(21772,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Chief Apothecary Hildagard - Link - Close Gossip'), +(21774,0,0,2,62,0,100,0,8392,0,0,0,85,37602,2,0,0,0,0,7,0,0,0,0,0,0,0,'Zorus the Judicator - On Gossip Option 0 Selected - Invoker cast Replace Lost Spectrecles T1'), +(21774,0,1,2,62,0,100,0,8392,1,0,0,85,37700,2,0,0,0,0,7,0,0,0,0,0,0,0,'Zorus the Judicator - On Gossip Option 1 Selected - Invoker cast Replace Lost Spectrecles T2'), +(21774,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Zorus the Judicator - Link - Close Gossip'); + +-- Winterhoof Emblem / Westguard Command Insignia +-- Horde +DELETE FROM `gossip_menu_option` WHERE `menu_id` in(8898); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUES +(8898, 0, 0, 'My insignia! Yes. I did lose it. Where did you find it, tauren?', 41971, 1, 1, 0, 0, 0, 0, '', 0); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN(8898); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, 8898, 0, 0, 0, 8, 0, 11256, 0, 0, 0, 0, 0, '', 'Gossip Option requires Skorn Must Fall Rewarded'), +(15, 8898, 0, 0, 0, 8, 0, 11258, 0, 0, 1, 0, 0, '', 'Gossip Option requires Burn, Skorn, Burn not Rewarded'), +(15, 8898, 0, 0, 0, 2, 0, 33340, 1, 0, 1, 0, 0, '', 'Gossip Option requires Player does not Winterhoof Emblem'), +(15, 8898, 0, 0, 1, 8, 0, 11256, 0, 0, 0, 0, 0, '', 'Gossip Option requires Skorn Must Fall Rewarded'), +(15, 8898, 0, 0, 1, 8, 0, 11257, 0, 0, 1, 0, 0, '', 'Gossip Option requires Gruesome but Necessary not Rewarded'), +(15, 8898, 0, 0, 1, 2, 0, 33340, 1, 0, 1, 0, 0, '', 'Gossip Option requires Player does not Winterhoof Emblem'), +(15, 8898, 0, 0, 2, 8, 0, 11256, 0, 0, 0, 0, 0, '', 'Gossip Option requires Skorn Must Fall Rewarded'), +(15, 8898, 0, 0, 2, 8, 0, 11259, 0, 0, 1, 0, 0, '', 'Gossip Option requires Towers of Certain Doom not Rewarded'), +(15, 8898, 0, 0, 2, 2, 0, 33340, 1, 0, 1, 0, 0, '', 'Gossip Option requires Player does not Winterhoof Emblem'), +(15, 8898, 0, 0, 3, 8, 0, 11256, 0, 0, 0, 0, 0, '', 'Gossip Option requires Skorn Must Fall Rewarded'), +(15, 8898, 0, 0, 3, 8, 0, 11261, 0, 0, 1, 0, 0, '', 'Gossip Option requires The Conqueror of Skorn! not Rewarded'), +(15, 8898, 0, 0, 3, 2, 0, 33340, 1, 0, 1, 0, 0, '', 'Gossip Option requires Player does not Winterhoof Emblem'); + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN(24129); + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(24129) 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 +(24129,0,0,1,62,0,100,0,8898,0,0,0,85,43123,2,0,0,0,0,7,0,0,0,0,0,0,0,'Chieftain Ashtotem - On Gossip Option 0 Selected - Invoker cast Skorn Must Fall!: Create Token'), +(24129,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Chieftain Ashtotem - Link - Close Gossip'); + + +-- Alliance Version +-- We must set gossip on Captain Adams as this was missing +UPDATE `creature_template` SET `gossip_menu_id`=8852,`npcflag`=3 WHERE `entry`=23749; +DELETE FROM `gossip_menu` WHERE `entry`=8852; +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES +(8852, 11494); -- 23749 + +DELETE FROM `gossip_menu_option` WHERE `menu_id` in(8852); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUES +(8852, 0, 0, 'Captain, I''ve somehow lost my command insignia.', 22809, 1, 1, 0, 0, 0, 0, '', 0); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN(8852); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, 8852, 0, 0, 0, 8, 0, 11248, 0, 0, 0, 0, 0, '', 'Gossip Option requires Operation: Skornful Wrath Rewarded'), +(15, 8852, 0, 0, 0, 8, 0, 11247, 0, 0, 1, 0, 0, '', 'Gossip Option requires Burn, Skorn, Burn not Rewarded'), +(15, 8852, 0, 0, 0, 2, 0, 33311, 1, 0, 1, 0, 0, '', 'Gossip Option requires Player does not have Westguard Command Insignia'), +(15, 8852, 0, 0, 1, 8, 0, 11248, 0, 0, 0, 0, 0, '', 'Gossip Option requires Operation: Skornful Wrath Rewarded'), +(15, 8852, 0, 0, 1, 8, 0, 11246, 0, 0, 1, 0, 0, '', 'Gossip Option requires Gruesome but Necessary not Rewarded'), +(15, 8852, 0, 0, 1, 2, 0, 33311, 1, 0, 1, 0, 0, '', 'Gossip Option requires Player does not Have Westguard Command Insignia'), +(15, 8852, 0, 0, 2, 8, 0, 11248, 0, 0, 0, 0, 0, '', 'Gossip Option requires Operation: Skornful Wrath Rewarded'), +(15, 8852, 0, 0, 2, 8, 0, 11245, 0, 0, 1, 0, 0, '', 'Gossip Option requires Towers of Certain Doom not Rewarded'), +(15, 8852, 0, 0, 2, 2, 0, 33311, 1, 0, 1, 0, 0, '', 'Gossip Option requires Player does not have Westguard Command Insignia'), +(15, 8852, 0, 0, 3, 8, 0, 11248, 0, 0, 0, 0, 0, '', 'Gossip Option requires Operation: Skornful Wrath'), +(15, 8852, 0, 0, 3, 8, 0, 11250, 0, 0, 1, 0, 0, '', 'Gossip Option requires All Hail the Conqueror of Skorn! not Rewarded'), +(15, 8852, 0, 0, 3, 2, 0, 33311, 1, 0, 1, 0, 0, '', 'Gossip Option requires Player does not have Westguard Command Insignia'); + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN(23749); + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(23749) 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 +(23749,0,0,1,62,0,100,0,8852,0,0,0,85,43122,2,0,0,0,0,7,0,0,0,0,0,0,0,'Captain Adams - On Gossip Option 0 Selected - Invoker cast Operation: Skornful Wrath: Create Insignia'), +(23749,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Captain Adams - Link - Close Gossip'); diff --git a/sql/updates/world/2014_04_19_01_world_quest.sql b/sql/updates/world/2014_04_19_01_world_quest.sql new file mode 100644 index 00000000000..a04b7e7b8b0 --- /dev/null +++ b/sql/updates/world/2014_04_19_01_world_quest.sql @@ -0,0 +1,30 @@ +-- +DELETE FROM `gossip_menu_option` WHERE `menu_id` in(524); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUES +(524, 0, 0, 'Press the red button labeled ''E.C.A.C.''', 3166, 1, 1, 0, 0, 0, 0, NULL, 0), +(524, 1, 0, 'Press the yellow button labeled ''Thieves'' Tools.', 3149, 1, 1, 0, 0, 0, 0, NULL, 0); + +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry` IN (7166,7167); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=7166; +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 +(7166,0,0,1,62,0,100,0,524,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Wrenixs Gizmotronic Apparatus - On Gossip Select - Close gossip'), +(7166,0,1,0,61,0,100,0,0,0,0,0,11,9977,0,0,0,0,0,7,0,0,0,0,0,0,0,'Wrenixs Gizmotronic Apparatus - Cast Conjure E.C.A.C'), +(7166,0,2,3,62,0,100,0,524,1,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Wrenixs Gizmotronic Apparatus - On Gossip Select - Close Gossip'), +(7166,0,3,0,61,0,100,0,0,0,0,0,11,9949,1,0,0,0,0,7,0,0,0,0,0,0,0,'Wrenixs Gizmotronic Apparatus - Cast Thieves Tool Rack Conjure'); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=7167; +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 +(7167,0,0,0,1,0,100,1,73000,73000,60000,60000,11,8822,0,0,0,0,0,1,0,0,0,0,0,0,0,'Polly - OOC - Cast Stealth'), +(7167,0,1,0,8,0,100,0,9976,0,0,0,36,7168,0,0,0,0,0,1,0,0,0,0,0,0,0,'Polly - On Spell Hit Polly Eats the E.C.A.C - Change Entry to Polly JR '); + +DELETE FROM `creature_loot_template` WHERE `entry`=7168 AND `item`=7968; +INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES +(7168, 7968, 100, 1, 0, 1, 1); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=524 AND `SourceEntry` IN (0,1); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,524,0,0,0,9,0,2381,0,0,0,0,'','Wrenixs Gizmotronic Apparatus - Show gossip option only if player has taken quest Plundering the Plunderers'), +(15,524,1,0,0,9,0,2381,0,0,0,0,'','Wrenixs Gizmotronic Apparatus - Show gossip option only if player has taken quest Plundering the Plunderers'), +(15,524,0,0,0,2,0,7970,1,0,1,0,'','Wrenixs Gizmotronic Apparatus - Show gossip option only if player Does not have E.C.A.C'), +(15,524,1,0,0,2,0,5060,1,0,1,0,'','Wrenixs Gizmotronic Apparatus - Show gossip option only if player Does not have Thieves Tools'); diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp index 943919451a9..32b229a5ea8 100644 --- a/src/server/game/AI/CoreAI/CombatAI.cpp +++ b/src/server/game/AI/CoreAI/CombatAI.cpp @@ -151,7 +151,7 @@ void CasterAI::UpdateAI(uint32 diff) events.Update(diff); - if (me->GetVictim()->HasBreakableByDamageCrowdControlAura(me)) + if (me->EnsureVictim()->HasBreakableByDamageCrowdControlAura(me)) { me->InterruptNonMeleeSpells(false); return; diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index d6e749b942a..e2eeaf880ad 100644 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -86,10 +86,10 @@ void PetAI::UpdateAI(uint32 diff) else m_updateAlliesTimer -= diff; - if (me->GetVictim() && me->GetVictim()->IsAlive()) + if (me->GetVictim() && me->EnsureVictim()->IsAlive()) { // is only necessary to stop casting, the pet must not exit combat - if (me->GetVictim()->HasBreakableByDamageCrowdControlAura(me)) + if (me->EnsureVictim()->HasBreakableByDamageCrowdControlAura(me)) { me->InterruptNonMeleeSpells(false); return; @@ -345,7 +345,7 @@ void PetAI::OwnerAttackedBy(Unit* attacker) return; // Prevent pet from disengaging from current target - if (me->GetVictim() && me->GetVictim()->IsAlive()) + if (me->GetVictim() && me->EnsureVictim()->IsAlive()) return; // Continue to evaluate and attack if necessary @@ -366,7 +366,7 @@ void PetAI::OwnerAttacked(Unit* target) return; // Prevent pet from disengaging from current target - if (me->GetVictim() && me->GetVictim()->IsAlive()) + if (me->GetVictim() && me->EnsureVictim()->IsAlive()) return; // Continue to evaluate and attack if necessary @@ -627,7 +627,7 @@ void PetAI::AttackedBy(Unit* attacker) return; // Prevent pet from disengaging from current target - if (me->GetVictim() && me->GetVictim()->IsAlive()) + if (me->GetVictim() && me->EnsureVictim()->IsAlive()) return; // Continue to evaluate and attack if necessary diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index dcf5bd56fa6..43596ffb4cb 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -77,7 +77,7 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* who) return false; //not a player - if (!who->GetVictim()->GetCharmerOrOwnerPlayerOrPlayerItself()) + if (!who->EnsureVictim()->GetCharmerOrOwnerPlayerOrPlayerItself()) return false; //never attack friendly diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index 0fbfc2cebac..df6bee51642 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -74,7 +74,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* who) return false; //not a player - if (!who->GetVictim()->GetCharmerOrOwnerPlayerOrPlayerItself()) + if (!who->EnsureVictim()->GetCharmerOrOwnerPlayerOrPlayerItself()) return false; //never attack friendly diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 23dea877776..3b055cabbfa 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -499,7 +499,7 @@ bool SmartAI::AssistPlayerInCombat(Unit* who) return false; //not a player - if (!who->GetVictim()->GetCharmerOrOwnerPlayerOrPlayerItself()) + if (!who->EnsureVictim()->GetCharmerOrOwnerPlayerOrPlayerItself()) return false; //never attack friendly diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 006ee4b69ad..d2562459522 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -2690,9 +2690,9 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui } case SMART_EVENT_TARGET_HEALTH_PCT: { - if (!me || !me->IsInCombat() || !me->GetVictim() || !me->GetVictim()->GetMaxHealth()) + if (!me || !me->IsInCombat() || !me->GetVictim() || !me->EnsureVictim()->GetMaxHealth()) return; - uint32 perc = (uint32)me->GetVictim()->GetHealthPct(); + uint32 perc = (uint32)me->EnsureVictim()->GetHealthPct(); if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) return; ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->GetVictim()); @@ -2710,9 +2710,9 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui } case SMART_EVENT_TARGET_MANA_PCT: { - if (!me || !me->IsInCombat() || !me->GetVictim() || !me->GetVictim()->GetMaxPower(POWER_MANA)) + if (!me || !me->IsInCombat() || !me->GetVictim() || !me->EnsureVictim()->GetMaxPower(POWER_MANA)) return; - uint32 perc = uint32(100.0f * me->GetVictim()->GetPower(POWER_MANA) / me->GetVictim()->GetMaxPower(POWER_MANA)); + uint32 perc = uint32(100.0f * me->EnsureVictim()->GetPower(POWER_MANA) / me->EnsureVictim()->GetMaxPower(POWER_MANA)); if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) return; ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->GetVictim()); @@ -2792,7 +2792,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui { if (!me || !me->GetVictim()) return; - uint32 count = me->GetVictim()->GetAuraCount(e.event.aura.spell); + uint32 count = me->EnsureVictim()->GetAuraCount(e.event.aura.spell); if (count < e.event.aura.count) return; ProcessTimedAction(e, e.event.aura.repeatMin, e.event.aura.repeatMax); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 40a09114935..926527e2bd9 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -563,8 +563,8 @@ void Creature::Update(uint32 diff) break; bool bInCombat = IsInCombat() && (!GetVictim() || // if IsInCombat() is true and this has no victim - !GetVictim()->GetCharmerOrOwnerPlayerOrPlayerItself() || // or the victim/owner/charmer is not a player - !GetVictim()->GetCharmerOrOwnerPlayerOrPlayerItself()->IsGameMaster()); // or the victim/owner/charmer is not a GameMaster + !EnsureVictim()->GetCharmerOrOwnerPlayerOrPlayerItself() || // or the victim/owner/charmer is not a player + !EnsureVictim()->GetCharmerOrOwnerPlayerOrPlayerItself()->IsGameMaster()); // or the victim/owner/charmer is not a GameMaster /*if (m_regenTimer <= diff) {*/ @@ -691,7 +691,7 @@ void Creature::DoFleeToGetAssistance() UpdateSpeed(MOVE_RUN, false); if (!creature) - //SetFeared(true, GetVictim()->GetGUID(), 0, sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY)); + //SetFeared(true, EnsureVictim()->GetGUID(), 0, sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY)); /// @todo use 31365 SetControlled(true, UNIT_STATE_FLEEING); else @@ -1852,7 +1852,7 @@ void Creature::CallAssistance() if (!assistList.empty()) { - AssistDelayEvent* e = new AssistDelayEvent(GetVictim()->GetGUID(), *this); + AssistDelayEvent* e = new AssistDelayEvent(EnsureVictim()->GetGUID(), *this); while (!assistList.empty()) { // Pushing guids because in delay can happen some creature gets despawned => invalid pointer diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a00a9596f91..6b017d8dc9d 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13894,7 +13894,7 @@ void Unit::SetStunned(bool apply) else { if (IsAlive() && GetVictim()) - SetTarget(GetVictim()->GetGUID()); + SetTarget(EnsureVictim()->GetGUID()); // don't remove UNIT_FLAG_STUNNED for pet when owner is mounted (disabled pet's interface) Unit* owner = GetOwner(); @@ -13949,7 +13949,7 @@ void Unit::SetFeared(bool apply) if (GetMotionMaster()->GetCurrentMovementGeneratorType() == FLEEING_MOTION_TYPE) GetMotionMaster()->MovementExpired(); if (GetVictim()) - SetTarget(GetVictim()->GetGUID()); + SetTarget(EnsureVictim()->GetGUID()); } } @@ -13971,7 +13971,7 @@ void Unit::SetConfused(bool apply) if (GetMotionMaster()->GetCurrentMovementGeneratorType() == CONFUSED_MOTION_TYPE) GetMotionMaster()->MovementExpired(); if (GetVictim()) - SetTarget(GetVictim()->GetGUID()); + SetTarget(EnsureVictim()->GetGUID()); } } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 0225975223a..886295d1f1d 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1345,6 +1345,12 @@ class Unit : public WorldObject AttackerSet const& getAttackers() const { return m_attackers; } bool isAttackingPlayer() const; Unit* GetVictim() const { return m_attacking; } + // Use this only when 100% sure there is a victim + Unit* EnsureVictim() const + { + ASSERT(m_attacking); + return m_attacking; + } void CombatStop(bool includingCast = false); void CombatStopWithPets(bool includingCast = false); diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index 61f3a04bc5d..2ab408965c1 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -118,7 +118,7 @@ void ConfusedMovementGenerator<Creature>::DoFinalize(Creature* unit) unit->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); unit->ClearUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_CONFUSED_MOVE); if (unit->GetVictim()) - unit->SetTarget(unit->GetVictim()->GetGUID()); + unit->SetTarget(unit->EnsureVictim()->GetGUID()); } template void ConfusedMovementGenerator<Player>::DoInitialize(Player*); diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp index 572d65b07c7..a34d09c3721 100644 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp @@ -141,7 +141,7 @@ void FleeingMovementGenerator<Creature>::DoFinalize(Creature* owner) owner->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING); owner->ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE); if (owner->GetVictim()) - owner->SetTarget(owner->GetVictim()->GetGUID()); + owner->SetTarget(owner->EnsureVictim()->GetGUID()); } template<class T> diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index b958adb0d6d..a4210d2dad5 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5338,12 +5338,12 @@ void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const { // Feeding Frenzy Rank 1 case 53511: - if (target->GetVictim() && target->GetVictim()->HealthBelowPct(35)) + if (target->GetVictim() && target->EnsureVictim()->HealthBelowPct(35)) target->CastSpell(target, 60096, true, 0, this); return; // Feeding Frenzy Rank 2 case 53512: - if (target->GetVictim() && target->GetVictim()->HealthBelowPct(35)) + if (target->GetVictim() && target->EnsureVictim()->HealthBelowPct(35)) target->CastSpell(target, 60097, true, 0, this); return; default: diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp index b1bc34b0437..eda2dbbcdaa 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp @@ -138,7 +138,7 @@ public: break; case EVENT_CONFLAGRATION: DoCastVictim(SPELL_CONFLAGRATION); - if (me->GetVictim() && me->GetVictim()->HasAura(SPELL_CONFLAGRATION)) + if (me->GetVictim() && me->EnsureVictim()->HasAura(SPELL_CONFLAGRATION)) if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true)) me->TauntApply(target); events.ScheduleEvent(EVENT_CONFLAGRATION, 30000); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp index 71c4a7469d9..6a2d76764be 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp @@ -200,7 +200,7 @@ public: break; case EVENT_BURNINGADRENALINE_TANK: // have the victim cast the spell on himself otherwise the third effect aura will be applied to Vael instead of the player - me->GetVictim()->CastSpell(me->GetVictim(), SPELL_BURNINGADRENALINE, true); + me->EnsureVictim()->CastSpell(me->GetVictim(), SPELL_BURNINGADRENALINE, true); events.ScheduleEvent(EVENT_BURNINGADRENALINE_TANK, 45000); break; } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp index 14cc3083d59..0387d7b776b 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp @@ -191,7 +191,7 @@ public: if (pAttumen->GetVictim()) { pAttumen->GetMotionMaster()->MoveChase(pAttumen->GetVictim()); - pAttumen->SetTarget(pAttumen->GetVictim()->GetGUID()); + pAttumen->SetTarget(pAttumen->EnsureVictim()->GetGUID()); } pAttumen->SetObjectScale(1); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index bde326a5c37..209154ec5f9 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -391,8 +391,8 @@ public: if (me->HasUnitState(UNIT_STATE_STUNNED)) // While shifting to phase 2 malchezaar stuns himself return; - if (me->GetUInt64Value(UNIT_FIELD_TARGET) != me->GetVictim()->GetGUID()) - me->SetTarget(me->GetVictim()->GetGUID()); + if (me->GetUInt64Value(UNIT_FIELD_TARGET) != me->EnsureVictim()->GetGUID()) + me->SetTarget(me->EnsureVictim()->GetGUID()); if (phase == 1) { diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 96386462c44..1bba7f02828 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -484,10 +484,10 @@ public: EnterEvadeMode(); return; } - else if (me->GetVictim()->GetTypeId() == TYPEID_PLAYER && me->GetVictim()->HealthBelowPct(10)) + else if (me->EnsureVictim()->GetTypeId() == TYPEID_PLAYER && me->EnsureVictim()->HealthBelowPct(10)) { - me->GetVictim()->CastSpell(me->GetVictim(), 7267, true); // beg - me->GetVictim()->RemoveGameObject(SPELL_DUEL_FLAG, true); + me->EnsureVictim()->CastSpell(me->GetVictim(), 7267, true); // beg + me->EnsureVictim()->RemoveGameObject(SPELL_DUEL_FLAG, true); EnterEvadeMode(); return; } @@ -837,7 +837,7 @@ public: //ScriptedAI::UpdateAI(diff); //Check if we have a current target - if (me->GetVictim()->GetEntry() == NPC_GHOSTS) + if (me->EnsureVictim()->GetEntry() == NPC_GHOSTS) { if (me->isAttackReady()) { diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index 46bd5bcbfdc..a03455f6213 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -298,7 +298,7 @@ public: Unit* target = (*itr)->getTarget(); if (target && target->GetTypeId() == TYPEID_PLAYER - && target->GetGUID() != me->GetVictim()->GetGUID() + && target->GetGUID() != me->EnsureVictim()->GetGUID() && target->GetPositionZ() > me->GetPositionZ() - 5 && !target->HasAura(AURA_SPECTRAL_EXHAUSTION)) { diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index e8b112aa1cd..5a2c23d1c0f 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -1255,7 +1255,7 @@ public: if ((victimClass == 0) && me->GetVictim()) { - victimClass = me->GetVictim()->getClass(); + victimClass = me->EnsureVictim()->getClass(); switch (victimClass) { case CLASS_DRUID: diff --git a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp index 6cfef015450..8dd8d8a2c65 100644 --- a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp +++ b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp @@ -100,7 +100,7 @@ public: if (me->IsInCombat() && me->GetVictim()) { - if (Player* player = me->GetVictim()->ToPlayer()) + if (Player* player = me->EnsureVictim()->ToPlayer()) { if (player->GetTeam() == HORDE) { diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index cbace6df028..bfe4db137f3 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -1351,7 +1351,7 @@ public: if (MoveTimer <= diff) { float x, y, z; - me->GetVictim()->GetPosition(x, y, z); + me->EnsureVictim()->GetPosition(x, y, z); me->GetMotionMaster()->MovePoint(0, x, y, z+Zpos); Zpos -= 1.0f; if (Zpos <= 0) diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp index a12a400ea8e..0af42f5af20 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp @@ -157,7 +157,7 @@ class boss_ayamiss : public CreatureScript SetCombatMovement(true); me->SetCanFly(false); Position VictimPos; - me->GetVictim()->GetPosition(&VictimPos); + me->EnsureVictim()->GetPosition(&VictimPos); me->GetMotionMaster()->MovePoint(POINT_GROUND, VictimPos); DoResetThreat(); events.ScheduleEvent(EVENT_LASH, urand(5000, 8000)); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp index 44c70075a94..7038dd0df46 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp @@ -272,7 +272,7 @@ class npc_glob_of_viscidus : public CreatureScript if (Viscidus->IsAlive() && Viscidus->GetHealthPct() < 5.0f) { Viscidus->SetVisible(true); - Viscidus->GetVictim()->Kill(Viscidus); + Viscidus->EnsureVictim()->Kill(Viscidus); } else { diff --git a/src/server/scripts/Kalimdor/zone_tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp index 3269bfb77db..d73c73cc2fa 100644 --- a/src/server/scripts/Kalimdor/zone_tanaris.cpp +++ b/src/server/scripts/Kalimdor/zone_tanaris.cpp @@ -120,7 +120,7 @@ public: { if (SendItemTimer <= diff) { - if (me->GetVictim()->GetTypeId() == TYPEID_PLAYER) + if (me->EnsureVictim()->GetTypeId() == TYPEID_PLAYER) SendItem(me->GetVictim()); SendItemTimer = 5000; } else SendItemTimer -= diff; diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index ee27a1524f0..ef96526aa16 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -198,8 +198,8 @@ uint8 const MAX_CORPOREALITY_STATE = 11; struct CorporealityEntry { - uint32 materialRealmSpell; uint32 twilightRealmSpell; + uint32 materialRealmSpell; }; CorporealityEntry const _corporealityReference[MAX_CORPOREALITY_STATE] = { diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index bbf3e8afc0f..197a4fc5414 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -374,7 +374,7 @@ class boss_blood_queen_lana_thel : public CreatureScript // both spells have SPELL_ATTR5_SINGLE_TARGET_SPELL, no manual removal needed newOfftank->CastSpell(me->GetVictim(), SPELL_BLOOD_MIRROR_DAMAGE, true); - me->GetVictim()->CastSpell(newOfftank, SPELL_BLOOD_MIRROR_DUMMY, true); + me->EnsureVictim()->CastSpell(newOfftank, SPELL_BLOOD_MIRROR_DUMMY, true); DoCastVictim(SPELL_BLOOD_MIRROR_VISUAL); if (Is25ManRaid() && newOfftank->GetQuestStatus(QUEST_BLOOD_INFUSION) == QUEST_STATUS_INCOMPLETE && newOfftank->HasAura(SPELL_UNSATED_CRAVING) && !newOfftank->HasAura(SPELL_THIRST_QUENCHED) && diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index bcb6d746622..10db26ccd0c 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -890,7 +890,7 @@ class npc_darnavan : public CreatureScript if (me->HasUnitState(UNIT_STATE_CASTING)) return; - if (_canShatter && me->GetVictim() && me->GetVictim()->IsImmunedToDamage(SPELL_SCHOOL_MASK_NORMAL)) + if (_canShatter && me->GetVictim() && me->EnsureVictim()->IsImmunedToDamage(SPELL_SCHOOL_MASK_NORMAL)) { DoCastVictim(SPELL_SHATTERING_THROW); _canShatter = false; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp index d33d218fab9..e586feb1070 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp @@ -136,7 +136,7 @@ public: } } - if (me->GetVictim() && me->GetVictim()->GetEntry() == NPC_ZOMBIE) + if (me->GetVictim() && me->EnsureVictim()->GetEntry() == NPC_ZOMBIE) { if (me->IsWithinMeleeRange(me->GetVictim())) { diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp index 8cc198a0d84..2803cccead3 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp @@ -231,7 +231,7 @@ class boss_urom : public CreatureScript if (arcaneExplosionTimer <= diff) { Position pos; - me->GetVictim()->GetPosition(&pos); + me->EnsureVictim()->GetPosition(&pos); me->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation()); me->GetMotionMaster()->MoveChase(me->GetVictim()); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index 578a51fa1f8..c199fe9e9e3 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -199,10 +199,10 @@ class npc_flash_freeze : public CreatureScript void UpdateAI(uint32 diff) OVERRIDE { - if (!UpdateVictim() || me->GetVictim()->HasAura(SPELL_BLOCK_OF_ICE) || me->GetVictim()->HasAura(SPELL_FLASH_FREEZE_HELPER)) + if (!UpdateVictim() || me->EnsureVictim()->HasAura(SPELL_BLOCK_OF_ICE) || me->EnsureVictim()->HasAura(SPELL_FLASH_FREEZE_HELPER)) return; - if (me->GetVictim()->GetGUID() != targetGUID || instance->GetBossState(BOSS_HODIR) != IN_PROGRESS) + if (me->EnsureVictim()->GetGUID() != targetGUID || instance->GetBossState(BOSS_HODIR) != IN_PROGRESS) me->DespawnOrUnsummon(); if (checkDespawnTimer <= diff) diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index d74aecb9b25..957471216d8 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -2077,12 +2077,12 @@ public: if (!UpdateVictim()) return; - if (me->GetVictim()->GetTypeId() != TYPEID_PLAYER) + if (me->EnsureVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players. - if (!me->GetVictim()->HasAura(SPELL_PARALYZE)) + if (!me->EnsureVictim()->HasAura(SPELL_PARALYZE)) { - TargetGUID = me->GetVictim()->GetGUID(); + TargetGUID = me->EnsureVictim()->GetGUID(); me->AddThreat(me->GetVictim(), 10000000.0f); DoCastVictim(SPELL_PURPLE_BEAM, true); DoCastVictim(SPELL_PARALYZE, true); @@ -2154,8 +2154,8 @@ public: { if (me->isAttackReady() && me->IsWithinMeleeRange(me->GetVictim())) { - if (!me->GetVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND) - && !me->GetVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2)) + if (!me->EnsureVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND) + && !me->EnsureVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2)) { if (Creature* illidan = Unit::GetCreature((*me), IllidanGUID))// summon only in 1. phase if (CAST_AI(boss_illidan_stormrage::boss_illidan_stormrageAI, illidan->AI())->Phase == PHASE_NORMAL) diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp index d92d8aaf5db..d86d94088da 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -673,17 +673,17 @@ public: if (!CheckedAggro) { - AggroTargetGUID = me->GetVictim()->GetGUID(); + AggroTargetGUID = me->EnsureVictim()->GetGUID(); CheckedAggro = true; } if (CheckTankTimer <= diff) { - if (me->GetVictim()->GetGUID() != AggroTargetGUID) + if (me->EnsureVictim()->GetGUID() != AggroTargetGUID) { Talk(ANGER_SAY_BEFORE); DoCast(me, SPELL_SELF_SEETHE, true); - AggroTargetGUID = me->GetVictim()->GetGUID(); + AggroTargetGUID = me->EnsureVictim()->GetGUID(); } CheckTankTimer = 2000; } else CheckTankTimer -= diff; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index 9055bb1862d..490bfaa16fc 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -626,7 +626,7 @@ public: { DoCastVictim(SPELL_TIDAL_SURGE); // Hacky way to do it - won't trigger elseways - me->GetVictim()->CastSpell(me->GetVictim(), SPELL_TIDAL_SURGE_FREEZE, true); + me->EnsureVictim()->CastSpell(me->GetVictim(), SPELL_TIDAL_SURGE_FREEZE, true); TidalSurge_Timer = 15000+rand()%5000; } else TidalSurge_Timer -= diff; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp index f9370b44c20..73da4f62a23 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp @@ -138,7 +138,7 @@ public: if (!UpdateVictim()) return; - if (me->GetVictim()->GetGUID() != victimGUID) + if (me->EnsureVictim()->GetGUID() != victimGUID) { DoModifyThreatPercent(me->GetVictim(), -100); Unit* owner = Unit::GetUnit(*me, victimGUID); @@ -519,7 +519,7 @@ public: for (ThreatContainer::StorageType::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr) { Unit* tempTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()); - if (tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != me->GetVictim()->GetGUID() && TargetList.size()<5) + if (tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != me->EnsureVictim()->GetGUID() && TargetList.size()<5) TargetList.push_back(tempTarget); } //SpellInfo* spell = GET_SPELL(SPELL_INSIDIOUS_WHISPER); diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp index 7b83fa7009d..500bcd1ed8f 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp @@ -115,7 +115,7 @@ class npc_warp_splinter_treant : public CreatureScript return; } - if (me->GetVictim()->GetGUID() != WarpGuid) + if (me->EnsureVictim()->GetGUID() != WarpGuid) DoMeleeAttackIfReady(); } }; diff --git a/src/server/scripts/Pet/pet_hunter.cpp b/src/server/scripts/Pet/pet_hunter.cpp index 8a0b78b5478..c8dfc582bb7 100644 --- a/src/server/scripts/Pet/pet_hunter.cpp +++ b/src/server/scripts/Pet/pet_hunter.cpp @@ -96,7 +96,7 @@ class npc_pet_hunter_snake_trap : public CreatureScript if (!UpdateVictim()) return; - if (me->GetVictim()->HasBreakableByDamageCrowdControlAura(me)) + if (me->EnsureVictim()->HasBreakableByDamageCrowdControlAura(me)) { me->InterruptNonMeleeSpells(false); return; |
