From 40ec7f7979cd65fccc6fe74c056688da4c4d47ce Mon Sep 17 00:00:00 2001 From: Kirkhammett Date: Thu, 15 Aug 2013 15:55:19 +0200 Subject: Lumber Hack (12050) Fixes #4560 --- sql/updates/world/2013_08_15_01_world_sai.sql | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 sql/updates/world/2013_08_15_01_world_sai.sql diff --git a/sql/updates/world/2013_08_15_01_world_sai.sql b/sql/updates/world/2013_08_15_01_world_sai.sql new file mode 100644 index 00000000000..290d2081e50 --- /dev/null +++ b/sql/updates/world/2013_08_15_01_world_sai.sql @@ -0,0 +1,44 @@ +-- Random Comment ™ +SET @SHREDDER := 27061; -- Xink's Shredder +SET @XINK := 26660; -- Xink +SET @SPELL := 52872; -- Forceitem Xink's Shredder + +UPDATE `creature_template` SET `npcflag`=16777216,`unit_flags`=32768,`spell1`=47938,`spell2`=47921,`spell3`=49857,`spell4`=47966, `spell6`=47939 ,`VehicleId`=42 WHERE `entry`=@SHREDDER; +-- Creature Gossip_menu_option ppdate from sniff +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9422) AND `id` IN (0); +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +(9422,0,0, 'I seem to have misplaced your Shredder Control Device... might you have another?',1,1,0,0,0,0, ''); +-- Gossip option conditions +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=15 AND `SourceGroup`=9422); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,9422,0,1,9,12050,0,0,0,'','Show gossip only if Lumber Hack quest is taken'), +(15,9422,0,1,26,36734,0,0,0,'','Show gossip only if player does not have item Xink''s Shredder Control Device'), +(15,9422,0,2,26,36734,0,0,0,'','Show gossip option if player does not have item Xink''s Shredder Control Device'), +(15,9422,0,2,9,12052,0,0,0,'','Show gossip option if player has quest marked as taken'); + +DELETE FROM `conditions` WHERE `SourceEntry`=@SHREDDER; +INSERT INTO `conditions`(`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`)VALUES +(16,0,@SHREDDER,0,23,4230,0,0,0,'',"Dismount player when not in intended zone - Coldwind Heights"); + +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry` IN (26660,27061) AND `groupid` IN (0,1); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@XINK,0,0, 'About time! Get that lumber and get moving. The horde won''t be up there fighting forever, there''s money to be made!',12,0,100,25,1000,0, 'Xink'), +(@SHREDDER,0,0, 'Xink''s Shredder ready and available for woodland destruction.',16,0,100,0,0,0, 'Xink''s Shredder'), +(@SHREDDER,1,0, 'Xink''s Shredder security features activated. Returning to base.',16,0,100,0,0,0, 'Xink''s Shredder'); + +-- SAI for Xink +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@XINK; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@XINK 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 +(@XINK,0,0,0,19,0,100,0,12050,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Xink - On Quest Accept - say 0'), +(@XINK,0,1,2,62,0,100,0,9422,0,0,0,11,@SPELL,0,0,0,0,0,7,0,0,0,0,0,0,0,'Xink - On Gossip option select - Cast Forceitem Xink''s Shredder'), +(@XINK,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,'Xink - On Gossip option select - Close Gossip'); + +DELETE FROM `conditions` WHERE `SourceEntry`=47939; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 47939, 0, 0, 35, 0, 1, 5, 3, 0, 0, 0, '', 'Gather Lumber - limit GO targets to Coldwind Tree'); + +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=27061; +INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`, `user_type`) VALUES +(27061, 47920, 1, 0); -- cgit v1.2.3 From e0e236967b808f830febf755eb7c0470823ae2b7 Mon Sep 17 00:00:00 2001 From: Kirkhammett Date: Thu, 15 Aug 2013 15:56:44 +0200 Subject: Revert "Lumber Hack (12050)" This reverts commit 40ec7f7979cd65fccc6fe74c056688da4c4d47ce. --- sql/updates/world/2013_08_15_01_world_sai.sql | 44 --------------------------- 1 file changed, 44 deletions(-) delete mode 100644 sql/updates/world/2013_08_15_01_world_sai.sql diff --git a/sql/updates/world/2013_08_15_01_world_sai.sql b/sql/updates/world/2013_08_15_01_world_sai.sql deleted file mode 100644 index 290d2081e50..00000000000 --- a/sql/updates/world/2013_08_15_01_world_sai.sql +++ /dev/null @@ -1,44 +0,0 @@ --- Random Comment ™ -SET @SHREDDER := 27061; -- Xink's Shredder -SET @XINK := 26660; -- Xink -SET @SPELL := 52872; -- Forceitem Xink's Shredder - -UPDATE `creature_template` SET `npcflag`=16777216,`unit_flags`=32768,`spell1`=47938,`spell2`=47921,`spell3`=49857,`spell4`=47966, `spell6`=47939 ,`VehicleId`=42 WHERE `entry`=@SHREDDER; --- Creature Gossip_menu_option ppdate from sniff -DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9422) AND `id` IN (0); -INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES -(9422,0,0, 'I seem to have misplaced your Shredder Control Device... might you have another?',1,1,0,0,0,0, ''); --- Gossip option conditions -DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=15 AND `SourceGroup`=9422); -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(15,9422,0,1,9,12050,0,0,0,'','Show gossip only if Lumber Hack quest is taken'), -(15,9422,0,1,26,36734,0,0,0,'','Show gossip only if player does not have item Xink''s Shredder Control Device'), -(15,9422,0,2,26,36734,0,0,0,'','Show gossip option if player does not have item Xink''s Shredder Control Device'), -(15,9422,0,2,9,12052,0,0,0,'','Show gossip option if player has quest marked as taken'); - -DELETE FROM `conditions` WHERE `SourceEntry`=@SHREDDER; -INSERT INTO `conditions`(`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`)VALUES -(16,0,@SHREDDER,0,23,4230,0,0,0,'',"Dismount player when not in intended zone - Coldwind Heights"); - --- NPC talk text insert from sniff -DELETE FROM `creature_text` WHERE `entry` IN (26660,27061) AND `groupid` IN (0,1); -INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES -(@XINK,0,0, 'About time! Get that lumber and get moving. The horde won''t be up there fighting forever, there''s money to be made!',12,0,100,25,1000,0, 'Xink'), -(@SHREDDER,0,0, 'Xink''s Shredder ready and available for woodland destruction.',16,0,100,0,0,0, 'Xink''s Shredder'), -(@SHREDDER,1,0, 'Xink''s Shredder security features activated. Returning to base.',16,0,100,0,0,0, 'Xink''s Shredder'); - --- SAI for Xink -UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@XINK; -DELETE FROM `smart_scripts` WHERE `entryorguid`=@XINK 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 -(@XINK,0,0,0,19,0,100,0,12050,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Xink - On Quest Accept - say 0'), -(@XINK,0,1,2,62,0,100,0,9422,0,0,0,11,@SPELL,0,0,0,0,0,7,0,0,0,0,0,0,0,'Xink - On Gossip option select - Cast Forceitem Xink''s Shredder'), -(@XINK,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,'Xink - On Gossip option select - Close Gossip'); - -DELETE FROM `conditions` WHERE `SourceEntry`=47939; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES -(13, 1, 47939, 0, 0, 35, 0, 1, 5, 3, 0, 0, 0, '', 'Gather Lumber - limit GO targets to Coldwind Tree'); - -DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=27061; -INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`, `user_type`) VALUES -(27061, 47920, 1, 0); -- cgit v1.2.3 From 43c218ad21b669be9c35b5c7a81b44613726d768 Mon Sep 17 00:00:00 2001 From: Kirkhammett Date: Thu, 15 Aug 2013 15:59:18 +0200 Subject: [DB/SAI]: Lumber Hack (12050) --- sql/updates/world/2013_08_15_01_world_sai.sql | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 sql/updates/world/2013_08_15_01_world_sai.sql diff --git a/sql/updates/world/2013_08_15_01_world_sai.sql b/sql/updates/world/2013_08_15_01_world_sai.sql new file mode 100644 index 00000000000..1629295644f --- /dev/null +++ b/sql/updates/world/2013_08_15_01_world_sai.sql @@ -0,0 +1,44 @@ +-- Random comment ™ +SET @SHREDDER := 27061; -- Xink's Shredder +SET @XINK := 26660; -- Xink +SET @SPELL := 52872; -- Forceitem Xink's Shredder + +UPDATE `creature_template` SET `npcflag`=16777216,`unit_flags`=32768,`spell1`=47938,`spell2`=47921,`spell3`=49857,`spell4`=47966, `spell6`=47939 ,`VehicleId`=42 WHERE `entry`=@SHREDDER; +-- Creature Gossip_menu_option ppdate from sniff +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9422) AND `id` IN (0); +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +(9422,0,0, 'I seem to have misplaced your Shredder Control Device... might you have another?',1,1,0,0,0,0, ''); +-- Gossip option conditions +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=15 AND `SourceGroup`=9422); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,9422,0,1,9,12050,0,0,0,'','Show gossip only if Lumber Hack quest is taken'), +(15,9422,0,1,26,36734,0,0,0,'','Show gossip only if player does not have item Xink''s Shredder Control Device'), +(15,9422,0,2,26,36734,0,0,0,'','Show gossip option if player does not have item Xink''s Shredder Control Device'), +(15,9422,0,2,9,12052,0,0,0,'','Show gossip option if player has quest marked as taken'); + +DELETE FROM `conditions` WHERE `SourceEntry`=@SHREDDER; +INSERT INTO `conditions`(`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`)VALUES +(16,0,@SHREDDER,0,23,4230,0,0,0,'',"Dismount player when not in intended zone - Coldwind Heights"); + +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry` IN (26660,27061) AND `groupid` IN (0,1); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@XINK,0,0, 'About time! Get that lumber and get moving. The horde won''t be up there fighting forever, there''s money to be made!',12,0,100,25,1000,0, 'Xink'), +(@SHREDDER,0,0, 'Xink''s Shredder ready and available for woodland destruction.',16,0,100,0,0,0, 'Xink''s Shredder'), +(@SHREDDER,1,0, 'Xink''s Shredder security features activated. Returning to base.',16,0,100,0,0,0, 'Xink''s Shredder'); + +-- SAI for Xink +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@XINK; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@XINK 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 +(@XINK,0,0,0,19,0,100,0,12050,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Xink - On Quest Accept - say 0'), +(@XINK,0,1,2,62,0,100,0,9422,0,0,0,11,@SPELL,0,0,0,0,0,7,0,0,0,0,0,0,0,'Xink - On Gossip option select - Cast Forceitem Xink''s Shredder'), +(@XINK,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,'Xink - On Gossip option select - Close Gossip'); + +DELETE FROM `conditions` WHERE `SourceEntry`=47939; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 47939, 0, 0, 35, 0, 1, 5, 3, 0, 0, 0, '', 'Gather Lumber - limit GO targets to Coldwind Tree'); + +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=27061; +INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`, `user_type`) VALUES +(27061, 47920, 1, 0); -- cgit v1.2.3 From 0e966c11e25a403fd33ab5a4c2a12f329e635237 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Thu, 15 Aug 2013 16:21:31 +0200 Subject: SQL: Add missing newline in 5890f95f7cd7a885b667fe9b5da2dceea22b9b81 --- sql/updates/world/2013_08_14_00_world_gameobject_loot_template_335.sql | 2 +- sql/updates/world/2013_08_15_01_world_sai.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/updates/world/2013_08_14_00_world_gameobject_loot_template_335.sql b/sql/updates/world/2013_08_14_00_world_gameobject_loot_template_335.sql index db3d6659ba5..a2a4ad1e98d 100644 --- a/sql/updates/world/2013_08_14_00_world_gameobject_loot_template_335.sql +++ b/sql/updates/world/2013_08_14_00_world_gameobject_loot_template_335.sql @@ -243,4 +243,4 @@ INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lo -- Cleanups DELETE FROM `reference_loot_template` WHERE `entry` IN (12010,12011,12012,12013,12014,12015,12016,12017); DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 4 AND `SourceGroup` IN (6150,6313,13948) AND `SourceEntry`=11514; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=10 AND `SourceGroup` IN (12010,12012,12013,12014) AND `SourceEntry`=11514; \ No newline at end of file +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=10 AND `SourceGroup` IN (12010,12012,12013,12014) AND `SourceEntry`=11514; diff --git a/sql/updates/world/2013_08_15_01_world_sai.sql b/sql/updates/world/2013_08_15_01_world_sai.sql index 1629295644f..5110993f1de 100644 --- a/sql/updates/world/2013_08_15_01_world_sai.sql +++ b/sql/updates/world/2013_08_15_01_world_sai.sql @@ -1,4 +1,4 @@ --- Random comment ™ +-- Random comment SET @SHREDDER := 27061; -- Xink's Shredder SET @XINK := 26660; -- Xink SET @SPELL := 52872; -- Forceitem Xink's Shredder -- cgit v1.2.3 From 2ac6380202ca38da318d5f147d0e33fddea9488e Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 15 Aug 2013 16:32:22 +0200 Subject: Core/Auras: Allow preventing whole aura proc default handler from script hooks, just how it is possible for separate effects --- src/server/game/Entities/Unit/Unit.cpp | 7 +++---- src/server/game/Spells/Auras/SpellAuras.cpp | 6 +++++- src/server/game/Spells/Auras/SpellAuras.h | 2 +- src/server/game/Spells/SpellScript.cpp | 2 ++ 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index fd5b13c3d28..a51207ce531 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -14064,11 +14064,10 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u if (spellInfo->AttributesEx3 & SPELL_ATTR3_DISABLE_PROC) SetCantProc(true); - i->aura->CallScriptProcHandlers(aurApp, eventInfo); + bool handled = i->aura->CallScriptProcHandlers(aurApp, eventInfo); - // This bool is needed till separate aura effect procs are still here - bool handled = false; - if (HandleAuraProc(target, damage, i->aura, procSpell, procFlag, procExtra, cooldown, &handled)) + // "handled" is needed as long as proc can be handled in multiple places + if (!handled && HandleAuraProc(target, damage, i->aura, procSpell, procFlag, procExtra, cooldown, &handled)) { TC_LOG_DEBUG(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), Id); takeCharges = true; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 2846137ad95..51a04749c30 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -2269,8 +2269,9 @@ bool Aura::CallScriptPrepareProcHandlers(AuraApplication const* aurApp, ProcEven return prepare; } -void Aura::CallScriptProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo) +bool Aura::CallScriptProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo) { + bool handled = false; for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_PROC, aurApp); @@ -2278,8 +2279,11 @@ void Aura::CallScriptProcHandlers(AuraApplication const* aurApp, ProcEventInfo& for (; hookItr != hookItrEnd; ++hookItr) hookItr->Call(*scritr, eventInfo); + handled |= (*scritr)->_IsDefaultActionPrevented(); (*scritr)->_FinishScriptCall(); } + + return handled; } void Aura::CallScriptAfterProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo) diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index e865d415438..9e7d0cce82c 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -229,7 +229,7 @@ class Aura // Spell Proc Hooks bool CallScriptCheckProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo); bool CallScriptPrepareProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo); - void CallScriptProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo); + bool CallScriptProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo); void CallScriptAfterProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo); bool CallScriptEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo); void CallScriptAfterEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo); diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 5fb4d69cd02..bb9aab023af 100644 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -909,6 +909,7 @@ bool AuraScript::_IsDefaultActionPrevented() case AURA_SCRIPT_HOOK_EFFECT_ABSORB: case AURA_SCRIPT_HOOK_EFFECT_SPLIT: case AURA_SCRIPT_HOOK_PREPARE_PROC: + case AURA_SCRIPT_HOOK_PROC: case AURA_SCRIPT_HOOK_EFFECT_PROC: return m_defaultActionPrevented; default: @@ -927,6 +928,7 @@ void AuraScript::PreventDefaultAction() case AURA_SCRIPT_HOOK_EFFECT_ABSORB: case AURA_SCRIPT_HOOK_EFFECT_SPLIT: case AURA_SCRIPT_HOOK_PREPARE_PROC: + case AURA_SCRIPT_HOOK_PROC: case AURA_SCRIPT_HOOK_EFFECT_PROC: m_defaultActionPrevented = true; break; -- cgit v1.2.3 From d1bb6da668c15e6b359c7b1ef0287d1004fcbe58 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 15 Aug 2013 16:34:57 +0200 Subject: Core/Spells: Fixed cast time mods using two charges on every cast --- src/server/game/Entities/Unit/Unit.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a51207ce531..274e9303946 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2968,11 +2968,11 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL]) { // break autorepeat if not Auto Shot - if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != 75) + if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->GetSpellInfo()->Id != 75) InterruptSpell(CURRENT_AUTOREPEAT_SPELL); m_AutoRepeatFirstCast = true; } - if (pSpell->m_spellInfo->CalcCastTime(this) > 0) + if (pSpell->GetCastTime() > 0) AddUnitState(UNIT_STATE_CASTING); break; @@ -2985,7 +2985,7 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) // it also does break autorepeat if not Auto Shot if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL] && - m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != 75) + m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->GetSpellInfo()->Id != 75) InterruptSpell(CURRENT_AUTOREPEAT_SPELL); AddUnitState(UNIT_STATE_CASTING); @@ -2994,7 +2994,7 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) case CURRENT_AUTOREPEAT_SPELL: { // only Auto Shoot does not break anything - if (pSpell->m_spellInfo->Id != 75) + if (pSpell->GetSpellInfo()->Id != 75) { // generic autorepeats break generic non-delayed and channeled non-delayed spells InterruptSpell(CURRENT_GENERIC_SPELL, false); -- cgit v1.2.3 From c52f9aa3157bddc7dffb67ac03b3bfdf7977c55c Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 15 Aug 2013 16:37:18 +0200 Subject: Core/Spells: Refactored SpellInfo::CalcCastTime() to prevent accidental mod charge losses caused by its incorrect usage --- src/server/game/Spells/Spell.cpp | 22 ++++++++++++---------- src/server/game/Spells/SpellInfo.cpp | 6 +++--- src/server/game/Spells/SpellInfo.h | 2 +- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 82460b7b218..be88179b168 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3050,18 +3050,20 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered // Prepare data for triggers prepareDataForTriggerSystem(triggeredByAura); - if (m_caster->GetTypeId() == TYPEID_PLAYER) - m_caster->ToPlayer()->SetSpellModTakingSpell(this, true); - // calculate cast time (calculated after first CheckCast check to prevent charge counting for first CheckCast fail) - m_casttime = m_spellInfo->CalcCastTime(m_caster, this); - if (m_caster->GetTypeId() == TYPEID_PLAYER) + if (Player* player = m_caster->ToPlayer()) { - m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); - - // Set casttime to 0 if .cheat casttime is enabled. - if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_CASTTIME)) - m_casttime = 0; + if (!m_caster->ToPlayer()->GetCommandStatus(CHEAT_CASTTIME)) + { + m_caster->ToPlayer()->SetSpellModTakingSpell(this, true); + // calculate cast time (calculated after first CheckCast check to prevent charge counting for first CheckCast fail) + m_casttime = m_spellInfo->CalcCastTime(this); + m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); + } + else + m_casttime = 0; // Set cast time to 0 if .cheat casttime is enabled. } + else + m_casttime = m_spellInfo->CalcCastTime(this); // don't allow channeled spells / spells with cast time to be casted while moving // (even if they are interrupted on moving, spells with almost immediate effect get to have their effect processed before movement interrupter kicks in) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 3ac1351c135..04437b82f2d 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -2057,7 +2057,7 @@ int32 SpellInfo::GetMaxDuration() const return (DurationEntry->Duration[2] == -1) ? -1 : abs(DurationEntry->Duration[2]); } -uint32 SpellInfo::CalcCastTime(Unit* caster, Spell* spell) const +uint32 SpellInfo::CalcCastTime(Spell* spell /*= NULL*/) const { // not all spells have cast time index and this is all is pasiive abilities if (!CastTimeEntry) @@ -2065,8 +2065,8 @@ uint32 SpellInfo::CalcCastTime(Unit* caster, Spell* spell) const int32 castTime = CastTimeEntry->CastTime; - if (caster) - caster->ModSpellCastTime(this, castTime, spell); + if (spell) + spell->GetCaster()->ModSpellCastTime(this, castTime, spell); if (Attributes & SPELL_ATTR0_REQ_AMMO && (!IsAutoRepeatRangedSpell())) castTime += 500; diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 82fa1129429..6acde5afa74 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -444,7 +444,7 @@ public: uint32 GetMaxTicks() const; - uint32 CalcCastTime(Unit* caster = NULL, Spell* spell = NULL) const; + uint32 CalcCastTime(Spell* spell = NULL) const; uint32 GetRecoveryTime() const; int32 CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) const; -- cgit v1.2.3 From a647d3590c91816272b94a1c9d31dcfe378e22a2 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 15 Aug 2013 16:38:35 +0200 Subject: Core/Spells: Fixed Execute rolling for procs twice --- src/server/game/Spells/SpellMgr.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index d8094488fcd..94454e8440d 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3106,6 +3106,17 @@ void SpellMgr::LoadSpellInfoCorrections() // Entries were not updated after spell effect change, we have to do that manually :/ spellInfo->AttributesEx3 |= SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED; break; + case 5308: // Execute (Rank 1) + case 20658: // Execute (Rank 2) + case 20660: // Execute (Rank 3) + case 20661: // Execute (Rank 4) + case 20662: // Execute (Rank 5) + case 25234: // Execute (Rank 6) + case 25236: // Execute (Rank 7) + case 47470: // Execute (Rank 8) + case 47471: // Execute (Rank 9) + spellInfo->AttributesEx3 |= SPELL_ATTR3_CANT_TRIGGER_PROC; + break; case 59725: // Improved Spell Reflection - aoe aura // Target entry seems to be wrong for this spell :/ spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER_AREA_PARTY); -- cgit v1.2.3 From 4d260a54aebbdabdb9982e297d1e5086f8a68fa9 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 15 Aug 2013 16:39:31 +0200 Subject: Core/Spells: Fixed warrior T10 4p dps bonus Closes #493 --- sql/updates/world/2013_08_15_02_world_spell_proc_event.sql | 3 +++ src/server/scripts/Spells/spell_warrior.cpp | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 sql/updates/world/2013_08_15_02_world_spell_proc_event.sql diff --git a/sql/updates/world/2013_08_15_02_world_spell_proc_event.sql b/sql/updates/world/2013_08_15_02_world_spell_proc_event.sql new file mode 100644 index 00000000000..4e2b04faea4 --- /dev/null +++ b/sql/updates/world/2013_08_15_02_world_spell_proc_event.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_proc_event` WHERE `entry`=46916; +INSERT INTO `spell_proc_event` (`entry`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`) VALUES +(46916,4,0x200000,0x0,0x0); diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 78dcaaa669c..d022eef65b9 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -578,9 +578,8 @@ class spell_warr_slam : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { - int32 bp0 = GetEffectValue(); if (GetHitUnit()) - GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_WARRIOR_SLAM, &bp0, NULL, NULL, true, 0); + GetCaster()->CastCustomSpell(SPELL_WARRIOR_SLAM, SPELLVALUE_BASE_POINT0, GetEffectValue(), GetHitUnit(), TRIGGERED_FULL_MASK); } void Register() OVERRIDE -- cgit v1.2.3