Skip to content

Commit

Permalink
[c12885] Implement sanity spells for Yogg-Saron encounter
Browse files Browse the repository at this point in the history
Limit target: 63830
Implement dummy aura: 63122 and 63050
Implement spell effects: 64555, 63122, 63795, 65301, 63803, 64164, 64168, 64059

Also
Set positive targets for 63745 and 63747, and update aura proc 63305

(based on commit [12687] - a6ec811)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>
  • Loading branch information
xfurry committed Aug 13, 2014
1 parent ccd42d5 commit 536f9a9
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/game/Spell.cpp
Expand Up @@ -7990,6 +7990,7 @@ void Spell::GetSpellRangeAndRadius(SpellEffectEntry const* spellEffect, float& r
case 63747: // Sara's Fervor (Ulduar, Yogg-Saron)
case 63795: // Psychosis (Ulduar, Yogg-Saron)
case 63820: // Summon Scrap Bot Trigger (Ulduar, Mimiron) use for Scrap Bots, hits npc 33856
case 63830: // Malady of the Mind (Ulduar, Yogg-Saron)
case 64218: // Overcharge (VoA, Emalon)
case 64234: // Gravity Bomb (h) (Ulduar, XT-002)
case 64402: // Rocket Strike (Ulduar, Mimiron)
Expand Down
12 changes: 12 additions & 0 deletions src/game/SpellAuras.cpp
Expand Up @@ -2406,6 +2406,9 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
target->setFaction(1990); // Ambient (hostile)
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
return;
case 63122: // Clear Insane
target->RemoveAurasDueToSpell(GetSpellProto()->CalculateSimpleValue(m_effIndex));
return;
case 63624: // Learn a Second Talent Specialization
// Teach Learn Talent Specialization Switches, required for client triggered casts, allow after 30 sec delay
if (target->GetTypeId() == TYPEID_PLAYER)
Expand Down Expand Up @@ -8351,6 +8354,14 @@ void Aura::PeriodicDummyTick()
target->CastSpell(target, 63536, true, NULL, this);
return;
}
case 63050: // Sanity
{
if (GetHolder()->GetStackAmount() <= 25 && !target->HasAura(63752))
target->CastSpell(target, 63752, true);
else if (GetHolder()->GetStackAmount() > 25 && target->HasAura(63752))
target->RemoveAurasDueToSpell(63752);
return;
}
case 63382: // Rapid Burst
{
if (GetAuraTicks() % 2)
Expand Down Expand Up @@ -9064,6 +9075,7 @@ SpellAuraHolder::SpellAuraHolder(SpellEntry const* spellproto, Unit* target, Wor
case 55166: // Tidal Force
case 58914: // Kill Command (pet part)
case 62519: // Attuned to Nature
case 63050: // Sanity
case 64455: // Feral Essence
case 65294: // Empowered
case 71564: // Deadly Precision
Expand Down
52 changes: 52 additions & 0 deletions src/game/SpellEffects.cpp
Expand Up @@ -2832,6 +2832,15 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
m_caster->CastSpell(m_caster, 64540, true);
return;
}
case 64555: // Insane Periodic
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER || unitTarget->HasAura(63050) || unitTarget->HasAura(effect->CalculateSimpleValue()))
return;

m_caster->CastSpell(unitTarget, 64464, true);
m_caster->CastSpell(unitTarget, effect->CalculateSimpleValue(), true);
return;
}
case 64673: // Feral Rush (h)
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
Expand Down Expand Up @@ -8818,6 +8827,14 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
unitTarget->CastSpell(unitTarget, 65347, true);
return;
}
case 63122: // Clear Insane
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;

unitTarget->RemoveAurasDueToSpell(effect->CalculateSimpleValue());
return;
}
case 63633: // Summon Rubble
{
if (!unitTarget)
Expand All @@ -8843,6 +8860,33 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
m_caster->CastSpell(unitTarget, 63036, true);
return;
}
case 63795: // Psychosis
case 65301: // Psychosis (h)
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER || unitTarget->HasAura(effect->CalculateSimpleValue()))
return;

unitTarget->RemoveAuraHolderFromStack(63050, 12);
return;
}
case 63803: // Brain Link
case 64164: // Lunatic Gaze (Yogg)
case 64168: // Lunatic Gaze (Skull)
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;

uint8 removedAmount = 0;
switch (m_spellInfo->Id)
{
case 63803: removedAmount = 2; break;
case 64164: removedAmount = 4; break;
case 64168: removedAmount = 2; break;
}

unitTarget->RemoveAuraHolderFromStack(63050, removedAmount);
return;
}
case 63993: // Cancel Illusion Room Aura
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
Expand All @@ -8852,6 +8896,14 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
unitTarget->RemoveAurasDueToSpell(effect->CalculateSimpleValue());
return;
}
case 64059: // Induce Madness
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER || !unitTarget->HasAura(effect->CalculateSimpleValue()))
return;

unitTarget->RemoveAurasDueToSpell(63050);
return;
}
case 64069: // Match Health (Rank 1)
{
if (!unitTarget)
Expand Down
2 changes: 2 additions & 0 deletions src/game/SpellMgr.cpp
Expand Up @@ -756,6 +756,8 @@ bool IsPositiveEffect(SpellEntry const* spellproto, SpellEffectIndex effIndex)
case 54530: // Opening
case 56099: // Throw Ice
case 62105: // To'kini's Blowgun
case 63745: // Sara's Blessing
case 63747: // Sara's Fervor
case 64402: // Rocket Strike
return true;
default:
Expand Down
3 changes: 3 additions & 0 deletions src/game/UnitAuraProcHandler.cpp
Expand Up @@ -1022,7 +1022,10 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
if (Unit* caster = triggeredByAura->GetCaster())
{
if (caster->GetEntry() != 33943 && caster->GetTypeId() == TYPEID_UNIT)
{
((Creature*)caster)->UpdateEntry(33943);
caster->CastSpell(caster, 64017, true);
}
}

triggered_spell_id = 64039;
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12884"
#define REVISION_NR "12885"
#endif // __REVISION_NR_H__

0 comments on commit 536f9a9

Please sign in to comment.