mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 11:21:58 +01:00
Scripts/Forge of Souls: Cleaned up code style
Scripts/Forge of Souls: Fixed a possible crash Closes issue #4660. --HG-- branch : trunk
This commit is contained in:
@@ -65,11 +65,16 @@ class boss_bronjahm : public CreatureScript
|
||||
|
||||
struct boss_bronjahmAI : public BossAI
|
||||
{
|
||||
boss_bronjahmAI(Creature* pCreature) : BossAI(pCreature, DATA_BRONJAHM)
|
||||
boss_bronjahmAI(Creature* creature) : BossAI(creature, DATA_BRONJAHM)
|
||||
{
|
||||
// disable AI outside of instance
|
||||
if (!instance)
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(FoSScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
Reset();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
@@ -176,55 +181,55 @@ class boss_bronjahm : public CreatureScript
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature* pCreature) const
|
||||
CreatureAI *GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_bronjahmAI(pCreature);
|
||||
return new boss_bronjahmAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class mob_corrupted_soul_fragment : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_corrupted_soul_fragment() : CreatureScript("mob_corrupted_soul_fragment") { }
|
||||
public:
|
||||
mob_corrupted_soul_fragment() : CreatureScript("mob_corrupted_soul_fragment") { }
|
||||
|
||||
struct mob_corrupted_soul_fragmentAI : public ScriptedAI
|
||||
{
|
||||
mob_corrupted_soul_fragmentAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
struct mob_corrupted_soul_fragmentAI : public ScriptedAI
|
||||
{
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != TARGETED_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
uint64 BronjahmGUID = 0;
|
||||
if (instance)
|
||||
mob_corrupted_soul_fragmentAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
if (TempSummon* summ = me->ToTempSummon())
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != TARGETED_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
uint64 BronjahmGUID = 0;
|
||||
if (instance)
|
||||
{
|
||||
BronjahmGUID = instance->GetData64(DATA_BRONJAHM);
|
||||
if (GUID_LOPART(BronjahmGUID) != id)
|
||||
return;
|
||||
if (TempSummon* summ = me->ToTempSummon())
|
||||
{
|
||||
BronjahmGUID = instance->GetData64(DATA_BRONJAHM);
|
||||
if (GUID_LOPART(BronjahmGUID) != id)
|
||||
return;
|
||||
|
||||
if (Creature* bronjahm = ObjectAccessor::GetCreature(*me, BronjahmGUID))
|
||||
me->CastSpell(bronjahm, SPELL_CONSUME_SOUL, true);
|
||||
if (Creature* bronjahm = ObjectAccessor::GetCreature(*me, BronjahmGUID))
|
||||
me->CastSpell(bronjahm, SPELL_CONSUME_SOUL, true);
|
||||
|
||||
summ->GetMotionMaster()->MoveIdle();
|
||||
summ->UnSummon();
|
||||
summ->GetMotionMaster()->MoveIdle();
|
||||
summ->UnSummon();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
InstanceScript* instance;
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature* creature) const
|
||||
{
|
||||
return new mob_corrupted_soul_fragmentAI(creature);
|
||||
}
|
||||
|
||||
private:
|
||||
InstanceScript* instance;
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature* pCreature) const
|
||||
{
|
||||
return new mob_corrupted_soul_fragmentAI(pCreature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_bronjahm_magic_bane : public SpellScriptLoader
|
||||
|
||||
@@ -67,22 +67,21 @@ enum Spells
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_NONE,
|
||||
EVENT_PHANTOM_BLAST,
|
||||
EVENT_MIRRORED_SOUL,
|
||||
EVENT_WELL_OF_SOULS,
|
||||
EVENT_UNLEASHED_SOULS,
|
||||
EVENT_WAILING_SOULS,
|
||||
EVENT_WAILING_SOULS_TICK,
|
||||
EVENT_FACE_ANGER,
|
||||
EVENT_PHANTOM_BLAST = 1,
|
||||
EVENT_MIRRORED_SOUL = 2,
|
||||
EVENT_WELL_OF_SOULS = 3,
|
||||
EVENT_UNLEASHED_SOULS = 4,
|
||||
EVENT_WAILING_SOULS = 5,
|
||||
EVENT_WAILING_SOULS_TICK = 6,
|
||||
EVENT_FACE_ANGER = 7,
|
||||
};
|
||||
|
||||
enum eEnum
|
||||
{
|
||||
ACHIEV_THREE_FACED = 4523,
|
||||
DISPLAY_ANGER = 30148,
|
||||
DISPLAY_SORROW = 30149,
|
||||
DISPLAY_DESIRE = 30150,
|
||||
ACHIEV_THREE_FACED = 4523,
|
||||
DISPLAY_ANGER = 30148,
|
||||
DISPLAY_SORROW = 30149,
|
||||
DISPLAY_DESIRE = 30150,
|
||||
};
|
||||
|
||||
struct outroPosition
|
||||
@@ -119,231 +118,247 @@ struct outroPosition
|
||||
|
||||
class boss_devourer_of_souls : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_devourer_of_souls() : CreatureScript("boss_devourer_of_souls") { }
|
||||
public:
|
||||
boss_devourer_of_souls() : CreatureScript("boss_devourer_of_souls") { }
|
||||
|
||||
struct boss_devourer_of_soulsAI : public BossAI
|
||||
{
|
||||
boss_devourer_of_soulsAI(Creature *c) : BossAI(c, DATA_DEVOURER_EVENT)
|
||||
struct boss_devourer_of_soulsAI : public BossAI
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
bool bThreeFaceAchievement;
|
||||
|
||||
InstanceScript* pInstance;
|
||||
|
||||
// wailing soul event
|
||||
float beamAngle;
|
||||
float beamAngleDiff;
|
||||
int8 wailingSoulTick;
|
||||
|
||||
uint64 uiMirroredSoulTarget;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
me->SetDisplayId(DISPLAY_ANGER);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
|
||||
events.Reset();
|
||||
|
||||
bThreeFaceAchievement = true;
|
||||
uiMirroredSoulTarget = 0;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_DEVOURER_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_DEVOURER_EVENT, IN_PROGRESS);
|
||||
|
||||
DoScriptText(RAND(SAY_FACE_ANGER_AGGRO,SAY_FACE_DESIRE_AGGRO), me);
|
||||
|
||||
events.ScheduleEvent(EVENT_PHANTOM_BLAST, 5000);
|
||||
events.ScheduleEvent(EVENT_MIRRORED_SOUL, 8000);
|
||||
events.ScheduleEvent(EVENT_WELL_OF_SOULS, 30000);
|
||||
events.ScheduleEvent(EVENT_UNLEASHED_SOULS, 20000);
|
||||
events.ScheduleEvent(EVENT_WAILING_SOULS, urand(60000,70000));
|
||||
}
|
||||
|
||||
void DamageTaken(Unit * /*pDoneBy*/, uint32 &uiDamage)
|
||||
{
|
||||
if (uiMirroredSoulTarget && me->HasAura(SPELL_MIRRORED_SOUL))
|
||||
boss_devourer_of_soulsAI(Creature *creature) : BossAI(creature, DATA_DEVOURER_EVENT)
|
||||
{
|
||||
if (Player *pPlayer = Unit::GetPlayer(*me, uiMirroredSoulTarget))
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
if (!instance || static_cast<InstanceMap*>(me->GetMap())->GetScriptId() != GetScriptId(FoSScriptName))
|
||||
me->IsAIEnabled = false;
|
||||
else if (!me->isDead())
|
||||
Reset();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
me->SetDisplayId(DISPLAY_ANGER);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
|
||||
events.Reset();
|
||||
|
||||
threeFaceAchievement = true;
|
||||
mirroredSoulTarget = 0;
|
||||
|
||||
instance->SetData(DATA_DEVOURER_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(RAND(SAY_FACE_ANGER_AGGRO, SAY_FACE_DESIRE_AGGRO), me);
|
||||
|
||||
events.ScheduleEvent(EVENT_PHANTOM_BLAST, 5000);
|
||||
events.ScheduleEvent(EVENT_MIRRORED_SOUL, 8000);
|
||||
events.ScheduleEvent(EVENT_WELL_OF_SOULS, 30000);
|
||||
events.ScheduleEvent(EVENT_UNLEASHED_SOULS, 20000);
|
||||
events.ScheduleEvent(EVENT_WAILING_SOULS, urand(60000, 70000));
|
||||
|
||||
instance->SetData(DATA_DEVOURER_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit * /*pDoneBy*/, uint32 &uiDamage)
|
||||
{
|
||||
if (mirroredSoulTarget && me->HasAura(SPELL_MIRRORED_SOUL))
|
||||
{
|
||||
if (pPlayer->GetAura(SPELL_MIRRORED_SOUL))
|
||||
if (Player *player = Unit::GetPlayer(*me, mirroredSoulTarget))
|
||||
{
|
||||
int32 mirrorDamage = (uiDamage * 45)/100;
|
||||
me->CastCustomSpell(pPlayer, 69034, &mirrorDamage, 0, 0, true);
|
||||
// me->DealDamage(pPlayer, (uiDamage * 45)/100, 0, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_SHADOW);
|
||||
if (player->GetAura(SPELL_MIRRORED_SOUL))
|
||||
{
|
||||
int32 mirrorDamage = (uiDamage * 45)/100;
|
||||
me->CastCustomSpell(player, 69034, &mirrorDamage, 0, 0, true);
|
||||
}
|
||||
else
|
||||
mirroredSoulTarget = 0;
|
||||
}
|
||||
else
|
||||
uiMirroredSoulTarget = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(RAND(SAY_FACE_ANGER_SLAY_1,SAY_FACE_SORROW_SLAY_1,SAY_FACE_DESIRE_SLAY_1,
|
||||
SAY_FACE_ANGER_SLAY_2,SAY_FACE_SORROW_SLAY_2,SAY_FACE_DESIRE_SLAY_2), me);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Position spawnPoint = { 5618.139f, 2451.873f, 705.854f, 0 };
|
||||
|
||||
DoScriptText(RAND(SAY_FACE_SORROW_DEATH,SAY_FACE_DESIRE_DEATH), me);
|
||||
|
||||
if (pInstance)
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
pInstance->SetData(DATA_DEVOURER_EVENT, DONE);
|
||||
if (victim->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
if (bThreeFaceAchievement && IsHeroic())
|
||||
pInstance->DoCompleteAchievement(ACHIEV_THREE_FACED);
|
||||
int32 textId = 0;
|
||||
switch (me->GetDisplayId())
|
||||
{
|
||||
case DISPLAY_ANGER:
|
||||
textId = RAND(SAY_FACE_ANGER_SLAY_1, SAY_FACE_ANGER_SLAY_2);
|
||||
break;
|
||||
case DISPLAY_SORROW:
|
||||
textId = RAND(SAY_FACE_SORROW_SLAY_1, SAY_FACE_SORROW_SLAY_2);
|
||||
break;
|
||||
case DISPLAY_DESIRE:
|
||||
textId = RAND(SAY_FACE_DESIRE_SLAY_1, SAY_FACE_DESIRE_SLAY_2);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (textId)
|
||||
DoScriptText(textId, me);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Position spawnPoint = {5618.139f, 2451.873f, 705.854f, 0};
|
||||
|
||||
DoScriptText(RAND(SAY_FACE_SORROW_DEATH, SAY_FACE_DESIRE_DEATH), me);
|
||||
|
||||
instance->SetData(DATA_DEVOURER_EVENT, DONE);
|
||||
|
||||
if (threeFaceAchievement && IsHeroic())
|
||||
instance->DoCompleteAchievement(ACHIEV_THREE_FACED);
|
||||
|
||||
int32 entryIndex;
|
||||
if (pInstance->GetData(DATA_TEAM_IN_INSTANCE) == TEAM_ALLIANCE)
|
||||
if (instance->GetData(DATA_TEAM_IN_INSTANCE) == TEAM_ALLIANCE)
|
||||
entryIndex = 0;
|
||||
else
|
||||
entryIndex = 1;
|
||||
|
||||
for (int8 i = 0; outroPositions[i].entry[entryIndex] != 0; ++i)
|
||||
{
|
||||
if (Creature *pSummon = me->SummonCreature(outroPositions[i].entry[entryIndex], spawnPoint, TEMPSUMMON_DEAD_DESPAWN))
|
||||
if (Creature *summon = me->SummonCreature(outroPositions[i].entry[entryIndex], spawnPoint, TEMPSUMMON_DEAD_DESPAWN))
|
||||
{
|
||||
pSummon->GetMotionMaster()->MovePoint(0, outroPositions[i].movePosition);
|
||||
|
||||
if (pSummon->GetEntry() == NPC_JAINA_PART2)
|
||||
DoScriptText(SAY_JAINA_OUTRO, pSummon);
|
||||
else if (pSummon->GetEntry() == NPC_SYLVANAS_PART2)
|
||||
DoScriptText(SAY_SYLVANAS_OUTRO, pSummon);
|
||||
summon->GetMotionMaster()->MovePoint(0, outroPositions[i].movePosition);
|
||||
if (summon->GetEntry() == NPC_JAINA_PART2)
|
||||
DoScriptText(SAY_JAINA_OUTRO, summon);
|
||||
else if (summon->GetEntry() == NPC_SYLVANAS_PART2)
|
||||
DoScriptText(SAY_SYLVANAS_OUTRO, summon);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* /*pTarget*/, const SpellEntry *pSpell)
|
||||
{
|
||||
if (pSpell->Id == H_SPELL_PHANTOM_BLAST)
|
||||
bThreeFaceAchievement = false;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
// Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
void SpellHitTarget(Unit* /*target*/, const SpellEntry *spell)
|
||||
{
|
||||
switch(eventId)
|
||||
{
|
||||
case EVENT_PHANTOM_BLAST:
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0))
|
||||
DoCast(pTarget, SPELL_PHANTOM_BLAST);
|
||||
events.ScheduleEvent(EVENT_PHANTOM_BLAST, 5000);
|
||||
break;
|
||||
case EVENT_MIRRORED_SOUL:
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
|
||||
{
|
||||
uiMirroredSoulTarget = pTarget->GetGUID();
|
||||
DoCast(pTarget, SPELL_MIRRORED_SOUL);
|
||||
DoScriptText(EMOTE_MIRRORED_SOUL, me);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_MIRRORED_SOUL, urand(15000,30000));
|
||||
break;
|
||||
case EVENT_WELL_OF_SOULS:
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_WELL_OF_SOULS);
|
||||
events.ScheduleEvent(EVENT_WELL_OF_SOULS, 20000);
|
||||
break;
|
||||
case EVENT_UNLEASHED_SOULS:
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_UNLEASHED_SOULS);
|
||||
me->SetDisplayId(DISPLAY_SORROW);
|
||||
DoScriptText(RAND(SAY_FACE_ANGER_UNLEASH_SOUL,SAY_FACE_SORROW_UNLEASH_SOUL,SAY_FACE_DESIRE_UNLEASH_SOUL), me);
|
||||
DoScriptText(EMOTE_UNLEASH_SOUL, me);
|
||||
events.ScheduleEvent(EVENT_UNLEASHED_SOULS, 30000);
|
||||
events.ScheduleEvent(EVENT_FACE_ANGER, 5000);
|
||||
break;
|
||||
case EVENT_FACE_ANGER:
|
||||
me->SetDisplayId(DISPLAY_ANGER);
|
||||
break;
|
||||
|
||||
case EVENT_WAILING_SOULS:
|
||||
me->SetDisplayId(DISPLAY_DESIRE);
|
||||
DoScriptText(RAND(SAY_FACE_ANGER_WAILING_SOUL,SAY_FACE_DESIRE_WAILING_SOUL), me);
|
||||
DoScriptText(EMOTE_WAILING_SOUL, me);
|
||||
DoCast(me, SPELL_WAILING_SOULS_STARTING);
|
||||
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
me->SetOrientation(me->GetAngle(pTarget));
|
||||
DoCast(me, SPELL_WAILING_SOULS_BEAM);
|
||||
}
|
||||
|
||||
beamAngle = me->GetOrientation();
|
||||
|
||||
beamAngleDiff = M_PI/30.0f; // PI/2 in 15 sec = PI/30 per tick
|
||||
if (RAND(true,false))
|
||||
beamAngleDiff = -beamAngleDiff;
|
||||
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
|
||||
//Remove any target
|
||||
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
|
||||
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
|
||||
wailingSoulTick = 15;
|
||||
events.DelayEvents(18000); // no other events during wailing souls
|
||||
events.ScheduleEvent(EVENT_WAILING_SOULS_TICK, 3000); // first one after 3 secs.
|
||||
break;
|
||||
|
||||
case EVENT_WAILING_SOULS_TICK:
|
||||
beamAngle += beamAngleDiff;
|
||||
me->SetOrientation(beamAngle);
|
||||
me->StopMoving();
|
||||
|
||||
DoCast(me, SPELL_WAILING_SOULS);
|
||||
|
||||
if (--wailingSoulTick)
|
||||
events.ScheduleEvent(EVENT_WAILING_SOULS_TICK, 1000);
|
||||
else
|
||||
{
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->SetDisplayId(DISPLAY_ANGER);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
me->GetMotionMaster()->MoveChase(me->getVictim());
|
||||
events.ScheduleEvent(EVENT_WAILING_SOULS, urand(60000,70000));
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (spell->Id == H_SPELL_PHANTOM_BLAST)
|
||||
threeFaceAchievement = false;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
// Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const
|
||||
{
|
||||
return new boss_devourer_of_soulsAI(creature);
|
||||
}
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch(eventId)
|
||||
{
|
||||
case EVENT_PHANTOM_BLAST:
|
||||
DoCastVictim(SPELL_PHANTOM_BLAST);
|
||||
events.ScheduleEvent(EVENT_PHANTOM_BLAST, 5000);
|
||||
break;
|
||||
case EVENT_MIRRORED_SOUL:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
|
||||
{
|
||||
mirroredSoulTarget = target->GetGUID();
|
||||
DoCast(target, SPELL_MIRRORED_SOUL);
|
||||
DoScriptText(EMOTE_MIRRORED_SOUL, me);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_MIRRORED_SOUL, urand(15000, 30000));
|
||||
break;
|
||||
case EVENT_WELL_OF_SOULS:
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_WELL_OF_SOULS);
|
||||
events.ScheduleEvent(EVENT_WELL_OF_SOULS, 20000);
|
||||
break;
|
||||
case EVENT_UNLEASHED_SOULS:
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_UNLEASHED_SOULS);
|
||||
me->SetDisplayId(DISPLAY_SORROW);
|
||||
DoScriptText(RAND(SAY_FACE_ANGER_UNLEASH_SOUL, SAY_FACE_SORROW_UNLEASH_SOUL, SAY_FACE_DESIRE_UNLEASH_SOUL), me);
|
||||
DoScriptText(EMOTE_UNLEASH_SOUL, me);
|
||||
events.ScheduleEvent(EVENT_UNLEASHED_SOULS, 30000);
|
||||
events.ScheduleEvent(EVENT_FACE_ANGER, 5000);
|
||||
break;
|
||||
case EVENT_FACE_ANGER:
|
||||
me->SetDisplayId(DISPLAY_ANGER);
|
||||
break;
|
||||
|
||||
case EVENT_WAILING_SOULS:
|
||||
me->SetDisplayId(DISPLAY_DESIRE);
|
||||
DoScriptText(RAND(SAY_FACE_ANGER_WAILING_SOUL,SAY_FACE_DESIRE_WAILING_SOUL), me);
|
||||
DoScriptText(EMOTE_WAILING_SOUL, me);
|
||||
DoCast(me, SPELL_WAILING_SOULS_STARTING);
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
me->SetOrientation(me->GetAngle(target));
|
||||
DoCast(me, SPELL_WAILING_SOULS_BEAM);
|
||||
}
|
||||
|
||||
beamAngle = me->GetOrientation();
|
||||
|
||||
beamAngleDiff = M_PI/30.0f; // PI/2 in 15 sec = PI/30 per tick
|
||||
if (RAND(true, false))
|
||||
beamAngleDiff = -beamAngleDiff;
|
||||
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
|
||||
//Remove any target
|
||||
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
|
||||
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
|
||||
wailingSoulTick = 15;
|
||||
events.DelayEvents(18000); // no other events during wailing souls
|
||||
events.ScheduleEvent(EVENT_WAILING_SOULS_TICK, 3000); // first one after 3 secs.
|
||||
break;
|
||||
|
||||
case EVENT_WAILING_SOULS_TICK:
|
||||
beamAngle += beamAngleDiff;
|
||||
me->SetOrientation(beamAngle);
|
||||
me->StopMoving();
|
||||
|
||||
DoCast(me, SPELL_WAILING_SOULS);
|
||||
|
||||
if (--wailingSoulTick)
|
||||
events.ScheduleEvent(EVENT_WAILING_SOULS_TICK, 1000);
|
||||
else
|
||||
{
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->SetDisplayId(DISPLAY_ANGER);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
me->GetMotionMaster()->MoveChase(me->getVictim());
|
||||
events.ScheduleEvent(EVENT_WAILING_SOULS, urand(60000,70000));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
bool threeFaceAchievement;
|
||||
|
||||
// wailing soul event
|
||||
float beamAngle;
|
||||
float beamAngleDiff;
|
||||
int8 wailingSoulTick;
|
||||
|
||||
uint64 mirroredSoulTarget;
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_devourer_of_soulsAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_devourer_of_souls()
|
||||
{
|
||||
new boss_devourer_of_souls;
|
||||
new boss_devourer_of_souls();
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ public:
|
||||
|
||||
struct npc_sylvanas_fosAI : public ScriptedAI
|
||||
{
|
||||
npc_sylvanas_fosAI(Creature *c) : ScriptedAI(c)
|
||||
npc_sylvanas_fosAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
@@ -237,37 +237,37 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (pCreature->isQuestGiver())
|
||||
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
|
||||
if (creature->isQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
if (pCreature->GetEntry() == NPC_JAINA_PART1)
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_JAINA_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
if (creature->GetEntry() == NPC_JAINA_PART1)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_JAINA_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
else
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SYLVANAS_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SYLVANAS_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
pPlayer->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, pCreature->GetGUID());
|
||||
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
pPlayer->PlayerTalkClass->ClearMenus();
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
switch(uiAction)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
|
||||
if (pCreature->AI())
|
||||
pCreature->AI()->DoAction(ACTION_INTRO);
|
||||
if (creature->AI())
|
||||
creature->AI()->DoAction(ACTION_INTRO);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const
|
||||
CreatureAI *GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_sylvanas_fosAI(creature);
|
||||
}
|
||||
@@ -280,7 +280,7 @@ public:
|
||||
|
||||
struct npc_jaina_fosAI: public ScriptedAI
|
||||
{
|
||||
npc_jaina_fosAI(Creature *c) : ScriptedAI(c)
|
||||
npc_jaina_fosAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
@@ -374,37 +374,37 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (pCreature->isQuestGiver())
|
||||
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
|
||||
if (creature->isQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
if (pCreature->GetEntry() == NPC_JAINA_PART1)
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_JAINA_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
if (creature->GetEntry() == NPC_JAINA_PART1)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_JAINA_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
else
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SYLVANAS_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SYLVANAS_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
pPlayer->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, pCreature->GetGUID());
|
||||
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
pPlayer->PlayerTalkClass->ClearMenus();
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
switch(uiAction)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
|
||||
if (pCreature->AI())
|
||||
pCreature->AI()->DoAction(ACTION_INTRO);
|
||||
if (creature->AI())
|
||||
creature->AI()->DoAction(ACTION_INTRO);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const
|
||||
CreatureAI *GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_jaina_fosAI(creature);
|
||||
}
|
||||
@@ -417,7 +417,7 @@ public:
|
||||
|
||||
struct mob_spiteful_apparitionAI: public ScriptedAI
|
||||
{
|
||||
mob_spiteful_apparitionAI(Creature *c) : ScriptedAI(c)
|
||||
mob_spiteful_apparitionAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -449,7 +449,7 @@ public:
|
||||
switch(eventId)
|
||||
{
|
||||
case EVENT_SPITE:
|
||||
DoCast(me->getVictim(), SPELL_SPITE);
|
||||
DoCastVictim(SPELL_SPITE);
|
||||
events.RescheduleEvent(EVENT_SPITE, 8000);
|
||||
return;
|
||||
}
|
||||
@@ -459,7 +459,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const
|
||||
CreatureAI *GetAI(Creature* creature) const
|
||||
{
|
||||
return new mob_spiteful_apparitionAI(creature);
|
||||
}
|
||||
@@ -472,7 +472,7 @@ public:
|
||||
|
||||
struct mob_spectral_wardenAI: public ScriptedAI
|
||||
{
|
||||
mob_spectral_wardenAI(Creature *c) : ScriptedAI(c)
|
||||
mob_spectral_wardenAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -505,12 +505,12 @@ public:
|
||||
switch(eventId)
|
||||
{
|
||||
case EVENT_VEIL_OF_SHADOWS:
|
||||
DoCast(me->getVictim(), SPELL_VEIL_OF_SHADOWS);
|
||||
DoCastVictim(SPELL_VEIL_OF_SHADOWS);
|
||||
events.RescheduleEvent(EVENT_VEIL_OF_SHADOWS, 10000);
|
||||
return;
|
||||
case EVENT_WAIL_OF_SOULS:
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_WAIL_OF_SOULS);
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_WAIL_OF_SOULS);
|
||||
events.RescheduleEvent(EVENT_WAIL_OF_SOULS, 5000);
|
||||
return;
|
||||
}
|
||||
@@ -519,7 +519,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const
|
||||
CreatureAI *GetAI(Creature* creature) const
|
||||
{
|
||||
return new mob_spectral_wardenAI(creature);
|
||||
}
|
||||
@@ -532,7 +532,7 @@ public:
|
||||
|
||||
struct mob_soulguard_watchmanAI: public ScriptedAI
|
||||
{
|
||||
mob_soulguard_watchmanAI(Creature *c) : ScriptedAI(c) { }
|
||||
mob_soulguard_watchmanAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
EventMap events;
|
||||
|
||||
@@ -576,7 +576,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const
|
||||
CreatureAI *GetAI(Creature* creature) const
|
||||
{
|
||||
return new mob_soulguard_watchmanAI(creature);
|
||||
}
|
||||
@@ -589,7 +589,7 @@ public:
|
||||
|
||||
struct mob_soulguard_reaperAI: public ScriptedAI
|
||||
{
|
||||
mob_soulguard_reaperAI(Creature *c) : ScriptedAI(c) { }
|
||||
mob_soulguard_reaperAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
EventMap events;
|
||||
|
||||
@@ -624,8 +624,8 @@ public:
|
||||
events.RescheduleEvent(EVENT_FROST_NOVA, 9600);
|
||||
return;
|
||||
case EVENT_SHADOW_LANCE:
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_SHADOW_LANCE);
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_SHADOW_LANCE);
|
||||
events.RescheduleEvent(EVENT_SHADOW_LANCE, 8000);
|
||||
return;
|
||||
}
|
||||
@@ -635,7 +635,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const
|
||||
CreatureAI *GetAI(Creature* creature) const
|
||||
{
|
||||
return new mob_soulguard_reaperAI(creature);
|
||||
}
|
||||
@@ -648,7 +648,7 @@ public:
|
||||
|
||||
struct mob_soulguard_bonecasterAI: public ScriptedAI
|
||||
{
|
||||
mob_soulguard_bonecasterAI(Creature *c) : ScriptedAI(c) { }
|
||||
mob_soulguard_bonecasterAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
EventMap events;
|
||||
|
||||
@@ -698,7 +698,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const
|
||||
CreatureAI *GetAI(Creature* creature) const
|
||||
{
|
||||
return new mob_soulguard_bonecasterAI(creature);
|
||||
}
|
||||
@@ -711,7 +711,7 @@ public:
|
||||
|
||||
struct mob_soulguard_animatorAI : public ScriptedAI
|
||||
{
|
||||
mob_soulguard_animatorAI(Creature *c) : ScriptedAI(c)
|
||||
mob_soulguard_animatorAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -750,18 +750,18 @@ public:
|
||||
events.RescheduleEvent(EVENT_RAISE_DEAD, 25000);
|
||||
return;
|
||||
case EVENT_SHADOW_BOLT:
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_SHADOW_BOLT);
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_SHADOW_BOLT);
|
||||
events.RescheduleEvent(EVENT_SHADOW_BOLT, 5000);
|
||||
return;
|
||||
case EVENT_SOUL_SICKNESS:
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_SOUL_SICKNESS);
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_SOUL_SICKNESS);
|
||||
events.RescheduleEvent(EVENT_SOUL_SICKNESS, 10000);
|
||||
return;
|
||||
case EVENT_SOUL_SIPHON:
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_SOUL_SIPHON);
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_SOUL_SIPHON);
|
||||
events.RescheduleEvent(EVENT_SOUL_SIPHON, 8000);
|
||||
return;
|
||||
}
|
||||
@@ -771,7 +771,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const
|
||||
CreatureAI *GetAI(Creature* creature) const
|
||||
{
|
||||
return new mob_soulguard_animatorAI(creature);
|
||||
}
|
||||
@@ -784,7 +784,7 @@ public:
|
||||
|
||||
struct mob_soulguard_adeptAI: public ScriptedAI
|
||||
{
|
||||
mob_soulguard_adeptAI(Creature *c) : ScriptedAI(c)
|
||||
mob_soulguard_adeptAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -823,13 +823,13 @@ public:
|
||||
events.RescheduleEvent(EVENT_RAISE_DEAD, 25000);
|
||||
return;
|
||||
case EVENT_SHADOW_BOLT:
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_SHADOW_BOLT);
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_SHADOW_BOLT);
|
||||
events.RescheduleEvent(EVENT_SHADOW_BOLT, 4000);
|
||||
return;
|
||||
case EVENT_DRAIN_LIFE:
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_DRAIN_LIFE);
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_DRAIN_LIFE);
|
||||
events.RescheduleEvent(EVENT_DRAIN_LIFE, 9000);
|
||||
return;
|
||||
case EVENT_SHADOW_MEND:
|
||||
@@ -843,7 +843,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const
|
||||
CreatureAI *GetAI(Creature* creature) const
|
||||
{
|
||||
return new mob_soulguard_adeptAI(creature);
|
||||
}
|
||||
@@ -856,7 +856,7 @@ public:
|
||||
|
||||
struct mob_soul_horrorAI : public ScriptedAI
|
||||
{
|
||||
mob_soul_horrorAI(Creature *c) : ScriptedAI(c) { }
|
||||
mob_soul_horrorAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
EventMap events;
|
||||
|
||||
@@ -896,7 +896,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const
|
||||
CreatureAI *GetAI(Creature* creature) const
|
||||
{
|
||||
return new mob_soul_horrorAI(creature);
|
||||
}
|
||||
@@ -904,14 +904,14 @@ public:
|
||||
|
||||
void AddSC_forge_of_souls()
|
||||
{
|
||||
new npc_sylvanas_fos;
|
||||
new npc_jaina_fos;
|
||||
new mob_spiteful_apparition;
|
||||
new mob_spectral_warden;
|
||||
new mob_soulguard_watchman;
|
||||
new mob_soulguard_reaper;
|
||||
new mob_soulguard_bonecaster;
|
||||
new mob_soulguard_animator;
|
||||
new mob_soulguard_adept;
|
||||
new mob_soul_horror;
|
||||
new npc_sylvanas_fos();
|
||||
new npc_jaina_fos();
|
||||
new mob_spiteful_apparition();
|
||||
new mob_spectral_warden();
|
||||
new mob_soulguard_watchman();
|
||||
new mob_soulguard_reaper();
|
||||
new mob_soulguard_bonecaster();
|
||||
new mob_soulguard_animator();
|
||||
new mob_soulguard_adept();
|
||||
new mob_soul_horror();
|
||||
}
|
||||
|
||||
@@ -18,16 +18,14 @@
|
||||
#ifndef DEF_FORGE_OF_SOULS_H
|
||||
#define DEF_FORGE_OF_SOULS_H
|
||||
|
||||
#define FoSScriptName "instance_forge_of_souls"
|
||||
|
||||
enum Data
|
||||
{
|
||||
DATA_DEVOURER_EVENT = 1,
|
||||
DATA_TEAM_IN_INSTANCE = 2,
|
||||
};
|
||||
|
||||
enum Data64
|
||||
{
|
||||
DATA_BRONJAHM,
|
||||
DATA_DEVOURER,
|
||||
DATA_BRONJAHM = 0,
|
||||
DATA_DEVOURER = 1,
|
||||
DATA_DEVOURER_EVENT = 2,
|
||||
DATA_TEAM_IN_INSTANCE = 3,
|
||||
};
|
||||
|
||||
enum Creatures
|
||||
|
||||
@@ -28,34 +28,33 @@
|
||||
class instance_forge_of_souls : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_forge_of_souls() : InstanceMapScript("instance_forge_of_souls", 632) { }
|
||||
instance_forge_of_souls() : InstanceMapScript(FoSScriptName, 632) { }
|
||||
|
||||
struct instance_forge_of_souls_InstanceScript : public InstanceScript
|
||||
{
|
||||
instance_forge_of_souls_InstanceScript(Map* pMap) : InstanceScript(pMap)
|
||||
instance_forge_of_souls_InstanceScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
SetBossNumber(MAX_ENCOUNTER);
|
||||
uiBronjahm = 0;
|
||||
uiDevourer = 0;
|
||||
bronjahm = 0;
|
||||
devourerOfSouls = 0;
|
||||
|
||||
uiTeamInInstance = 0;
|
||||
teamInInstance = 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
|
||||
void OnCreatureCreate(Creature* creature, bool /*add*/)
|
||||
{
|
||||
Map::PlayerList const &players = instance->GetPlayers();
|
||||
|
||||
if (!players.isEmpty())
|
||||
if (Player* pPlayer = players.begin()->getSource())
|
||||
uiTeamInInstance = pPlayer->GetTeamId();
|
||||
if (Player* player = players.begin()->getSource())
|
||||
teamInInstance = player->GetTeamId();
|
||||
|
||||
switch (pCreature->GetEntry())
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case CREATURE_BRONJAHM:
|
||||
uiBronjahm = pCreature->GetGUID();
|
||||
bronjahm = creature->GetGUID();
|
||||
break;
|
||||
case CREATURE_DEVOURER:
|
||||
uiDevourer = pCreature->GetGUID();
|
||||
devourerOfSouls = creature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -65,7 +64,7 @@ class instance_forge_of_souls : public InstanceMapScript
|
||||
switch (type)
|
||||
{
|
||||
case DATA_TEAM_IN_INSTANCE:
|
||||
return uiTeamInInstance;
|
||||
return teamInInstance;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -73,14 +72,14 @@ class instance_forge_of_souls : public InstanceMapScript
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 identifier)
|
||||
uint64 GetData64(uint32 type)
|
||||
{
|
||||
switch (identifier)
|
||||
switch (type)
|
||||
{
|
||||
case DATA_BRONJAHM:
|
||||
return uiBronjahm;
|
||||
return bronjahm;
|
||||
case DATA_DEVOURER:
|
||||
return uiDevourer;
|
||||
return devourerOfSouls;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -130,10 +129,10 @@ class instance_forge_of_souls : public InstanceMapScript
|
||||
}
|
||||
|
||||
private:
|
||||
uint64 uiBronjahm;
|
||||
uint64 uiDevourer;
|
||||
uint64 bronjahm;
|
||||
uint64 devourerOfSouls;
|
||||
|
||||
uint32 uiTeamInInstance;
|
||||
uint32 teamInInstance;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap *map) const
|
||||
|
||||
Reference in New Issue
Block a user