mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 17:27:36 +01:00
Core/Spells: Use SpellDifficulty.dbc to check casterAuraSpell, excludeCasterAuraSpell, targetAuraSpell and excludeTargetAuraSpell
Scripts/Icecrown Citadel: Fixed Mutated Abomination not being able to eat ooze on heroic mode Scripts/Icecrown Citadel: Removed some obsolete code Closes #523, #1447
This commit is contained in:
@@ -513,9 +513,8 @@ class spell_blood_queen_vampiric_bite : public SpellScriptLoader
|
||||
if (GetCaster()->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
SpellEntry const* spell = sSpellStore.LookupEntry(SPELL_FRENZIED_BLOODTHIRST);
|
||||
spell = sSpellMgr->GetSpellForDifficultyFromSpell(spell, GetCaster());
|
||||
GetCaster()->RemoveAura(spell->Id, 0, 0, AURA_REMOVE_BY_ENEMY_SPELL);
|
||||
uint32 spellId = sSpellMgr->GetSpellIdForDifficulty(SPELL_FRENZIED_BLOODTHIRST, GetCaster());
|
||||
GetCaster()->RemoveAura(spellId, 0, 0, AURA_REMOVE_BY_ENEMY_SPELL);
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_PLR, true);
|
||||
// Presence of the Darkfallen buff on Blood-Queen
|
||||
if (GetCaster()->GetMap()->IsHeroic())
|
||||
|
||||
@@ -1188,7 +1188,7 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader
|
||||
|
||||
// set the upper cap
|
||||
if (targetsAtRange < minTargets)
|
||||
targetsAtRange = std::min<uint32>(unitList.size()-1, minTargets);
|
||||
targetsAtRange = std::min<uint32>(unitList.size() - 1, minTargets);
|
||||
|
||||
std::list<Unit*>::iterator itr = unitList.begin();
|
||||
std::advance(itr, urand(0, targetsAtRange));
|
||||
|
||||
@@ -351,17 +351,18 @@ class spell_festergut_pungent_blight : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_festergut_pungent_blight_SpellScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(uint32(GetEffectValue()));
|
||||
if (!spellInfo || GetCaster()->GetTypeId() != TYPEID_UNIT)
|
||||
return;
|
||||
|
||||
// Get Inhaled Blight id for our difficulty
|
||||
spellInfo = sSpellMgr->GetSpellForDifficultyFromSpell(spellInfo, GetCaster());
|
||||
uint32 blightId = sSpellMgr->GetSpellIdForDifficulty(uint32(GetEffectValue()), GetCaster());
|
||||
|
||||
// ...and remove it
|
||||
GetCaster()->RemoveAurasDueToSpell(spellInfo->Id);
|
||||
GetCaster()->RemoveAurasDueToSpell(blightId);
|
||||
GetCaster()->ToCreature()->AI()->Talk(EMOTE_PUNGENT_BLIGHT);
|
||||
}
|
||||
|
||||
@@ -431,15 +432,16 @@ class spell_festergut_blighted_spores : public SpellScriptLoader
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Load()
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void ExtraEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetCaster()->GetTypeId() != TYPEID_UNIT)
|
||||
return;
|
||||
|
||||
SpellEntry const* inoculated = sSpellStore.LookupEntry(SPELL_INOCULATED);
|
||||
inoculated = sSpellMgr->GetSpellForDifficultyFromSpell(inoculated, GetCaster());
|
||||
uint32 inoculatedId = sSpellMgr->GetSpellIdForDifficulty(SPELL_INOCULATED, GetCaster());
|
||||
uint32 currStack = 0;
|
||||
if (Aura const* inoculate = GetTarget()->GetAura(inoculated->Id))
|
||||
if (Aura const* inoculate = GetTarget()->GetAura(inoculatedId))
|
||||
currStack = inoculate->GetStackAmount();
|
||||
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_INOCULATED, true);
|
||||
|
||||
@@ -334,17 +334,15 @@ class boss_professor_putricide : public CreatureScript
|
||||
case PHASE_COMBAT_2:
|
||||
{
|
||||
SpellEntry const* spell = sSpellStore.LookupEntry(SPELL_CREATE_CONCOCTION);
|
||||
spell = sSpellMgr->GetSpellForDifficultyFromSpell(spell, me);
|
||||
DoCast(me, SPELL_CREATE_CONCOCTION);
|
||||
events.ScheduleEvent(EVENT_PHASE_TRANSITION, GetSpellCastTime(spell)+100);
|
||||
events.ScheduleEvent(EVENT_PHASE_TRANSITION, GetSpellCastTime(sSpellMgr->GetSpellForDifficultyFromSpell(spell, me)) + 100);
|
||||
break;
|
||||
}
|
||||
case PHASE_COMBAT_3:
|
||||
{
|
||||
SpellEntry const* spell = sSpellStore.LookupEntry(SPELL_GUZZLE_POTIONS);
|
||||
spell = sSpellMgr->GetSpellForDifficultyFromSpell(spell, me);
|
||||
DoCast(me, SPELL_GUZZLE_POTIONS);
|
||||
events.ScheduleEvent(EVENT_PHASE_TRANSITION, GetSpellCastTime(spell)+100);
|
||||
events.ScheduleEvent(EVENT_PHASE_TRANSITION, GetSpellCastTime(sSpellMgr->GetSpellForDifficultyFromSpell(spell, me)) + 100);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -869,9 +867,8 @@ class spell_putricide_expunged_gas : public SpellScriptLoader
|
||||
return;
|
||||
|
||||
int32 dmg = 0;
|
||||
SpellEntry const* bloat = sSpellStore.LookupEntry(SPELL_GASEOUS_BLOAT);
|
||||
bloat = sSpellMgr->GetSpellForDifficultyFromSpell(bloat, GetCaster());
|
||||
if (Aura* gasBloat = GetTargetUnit()->GetAura(bloat->Id))
|
||||
uint32 bloatId = sSpellMgr->GetSpellIdForDifficulty(SPELL_GASEOUS_BLOAT, GetCaster());
|
||||
if (Aura* gasBloat = GetTargetUnit()->GetAura(bloatId))
|
||||
{
|
||||
uint32 stack = gasBloat->GetStackAmount();
|
||||
int32 const mod = (GetCaster()->GetMap()->GetSpawnMode() & 1) ? 1500 : 1250;
|
||||
@@ -1026,12 +1023,11 @@ class spell_putricide_ooze_eruption_searcher : public SpellScriptLoader
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
SpellEntry const* adhesive = sSpellStore.LookupEntry(SPELL_VOLATILE_OOZE_ADHESIVE);
|
||||
adhesive = sSpellMgr->GetSpellForDifficultyFromSpell(adhesive, GetCaster());
|
||||
if (GetHitUnit()->HasAura(adhesive->Id))
|
||||
uint32 adhesiveId = sSpellMgr->GetSpellIdForDifficulty(SPELL_VOLATILE_OOZE_ADHESIVE, GetCaster());
|
||||
if (GetHitUnit()->HasAura(adhesiveId))
|
||||
{
|
||||
GetCaster()->CastSpell(GetHitUnit(), SPELL_OOZE_ERUPTION, true);
|
||||
GetHitUnit()->RemoveAurasDueToSpell(adhesive->Id, GetCaster()->GetGUID(), 0, AURA_REMOVE_BY_ENEMY_SPELL);
|
||||
GetHitUnit()->RemoveAurasDueToSpell(adhesiveId, GetCaster()->GetGUID(), 0, AURA_REMOVE_BY_ENEMY_SPELL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1108,21 +1104,21 @@ class spell_putricide_unbound_plague : public SpellScriptLoader
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
SpellEntry const* plague = sSpellMgr->GetSpellForDifficultyFromSpell(sSpellStore.LookupEntry(SPELL_UNBOUND_PLAGUE), GetCaster());
|
||||
SpellEntry const* searcher = sSpellMgr->GetSpellForDifficultyFromSpell(sSpellStore.LookupEntry(SPELL_UNBOUND_PLAGUE_SEARCHER), GetCaster());
|
||||
uint32 plagueId = sSpellMgr->GetSpellIdForDifficulty(SPELL_UNBOUND_PLAGUE, GetCaster());
|
||||
uint32 searcherId = sSpellMgr->GetSpellIdForDifficulty(SPELL_UNBOUND_PLAGUE_SEARCHER, GetCaster());
|
||||
|
||||
if (!GetHitUnit()->HasAura(plague->Id))
|
||||
if (!GetHitUnit()->HasAura(plagueId))
|
||||
{
|
||||
if (Creature* professor = ObjectAccessor::GetCreature(*GetCaster(), instance->GetData64(DATA_PROFESSOR_PUTRICIDE)))
|
||||
{
|
||||
if (Aura* oldPlague = GetCaster()->GetAura(plague->Id, professor->GetGUID()))
|
||||
if (Aura* oldPlague = GetCaster()->GetAura(plagueId, professor->GetGUID()))
|
||||
{
|
||||
if (Aura* newPlague = professor->AddAura(plague->Id, GetHitUnit()))
|
||||
if (Aura* newPlague = professor->AddAura(plagueId, GetHitUnit()))
|
||||
{
|
||||
newPlague->SetMaxDuration(oldPlague->GetDuration());
|
||||
newPlague->SetDuration(oldPlague->GetDuration());
|
||||
oldPlague->Remove();
|
||||
GetCaster()->RemoveAurasDueToSpell(searcher->Id);
|
||||
GetCaster()->RemoveAurasDueToSpell(searcherId);
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_PLAGUE_SICKNESS, true);
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_UNBOUND_PLAGUE_PROTECTION, true);
|
||||
professor->CastSpell(GetHitUnit(), SPELL_UNBOUND_PLAGUE_SEARCHER, true);
|
||||
|
||||
@@ -159,25 +159,6 @@ class boss_rotface : public CreatureScript
|
||||
// don't enter combat
|
||||
}
|
||||
|
||||
Unit* GetAuraEffectTriggerTarget(uint32 spellId, uint8 /*effIndex*/)
|
||||
{
|
||||
if (spellId == SPELL_SLIME_SPRAY)
|
||||
{
|
||||
for (std::list<uint64>::iterator itr = summons.begin(); itr != summons.end();)
|
||||
{
|
||||
Creature *summon = Unit::GetCreature(*me, *itr);
|
||||
if (!summon)
|
||||
summons.erase(itr++);
|
||||
else if (summon->GetEntry() == NPC_OOZE_SPRAY_STALKER)
|
||||
return summon;
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim() || !CheckInRoom())
|
||||
@@ -195,11 +176,9 @@ class boss_rotface : public CreatureScript
|
||||
case EVENT_SLIME_SPRAY:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true))
|
||||
{
|
||||
Position pos;
|
||||
target->GetPosition(&pos);
|
||||
DoSummon(NPC_OOZE_SPRAY_STALKER, pos, 8000, TEMPSUMMON_TIMED_DESPAWN);
|
||||
DoSummon(NPC_OOZE_SPRAY_STALKER, *target, 8000, TEMPSUMMON_TIMED_DESPAWN);
|
||||
Talk(EMOTE_SLIME_SPRAY);
|
||||
DoCastAOE(SPELL_SLIME_SPRAY);
|
||||
DoCast(me, SPELL_SLIME_SPRAY);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SLIME_SPRAY, 20000);
|
||||
break;
|
||||
|
||||
@@ -323,17 +323,17 @@ class boss_sindragosa : public CreatureScript
|
||||
|
||||
void SpellHitTarget(Unit* target, SpellEntry const* spell)
|
||||
{
|
||||
if (SpellEntry const* buffet = sSpellMgr->GetSpellForDifficultyFromSpell(sSpellStore.LookupEntry(70127), me))
|
||||
if (buffet->Id == spell->Id)
|
||||
if (uint32 spellId = sSpellMgr->GetSpellIdForDifficulty(70127, me))
|
||||
if (spellId == spell->Id)
|
||||
if (Aura const* mysticBuffet = target->GetAura(spell->Id))
|
||||
_mysticBuffetStack = std::max<uint8>(_mysticBuffetStack, mysticBuffet->GetStackAmount());
|
||||
|
||||
// Frost Infusion
|
||||
if (Player* player = target->ToPlayer())
|
||||
{
|
||||
if (SpellEntry const* breath = sSpellMgr->GetSpellForDifficultyFromSpell(sSpellStore.LookupEntry(_isThirdPhase ? SPELL_FROST_BREATH_P2 : SPELL_FROST_BREATH_P1), me))
|
||||
if (uint32 spellId = sSpellMgr->GetSpellIdForDifficulty(_isThirdPhase ? SPELL_FROST_BREATH_P2 : SPELL_FROST_BREATH_P1, me))
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_FROST_INFUSION) != QUEST_STATUS_REWARDED && breath->Id == spell->Id)
|
||||
if (player->GetQuestStatus(QUEST_FROST_INFUSION) != QUEST_STATUS_REWARDED && spellId == spell->Id)
|
||||
{
|
||||
if (Item* shadowsEdge = player->GetWeaponForAttack(BASE_ATTACK, true))
|
||||
{
|
||||
|
||||
@@ -914,7 +914,7 @@ class npc_crok_scourgebane : public CreatureScript
|
||||
SetDespawnAtEnd(false);
|
||||
SetDespawnAtFar(false);
|
||||
_isEventActive = false;
|
||||
_isEventDone = false;
|
||||
_isEventDone = _instance->GetBossState(DATA_SISTER_SVALNA) == DONE;
|
||||
_didUnderTenPercentText = false;
|
||||
}
|
||||
|
||||
@@ -939,7 +939,7 @@ class npc_crok_scourgebane : public CreatureScript
|
||||
_isEventDone = true;
|
||||
// Load Grid with Sister Svalna
|
||||
me->GetMap()->LoadGrid(4356.71f, 2484.33f);
|
||||
if (Creature* svalna = me->FindNearestCreature(NPC_SISTER_SVALNA, 333.0f, true))
|
||||
if (Creature* svalna = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_SISTER_SVALNA)))
|
||||
svalna->AI()->DoAction(ACTION_START_GAUNTLET);
|
||||
Talk(SAY_CROK_INTRO_1);
|
||||
_events.ScheduleEvent(EVENT_ARNATH_INTRO_2, 7000);
|
||||
@@ -953,7 +953,7 @@ class npc_crok_scourgebane : public CreatureScript
|
||||
else if (action == ACTION_RESET_EVENT)
|
||||
{
|
||||
_isEventActive = false;
|
||||
_isEventDone = false;
|
||||
_isEventDone = _instance->GetBossState(DATA_SISTER_SVALNA) == DONE;
|
||||
me->setActive(false);
|
||||
_aliveTrash.clear();
|
||||
_currentWPid = 0;
|
||||
|
||||
Reference in New Issue
Block a user