diff options
-rw-r--r-- | sql/updates/world/2012_06_14_09_world_sai.sql | 45 | ||||
-rw-r--r-- | sql/updates/world/2012_06_14_10_world_eai.sql | 2 | ||||
-rw-r--r-- | sql/updates/world/2012_06_14_11_world_sai.sql | 48 | ||||
-rw-r--r-- | sql/updates/world/2012_06_15_00_world_spell_script_names.sql | 3 | ||||
-rw-r--r-- | src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp | 44 | ||||
-rwxr-xr-x | src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp | 84 | ||||
-rw-r--r-- | src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp | 4 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_druid.cpp | 49 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 29 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 11 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_pet.cpp | 178 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_priest.cpp | 4 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_shaman.cpp | 10 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_warlock.cpp | 6 |
14 files changed, 257 insertions, 260 deletions
diff --git a/sql/updates/world/2012_06_14_09_world_sai.sql b/sql/updates/world/2012_06_14_09_world_sai.sql new file mode 100644 index 00000000000..3beb7c06326 --- /dev/null +++ b/sql/updates/world/2012_06_14_09_world_sai.sql @@ -0,0 +1,45 @@ +-- Fix up quest 9539 "Totem of Coo" +-- Totem of Akida SAI +SET @ENTRY := 17360; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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 +(@ENTRY,0,0,0,19,0,100,0,9539,0,0,0,85,30437,0,0,0,0,0,7,0,0,0,0,0,0,0,'Totem of Akida - Quest accepted - Cast Spell on player'); +-- Stillpine Ancestor Akida SAI +SET @ENTRY := 17379; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY*100) AND `source_type`=9; +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 +(@ENTRY,0,0,0,54,0,100,0,0,1,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Just Summoned - Run Script'), +-- Script +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,3,0,16995,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - set model'), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - turn to player'), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,11,25035,0,0,0,0,0,1,0,0,0,0,0,0,0.01745319,'Stillpine Ancestor Akida - Script - Cast Spell'), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - Set run on'), +(@ENTRY*100,9,4,0,0,0,100,0,4000,4000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - say 0'), +(@ENTRY*100,9,5,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-4154.224,-12514.75,45.35527,0,'Stillpine Ancestor Akida - Script - move to'), +(@ENTRY*100,9,6,0,0,0,100,0,2000,2000,0,0,69,0,0,0,0,0,0,8,0,0,0,-4123.563,-12517.23,44.9127,0,'Stillpine Ancestor Akida - Script - move to'), +(@ENTRY*100,9,7,0,0,0,100,0,3500,3500,0,0,69,0,0,0,0,0,0,8,0,0,0,-4091.881,-12524,42.37354,0,'Stillpine Ancestor Akida - Script - move to'), +(@ENTRY*100,9,8,0,0,0,100,0,5500,5500,0,0,69,0,0,0,0,0,0,8,0,0,0,-4058.039,-12538.57,43.96096,0,'Stillpine Ancestor Akida - Script - move to'), +(@ENTRY*100,9,9,0,0,0,100,0,4500,4500,0,0,69,0,0,0,0,0,0,8,0,0,0,-4026.534,-12568.4,45.82222,0,'Stillpine Ancestor Akida - Script - move to'), +(@ENTRY*100,9,10,0,0,0,100,0,3000,3000,0,0,69,0,0,0,0,0,0,8,0,0,0,-4000.155,-12598.55,54.19722,0,'Stillpine Ancestor Akida - Script - move to'), -- +(@ENTRY*100,9,11,0,0,0,100,0,7500,7500,0,0,69,0,0,0,0,0,0,8,0,0,0,-3977.5,-12627.22,63.1442,0,'Stillpine Ancestor Akida - Script - move to'), +(@ENTRY*100,9,12,0,0,0,100,0,3500,3500,0,0,69,0,0,0,0,0,0,8,0,0,0,-3952.254,-12660.37,74.23783,0,'Stillpine Ancestor Akida - Script - move to'), +(@ENTRY*100,9,13,0,0,0,100,0,6500,6500,0,0,69,0,0,0,0,0,0,8,0,0,0,-3933.183,-12698.27,85.65151,0,'Stillpine Ancestor Akida - Script - move to'), +(@ENTRY*100,9,14,0,0,0,100,0,4500,4500,0,0,69,0,0,0,0,0,0,8,0,0,0,-3925.843,-12718.81,89.94553,0,'Stillpine Ancestor Akida - Script - move to'), -- +(@ENTRY*100,9,15,0,0,0,100,0,3500,3500,0,0,69,0,0,0,0,0,0,8,0,0,0,-3915.914,-12743.41,98.56779,0,'Stillpine Ancestor Akida - Script - move to'), +(@ENTRY*100,9,16,0,0,0,100,0,4500,4500,0,0,66,0,0,0,0,0,0,19,17361,10,0,0,0,0,0,'Stillpine Ancestor Akida - Script - turn to Totem of Coo'), +(@ENTRY*100,9,17,0,0,0,100,0,2000,2000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - say 1'), +(@ENTRY*100,9,18,0,0,0,100,0,3000,3000,0,0,11,30428,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - cast spell'), +(@ENTRY*100,9,19,0,0,0,100,0,1000,1000,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Akida - Script - despawn'); +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry`=17379; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(17379,0,0, '%s urges you to follow him.',16,0,100,0,0,0, 'Stillpine Ancestor Akida'), +(17379,1,0, '%s points to the totem of Coo.',16,0,100,25,0,0, 'Stillpine Ancestor Akida'); +-- add missing spells to db +DELETE FROM `spell_dbc` WHERE `Id` IN (30426,30437); +INSERT INTO `spell_dbc` (`Id`,`SchoolMask`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`Comment`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`AreaGroupId`,`EffectMiscValueB1`) VALUES +(30426,0,0,0,256,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,40,12,0,-1,0,0,28,6,0,0,0,0,0,0,0,0,0,0,0,0,0,32,1,0,0,0,0,15,0,0,0,4,0,0,0,0,0,0,0,17379,0,0,0,0,0,'Stillpine Ancestor Akida',0,0,0,0,0,0,0,1,1,0,64), +(30437,0,0,0,2304,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,36,3,0,-1,0,0,6,0,0,1,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,23,0,0,1000,0,0,0,0,0,0,0,0,30426,0,0,'Stillpine Ancestor Akida TRIGGER',0,0,0,0,0,0,0,1,0,0,0); diff --git a/sql/updates/world/2012_06_14_10_world_eai.sql b/sql/updates/world/2012_06_14_10_world_eai.sql new file mode 100644 index 00000000000..355646fbd69 --- /dev/null +++ b/sql/updates/world/2012_06_14_10_world_eai.sql @@ -0,0 +1,2 @@ +-- Remove Stillpine Ancestor Akida EAI +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=17379; diff --git a/sql/updates/world/2012_06_14_11_world_sai.sql b/sql/updates/world/2012_06_14_11_world_sai.sql new file mode 100644 index 00000000000..1d01b02f86b --- /dev/null +++ b/sql/updates/world/2012_06_14_11_world_sai.sql @@ -0,0 +1,48 @@ +-- Fix up quest 9540 "Totem of Tikti" +-- Totem of Coo SAI +SET @ENTRY := 17361; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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 +(@ENTRY,0,0,0,19,0,100,0,9540,0,0,0,85,30442,0,0,0,0,0,7,0,0,0,0,0,0,0,'Totem of Coo - Quest accepted - Cast Spell on player'); +-- Stillpine Ancestor Coo SAI +SET @ENTRY := 17391; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY*100) AND `source_type`=9; +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 +(@ENTRY,0,0,0,54,0,100,0,0,1,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Just Summoned - Run Script'), +-- Script +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,3,0,16995,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - set model'), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - turn to player'), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,11,25035,0,0,0,0,0,1,0,0,0,0,0,0,0.01745319,'Stillpine Ancestor Coo - Script - Cast Spell'), +(@ENTRY*100,9,3,0,0,0,100,0,3000,3000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - say 0'), +(@ENTRY*100,9,4,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-3926.039,-12746.71,96.06779,0,'Stillpine Ancestor Coo - Script - move to'), +(@ENTRY*100,9,5,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-3926.326,-12753.71,98.44279,0,'Stillpine Ancestor Coo - Script - move to'), +(@ENTRY*100,9,6,0,0,0,100,0,2000,2000,0,0,69,0,0,0,0,0,0,8,0,0,0,-3924.268,-12761.45,101.6928,0,'Stillpine Ancestor Coo - Script - move to'), +(@ENTRY*100,9,7,0,0,0,100,0,6000,6000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - say 1'), +(@ENTRY*100,9,8,0,0,0,100,0,4000,4000,0,0,11,30424,0,0,0,0,0,7,0,0,0,0,0,0,0.01745319,'Stillpine Ancestor Coo - Script - Cast Spell'), +(@ENTRY*100,9,9,0,0,0,100,0,1000,1000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - say 2'), +(@ENTRY*100,9,10,0,0,0,100,0,4000,4000,0,0,11,30473,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - cast spell'), +(@ENTRY*100,9,11,0,0,0,100,0,0,0,0,0,3,0,17019,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - set model'), +(@ENTRY*100,9,12,0,0,0,100,0,3000,3000,0,0,60,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - Fly on'), +(@ENTRY*100,9,13,0,0,0,100,0,0,0,0,0,69,0,0,0,0,0,0,8,0,0,0,-3926.068,-12767.33,104.3799,0,'Stillpine Ancestor Coo - Script - move to'), +(@ENTRY*100,9,14,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-3923.497,-12794.98,98.46323,0,'Stillpine Ancestor Coo - Script - move to'), +(@ENTRY*100,9,15,0,0,0,100,0,4000,4000,0,0,69,0,0,0,0,0,0,8,0,0,0,-3922.687,-12832.4,89.24097,0,'Stillpine Ancestor Coo - Script - move to'), +(@ENTRY*100,9,16,0,0,0,100,0,8000,8000,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stillpine Ancestor Coo - Script - despawn'); +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry`=17391; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(17391,0,0, '%s motions for you to follow him.',16,0,100,0,0,0, 'Stillpine Ancestor Coo'), +(17391,1,0, '[Furbolg] Ritk kin''chikx azul azure summit...',12,0,100,0,0,0, 'Stillpine Ancestor Coo'), +(17391,2,0, '[Furbolg] Coo xip fly... Jump ilos river. Find Tikti.',12,0,100,0,0,0, 'Stillpine Ancestor Coo'); +-- add missing spells to db +DELETE FROM `spell_dbc` WHERE `Id` IN (30429,30442); +INSERT INTO `spell_dbc` (`Id`,`SchoolMask`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`Comment`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`AreaGroupId`,`EffectMiscValueB1`) VALUES +(30429,0,0,0,256,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,40,12,0,-1,0,0,28,6,0,0,0,0,0,0,0,0,0,0,0,0,0,32,1,0,0,0,0,7,0,0,0,4,0,0,0,0,0,0,0,17391,0,0,0,0,0,'Stillpine Ancestor Coo',0,0,0,0,0,0,0,1,1,0,64), +(30442,0,0,0,2304,268435456,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,36,3,0,-1,0,0,6,0,0,1,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,23,0,0,1000,0,0,0,0,0,0,0,0,30429,0,0,'Stillpine Ancestor Coo TRIGGER',0,0,0,0,0,0,0,1,0,0,0); +-- Delete bad spawn of Stillpine Ancestor Coo +DELETE FROM `creature` WHERE `guid`=86512; +DELETE FROM `creature_addon` WHERE `guid`=86512; +-- Remove Stillpine Ancestor Akida EAI +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=17391; diff --git a/sql/updates/world/2012_06_15_00_world_spell_script_names.sql b/sql/updates/world/2012_06_15_00_world_spell_script_names.sql new file mode 100644 index 00000000000..040ad3c87ba --- /dev/null +++ b/sql/updates/world/2012_06_15_00_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` = 27819; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(27819, 'spell_kelthuzad_detonate_mana'); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 9baf6ba7a00..fdc9a6a21d6 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -200,7 +200,7 @@ class boss_sindragosa : public CreatureScript struct boss_sindragosaAI : public BossAI { - boss_sindragosaAI(Creature* creature) : BossAI(creature, DATA_SINDRAGOSA) + boss_sindragosaAI(Creature* creature) : BossAI(creature, DATA_SINDRAGOSA), _summoned(false) { } @@ -220,7 +220,7 @@ class boss_sindragosa : public CreatureScript _isInAirPhase = false; _isThirdPhase = false; - if (instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) != 255) + if (!_summoned) { me->SetCanFly(true); me->SetDisableGravity(true); @@ -266,10 +266,13 @@ class boss_sindragosa : public CreatureScript { if (action == ACTION_START_FROSTWYRM) { + if (_summoned) + return; + + _summoned = true; if (TempSummon* summon = me->ToTempSummon()) summon->SetTempSummonType(TEMPSUMMON_DEAD_DESPAWN); - instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, 255); if (me->isDead()) return; @@ -550,6 +553,7 @@ class boss_sindragosa : public CreatureScript uint8 _mysticBuffetStack; bool _isInAirPhase; bool _isThirdPhase; + bool _summoned; }; CreatureAI* GetAI(Creature* creature) const @@ -642,7 +646,7 @@ class npc_spinestalker : public CreatureScript struct npc_spinestalkerAI : public ScriptedAI { - npc_spinestalkerAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) + npc_spinestalkerAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _summoned(false) { } @@ -651,7 +655,7 @@ class npc_spinestalker : public CreatureScript // Increase add count if (!me->isDead()) { - _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade + _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade Reset(); } } @@ -664,7 +668,7 @@ class npc_spinestalker : public CreatureScript _events.ScheduleEvent(EVENT_TAIL_SWEEP, urand(8000, 12000)); me->SetReactState(REACT_DEFENSIVE); - if (_instance->GetData(DATA_SPINESTALKER) != 255) + if (!_summoned) { me->SetCanFly(true); me->SetDisableGravity(true); @@ -674,7 +678,7 @@ class npc_spinestalker : public CreatureScript void JustRespawned() { ScriptedAI::JustRespawned(); - _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade + _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade } void JustDied(Unit* /*killer*/) @@ -686,7 +690,10 @@ class npc_spinestalker : public CreatureScript { if (action == ACTION_START_FROSTWYRM) { - _instance->SetData(DATA_SPINESTALKER, 255); + if (_summoned) + return; + + _summoned = true; if (me->isDead()) return; @@ -753,6 +760,7 @@ class npc_spinestalker : public CreatureScript private: EventMap _events; InstanceScript* _instance; + bool _summoned; }; CreatureAI* GetAI(Creature* creature) const @@ -768,7 +776,7 @@ class npc_rimefang : public CreatureScript struct npc_rimefangAI : public ScriptedAI { - npc_rimefangAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) + npc_rimefangAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _summoned(false) { } @@ -777,7 +785,7 @@ class npc_rimefang : public CreatureScript // Increase add count if (!me->isDead()) { - _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade + _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade Reset(); } } @@ -790,7 +798,7 @@ class npc_rimefang : public CreatureScript me->SetReactState(REACT_DEFENSIVE); _icyBlastCounter = 0; - if (_instance->GetData(DATA_RIMEFANG) != 255) + if (!_summoned) { me->SetCanFly(true); me->SetDisableGravity(true); @@ -800,7 +808,7 @@ class npc_rimefang : public CreatureScript void JustRespawned() { ScriptedAI::JustRespawned(); - _instance->SetData64(DATA_SINDRAGOSA_FROSTWYRMS, me->GetGUID()); // this cannot be in Reset because reset also happens on evade + _instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade } void JustDied(Unit* /*killer*/) @@ -812,7 +820,10 @@ class npc_rimefang : public CreatureScript { if (action == ACTION_START_FROSTWYRM) { - _instance->SetData(DATA_RIMEFANG, 255); + if (_summoned) + return; + + _summoned = true; if (me->isDead()) return; @@ -906,6 +917,7 @@ class npc_rimefang : public CreatureScript EventMap _events; InstanceScript* _instance; uint8 _icyBlastCounter; + bool _summoned; }; CreatureAI* GetAI(Creature* creature) const @@ -933,7 +945,7 @@ class npc_sindragosa_trash : public CreatureScript if (!me->isDead()) { if (me->GetEntry() == NPC_FROSTWING_WHELP) - _instance->SetData64(_frostwyrmId, me->GetGUID()); // this cannot be in Reset because reset also happens on evade + _instance->SetData(_frostwyrmId, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade Reset(); } } @@ -956,7 +968,7 @@ class npc_sindragosa_trash : public CreatureScript // Increase add count if (me->GetEntry() == NPC_FROSTWING_WHELP) - _instance->SetData64(_frostwyrmId, me->GetGUID()); // this cannot be in Reset because reset also happens on evade + _instance->SetData(_frostwyrmId, me->GetDBTableGUIDLow()); // this cannot be in Reset because reset also happens on evade } void SetData(uint32 type, uint32 data) @@ -1503,7 +1515,7 @@ class at_sindragosa_lair : public AreaTriggerScript if (Creature* rimefang = ObjectAccessor::GetCreature(*player, instance->GetData64(DATA_RIMEFANG))) rimefang->AI()->DoAction(ACTION_START_FROSTWYRM); - if (!instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) && instance->GetBossState(DATA_SINDRAGOSA) != DONE) + if (!instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) && !instance->GetData64(DATA_SINDRAGOSA) && instance->GetBossState(DATA_SINDRAGOSA) != DONE) { if (player->GetMap()->IsHeroic() && !instance->GetData(DATA_HEROIC_ATTEMPTS)) return true; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index 288fde28c38..704c3c2b0c2 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -89,13 +89,6 @@ WeeklyQuest const WeeklyQuestData[WeeklyNPCs] = {NPC_VALITHRIA_DREAMWALKER_QUEST, {QUEST_RESPITE_FOR_A_TORNMENTED_SOUL_10, QUEST_RESPITE_FOR_A_TORNMENTED_SOUL_25}}, // Respite for a Tormented Soul }; -enum FrostwyrmFlags -{ - FLAG_SPINESTALKER_SUMMONED = 0x01, - FLAG_RIMEFANG_SUMMONED = 0x02, - FLAG_SINDRAGOSA_SUMMONED = 0x04, -}; - class instance_icecrown_citadel : public InstanceMapScript { public: @@ -152,7 +145,6 @@ class instance_icecrown_citadel : public InstanceMapScript ColdflameJetsState = NOT_STARTED; BloodQuickeningState = NOT_STARTED; BloodQuickeningMinutes = 0; - FrostwyrmFlags = 0; } void FillInitialWorldStates(WorldPacket& data) @@ -284,13 +276,9 @@ class instance_icecrown_citadel : public InstanceMapScript break; case NPC_SPINESTALKER: SpinestalkerGUID = creature->GetGUID(); - if (!creature->isAlive()) - FrostwyrmFlags |= FLAG_SPINESTALKER_SUMMONED; break; case NPC_RIMEFANG: RimefangGUID = creature->GetGUID(); - if (!creature->isAlive()) - FrostwyrmFlags |= FLAG_RIMEFANG_SUMMONED; break; case NPC_THE_LICH_KING: TheLichKingGUID = creature->GetGUID(); @@ -307,6 +295,12 @@ class instance_icecrown_citadel : public InstanceMapScript } } + void OnCreatureRemove(Creature* creature) + { + if (creature->GetEntry() == NPC_SINDRAGOSA) + SindragosaGUID = 0; + } + // Weekly quest spawn prevention uint32 GetCreatureEntry(uint32 /*guidLow*/, CreatureData const* data) { @@ -357,49 +351,36 @@ class instance_icecrown_citadel : public InstanceMapScript crok->AI()->SetGUID(creature->GetGUID(), ACTION_VRYKUL_DEATH); break; case NPC_FROSTWING_WHELP: + if (FrostwyrmGUIDs.empty()) + return; + if (creature->AI()->GetData(1/*DATA_FROSTWYRM_OWNER*/) == DATA_SPINESTALKER) { - if (FrostwyrmFlags & FLAG_SPINESTALKER_SUMMONED) - return; - - SpinestalkerTrash.erase(creature->GetGUID()); + SpinestalkerTrash.erase(creature->GetDBTableGUIDLow()); if (SpinestalkerTrash.empty()) - { - FrostwyrmFlags |= FLAG_SPINESTALKER_SUMMONED; if (Creature* spinestalk = instance->GetCreature(SpinestalkerGUID)) spinestalk->AI()->DoAction(ACTION_START_FROSTWYRM); - } } else { - if (FrostwyrmFlags & FLAG_RIMEFANG_SUMMONED) - return; - - RimefangTrash.erase(creature->GetGUID()); + RimefangTrash.erase(creature->GetDBTableGUIDLow()); if (RimefangTrash.empty()) - { - FrostwyrmFlags |= FLAG_RIMEFANG_SUMMONED; if (Creature* spinestalk = instance->GetCreature(RimefangGUID)) spinestalk->AI()->DoAction(ACTION_START_FROSTWYRM); - } } break; case NPC_RIMEFANG: case NPC_SPINESTALKER: { - if (FrostwyrmFlags & FLAG_SINDRAGOSA_SUMMONED) - return; - if (instance->IsHeroic() && !HeroicAttempts) return; if (GetBossState(DATA_SINDRAGOSA) == DONE) return; - FrostwyrmGUIDs.erase(creature->GetGUID()); + FrostwyrmGUIDs.erase(creature->GetDBTableGUIDLow()); if (FrostwyrmGUIDs.empty()) { - FrostwyrmFlags |= FLAG_SINDRAGOSA_SUMMONED; instance->LoadGrid(SindragosaSpawnPos.GetPositionX(), SindragosaSpawnPos.GetPositionY()); if (Creature* boss = instance->SummonCreature(NPC_SINDRAGOSA, SindragosaSpawnPos)) boss->AI()->DoAction(ACTION_START_FROSTWYRM); @@ -597,16 +578,10 @@ class instance_icecrown_citadel : public InstanceMapScript switch (type) { case DATA_SINDRAGOSA_FROSTWYRMS: - if (FrostwyrmFlags & FLAG_SINDRAGOSA_SUMMONED) - return 255; return FrostwyrmGUIDs.size(); case DATA_SPINESTALKER: - if (FrostwyrmFlags & FLAG_SPINESTALKER_SUMMONED) - return 255; return SpinestalkerTrash.size(); case DATA_RIMEFANG: - if (FrostwyrmFlags & FLAG_RIMEFANG_SUMMONED) - return 255; return RimefangTrash.size(); case DATA_COLDFLAME_JETS: return ColdflameJetsState; @@ -806,9 +781,6 @@ class instance_icecrown_citadel : public InstanceMapScript sindra->DespawnOrUnsummon(); } } - // Reached when loading from DB - if (state == DONE) - FrostwyrmFlags |= FLAG_SINDRAGOSA_SUMMONED; break; case DATA_THE_LICH_KING: { @@ -866,16 +838,13 @@ class instance_icecrown_citadel : public InstanceMapScript IsOrbWhispererEligible = data ? true : false; break; case DATA_SINDRAGOSA_FROSTWYRMS: - if (data == 255) - FrostwyrmFlags |= FLAG_SINDRAGOSA_SUMMONED; + FrostwyrmGUIDs.insert(data); break; case DATA_SPINESTALKER: - if (data == 255) - FrostwyrmFlags |= FLAG_SPINESTALKER_SUMMONED; + SpinestalkerTrash.insert(data); break; case DATA_RIMEFANG: - if (data == 255) - FrostwyrmFlags |= FLAG_RIMEFANG_SUMMONED; + RimefangTrash.insert(data); break; case DATA_COLDFLAME_JETS: ColdflameJetsState = data; @@ -918,22 +887,6 @@ class instance_icecrown_citadel : public InstanceMapScript } } - void SetData64(uint32 id, uint64 data) - { - switch (id) - { - case DATA_SINDRAGOSA_FROSTWYRMS: - FrostwyrmGUIDs.insert(data); - break; - case DATA_SPINESTALKER: - SpinestalkerTrash.insert(data); - break; - case DATA_RIMEFANG: - RimefangTrash.insert(data); - break; - } - } - bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) { switch (criteria_id) @@ -1301,13 +1254,12 @@ class instance_icecrown_citadel : public InstanceMapScript uint64 PillarsUnchainedGUID; uint32 TeamInInstance; uint32 ColdflameJetsState; - std::set<uint64> FrostwyrmGUIDs; - std::set<uint64> SpinestalkerTrash; - std::set<uint64> RimefangTrash; + std::set<uint32> FrostwyrmGUIDs; + std::set<uint32> SpinestalkerTrash; + std::set<uint32> RimefangTrash; uint32 BloodQuickeningState; uint32 HeroicAttempts; uint16 BloodQuickeningMinutes; - uint16 FrostwyrmFlags; bool IsBonedEligible; bool IsOozeDanceEligible; bool IsNauseaEligible; diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp index bdaaa002b3f..f42fd87c643 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp @@ -193,7 +193,7 @@ class spell_loken_pulsing_shockwave : public SpellScriptLoader { PrepareSpellScript(spell_loken_pulsing_shockwave_SpellScript); - void CalculateDamage() + void CalculateDamage(SpellEffIndex /*effIndex*/) { if (!GetHitUnit()) return; @@ -205,7 +205,7 @@ class spell_loken_pulsing_shockwave : public SpellScriptLoader void Register() { - OnHit += SpellHitFn(spell_loken_pulsing_shockwave_SpellScript::CalculateDamage); + OnEffectHitTarget += SpellEffectFn(spell_loken_pulsing_shockwave_SpellScript::CalculateDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); } }; diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 9dedeaf5bd7..4c8a9db1571 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -332,26 +332,6 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader } }; -class StarfallDummyTargetFilter -{ - public: - StarfallDummyTargetFilter(Unit* caster) : _caster(caster) { } - - bool operator()(Unit* target) const - { - if (target->HasStealthAura() || target->HasInvisibilityAura()) - return true; - - if (!target->IsWithinLOSInMap(_caster)) - return true; - - return false; - } - - private: - Unit* _caster; -}; - class spell_dru_starfall_dummy : public SpellScriptLoader { public: @@ -363,8 +343,6 @@ class spell_dru_starfall_dummy : public SpellScriptLoader void FilterTargets(std::list<Unit*>& unitList) { - // Remove targets not in LoS or in stealth - unitList.remove_if(StarfallDummyTargetFilter(GetCaster())); Trinity::Containers::RandomResizeList(unitList, 2); } @@ -426,21 +404,20 @@ class spell_dru_lifebloom : public SpellScriptLoader // final heal int32 stack = GetStackAmount(); int32 healAmount = aurEff->GetAmount(); - Unit* caster = GetCaster(); - if (caster) + if (Unit* caster = GetCaster()) { healAmount = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), healAmount, HEAL, stack); healAmount = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, stack); - } - GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); + GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); - // restore mana - if (caster) - { + // restore mana int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2; caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); + return; } + + GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); } void HandleDispel(DispelInfo* dispelInfo) @@ -451,21 +428,19 @@ class spell_dru_lifebloom : public SpellScriptLoader { // final heal int32 healAmount = aurEff->GetAmount(); - Unit* caster = GetCaster(); - if (caster) + if (Unit* caster = GetCaster()) { healAmount = caster->SpellHealingBonusDone(target, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges()); healAmount = target->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges()); - } - - target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID()); + target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID()); - // restore mana - if (caster) - { + // restore mana int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * dispelInfo->GetRemovedCharges() / 2; caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID()); + return; } + + target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID()); } } } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index f254908fe55..e7cc7360aab 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -252,12 +252,7 @@ class spell_gen_parachute : public SpellScriptLoader if (target->IsFalling()) { target->RemoveAurasDueToSpell(SPELL_PARACHUTE); - - float x, y, z; - target->GetPosition(x, y, z); - float groundZ = target->GetMap()->GetHeight(target->GetPhaseMask(), x, y, z); - if (fabs(groundZ - z) > 0.1f) - target->CastSpell(target, SPELL_PARACHUTE_BUFF, true); + target->CastSpell(target, SPELL_PARACHUTE_BUFF, true); } } @@ -2825,24 +2820,16 @@ class spell_gen_lifebloom : public SpellScriptLoader void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { // Final heal only on duration end - if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL) return; // final heal GetTarget()->CastSpell(GetTarget(), _spellId, true, NULL, aurEff, GetCasterGUID()); } - void HandleDispel(DispelInfo* /*dispelInfo*/) - { - // final heal - if (Unit* target = GetUnitOwner()) - target->CastSpell(target, _spellId, true, NULL, GetEffect(EFFECT_0), GetCasterGUID()); - } - void Register() { AfterEffectRemove += AuraEffectRemoveFn(spell_gen_lifebloom_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL); - AfterDispel += AuraDispelFn(spell_gen_lifebloom_AuraScript::HandleDispel); } private: @@ -2887,8 +2874,7 @@ class spell_gen_summon_elemental : public SpellScriptLoader { if (GetCaster()) if (Unit* owner = GetCaster()->GetOwner()) - if (owner->GetTypeId() == TYPEID_PLAYER) // todo: this check is maybe wrong - owner->CastSpell(owner, _spellId, true); + owner->CastSpell(owner, _spellId, true); } void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) @@ -3010,14 +2996,11 @@ class spell_gen_mount : public SpellScriptLoader // Triggered spell id dependent on riding skill and zone bool canFly = false; - uint32 vmap = GetVirtualMapForMapAndZone(target->GetMapId(), target->GetZoneId()); - if (vmap == 530 || (vmap == 571 && target->HasSpell(SPELL_COLD_WEATHER_FLYING))) + uint32 map = target->GetMapId(); + if (map == 530 || (map == 571 && target->HasSpell(SPELL_COLD_WEATHER_FLYING))) canFly = true; - float x, y, z; - target->GetPosition(x, y, z); - uint32 areaFlag = target->GetBaseMap()->GetAreaFlag(x, y, z); - AreaTableEntry const* area = sAreaStore.LookupEntry(areaFlag); + AreaTableEntry const* area = sAreaStore.LookupEntry(target->GetAreaId()); if (!area || (canFly && (area->flags & AREA_FLAG_NO_FLY_ZONE))) canFly = false; diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index fe681032c1c..329e0d2e170 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -462,19 +462,10 @@ class spell_pal_lay_on_hands : public SpellScriptLoader { Unit* caster = GetCaster(); if (Unit* target = GetExplTargetUnit()) - { if (caster == target) - { - if (target->HasAura(SPELL_FORBEARANCE)) - return SPELL_FAILED_TARGET_AURASTATE; - - if (target->HasAura(SPELL_AVENGING_WRATH_MARKER)) + if (target->HasAura(SPELL_FORBEARANCE) || target->HasAura(SPELL_AVENGING_WRATH_MARKER) || target->HasAura(SPELL_IMMUNE_SHIELD_MARKER)) return SPELL_FAILED_TARGET_AURASTATE; - if (target->HasAura(SPELL_IMMUNE_SHIELD_MARKER)) - return SPELL_FAILED_TARGET_AURASTATE; - } - } return SPELL_CAST_OK; } diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index 6ed0f18c785..78bdbb7f127 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -1,4 +1,4 @@ -/* + /* * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it @@ -102,7 +102,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader return true; } - void CalculateAmountCritSpell(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountCritSpell(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -121,7 +121,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader } } - void CalculateAmountCritMelee(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountCritMelee(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -140,7 +140,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader } } - void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -155,7 +155,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader } } - void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -170,7 +170,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader } } - void CalculateAmountExpertise(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountExpertise(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -237,7 +237,7 @@ public: return true; } - void CalculateStaminaAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateStaminaAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -249,7 +249,7 @@ public: } } - void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void ApplyEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) if (_tempBonus) @@ -281,7 +281,7 @@ public: } } - void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void RemoveEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -291,7 +291,7 @@ public: } } - void CalculateAttackPowerAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAttackPowerAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -310,16 +310,16 @@ public: // Glyph of felguard if (pet->GetEntry() == ENTRY_FELGUARD) { - if (AuraEffect* aurEffect = owner->GetAuraEffect(56246, EFFECT_0)) + if (AuraEffect* /* aurEff */ect = owner->GetAuraEffect(56246, EFFECT_0)) { float base_attPower = pet->GetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE) * pet->GetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_PCT); - amount += CalculatePctN(amount+base_attPower, aurEffect->GetAmount()); + amount += CalculatePctN(amount+base_attPower, /* aurEff */ect->GetAmount()); } } } } - void CalculateDamageDoneAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateDamageDoneAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -374,7 +374,7 @@ public: return true; } - void CalculateIntellectAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateIntellectAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -389,7 +389,7 @@ public: } } - void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void ApplyEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) if (_tempBonus) @@ -417,7 +417,7 @@ public: } } - void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void RemoveEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -427,7 +427,7 @@ public: } } - void CalculateArmorAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateArmorAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -439,7 +439,7 @@ public: } } - void CalculateFireResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateFireResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -486,7 +486,7 @@ public: return true; } - void CalculateFrostResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateFrostResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -498,7 +498,7 @@ public: } } - void CalculateArcaneResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateArcaneResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -510,7 +510,7 @@ public: } } - void CalculateNatureResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateNatureResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -553,7 +553,7 @@ public: return true; } - void CalculateShadowResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateShadowResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) @@ -593,7 +593,7 @@ public: return true; } - void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -608,7 +608,7 @@ public: } } - void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -623,7 +623,7 @@ public: } } - void CalculateAmountExpertise(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountExpertise(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -668,7 +668,7 @@ public: return true; } - void CalculateAmountCritSpell(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountCritSpell(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -690,7 +690,7 @@ public: } } - void CalculateAmountCritMelee(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountCritMelee(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { @@ -741,11 +741,11 @@ public: return true; } - void CalculateAmountDamageDone(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountDamageDone(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; - if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + if (GetCaster()->GetOwner()->ToPlayer()) { switch (GetCaster()->GetEntry()) { @@ -792,13 +792,13 @@ public: return true; } - void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) if (pet->isPet()) if (Unit* owner = pet->ToPet()->GetOwner()) - if (AuraEffect* aurEffect = owner->GetAuraEffect(SPELL_WARLOCK_GLYPH_OF_VOIDWALKER, EFFECT_0)) - amount += aurEffect->GetAmount(); + if (AuraEffect* /* aurEff */ect = owner->GetAuraEffect(SPELL_WARLOCK_GLYPH_OF_VOIDWALKER, EFFECT_0)) + amount += /* aurEff */ect->GetAmount(); } void Register() @@ -830,10 +830,8 @@ public: return true; } - void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { - if (!GetCaster() || !GetCaster()->GetOwner()) - return; if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { // For others recalculate it from: @@ -847,10 +845,8 @@ public: } } - void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { - if (!GetCaster() || !GetCaster()->GetOwner()) - return; if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { // For others recalculate it from: @@ -886,50 +882,45 @@ public: { PrepareAuraScript(spell_hun_pet_scaling_01_AuraScript); - void CalculateStaminaAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateStaminaAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) - { - if (!pet->isPet()) - return; - - Unit* owner = pet->ToPet()->GetOwner(); - if (!owner) - return; - - float mod = 0.45f; - float ownerBonus = 0.0f; + if (pet->isPet()) + if (Unit* owner = pet->ToPet()->GetOwner()) + { + float mod = 0.45f; + float ownerBonus = 0.0f; - PetSpellMap::const_iterator itr = (pet->ToPet()->m_spells.find(62758)); // Wild Hunt rank 1 - if (itr == pet->ToPet()->m_spells.end()) - itr = pet->ToPet()->m_spells.find(62762); // Wild Hunt rank 2 + PetSpellMap::const_iterator itr = (pet->ToPet()->m_spells.find(62758)); // Wild Hunt rank 1 + if (itr == pet->ToPet()->m_spells.end()) + itr = pet->ToPet()->m_spells.find(62762); // Wild Hunt rank 2 - if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt - { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value - AddPctN(mod, spellInfo->Effects[EFFECT_0].CalcValue()); - } + if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt + { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value + AddPctN(mod, spellInfo->Effects[EFFECT_0].CalcValue()); + } - ownerBonus = owner->GetStat(STAT_STAMINA)*mod; + ownerBonus = owner->GetStat(STAT_STAMINA)*mod; - amount += ownerBonus; - } + amount += ownerBonus; + } } - void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void ApplyEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) if (_tempHealth) pet->SetHealth(_tempHealth); } - void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void RemoveEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) _tempHealth = pet->GetHealth(); } - void CalculateAttackPowerAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAttackPowerAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -959,7 +950,7 @@ public: } } - void CalculateDamageDoneAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateDamageDoneAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1024,7 +1015,7 @@ public: return true; } - void CalculateFrostResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateFrostResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1043,7 +1034,7 @@ public: } } - void CalculateFireResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateFireResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1062,7 +1053,7 @@ public: } } - void CalculateNatureResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateNatureResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1111,7 +1102,7 @@ public: return true; } - void CalculateShadowResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateShadowResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1130,7 +1121,7 @@ public: } } - void CalculateArcaneResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateArcaneResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1149,7 +1140,7 @@ public: } } - void CalculateArmorAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateArmorAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1198,7 +1189,7 @@ public: return true; } - void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; @@ -1215,7 +1206,7 @@ public: } } - void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; @@ -1232,7 +1223,7 @@ public: } } - void CalculateAmountExpertise(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountExpertise(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; @@ -1279,11 +1270,11 @@ public: return true; } - void CalculateAmountCritSpell(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountCritSpell(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; - if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + if (GetCaster()->GetOwner()->ToPlayer()) { // For others recalculate it from: float CritSpell = 0.0f; @@ -1300,11 +1291,11 @@ public: } } - void CalculateAmountCritMelee(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountCritMelee(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; - if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + if (GetCaster()->GetOwner()->ToPlayer()) { // For others recalculate it from: float CritMelee = 0.0f; @@ -1350,11 +1341,11 @@ public: return true; } - void CalculateAmountDamageDone(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountDamageDone(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; - if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) + if (GetCaster()->GetOwner()->ToPlayer()) { // Pet's base damage changes depending on happiness if (GetCaster()->isPet() && GetCaster()->ToPet()->isHunterPet()) @@ -1408,14 +1399,14 @@ public: return true; } - void CalculateAmountDamageDone(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountDamageDone(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; if (Player* owner = GetCaster()->GetOwner()->ToPlayer()) { - if (AuraEffect* aurEffect = owner->GetAuraEffectOfRankedSpell(SPELL_HUNTER_ANIMAL_HANDLER, EFFECT_1)) - amount = aurEffect->GetAmount(); + if (AuraEffect* /* aurEff */ect = owner->GetAuraEffectOfRankedSpell(SPELL_HUNTER_ANIMAL_HANDLER, EFFECT_1)) + amount = /* aurEff */ect->GetAmount(); else amount = 0; } @@ -1450,18 +1441,19 @@ public: return true; } - void CalculateAvoidanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAvoidanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { if (Unit* owner = pet->GetOwner()) - + { // Army of the dead ghoul if (pet->GetEntry() == ENTRY_ARMY_OF_THE_DEAD_GHOUL) amount = -90; // Night of the dead else if ( Aura * aur = owner->GetAuraOfRankedSpell(SPELL_NIGHT_OF_THE_DEAD)) amount = aur->GetSpellInfo()->Effects[EFFECT_2].CalcValue(); + } } } @@ -1494,7 +1486,7 @@ public: return true; } - void CalculateStaminaAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateStaminaAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1520,20 +1512,20 @@ public: } } - void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void ApplyEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) if (_tempHealth) pet->SetHealth(_tempHealth); } - void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void RemoveEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/) { if (Unit* pet = GetUnitOwner()) _tempHealth = pet->GetHealth(); } - void CalculateStrengthAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateStrengthAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1597,7 +1589,7 @@ public: return true; } - void CalculateAmountMeleeHaste(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHaste(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; @@ -1640,7 +1632,7 @@ public: return true; } - void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; @@ -1657,7 +1649,7 @@ public: } } - void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountSpellHit(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; @@ -1703,7 +1695,7 @@ public: return true; } - void CalculateDamageDoneAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateDamageDoneAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* pet = GetUnitOwner()) { @@ -1718,7 +1710,7 @@ public: } } - void CalculateAmountMeleeHaste(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmountMeleeHaste(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/) { if (!GetCaster() || !GetCaster()->GetOwner()) return; diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index dbc3a91012b..6910bf47805 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -352,17 +352,13 @@ class spell_pri_vampiric_touch : public SpellScriptLoader void HandleDispel(DispelInfo* /*dispelInfo*/) { if (Unit* caster = GetCaster()) - { if (Unit* target = GetUnitOwner()) - { if (AuraEffect const* aurEff = GetEffect(EFFECT_1)) { int32 damage = aurEff->GetAmount() * 8; // backfire damage caster->CastCustomSpell(target, PRIEST_SPELL_VAMPIRIC_TOUCH_DISPEL, &damage, NULL, NULL, true, NULL, aurEff); } - } - } } void Register() diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index da15c5c5046..fce3d0415a6 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -35,7 +35,7 @@ enum ShamanSpells SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1 = 8349, SHAMAN_SPELL_SATED = 57724, SHAMAN_SPELL_EXHAUSTION = 57723, - + SHAMAN_SPELL_STORM_EARTH_AND_FIRE = 51483, EARTHBIND_TOTEM_SPELL_EARTHGRAB = 64695, @@ -261,7 +261,7 @@ class EarthenPowerTargetSelector { public: EarthenPowerTargetSelector() { } - + bool operator() (Unit* target) { if (!target->HasAuraWithMechanic(1 << MECHANIC_SNARE)) @@ -679,9 +679,8 @@ class spell_sha_flame_shock : public SpellScriptLoader void HandleDispel(DispelInfo* /*dispelInfo*/) { if (Unit* caster = GetCaster()) - { // Lava Flows - if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, ICON_ID_SHAMAN_LAVA_FLOW, 0)) + if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, ICON_ID_SHAMAN_LAVA_FLOW, EFFECT_0)) { if (sSpellMgr->GetFirstSpellInChain(SHAMAN_LAVA_FLOWS_R1) != sSpellMgr->GetFirstSpellInChain(aurEff->GetId())) return; @@ -689,7 +688,6 @@ class spell_sha_flame_shock : public SpellScriptLoader uint8 rank = sSpellMgr->GetSpellRank(aurEff->GetId()); caster->CastSpell(caster, sSpellMgr->GetSpellWithRank(SHAMAN_LAVA_FLOWS_TRIGGERED_R1, rank), true); } - } } void Register() @@ -723,11 +721,9 @@ class spell_sha_sentry_totem : public SpellScriptLoader void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (Unit* caster = GetCaster()) - { if (Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[4])) if (totem->isTotem()) caster->CastSpell(totem, SHAMAN_BIND_SIGHT, true); - } } void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 1b24a9ec09f..e20eb07d45a 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -37,6 +37,7 @@ enum WarlockSpells WARLOCK_DEMONIC_CIRCLE_SUMMON = 48018, WARLOCK_DEMONIC_CIRCLE_TELEPORT = 48020, WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388, + WARLOCK_HAUNT = 48181, WARLOCK_HAUNT_HEAL = 48210, WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117, }; @@ -560,6 +561,9 @@ class spell_warl_haunt : public SpellScriptLoader void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) + return; + if (Unit* caster = GetCaster()) { int32 amount = aurEff->GetAmount(); @@ -603,14 +607,12 @@ class spell_warl_unstable_affliction : public SpellScriptLoader void HandleDispel(DispelInfo* dispelInfo) { if (Unit* caster = GetCaster()) - { if (AuraEffect const* aurEff = GetEffect(EFFECT_0)) { int32 damage = aurEff->GetAmount() * 9; // backfire damage and silence caster->CastCustomSpell(dispelInfo->GetDispeller(), WARLOCK_UNSTABLE_AFFLICTION_DISPEL, &damage, NULL, NULL, true, NULL, aurEff); } - } } void Register() |