Skip to content

Commit 2d9e0e2

Browse files
authored
Fix Hungarfen mushroom spell bug and behavior (#842)
* Fix Hungarfen mushroom spell and behavior Fix the mushroom spell on Hungarfen not working properly. The spell should leave a cloud that does damage and also applies a DoT debuff. Currently, it's leaving a cloud but you then get an aura that causes all enemies nearby to receive the DoT, and since each DoT stacks per caster, the boss would receive 5 versions of this DoT and die quickly. Also, we shrink the mushrooms when they spawn to start small (correct) but we forgot to shrink them once we reach the shrink timer after they cast their Spore cloud spell (we removed grow but forgot to actually cast shrink). * Use aurascript to fix this
1 parent ea90dbc commit 2d9e0e2

3 files changed

Lines changed: 24 additions & 5 deletions

File tree

sql/scriptdev2/spell.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,8 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
785785
(32173,'spell_entangling_roots'),
786786
(34520,'spell_elemental_power_extractor'),
787787
(35268,'spell_raging_flames_inferno'),
788-
(39346,'spell_raging_flames_inferno');
788+
(39346,'spell_raging_flames_inferno'),
789+
(34168,'spell_spore_cloud_underbog');
789790

790791
-- Wotlk
791792
INSERT INTO spell_scripts(Id, ScriptName) VALUES

src/game/AI/ScriptDevAI/scripts/outland/coilfang_reservoir/underbog/boss_hungarfen.cpp

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ struct boss_hungarfenAI : public CombatAI
6969
DoCastSpellIfCan(nullptr, SPELL_DESPAWN_MUSHROOMS, CAST_TRIGGERED);
7070
}
7171

72+
void EnterEvadeMode() override
73+
{
74+
DoCastSpellIfCan(nullptr, SPELL_DESPAWN_MUSHROOMS, CAST_TRIGGERED);
75+
CombatAI::EnterEvadeMode();
76+
}
77+
7278
void ExecuteAction(uint32 action) override
7379
{
7480
switch (action)
@@ -132,7 +138,7 @@ struct mob_underbog_mushroomAI : public ScriptedAI
132138
{
133139
if (m_uiSporeTimer <= uiDiff)
134140
{
135-
if (DoCastSpellIfCan(m_creature, SPELL_SPORE_CLOUD) == CAST_OK)
141+
if (DoCastSpellIfCan(m_creature, SPELL_SPORE_CLOUD, CAST_INTERRUPT_PREVIOUS | CAST_TRIGGERED | CAST_FORCE_CAST) == CAST_OK)
136142
{
137143
m_uiGrowTimer = 0;
138144
m_uiSporeTimer = 0;
@@ -158,7 +164,8 @@ struct mob_underbog_mushroomAI : public ScriptedAI
158164
if (m_uiShrinkTimer <= uiDiff)
159165
{
160166
m_creature->RemoveAurasDueToSpell(SPELL_GROW);
161-
m_uiShrinkTimer = 0;
167+
if (DoCastSpellIfCan(nullptr, SPELL_SHRINK, CAST_TRIGGERED | CAST_AURA_NOT_PRESENT) == CAST_OK)
168+
m_uiShrinkTimer = 0;
162169
}
163170
else
164171
m_uiShrinkTimer -= uiDiff;
@@ -178,6 +185,16 @@ struct DespawnMushrooms : public SpellScript
178185
}
179186
};
180187

188+
// 34168 - Spore Cloud (Underbog)
189+
struct SporeCloud : public AuraScript
190+
{
191+
void OnPeriodicTrigger(Aura* aura, PeriodicTriggerData& data) const override
192+
{
193+
data.caster = aura->GetCaster();
194+
data.target = aura->GetTarget();
195+
}
196+
};
197+
181198
void AddSC_boss_hungarfen()
182199
{
183200
Script* pNewScript = new Script;
@@ -191,4 +208,5 @@ void AddSC_boss_hungarfen()
191208
pNewScript->RegisterSelf();
192209

193210
RegisterSpellScript<DespawnMushrooms>("spell_despawn_underbog_mushrooms");
211+
RegisterSpellScript<SporeCloud>("spell_spore_cloud_underbog");
194212
}

src/game/Spells/SpellAuras.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1932,8 +1932,8 @@ void Aura::TriggerSpell()
19321932
{
19331933
casterGUID = target->GetObjectGuid();
19341934
break;
1935-
}
1936-
case 38652: // Spore Cloud
1935+
}
1936+
case 38652: // Spore Cloud (SSC)
19371937
case 40106: // Merge
19381938
{
19391939
triggerCaster = GetCaster();

0 commit comments

Comments
 (0)