Scripts/Icecrown Citadel: Add script for Deathbringer Saurfang (only missing alliance outro due to need of spawning and moving a transport)
Scripts/Icecrown Citadel: Corrected Lord Marrowgar, should no longer target tanks with Bone Spike Graveyard, his Coldflame should now spread properly Core/Scripts: Moved Lady Deathwhisper Mana Barrier handler to scripts Core/Scripts: Allow AuraScript to prevent default effects by effect index Core/Scripts: Added Is25ManRaid() method to ScriptedAI, obviously used to check if raid is 25man Core/Achievements: Pass m_caster to UpdateAchievementCriteria for ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET --HG-- branch : trunk
This commit is contained in:
1 parent
97f98e9bbd
commit
73d3f210a9
21 files changed
+1474
-35
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -748,6 +748,34 @@ class npc_vengeful_shade : public CreatureScript
|
||||
}
|
||||
};
|
||||
|
||||
class spell_deathwhisper_mana_barrier : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_deathwhisper_mana_barrier() : SpellScriptLoader("spell_deathwhisper_mana_barrier") { }
|
||||
|
||||
class spell_deathwhisper_mana_barrier_AuraScript : public AuraScript
|
||||
{
|
||||
void HandlePeriodicTick(AuraEffect const * aurEff, AuraApplication const * aurApp)
|
||||
{
|
||||
PreventDefaultAction(EFFECT_0);
|
||||
Unit* caster = GetCaster();
|
||||
int32 missingHealth = caster->GetMaxHealth() - caster->GetHealth();
|
||||
caster->ModifyHealth(missingHealth);
|
||||
caster->ModifyPower(POWER_MANA, -missingHealth);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_deathwhisper_mana_barrier_AuraScript::HandlePeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_deathwhisper_mana_barrier_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_cultist_dark_martyrdom : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -794,5 +822,6 @@ void AddSC_boss_lady_deathwhisper()
|
||||
new npc_cult_fanatic();
|
||||
new npc_cult_adherent();
|
||||
new npc_vengeful_shade();
|
||||
new spell_deathwhisper_mana_barrier();
|
||||
new spell_cultist_dark_martyrdom();
|
||||
}
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "ScriptPCH.h"
|
||||
#include "icecrown_citadel.h"
|
||||
#include "MapManager.h"
|
||||
#include "Spell.h"
|
||||
|
||||
enum eScriptTexts
|
||||
{
|
||||
@@ -85,6 +86,7 @@ class boss_lord_marrowgar : public CreatureScript
|
||||
fBaseSpeed = pCreature->GetSpeedRate(MOVE_RUN);
|
||||
bIntroDone = false;
|
||||
pInstance = pCreature->GetInstanceScript();
|
||||
coldflameLastPos.Relocate(pCreature);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
@@ -161,6 +163,7 @@ class boss_lord_marrowgar : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_BONE_SPIKE_GRAVEYARD, urand(25000, 35000));
|
||||
break;
|
||||
case EVENT_COLDFLAME:
|
||||
coldflameLastPos.Relocate(me);
|
||||
if (!me->HasAura(SPELL_BONE_STORM))
|
||||
DoCast(me, SPELL_COLDFLAME_NORMAL);
|
||||
else
|
||||
@@ -230,6 +233,11 @@ class boss_lord_marrowgar : public CreatureScript
|
||||
DoStartNoMovement(me->getVictim());
|
||||
}
|
||||
|
||||
const Position* GetLastColdflamePosition() const
|
||||
{
|
||||
return &coldflameLastPos;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
EventMap events;
|
||||
@@ -238,6 +246,7 @@ class boss_lord_marrowgar : public CreatureScript
|
||||
uint32 uiBoneStormDuration;
|
||||
float fBaseSpeed;
|
||||
bool bBoneSlice;
|
||||
Position coldflameLastPos;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
@@ -283,7 +292,8 @@ class npc_coldflame : public CreatureScript
|
||||
else
|
||||
{
|
||||
me->GetPosition(x, y, z);
|
||||
float ang = me->GetAngle(owner) - static_cast<float>(M_PI);
|
||||
Position const* ownerPos = CAST_AI(boss_lord_marrowgar::boss_lord_marrowgarAI, owner->ToCreature()->AI())->GetLastColdflamePosition();
|
||||
float ang = me->GetAngle(ownerPos) - static_cast<float>(M_PI);
|
||||
MapManager::NormalizeOrientation(ang);
|
||||
x += 50.0f * cosf(ang);
|
||||
y += 50.0f * sinf(ang);
|
||||
@@ -407,12 +417,24 @@ class spell_marrowgar_coldflame : public SpellScriptLoader
|
||||
{
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
uint8 count = 1;
|
||||
if (GetSpellInfo()->Id == 72705)
|
||||
count = 4;
|
||||
|
||||
SpellCastTargets targets;
|
||||
targets.setUnitTarget(caster);
|
||||
targets.setDst(*caster);
|
||||
|
||||
Spell* spell = NULL;
|
||||
SpellEntry const* spellInfo = NULL;
|
||||
|
||||
for (uint8 i = 0; i < count; ++i)
|
||||
GetCaster()->CastSpell(GetCaster(), SpellMgr::CalculateSpellEffectAmount(GetSpellInfo(), EFFECT_0)+i, true);
|
||||
{
|
||||
spellInfo = sSpellStore.LookupEntry(GetEffectValue()+i);
|
||||
spell = new Spell(caster, spellInfo, true);
|
||||
spell->prepare(&targets);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -450,8 +472,8 @@ class spell_marrowgar_bone_spike_graveyard : public SpellScriptLoader
|
||||
{
|
||||
// select any unit but not the tank
|
||||
Unit* target = marrowgarAI->SelectTarget(SELECT_TARGET_RANDOM, 1, 100.0f, true, -SPELL_IMPALED);
|
||||
if (!target)
|
||||
target = marrowgarAI->SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, -SPELL_IMPALED); // or the tank if its solo
|
||||
if (!target && !i)
|
||||
target = marrowgarAI->SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, -SPELL_IMPALED);
|
||||
if (!target)
|
||||
break;
|
||||
yell = true;
|
||||
|
||||
@@ -39,25 +39,36 @@ enum eData
|
||||
DATA_SINDRAGOSA = 10,
|
||||
DATA_THE_LICH_KING = 11,
|
||||
|
||||
COMMAND_FAIL_BONED
|
||||
COMMAND_FAIL_BONED,
|
||||
DATA_SAURFANG_EVENT_NPC,
|
||||
DATA_SAURFANG_DOOR,
|
||||
};
|
||||
|
||||
#define MAX_ENCOUNTER 12
|
||||
|
||||
enum eCreatures
|
||||
{
|
||||
NPC_LORD_MARROWGAR = 36612,
|
||||
NPC_COLDFLAME = 36672,
|
||||
NPC_BONE_SPIKE = 36619,
|
||||
NPC_LORD_MARROWGAR = 36612,
|
||||
NPC_COLDFLAME = 36672,
|
||||
NPC_BONE_SPIKE = 36619,
|
||||
|
||||
NPC_LADY_DEATHWHISPER = 36855,
|
||||
NPC_CULT_FANATIC = 37890,
|
||||
NPC_DEFORMED_FANATIC = 38135,
|
||||
NPC_REANIMATED_FANATIC = 38009,
|
||||
NPC_CULT_ADHERENT = 37949,
|
||||
NPC_EMPOWERED_ADHERENT = 38136,
|
||||
NPC_REANIMATED_ADHERENT = 38010,
|
||||
NPC_VENGEFUL_SHADE = 38222,
|
||||
NPC_LADY_DEATHWHISPER = 36855,
|
||||
NPC_CULT_FANATIC = 37890,
|
||||
NPC_DEFORMED_FANATIC = 38135,
|
||||
NPC_REANIMATED_FANATIC = 38009,
|
||||
NPC_CULT_ADHERENT = 37949,
|
||||
NPC_EMPOWERED_ADHERENT = 38136,
|
||||
NPC_REANIMATED_ADHERENT = 38010,
|
||||
NPC_VENGEFUL_SHADE = 38222,
|
||||
|
||||
NPC_DEATHBRINGER_SAURFANG = 37813,
|
||||
NPC_BLOOD_BEAST = 38508,
|
||||
NPC_SE_JAINA_PROUDMOORE = 37188, // SE means Saurfang Event
|
||||
NPC_SE_MURADIN_BRONZEBEARD = 37200,
|
||||
NPC_SE_KING_VARIAN_WRYNN = 37879,
|
||||
NPC_SE_HIGH_OVERLORD_SAURFANG = 37187,
|
||||
NPC_SE_KOR_KRON_REAVER = 37920,
|
||||
NPC_SE_SKYBREAKER_MARINE = 37830,
|
||||
};
|
||||
|
||||
enum eGameobjects
|
||||
@@ -67,6 +78,11 @@ enum eGameobjects
|
||||
LORD_MARROWGAR_S_ENTRANCE = 201857,
|
||||
ORATORY_OF_THE_DAMNED_ENTRANCE = 201563,
|
||||
LADY_DEATHWHISPER_ELEVATOR = 202220,
|
||||
SAURFANG_S_DOOR = 201825,
|
||||
DEATHBRINGER_S_CACHE_10N = 202239,
|
||||
DEATHBRINGER_S_CACHE_25N = 202240,
|
||||
DEATHBRINGER_S_CACHE_10H = 202238,
|
||||
DEATHBRINGER_S_CACHE_25H = 202241,
|
||||
};
|
||||
|
||||
enum eAchievementCriteria
|
||||
|
||||
@@ -33,7 +33,11 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
uiMarrowgarEntrance = 0;
|
||||
uiLadyDeathwisperElevator = 0;
|
||||
uiOratoryDoor = 0;
|
||||
isBonedEligible = true;
|
||||
uiDeathbringerSaurfang = 0;
|
||||
uiSaurfangDoor = 0;
|
||||
uiSaurfangEventNPC = 0;
|
||||
uiDeathbringersCache = 0;
|
||||
isBonedEligible = false;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
@@ -45,6 +49,36 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
return false;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature, bool add)
|
||||
{
|
||||
Map::PlayerList const &players = instance->GetPlayers();
|
||||
uint32 TeamInInstance = 0;
|
||||
|
||||
if (!players.isEmpty())
|
||||
{
|
||||
if (Player* pPlayer = players.begin()->getSource())
|
||||
TeamInInstance = pPlayer->GetTeam();
|
||||
}
|
||||
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_DEATHBRINGER_SAURFANG:
|
||||
uiDeathbringerSaurfang = creature->GetGUID();
|
||||
break;
|
||||
case NPC_SE_HIGH_OVERLORD_SAURFANG:
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_SE_MURADIN_BRONZEBEARD, ALLIANCE);
|
||||
case NPC_SE_MURADIN_BRONZEBEARD:
|
||||
uiSaurfangEventNPC = creature->GetGUID();
|
||||
creature->LastUsedScriptID = creature->GetScriptId();
|
||||
break;
|
||||
case NPC_SE_KOR_KRON_REAVER:
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_SE_SKYBREAKER_MARINE, ALLIANCE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool add)
|
||||
{
|
||||
switch (pGo->GetEntry())
|
||||
@@ -77,6 +111,15 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
pGo->SetGoState(GO_STATE_READY);
|
||||
}
|
||||
break;
|
||||
case SAURFANG_S_DOOR:
|
||||
uiSaurfangDoor = pGo->GetGUID();
|
||||
break;
|
||||
case DEATHBRINGER_S_CACHE_10N:
|
||||
case DEATHBRINGER_S_CACHE_25N:
|
||||
case DEATHBRINGER_S_CACHE_10H:
|
||||
case DEATHBRINGER_S_CACHE_25H:
|
||||
uiDeathbringersCache = pGo->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,6 +145,21 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_DEATHBRINGER_SAURFANG:
|
||||
return uiDeathbringerSaurfang;
|
||||
case DATA_SAURFANG_EVENT_NPC:
|
||||
return uiSaurfangEventNPC;
|
||||
case DATA_SAURFANG_DOOR:
|
||||
return uiSaurfangDoor;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
@@ -130,6 +188,8 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
switch(data)
|
||||
{
|
||||
case DONE:
|
||||
// TEMPORARY, UNCOMMMENT IF YOU WANT TO DO SAURFANG AND SKIP GUNSHIP
|
||||
//uiEncounterState[DATA_GUNSHIP_EVENT] = DONE;
|
||||
HandleGameObject(uiOratoryDoor, true);
|
||||
if (GameObject* elevator = instance->GetGameObject(uiLadyDeathwisperElevator))
|
||||
{
|
||||
@@ -146,7 +206,15 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
}
|
||||
break;
|
||||
case DATA_GUNSHIP_EVENT:
|
||||
uiEncounterState[type] = data;
|
||||
break;
|
||||
case DATA_DEATHBRINGER_SAURFANG:
|
||||
uiEncounterState[type] = data;
|
||||
if (data == DONE)
|
||||
if (GameObject* lootCache = instance->GetGameObject(uiDeathbringersCache))
|
||||
if (!lootCache->isSpawned())
|
||||
lootCache->SetRespawnTime(7*DAY);
|
||||
break;
|
||||
case DATA_FESTERGUT:
|
||||
case DATA_ROTFACE:
|
||||
case DATA_PROFESSOR_PUTRICIDE:
|
||||
@@ -230,6 +298,10 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
uint64 uiMarrowgarEntrance;
|
||||
uint64 uiLadyDeathwisperElevator;
|
||||
uint64 uiOratoryDoor;
|
||||
uint64 uiDeathbringerSaurfang;
|
||||
uint64 uiSaurfangDoor;
|
||||
uint64 uiSaurfangEventNPC; // Muradin Bronzebeard or High Overlord Saurfang
|
||||
uint64 uiDeathbringersCache;
|
||||
bool isBonedEligible;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user