aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2011-05-17 13:17:42 +0200
committerShauren <shauren.trinity@gmail.com>2011-05-17 13:17:42 +0200
commit63f7a6d3d91c0181d753e8ed8e6bbb97aaed4adb (patch)
treecd392fac53bae989a75fc2e2c351863267737370 /src/server/scripts
parent2086eb37e8c865f28d8b239ac920ba4e63860fde (diff)
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
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp5
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp2
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp26
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp30
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp25
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp8
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp6
7 files changed, 39 insertions, 63 deletions
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp
index 6a72b9c87bd..f20a90b369b 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp
@@ -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())
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
index 2f533719696..a2dc0127732 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
@@ -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));
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp
index a16b2120aef..5f1688f1a16 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp
@@ -351,17 +351,18 @@ class spell_festergut_pungent_blight : public SpellScriptLoader
{
PrepareSpellScript(spell_festergut_pungent_blight_SpellScript);
- void HandleScript(SpellEffIndex /*effIndex*/)
+ bool Load()
{
- SpellEntry const* spellInfo = sSpellStore.LookupEntry(uint32(GetEffectValue()));
- if (!spellInfo || GetCaster()->GetTypeId() != TYPEID_UNIT)
- return;
+ return GetCaster()->GetTypeId() == TYPEID_UNIT;
+ }
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
// 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;
}
- void ExtraEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ bool Load()
{
- if (GetCaster()->GetTypeId() != TYPEID_UNIT)
- return;
+ return GetCaster()->GetTypeId() == TYPEID_UNIT;
+ }
- SpellEntry const* inoculated = sSpellStore.LookupEntry(SPELL_INOCULATED);
- inoculated = sSpellMgr->GetSpellForDifficultyFromSpell(inoculated, GetCaster());
+ void ExtraEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ 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);
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
index 0e5c9bea4db..9db92d10d6c 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
@@ -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);
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp
index 2db5bf37f06..b20e7817bfe 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp
@@ -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;
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
index a369f6947a7..6ccdb6e6de9 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
@@ -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))
{
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
index 1ffee145667..1f450f5213f 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
@@ -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;