diff options
author | Killyana <morphone1@gmail.com> | 2019-12-15 16:27:21 +0100 |
---|---|---|
committer | Killyana <morphone1@gmail.com> | 2019-12-15 16:27:21 +0100 |
commit | c22b1e6cb46ff76729f44eb846043e1614abc9f9 (patch) | |
tree | 8fce382cc11529f532145ff86ebf81edbd12737d | |
parent | 8b03fe95061f870efbe5352530c25a0175c4d8ee (diff) |
DB/Quest: Take Down Tethyr!
Closes #22407
-rw-r--r-- | sql/updates/world/3.3.5/2019_12_15_00_world_335.sql | 23 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 30 |
2 files changed, 53 insertions, 0 deletions
diff --git a/sql/updates/world/3.3.5/2019_12_15_00_world_335.sql b/sql/updates/world/3.3.5/2019_12_15_00_world_335.sql new file mode 100644 index 00000000000..ae2e7149e34 --- /dev/null +++ b/sql/updates/world/3.3.5/2019_12_15_00_world_335.sql @@ -0,0 +1,23 @@ +-- +UPDATE `creature` SET `position_z`=12.259 WHERE `id`=23907; +UPDATE `smart_scripts` SET `event_param1`=16000,`event_param2`=16000 WHERE `entryorguid`=23900 AND `source_type`=0 AND `id`=2; +UPDATE `smart_scripts` SET `action_param1`=768 WHERE `entryorguid`=2389900 AND `source_type`=9 AND `id`=2; +UPDATE `smart_scripts` SET `action_param1`=768 WHERE `entryorguid`=23899 AND `source_type`=0 AND `id`=2; +UPDATE `creature_template_movement` SET `Ground`=1 WHERE `CreatureID`=23899; + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (23899) AND `source_type`=0 AND `id`=5; +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 +(23899,0,5,0,40,0,100,0,1,23899,0,0,103,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Tethyr - Waypoint reached - Root'); +UPDATE `creature_template` SET `flags_extra`=64 WHERE `entry` IN (23899); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=42578; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition` ,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,42578,0,0,31,0,3,23907,0,0,0,'','Cannon Blast'); + +DELETE FROM `creature_template_addon` WHERE `entry`=23900; +INSERT INTO `creature_template_addon` (`entry`, `bytes2`, `emote`) VALUES (23900,2,384); + +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 42578; +DELETE FROM `spell_script_names` WHERE `ScriptName`="spell_gen_cannon_blast"; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(42578, "spell_gen_cannon_blast"); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 3b45a48c64d..1abb2da344d 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -4324,6 +4324,35 @@ class spell_gen_charmed_unit_spell_cooldown : public SpellScript } }; +enum CannonBlast +{ + SPELL_CANNON_BLAST = 42578, + SPELL_CANNON_BLAST_DAMAGE = 42576 +}; + +class spell_gen_cannon_blast : public SpellScript +{ + PrepareSpellScript(spell_gen_cannon_blast); + + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo({ SPELL_CANNON_BLAST }); + } + void HandleScript(SpellEffIndex effIndex) + { + int32 bp = GetSpellInfo()->Effects[effIndex].CalcValue(); + Unit* target = GetHitUnit(); + CastSpellExtraArgs args(TRIGGERED_FULL_MASK); + args.AddSpellBP0(bp); + target->CastSpell(target, SPELL_CANNON_BLAST_DAMAGE, args); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_gen_cannon_blast::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_generic_spell_scripts() { RegisterAuraScript(spell_gen_absorb0_hitlimit1); @@ -4451,4 +4480,5 @@ void AddSC_generic_spell_scripts() RegisterAuraScript(spell_gen_vehicle_control_link); RegisterSpellScript(spell_freezing_circle); RegisterSpellScript(spell_gen_charmed_unit_spell_cooldown); + RegisterSpellScript(spell_gen_cannon_blast); } |