Scripts/BWD: make Magmaw's Lava Parasites fall from above on summon

This commit is contained in:
Ovahlord
2019-05-08 23:54:27 +02:00
parent bc8d6546f3
commit fe35a745c8
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
-- Spells
DELETE FROM `spell_script_names` WHERE `ScriptName` IN
('spell_magmaw_lava_parasite_summon');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(77969, 'spell_magmaw_lava_parasite_summon');

View File

@@ -18,6 +18,7 @@
#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "Spell.h"
#include "SpellScript.h"
#include "SpellAuraEffects.h"
#include "Player.h"
@@ -1181,6 +1182,21 @@ class spell_magmaw_shadow_breath_targeting : public SpellScript
}
};
class spell_magmaw_lava_parasite_summon : public SpellScript
{
PrepareSpellScript(spell_magmaw_lava_parasite_summon);
void SetDest(SpellDestination& dest)
{
dest.RelocateOffset({ 0.0f, 0.0f, frand(13.0f, 15.0f), 0.0f });
}
void Register()
{
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_magmaw_lava_parasite_summon::SetDest, EFFECT_0, TARGET_DEST_DEST_RANDOM);
}
};
class achievement_parasite_evening : public AchievementCriteriaScript
{
public:
@@ -1213,6 +1229,7 @@ void AddSC_boss_magmaw()
RegisterSpellScript(spell_magmaw_eject_passenger_1);
RegisterSpellScript(spell_magmaw_eject_passenger_3);
RegisterAuraScript(spell_magmaw_lava_parasite);
RegisterSpellScript(spell_magmaw_lava_parasite_summon);
RegisterSpellScript(spell_magmaw_blazing_inferno_targeting);
RegisterSpellScript(spell_magmaw_shadow_breath_targeting);
new achievement_parasite_evening();