fix(Core/SSC): Rancid Mushroom mechanic (#18008)

* fix(Core/SSC): Rancid Mushroom mechanic

* missing clear smart_scripts

* build

* build again
This commit is contained in:
Angelo Venturini
2023-12-12 18:29:05 -03:00
committed by GitHub
parent d266bf3d15
commit 18af46d357
2 changed files with 57 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
--
UPDATE `creature_template` SET `scale` = 0.5, `unit_flags` = `unit_flags`|2048|524288, `mechanic_immune_mask` = 1073741823, `AIName` = '', `ScriptName` = 'npc_rancid_mushroom' WHERE `entry` = 22250;
DELETE FROM `spell_script_names` WHERE `spell_id` = 38652 AND `ScriptName` = 'spell_rancid_spore_cloud';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(38652, 'spell_rancid_spore_cloud');
DELETE FROM `smart_scripts` WHERE `entryorguid` = 22250 AND `source_type` = 0;

View File

@@ -22,6 +22,7 @@
#include "SpellScriptLoader.h"
#include "TemporarySummon.h"
#include "serpent_shrine.h"
#include "ScriptedCreature.h"
DoorData const doorData[] =
{
@@ -308,6 +309,52 @@ class spell_serpentshrine_cavern_coilfang_water : public AuraScript
}
};
struct npc_rancid_mushroom : public ScriptedAI
{
npc_rancid_mushroom(Creature* creature) : ScriptedAI(creature) { }
enum Spells : uint32
{
SPELL_GROW = 31698,
SPELL_SPORE_CLOUD = 38652
};
void InitializeAI() override
{
scheduler.Schedule(1150ms, [this](TaskContext context)
{
DoCastSelf(SPELL_GROW);
context.Repeat(1200ms, 3400ms);
})
.Schedule(22950ms, [this](TaskContext /*context*/)
{
DoCastSelf(SPELL_SPORE_CLOUD);
me->KillSelf();
});
}
void UpdateAI(uint32 diff) override
{
scheduler.Update(diff);
}
};
class spell_rancid_spore_cloud : public AuraScript
{
PrepareAuraScript(spell_rancid_spore_cloud);
void HandlePeriodic(AuraEffect const* /*aurEff*/)
{
PreventDefaultAction();
GetCaster()->CastSpell((Unit*)nullptr, GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_rancid_spore_cloud::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
void AddSC_instance_serpentshrine_cavern()
{
new instance_serpent_shrine();
@@ -315,5 +362,7 @@ void AddSC_instance_serpentshrine_cavern()
RegisterSpellAndAuraScriptPair(spell_serpentshrine_cavern_serpentshrine_parasite_trigger, spell_serpentshrine_cavern_serpentshrine_parasite_trigger_aura);
RegisterSpellScript(spell_serpentshrine_cavern_infection);
RegisterSpellScript(spell_serpentshrine_cavern_coilfang_water);
RegisterSerpentShrineAI(npc_rancid_mushroom);
RegisterSpellScript(spell_rancid_spore_cloud);
}