Scripts/Spells: Rework Fire Bomb (Halaa) (#28025)

This commit is contained in:
offl
2022-06-12 23:27:05 +03:00
committed by GitHub
parent b52e0ccbad
commit b5194a1527
2 changed files with 101 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
--
UPDATE `creature_template` SET `speed_walk` = 1, `minlevel` = 65, `maxlevel` = 65, `unit_flags` = 33554944 WHERE `entry` = 18225;
DELETE FROM `creature_template_movement` WHERE `CreatureId` = 18225;
INSERT INTO `creature_template_movement` (`CreatureId`,`Ground`,`Swim`,`Flight`,`Rooted`,`Chase`,`Random`) VALUES
(18225,1,0,1,0,0,0);
DELETE FROM `smart_scripts` WHERE `entryorguid` = 18225 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`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(18225,0,0,0,11,0,100,0,0,0,0,0,0,11,31959,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Fire Bomb Target - On Spawn - Cast 'Fire Bomb Target Summon Trigger'");
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_nagrand_fire_bomb_target_summon_trigger','spell_nagrand_fire_bomb_target_summon_effect','spell_nagrand_fire_bomb_damage_missile');
DELETE FROM `spell_script_names` WHERE `spell_id` = 34658 AND `ScriptName` = 'spell_gen_despawn_aura';
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(31959,'spell_nagrand_fire_bomb_target_summon_trigger'),
(31960,'spell_nagrand_fire_bomb_target_summon_effect'),
(31961,'spell_nagrand_fire_bomb_damage_missile'),
(34658,'spell_gen_despawn_aura');
DELETE FROM `spell_custom_attr` WHERE `entry` = 31960;
INSERT INTO `spell_custom_attr` (`entry`, `attributes`) VALUES
(31960,262144);

View File

@@ -34,6 +34,7 @@ EndContentData */
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
#include "SpellInfo.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
/*######
@@ -703,10 +704,88 @@ public:
}
};
enum FireBomb
{
SPELL_FIRE_BOMB_TARGET_SUMMON_EFFECT = 31960,
SPELL_FIRE_BOMB_DAMAGE_MISSILE = 31961,
SPELL_FIRE_BOMB_SUMMON_CATAPULT_BLAZE = 31963,
SPELL_FIRE_BOMB_FLAMES = 34658
};
// 31959 - Fire Bomb Target Summon Trigger
class spell_nagrand_fire_bomb_target_summon_trigger : public SpellScript
{
PrepareSpellScript(spell_nagrand_fire_bomb_target_summon_trigger);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_FIRE_BOMB_TARGET_SUMMON_EFFECT });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (TempSummon* casterSummon = GetCaster()->ToTempSummon())
if (Unit* summoner = casterSummon->GetSummonerUnit())
casterSummon->CastSpell(summoner, SPELL_FIRE_BOMB_TARGET_SUMMON_EFFECT);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_nagrand_fire_bomb_target_summon_trigger::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
// 31960 - Fire Bomb Target Summon Effect
class spell_nagrand_fire_bomb_target_summon_effect : public SpellScript
{
PrepareSpellScript(spell_nagrand_fire_bomb_target_summon_effect);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_FIRE_BOMB_DAMAGE_MISSILE });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
GetHitUnit()->CastSpell(GetCaster(), SPELL_FIRE_BOMB_DAMAGE_MISSILE);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_nagrand_fire_bomb_target_summon_effect::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
// 31961 - Fire Bomb
class spell_nagrand_fire_bomb_damage_missile : public SpellScript
{
PrepareSpellScript(spell_nagrand_fire_bomb_damage_missile);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_FIRE_BOMB_SUMMON_CATAPULT_BLAZE, SPELL_FIRE_BOMB_FLAMES });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
Unit* target = GetHitUnit();
target->CastSpell(target, SPELL_FIRE_BOMB_SUMMON_CATAPULT_BLAZE);
target->CastSpell(target, SPELL_FIRE_BOMB_FLAMES);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_nagrand_fire_bomb_damage_missile::HandleScript, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
void AddSC_nagrand()
{
new npc_maghar_captive();
new npc_kurenai_captive();
new npc_nagrand_banner();
new condition_nagrand_banner();
RegisterSpellScript(spell_nagrand_fire_bomb_target_summon_trigger);
RegisterSpellScript(spell_nagrand_fire_bomb_target_summon_effect);
RegisterSpellScript(spell_nagrand_fire_bomb_damage_missile);
}