Skip to content

Commit 673365f

Browse files
committed
Fix Ignite for old client versions.
Closes vmangos#3049
1 parent ded23a0 commit 673365f

3 files changed

Lines changed: 113 additions & 74 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
DROP PROCEDURE IF EXISTS add_migration;
2+
DELIMITER ??
3+
CREATE PROCEDURE `add_migration`()
4+
BEGIN
5+
DECLARE v INT DEFAULT 1;
6+
SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20250529103629');
7+
IF v = 0 THEN
8+
INSERT INTO `migrations` VALUES ('20250529103629');
9+
-- Add your query below.
10+
11+
12+
-- Fix ignite for old client versions.
13+
UPDATE `spell_template` SET `script_name`='spell_mage_ignite' WHERE `entry` IN (11119, 11120, 12846, 12847, 12848);
14+
UPDATE `spell_proc_event` SET `procFlags`=65536 WHERE `entry`=11119;
15+
16+
17+
-- End of migration.
18+
END IF;
19+
END??
20+
DELIMITER ;
21+
CALL add_migration();
22+
DROP PROCEDURE IF EXISTS add_migration;

src/game/UnitAuraProcHandler.cpp

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -862,80 +862,6 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 amount, uint
862862
}
863863
switch (dummySpell->Id)
864864
{
865-
// Ignite
866-
case 11119:
867-
case 11120:
868-
case 12846:
869-
case 12847:
870-
case 12848:
871-
{
872-
uint32 totalDamage = originalAmount;
873-
874-
switch (dummySpell->Id)
875-
{
876-
case 11119:
877-
basepoints[0] = int32(0.04f * totalDamage);
878-
break;
879-
case 11120:
880-
basepoints[0] = int32(0.08f * totalDamage);
881-
break;
882-
case 12846:
883-
basepoints[0] = int32(0.12f * totalDamage);
884-
break;
885-
case 12847:
886-
basepoints[0] = int32(0.16f * totalDamage);
887-
break;
888-
case 12848:
889-
basepoints[0] = int32(0.20f * totalDamage);
890-
break;
891-
default:
892-
sLog.Out(LOG_BASIC, LOG_LVL_ERROR, "Unit::HandleDummyAuraProc: non handled spell id: %u (IG)", dummySpell->Id);
893-
return SPELL_AURA_PROC_FAILED;
894-
}
895-
896-
// Get current Ignite Aura if exist
897-
Aura* igniteAura = target->GetAura(12654, EFFECT_INDEX_0);
898-
899-
if (igniteAura)
900-
{
901-
Modifier *igniteModifier = igniteAura->GetModifier();
902-
SpellAuraHolder* igniteHolder = igniteAura->GetHolder();
903-
904-
int32 tickDamage = igniteModifier->m_amount;
905-
906-
bool notAtMaxStack = igniteAura->GetStackAmount() < 5;
907-
908-
bool reapplyIgnite = igniteAura->GetAuraTicks() >= igniteAura->GetAuraMaxTicks();
909-
910-
if (!reapplyIgnite)
911-
{
912-
if (notAtMaxStack)
913-
{
914-
tickDamage += basepoints[0];
915-
916-
igniteHolder->ModStackAmount(1);
917-
918-
// Update DOT damage
919-
igniteModifier->m_amount = tickDamage;
920-
igniteAura->ApplyModifier(true, true, false);
921-
}
922-
else
923-
igniteHolder->SetStackAmount(5);
924-
925-
// Refresh Ignite Stack
926-
igniteHolder->Refresh(igniteAura->GetCaster(), target, igniteHolder);
927-
928-
return SPELL_AURA_PROC_OK;
929-
}
930-
931-
// All damage done, remove and continue to reapply
932-
target->RemoveAurasDueToSpell(12654);
933-
}
934-
935-
// No Ignite found, apply Ignite Aura
936-
triggered_spell_id = 12654;
937-
break;
938-
}
939865
// Combustion
940866
case 11129:
941867
{

src/scripts/spells/spell_mage.cpp

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,92 @@ SpellScript* GetScript_MageColdSnap(SpellEntry const*)
4747
return new MageColdSnapScript();
4848
}
4949

50+
// 11119, 11120, 12846, 12847, 12848 - Ignite
51+
struct MageIgniteScript : public AuraScript
52+
{
53+
enum
54+
{
55+
SPELL_DOT = 12654,
56+
SPELL_TALENT_RANK_1 = 11119,
57+
SPELL_TALENT_RANK_2 = 11120,
58+
SPELL_TALENT_RANK_3 = 12846,
59+
SPELL_TALENT_RANK_4 = 12847,
60+
SPELL_TALENT_RANK_5 = 12848,
61+
};
62+
63+
optional<SpellAuraProcResult> OnProc(Unit* pOwner, Unit* pVictim, uint32 /*amount*/, int32 originalAmount, Aura* triggeredByAura, SpellEntry const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 cooldown) final
64+
{
65+
uint32 totalDamage = originalAmount;
66+
int32 basePoints[MAX_SPELL_EFFECTS] = {};
67+
68+
switch (triggeredByAura->GetSpellProto()->Id)
69+
{
70+
case SPELL_TALENT_RANK_1:
71+
basePoints[0] = int32(0.04f * totalDamage);
72+
break;
73+
case SPELL_TALENT_RANK_2:
74+
basePoints[0] = int32(0.08f * totalDamage);
75+
break;
76+
case SPELL_TALENT_RANK_3:
77+
basePoints[0] = int32(0.12f * totalDamage);
78+
break;
79+
case SPELL_TALENT_RANK_4:
80+
basePoints[0] = int32(0.16f * totalDamage);
81+
break;
82+
case SPELL_TALENT_RANK_5:
83+
basePoints[0] = int32(0.20f * totalDamage);
84+
break;
85+
default:
86+
sLog.Out(LOG_BASIC, LOG_LVL_ERROR, "MageIgniteScript: non handled spell id: %u", triggeredByAura->GetId());
87+
return SPELL_AURA_PROC_FAILED;
88+
}
89+
90+
// Get current Ignite Aura if exist
91+
Aura* igniteAura = pVictim->GetAura(SPELL_DOT, EFFECT_INDEX_0);
92+
93+
if (igniteAura)
94+
{
95+
Modifier *igniteModifier = igniteAura->GetModifier();
96+
SpellAuraHolder* igniteHolder = igniteAura->GetHolder();
97+
98+
int32 tickDamage = igniteModifier->m_amount;
99+
bool notAtMaxStack = igniteAura->GetStackAmount() < 5;
100+
bool reapplyIgnite = igniteAura->GetAuraTicks() >= igniteAura->GetAuraMaxTicks();
101+
102+
if (!reapplyIgnite)
103+
{
104+
if (notAtMaxStack)
105+
{
106+
tickDamage += basePoints[0];
107+
igniteHolder->ModStackAmount(1);
108+
109+
// Update DOT damage
110+
igniteModifier->m_amount = tickDamage;
111+
igniteAura->ApplyModifier(true, true, false);
112+
}
113+
else
114+
igniteHolder->SetStackAmount(5);
115+
116+
// Refresh Ignite Stack
117+
igniteHolder->Refresh(igniteAura->GetCaster(), pVictim, igniteHolder);
118+
119+
return SPELL_AURA_PROC_OK;
120+
}
121+
122+
// All damage done, remove and continue to reapply
123+
pVictim->RemoveAurasDueToSpell(SPELL_DOT);
124+
}
125+
126+
// No Ignite found, apply Ignite Aura
127+
return pOwner->TriggerProccedSpell(pVictim, basePoints, SPELL_DOT, nullptr, triggeredByAura, cooldown);
128+
}
129+
};
130+
131+
AuraScript* GetScript_MageIgnite(SpellEntry const*)
132+
{
133+
return new MageIgniteScript();
134+
}
135+
50136
void AddSC_mage_spell_scripts()
51137
{
52138
Script* newscript;
@@ -55,4 +141,9 @@ void AddSC_mage_spell_scripts()
55141
newscript->Name = "spell_mage_cold_snap";
56142
newscript->GetSpellScript = &GetScript_MageColdSnap;
57143
newscript->RegisterSelf();
144+
145+
newscript = new Script;
146+
newscript->Name = "spell_mage_ignite";
147+
newscript->GetAuraScript = &GetScript_MageIgnite;
148+
newscript->RegisterSelf();
58149
}

0 commit comments

Comments
 (0)