Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cyberium/89815c9630c21e9aaab90f06d1141a70 to your computer and use it in GitHub Desktop.
Save cyberium/89815c9630c21e9aaab90f06d1141a70 to your computer and use it in GitHub Desktop.
From 4cc97f57cc4baf373ee66710ffd43075b49321c7 Mon Sep 17 00:00:00 2001
From: Roux Patrick-Edouard <by.peroux@gmail.com>
Date: Fri, 1 Sep 2017 21:27:34 +0200
Subject: [PATCH] [SpellAura] Dose flame touched aura on flame sear
Flame sear dots should add stacks of Flame Touched debuff every second.
---
.../sunwell_plateau/boss_eredar_twins.cpp | 63 ++++------------------
src/game/Spells/UnitAuraProcHandler.cpp | 49 +++++++++++++++--
2 files changed, 55 insertions(+), 57 deletions(-)
diff --git a/src/game/AI/ScriptDevAI/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp b/src/game/AI/ScriptDevAI/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp
index 4b76e35a9..ea1693ef6 100644
--- a/src/game/AI/ScriptDevAI/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp
+++ b/src/game/AI/ScriptDevAI/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp
@@ -74,6 +74,9 @@ enum
SPELL_BLAZE = 45235, // On main target every 3 secs; should trigger 45236 which leaves a fire on the ground
SPELL_FLAME_SEAR = 46771, // A few random targets debuff
SPELL_CONFLAGRATION_UNK = 45333, // Unknown
+
+ DARK_FLAME_AURA_ALYTHESS = 47300, // Aura buff that make flame touched spell proc - for Alythess
+ DARK_FLAME_AURA_SCAROLASH = 45343, // Aura buff that make dark touched spell proc - for Scarolash
};
static const DialogueEntry aIntroDialogue[] =
@@ -89,6 +92,7 @@ static const DialogueEntry aIntroDialogue[] =
{0, 0, 0},
};
+
/*######
## boss_alythess
######*/
@@ -121,6 +125,7 @@ struct boss_alythessAI : public ScriptedAI
m_uiBlazeTimer = 1000;
m_uiFlameSearTimer = 5000;
m_bDidIntro = false;
+ DoCastSpellIfCan(m_creature, DARK_FLAME_AURA_ALYTHESS);
}
void JustReachedHome() override
@@ -183,39 +188,13 @@ struct boss_alythessAI : public ScriptedAI
m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
DoScriptText(SAY_SACROLASH_EMPOWER, pSacrolash);
pSacrolash->InterruptNonMeleeSpells(true);
+ pSacrolash->CastSpell(pSacrolash, DARK_FLAME_AURA_ALYTHESS, TRIGGERED_NONE);
pSacrolash->CastSpell(pSacrolash, SPELL_EMPOWER, TRIGGERED_NONE);
}
}
}
}
- void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) override
- {
- if (pTarget->HasAura(SPELL_DARK_FLAME))
- return;
-
- if (pSpell->SchoolMask == SPELL_SCHOOL_MASK_FIRE)
- {
- if (pTarget->HasAura(SPELL_DARK_TOUCHED))
- {
- pTarget->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED);
- pTarget->CastSpell(pTarget, SPELL_DARK_FLAME, TRIGGERED_OLD_TRIGGERED);
- }
- else
- pTarget->CastSpell(pTarget, SPELL_FLAME_TOUCHED, TRIGGERED_OLD_TRIGGERED);
- }
- else if (pSpell->SchoolMask == SPELL_SCHOOL_MASK_SHADOW)
- {
- if (pTarget->HasAura(SPELL_FLAME_TOUCHED))
- {
- pTarget->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
- pTarget->CastSpell(pTarget, SPELL_DARK_FLAME, TRIGGERED_OLD_TRIGGERED);
- }
- else
- pTarget->CastSpell(pTarget, SPELL_DARK_TOUCHED, TRIGGERED_OLD_TRIGGERED);
- }
- }
-
void UpdateAI(const uint32 uiDiff) override
{
if (m_pInstance && m_pInstance->GetData(TYPE_EREDAR_TWINS) == SPECIAL)
@@ -273,6 +252,7 @@ struct boss_alythessAI : public ScriptedAI
{
if (DoCastSpellIfCan(m_creature, SPELL_FLAME_SEAR) == CAST_OK)
m_uiFlameSearTimer = 10000;
+
}
else
m_uiFlameSearTimer -= uiDiff;
@@ -314,6 +294,7 @@ struct boss_sacrolashAI : public ScriptedAI
m_uiConfoundingBlowTimer = 30000;
m_uiShadowBladesTimer = 15000;
m_uiSummonShadowImage = 10000;
+ DoCastSpellIfCan(m_creature, DARK_FLAME_AURA_SCAROLASH);
}
void JustReachedHome() override
@@ -363,39 +344,13 @@ struct boss_sacrolashAI : public ScriptedAI
m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
DoScriptText(SAY_ALYTHESS_EMPOWER, pAlythess);
pAlythess->InterruptNonMeleeSpells(true);
+ pAlythess->CastSpell(pAlythess, DARK_FLAME_AURA_SCAROLASH, TRIGGERED_NONE);
pAlythess->CastSpell(pAlythess, SPELL_EMPOWER, TRIGGERED_NONE);
}
}
}
}
- void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) override
- {
- if (pTarget->HasAura(SPELL_DARK_FLAME))
- return;
-
- if (pSpell->SchoolMask == SPELL_SCHOOL_MASK_FIRE)
- {
- if (pTarget->HasAura(SPELL_DARK_TOUCHED))
- {
- pTarget->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED);
- pTarget->CastSpell(pTarget, SPELL_DARK_FLAME, TRIGGERED_OLD_TRIGGERED);
- }
- else
- pTarget->CastSpell(pTarget, SPELL_FLAME_TOUCHED, TRIGGERED_OLD_TRIGGERED);
- }
- else if (pSpell->SchoolMask == SPELL_SCHOOL_MASK_SHADOW)
- {
- if (pTarget->HasAura(SPELL_FLAME_TOUCHED))
- {
- pTarget->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
- pTarget->CastSpell(pTarget, SPELL_DARK_FLAME, TRIGGERED_OLD_TRIGGERED);
- }
- else
- pTarget->CastSpell(pTarget, SPELL_DARK_TOUCHED, TRIGGERED_OLD_TRIGGERED);
- }
- }
-
// Return a random target which it's not in range of 10 yards of boss
Unit* GetRandomTargetAtDist(float fDist)
{
diff --git a/src/game/Spells/UnitAuraProcHandler.cpp b/src/game/Spells/UnitAuraProcHandler.cpp
index 45806c6d7..056aa6dbc 100644
--- a/src/game/Spells/UnitAuraProcHandler.cpp
+++ b/src/game/Spells/UnitAuraProcHandler.cpp
@@ -1647,6 +1647,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
Item* castItem = triggeredByAura->GetCastItemGuid() && GetTypeId() == TYPEID_PLAYER
? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGuid()) : nullptr;
+
// Try handle unknown trigger spells
// Custom requirements (not listed in procEx) Warning! damage dealing after this
// Custom triggered spells
@@ -1750,12 +1751,54 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
if (int32(GetHealth()) - int32(damage) >= int32(GetMaxHealth() * triggerAmount / 100))
return SPELL_AURA_PROC_FAILED;
break;
- // case 45205: break; // Copy Offhand Weapon
- // case 45343: break; // Dark Flame Aura
+ // case 45205: break; // Copy Offhand Weapon
+ case 47300: // Dark Flame Aura procs from alythess
+
+ if(!procSpell)
+ return SPELL_AURA_PROC_FAILED;
+
+ if (this->HasAura(45345)) // SPELL_DARK_FLAME on player
+ return SPELL_AURA_PROC_FAILED;
+
+ if (procSpell->Id == 46771 // flame sear
+ || procSpell->Id == 45342 // or conflag
+ || procSpell->Id == 45235) // or blaze
+ {
+ cooldown = 1;
+ target = this;
+ if (this->HasAura(45347))
+ {
+ this->RemoveAurasDueToSpell(45347);
+ trigger_spell_id = 45345;
+ }
+ else
+ trigger_spell_id = 45348;
+ }
+ break;
+ case 45343: // Dark Flame Aura proc from scarolash
+ if(!procSpell)
+ return SPELL_AURA_PROC_FAILED;
+
+ if (this->HasAura(45345)) // SPELL_DARK_FLAME on player
+ return SPELL_AURA_PROC_FAILED;
+
+ if (procSpell->Id == 45256 // confunding blow
+ || procSpell->Id == 45248 // shadow blades
+ || procSpell->Id == 45329) // shadow nova
+ {
+ cooldown = 1;
+ target = this;
+ if (this->HasAura(45348))
+ {
+ this->RemoveAurasDueToSpell(45348);
+ trigger_spell_id = 45345;
+ }
+ else
+ trigger_spell_id = 45347;
+ }
// case 45903: break: // Offensive State
// case 46146: break: // [PH] Ahune Spanky Hands
// case 46146: break; // [PH] Ahune Spanky Hands
- // case 47300: break; // Dark Flame Aura
// case 50051: break; // Ethereal Pet Aura
break;
}
--
2.12.2.windows.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment