* Rename InstanceData to InstanceScript

* Rename *mgr to their new names in scripts project
* Mass convert all the scripts (NEEDS THOROUGH TESTING, because it was done automatically) Please, report bugs on issue tracker.

--HG--
branch : trunk
rename : src/server/game/Instances/InstanceData.cpp => src/server/game/Instances/InstanceScript.cpp
rename : src/server/game/Instances/InstanceData.h => src/server/game/Instances/InstanceScript.h
This commit is contained in:
azazel
2010-08-08 22:54:58 +06:00
parent 8a69e50d6a
commit 590199d8e1
482 changed files with 84476 additions and 82697 deletions
@@ -51,275 +51,281 @@
#define SAY_ONAGGRO "You are defenders of a doomed world! Flee here, and perhaps you will prolong your pathetic lives!"
#define SOUND_ONAGGRO 10977
struct boss_anetheronAI : public hyjal_trashAI
␍class boss_anetheron : public CreatureScript
{
boss_anetheronAI(Creature *c) : hyjal_trashAI(c)
public:
boss_anetheron() : CreatureScript("boss_anetheron") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
pGo = false;
pos = 0;
SpellEntry *TempSpell = GET_SPELL(SPELL_SLEEP);
if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 1)
return new boss_anetheronAI (pCreature);
}
struct boss_anetheronAI : public hyjal_trashAI
{
boss_anetheronAI(Creature *c) : hyjal_trashAI(c)
{
TempSpell->EffectImplicitTargetA[0] = 1;
TempSpell->EffectImplicitTargetB[0] = 0;
}
}
uint32 SwarmTimer;
uint32 SleepTimer;
uint32 AuraTimer;
uint32 InfernoTimer;
bool pGo;
uint32 pos;
void Reset()
{
damageTaken = 0;
SwarmTimer = 45000;
SleepTimer = 60000;
AuraTimer = 5000;
InfernoTimer = 45000;
if (pInstance && IsEvent)
pInstance->SetData(DATA_ANETHERONEVENT, NOT_STARTED);
}
void EnterCombat(Unit * /*who*/)
{
if (pInstance && IsEvent)
pInstance->SetData(DATA_ANETHERONEVENT, IN_PROGRESS);
DoPlaySoundToSet(me, SOUND_ONAGGRO);
me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0);
}
void KilledUnit(Unit * /*victim*/)
{
switch (urand(0,2))
{
case 0:
DoPlaySoundToSet(me, SOUND_ONSLAY1);
me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0);
break;
case 1:
DoPlaySoundToSet(me, SOUND_ONSLAY2);
me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0);
break;
case 2:
DoPlaySoundToSet(me, SOUND_ONSLAY3);
me->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, 0);
break;
}
}
void WaypointReached(uint32 i)
{
pos = i;
if (i == 7 && pInstance)
{
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget,0.0);
}
}
void JustDied(Unit *victim)
{
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
pInstance->SetData(DATA_ANETHERONEVENT, DONE);
DoPlaySoundToSet(me, SOUND_ONDEATH);
me->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0);
}
void UpdateAI(const uint32 diff)
{
if (IsEvent)
{
//Must update npc_escortAI
npc_escortAI::UpdateAI(diff);
if (!pGo)
pInstance = c->GetInstanceScript();
pGo = false;
pos = 0;
SpellEntry *TempSpell = GET_SPELL(SPELL_SLEEP);
if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 1)
{
pGo = true;
if (pInstance)
TempSpell->EffectImplicitTargetA[0] = 1;
TempSpell->EffectImplicitTargetB[0] = 0;
}
}
uint32 SwarmTimer;
uint32 SleepTimer;
uint32 AuraTimer;
uint32 InfernoTimer;
bool pGo;
uint32 pos;
void Reset()
{
damageTaken = 0;
SwarmTimer = 45000;
SleepTimer = 60000;
AuraTimer = 5000;
InfernoTimer = 45000;
if (pInstance && IsEvent)
pInstance->SetData(DATA_ANETHERONEVENT, NOT_STARTED);
}
void EnterCombat(Unit * /*who*/)
{
if (pInstance && IsEvent)
pInstance->SetData(DATA_ANETHERONEVENT, IN_PROGRESS);
DoPlaySoundToSet(me, SOUND_ONAGGRO);
me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0);
}
void KilledUnit(Unit * /*victim*/)
{
switch (urand(0,2))
{
case 0:
DoPlaySoundToSet(me, SOUND_ONSLAY1);
me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0);
break;
case 1:
DoPlaySoundToSet(me, SOUND_ONSLAY2);
me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0);
break;
case 2:
DoPlaySoundToSet(me, SOUND_ONSLAY3);
me->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, 0);
break;
}
}
void WaypointReached(uint32 i)
{
pos = i;
if (i == 7 && pInstance)
{
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget,0.0);
}
}
void JustDied(Unit *victim)
{
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
pInstance->SetData(DATA_ANETHERONEVENT, DONE);
DoPlaySoundToSet(me, SOUND_ONDEATH);
me->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0);
}
void UpdateAI(const uint32 diff)
{
if (IsEvent)
{
//Must update npc_escortAI
npc_escortAI::UpdateAI(diff);
if (!pGo)
{
AddWaypoint(0, 4896.08, -1576.35, 1333.65);
AddWaypoint(1, 4898.68, -1615.02, 1329.48);
AddWaypoint(2, 4907.12, -1667.08, 1321.00);
AddWaypoint(3, 4963.18, -1699.35, 1340.51);
AddWaypoint(4, 4989.16, -1716.67, 1335.74);
AddWaypoint(5, 5026.27, -1736.89, 1323.02);
AddWaypoint(6, 5037.77, -1770.56, 1324.36);
AddWaypoint(7, 5067.23, -1789.95, 1321.17);
Start(false, true);
SetDespawnAtEnd(false);
pGo = true;
if (pInstance)
{
AddWaypoint(0, 4896.08, -1576.35, 1333.65);
AddWaypoint(1, 4898.68, -1615.02, 1329.48);
AddWaypoint(2, 4907.12, -1667.08, 1321.00);
AddWaypoint(3, 4963.18, -1699.35, 1340.51);
AddWaypoint(4, 4989.16, -1716.67, 1335.74);
AddWaypoint(5, 5026.27, -1736.89, 1323.02);
AddWaypoint(6, 5037.77, -1770.56, 1324.36);
AddWaypoint(7, 5067.23, -1789.95, 1321.17);
Start(false, true);
SetDespawnAtEnd(false);
}
}
}
}
//Return since we have no target
if (!UpdateVictim())
return;
//Return since we have no target
if (!UpdateVictim())
return;
if (SwarmTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_CARRION_SWARM);
SwarmTimer = urand(45000,60000);
switch (urand(0,1))
{
case 0:
DoPlaySoundToSet(me, SOUND_SWARM1);
me->MonsterYell(SAY_SWARM1, LANG_UNIVERSAL, 0);
break;
case 1:
DoPlaySoundToSet(me, SOUND_SWARM2);
me->MonsterYell(SAY_SWARM2, LANG_UNIVERSAL, 0);
break;
}
} else SwarmTimer -= diff;
if (SleepTimer <= diff)
{
for (uint8 i = 0; i < 3; ++i)
if (SwarmTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
pTarget->CastSpell(pTarget,SPELL_SLEEP,true);
}
SleepTimer = 60000;
switch (urand(0,1))
{
case 0:
DoPlaySoundToSet(me, SOUND_SLEEP1);
me->MonsterYell(SAY_SLEEP1, LANG_UNIVERSAL, 0);
break;
case 1:
DoPlaySoundToSet(me, SOUND_SLEEP2);
me->MonsterYell(SAY_SLEEP2, LANG_UNIVERSAL, 0);
break;
}
} else SleepTimer -= diff;
if (AuraTimer <= diff)
{
DoCast(me, SPELL_VAMPIRIC_AURA, true);
AuraTimer = urand(10000,20000);
} else AuraTimer -= diff;
if (InfernoTimer <= diff)
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_INFERNO);
InfernoTimer = 45000;
switch (urand(0,1))
{
case 0:
DoPlaySoundToSet(me, SOUND_INFERNO1);
me->MonsterYell(SAY_INFERNO1, LANG_UNIVERSAL, 0);
break;
case 1:
DoPlaySoundToSet(me, SOUND_INFERNO2);
me->MonsterYell(SAY_INFERNO2, LANG_UNIVERSAL, 0);
break;
}
} else InfernoTimer -= diff;
DoCast(pTarget, SPELL_CARRION_SWARM);
SwarmTimer = urand(45000,60000);
switch (urand(0,1))
{
case 0:
DoPlaySoundToSet(me, SOUND_SWARM1);
me->MonsterYell(SAY_SWARM1, LANG_UNIVERSAL, 0);
break;
case 1:
DoPlaySoundToSet(me, SOUND_SWARM2);
me->MonsterYell(SAY_SWARM2, LANG_UNIVERSAL, 0);
break;
}
} else SwarmTimer -= diff;
if (SleepTimer <= diff)
{
for (uint8 i = 0; i < 3; ++i)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
pTarget->CastSpell(pTarget,SPELL_SLEEP,true);
}
SleepTimer = 60000;
switch (urand(0,1))
{
case 0:
DoPlaySoundToSet(me, SOUND_SLEEP1);
me->MonsterYell(SAY_SLEEP1, LANG_UNIVERSAL, 0);
break;
case 1:
DoPlaySoundToSet(me, SOUND_SLEEP2);
me->MonsterYell(SAY_SLEEP2, LANG_UNIVERSAL, 0);
break;
}
} else SleepTimer -= diff;
if (AuraTimer <= diff)
{
DoCast(me, SPELL_VAMPIRIC_AURA, true);
AuraTimer = urand(10000,20000);
} else AuraTimer -= diff;
if (InfernoTimer <= diff)
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_INFERNO);
InfernoTimer = 45000;
switch (urand(0,1))
{
case 0:
DoPlaySoundToSet(me, SOUND_INFERNO1);
me->MonsterYell(SAY_INFERNO1, LANG_UNIVERSAL, 0);
break;
case 1:
DoPlaySoundToSet(me, SOUND_INFERNO2);
me->MonsterYell(SAY_INFERNO2, LANG_UNIVERSAL, 0);
break;
}
} else InfernoTimer -= diff;
DoMeleeAttackIfReady();
}
};
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_anetheron(Creature* pCreature)
{
return new boss_anetheronAI (pCreature);
}
#define SPELL_IMMOLATION 31303
#define SPELL_INFERNO_EFFECT 31302
struct mob_towering_infernalAI : public ScriptedAI
␍class mob_towering_infernal : public CreatureScript
{
mob_towering_infernalAI(Creature *c) : ScriptedAI(c)
public:
mob_towering_infernal() : CreatureScript("mob_towering_infernal") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
if (pInstance)
AnetheronGUID = pInstance->GetData64(DATA_ANETHERON);
return new mob_towering_infernalAI (pCreature);
}
uint32 ImmolationTimer;
uint32 CheckTimer;
uint64 AnetheronGUID;
ScriptedInstance* pInstance;
void Reset()
struct mob_towering_infernalAI : public ScriptedAI
{
DoCast(me, SPELL_INFERNO_EFFECT);
ImmolationTimer = 5000;
CheckTimer = 5000;
}
void EnterCombat(Unit * /*who*/)
{
}
void KilledUnit(Unit * /*victim*/)
{
}
void JustDied(Unit * /*victim*/)
{
}
void MoveInLineOfSight(Unit *who)
{
if (me->IsWithinDist(who, 50) && !me->isInCombat() && me->IsHostileTo(who))
AttackStart(who);
}
void UpdateAI(const uint32 diff)
{
if (CheckTimer <= diff)
mob_towering_infernalAI(Creature *c) : ScriptedAI(c)
{
if (AnetheronGUID)
{
Creature* boss = Unit::GetCreature((*me),AnetheronGUID);
if (!boss || (boss && boss->isDead()))
{
me->setDeathState(JUST_DIED);
me->RemoveCorpse();
return;
}
}
CheckTimer = 5000;
} else CheckTimer -= diff;
pInstance = c->GetInstanceScript();
if (pInstance)
AnetheronGUID = pInstance->GetData64(DATA_ANETHERON);
}
//Return since we have no target
if (!UpdateVictim())
return;
uint32 ImmolationTimer;
uint32 CheckTimer;
uint64 AnetheronGUID;
InstanceScript* pInstance;
if (ImmolationTimer <= diff)
void Reset()
{
DoCast(me, SPELL_IMMOLATION);
DoCast(me, SPELL_INFERNO_EFFECT);
ImmolationTimer = 5000;
} else ImmolationTimer -= diff;
CheckTimer = 5000;
}
void EnterCombat(Unit * /*who*/)
{
}
void KilledUnit(Unit * /*victim*/)
{
}
void JustDied(Unit * /*victim*/)
{
}
void MoveInLineOfSight(Unit *who)
{
if (me->IsWithinDist(who, 50) && !me->isInCombat() && me->IsHostileTo(who))
AttackStart(who);
}
void UpdateAI(const uint32 diff)
{
if (CheckTimer <= diff)
{
if (AnetheronGUID)
{
Creature* boss = Unit::GetCreature((*me),AnetheronGUID);
if (!boss || (boss && boss->isDead()))
{
me->setDeathState(JUST_DIED);
me->RemoveCorpse();
return;
}
}
CheckTimer = 5000;
} else CheckTimer -= diff;
//Return since we have no target
if (!UpdateVictim())
return;
if (ImmolationTimer <= diff)
{
DoCast(me, SPELL_IMMOLATION);
ImmolationTimer = 5000;
} else ImmolationTimer -= diff;
DoMeleeAttackIfReady();
}
};
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_mob_towering_infernal(Creature* pCreature)
{
return new mob_towering_infernalAI (pCreature);
}
void AddSC_boss_anetheron()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_anetheron";
newscript->GetAI = &GetAI_boss_anetheron;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_towering_infernal";
newscript->GetAI = &GetAI_mob_towering_infernal;
newscript->RegisterSelf();
new boss_anetheron();
new mob_towering_infernal();
}
File diff suppressed because it is too large Load Diff
@@ -42,260 +42,266 @@
#define SAY_ONAGGRO "Abandon all hope! The legion has returned to finish what was begun so many years ago. This time there will be no escape!"
#define SOUND_ONAGGRO 10999
struct boss_azgalorAI : public hyjal_trashAI
␍class boss_azgalor : public CreatureScript
{
boss_azgalorAI(Creature *c) : hyjal_trashAI(c)
public:
boss_azgalor() : CreatureScript("boss_azgalor") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
pGo = false;
pos = 0;
SpellEntry *TempSpell = GET_SPELL(SPELL_HOWL_OF_AZGALOR);
if (TempSpell)
TempSpell->EffectRadiusIndex[0] = 12;//100yards instead of 50000?!
return new boss_azgalorAI (pCreature);
}
uint32 RainTimer;
uint32 DoomTimer;
uint32 HowlTimer;
uint32 CleaveTimer;
uint32 EnrageTimer;
bool enraged;
bool pGo;
uint32 pos;
void Reset()
struct boss_azgalorAI : public hyjal_trashAI
{
damageTaken = 0;
RainTimer = 20000;
DoomTimer = 50000;
HowlTimer = 30000;
CleaveTimer = 10000;
EnrageTimer = 600000;
enraged = false;
if (pInstance && IsEvent)
pInstance->SetData(DATA_AZGALOREVENT, NOT_STARTED);
}
void EnterCombat(Unit * /*who*/)
{
if (pInstance && IsEvent)
pInstance->SetData(DATA_AZGALOREVENT, IN_PROGRESS);
DoPlaySoundToSet(me, SOUND_ONAGGRO);
me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
}
void KilledUnit(Unit * /*victim*/)
{
switch (urand(0,2))
boss_azgalorAI(Creature *c) : hyjal_trashAI(c)
{
case 0:
DoPlaySoundToSet(me, SOUND_ONSLAY1);
me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
break;
case 1:
DoPlaySoundToSet(me, SOUND_ONSLAY2);
me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
break;
case 2:
DoPlaySoundToSet(me, SOUND_ONSLAY3);
me->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL);
break;
pInstance = c->GetInstanceScript();
pGo = false;
pos = 0;
SpellEntry *TempSpell = GET_SPELL(SPELL_HOWL_OF_AZGALOR);
if (TempSpell)
TempSpell->EffectRadiusIndex[0] = 12;//100yards instead of 50000?!
}
}
void WaypointReached(uint32 i)
{
pos = i;
if (i == 7 && pInstance)
uint32 RainTimer;
uint32 DoomTimer;
uint32 HowlTimer;
uint32 CleaveTimer;
uint32 EnrageTimer;
bool enraged;
bool pGo;
uint32 pos;
void Reset()
{
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget,0.0);
damageTaken = 0;
RainTimer = 20000;
DoomTimer = 50000;
HowlTimer = 30000;
CleaveTimer = 10000;
EnrageTimer = 600000;
enraged = false;
if (pInstance && IsEvent)
pInstance->SetData(DATA_AZGALOREVENT, NOT_STARTED);
}
}
void JustDied(Unit *victim)
{
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
pInstance->SetData(DATA_AZGALOREVENT, DONE);
DoPlaySoundToSet(me, SOUND_ONDEATH);
}
void UpdateAI(const uint32 diff)
{
if (IsEvent)
void EnterCombat(Unit * /*who*/)
{
//Must update npc_escortAI
npc_escortAI::UpdateAI(diff);
if (!pGo)
if (pInstance && IsEvent)
pInstance->SetData(DATA_AZGALOREVENT, IN_PROGRESS);
DoPlaySoundToSet(me, SOUND_ONAGGRO);
me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
}
void KilledUnit(Unit * /*victim*/)
{
switch (urand(0,2))
{
pGo = true;
if (pInstance)
{
AddWaypoint(0, 5492.91, -2404.61, 1462.63);
AddWaypoint(1, 5531.76, -2460.87, 1469.55);
AddWaypoint(2, 5554.58, -2514.66, 1476.12);
AddWaypoint(3, 5554.16, -2567.23, 1479.90);
AddWaypoint(4, 5540.67, -2625.99, 1480.89);
AddWaypoint(5, 5508.16, -2659.2, 1480.15);
AddWaypoint(6, 5489.62, -2704.05, 1482.18);
AddWaypoint(7, 5457.04, -2726.26, 1485.10);
Start(false, true);
SetDespawnAtEnd(false);
}
case 0:
DoPlaySoundToSet(me, SOUND_ONSLAY1);
me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
break;
case 1:
DoPlaySoundToSet(me, SOUND_ONSLAY2);
me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
break;
case 2:
DoPlaySoundToSet(me, SOUND_ONSLAY3);
me->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL);
break;
}
}
//Return since we have no target
if (!UpdateVictim())
return;
if (RainTimer <= diff)
void WaypointReached(uint32 i)
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,30,true), SPELL_RAIN_OF_FIRE);
RainTimer = 20000+rand()%15000;
} else RainTimer -= diff;
pos = i;
if (i == 7 && pInstance)
{
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget,0.0);
}
}
if (DoomTimer <= diff)
void JustDied(Unit *victim)
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM,1,100,true), SPELL_DOOM);//never on tank
DoomTimer = 45000+rand()%5000;
} else DoomTimer -= diff;
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
pInstance->SetData(DATA_AZGALOREVENT, DONE);
DoPlaySoundToSet(me, SOUND_ONDEATH);
}
if (HowlTimer <= diff)
void UpdateAI(const uint32 diff)
{
DoCast(me, SPELL_HOWL_OF_AZGALOR);
HowlTimer = 30000;
} else HowlTimer -= diff;
if (IsEvent)
{
//Must update npc_escortAI
npc_escortAI::UpdateAI(diff);
if (!pGo)
{
pGo = true;
if (pInstance)
{
AddWaypoint(0, 5492.91, -2404.61, 1462.63);
AddWaypoint(1, 5531.76, -2460.87, 1469.55);
AddWaypoint(2, 5554.58, -2514.66, 1476.12);
AddWaypoint(3, 5554.16, -2567.23, 1479.90);
AddWaypoint(4, 5540.67, -2625.99, 1480.89);
AddWaypoint(5, 5508.16, -2659.2, 1480.15);
AddWaypoint(6, 5489.62, -2704.05, 1482.18);
AddWaypoint(7, 5457.04, -2726.26, 1485.10);
Start(false, true);
SetDespawnAtEnd(false);
}
}
}
if (CleaveTimer <= diff)
{
DoCast(me->getVictim(), SPELL_CLEAVE);
CleaveTimer = 10000+rand()%5000;
} else CleaveTimer -= diff;
//Return since we have no target
if (!UpdateVictim())
return;
if (EnrageTimer < diff && !enraged)
{
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_BERSERK, true);
enraged = true;
EnrageTimer = 600000;
} else EnrageTimer -= diff;
if (RainTimer <= diff)
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,30,true), SPELL_RAIN_OF_FIRE);
RainTimer = 20000+rand()%15000;
} else RainTimer -= diff;
if (DoomTimer <= diff)
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM,1,100,true), SPELL_DOOM);//never on tank
DoomTimer = 45000+rand()%5000;
} else DoomTimer -= diff;
if (HowlTimer <= diff)
{
DoCast(me, SPELL_HOWL_OF_AZGALOR);
HowlTimer = 30000;
} else HowlTimer -= diff;
if (CleaveTimer <= diff)
{
DoCast(me->getVictim(), SPELL_CLEAVE);
CleaveTimer = 10000+rand()%5000;
} else CleaveTimer -= diff;
if (EnrageTimer < diff && !enraged)
{
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_BERSERK, true);
enraged = true;
EnrageTimer = 600000;
} else EnrageTimer -= diff;
DoMeleeAttackIfReady();
}
};
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_azgalor(Creature* pCreature)
{
return new boss_azgalorAI (pCreature);
}
#define SPELL_THRASH 12787
#define SPELL_CRIPPLE 31406
#define SPELL_WARSTOMP 31408
struct mob_lesser_doomguardAI : public hyjal_trashAI
␍class mob_lesser_doomguard : public CreatureScript
{
mob_lesser_doomguardAI(Creature *c) : hyjal_trashAI(c)
public:
mob_lesser_doomguard() : CreatureScript("mob_lesser_doomguard") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
if (pInstance)
AzgalorGUID = pInstance->GetData64(DATA_AZGALOR);
return new mob_lesser_doomguardAI (pCreature);
}
uint32 CrippleTimer;
uint32 WarstompTimer;
uint32 CheckTimer;
uint64 AzgalorGUID;
ScriptedInstance* pInstance;
void Reset()
struct mob_lesser_doomguardAI : public hyjal_trashAI
{
CrippleTimer = 50000;
WarstompTimer = 10000;
DoCast(me, SPELL_THRASH);
CheckTimer = 5000;
}
void EnterCombat(Unit * /*who*/)
{
}
void KilledUnit(Unit * /*victim*/)
{
}
void WaypointReached(uint32 /*i*/)
{
}
void MoveInLineOfSight(Unit *who)
{
if (me->IsWithinDist(who, 50) && !me->isInCombat() && me->IsHostileTo(who))
AttackStart(who);
}
void JustDied(Unit * /*victim*/)
{
}
void UpdateAI(const uint32 diff)
{
if (CheckTimer <= diff)
mob_lesser_doomguardAI(Creature *c) : hyjal_trashAI(c)
{
if (AzgalorGUID)
{
Creature* boss = Unit::GetCreature((*me),AzgalorGUID);
if (!boss || (boss && boss->isDead()))
{
me->setDeathState(JUST_DIED);
me->RemoveCorpse();
return;
}
}
pInstance = c->GetInstanceScript();
if (pInstance)
AzgalorGUID = pInstance->GetData64(DATA_AZGALOR);
}
uint32 CrippleTimer;
uint32 WarstompTimer;
uint32 CheckTimer;
uint64 AzgalorGUID;
InstanceScript* pInstance;
void Reset()
{
CrippleTimer = 50000;
WarstompTimer = 10000;
DoCast(me, SPELL_THRASH);
CheckTimer = 5000;
} else CheckTimer -= diff;
}
//Return since we have no target
if (!UpdateVictim())
return;
if (WarstompTimer <= diff)
void EnterCombat(Unit * /*who*/)
{
DoCast(me, SPELL_WARSTOMP);
WarstompTimer = 10000+rand()%5000;
} else WarstompTimer -= diff;
}
if (CrippleTimer <= diff)
void KilledUnit(Unit * /*victim*/)
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_CRIPPLE);
CrippleTimer = 25000+rand()%5000;
} else CrippleTimer -= diff;
}
void WaypointReached(uint32 /*i*/)
{
}
void MoveInLineOfSight(Unit *who)
{
if (me->IsWithinDist(who, 50) && !me->isInCombat() && me->IsHostileTo(who))
AttackStart(who);
}
void JustDied(Unit * /*victim*/)
{
}
void UpdateAI(const uint32 diff)
{
if (CheckTimer <= diff)
{
if (AzgalorGUID)
{
Creature* boss = Unit::GetCreature((*me),AzgalorGUID);
if (!boss || (boss && boss->isDead()))
{
me->setDeathState(JUST_DIED);
me->RemoveCorpse();
return;
}
}
CheckTimer = 5000;
} else CheckTimer -= diff;
//Return since we have no target
if (!UpdateVictim())
return;
if (WarstompTimer <= diff)
{
DoCast(me, SPELL_WARSTOMP);
WarstompTimer = 10000+rand()%5000;
} else WarstompTimer -= diff;
if (CrippleTimer <= diff)
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_CRIPPLE);
CrippleTimer = 25000+rand()%5000;
} else CrippleTimer -= diff;
DoMeleeAttackIfReady();
}
};
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_mob_lesser_doomguard(Creature* pCreature)
{
return new mob_lesser_doomguardAI (pCreature);
}
void AddSC_boss_azgalor()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_azgalor";
newscript->GetAI = &GetAI_boss_azgalor;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_lesser_doomguard";
newscript->GetAI = &GetAI_mob_lesser_doomguard;
newscript->RegisterSelf();
new boss_azgalor();
new mob_lesser_doomguard();
}
@@ -39,175 +39,178 @@
#define SAY_ONAGGRO "Cry for mercy! Your meaningless lives will soon be forfeit."
#define SOUND_ONAGGRO 11015
struct boss_kazrogalAI : public hyjal_trashAI
␍class boss_kazrogal : public CreatureScript
{
boss_kazrogalAI(Creature *c) : hyjal_trashAI(c)
public:
boss_kazrogal() : CreatureScript("boss_kazrogal") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
pGo = false;
pos = 0;
SpellEntry *TempSpell = GET_SPELL(SPELL_MARK);
if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 1)
return new boss_kazrogalAI (pCreature);
}
struct boss_kazrogalAI : public hyjal_trashAI
{
boss_kazrogalAI(Creature *c) : hyjal_trashAI(c)
{
TempSpell->EffectImplicitTargetA[0] = 1;
TempSpell->EffectImplicitTargetB[0] = 0;
}
}
uint32 CleaveTimer;
uint32 WarStompTimer;
uint32 MarkTimer;
uint32 MarkTimerBase;
bool pGo;
uint32 pos;
void Reset()
{
damageTaken = 0;
CleaveTimer = 5000;
WarStompTimer = 15000;
MarkTimer = 45000;
MarkTimerBase = 45000;
if (pInstance && IsEvent)
pInstance->SetData(DATA_KAZROGALEVENT, NOT_STARTED);
}
void EnterCombat(Unit * /*who*/)
{
if (pInstance && IsEvent)
pInstance->SetData(DATA_KAZROGALEVENT, IN_PROGRESS);
DoPlaySoundToSet(me, SOUND_ONAGGRO);
me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
}
void KilledUnit(Unit * /*victim*/)
{
switch (urand(0,2))
{
case 0:
DoPlaySoundToSet(me, SOUND_ONSLAY1);
me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
break;
case 1:
DoPlaySoundToSet(me, SOUND_ONSLAY2);
me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
break;
case 2:
DoPlaySoundToSet(me, SOUND_ONSLAY3);
me->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL);
break;
}
}
void WaypointReached(uint32 i)
{
pos = i;
if (i == 7 && pInstance)
{
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget,0.0);
}
}
void JustDied(Unit *victim)
{
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
pInstance->SetData(DATA_KAZROGALEVENT, DONE);
DoPlaySoundToSet(me, SOUND_ONDEATH);
}
void UpdateAI(const uint32 diff)
{
if (IsEvent)
{
//Must update npc_escortAI
npc_escortAI::UpdateAI(diff);
if (!pGo)
pInstance = c->GetInstanceScript();
pGo = false;
pos = 0;
SpellEntry *TempSpell = GET_SPELL(SPELL_MARK);
if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 1)
{
pGo = true;
if (pInstance)
{
AddWaypoint(0, 5492.91, -2404.61, 1462.63);
AddWaypoint(1, 5531.76, -2460.87, 1469.55);
AddWaypoint(2, 5554.58, -2514.66, 1476.12);
AddWaypoint(3, 5554.16, -2567.23, 1479.90);
AddWaypoint(4, 5540.67, -2625.99, 1480.89);
AddWaypoint(5, 5508.16, -2659.2, 1480.15);
AddWaypoint(6, 5489.62, -2704.05, 1482.18);
AddWaypoint(7, 5457.04, -2726.26, 1485.10);
Start(false, true);
SetDespawnAtEnd(false);
}
TempSpell->EffectImplicitTargetA[0] = 1;
TempSpell->EffectImplicitTargetB[0] = 0;
}
}
//Return since we have no target
if (!UpdateVictim())
return;
uint32 CleaveTimer;
uint32 WarStompTimer;
uint32 MarkTimer;
uint32 MarkTimerBase;
bool pGo;
uint32 pos;
if (CleaveTimer <= diff)
void Reset()
{
DoCast(me, SPELL_CLEAVE);
CleaveTimer = 6000+rand()%15000;
} else CleaveTimer -= diff;
damageTaken = 0;
CleaveTimer = 5000;
WarStompTimer = 15000;
MarkTimer = 45000;
MarkTimerBase = 45000;
if (WarStompTimer <= diff)
if (pInstance && IsEvent)
pInstance->SetData(DATA_KAZROGALEVENT, NOT_STARTED);
}
void EnterCombat(Unit * /*who*/)
{
DoCast(me, SPELL_WARSTOMP);
WarStompTimer = 60000;
} else WarStompTimer -= diff;
if (pInstance && IsEvent)
pInstance->SetData(DATA_KAZROGALEVENT, IN_PROGRESS);
DoPlaySoundToSet(me, SOUND_ONAGGRO);
me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
}
if (me->HasAura(SPELL_MARK))
me->RemoveAurasDueToSpell(SPELL_MARK);
if (MarkTimer <= diff)
void KilledUnit(Unit * /*victim*/)
{
//cast dummy, useful for bos addons
me->CastCustomSpell(me, SPELL_MARK, NULL, NULL, NULL, false, NULL, NULL, me->GetGUID());
std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->getPowerType() == POWER_MANA)
{
pTarget->CastSpell(pTarget, SPELL_MARK,true);//only cast on mana users
}
}
MarkTimerBase -= 5000;
if (MarkTimerBase < 5500)
MarkTimerBase = 5500;
MarkTimer = MarkTimerBase;
switch (urand(0,2))
{
case 0:
DoPlaySoundToSet(me, SOUND_MARK1);
me->MonsterYell(SAY_MARK1, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONSLAY1);
me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
break;
case 1:
DoPlaySoundToSet(me, SOUND_MARK2);
me->MonsterYell(SAY_MARK2, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONSLAY2);
me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
break;
case 2:
DoPlaySoundToSet(me, SOUND_ONSLAY3);
me->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL);
break;
}
} else MarkTimer -= diff;
}
void WaypointReached(uint32 i)
{
pos = i;
if (i == 7 && pInstance)
{
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget,0.0);
}
}
void JustDied(Unit *victim)
{
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
pInstance->SetData(DATA_KAZROGALEVENT, DONE);
DoPlaySoundToSet(me, SOUND_ONDEATH);
}
void UpdateAI(const uint32 diff)
{
if (IsEvent)
{
//Must update npc_escortAI
npc_escortAI::UpdateAI(diff);
if (!pGo)
{
pGo = true;
if (pInstance)
{
AddWaypoint(0, 5492.91, -2404.61, 1462.63);
AddWaypoint(1, 5531.76, -2460.87, 1469.55);
AddWaypoint(2, 5554.58, -2514.66, 1476.12);
AddWaypoint(3, 5554.16, -2567.23, 1479.90);
AddWaypoint(4, 5540.67, -2625.99, 1480.89);
AddWaypoint(5, 5508.16, -2659.2, 1480.15);
AddWaypoint(6, 5489.62, -2704.05, 1482.18);
AddWaypoint(7, 5457.04, -2726.26, 1485.10);
Start(false, true);
SetDespawnAtEnd(false);
}
}
}
//Return since we have no target
if (!UpdateVictim())
return;
if (CleaveTimer <= diff)
{
DoCast(me, SPELL_CLEAVE);
CleaveTimer = 6000+rand()%15000;
} else CleaveTimer -= diff;
if (WarStompTimer <= diff)
{
DoCast(me, SPELL_WARSTOMP);
WarStompTimer = 60000;
} else WarStompTimer -= diff;
if (me->HasAura(SPELL_MARK))
me->RemoveAurasDueToSpell(SPELL_MARK);
if (MarkTimer <= diff)
{
//cast dummy, useful for bos addons
me->CastCustomSpell(me, SPELL_MARK, NULL, NULL, NULL, false, NULL, NULL, me->GetGUID());
std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->getPowerType() == POWER_MANA)
{
pTarget->CastSpell(pTarget, SPELL_MARK,true);//only cast on mana users
}
}
MarkTimerBase -= 5000;
if (MarkTimerBase < 5500)
MarkTimerBase = 5500;
MarkTimer = MarkTimerBase;
switch (urand(0,2))
{
case 0:
DoPlaySoundToSet(me, SOUND_MARK1);
me->MonsterYell(SAY_MARK1, LANG_UNIVERSAL, NULL);
break;
case 1:
DoPlaySoundToSet(me, SOUND_MARK2);
me->MonsterYell(SAY_MARK2, LANG_UNIVERSAL, NULL);
break;
}
} else MarkTimer -= diff;
DoMeleeAttackIfReady();
}
};
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_kazrogal(Creature* pCreature)
{
return new boss_kazrogalAI (pCreature);
}
void AddSC_boss_kazrogal()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_kazrogal";
newscript->GetAI = &GetAI_boss_kazrogal;
newscript->RegisterSelf();
new boss_kazrogal();
}
@@ -45,164 +45,167 @@
#define SAY_ONAGGRO "The Legion's final conquest has begun! Once again the subjugation of this world is within our grasp. Let none survive!"
#define SOUND_ONAGGRO 11022
struct boss_rage_winterchillAI : public hyjal_trashAI
␍class boss_rage_winterchill : public CreatureScript
{
boss_rage_winterchillAI(Creature *c) : hyjal_trashAI(c)
public:
boss_rage_winterchill() : CreatureScript("boss_rage_winterchill") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
pGo = false;
pos = 0;
return new boss_rage_winterchillAI (pCreature);
}
uint32 FrostArmorTimer;
uint32 DecayTimer;
uint32 NovaTimer;
uint32 IceboltTimer;
bool pGo;
uint32 pos;
void Reset()
struct boss_rage_winterchillAI : public hyjal_trashAI
{
damageTaken = 0;
FrostArmorTimer = 37000;
DecayTimer = 45000;
NovaTimer = 15000;
IceboltTimer = 10000;
if (pInstance && IsEvent)
pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, NOT_STARTED);
}
void EnterCombat(Unit * /*who*/)
{
if (pInstance && IsEvent)
pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, IN_PROGRESS);
DoPlaySoundToSet(me, SOUND_ONAGGRO);
me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0);
}
void KilledUnit(Unit * /*victim*/)
{
switch (urand(0,1))
boss_rage_winterchillAI(Creature *c) : hyjal_trashAI(c)
{
case 0:
DoPlaySoundToSet(me, SOUND_ONSLAY1);
me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
break;
case 1:
DoPlaySoundToSet(me, SOUND_ONSLAY2);
me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
break;
pInstance = c->GetInstanceScript();
pGo = false;
pos = 0;
}
}
void WaypointReached(uint32 i)
{
pos = i;
if (i == 7 && pInstance)
uint32 FrostArmorTimer;
uint32 DecayTimer;
uint32 NovaTimer;
uint32 IceboltTimer;
bool pGo;
uint32 pos;
void Reset()
{
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget,0.0f);
damageTaken = 0;
FrostArmorTimer = 37000;
DecayTimer = 45000;
NovaTimer = 15000;
IceboltTimer = 10000;
if (pInstance && IsEvent)
pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, NOT_STARTED);
}
}
void JustDied(Unit *victim)
{
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, DONE);
DoPlaySoundToSet(me, SOUND_ONDEATH);
me->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, NULL);
}
void UpdateAI(const uint32 diff)
{
if (IsEvent)
void EnterCombat(Unit * /*who*/)
{
//Must update npc_escortAI
npc_escortAI::UpdateAI(diff);
if (!pGo)
if (pInstance && IsEvent)
pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, IN_PROGRESS);
DoPlaySoundToSet(me, SOUND_ONAGGRO);
me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0);
}
void KilledUnit(Unit * /*victim*/)
{
switch (urand(0,1))
{
pGo = true;
if (pInstance)
case 0:
DoPlaySoundToSet(me, SOUND_ONSLAY1);
me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
break;
case 1:
DoPlaySoundToSet(me, SOUND_ONSLAY2);
me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
break;
}
}
void WaypointReached(uint32 i)
{
pos = i;
if (i == 7 && pInstance)
{
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget,0.0f);
}
}
void JustDied(Unit *victim)
{
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, DONE);
DoPlaySoundToSet(me, SOUND_ONDEATH);
me->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, NULL);
}
void UpdateAI(const uint32 diff)
{
if (IsEvent)
{
//Must update npc_escortAI
npc_escortAI::UpdateAI(diff);
if (!pGo)
{
AddWaypoint(0, 4896.08, -1576.35, 1333.65);
AddWaypoint(1, 4898.68, -1615.02, 1329.48);
AddWaypoint(2, 4907.12, -1667.08, 1321.00);
AddWaypoint(3, 4963.18, -1699.35, 1340.51);
AddWaypoint(4, 4989.16, -1716.67, 1335.74);
AddWaypoint(5, 5026.27, -1736.89, 1323.02);
AddWaypoint(6, 5037.77, -1770.56, 1324.36);
AddWaypoint(7, 5067.23, -1789.95, 1321.17);
Start(false, true);
SetDespawnAtEnd(false);
pGo = true;
if (pInstance)
{
AddWaypoint(0, 4896.08, -1576.35, 1333.65);
AddWaypoint(1, 4898.68, -1615.02, 1329.48);
AddWaypoint(2, 4907.12, -1667.08, 1321.00);
AddWaypoint(3, 4963.18, -1699.35, 1340.51);
AddWaypoint(4, 4989.16, -1716.67, 1335.74);
AddWaypoint(5, 5026.27, -1736.89, 1323.02);
AddWaypoint(6, 5037.77, -1770.56, 1324.36);
AddWaypoint(7, 5067.23, -1789.95, 1321.17);
Start(false, true);
SetDespawnAtEnd(false);
}
}
}
//Return since we have no target
if (!UpdateVictim())
return;
if (FrostArmorTimer <= diff)
{
DoCast(me, SPELL_FROST_ARMOR);
FrostArmorTimer = 40000+rand()%20000;
} else FrostArmorTimer -= diff;
if (DecayTimer <= diff)
{
DoCast(me->getVictim(), SPELL_DEATH_AND_DECAY);
DecayTimer = 60000+rand()%20000;
switch (urand(0,1))
{
case 0:
DoPlaySoundToSet(me, SOUND_DECAY1);
me->MonsterYell(SAY_DECAY1, LANG_UNIVERSAL, NULL);
break;
case 1:
DoPlaySoundToSet(me, SOUND_DECAY2);
me->MonsterYell(SAY_DECAY2, LANG_UNIVERSAL, NULL);
break;
}
} else DecayTimer -= diff;
if (NovaTimer <= diff)
{
DoCast(me->getVictim(), SPELL_FROST_NOVA);
NovaTimer = 30000+rand()%15000;
switch (urand(0,1))
{
case 0:
DoPlaySoundToSet(me, SOUND_NOVA1);
me->MonsterYell(SAY_NOVA1, LANG_UNIVERSAL, NULL);
break;
case 1:
DoPlaySoundToSet(me, SOUND_NOVA2);
me->MonsterYell(SAY_NOVA2, LANG_UNIVERSAL, NULL);
break;
}
} else NovaTimer -= diff;
if (IceboltTimer <= diff)
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,40,true), SPELL_ICEBOLT);
IceboltTimer = 11000+rand()%20000;
} else IceboltTimer -= diff;
DoMeleeAttackIfReady();
}
};
//Return since we have no target
if (!UpdateVictim())
return;
if (FrostArmorTimer <= diff)
{
DoCast(me, SPELL_FROST_ARMOR);
FrostArmorTimer = 40000+rand()%20000;
} else FrostArmorTimer -= diff;
if (DecayTimer <= diff)
{
DoCast(me->getVictim(), SPELL_DEATH_AND_DECAY);
DecayTimer = 60000+rand()%20000;
switch (urand(0,1))
{
case 0:
DoPlaySoundToSet(me, SOUND_DECAY1);
me->MonsterYell(SAY_DECAY1, LANG_UNIVERSAL, NULL);
break;
case 1:
DoPlaySoundToSet(me, SOUND_DECAY2);
me->MonsterYell(SAY_DECAY2, LANG_UNIVERSAL, NULL);
break;
}
} else DecayTimer -= diff;
if (NovaTimer <= diff)
{
DoCast(me->getVictim(), SPELL_FROST_NOVA);
NovaTimer = 30000+rand()%15000;
switch (urand(0,1))
{
case 0:
DoPlaySoundToSet(me, SOUND_NOVA1);
me->MonsterYell(SAY_NOVA1, LANG_UNIVERSAL, NULL);
break;
case 1:
DoPlaySoundToSet(me, SOUND_NOVA2);
me->MonsterYell(SAY_NOVA2, LANG_UNIVERSAL, NULL);
break;
}
} else NovaTimer -= diff;
if (IceboltTimer <= diff)
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,40,true), SPELL_ICEBOLT);
IceboltTimer = 11000+rand()%20000;
} else IceboltTimer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_rage_winterchill(Creature* pCreature)
{
return new boss_rage_winterchillAI (pCreature);
}
void AddSC_boss_rage_winterchill()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_rage_winterchill";
newscript->GetAI = &GetAI_boss_rage_winterchill;
newscript->RegisterSelf();
new boss_rage_winterchill();
}
@@ -44,206 +44,210 @@ EndContentData */
#define ITEM_TEAR_OF_GODDESS 24494
#define GOSSIP_ITEM_GM1 "[GM] Toggle Debug Timers"
CreatureAI* GetAI_npc_jaina_proudmoore(Creature* pCreature)
␍class npc_jaina_proudmoore : public CreatureScript
{
hyjalAI* ai = new hyjalAI(pCreature);
public:
npc_jaina_proudmoore() : CreatureScript("npc_jaina_proudmoore") { }
ai->Reset();
ai->EnterEvadeMode();
ai->Spell[0].SpellId = SPELL_BLIZZARD;
ai->Spell[0].Cooldown = 15000 + rand()%20000;
ai->Spell[0].TargetType = TARGETTYPE_RANDOM;
ai->Spell[1].SpellId = SPELL_PYROBLAST;
ai->Spell[1].Cooldown = 5500 + rand()%4000;
ai->Spell[1].TargetType = TARGETTYPE_RANDOM;
ai->Spell[2].SpellId = SPELL_SUMMON_ELEMENTALS;
ai->Spell[2].Cooldown = 15000 + rand()%30000;
ai->Spell[2].TargetType = TARGETTYPE_SELF;
return ai;
}
bool GossipHello_npc_jaina_proudmoore(Player* pPlayer, Creature* pCreature)
{
hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI());
if (ai->EventBegun)
return false;
uint32 RageEncounter = ai->GetInstanceData(DATA_RAGEWINTERCHILLEVENT);
uint32 AnetheronEncounter = ai->GetInstanceData(DATA_ANETHERONEVENT);
if (RageEncounter == NOT_STARTED)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEGIN_ALLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
else if (RageEncounter == DONE && AnetheronEncounter == NOT_STARTED)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ANETHERON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
else if (RageEncounter == DONE && AnetheronEncounter == DONE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
if (pPlayer->isGameMaster())
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_ITEM_GM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_jaina_proudmoore(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI());
switch(uiAction)
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
case GOSSIP_ACTION_INFO_DEF + 1:
ai->StartEvent(pPlayer);
break;
case GOSSIP_ACTION_INFO_DEF + 2:
ai->FirstBossDead = true;
ai->WaveCount = 9;
ai->StartEvent(pPlayer);
break;
case GOSSIP_ACTION_INFO_DEF + 3:
ai->Retreat();
break;
case GOSSIP_ACTION_INFO_DEF:
ai->Debug = !ai->Debug;
sLog.outDebug("TSCR: HyjalAI - Debug mode has been toggled");
break;
}
return true;
}
CreatureAI* GetAI_npc_thrall(Creature* pCreature)
{
hyjalAI* ai = new hyjalAI(pCreature);
ai->Reset();
ai->EnterEvadeMode();
ai->Spell[0].SpellId = SPELL_CHAIN_LIGHTNING;
ai->Spell[0].Cooldown = 3000 + rand()%5000;
ai->Spell[0].TargetType = TARGETTYPE_VICTIM;
ai->Spell[1].SpellId = SPELL_SUMMON_DIRE_WOLF;
ai->Spell[1].Cooldown = 6000 + rand()%35000;
ai->Spell[1].TargetType = TARGETTYPE_RANDOM;
return ai;
}
bool GossipHello_npc_thrall(Player* pPlayer, Creature* pCreature)
{
hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI());
if (ai->EventBegun)
return false;
uint32 AnetheronEvent = ai->GetInstanceData(DATA_ANETHERONEVENT);
// Only let them start the Horde phases if Anetheron is dead.
if (AnetheronEvent == DONE && ai->GetInstanceData(DATA_ALLIANCE_RETREAT))
{
uint32 KazrogalEvent = ai->GetInstanceData(DATA_KAZROGALEVENT);
uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT);
if (KazrogalEvent == NOT_STARTED)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEGIN_HORDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
else if (KazrogalEvent == DONE && AzgalorEvent == NOT_STARTED)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AZGALOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
else if (AzgalorEvent == DONE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI());
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF + 1:
ai->StartEvent(pPlayer);
break;
case GOSSIP_ACTION_INFO_DEF + 2:
ai->FirstBossDead = true;
ai->WaveCount = 9;
ai->StartEvent(pPlayer);
break;
case GOSSIP_ACTION_INFO_DEF + 3:
ai->Retreat();
break;
case GOSSIP_ACTION_INFO_DEF:
ai->Debug = !ai->Debug;
sLog.outDebug("TSCR: HyjalAI - Debug mode has been toggled");
break;
}
return true;
}
if (pPlayer->isGameMaster())
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_ITEM_GM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_thrall(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI());
ai->DeSpawnVeins();//despawn the alliance veins
switch(uiAction)
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
case GOSSIP_ACTION_INFO_DEF + 1:
ai->StartEvent(pPlayer);
break;
case GOSSIP_ACTION_INFO_DEF + 2:
ai->FirstBossDead = true;
ai->WaveCount = 9;
ai->StartEvent(pPlayer);
break;
case GOSSIP_ACTION_INFO_DEF + 3:
ai->Retreat();
break;
case GOSSIP_ACTION_INFO_DEF:
ai->Debug = !ai->Debug;
sLog.outDebug("TSCR: HyjalAI - Debug mode has been toggled");
break;
hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI());
if (ai->EventBegun)
return false;
uint32 RageEncounter = ai->GetInstanceData(DATA_RAGEWINTERCHILLEVENT);
uint32 AnetheronEncounter = ai->GetInstanceData(DATA_ANETHERONEVENT);
if (RageEncounter == NOT_STARTED)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEGIN_ALLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
else if (RageEncounter == DONE && AnetheronEncounter == NOT_STARTED)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ANETHERON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
else if (RageEncounter == DONE && AnetheronEncounter == DONE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
if (pPlayer->isGameMaster())
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_ITEM_GM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID());
return true;
}
return true;
}
CreatureAI* GetAI_npc_tyrande_whisperwind(Creature* pCreature)
{
hyjalAI* ai = new hyjalAI(pCreature);
ai->Reset();
ai->EnterEvadeMode();
return ai;
}
bool GossipHello_npc_tyrande_whisperwind(Player* pPlayer, Creature* pCreature)
{
hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI());
uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT);
// Only let them get item if Azgalor is dead.
if (AzgalorEvent == DONE && !pPlayer->HasItemCount(ITEM_TEAR_OF_GODDESS,1))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TYRANDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_tyrande_whisperwind(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF)
CreatureAI* GetAI(Creature* pCreature) const
{
ItemPosCountVec dest;
uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_TEAR_OF_GODDESS, 1);
if (msg == EQUIP_ERR_OK)
{
Item* item = pPlayer->StoreNewItem(dest, ITEM_TEAR_OF_GODDESS, true);
if (item && pPlayer)
pPlayer->SendNewItem(item,1,true,false,true);
}
pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID());
CAST_AI(hyjalAI, pCreature->AI());
hyjalAI* ai = new hyjalAI(pCreature);
ai->Reset();
ai->EnterEvadeMode();
ai->Spell[0].SpellId = SPELL_BLIZZARD;
ai->Spell[0].Cooldown = 15000 + rand()%20000;
ai->Spell[0].TargetType = TARGETTYPE_RANDOM;
ai->Spell[1].SpellId = SPELL_PYROBLAST;
ai->Spell[1].Cooldown = 5500 + rand()%4000;
ai->Spell[1].TargetType = TARGETTYPE_RANDOM;
ai->Spell[2].SpellId = SPELL_SUMMON_ELEMENTALS;
ai->Spell[2].Cooldown = 15000 + rand()%30000;
ai->Spell[2].TargetType = TARGETTYPE_SELF;
return ai;
}
return true;
}
};
␍class npc_thrall : public CreatureScript
{
public:
npc_thrall() : CreatureScript("npc_thrall") { }
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI());
ai->DeSpawnVeins();//despawn the alliance veins
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF + 1:
ai->StartEvent(pPlayer);
break;
case GOSSIP_ACTION_INFO_DEF + 2:
ai->FirstBossDead = true;
ai->WaveCount = 9;
ai->StartEvent(pPlayer);
break;
case GOSSIP_ACTION_INFO_DEF + 3:
ai->Retreat();
break;
case GOSSIP_ACTION_INFO_DEF:
ai->Debug = !ai->Debug;
sLog.outDebug("TSCR: HyjalAI - Debug mode has been toggled");
break;
}
return true;
}
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI());
if (ai->EventBegun)
return false;
uint32 AnetheronEvent = ai->GetInstanceData(DATA_ANETHERONEVENT);
// Only let them start the Horde phases if Anetheron is dead.
if (AnetheronEvent == DONE && ai->GetInstanceData(DATA_ALLIANCE_RETREAT))
{
uint32 KazrogalEvent = ai->GetInstanceData(DATA_KAZROGALEVENT);
uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT);
if (KazrogalEvent == NOT_STARTED)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEGIN_HORDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
else if (KazrogalEvent == DONE && AzgalorEvent == NOT_STARTED)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AZGALOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
else if (AzgalorEvent == DONE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
}
if (pPlayer->isGameMaster())
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_ITEM_GM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID());
return true;
}
CreatureAI* GetAI(Creature* pCreature) const
{
hyjalAI* ai = new hyjalAI(pCreature);
ai->Reset();
ai->EnterEvadeMode();
ai->Spell[0].SpellId = SPELL_CHAIN_LIGHTNING;
ai->Spell[0].Cooldown = 3000 + rand()%5000;
ai->Spell[0].TargetType = TARGETTYPE_VICTIM;
ai->Spell[1].SpellId = SPELL_SUMMON_DIRE_WOLF;
ai->Spell[1].Cooldown = 6000 + rand()%35000;
ai->Spell[1].TargetType = TARGETTYPE_RANDOM;
return ai;
}
};
␍class npc_tyrande_whisperwind : public CreatureScript
{
public:
npc_tyrande_whisperwind() : CreatureScript("npc_tyrande_whisperwind") { }
CreatureAI* GetAI(Creature* pCreature) const
{
hyjalAI* ai = new hyjalAI(pCreature);
ai->Reset();
ai->EnterEvadeMode();
return ai;
}
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF)
{
ItemPosCountVec dest;
uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_TEAR_OF_GODDESS, 1);
if (msg == EQUIP_ERR_OK)
{
Item* item = pPlayer->StoreNewItem(dest, ITEM_TEAR_OF_GODDESS, true);
if (item && pPlayer)
pPlayer->SendNewItem(item,1,true,false,true);
}
pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID());
CAST_AI(hyjalAI, pCreature->AI());
}
return true;
}
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI());
uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT);
// Only let them get item if Azgalor is dead.
if (AzgalorEvent == DONE && !pPlayer->HasItemCount(ITEM_TEAR_OF_GODDESS,1))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TYRANDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID());
return true;
}
};
void AddSC_hyjal()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_jaina_proudmoore";
newscript->GetAI = &GetAI_npc_jaina_proudmoore;
newscript->pGossipHello = &GossipHello_npc_jaina_proudmoore;
newscript->pGossipSelect = &GossipSelect_npc_jaina_proudmoore;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_thrall";
newscript->GetAI = &GetAI_npc_thrall;
newscript->pGossipHello = &GossipHello_npc_thrall;
newscript->pGossipSelect = &GossipSelect_npc_thrall;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_tyrande_whisperwind";
newscript->pGossipHello = &GossipHello_npc_tyrande_whisperwind;
newscript->pGossipSelect = &GossipSelect_npc_tyrande_whisperwind;
newscript->GetAI = &GetAI_npc_tyrande_whisperwind;
newscript->RegisterSelf();
new npc_jaina_proudmoore();
new npc_thrall();
new npc_tyrande_whisperwind();
}
@@ -312,7 +312,7 @@ float HordeFirePos[65][8]=//spawn points for the fire visuals (GO) in the horde
hyjalAI::hyjalAI(Creature *c) : npc_escortAI(c), Summons(me)
{
pInstance = c->GetInstanceData();
pInstance = c->GetInstanceScript();
VeinsSpawned[0] = false;
VeinsSpawned[1] = false;
for (uint8 i=0; i<14; ++i)
@@ -210,7 +210,7 @@ struct hyjalAI : public npc_escortAI
void Talk(uint32 id); // Searches for the appropriate yell and sound and uses it to inform the raid of various things
public:
ScriptedInstance* pInstance;
InstanceScript* pInstance;
uint64 PlayerGUID;
uint64 BossGUID[2];
File diff suppressed because it is too large Load Diff
@@ -34,7 +34,7 @@ struct hyjal_trashAI : public npc_escortAI
void DamageTaken(Unit *done_by, uint32 &damage);
public:
ScriptedInstance* pInstance;
InstanceScript* pInstance;
bool IsEvent;
uint32 Delay;
uint32 LastOverronPos;
@@ -40,287 +40,289 @@ enum eEnums
3 - Azgalor event
4 - Archimonde event
*/
struct instance_mount_hyjal : public ScriptedInstance
class instance_hyjal : public InstanceMapScript
{
instance_mount_hyjal(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
public:
instance_hyjal() : InstanceMapScript("instance_hyjal") { }
uint32 m_auiEncounter[MAX_ENCOUNTER];
std::string str_data;
std::list<uint64> m_uiAncientGemGUID;
uint64 RageWinterchill;
uint64 Anetheron;
uint64 Kazrogal;
uint64 Azgalor;
uint64 Archimonde;
uint64 JainaProudmoore;
uint64 Thrall;
uint64 TyrandeWhisperwind;
uint64 HordeGate;
uint64 ElfGate;
uint32 Trash;
uint32 hordeRetreat;
uint32 allianceRetreat;
bool ArchiYell;
uint32 RaidDamage;
#define YELL_EFFORTS "All of your efforts have been in vain, for the draining of the World Tree has already begun. Soon the heart of your world will beat no more."
#define YELL_EFFORTS_NAME "Archimonde"
void Initialize()
InstanceScript* GetInstanceData_instance_mount_hyjal_InstanceMapScript(Map* pMap)
{
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
m_uiAncientGemGUID.clear();
RageWinterchill = 0;
Anetheron = 0;
Kazrogal = 0;
Azgalor = 0;
Archimonde = 0;
JainaProudmoore = 0;
Thrall = 0;
TyrandeWhisperwind = 0;
HordeGate = 0;
ElfGate = 0;
ArchiYell = false;
RaidDamage = 0;
Trash = 0;
hordeRetreat = 0;
allianceRetreat = 0;
return new instance_mount_hyjal_InstanceMapScript(pMap);
}
bool IsEncounterInProgress() const
struct instance_mount_hyjal_InstanceMapScript : public InstanceScript
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
instance_mount_hyjal_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();};
return false;
}
uint32 m_auiEncounter[MAX_ENCOUNTER];
std::string str_data;
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
{
switch(pGo->GetEntry())
std::list<uint64> m_uiAncientGemGUID;
uint64 RageWinterchill;
uint64 Anetheron;
uint64 Kazrogal;
uint64 Azgalor;
uint64 Archimonde;
uint64 JainaProudmoore;
uint64 Thrall;
uint64 TyrandeWhisperwind;
uint64 HordeGate;
uint64 ElfGate;
uint32 Trash;
uint32 hordeRetreat;
uint32 allianceRetreat;
bool ArchiYell;
uint32 RaidDamage;
#define YELL_EFFORTS "All of your efforts have been in vain, for the draining of the World Tree has already begun. Soon the heart of your world will beat no more."
#define YELL_EFFORTS_NAME "Archimonde"
void Initialize()
{
case 182060:
HordeGate = pGo->GetGUID();
if (allianceRetreat)
HandleGameObject(0, true, pGo);
else
HandleGameObject(0, false, pGo);
break;
case 182061:
ElfGate = pGo->GetGUID();
if (hordeRetreat)
HandleGameObject(0, true, pGo);
else
HandleGameObject(0, false, pGo);
break;
case GO_ANCIENT_GEM:
m_uiAncientGemGUID.push_back(pGo->GetGUID());
break;
}
}
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
switch(pCreature->GetEntry())
{
case 17767: RageWinterchill = pCreature->GetGUID(); break;
case 17808: Anetheron = pCreature->GetGUID(); break;
case 17888: Kazrogal = pCreature->GetGUID(); break;
case 17842: Azgalor = pCreature->GetGUID(); break;
case 17968: Archimonde = pCreature->GetGUID(); break;
case 17772: JainaProudmoore = pCreature->GetGUID(); break;
case 17852: Thrall = pCreature->GetGUID(); break;
case 17948: TyrandeWhisperwind = pCreature->GetGUID(); break;
}
}
m_uiAncientGemGUID.clear();
uint64 GetData64(uint32 identifier)
{
switch(identifier)
{
case DATA_RAGEWINTERCHILL: return RageWinterchill;
case DATA_ANETHERON: return Anetheron;
case DATA_KAZROGAL: return Kazrogal;
case DATA_AZGALOR: return Azgalor;
case DATA_ARCHIMONDE: return Archimonde;
case DATA_JAINAPROUDMOORE: return JainaProudmoore;
case DATA_THRALL: return Thrall;
case DATA_TYRANDEWHISPERWIND: return TyrandeWhisperwind;
RageWinterchill = 0;
Anetheron = 0;
Kazrogal = 0;
Azgalor = 0;
Archimonde = 0;
JainaProudmoore = 0;
Thrall = 0;
TyrandeWhisperwind = 0;
HordeGate = 0;
ElfGate = 0;
ArchiYell = false;
RaidDamage = 0;
Trash = 0;
hordeRetreat = 0;
allianceRetreat = 0;
}
return 0;
}
void SetData(uint32 type, uint32 data)
{
switch(type)
bool IsEncounterInProgress() const
{
case DATA_RAGEWINTERCHILLEVENT: m_auiEncounter[0] = data; break;
case DATA_ANETHERONEVENT:
m_auiEncounter[1] = data;
break;
case DATA_KAZROGALEVENT: m_auiEncounter[2] = data; break;
case DATA_AZGALOREVENT:
{
m_auiEncounter[3] = data;
if (data == DONE)
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
return false;
}
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
{
switch(pGo->GetEntry())
{
case 182060:
HordeGate = pGo->GetGUID();
if (allianceRetreat)
HandleGameObject(0, true, pGo);
else
HandleGameObject(0, false, pGo);
break;
case 182061:
ElfGate = pGo->GetGUID();
if (hordeRetreat)
HandleGameObject(0, true, pGo);
else
HandleGameObject(0, false, pGo);
break;
case GO_ANCIENT_GEM:
m_uiAncientGemGUID.push_back(pGo->GetGUID());
break;
}
}
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
switch(pCreature->GetEntry())
{
case 17767: RageWinterchill = pCreature->GetGUID(); break;
case 17808: Anetheron = pCreature->GetGUID(); break;
case 17888: Kazrogal = pCreature->GetGUID(); break;
case 17842: Azgalor = pCreature->GetGUID(); break;
case 17968: Archimonde = pCreature->GetGUID(); break;
case 17772: JainaProudmoore = pCreature->GetGUID(); break;
case 17852: Thrall = pCreature->GetGUID(); break;
case 17948: TyrandeWhisperwind = pCreature->GetGUID(); break;
}
}
uint64 GetData64(uint32 identifier)
{
switch(identifier)
{
case DATA_RAGEWINTERCHILL: return RageWinterchill;
case DATA_ANETHERON: return Anetheron;
case DATA_KAZROGAL: return Kazrogal;
case DATA_AZGALOR: return Azgalor;
case DATA_ARCHIMONDE: return Archimonde;
case DATA_JAINAPROUDMOORE: return JainaProudmoore;
case DATA_THRALL: return Thrall;
case DATA_TYRANDEWHISPERWIND: return TyrandeWhisperwind;
}
return 0;
}
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_RAGEWINTERCHILLEVENT: m_auiEncounter[0] = data; break;
case DATA_ANETHERONEVENT:
m_auiEncounter[1] = data;
break;
case DATA_KAZROGALEVENT: m_auiEncounter[2] = data; break;
case DATA_AZGALOREVENT:
{
if (ArchiYell)break;
ArchiYell = true;
Creature* pCreature = instance->GetCreature(Azgalor);
if (pCreature)
m_auiEncounter[3] = data;
if (data == DONE)
{
Creature* pUnit = pCreature->SummonCreature(21987,pCreature->GetPositionX(),pCreature->GetPositionY(),pCreature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,10000);
if (ArchiYell)break;
ArchiYell = true;
Map* pMap = pCreature->GetMap();
if (pMap->IsDungeon() && pUnit)
Creature* pCreature = instance->GetCreature(Azgalor);
if (pCreature)
{
pUnit->SetVisibility(VISIBILITY_OFF);
Map::PlayerList const &PlayerList = pMap->GetPlayers();
if (PlayerList.isEmpty())
return;
Creature* pUnit = pCreature->SummonCreature(21987,pCreature->GetPositionX(),pCreature->GetPositionY(),pCreature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,10000);
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
Map* pMap = pCreature->GetMap();
if (pMap->IsDungeon() && pUnit)
{
if (i->getSource())
{
WorldPacket data(SMSG_MESSAGECHAT, 200);
pUnit->BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,YELL_EFFORTS,0,YELL_EFFORTS_NAME,i->getSource()->GetGUID());
i->getSource()->GetSession()->SendPacket(&data);
pUnit->SetVisibility(VISIBILITY_OFF);
Map::PlayerList const &PlayerList = pMap->GetPlayers();
if (PlayerList.isEmpty())
return;
WorldPacket data2(SMSG_PLAY_SOUND, 4);
data2 << 10986;
i->getSource()->GetSession()->SendPacket(&data2);
}
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->getSource())
{
WorldPacket data(SMSG_MESSAGECHAT, 200);
pUnit->BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,YELL_EFFORTS,0,YELL_EFFORTS_NAME,i->getSource()->GetGUID());
i->getSource()->GetSession()->SendPacket(&data);
WorldPacket data2(SMSG_PLAY_SOUND, 4);
data2 << 10986;
i->getSource()->GetSession()->SendPacket(&data2);
}
}
}
}
}
}
}
break;
case DATA_ARCHIMONDEEVENT: m_auiEncounter[4] = data; break;
case DATA_RESET_TRASH_COUNT: Trash = 0; break;
break;
case DATA_ARCHIMONDEEVENT: m_auiEncounter[4] = data; break;
case DATA_RESET_TRASH_COUNT: Trash = 0; break;
case DATA_TRASH:
if (data) Trash = data;
else Trash--;
DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, Trash);
break;
case TYPE_RETREAT:
if (data == SPECIAL)
{
if (!m_uiAncientGemGUID.empty())
case DATA_TRASH:
if (data) Trash = data;
else Trash--;
DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, Trash);
break;
case TYPE_RETREAT:
if (data == SPECIAL)
{
for (std::list<uint64>::const_iterator itr = m_uiAncientGemGUID.begin(); itr != m_uiAncientGemGUID.end(); ++itr)
if (!m_uiAncientGemGUID.empty())
{
//don't know how long it expected
DoRespawnGameObject(*itr,DAY);
for (std::list<uint64>::const_iterator itr = m_uiAncientGemGUID.begin(); itr != m_uiAncientGemGUID.end(); ++itr)
{
//don't know how long it expected
DoRespawnGameObject(*itr,DAY);
}
}
}
}
break;
case DATA_ALLIANCE_RETREAT:
allianceRetreat = data;
HandleGameObject(HordeGate, true);
break;
case DATA_ALLIANCE_RETREAT:
allianceRetreat = data;
HandleGameObject(HordeGate, true);
SaveToDB();
break;
case DATA_HORDE_RETREAT:
hordeRetreat = data;
HandleGameObject(ElfGate, true);
SaveToDB();
break;
case DATA_RAIDDAMAGE:
RaidDamage += data;
if (RaidDamage >= MINRAIDDAMAGE)
RaidDamage = MINRAIDDAMAGE;
break;
case DATA_RESET_RAIDDAMAGE:
RaidDamage = 0;
break;
}
sLog.outDebug("TSCR: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data);
if (data == DONE)
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " "
<< m_auiEncounter[3] << " " << m_auiEncounter[4]
<< " " << allianceRetreat << " " << hordeRetreat
<< " " << RaidDamage;
str_data = saveStream.str();
SaveToDB();
break;
case DATA_HORDE_RETREAT:
hordeRetreat = data;
HandleGameObject(ElfGate, true);
SaveToDB();
break;
case DATA_RAIDDAMAGE:
RaidDamage += data;
if (RaidDamage >= MINRAIDDAMAGE)
RaidDamage = MINRAIDDAMAGE;
break;
case DATA_RESET_RAIDDAMAGE:
RaidDamage = 0;
break;
OUT_SAVE_INST_DATA_COMPLETE;
}
}
sLog.outDebug("TSCR: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data);
if (data == DONE)
uint32 GetData(uint32 type)
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " "
<< m_auiEncounter[3] << " " << m_auiEncounter[4]
<< " " << allianceRetreat << " " << hordeRetreat
<< " " << RaidDamage;
str_data = saveStream.str();
SaveToDB();
OUT_SAVE_INST_DATA_COMPLETE;
switch(type)
{
case DATA_RAGEWINTERCHILLEVENT: return m_auiEncounter[0];
case DATA_ANETHERONEVENT: return m_auiEncounter[1];
case DATA_KAZROGALEVENT: return m_auiEncounter[2];
case DATA_AZGALOREVENT: return m_auiEncounter[3];
case DATA_ARCHIMONDEEVENT: return m_auiEncounter[4];
case DATA_TRASH: return Trash;
case DATA_ALLIANCE_RETREAT: return allianceRetreat;
case DATA_HORDE_RETREAT: return hordeRetreat;
case DATA_RAIDDAMAGE: return RaidDamage;
}
return 0;
}
}
uint32 GetData(uint32 type)
{
switch(type)
std::string GetSaveData()
{
case DATA_RAGEWINTERCHILLEVENT: return m_auiEncounter[0];
case DATA_ANETHERONEVENT: return m_auiEncounter[1];
case DATA_KAZROGALEVENT: return m_auiEncounter[2];
case DATA_AZGALOREVENT: return m_auiEncounter[3];
case DATA_ARCHIMONDEEVENT: return m_auiEncounter[4];
case DATA_TRASH: return Trash;
case DATA_ALLIANCE_RETREAT: return allianceRetreat;
case DATA_HORDE_RETREAT: return hordeRetreat;
case DATA_RAIDDAMAGE: return RaidDamage;
return str_data;
}
return 0;
}
std::string GetSaveData()
{
return str_data;
}
void Load(const char* in)
{
if (!in)
void Load(const char* in)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
if (!in)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(in);
std::istringstream loadStream(in);
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4] >> allianceRetreat >> hordeRetreat >> RaidDamage;
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as IN_PROGRESS - reset it instead.
m_auiEncounter[i] = NOT_STARTED;
OUT_LOAD_INST_DATA_COMPLETE;
}
};
OUT_LOAD_INST_DATA(in);
std::istringstream loadStream(in);
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4] >> allianceRetreat >> hordeRetreat >> RaidDamage;
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as IN_PROGRESS - reset it instead.
m_auiEncounter[i] = NOT_STARTED;
OUT_LOAD_INST_DATA_COMPLETE;
}
};
InstanceData* GetInstanceData_instance_mount_hyjal(Map* pMap)
{
return new instance_mount_hyjal(pMap);
}
void AddSC_instance_mount_hyjal()
{
Script *newscript;
newscript = new Script;
newscript->Name = "instance_hyjal";
newscript->GetInstanceData = &GetInstanceData_instance_mount_hyjal;
newscript->RegisterSelf();
new instance_hyjal();
}
@@ -48,108 +48,110 @@ enum Yells
SAY_SLAY_3 = -1595007, //"You were destined to fail. "
SAY_DEATH = -1595008 //"*gurgles*"
};
struct boss_epochAI : public ScriptedAI
class boss_epoch : public CreatureScript
{
boss_epochAI(Creature *c) : ScriptedAI(c)
public:
boss_epoch() : CreatureScript("boss_epoch") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
return new boss_epochAI (pCreature);
}
uint8 uiStep;
uint32 uiStepTimer;
uint32 uiWoundingStrikeTimer;
uint32 uiTimeWarpTimer;
uint32 uiTimeStopTimer;
uint32 uiCurseOfExertionTimer;
ScriptedInstance* pInstance;
void Reset()
struct boss_epochAI : public ScriptedAI
{
uiStep = 1;
uiStepTimer = 26000;
uiCurseOfExertionTimer = 9300;
uiTimeWarpTimer = 25300;
uiTimeStopTimer = 21300;
uiWoundingStrikeTimer = 5300;
if (pInstance)
pInstance->SetData(DATA_EPOCH_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_EPOCH_EVENT, IN_PROGRESS);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (uiCurseOfExertionTimer < diff)
boss_epochAI(Creature *c) : ScriptedAI(c)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_CURSE_OF_EXERTION);
pInstance = c->GetInstanceScript();
}
uint8 uiStep;
uint32 uiStepTimer;
uint32 uiWoundingStrikeTimer;
uint32 uiTimeWarpTimer;
uint32 uiTimeStopTimer;
uint32 uiCurseOfExertionTimer;
InstanceScript* pInstance;
void Reset()
{
uiStep = 1;
uiStepTimer = 26000;
uiCurseOfExertionTimer = 9300;
} else uiCurseOfExertionTimer -= diff;
if (uiWoundingStrikeTimer < diff)
{
DoCastVictim(SPELL_WOUNDING_STRIKE);
uiWoundingStrikeTimer = 5300;
} else uiWoundingStrikeTimer -= diff;
if (uiTimeStopTimer < diff)
{
DoCastAOE(SPELL_TIME_STOP);
uiTimeStopTimer = 21300;
} else uiTimeStopTimer -= diff;
if (uiTimeWarpTimer < diff)
{
DoScriptText(RAND(SAY_TIME_WARP_1,SAY_TIME_WARP_2,SAY_TIME_WARP_3), me);
DoCastAOE(SPELL_TIME_WARP);
uiTimeWarpTimer = 25300;
} else uiTimeWarpTimer -= diff;
uiTimeStopTimer = 21300;
uiWoundingStrikeTimer = 5300;
DoMeleeAttackIfReady();
}
if (pInstance)
pInstance->SetData(DATA_EPOCH_EVENT, NOT_STARTED);
}
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_EPOCH_EVENT, DONE);
}
if (pInstance)
pInstance->SetData(DATA_EPOCH_EVENT, IN_PROGRESS);
}
void KilledUnit(Unit * victim)
{
if (victim == me)
return;
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (uiCurseOfExertionTimer < diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_CURSE_OF_EXERTION);
uiCurseOfExertionTimer = 9300;
} else uiCurseOfExertionTimer -= diff;
if (uiWoundingStrikeTimer < diff)
{
DoCastVictim(SPELL_WOUNDING_STRIKE);
uiWoundingStrikeTimer = 5300;
} else uiWoundingStrikeTimer -= diff;
if (uiTimeStopTimer < diff)
{
DoCastAOE(SPELL_TIME_STOP);
uiTimeStopTimer = 21300;
} else uiTimeStopTimer -= diff;
if (uiTimeWarpTimer < diff)
{
DoScriptText(RAND(SAY_TIME_WARP_1,SAY_TIME_WARP_2,SAY_TIME_WARP_3), me);
DoCastAOE(SPELL_TIME_WARP);
uiTimeWarpTimer = 25300;
} else uiTimeWarpTimer -= diff;
DoMeleeAttackIfReady();
}
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_EPOCH_EVENT, DONE);
}
void KilledUnit(Unit * victim)
{
if (victim == me)
return;
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
};
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
};
CreatureAI* GetAI_boss_epoch(Creature* pCreature)
{
return new boss_epochAI (pCreature);
}
void AddSC_boss_epoch()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_epoch";
newscript->GetAI = &GetAI_boss_epoch;
newscript->RegisterSelf();
new boss_epoch();
}
@@ -31,57 +31,59 @@ enum Yells
SAY_DEATH = -1595047
};
struct boss_infinite_corruptorAI : public ScriptedAI
class boss_infinite_corruptor : public CreatureScript
{
boss_infinite_corruptorAI(Creature *c) : ScriptedAI(c)
public:
boss_infinite_corruptor() : CreatureScript("boss_infinite_corruptor") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
return new boss_infinite_corruptorAI(pCreature);
}
ScriptedInstance* pInstance;
void Reset()
struct boss_infinite_corruptorAI : public ScriptedAI
{
if (pInstance)
pInstance->SetData(DATA_INFINITE_EVENT, NOT_STARTED);
}
boss_infinite_corruptorAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceScript();
}
void EnterCombat(Unit* /*who*/)
{
if (pInstance)
pInstance->SetData(DATA_INFINITE_EVENT, IN_PROGRESS);
}
InstanceScript* pInstance;
void AttackStart(Unit* /*who*/) {}
void MoveInLineOfSight(Unit* /*who*/) {}
void UpdateAI(const uint32 /*diff*/)
{
//Return since we have no target
if (!UpdateVictim())
return;
void Reset()
{
if (pInstance)
pInstance->SetData(DATA_INFINITE_EVENT, NOT_STARTED);
}
DoMeleeAttackIfReady();
}
void EnterCombat(Unit* /*who*/)
{
if (pInstance)
pInstance->SetData(DATA_INFINITE_EVENT, IN_PROGRESS);
}
void AttackStart(Unit* /*who*/) {}
void MoveInLineOfSight(Unit* /*who*/) {}
void UpdateAI(const uint32 /*diff*/)
{
//Return since we have no target
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
void JustDied(Unit* /*killer*/)
{
if (pInstance)
pInstance->SetData(DATA_INFINITE_EVENT, DONE);
}
};
void JustDied(Unit* /*killer*/)
{
if (pInstance)
pInstance->SetData(DATA_INFINITE_EVENT, DONE);
}
};
CreatureAI* GetAI_boss_infinite_corruptor(Creature* pCreature)
{
return new boss_infinite_corruptorAI(pCreature);
}
void AddSC_boss_infinite_corruptor()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_infinite_corruptor";
newscript->GetAI = &GetAI_boss_infinite_corruptor;
newscript->RegisterSelf();
new boss_infinite_corruptor();
}
@@ -66,196 +66,198 @@ enum CombatPhases
COMBAT,
OUTRO
};
struct boss_mal_ganisAI : public ScriptedAI
class boss_mal_ganis : public CreatureScript
{
boss_mal_ganisAI(Creature *c) : ScriptedAI(c)
public:
boss_mal_ganis() : CreatureScript("boss_mal_ganis") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
return new boss_mal_ganisAI (pCreature);
}
uint32 uiCarrionSwarmTimer;
uint32 uiMindBlastTimer;
uint32 uiVampiricTouchTimer;
uint32 uiSleepTimer;
uint8 uiOutroStep;
uint32 uiOutroTimer;
bool bYelled;
bool bYelled2;
CombatPhases Phase;
ScriptedInstance* pInstance;
void Reset()
struct boss_mal_ganisAI : public ScriptedAI
{
bYelled = false;
bYelled2 = false;
Phase = COMBAT;
uiCarrionSwarmTimer = 6000;
uiMindBlastTimer = 11000;
uiVampiricTouchTimer = urand(10000,15000);
uiSleepTimer = urand(15000,20000);
uiOutroTimer = 1000;
if (pInstance)
pInstance->SetData(DATA_MAL_GANIS_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_MAL_GANIS_EVENT, IN_PROGRESS);
}
void DamageTaken(Unit *done_by, uint32 &damage)
{
if (damage >= me->GetHealth() && done_by != me)
damage = me->GetHealth()-1;
}
void UpdateAI(const uint32 diff)
{
switch(Phase)
boss_mal_ganisAI(Creature *c) : ScriptedAI(c)
{
case COMBAT:
//Return since we have no target
if (!UpdateVictim())
return;
if (!bYelled && HealthBelowPct(30))
{
DoScriptText(SAY_30HEALTH, me);
bYelled = true;
}
if (!bYelled2 && HealthBelowPct(15))
{
DoScriptText(SAY_15HEALTH, me);
bYelled2 = true;
}
if (HealthBelowPct(1))
{
//Handle Escape Event: Don't forget to add Player::RewardPlayerAndGroupAtEvent
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
uiOutroStep = 1;
Phase = OUTRO;
return;
}
if (Creature* pArthas = me->GetCreature(*me, pInstance ? pInstance->GetData64(DATA_ARTHAS) : 0))
if (pArthas->isDead())
{
EnterEvadeMode();
me->DisappearAndDie();
if (pInstance)
pInstance->SetData(DATA_MAL_GANIS_EVENT, FAIL);
}
if (uiCarrionSwarmTimer < diff)
{
DoCastVictim(SPELL_CARRION_SWARM);
uiCarrionSwarmTimer = 7000;
} else uiCarrionSwarmTimer -= diff;
if (uiMindBlastTimer < diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_MIND_BLAST);
uiMindBlastTimer = 6000;
} else uiMindBlastTimer -= diff;
if (uiVampiricTouchTimer < diff)
{
DoCast(me, SPELL_VAMPIRIC_TOUCH);
uiVampiricTouchTimer = 32000;
} else uiVampiricTouchTimer -= diff;
if (uiSleepTimer < diff)
{
DoScriptText(RAND(SAY_SLEEP_1,SAY_SLEEP_2), me);
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_SLEEP);
uiSleepTimer = urand(15000,20000);
} else uiSleepTimer -= diff;
DoMeleeAttackIfReady();
break;
case OUTRO:
if (uiOutroTimer < diff)
{
switch(uiOutroStep)
{
case 1:
DoScriptText(SAY_ESCAPE_SPEECH_1, me);
me->GetMotionMaster()->MoveTargetedHome();
++uiOutroStep;
uiOutroTimer = 8000;
break;
case 2:
me->SetUInt64Value(UNIT_FIELD_TARGET, pInstance ? pInstance->GetData64(DATA_ARTHAS) : 0);
me->HandleEmoteCommand(29);
DoScriptText(SAY_ESCAPE_SPEECH_2, me);
++uiOutroStep;
uiOutroTimer = 9000;
break;
case 3:
DoScriptText(SAY_OUTRO, me);
++uiOutroStep;
uiOutroTimer = 16000;
break;
case 4:
me->HandleEmoteCommand(33);
++uiOutroStep;
uiOutroTimer = 500;
break;
case 5:
me->SetVisibility(VISIBILITY_OFF);
me->Kill(me);
break;
}
} else uiOutroTimer -= diff;
break;
pInstance = c->GetInstanceScript();
}
}
void JustDied(Unit* /*killer*/)
{
if (pInstance)
uint32 uiCarrionSwarmTimer;
uint32 uiMindBlastTimer;
uint32 uiVampiricTouchTimer;
uint32 uiSleepTimer;
uint8 uiOutroStep;
uint32 uiOutroTimer;
bool bYelled;
bool bYelled2;
CombatPhases Phase;
InstanceScript* pInstance;
void Reset()
{
pInstance->SetData(DATA_MAL_GANIS_EVENT, DONE);
bYelled = false;
bYelled2 = false;
Phase = COMBAT;
uiCarrionSwarmTimer = 6000;
uiMindBlastTimer = 11000;
uiVampiricTouchTimer = urand(10000,15000);
uiSleepTimer = urand(15000,20000);
uiOutroTimer = 1000;
// give achievement credit to players. criteria use spell 58630 which doesn't exist.
if (pInstance)
pInstance->SetData(DATA_MAL_GANIS_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 58630);
pInstance->SetData(DATA_MAL_GANIS_EVENT, IN_PROGRESS);
}
}
void KilledUnit(Unit * victim)
{
if (victim == me)
return;
void DamageTaken(Unit *done_by, uint32 &damage)
{
if (damage >= me->GetHealth() && done_by != me)
damage = me->GetHealth()-1;
}
void UpdateAI(const uint32 diff)
{
switch(Phase)
{
case COMBAT:
//Return since we have no target
if (!UpdateVictim())
return;
if (!bYelled && HealthBelowPct(30))
{
DoScriptText(SAY_30HEALTH, me);
bYelled = true;
}
if (!bYelled2 && HealthBelowPct(15))
{
DoScriptText(SAY_15HEALTH, me);
bYelled2 = true;
}
if (HealthBelowPct(1))
{
//Handle Escape Event: Don't forget to add Player::RewardPlayerAndGroupAtEvent
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
uiOutroStep = 1;
Phase = OUTRO;
return;
}
if (Creature* pArthas = me->GetCreature(*me, pInstance ? pInstance->GetData64(DATA_ARTHAS) : 0))
if (pArthas->isDead())
{
EnterEvadeMode();
me->DisappearAndDie();
if (pInstance)
pInstance->SetData(DATA_MAL_GANIS_EVENT, FAIL);
}
if (uiCarrionSwarmTimer < diff)
{
DoCastVictim(SPELL_CARRION_SWARM);
uiCarrionSwarmTimer = 7000;
} else uiCarrionSwarmTimer -= diff;
if (uiMindBlastTimer < diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_MIND_BLAST);
uiMindBlastTimer = 6000;
} else uiMindBlastTimer -= diff;
if (uiVampiricTouchTimer < diff)
{
DoCast(me, SPELL_VAMPIRIC_TOUCH);
uiVampiricTouchTimer = 32000;
} else uiVampiricTouchTimer -= diff;
if (uiSleepTimer < diff)
{
DoScriptText(RAND(SAY_SLEEP_1,SAY_SLEEP_2), me);
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_SLEEP);
uiSleepTimer = urand(15000,20000);
} else uiSleepTimer -= diff;
DoMeleeAttackIfReady();
break;
case OUTRO:
if (uiOutroTimer < diff)
{
switch(uiOutroStep)
{
case 1:
DoScriptText(SAY_ESCAPE_SPEECH_1, me);
me->GetMotionMaster()->MoveTargetedHome();
++uiOutroStep;
uiOutroTimer = 8000;
break;
case 2:
me->SetUInt64Value(UNIT_FIELD_TARGET, pInstance ? pInstance->GetData64(DATA_ARTHAS) : 0);
me->HandleEmoteCommand(29);
DoScriptText(SAY_ESCAPE_SPEECH_2, me);
++uiOutroStep;
uiOutroTimer = 9000;
break;
case 3:
DoScriptText(SAY_OUTRO, me);
++uiOutroStep;
uiOutroTimer = 16000;
break;
case 4:
me->HandleEmoteCommand(33);
++uiOutroStep;
uiOutroTimer = 500;
break;
case 5:
me->SetVisibility(VISIBILITY_OFF);
me->Kill(me);
break;
}
} else uiOutroTimer -= diff;
break;
}
}
void JustDied(Unit* /*killer*/)
{
if (pInstance)
{
pInstance->SetData(DATA_MAL_GANIS_EVENT, DONE);
// give achievement credit to players. criteria use spell 58630 which doesn't exist.
if (pInstance)
pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 58630);
}
}
void KilledUnit(Unit * victim)
{
if (victim == me)
return;
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3,SAY_SLAY_4), me);
}
};
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3,SAY_SLAY_4), me);
}
};
CreatureAI* GetAI_boss_mal_ganis(Creature* pCreature)
{
return new boss_mal_ganisAI (pCreature);
}
void AddSC_boss_mal_ganis()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_mal_ganis";
newscript->GetAI = &GetAI_boss_mal_ganis;
newscript->RegisterSelf();
new boss_mal_ganis();
}
@@ -44,96 +44,98 @@ enum Yells
SAY_SPAWN = -1595030,
SAY_DEATH = -1595031
};
struct boss_meathookAI : public ScriptedAI
class boss_meathook : public CreatureScript
{
boss_meathookAI(Creature *c) : ScriptedAI(c)
public:
boss_meathook() : CreatureScript("boss_meathook") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
if (pInstance)
DoScriptText(SAY_SPAWN,me);
return new boss_meathookAI (pCreature);
}
uint32 uiChainTimer;
uint32 uiDiseaseTimer;
uint32 uiFrenzyTimer;
ScriptedInstance* pInstance;
void Reset()
struct boss_meathookAI : public ScriptedAI
{
uiChainTimer = urand(12000,17000); //seen on video 13, 17, 15, 12, 16
uiDiseaseTimer = urand(2000,4000); //approx 3s
uiFrenzyTimer = urand(21000,26000); //made it up
if (pInstance)
pInstance->SetData(DATA_MEATHOOK_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_MEATHOOK_EVENT, IN_PROGRESS);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (uiDiseaseTimer <= diff)
boss_meathookAI(Creature *c) : ScriptedAI(c)
{
DoCastAOE(SPELL_DISEASE_EXPULSION);
uiDiseaseTimer = urand(1500,4000);
} else uiDiseaseTimer -= diff;
pInstance = c->GetInstanceScript();
if (pInstance)
DoScriptText(SAY_SPAWN,me);
}
if (uiFrenzyTimer <= diff)
uint32 uiChainTimer;
uint32 uiDiseaseTimer;
uint32 uiFrenzyTimer;
InstanceScript* pInstance;
void Reset()
{
DoCast(me, SPELL_FRENZY);
uiFrenzyTimer = urand(21000,26000);
} else uiFrenzyTimer -= diff;
uiChainTimer = urand(12000,17000); //seen on video 13, 17, 15, 12, 16
uiDiseaseTimer = urand(2000,4000); //approx 3s
uiFrenzyTimer = urand(21000,26000); //made it up
if (uiChainTimer <= diff)
if (pInstance)
pInstance->SetData(DATA_MEATHOOK_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_CONSTRICTING_CHAINS); //anyone but the tank
uiChainTimer = urand(2000,4000);
} else uiChainTimer -= diff;
DoScriptText(SAY_AGGRO, me);
DoMeleeAttackIfReady();
}
if (pInstance)
pInstance->SetData(DATA_MEATHOOK_EVENT, IN_PROGRESS);
}
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (pInstance)
pInstance->SetData(DATA_MEATHOOK_EVENT, DONE);
}
if (uiDiseaseTimer <= diff)
{
DoCastAOE(SPELL_DISEASE_EXPULSION);
uiDiseaseTimer = urand(1500,4000);
} else uiDiseaseTimer -= diff;
void KilledUnit(Unit * victim)
{
if (victim == me)
return;
if (uiFrenzyTimer <= diff)
{
DoCast(me, SPELL_FRENZY);
uiFrenzyTimer = urand(21000,26000);
} else uiFrenzyTimer -= diff;
if (uiChainTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_CONSTRICTING_CHAINS); //anyone but the tank
uiChainTimer = urand(2000,4000);
} else uiChainTimer -= diff;
DoMeleeAttackIfReady();
}
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_MEATHOOK_EVENT, DONE);
}
void KilledUnit(Unit * victim)
{
if (victim == me)
return;
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
};
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
};
CreatureAI* GetAI_boss_meathook(Creature* pCreature)
{
return new boss_meathookAI (pCreature);
}
void AddSC_boss_meathook()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_meathook";
newscript->GetAI = &GetAI_boss_meathook;
newscript->RegisterSelf();
new boss_meathook();
}
@@ -56,114 +56,116 @@ enum Yells
SAY_SUMMON_GHOULS_1 = -1595043,
SAY_SUMMON_GHOULS_2 = -1595044
};
struct boss_salrammAI : public ScriptedAI
class boss_salramm : public CreatureScript
{
boss_salrammAI(Creature *c) : ScriptedAI(c)
public:
boss_salramm() : CreatureScript("boss_salramm") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
if (pInstance)
DoScriptText(SAY_SPAWN,me);
return new boss_salrammAI (pCreature);
}
uint32 uiCurseFleshTimer;
uint32 uiExplodeGhoulTimer;
uint32 uiShadowBoltTimer;
uint32 uiStealFleshTimer;
uint32 uiSummonGhoulsTimer;
ScriptedInstance* pInstance;
void Reset()
struct boss_salrammAI : public ScriptedAI
{
uiCurseFleshTimer = 30000; //30s DBM
uiExplodeGhoulTimer = urand(25000,28000); //approx 6 sec after summon ghouls
uiShadowBoltTimer = urand(8000,12000); // approx 10s
uiStealFleshTimer = 12345;
uiSummonGhoulsTimer = urand(19000,24000); //on a video approx 24s after aggro
if (pInstance)
pInstance->SetData(DATA_SALRAMM_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_SALRAMM_EVENT, IN_PROGRESS);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Curse of twisted flesh timer
if (uiCurseFleshTimer <= diff)
boss_salrammAI(Creature *c) : ScriptedAI(c)
{
DoCast(me->getVictim(), SPELL_CURSE_OF_TWISTED_FLESH);
uiCurseFleshTimer = 37000;
} else uiCurseFleshTimer -= diff;
pInstance = c->GetInstanceScript();
if (pInstance)
DoScriptText(SAY_SPAWN,me);
}
//Shadow bolt timer
if (uiShadowBoltTimer <= diff)
uint32 uiCurseFleshTimer;
uint32 uiExplodeGhoulTimer;
uint32 uiShadowBoltTimer;
uint32 uiStealFleshTimer;
uint32 uiSummonGhoulsTimer;
InstanceScript* pInstance;
void Reset()
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_SHADOW_BOLT);
uiShadowBoltTimer = urand(8000,12000);
} else uiShadowBoltTimer -= diff;
uiCurseFleshTimer = 30000; //30s DBM
uiExplodeGhoulTimer = urand(25000,28000); //approx 6 sec after summon ghouls
uiShadowBoltTimer = urand(8000,12000); // approx 10s
uiStealFleshTimer = 12345;
uiSummonGhoulsTimer = urand(19000,24000); //on a video approx 24s after aggro
//Steal Flesh timer
if (uiStealFleshTimer <= diff)
if (pInstance)
pInstance->SetData(DATA_SALRAMM_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(RAND(SAY_STEAL_FLESH_1,SAY_STEAL_FLESH_2,SAY_STEAL_FLESH_3), me);
if (Unit* random_pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(random_pTarget, SPELL_STEAL_FLESH);
uiStealFleshTimer = 10000;
} else uiStealFleshTimer -= diff;
DoScriptText(SAY_AGGRO, me);
//Summon ghouls timer
if (uiSummonGhoulsTimer <= diff)
if (pInstance)
pInstance->SetData(DATA_SALRAMM_EVENT, IN_PROGRESS);
}
void UpdateAI(const uint32 diff)
{
DoScriptText(RAND(SAY_SUMMON_GHOULS_1,SAY_SUMMON_GHOULS_2), me);
if (Unit* random_pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(random_pTarget, SPELL_SUMMON_GHOULS);
uiSummonGhoulsTimer = 10000;
} else uiSummonGhoulsTimer -= diff;
//Return since we have no target
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
//Curse of twisted flesh timer
if (uiCurseFleshTimer <= diff)
{
DoCast(me->getVictim(), SPELL_CURSE_OF_TWISTED_FLESH);
uiCurseFleshTimer = 37000;
} else uiCurseFleshTimer -= diff;
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
//Shadow bolt timer
if (uiShadowBoltTimer <= diff)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_SHADOW_BOLT);
uiShadowBoltTimer = urand(8000,12000);
} else uiShadowBoltTimer -= diff;
if (pInstance)
pInstance->SetData(DATA_SALRAMM_EVENT, DONE);
}
//Steal Flesh timer
if (uiStealFleshTimer <= diff)
{
DoScriptText(RAND(SAY_STEAL_FLESH_1,SAY_STEAL_FLESH_2,SAY_STEAL_FLESH_3), me);
if (Unit* random_pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(random_pTarget, SPELL_STEAL_FLESH);
uiStealFleshTimer = 10000;
} else uiStealFleshTimer -= diff;
void KilledUnit(Unit * victim)
{
if (victim == me)
return;
//Summon ghouls timer
if (uiSummonGhoulsTimer <= diff)
{
DoScriptText(RAND(SAY_SUMMON_GHOULS_1,SAY_SUMMON_GHOULS_2), me);
if (Unit* random_pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(random_pTarget, SPELL_SUMMON_GHOULS);
uiSummonGhoulsTimer = 10000;
} else uiSummonGhoulsTimer -= diff;
DoMeleeAttackIfReady();
}
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_SALRAMM_EVENT, DONE);
}
void KilledUnit(Unit * victim)
{
if (victim == me)
return;
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
};
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
};
CreatureAI* GetAI_boss_salramm(Creature* pCreature)
{
return new boss_salrammAI (pCreature);
}
void AddSC_boss_salramm()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_salramm";
newscript->GetAI = &GetAI_boss_salramm;
newscript->RegisterSelf();
new boss_salramm();
}
@@ -27,217 +27,220 @@
3 - Mal'Ganis
4 - Infinite Corruptor (Heroic only)
*/
struct instance_culling_of_stratholme : public ScriptedInstance
class instance_culling_of_stratholme : public InstanceMapScript
{
instance_culling_of_stratholme(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
public:
instance_culling_of_stratholme() : InstanceMapScript("instance_culling_of_stratholme") { }
uint64 uiArthas;
uint64 uiMeathook;
uint64 uiSalramm;
uint64 uiEpoch;
uint64 uiMalGanis;
uint64 uiInfinite;
uint64 uiShkafGate;
uint64 uiMalGanisGate1;
uint64 uiMalGanisGate2;
uint64 uiExitGate;
uint64 uiMalGanisChest;
uint32 m_auiEncounter[MAX_ENCOUNTER];
std::string str_data;
bool IsEncounterInProgress() const
InstanceScript* GetInstanceData_InstanceMapScript(Map* pMap)
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
return false;
return new instance_culling_of_stratholme_InstanceMapScript(pMap);
}
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
struct instance_culling_of_stratholme_InstanceMapScript : public InstanceScript
{
switch(pCreature->GetEntry())
instance_culling_of_stratholme_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();};
uint64 uiArthas;
uint64 uiMeathook;
uint64 uiSalramm;
uint64 uiEpoch;
uint64 uiMalGanis;
uint64 uiInfinite;
uint64 uiShkafGate;
uint64 uiMalGanisGate1;
uint64 uiMalGanisGate2;
uint64 uiExitGate;
uint64 uiMalGanisChest;
uint32 m_auiEncounter[MAX_ENCOUNTER];
std::string str_data;
bool IsEncounterInProgress() const
{
case NPC_ARTHAS:
uiArthas = pCreature->GetGUID();
break;
case NPC_MEATHOOK:
uiMeathook = pCreature->GetGUID();
break;
case NPC_SALRAMM:
uiSalramm = pCreature->GetGUID();
break;
case NPC_EPOCH:
uiEpoch = pCreature->GetGUID();
break;
case NPC_MAL_GANIS:
uiMalGanis = pCreature->GetGUID();
break;
case NPC_INFINITE:
uiInfinite = pCreature->GetGUID();
break;
}
}
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
{
switch(pGo->GetEntry())
{
case GO_SHKAF_GATE:
uiShkafGate = pGo->GetGUID();
break;
case GO_MALGANIS_GATE_1:
uiMalGanisGate1 = pGo->GetGUID();
break;
case GO_MALGANIS_GATE_2:
uiMalGanisGate2 = pGo->GetGUID();
break;
case GO_EXIT_GATE:
uiExitGate = pGo->GetGUID();
if (m_auiEncounter[3] == DONE)
HandleGameObject(uiExitGate,true);
break;
case GO_MALGANIS_CHEST_N:
case GO_MALGANIS_CHEST_H:
uiMalGanisChest = pGo->GetGUID();
if (m_auiEncounter[3] == DONE)
pGo->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_INTERACT_COND);
break;
}
}
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_MEATHOOK_EVENT:
m_auiEncounter[0] = data;
break;
case DATA_SALRAMM_EVENT:
m_auiEncounter[1] = data;
break;
case DATA_EPOCH_EVENT:
m_auiEncounter[2] = data;
break;
case DATA_MAL_GANIS_EVENT:
m_auiEncounter[3] = data;
switch(m_auiEncounter[3])
{
case NOT_STARTED:
HandleGameObject(uiMalGanisGate2,true);
break;
case IN_PROGRESS:
HandleGameObject(uiMalGanisGate2,false);
break;
case DONE:
HandleGameObject(uiExitGate, true);
if (GameObject *pGo = instance->GetGameObject(uiMalGanisChest))
pGo->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_INTERACT_COND);
break;
}
break;
case DATA_INFINITE_EVENT:
m_auiEncounter[4] = data;
break;
}
if (data == DONE)
SaveToDB();
}
uint32 GetData(uint32 type)
{
switch(type)
{
case DATA_MEATHOOK_EVENT: return m_auiEncounter[0];
case DATA_SALRAMM_EVENT: return m_auiEncounter[1];
case DATA_EPOCH_EVENT: return m_auiEncounter[2];
case DATA_MAL_GANIS_EVENT: return m_auiEncounter[3];
case DATA_INFINITE_EVENT: return m_auiEncounter[4];
}
return 0;
}
uint64 GetData64(uint32 identifier)
{
switch(identifier)
{
case DATA_ARTHAS: return uiArthas;
case DATA_MEATHOOK: return uiMeathook;
case DATA_SALRAMM: return uiSalramm;
case DATA_EPOCH: return uiEpoch;
case DATA_MAL_GANIS: return uiMalGanis;
case DATA_INFINITE: return uiInfinite;
case DATA_SHKAF_GATE: return uiShkafGate;
case DATA_MAL_GANIS_GATE_1: return uiMalGanisGate1;
case DATA_MAL_GANIS_GATE_2: return uiMalGanisGate2;
case DATA_EXIT_GATE: return uiExitGate;
case DATA_MAL_GANIS_CHEST: return uiMalGanisChest;
}
return 0;
}
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << "C S " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
<< m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4];
str_data = saveStream.str();
OUT_SAVE_INST_DATA_COMPLETE;
return str_data;
}
void Load(const char* in)
{
if (!in)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(in);
char dataHead1, dataHead2;
uint16 data0, data1, data2, data3, data4;
std::istringstream loadStream(in);
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3 >> data4;
if (dataHead1 == 'C' && dataHead2 == 'S')
{
m_auiEncounter[0] = data0;
m_auiEncounter[1] = data1;
m_auiEncounter[2] = data2;
m_auiEncounter[3] = data3;
m_auiEncounter[4] = data4;
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS)
m_auiEncounter[i] = NOT_STARTED;
if (m_auiEncounter[i] == IN_PROGRESS) return true;
} else OUT_LOAD_INST_DATA_FAIL;
return false;
}
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
switch(pCreature->GetEntry())
{
case NPC_ARTHAS:
uiArthas = pCreature->GetGUID();
break;
case NPC_MEATHOOK:
uiMeathook = pCreature->GetGUID();
break;
case NPC_SALRAMM:
uiSalramm = pCreature->GetGUID();
break;
case NPC_EPOCH:
uiEpoch = pCreature->GetGUID();
break;
case NPC_MAL_GANIS:
uiMalGanis = pCreature->GetGUID();
break;
case NPC_INFINITE:
uiInfinite = pCreature->GetGUID();
break;
}
}
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
{
switch(pGo->GetEntry())
{
case GO_SHKAF_GATE:
uiShkafGate = pGo->GetGUID();
break;
case GO_MALGANIS_GATE_1:
uiMalGanisGate1 = pGo->GetGUID();
break;
case GO_MALGANIS_GATE_2:
uiMalGanisGate2 = pGo->GetGUID();
break;
case GO_EXIT_GATE:
uiExitGate = pGo->GetGUID();
if (m_auiEncounter[3] == DONE)
HandleGameObject(uiExitGate,true);
break;
case GO_MALGANIS_CHEST_N:
case GO_MALGANIS_CHEST_H:
uiMalGanisChest = pGo->GetGUID();
if (m_auiEncounter[3] == DONE)
pGo->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_INTERACT_COND);
break;
}
}
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_MEATHOOK_EVENT:
m_auiEncounter[0] = data;
break;
case DATA_SALRAMM_EVENT:
m_auiEncounter[1] = data;
break;
case DATA_EPOCH_EVENT:
m_auiEncounter[2] = data;
break;
case DATA_MAL_GANIS_EVENT:
m_auiEncounter[3] = data;
switch(m_auiEncounter[3])
{
case NOT_STARTED:
HandleGameObject(uiMalGanisGate2,true);
break;
case IN_PROGRESS:
HandleGameObject(uiMalGanisGate2,false);
break;
case DONE:
HandleGameObject(uiExitGate, true);
if (GameObject *pGo = instance->GetGameObject(uiMalGanisChest))
pGo->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_INTERACT_COND);
break;
}
break;
case DATA_INFINITE_EVENT:
m_auiEncounter[4] = data;
break;
}
if (data == DONE)
SaveToDB();
}
uint32 GetData(uint32 type)
{
switch(type)
{
case DATA_MEATHOOK_EVENT: return m_auiEncounter[0];
case DATA_SALRAMM_EVENT: return m_auiEncounter[1];
case DATA_EPOCH_EVENT: return m_auiEncounter[2];
case DATA_MAL_GANIS_EVENT: return m_auiEncounter[3];
case DATA_INFINITE_EVENT: return m_auiEncounter[4];
}
return 0;
}
uint64 GetData64(uint32 identifier)
{
switch(identifier)
{
case DATA_ARTHAS: return uiArthas;
case DATA_MEATHOOK: return uiMeathook;
case DATA_SALRAMM: return uiSalramm;
case DATA_EPOCH: return uiEpoch;
case DATA_MAL_GANIS: return uiMalGanis;
case DATA_INFINITE: return uiInfinite;
case DATA_SHKAF_GATE: return uiShkafGate;
case DATA_MAL_GANIS_GATE_1: return uiMalGanisGate1;
case DATA_MAL_GANIS_GATE_2: return uiMalGanisGate2;
case DATA_EXIT_GATE: return uiExitGate;
case DATA_MAL_GANIS_CHEST: return uiMalGanisChest;
}
return 0;
}
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << "C S " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
<< m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4];
str_data = saveStream.str();
OUT_SAVE_INST_DATA_COMPLETE;
return str_data;
}
void Load(const char* in)
{
if (!in)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(in);
char dataHead1, dataHead2;
uint16 data0, data1, data2, data3, data4;
std::istringstream loadStream(in);
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3 >> data4;
if (dataHead1 == 'C' && dataHead2 == 'S')
{
m_auiEncounter[0] = data0;
m_auiEncounter[1] = data1;
m_auiEncounter[2] = data2;
m_auiEncounter[3] = data3;
m_auiEncounter[4] = data4;
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS)
m_auiEncounter[i] = NOT_STARTED;
} else OUT_LOAD_INST_DATA_FAIL;
OUT_LOAD_INST_DATA_COMPLETE;
}
};
OUT_LOAD_INST_DATA_COMPLETE;
}
};
InstanceData* GetInstanceData_instance_culling_of_stratholme(Map* pMap)
{
return new instance_culling_of_stratholme(pMap);
}
void AddSC_instance_culling_of_stratholme()
{
Script *newscript;
newscript = new Script;
newscript->Name = "instance_culling_of_stratholme";
newscript->GetInstanceData = &GetInstanceData_instance_culling_of_stratholme;
newscript->RegisterSelf();
new instance_culling_of_stratholme();
}
@@ -42,106 +42,108 @@ enum eEnums
SPELL_SAND_BREATH = 31473,
H_SPELL_SAND_BREATH = 39049
};
struct boss_aeonusAI : public ScriptedAI
class boss_aeonus : public CreatureScript
{
boss_aeonusAI(Creature *c) : ScriptedAI(c)
public:
boss_aeonus() : CreatureScript("boss_aeonus") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
return new boss_aeonusAI (pCreature);
}
ScriptedInstance *pInstance;
uint32 SandBreath_Timer;
uint32 TimeStop_Timer;
uint32 Frenzy_Timer;
void Reset()
struct boss_aeonusAI : public ScriptedAI
{
SandBreath_Timer = 15000+rand()%15000;
TimeStop_Timer = 10000+rand()%5000;
Frenzy_Timer = 30000+rand()%15000;
}
void EnterCombat(Unit * /*who*/)
{
DoScriptText(SAY_AGGRO, me);
}
void MoveInLineOfSight(Unit *who)
{
//Despawn Time Keeper
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER)
boss_aeonusAI(Creature *c) : ScriptedAI(c)
{
if (me->IsWithinDistInMap(who,20.0f))
{
DoScriptText(SAY_BANISH, me);
me->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
pInstance = c->GetInstanceScript();
}
ScriptedAI::MoveInLineOfSight(who);
}
InstanceScript *pInstance;
void JustDied(Unit * /*victim*/)
{
DoScriptText(SAY_DEATH, me);
uint32 SandBreath_Timer;
uint32 TimeStop_Timer;
uint32 Frenzy_Timer;
if (pInstance)
{
pInstance->SetData(TYPE_RIFT,DONE);
pInstance->SetData(TYPE_MEDIVH,DONE);//FIXME: later should be removed
}
}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Sand Breath
if (SandBreath_Timer <= diff)
void Reset()
{
DoCast(me->getVictim(), SPELL_SAND_BREATH);
SandBreath_Timer = 15000+rand()%10000;
} else SandBreath_Timer -= diff;
SandBreath_Timer = 15000+rand()%15000;
TimeStop_Timer = 10000+rand()%5000;
Frenzy_Timer = 30000+rand()%15000;
}
//Time Stop
if (TimeStop_Timer <= diff)
void EnterCombat(Unit * /*who*/)
{
DoCast(me->getVictim(), SPELL_TIME_STOP);
TimeStop_Timer = 20000+rand()%15000;
} else TimeStop_Timer -= diff;
DoScriptText(SAY_AGGRO, me);
}
//Frenzy
if (Frenzy_Timer <= diff)
void MoveInLineOfSight(Unit *who)
{
DoScriptText(EMOTE_FRENZY, me);
DoCast(me, SPELL_ENRAGE);
Frenzy_Timer = 20000+rand()%15000;
} else Frenzy_Timer -= diff;
//Despawn Time Keeper
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER)
{
if (me->IsWithinDistInMap(who,20.0f))
{
DoScriptText(SAY_BANISH, me);
me->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
}
ScriptedAI::MoveInLineOfSight(who);
}
void JustDied(Unit * /*victim*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance)
{
pInstance->SetData(TYPE_RIFT,DONE);
pInstance->SetData(TYPE_MEDIVH,DONE);//FIXME: later should be removed
}
}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Sand Breath
if (SandBreath_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_SAND_BREATH);
SandBreath_Timer = 15000+rand()%10000;
} else SandBreath_Timer -= diff;
//Time Stop
if (TimeStop_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_TIME_STOP);
TimeStop_Timer = 20000+rand()%15000;
} else TimeStop_Timer -= diff;
//Frenzy
if (Frenzy_Timer <= diff)
{
DoScriptText(EMOTE_FRENZY, me);
DoCast(me, SPELL_ENRAGE);
Frenzy_Timer = 20000+rand()%15000;
} else Frenzy_Timer -= diff;
DoMeleeAttackIfReady();
}
};
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_aeonus(Creature* pCreature)
{
return new boss_aeonusAI (pCreature);
}
void AddSC_boss_aeonus()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_aeonus";
newscript->GetAI = &GetAI_boss_aeonus;
newscript->RegisterSelf();
new boss_aeonus();
}
@@ -42,115 +42,117 @@ enum eEnums
SPELL_TIME_LAPSE = 31467,
SPELL_ATTRACTION = 38540 //Not Implemented (Heroic mode)
};
struct boss_chrono_lord_dejaAI : public ScriptedAI
class boss_chrono_lord_deja : public CreatureScript
{
boss_chrono_lord_dejaAI(Creature *c) : ScriptedAI(c)
public:
boss_chrono_lord_deja() : CreatureScript("boss_chrono_lord_deja") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
return new boss_chrono_lord_dejaAI (pCreature);
}
ScriptedInstance *pInstance;
uint32 ArcaneBlast_Timer;
uint32 TimeLapse_Timer;
uint32 Attraction_Timer;
uint32 ArcaneDischarge_Timer;
void Reset()
struct boss_chrono_lord_dejaAI : public ScriptedAI
{
ArcaneBlast_Timer = 18000+rand()%5000;
TimeLapse_Timer = 10000+rand()%5000;
ArcaneDischarge_Timer = 20000+rand()%10000;
Attraction_Timer = 25000+rand()%10000;
}
void EnterCombat(Unit * /*who*/)
{
DoScriptText(SAY_AGGRO, me);
}
void MoveInLineOfSight(Unit *who)
{
//Despawn Time Keeper
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER)
boss_chrono_lord_dejaAI(Creature *c) : ScriptedAI(c)
{
if (me->IsWithinDistInMap(who,20.0f))
pInstance = c->GetInstanceScript();
}
InstanceScript *pInstance;
uint32 ArcaneBlast_Timer;
uint32 TimeLapse_Timer;
uint32 Attraction_Timer;
uint32 ArcaneDischarge_Timer;
void Reset()
{
ArcaneBlast_Timer = 18000+rand()%5000;
TimeLapse_Timer = 10000+rand()%5000;
ArcaneDischarge_Timer = 20000+rand()%10000;
Attraction_Timer = 25000+rand()%10000;
}
void EnterCombat(Unit * /*who*/)
{
DoScriptText(SAY_AGGRO, me);
}
void MoveInLineOfSight(Unit *who)
{
//Despawn Time Keeper
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER)
{
if (me->IsWithinDistInMap(who,20.0f))
{
DoScriptText(SAY_BANISH, me);
me->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
}
ScriptedAI::MoveInLineOfSight(who);
}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit * /*victim*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(TYPE_RIFT,SPECIAL);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Arcane Blast
if (ArcaneBlast_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_ARCANE_BLAST);
ArcaneBlast_Timer = 15000+rand()%10000;
} else ArcaneBlast_Timer -= diff;
//Arcane Discharge
if (ArcaneDischarge_Timer <= diff)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
DoCast(pTarget, SPELL_ARCANE_DISCHARGE);
ArcaneDischarge_Timer = 20000+rand()%10000;
} else ArcaneDischarge_Timer -= diff;
//Time Lapse
if (TimeLapse_Timer <= diff)
{
DoScriptText(SAY_BANISH, me);
me->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
}
DoCast(me, SPELL_TIME_LAPSE);
TimeLapse_Timer = 15000+rand()%10000;
} else TimeLapse_Timer -= diff;
ScriptedAI::MoveInLineOfSight(who);
}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit * /*victim*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(TYPE_RIFT,SPECIAL);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Arcane Blast
if (ArcaneBlast_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_ARCANE_BLAST);
ArcaneBlast_Timer = 15000+rand()%10000;
} else ArcaneBlast_Timer -= diff;
//Arcane Discharge
if (ArcaneDischarge_Timer <= diff)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
DoCast(pTarget, SPELL_ARCANE_DISCHARGE);
ArcaneDischarge_Timer = 20000+rand()%10000;
} else ArcaneDischarge_Timer -= diff;
//Time Lapse
if (TimeLapse_Timer <= diff)
{
DoScriptText(SAY_BANISH, me);
DoCast(me, SPELL_TIME_LAPSE);
TimeLapse_Timer = 15000+rand()%10000;
} else TimeLapse_Timer -= diff;
if (IsHeroic())
{
if (Attraction_Timer <= diff)
if (IsHeroic())
{
DoCast(me, SPELL_ATTRACTION);
Attraction_Timer = 25000+rand()%10000;
} else Attraction_Timer -= diff;
}
if (Attraction_Timer <= diff)
{
DoCast(me, SPELL_ATTRACTION);
Attraction_Timer = 25000+rand()%10000;
} else Attraction_Timer -= diff;
}
DoMeleeAttackIfReady();
}
};
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_chrono_lord_deja(Creature* pCreature)
{
return new boss_chrono_lord_dejaAI (pCreature);
}
void AddSC_boss_chrono_lord_deja()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_chrono_lord_deja";
newscript->GetAI = &GetAI_boss_chrono_lord_deja;
newscript->RegisterSelf();
new boss_chrono_lord_deja();
}
@@ -41,114 +41,116 @@ enum eEnums
H_SPELL_WING_BUFFET = 38593,
SPELL_REFLECT = 38592 //Not Implemented (Heroic mod)
};
struct boss_temporusAI : public ScriptedAI
class boss_temporus : public CreatureScript
{
boss_temporusAI(Creature *c) : ScriptedAI(c)
public:
boss_temporus() : CreatureScript("boss_temporus") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
return new boss_temporusAI (pCreature);
}
ScriptedInstance *pInstance;
uint32 Haste_Timer;
uint32 SpellReflection_Timer;
uint32 MortalWound_Timer;
uint32 WingBuffet_Timer;
void Reset()
struct boss_temporusAI : public ScriptedAI
{
Haste_Timer = 15000+rand()%8000;
SpellReflection_Timer = 30000;
MortalWound_Timer = 8000;
WingBuffet_Timer = 25000+rand()%10000;
}
void EnterCombat(Unit * /*who*/)
{
DoScriptText(SAY_AGGRO, me);
}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit * /*victim*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(TYPE_RIFT,SPECIAL);
}
void MoveInLineOfSight(Unit *who)
{
//Despawn Time Keeper
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER)
boss_temporusAI(Creature *c) : ScriptedAI(c)
{
if (me->IsWithinDistInMap(who,20.0f))
{
DoScriptText(SAY_BANISH, me);
pInstance = c->GetInstanceScript();
}
me->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
InstanceScript *pInstance;
uint32 Haste_Timer;
uint32 SpellReflection_Timer;
uint32 MortalWound_Timer;
uint32 WingBuffet_Timer;
void Reset()
{
Haste_Timer = 15000+rand()%8000;
SpellReflection_Timer = 30000;
MortalWound_Timer = 8000;
WingBuffet_Timer = 25000+rand()%10000;
}
void EnterCombat(Unit * /*who*/)
{
DoScriptText(SAY_AGGRO, me);
}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit * /*victim*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(TYPE_RIFT,SPECIAL);
}
void MoveInLineOfSight(Unit *who)
{
//Despawn Time Keeper
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER)
{
if (me->IsWithinDistInMap(who,20.0f))
{
DoScriptText(SAY_BANISH, me);
me->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
}
ScriptedAI::MoveInLineOfSight(who);
}
ScriptedAI::MoveInLineOfSight(who);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Attack Haste
if (Haste_Timer <= diff)
void UpdateAI(const uint32 diff)
{
DoCast(me, SPELL_HASTE);
Haste_Timer = 20000+rand()%5000;
} else Haste_Timer -= diff;
//Return since we have no target
if (!UpdateVictim())
return;
//MortalWound_Timer
if (MortalWound_Timer <= diff)
{
DoCast(me, SPELL_MORTAL_WOUND);
MortalWound_Timer = 10000+rand()%10000;
} else MortalWound_Timer -= diff;
//Wing ruffet
if (WingBuffet_Timer <= diff)
{
DoCast(me, SPELL_WING_BUFFET);
WingBuffet_Timer = 20000+rand()%10000;
} else WingBuffet_Timer -= diff;
if (IsHeroic())
{
if (SpellReflection_Timer <= diff)
//Attack Haste
if (Haste_Timer <= diff)
{
DoCast(me, SPELL_REFLECT);
SpellReflection_Timer = 25000+rand()%10000;
} else SpellReflection_Timer -= diff;
}
DoCast(me, SPELL_HASTE);
Haste_Timer = 20000+rand()%5000;
} else Haste_Timer -= diff;
//MortalWound_Timer
if (MortalWound_Timer <= diff)
{
DoCast(me, SPELL_MORTAL_WOUND);
MortalWound_Timer = 10000+rand()%10000;
} else MortalWound_Timer -= diff;
//Wing ruffet
if (WingBuffet_Timer <= diff)
{
DoCast(me, SPELL_WING_BUFFET);
WingBuffet_Timer = 20000+rand()%10000;
} else WingBuffet_Timer -= diff;
if (IsHeroic())
{
if (SpellReflection_Timer <= diff)
{
DoCast(me, SPELL_REFLECT);
SpellReflection_Timer = 25000+rand()%10000;
} else SpellReflection_Timer -= diff;
}
DoMeleeAttackIfReady();
}
};
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_temporus(Creature* pCreature)
{
return new boss_temporusAI (pCreature);
}
void AddSC_boss_temporus()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_temporus";
newscript->GetAI = &GetAI_boss_temporus;
newscript->RegisterSelf();
new boss_temporus();
}
@@ -55,180 +55,187 @@ EndContentData */
#define SPELL_CORRUPT_AEONUS 37853
#define C_COUNCIL_ENFORCER 17023
struct npc_medivh_bmAI : public ScriptedAI
class npc_medivh_bm : public CreatureScript
{
npc_medivh_bmAI(Creature *c) : ScriptedAI(c)
public:
npc_medivh_bm() : CreatureScript("npc_medivh_bm") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
return new npc_medivh_bmAI (pCreature);
}
ScriptedInstance *pInstance;
uint32 SpellCorrupt_Timer;
uint32 Check_Timer;
bool Life75;
bool Life50;
bool Life25;
void Reset()
struct npc_medivh_bmAI : public ScriptedAI
{
SpellCorrupt_Timer = 0;
if (!pInstance)
return;
if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
DoCast(me, SPELL_CHANNEL, true);
else if (me->HasAura(SPELL_CHANNEL))
me->RemoveAura(SPELL_CHANNEL);
DoCast(me, SPELL_PORTAL_RUNE, true);
}
void MoveInLineOfSight(Unit *who)
{
if (!pInstance)
return;
if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 10.0f))
npc_medivh_bmAI(Creature *c) : ScriptedAI(c)
{
if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS || pInstance->GetData(TYPE_MEDIVH) == DONE)
return;
DoScriptText(SAY_INTRO, me);
pInstance->SetData(TYPE_MEDIVH,IN_PROGRESS);
DoCast(me, SPELL_CHANNEL, false);
Check_Timer = 5000;
}
else if (who->GetTypeId() == TYPEID_UNIT && me->IsWithinDistInMap(who, 15.0f))
{
if (pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS)
return;
uint32 entry = who->GetEntry();
if (entry == C_ASSAS || entry == C_WHELP || entry == C_CHRON || entry == C_EXECU || entry == C_VANQU)
{
who->StopMoving();
who->CastSpell(me,SPELL_CORRUPT,false);
}
else if (entry == C_AEONUS)
{
who->StopMoving();
who->CastSpell(me,SPELL_CORRUPT_AEONUS,false);
}
}
}
void AttackStart(Unit * /*who*/)
{
//if (pInstance && pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
//return;
//ScriptedAI::AttackStart(who);
}
void EnterCombat(Unit * /*who*/) {}
void SpellHit(Unit* /*caster*/, const SpellEntry* spell)
{
if (SpellCorrupt_Timer)
return;
if (spell->Id == SPELL_CORRUPT_AEONUS)
SpellCorrupt_Timer = 1000;
if (spell->Id == SPELL_CORRUPT)
SpellCorrupt_Timer = 3000;
}
void JustDied(Unit* Killer)
{
if (Killer->GetEntry() == me->GetEntry())
return;
DoScriptText(SAY_DEATH, me);
}
void UpdateAI(const uint32 diff)
{
if (!pInstance)
return;
if (SpellCorrupt_Timer)
{
if (SpellCorrupt_Timer <= diff)
{
pInstance->SetData(TYPE_MEDIVH,SPECIAL);
if (me->HasAura(SPELL_CORRUPT_AEONUS))
SpellCorrupt_Timer = 1000;
else if (me->HasAura(SPELL_CORRUPT))
SpellCorrupt_Timer = 3000;
else
SpellCorrupt_Timer = 0;
} else SpellCorrupt_Timer -= diff;
pInstance = c->GetInstanceScript();
}
if (Check_Timer)
InstanceScript *pInstance;
uint32 SpellCorrupt_Timer;
uint32 Check_Timer;
bool Life75;
bool Life50;
bool Life25;
void Reset()
{
if (Check_Timer <= diff)
SpellCorrupt_Timer = 0;
if (!pInstance)
return;
if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
DoCast(me, SPELL_CHANNEL, true);
else if (me->HasAura(SPELL_CHANNEL))
me->RemoveAura(SPELL_CHANNEL);
DoCast(me, SPELL_PORTAL_RUNE, true);
}
void MoveInLineOfSight(Unit *who)
{
if (!pInstance)
return;
if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 10.0f))
{
uint32 pct = pInstance->GetData(DATA_SHIELD);
Check_Timer = 5000;
if (Life25 && pct <= 25)
{
DoScriptText(SAY_WEAK25, me);
Life25 = false;
}
else if (Life50 && pct <= 50)
{
DoScriptText(SAY_WEAK50, me);
Life50 = false;
}
else if (Life75 && pct <= 75)
{
DoScriptText(SAY_WEAK75, me);
Life75 = false;
}
//if we reach this it means event was running but at some point reset.
if (pInstance->GetData(TYPE_MEDIVH) == NOT_STARTED)
{
me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
me->RemoveCorpse();
me->Respawn();
if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS || pInstance->GetData(TYPE_MEDIVH) == DONE)
return;
}
if (pInstance->GetData(TYPE_RIFT) == DONE)
DoScriptText(SAY_INTRO, me);
pInstance->SetData(TYPE_MEDIVH,IN_PROGRESS);
DoCast(me, SPELL_CHANNEL, false);
Check_Timer = 5000;
}
else if (who->GetTypeId() == TYPEID_UNIT && me->IsWithinDistInMap(who, 15.0f))
{
if (pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS)
return;
uint32 entry = who->GetEntry();
if (entry == C_ASSAS || entry == C_WHELP || entry == C_CHRON || entry == C_EXECU || entry == C_VANQU)
{
DoScriptText(SAY_WIN, me);
Check_Timer = 0;
if (me->HasAura(SPELL_CHANNEL))
me->RemoveAura(SPELL_CHANNEL);
//TODO: start the post-event here
pInstance->SetData(TYPE_MEDIVH,DONE);
who->StopMoving();
who->CastSpell(me,SPELL_CORRUPT,false);
}
} else Check_Timer -= diff;
else if (entry == C_AEONUS)
{
who->StopMoving();
who->CastSpell(me,SPELL_CORRUPT_AEONUS,false);
}
}
}
//if (!UpdateVictim())
//return;
void AttackStart(Unit * /*who*/)
{
//if (pInstance && pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
//return;
//ScriptedAI::AttackStart(who);
}
void EnterCombat(Unit * /*who*/) {}
void SpellHit(Unit* /*caster*/, const SpellEntry* spell)
{
if (SpellCorrupt_Timer)
return;
if (spell->Id == SPELL_CORRUPT_AEONUS)
SpellCorrupt_Timer = 1000;
if (spell->Id == SPELL_CORRUPT)
SpellCorrupt_Timer = 3000;
}
void JustDied(Unit* Killer)
{
if (Killer->GetEntry() == me->GetEntry())
return;
DoScriptText(SAY_DEATH, me);
}
void UpdateAI(const uint32 diff)
{
if (!pInstance)
return;
if (SpellCorrupt_Timer)
{
if (SpellCorrupt_Timer <= diff)
{
pInstance->SetData(TYPE_MEDIVH,SPECIAL);
if (me->HasAura(SPELL_CORRUPT_AEONUS))
SpellCorrupt_Timer = 1000;
else if (me->HasAura(SPELL_CORRUPT))
SpellCorrupt_Timer = 3000;
else
SpellCorrupt_Timer = 0;
} else SpellCorrupt_Timer -= diff;
}
if (Check_Timer)
{
if (Check_Timer <= diff)
{
uint32 pct = pInstance->GetData(DATA_SHIELD);
Check_Timer = 5000;
if (Life25 && pct <= 25)
{
DoScriptText(SAY_WEAK25, me);
Life25 = false;
}
else if (Life50 && pct <= 50)
{
DoScriptText(SAY_WEAK50, me);
Life50 = false;
}
else if (Life75 && pct <= 75)
{
DoScriptText(SAY_WEAK75, me);
Life75 = false;
}
//if we reach this it means event was running but at some point reset.
if (pInstance->GetData(TYPE_MEDIVH) == NOT_STARTED)
{
me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
me->RemoveCorpse();
me->Respawn();
return;
}
if (pInstance->GetData(TYPE_RIFT) == DONE)
{
DoScriptText(SAY_WIN, me);
Check_Timer = 0;
if (me->HasAura(SPELL_CHANNEL))
me->RemoveAura(SPELL_CHANNEL);
//TODO: start the post-event here
pInstance->SetData(TYPE_MEDIVH,DONE);
}
} else Check_Timer -= diff;
}
//if (!UpdateVictim())
//return;
//DoMeleeAttackIfReady();
}
};
//DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_npc_medivh_bm(Creature* pCreature)
{
return new npc_medivh_bmAI (pCreature);
}
struct Wave
{
@@ -241,166 +248,165 @@ static Wave PortalWaves[]=
{C_EXECU, C_CHRON, C_WHELP, C_ASSAS},
{C_EXECU, C_VANQU, C_CHRON, C_ASSAS}
};
struct npc_time_riftAI : public ScriptedAI
class npc_time_rift : public CreatureScript
{
npc_time_riftAI(Creature *c) : ScriptedAI(c)
public:
npc_time_rift() : CreatureScript("npc_time_rift") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
return new npc_time_riftAI (pCreature);
}
ScriptedInstance *pInstance;
uint32 TimeRiftWave_Timer;
uint8 mRiftWaveCount;
uint8 mPortalCount;
uint8 mWaveId;
void Reset()
struct npc_time_riftAI : public ScriptedAI
{
TimeRiftWave_Timer = 15000;
mRiftWaveCount = 0;
if (!pInstance)
return;
mPortalCount = pInstance->GetData(DATA_PORTAL_COUNT);
if (mPortalCount < 6)
mWaveId = 0;
else if (mPortalCount > 12)
mWaveId = 2;
else mWaveId = 1;
}
void EnterCombat(Unit * /*who*/) {}
void DoSummonAtRift(uint32 creature_entry)
{
if (!creature_entry)
return;
if (pInstance && pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS)
npc_time_riftAI(Creature *c) : ScriptedAI(c)
{
me->InterruptNonMeleeSpells(true);
me->RemoveAllAuras();
return;
pInstance = c->GetInstanceScript();
}
Position pos;
me->GetRandomNearPosition(pos, 10.0f);
InstanceScript *pInstance;
//normalize Z-level if we can, if rift is not at ground level.
pos.m_positionZ = std::max(me->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), me->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY));
uint32 TimeRiftWave_Timer;
uint8 mRiftWaveCount;
uint8 mPortalCount;
uint8 mWaveId;
if (Unit *Summon = DoSummon(creature_entry, pos, 30000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT))
if (Unit *temp = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_MEDIVH) : 0))
Summon->AddThreat(temp,0.0f);
}
void Reset()
{
void DoSelectSummon()
{
uint32 entry = 0;
if ((mRiftWaveCount > 2 && mWaveId < 1) || mRiftWaveCount > 3)
TimeRiftWave_Timer = 15000;
mRiftWaveCount = 0;
entry = PortalWaves[mWaveId].PortalMob[mRiftWaveCount];
sLog.outDebug("TSCR: npc_time_rift: summoning wave Creature (Wave %u, Entry %u).",mRiftWaveCount,entry);
if (!pInstance)
return;
++mRiftWaveCount;
mPortalCount = pInstance->GetData(DATA_PORTAL_COUNT);
if (entry == C_WHELP)
if (mPortalCount < 6)
mWaveId = 0;
else if (mPortalCount > 12)
mWaveId = 2;
else mWaveId = 1;
}
void EnterCombat(Unit * /*who*/) {}
void DoSummonAtRift(uint32 creature_entry)
{
for (uint8 i = 0; i < 3; ++i)
DoSummonAtRift(entry);
} else DoSummonAtRift(entry);
}
if (!creature_entry)
return;
void UpdateAI(const uint32 diff)
{
if (!pInstance)
return;
if (pInstance && pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS)
{
me->InterruptNonMeleeSpells(true);
me->RemoveAllAuras();
return;
}
if (TimeRiftWave_Timer <= diff)
Position pos;
me->GetRandomNearPosition(pos, 10.0f);
//normalize Z-level if we can, if rift is not at ground level.
pos.m_positionZ = std::max(me->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), me->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY));
if (Unit *Summon = DoSummon(creature_entry, pos, 30000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT))
if (Unit *temp = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_MEDIVH) : 0))
Summon->AddThreat(temp,0.0f);
}
void DoSelectSummon()
{
DoSelectSummon();
TimeRiftWave_Timer = 15000;
} else TimeRiftWave_Timer -= diff;
uint32 entry = 0;
if (me->IsNonMeleeSpellCasted(false))
return;
if ((mRiftWaveCount > 2 && mWaveId < 1) || mRiftWaveCount > 3)
mRiftWaveCount = 0;
sLog.outDebug("TSCR: npc_time_rift: not casting anylonger, i need to die.");
me->setDeathState(JUST_DIED);
entry = PortalWaves[mWaveId].PortalMob[mRiftWaveCount];
sLog.outDebug("TSCR: npc_time_rift: summoning wave Creature (Wave %u, Entry %u).",mRiftWaveCount,entry);
++mRiftWaveCount;
if (entry == C_WHELP)
{
for (uint8 i = 0; i < 3; ++i)
DoSummonAtRift(entry);
} else DoSummonAtRift(entry);
}
void UpdateAI(const uint32 diff)
{
if (!pInstance)
return;
if (TimeRiftWave_Timer <= diff)
{
DoSelectSummon();
TimeRiftWave_Timer = 15000;
} else TimeRiftWave_Timer -= diff;
if (me->IsNonMeleeSpellCasted(false))
return;
sLog.outDebug("TSCR: npc_time_rift: not casting anylonger, i need to die.");
me->setDeathState(JUST_DIED);
if (pInstance->GetData(TYPE_RIFT) == IN_PROGRESS)
pInstance->SetData(TYPE_RIFT,SPECIAL);
}
};
if (pInstance->GetData(TYPE_RIFT) == IN_PROGRESS)
pInstance->SetData(TYPE_RIFT,SPECIAL);
}
};
CreatureAI* GetAI_npc_time_rift(Creature* pCreature)
{
return new npc_time_riftAI (pCreature);
}
#define SAY_SAAT_WELCOME -1269019
#define GOSSIP_ITEM_OBTAIN "[PH] Obtain Chrono-Beacon"
#define SPELL_CHRONO_BEACON 34975
#define ITEM_CHRONO_BEACON 24289
bool GossipHello_npc_saat(Player* pPlayer, Creature* pCreature)
class npc_saat : public CreatureScript
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
public:
npc_saat() : CreatureScript("npc_saat") { }
if (pPlayer->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(ITEM_CHRONO_BEACON,1))
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(10000, pCreature->GetGUID());
return true;
}
else if (pPlayer->GetQuestRewardStatus(QUEST_OPENING_PORTAL) && !pPlayer->HasItemCount(ITEM_CHRONO_BEACON,1))
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(10001, pCreature->GetGUID());
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
{
pPlayer->CLOSE_GOSSIP_MENU();
pCreature->CastSpell(pPlayer,SPELL_CHRONO_BEACON,false);
}
return true;
}
pPlayer->SEND_GOSSIP_MENU(10002, pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_saat(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
pPlayer->CLOSE_GOSSIP_MENU();
pCreature->CastSpell(pPlayer,SPELL_CHRONO_BEACON,false);
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pPlayer->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(ITEM_CHRONO_BEACON,1))
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(10000, pCreature->GetGUID());
return true;
}
else if (pPlayer->GetQuestRewardStatus(QUEST_OPENING_PORTAL) && !pPlayer->HasItemCount(ITEM_CHRONO_BEACON,1))
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(10001, pCreature->GetGUID());
return true;
}
pPlayer->SEND_GOSSIP_MENU(10002, pCreature->GetGUID());
return true;
}
return true;
}
};
void AddSC_dark_portal()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_medivh_bm";
newscript->GetAI = &GetAI_npc_medivh_bm;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_time_rift";
newscript->GetAI = &GetAI_npc_time_rift;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_saat";
newscript->pGossipHello = &GossipHello_npc_saat;
newscript->pGossipSelect = &GossipSelect_npc_saat;
newscript->RegisterSelf();
new npc_medivh_bm();
new npc_time_rift();
new npc_saat();
}
@@ -60,289 +60,290 @@ static Wave RiftWaves[]=
{RIFT_BOSS, 120000},
{C_AEONUS, 0}
};
struct instance_dark_portal : public ScriptedInstance
class instance_dark_portal : public InstanceMapScript
{
instance_dark_portal(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
public:
instance_dark_portal() : InstanceMapScript("instance_dark_portal") { }
uint32 m_auiEncounter[MAX_ENCOUNTER];
uint32 mRiftPortalCount;
uint32 mShieldPercent;
uint8 mRiftWaveCount;
uint8 mRiftWaveId;
uint32 NextPortal_Timer;
uint64 MedivhGUID;
uint8 CurrentRiftId;
void Initialize()
InstanceScript* GetInstanceData_InstanceMapScript(Map* pMap)
{
MedivhGUID = 0;
Clear();
return new instance_dark_portal_InstanceMapScript(pMap);
}
void Clear()
struct instance_dark_portal_InstanceMapScript : public InstanceScript
{
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
instance_dark_portal_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();};
mRiftPortalCount = 0;
mShieldPercent = 100;
mRiftWaveCount = 0;
mRiftWaveId = 0;
uint32 m_auiEncounter[MAX_ENCOUNTER];
CurrentRiftId = 0;
uint32 mRiftPortalCount;
uint32 mShieldPercent;
uint8 mRiftWaveCount;
uint8 mRiftWaveId;
NextPortal_Timer = 0;
}
uint32 NextPortal_Timer;
void InitWorldState(bool Enable = true)
{
DoUpdateWorldState(WORLD_STATE_BM,Enable ? 1 : 0);
DoUpdateWorldState(WORLD_STATE_BM_SHIELD, 100);
DoUpdateWorldState(WORLD_STATE_BM_RIFT, 0);
}
uint64 MedivhGUID;
uint8 CurrentRiftId;
bool IsEncounterInProgress()
{
if (GetData(TYPE_MEDIVH) == IN_PROGRESS)
return true;
return false;
}
void OnPlayerEnter(Player* pPlayer)
{
if (GetData(TYPE_MEDIVH) == IN_PROGRESS)
return;
pPlayer->SendUpdateWorldState(WORLD_STATE_BM,0);
}
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
if (pCreature->GetEntry() == C_MEDIVH)
MedivhGUID = pCreature->GetGUID();
}
//what other conditions to check?
bool CanProgressEvent()
{
if (instance->GetPlayers().isEmpty())
return false;
return true;
}
uint8 GetRiftWaveId()
{
switch(mRiftPortalCount)
void Initialize()
{
case 6:
mRiftWaveId = 2;
return 1;
case 12:
mRiftWaveId = 4;
return 3;
case 18:
return 5;
default:
return mRiftWaveId;
MedivhGUID = 0;
Clear();
}
}
void SetData(uint32 type, uint32 data)
{
switch(type)
void Clear()
{
case TYPE_MEDIVH:
if (data == SPECIAL && m_auiEncounter[0] == IN_PROGRESS)
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
mRiftPortalCount = 0;
mShieldPercent = 100;
mRiftWaveCount = 0;
mRiftWaveId = 0;
CurrentRiftId = 0;
NextPortal_Timer = 0;
}
void InitWorldState(bool Enable = true)
{
DoUpdateWorldState(WORLD_STATE_BM,Enable ? 1 : 0);
DoUpdateWorldState(WORLD_STATE_BM_SHIELD, 100);
DoUpdateWorldState(WORLD_STATE_BM_RIFT, 0);
}
bool IsEncounterInProgress()
{
if (GetData(TYPE_MEDIVH) == IN_PROGRESS)
return true;
return false;
}
void OnPlayerEnter(Player* pPlayer)
{
if (GetData(TYPE_MEDIVH) == IN_PROGRESS)
return;
pPlayer->SendUpdateWorldState(WORLD_STATE_BM,0);
}
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
if (pCreature->GetEntry() == C_MEDIVH)
MedivhGUID = pCreature->GetGUID();
}
//what other conditions to check?
bool CanProgressEvent()
{
if (instance->GetPlayers().isEmpty())
return false;
return true;
}
uint8 GetRiftWaveId()
{
switch(mRiftPortalCount)
{
--mShieldPercent;
DoUpdateWorldState(WORLD_STATE_BM_SHIELD, mShieldPercent);
if (!mShieldPercent)
{
if (Creature* pMedivh = instance->GetCreature(MedivhGUID))
{
if (pMedivh->isAlive())
{
pMedivh->DealDamage(pMedivh, pMedivh->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
m_auiEncounter[0] = FAIL;
m_auiEncounter[1] = NOT_STARTED;
}
}
}
case 6:
mRiftWaveId = 2;
return 1;
case 12:
mRiftWaveId = 4;
return 3;
case 18:
return 5;
default:
return mRiftWaveId;
}
else
}
void SetData(uint32 type, uint32 data)
{
switch(type)
{
if (data == IN_PROGRESS)
case TYPE_MEDIVH:
if (data == SPECIAL && m_auiEncounter[0] == IN_PROGRESS)
{
sLog.outDebug("TSCR: Instance Dark Portal: Starting event.");
InitWorldState();
m_auiEncounter[1] = IN_PROGRESS;
NextPortal_Timer = 15000;
}
--mShieldPercent;
if (data == DONE)
{
//this may be completed further out in the post-event
sLog.outDebug("TSCR: Instance Dark Portal: Event completed.");
Map::PlayerList const& players = instance->GetPlayers();
DoUpdateWorldState(WORLD_STATE_BM_SHIELD, mShieldPercent);
if (!players.isEmpty())
if (!mShieldPercent)
{
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
if (Creature* pMedivh = instance->GetCreature(MedivhGUID))
{
if (Player* pPlayer = itr->getSource())
if (pMedivh->isAlive())
{
if (pPlayer->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE)
pPlayer->AreaExploredOrEventHappens(QUEST_OPENING_PORTAL);
if (pPlayer->GetQuestStatus(QUEST_MASTER_TOUCH) == QUEST_STATUS_INCOMPLETE)
pPlayer->AreaExploredOrEventHappens(QUEST_MASTER_TOUCH);
pMedivh->DealDamage(pMedivh, pMedivh->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
m_auiEncounter[0] = FAIL;
m_auiEncounter[1] = NOT_STARTED;
}
}
}
}
m_auiEncounter[0] = data;
}
break;
case TYPE_RIFT:
if (data == SPECIAL)
{
if (mRiftPortalCount < 7)
NextPortal_Timer = 5000;
}
else
m_auiEncounter[1] = data;
break;
}
}
uint32 GetData(uint32 type)
{
switch(type)
{
case TYPE_MEDIVH:
return m_auiEncounter[0];
case TYPE_RIFT:
return m_auiEncounter[1];
case DATA_PORTAL_COUNT:
return mRiftPortalCount;
case DATA_SHIELD:
return mShieldPercent;
}
return 0;
}
uint64 GetData64(uint32 data)
{
if (data == DATA_MEDIVH)
return MedivhGUID;
return 0;
}
Creature* SummonedPortalBoss(Creature* me)
{
uint32 entry = RiftWaves[GetRiftWaveId()].PortalBoss;
if (entry == RIFT_BOSS)
entry = RandRiftBoss();
sLog.outDebug("TSCR: Instance Dark Portal: Summoning rift boss entry %u.",entry);
Position pos;
me->GetRandomNearPosition(pos, 10.0f);
//normalize Z-level if we can, if rift is not at ground level.
pos.m_positionZ = std::max(me->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), me->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY));
if (Creature *summon = me->SummonCreature(entry, pos, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000))
return summon;
sLog.outDebug("TSCR: Instance Dark Portal: What just happened there? No boss, no loot, no fun...");
return NULL;
}
void DoSpawnPortal()
{
if (Creature* pMedivh = instance->GetCreature(MedivhGUID))
{
uint8 tmp = urand(0,2);
if (tmp >= CurrentRiftId)
++tmp;
sLog.outDebug("TSCR: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId);
CurrentRiftId = tmp;
Creature *pTemp = pMedivh->SummonCreature(C_TIME_RIFT,
PortalLocation[tmp][0],PortalLocation[tmp][1],PortalLocation[tmp][2],PortalLocation[tmp][3],
TEMPSUMMON_CORPSE_DESPAWN,0);
if (pTemp)
{
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if (Creature *pBoss = SummonedPortalBoss(pTemp))
else
{
if (pBoss->GetEntry() == C_AEONUS)
pBoss->AddThreat(pMedivh,0.0f);
else
if (data == IN_PROGRESS)
{
pBoss->AddThreat(pTemp,0.0f);
pTemp->CastSpell(pBoss,SPELL_RIFT_CHANNEL,false);
sLog.outDebug("TSCR: Instance Dark Portal: Starting event.");
InitWorldState();
m_auiEncounter[1] = IN_PROGRESS;
NextPortal_Timer = 15000;
}
if (data == DONE)
{
//this may be completed further out in the post-event
sLog.outDebug("TSCR: Instance Dark Portal: Event completed.");
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
{
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (Player* pPlayer = itr->getSource())
{
if (pPlayer->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE)
pPlayer->AreaExploredOrEventHappens(QUEST_OPENING_PORTAL);
if (pPlayer->GetQuestStatus(QUEST_MASTER_TOUCH) == QUEST_STATUS_INCOMPLETE)
pPlayer->AreaExploredOrEventHappens(QUEST_MASTER_TOUCH);
}
}
}
}
m_auiEncounter[0] = data;
}
break;
case TYPE_RIFT:
if (data == SPECIAL)
{
if (mRiftPortalCount < 7)
NextPortal_Timer = 5000;
}
else
m_auiEncounter[1] = data;
break;
}
}
uint32 GetData(uint32 type)
{
switch(type)
{
case TYPE_MEDIVH:
return m_auiEncounter[0];
case TYPE_RIFT:
return m_auiEncounter[1];
case DATA_PORTAL_COUNT:
return mRiftPortalCount;
case DATA_SHIELD:
return mShieldPercent;
}
return 0;
}
uint64 GetData64(uint32 data)
{
if (data == DATA_MEDIVH)
return MedivhGUID;
return 0;
}
Creature* SummonedPortalBoss(Creature* me)
{
uint32 entry = RiftWaves[GetRiftWaveId()].PortalBoss;
if (entry == RIFT_BOSS)
entry = RandRiftBoss();
sLog.outDebug("TSCR: Instance Dark Portal: Summoning rift boss entry %u.",entry);
Position pos;
me->GetRandomNearPosition(pos, 10.0f);
//normalize Z-level if we can, if rift is not at ground level.
pos.m_positionZ = std::max(me->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), me->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY));
if (Creature *summon = me->SummonCreature(entry, pos, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000))
return summon;
sLog.outDebug("TSCR: Instance Dark Portal: What just happened there? No boss, no loot, no fun...");
return NULL;
}
void DoSpawnPortal()
{
if (Creature* pMedivh = instance->GetCreature(MedivhGUID))
{
uint8 tmp = urand(0,2);
if (tmp >= CurrentRiftId)
++tmp;
sLog.outDebug("TSCR: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId);
CurrentRiftId = tmp;
Creature *pTemp = pMedivh->SummonCreature(C_TIME_RIFT,
PortalLocation[tmp][0],PortalLocation[tmp][1],PortalLocation[tmp][2],PortalLocation[tmp][3],
TEMPSUMMON_CORPSE_DESPAWN,0);
if (pTemp)
{
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if (Creature *pBoss = SummonedPortalBoss(pTemp))
{
if (pBoss->GetEntry() == C_AEONUS)
pBoss->AddThreat(pMedivh,0.0f);
else
{
pBoss->AddThreat(pTemp,0.0f);
pTemp->CastSpell(pBoss,SPELL_RIFT_CHANNEL,false);
}
}
}
}
}
}
void Update(uint32 diff)
{
if (m_auiEncounter[1] != IN_PROGRESS)
return;
//add delay timer?
if (!CanProgressEvent())
void Update(uint32 diff)
{
Clear();
return;
}
if (m_auiEncounter[1] != IN_PROGRESS)
return;
if (NextPortal_Timer)
{
if (NextPortal_Timer <= diff)
//add delay timer?
if (!CanProgressEvent())
{
++mRiftPortalCount;
Clear();
return;
}
DoUpdateWorldState(WORLD_STATE_BM_RIFT, mRiftPortalCount);
if (NextPortal_Timer)
{
if (NextPortal_Timer <= diff)
{
++mRiftPortalCount;
DoSpawnPortal();
NextPortal_Timer = RiftWaves[GetRiftWaveId()].NextPortalTime;
} else NextPortal_Timer -= diff;
DoUpdateWorldState(WORLD_STATE_BM_RIFT, mRiftPortalCount);
DoSpawnPortal();
NextPortal_Timer = RiftWaves[GetRiftWaveId()].NextPortalTime;
} else NextPortal_Timer -= diff;
}
}
}
};
};
InstanceData* GetInstanceData_instance_dark_portal(Map* pMap)
{
return new instance_dark_portal(pMap);
}
void AddSC_instance_dark_portal()
{
Script *newscript;
newscript = new Script;
newscript->Name = "instance_dark_portal";
newscript->GetInstanceData = &GetInstanceData_instance_dark_portal;
newscript->RegisterSelf();
new instance_dark_portal();
}
@@ -39,116 +39,118 @@ EndScriptData */
#define SPELL_HOLY_SHIELD 31904
#define SPELL_DEVOTION_AURA 8258
#define SPELL_CONSECRATION 38385
struct boss_captain_skarlocAI : public ScriptedAI
class boss_captain_skarloc : public CreatureScript
{
boss_captain_skarlocAI(Creature *c) : ScriptedAI(c)
public:
boss_captain_skarloc() : CreatureScript("boss_captain_skarloc") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
return new boss_captain_skarlocAI (pCreature);
}
ScriptedInstance *pInstance;
uint32 Holy_Light_Timer;
uint32 Cleanse_Timer;
uint32 HammerOfJustice_Timer;
uint32 HolyShield_Timer;
uint32 DevotionAura_Timer;
uint32 Consecration_Timer;
void Reset()
struct boss_captain_skarlocAI : public ScriptedAI
{
Holy_Light_Timer = 20000 + rand()%10000;
Cleanse_Timer = 10000;
HammerOfJustice_Timer = 20000 + rand()%15000;
HolyShield_Timer = 240000;
DevotionAura_Timer = 3000;
Consecration_Timer = 8000;
}
void EnterCombat(Unit * /*who*/)
{
//This is not correct. Should taunt Thrall before engage in combat
DoScriptText(SAY_TAUNT1, me);
DoScriptText(SAY_TAUNT2, me);
}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit * /*victim*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
pInstance->SetData(TYPE_THRALL_PART1, DONE);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Holy_Light
if (Holy_Light_Timer <= diff)
boss_captain_skarlocAI(Creature *c) : ScriptedAI(c)
{
DoCast(me, SPELL_HOLY_LIGHT);
Holy_Light_Timer = 30000;
} else Holy_Light_Timer -= diff;
pInstance = c->GetInstanceScript();
}
//Cleanse
if (Cleanse_Timer <= diff)
InstanceScript *pInstance;
uint32 Holy_Light_Timer;
uint32 Cleanse_Timer;
uint32 HammerOfJustice_Timer;
uint32 HolyShield_Timer;
uint32 DevotionAura_Timer;
uint32 Consecration_Timer;
void Reset()
{
DoCast(me, SPELL_CLEANSE);
Holy_Light_Timer = 20000 + rand()%10000;
Cleanse_Timer = 10000;
} else Cleanse_Timer -= diff;
//Hammer of Justice
if (HammerOfJustice_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_HAMMER_OF_JUSTICE);
HammerOfJustice_Timer = 60000;
} else HammerOfJustice_Timer -= diff;
//Holy Shield
if (HolyShield_Timer <= diff)
{
DoCast(me, SPELL_HOLY_SHIELD);
HammerOfJustice_Timer = 20000 + rand()%15000;
HolyShield_Timer = 240000;
} else HolyShield_Timer -= diff;
DevotionAura_Timer = 3000;
Consecration_Timer = 8000;
}
//Devotion_Aura
if (DevotionAura_Timer <= diff)
void EnterCombat(Unit * /*who*/)
{
DoCast(me, SPELL_DEVOTION_AURA);
DevotionAura_Timer = 45000 + rand()%10000;
} else DevotionAura_Timer -= diff;
//This is not correct. Should taunt Thrall before engage in combat
DoScriptText(SAY_TAUNT1, me);
DoScriptText(SAY_TAUNT2, me);
}
//Consecration
if (Consecration_Timer <= diff)
void KilledUnit(Unit * /*victim*/)
{
//DoCast(me->getVictim(), SPELL_CONSECRATION);
Consecration_Timer = 5000 + rand()%5000;
} else Consecration_Timer -= diff;
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit * /*victim*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
pInstance->SetData(TYPE_THRALL_PART1, DONE);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Holy_Light
if (Holy_Light_Timer <= diff)
{
DoCast(me, SPELL_HOLY_LIGHT);
Holy_Light_Timer = 30000;
} else Holy_Light_Timer -= diff;
//Cleanse
if (Cleanse_Timer <= diff)
{
DoCast(me, SPELL_CLEANSE);
Cleanse_Timer = 10000;
} else Cleanse_Timer -= diff;
//Hammer of Justice
if (HammerOfJustice_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_HAMMER_OF_JUSTICE);
HammerOfJustice_Timer = 60000;
} else HammerOfJustice_Timer -= diff;
//Holy Shield
if (HolyShield_Timer <= diff)
{
DoCast(me, SPELL_HOLY_SHIELD);
HolyShield_Timer = 240000;
} else HolyShield_Timer -= diff;
//Devotion_Aura
if (DevotionAura_Timer <= diff)
{
DoCast(me, SPELL_DEVOTION_AURA);
DevotionAura_Timer = 45000 + rand()%10000;
} else DevotionAura_Timer -= diff;
//Consecration
if (Consecration_Timer <= diff)
{
//DoCast(me->getVictim(), SPELL_CONSECRATION);
Consecration_Timer = 5000 + rand()%5000;
} else Consecration_Timer -= diff;
DoMeleeAttackIfReady();
}
};
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_captain_skarloc(Creature* pCreature)
{
return new boss_captain_skarlocAI (pCreature);
}
void AddSC_boss_captain_skarloc()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_captain_skarloc";
newscript->GetAI = &GetAI_boss_captain_skarloc;
newscript->RegisterSelf();
new boss_captain_skarloc();
}
@@ -41,100 +41,102 @@ EndScriptData */
#define SPELL_IMPENDING_DEATH 31916
#define SPELL_MAGIC_DISRUPTION_AURA 33834
#define SPELL_WING_BUFFET 31475
struct boss_epoch_hunterAI : public ScriptedAI
class boss_epoch_hunter : public CreatureScript
{
boss_epoch_hunterAI(Creature *c) : ScriptedAI(c)
public:
boss_epoch_hunter() : CreatureScript("boss_epoch_hunter") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
return new boss_epoch_hunterAI (pCreature);
}
ScriptedInstance *pInstance;
uint32 SandBreath_Timer;
uint32 ImpendingDeath_Timer;
uint32 WingBuffet_Timer;
uint32 Mda_Timer;
void Reset()
struct boss_epoch_hunterAI : public ScriptedAI
{
SandBreath_Timer = 8000 + rand()%8000;
ImpendingDeath_Timer = 25000 + rand()%5000;
WingBuffet_Timer = 35000;
Mda_Timer = 40000;
}
void EnterCombat(Unit * /*who*/)
{
DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2), me);
}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit * /*victim*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
pInstance->SetData(TYPE_THRALL_PART4, DONE);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Sand Breath
if (SandBreath_Timer <= diff)
boss_epoch_hunterAI(Creature *c) : ScriptedAI(c)
{
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(false);
pInstance = c->GetInstanceScript();
}
DoCast(me->getVictim(), SPELL_SAND_BREATH);
InstanceScript *pInstance;
DoScriptText(RAND(SAY_BREATH1,SAY_BREATH2), me);
uint32 SandBreath_Timer;
uint32 ImpendingDeath_Timer;
uint32 WingBuffet_Timer;
uint32 Mda_Timer;
SandBreath_Timer = 10000 + rand()%10000;
} else SandBreath_Timer -= diff;
if (ImpendingDeath_Timer <= diff)
void Reset()
{
DoCast(me->getVictim(), SPELL_IMPENDING_DEATH);
ImpendingDeath_Timer = 25000+rand()%5000;
} else ImpendingDeath_Timer -= diff;
SandBreath_Timer = 8000 + rand()%8000;
ImpendingDeath_Timer = 25000 + rand()%5000;
WingBuffet_Timer = 35000;
Mda_Timer = 40000;
}
if (WingBuffet_Timer <= diff)
void EnterCombat(Unit * /*who*/)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(pTarget, SPELL_WING_BUFFET);
WingBuffet_Timer = 25000+rand()%10000;
} else WingBuffet_Timer -= diff;
DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2), me);
}
if (Mda_Timer <= diff)
void KilledUnit(Unit * /*victim*/)
{
DoCast(me, SPELL_MAGIC_DISRUPTION_AURA);
Mda_Timer = 15000;
} else Mda_Timer -= diff;
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit * /*victim*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
pInstance->SetData(TYPE_THRALL_PART4, DONE);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Sand Breath
if (SandBreath_Timer <= diff)
{
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(false);
DoCast(me->getVictim(), SPELL_SAND_BREATH);
DoScriptText(RAND(SAY_BREATH1,SAY_BREATH2), me);
SandBreath_Timer = 10000 + rand()%10000;
} else SandBreath_Timer -= diff;
if (ImpendingDeath_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_IMPENDING_DEATH);
ImpendingDeath_Timer = 25000+rand()%5000;
} else ImpendingDeath_Timer -= diff;
if (WingBuffet_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(pTarget, SPELL_WING_BUFFET);
WingBuffet_Timer = 25000+rand()%10000;
} else WingBuffet_Timer -= diff;
if (Mda_Timer <= diff)
{
DoCast(me, SPELL_MAGIC_DISRUPTION_AURA);
Mda_Timer = 15000;
} else Mda_Timer -= diff;
DoMeleeAttackIfReady();
}
};
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_epoch_hunter(Creature* pCreature)
{
return new boss_epoch_hunterAI (pCreature);
}
void AddSC_boss_epoch_hunter()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_epoch_hunter";
newscript->GetAI = &GetAI_boss_epoch_hunter;
newscript->RegisterSelf();
new boss_epoch_hunter();
}
@@ -30,19 +30,25 @@ EndScriptData */
/*######
## go_barrel_old_hillsbrad
######*/
bool GOHello_go_barrel_old_hillsbrad(Player* /*pPlayer*/, GameObject* pGO)
class go_barrel_old_hillsbrad : public GameObjectScript
{
if (ScriptedInstance* pInstance = pGO->GetInstanceData())
{
if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE)
return false;
public:
go_barrel_old_hillsbrad() : GameObjectScript("go_barrel_old_hillsbrad") { }
pInstance->SetData(TYPE_BARREL_DIVERSION, IN_PROGRESS);
bool OnGossipHello(Player* /*pPlayer*/, GameObject* pGO)
{
if (InstanceScript* pInstance = pGO->GetInstanceScript())
{
if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE)
return false;
pInstance->SetData(TYPE_BARREL_DIVERSION, IN_PROGRESS);
}
return false;
}
return false;
}
};
/*######
## boss_lieutenant_drake
@@ -91,102 +97,99 @@ static Location DrakeWP[]=
{17, 2125.50, 88.9481, 54.7953},
{18, 2128.20, 70.9763, 64.4221}
};
struct boss_lieutenant_drakeAI : public ScriptedAI
class boss_lieutenant_drake : public CreatureScript
{
boss_lieutenant_drakeAI(Creature *c) : ScriptedAI(c) {}
public:
boss_lieutenant_drake() : CreatureScript("boss_lieutenant_drake") { }
bool CanPatrol;
uint32 wpId;
uint32 Whirlwind_Timer;
uint32 Fear_Timer;
uint32 MortalStrike_Timer;
uint32 ExplodingShout_Timer;
void Reset()
CreatureAI* GetAI(Creature* pCreature) const
{
CanPatrol = true;
wpId = 0;
Whirlwind_Timer = 20000;
Fear_Timer = 30000;
MortalStrike_Timer = 45000;
ExplodingShout_Timer = 25000;
return new boss_lieutenant_drakeAI (pCreature);
}
void EnterCombat(Unit * /*who*/)
struct boss_lieutenant_drakeAI : public ScriptedAI
{
DoScriptText(SAY_AGGRO, me);
}
boss_lieutenant_drakeAI(Creature *c) : ScriptedAI(c) {}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
bool CanPatrol;
uint32 wpId;
void JustDied(Unit * /*victim*/)
{
DoScriptText(SAY_DEATH, me);
}
uint32 Whirlwind_Timer;
uint32 Fear_Timer;
uint32 MortalStrike_Timer;
uint32 ExplodingShout_Timer;
void UpdateAI(const uint32 diff)
{
//TODO: make this work
if (CanPatrol && wpId == 0)
void Reset()
{
me->GetMotionMaster()->MovePoint(DrakeWP[0].wpId, DrakeWP[0].x, DrakeWP[0].y, DrakeWP[0].z);
++wpId;
CanPatrol = true;
wpId = 0;
Whirlwind_Timer = 20000;
Fear_Timer = 30000;
MortalStrike_Timer = 45000;
ExplodingShout_Timer = 25000;
}
//Return since we have no target
if (!UpdateVictim())
return;
//Whirlwind
if (Whirlwind_Timer <= diff)
void EnterCombat(Unit * /*who*/)
{
DoCast(me->getVictim(), SPELL_WHIRLWIND);
Whirlwind_Timer = 20000+rand()%5000;
} else Whirlwind_Timer -= diff;
DoScriptText(SAY_AGGRO, me);
}
//Fear
if (Fear_Timer <= diff)
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(SAY_SHOUT, me);
DoCast(me->getVictim(), SPELL_FRIGHTENING_SHOUT);
Fear_Timer = 25000+rand()%10000;
} else Fear_Timer -= diff;
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
//Mortal Strike
if (MortalStrike_Timer <= diff)
void JustDied(Unit * /*victim*/)
{
DoScriptText(SAY_MORTAL, me);
DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
MortalStrike_Timer = 20000+rand()%10000;
} else MortalStrike_Timer -= diff;
DoScriptText(SAY_DEATH, me);
}
void UpdateAI(const uint32 diff)
{
//TODO: make this work
if (CanPatrol && wpId == 0)
{
me->GetMotionMaster()->MovePoint(DrakeWP[0].wpId, DrakeWP[0].x, DrakeWP[0].y, DrakeWP[0].z);
++wpId;
}
//Return since we have no target
if (!UpdateVictim())
return;
//Whirlwind
if (Whirlwind_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_WHIRLWIND);
Whirlwind_Timer = 20000+rand()%5000;
} else Whirlwind_Timer -= diff;
//Fear
if (Fear_Timer <= diff)
{
DoScriptText(SAY_SHOUT, me);
DoCast(me->getVictim(), SPELL_FRIGHTENING_SHOUT);
Fear_Timer = 25000+rand()%10000;
} else Fear_Timer -= diff;
//Mortal Strike
if (MortalStrike_Timer <= diff)
{
DoScriptText(SAY_MORTAL, me);
DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
MortalStrike_Timer = 20000+rand()%10000;
} else MortalStrike_Timer -= diff;
DoMeleeAttackIfReady();
}
};
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_lieutenant_drake(Creature* pCreature)
{
return new boss_lieutenant_drakeAI (pCreature);
}
void AddSC_boss_lieutenant_drake()
{
Script *newscript;
newscript = new Script;
newscript->Name = "go_barrel_old_hillsbrad";
newscript->pGOHello = &GOHello_go_barrel_old_hillsbrad;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "boss_lieutenant_drake";
newscript->GetAI = &GetAI_boss_lieutenant_drake;
newscript->RegisterSelf();
new go_barrel_old_hillsbrad();
new boss_lieutenant_drake();
}
@@ -36,205 +36,207 @@ EndScriptData */
#define QUEST_ENTRY_DIVERSION 10283
#define LODGE_QUEST_TRIGGER 20155
struct instance_old_hillsbrad : public ScriptedInstance
class instance_old_hillsbrad : public InstanceMapScript
{
instance_old_hillsbrad(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
public:
instance_old_hillsbrad() : InstanceMapScript("instance_old_hillsbrad") { }
uint32 m_auiEncounter[MAX_ENCOUNTER];
uint32 mBarrelCount;
uint32 mThrallEventCount;
uint64 ThrallGUID;
uint64 TarethaGUID;
uint64 EpochGUID;
void Initialize()
InstanceScript* GetInstanceData_InstanceMapScript(Map* pMap)
{
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
mBarrelCount = 0;
mThrallEventCount = 0;
ThrallGUID = 0;
TarethaGUID = 0;
EpochGUID = 0;
return new instance_old_hillsbrad_InstanceMapScript(pMap);
}
Player* GetPlayerInMap()
struct instance_old_hillsbrad_InstanceMapScript : public InstanceScript
{
Map::PlayerList const& players = instance->GetPlayers();
instance_old_hillsbrad_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();};
if (!players.isEmpty())
uint32 m_auiEncounter[MAX_ENCOUNTER];
uint32 mBarrelCount;
uint32 mThrallEventCount;
uint64 ThrallGUID;
uint64 TarethaGUID;
uint64 EpochGUID;
void Initialize()
{
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
mBarrelCount = 0;
mThrallEventCount = 0;
ThrallGUID = 0;
TarethaGUID = 0;
EpochGUID = 0;
}
Player* GetPlayerInMap()
{
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
{
if (Player* plr = itr->getSource())
return plr;
}
}
sLog.outDebug("TSCR: Instance Old Hillsbrad: GetPlayerInMap, but PlayerList is empty!");
return NULL;
}
void UpdateQuestCredit()
{
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
{
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (Player* pPlayer = itr->getSource())
pPlayer->KilledMonsterCredit(LODGE_QUEST_TRIGGER,0);
}
}
}
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
switch(pCreature->GetEntry())
{
case THRALL_ENTRY:
ThrallGUID = pCreature->GetGUID();
break;
case TARETHA_ENTRY:
TarethaGUID = pCreature->GetGUID();
break;
case EPOCH_ENTRY:
EpochGUID = pCreature->GetGUID();
break;
}
}
void SetData(uint32 type, uint32 data)
{
Player* pPlayer = GetPlayerInMap();
if (!pPlayer)
{
sLog.outDebug("TSCR: Instance Old Hillsbrad: SetData (Type: %u Data %u) cannot find any player.", type, data);
return;
}
switch(type)
{
case TYPE_BARREL_DIVERSION:
{
if (data == IN_PROGRESS)
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (mBarrelCount >= 5)
return;
++mBarrelCount;
DoUpdateWorldState(WORLD_STATE_OH, mBarrelCount);
sLog.outDebug("TSCR: Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u",mBarrelCount);
m_auiEncounter[0] = IN_PROGRESS;
if (mBarrelCount == 5)
{
UpdateQuestCredit();
pPlayer->SummonCreature(DRAKE_ENTRY, 2128.43, 71.01, 64.42, 1.74, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000);
m_auiEncounter[0] = DONE;
}
if (Player* plr = itr->getSource())
return plr;
}
break;
}
case TYPE_THRALL_EVENT:
sLog.outDebug("TSCR: Instance Old Hillsbrad: GetPlayerInMap, but PlayerList is empty!");
return NULL;
}
void UpdateQuestCredit()
{
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
{
if (data == FAIL)
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (mThrallEventCount <= 20)
if (Player* pPlayer = itr->getSource())
pPlayer->KilledMonsterCredit(LODGE_QUEST_TRIGGER,0);
}
}
}
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
switch(pCreature->GetEntry())
{
case THRALL_ENTRY:
ThrallGUID = pCreature->GetGUID();
break;
case TARETHA_ENTRY:
TarethaGUID = pCreature->GetGUID();
break;
case EPOCH_ENTRY:
EpochGUID = pCreature->GetGUID();
break;
}
}
void SetData(uint32 type, uint32 data)
{
Player* pPlayer = GetPlayerInMap();
if (!pPlayer)
{
sLog.outDebug("TSCR: Instance Old Hillsbrad: SetData (Type: %u Data %u) cannot find any player.", type, data);
return;
}
switch(type)
{
case TYPE_BARREL_DIVERSION:
{
if (data == IN_PROGRESS)
{
++mThrallEventCount;
m_auiEncounter[1] = NOT_STARTED;
sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount);
m_auiEncounter[2] = NOT_STARTED;
m_auiEncounter[3] = NOT_STARTED;
m_auiEncounter[4] = NOT_STARTED;
m_auiEncounter[5] = NOT_STARTED;
if (mBarrelCount >= 5)
return;
++mBarrelCount;
DoUpdateWorldState(WORLD_STATE_OH, mBarrelCount);
sLog.outDebug("TSCR: Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u",mBarrelCount);
m_auiEncounter[0] = IN_PROGRESS;
if (mBarrelCount == 5)
{
UpdateQuestCredit();
pPlayer->SummonCreature(DRAKE_ENTRY, 2128.43, 71.01, 64.42, 1.74, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000);
m_auiEncounter[0] = DONE;
}
}
else if (mThrallEventCount > 20)
break;
}
case TYPE_THRALL_EVENT:
{
if (data == FAIL)
{
if (mThrallEventCount <= 20)
{
++mThrallEventCount;
m_auiEncounter[1] = NOT_STARTED;
sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount);
m_auiEncounter[2] = NOT_STARTED;
m_auiEncounter[3] = NOT_STARTED;
m_auiEncounter[4] = NOT_STARTED;
m_auiEncounter[5] = NOT_STARTED;
}
else if (mThrallEventCount > 20)
{
m_auiEncounter[1] = data;
m_auiEncounter[2] = data;
m_auiEncounter[3] = data;
m_auiEncounter[4] = data;
m_auiEncounter[5] = data;
sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount);
}
}
else
m_auiEncounter[1] = data;
m_auiEncounter[2] = data;
m_auiEncounter[3] = data;
m_auiEncounter[4] = data;
m_auiEncounter[5] = data;
sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount);
}
sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall escort event adjusted to data %u.",data);
break;
}
else
m_auiEncounter[1] = data;
sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall escort event adjusted to data %u.",data);
break;
case TYPE_THRALL_PART1:
m_auiEncounter[2] = data;
sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event part I adjusted to data %u.",data);
break;
case TYPE_THRALL_PART2:
m_auiEncounter[3] = data;
sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event part II adjusted to data %u.",data);
break;
case TYPE_THRALL_PART3:
m_auiEncounter[4] = data;
sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event part III adjusted to data %u.",data);
break;
case TYPE_THRALL_PART4:
m_auiEncounter[5] = data;
sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event part IV adjusted to data %u.",data);
break;
}
case TYPE_THRALL_PART1:
m_auiEncounter[2] = data;
sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event part I adjusted to data %u.",data);
break;
case TYPE_THRALL_PART2:
m_auiEncounter[3] = data;
sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event part II adjusted to data %u.",data);
break;
case TYPE_THRALL_PART3:
m_auiEncounter[4] = data;
sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event part III adjusted to data %u.",data);
break;
case TYPE_THRALL_PART4:
m_auiEncounter[5] = data;
sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event part IV adjusted to data %u.",data);
break;
}
}
uint32 GetData(uint32 data)
{
switch(data)
uint32 GetData(uint32 data)
{
case TYPE_BARREL_DIVERSION:
return m_auiEncounter[0];
case TYPE_THRALL_EVENT:
return m_auiEncounter[1];
case TYPE_THRALL_PART1:
return m_auiEncounter[2];
case TYPE_THRALL_PART2:
return m_auiEncounter[3];
case TYPE_THRALL_PART3:
return m_auiEncounter[4];
case TYPE_THRALL_PART4:
return m_auiEncounter[5];
switch(data)
{
case TYPE_BARREL_DIVERSION:
return m_auiEncounter[0];
case TYPE_THRALL_EVENT:
return m_auiEncounter[1];
case TYPE_THRALL_PART1:
return m_auiEncounter[2];
case TYPE_THRALL_PART2:
return m_auiEncounter[3];
case TYPE_THRALL_PART3:
return m_auiEncounter[4];
case TYPE_THRALL_PART4:
return m_auiEncounter[5];
}
return 0;
}
return 0;
}
uint64 GetData64(uint32 data)
{
switch(data)
uint64 GetData64(uint32 data)
{
case DATA_THRALL:
return ThrallGUID;
case DATA_TARETHA:
return TarethaGUID;
case DATA_EPOCH:
return EpochGUID;
switch(data)
{
case DATA_THRALL:
return ThrallGUID;
case DATA_TARETHA:
return TarethaGUID;
case DATA_EPOCH:
return EpochGUID;
}
return 0;
}
return 0;
}
};
};
InstanceData* GetInstanceData_instance_old_hillsbrad(Map* pMap)
{
return new instance_old_hillsbrad(pMap);
}
void AddSC_instance_old_hillsbrad()
{
Script *newscript;
newscript = new Script;
newscript->Name = "instance_old_hillsbrad";
newscript->GetInstanceData = &GetInstanceData_instance_old_hillsbrad;
newscript->RegisterSelf();
new instance_old_hillsbrad();
}
@@ -45,42 +45,49 @@ EndContentData */
/*######
## npc_erozion
######*/
bool GossipHello_npc_erozion(Player* pPlayer, Creature* pCreature)
class npc_erozion : public CreatureScript
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
public:
npc_erozion() : CreatureScript("npc_erozion") { }
ScriptedInstance* pInstance = pCreature->GetInstanceData();
if (pInstance && pInstance->GetData(TYPE_BARREL_DIVERSION) != DONE && !pPlayer->HasItemCount(ITEM_ENTRY_BOMBS,1))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_EROZION1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
if (!pPlayer->GetQuestRewardStatus(QUEST_ENTRY_RETURN) && pPlayer->GetQuestStatus(QUEST_ENTRY_RETURN) == QUEST_STATUS_COMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_EROZION2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
pPlayer->SEND_GOSSIP_MENU(9778, pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_erozion(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
ItemPosCountVec dest;
uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_ENTRY_BOMBS, 1);
if (msg == EQUIP_ERR_OK)
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
{
pPlayer->StoreNewItem(dest, ITEM_ENTRY_BOMBS, true);
ItemPosCountVec dest;
uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_ENTRY_BOMBS, 1);
if (msg == EQUIP_ERR_OK)
{
pPlayer->StoreNewItem(dest, ITEM_ENTRY_BOMBS, true);
}
pPlayer->SEND_GOSSIP_MENU(9515, pCreature->GetGUID());
}
pPlayer->SEND_GOSSIP_MENU(9515, pCreature->GetGUID());
if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
{
pPlayer->CLOSE_GOSSIP_MENU();
}
return true;
}
if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
pPlayer->CLOSE_GOSSIP_MENU();
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
InstanceScript* pInstance = pCreature->GetInstanceScript();
if (pInstance && pInstance->GetData(TYPE_BARREL_DIVERSION) != DONE && !pPlayer->HasItemCount(ITEM_ENTRY_BOMBS,1))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_EROZION1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
if (!pPlayer->GetQuestRewardStatus(QUEST_ENTRY_RETURN) && pPlayer->GetQuestStatus(QUEST_ENTRY_RETURN) == QUEST_STATUS_COMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_EROZION2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
pPlayer->SEND_GOSSIP_MENU(9778, pCreature->GetGUID());
return true;
}
return true;
}
};
/*######
## npc_thrall_old_hillsbrad
@@ -179,372 +186,381 @@ bool GossipSelect_npc_erozion(Player* pPlayer, Creature* pCreature, uint32 /*uiS
#define GOSSIP_ID_COMPLETE 9578 //Thank you friends, I owe my freedom to you. Where is Taretha? I hoped to see her
#define GOSSIP_ITEM_WALKING "[PH] Start walking."
struct npc_thrall_old_hillsbradAI : public npc_escortAI
class npc_thrall_old_hillsbrad : public CreatureScript
{
npc_thrall_old_hillsbradAI(Creature *c) : npc_escortAI(c)
public:
npc_thrall_old_hillsbrad() : CreatureScript("npc_thrall_old_hillsbrad") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
HadMount = false;
me->setActive(true);
return new npc_thrall_old_hillsbradAI(pCreature);
}
ScriptedInstance *pInstance;
uint64 TarethaGUID;
bool LowHp;
bool HadMount;
void WaypointReached(uint32 i)
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
if (!pInstance)
return;
switch(i)
InstanceScript* pInstance = pCreature->GetInstanceScript();
switch(uiAction)
{
case 8:
SetRun(false);
me->SummonCreature(18764,2181.87,112.46,89.45,0.26,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
case GOSSIP_ACTION_INFO_DEF+1:
pPlayer->CLOSE_GOSSIP_MENU();
if (pInstance)
{
pInstance->SetData(TYPE_THRALL_EVENT,IN_PROGRESS);
pInstance->SetData(TYPE_THRALL_PART1,IN_PROGRESS);
}
DoScriptText(SAY_TH_START_EVENT_PART1, pCreature);
if (npc_escortAI* pEscortAI = CAST_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, pCreature->AI()))
pEscortAI->Start(true, true, pPlayer->GetGUID());
CAST_AI(npc_escortAI, (pCreature->AI()))->SetMaxPlayerDistance(100.0f);//not really needed, because it will not despawn if player is too far
CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtEnd(false);
CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtFar(false);
break;
case 9:
DoScriptText(SAY_TH_ARMORY, me);
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, THRALL_WEAPON_MODEL);
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO);
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781);
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, THRALL_SHIELD_MODEL);
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, THRALL_SHIELD_INFO);
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 1038);
case GOSSIP_ACTION_INFO_DEF+2:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC2, pCreature->GetGUID());
break;
case 10:
me->SetDisplayId(THRALL_MODEL_EQUIPPED);
case GOSSIP_ACTION_INFO_DEF+20:
pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC3, pCreature->GetGUID());
pCreature->SummonCreature(SKARLOC_MOUNT,2038.81,270.26,63.20,5.41,TEMPSUMMON_TIMED_DESPAWN,12000);
if (pInstance)
pInstance->SetData(TYPE_THRALL_PART2,IN_PROGRESS);
DoScriptText(SAY_TH_START_EVENT_PART2, pCreature);
CAST_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, pCreature->AI())->StartWP();
break;
case 11:
SetRun();
case GOSSIP_ACTION_INFO_DEF+3:
pPlayer->CLOSE_GOSSIP_MENU();
if (pInstance)
pInstance->SetData(TYPE_THRALL_PART3,IN_PROGRESS);
CAST_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, pCreature->AI())->StartWP();
break;
case 15:
me->SummonCreature(MOB_ENTRY_RIFLE,2200.28,137.37,87.93,5.07,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_WARDEN,2197.44,131.83,87.93,0.78,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_VETERAN,2203.62,135.40,87.93,3.70,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_VETERAN,2200.75,130.13,87.93,1.48,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 21:
me->SummonCreature(MOB_ENTRY_RIFLE,2135.80,154.01,67.45,4.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_WARDEN,2144.36,151.87,67.74,4.46,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_VETERAN,2142.12,154.41,67.12,4.56,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_VETERAN,2138.08,155.38,67.24,4.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 25:
me->SummonCreature(MOB_ENTRY_RIFLE,2102.98,192.17,65.24,6.02,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_WARDEN,2108.48,198.75,65.18,5.15,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_VETERAN,2106.11,197.29,65.18,5.63,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_VETERAN,2104.18,194.82,65.18,5.75,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 29:
DoScriptText(SAY_TH_SKARLOC_MEET, me);
me->SummonCreature(ENTRY_SCARLOC,2036.48,271.22,63.43,5.27,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
//temporary,skarloc should rather be triggered to walk up to thrall
break;
case 30:
SetEscortPaused(true);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetRun(false);
break;
case 31:
DoScriptText(SAY_TH_MOUNTS_UP, me);
}
return true;
}
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
{
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
pPlayer->SendPreparedQuest(pCreature->GetGUID());
}
InstanceScript* pInstance = pCreature->GetInstanceScript();
if (pInstance)
{
if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE && !pInstance->GetData(TYPE_THRALL_EVENT))
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_WALKING, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_START, pCreature->GetGUID());
}
if (pInstance->GetData(TYPE_THRALL_PART1) == DONE && !pInstance->GetData(TYPE_THRALL_PART2))
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC1, pCreature->GetGUID());
}
if (pInstance->GetData(TYPE_THRALL_PART2) == DONE && !pInstance->GetData(TYPE_THRALL_PART3))
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TARREN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_TARREN, pCreature->GetGUID());
}
}
return true;
}
struct npc_thrall_old_hillsbradAI : public npc_escortAI
{
npc_thrall_old_hillsbradAI(Creature *c) : npc_escortAI(c)
{
pInstance = c->GetInstanceScript();
HadMount = false;
me->setActive(true);
}
InstanceScript *pInstance;
uint64 TarethaGUID;
bool LowHp;
bool HadMount;
void WaypointReached(uint32 i)
{
if (!pInstance)
return;
switch(i)
{
case 8:
SetRun(false);
me->SummonCreature(18764,2181.87,112.46,89.45,0.26,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 9:
DoScriptText(SAY_TH_ARMORY, me);
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, THRALL_WEAPON_MODEL);
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO);
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781);
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, THRALL_SHIELD_MODEL);
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, THRALL_SHIELD_INFO);
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 1038);
break;
case 10:
me->SetDisplayId(THRALL_MODEL_EQUIPPED);
break;
case 11:
SetRun();
break;
case 15:
me->SummonCreature(MOB_ENTRY_RIFLE,2200.28,137.37,87.93,5.07,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_WARDEN,2197.44,131.83,87.93,0.78,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_VETERAN,2203.62,135.40,87.93,3.70,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_VETERAN,2200.75,130.13,87.93,1.48,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 21:
me->SummonCreature(MOB_ENTRY_RIFLE,2135.80,154.01,67.45,4.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_WARDEN,2144.36,151.87,67.74,4.46,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_VETERAN,2142.12,154.41,67.12,4.56,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_VETERAN,2138.08,155.38,67.24,4.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 25:
me->SummonCreature(MOB_ENTRY_RIFLE,2102.98,192.17,65.24,6.02,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_WARDEN,2108.48,198.75,65.18,5.15,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_VETERAN,2106.11,197.29,65.18,5.63,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_VETERAN,2104.18,194.82,65.18,5.75,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 29:
DoScriptText(SAY_TH_SKARLOC_MEET, me);
me->SummonCreature(ENTRY_SCARLOC,2036.48,271.22,63.43,5.27,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
//temporary,skarloc should rather be triggered to walk up to thrall
break;
case 30:
SetEscortPaused(true);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetRun(false);
break;
case 31:
DoScriptText(SAY_TH_MOUNTS_UP, me);
DoMount();
SetRun();
break;
case 37:
//possibly regular patrollers? If so, remove this and let database handle them
me->SummonCreature(MOB_ENTRY_WATCHMAN,2124.26,522.16,56.87,3.99,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_WATCHMAN,2121.69,525.37,57.11,4.01,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_SENTRY,2124.65,524.55,56.63,3.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 59:
me->SummonCreature(SKARLOC_MOUNT,2488.64,625.77,58.26,4.71,TEMPSUMMON_TIMED_DESPAWN,10000);
DoUnmount();
HadMount = false;
SetRun(false);
break;
case 60:
me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
//make horsie run off
SetEscortPaused(true);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
pInstance->SetData(TYPE_THRALL_PART2, DONE);
SetRun();
break;
case 64:
SetRun(false);
break;
case 68:
me->SummonCreature(MOB_ENTRY_BARN_PROTECTOR,2500.22,692.60,55.50,2.84,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_BARN_LOOKOUT,2500.13,696.55,55.51,3.38,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.55,693.64,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.94,695.81,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 71:
SetRun();
break;
case 81:
SetRun(false);
break;
case 83:
me->SummonCreature(MOB_ENTRY_CHURCH_PROTECTOR,2627.33,646.82,56.03,4.28,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
me->SummonCreature(MOB_ENTRY_CHURCH_LOOKOUT,2624.14,648.03,56.03,4.50,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
me->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2625.32,649.60,56.03,4.38,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
me->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2627.22,649.00,56.03,4.34,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
break;
case 84:
DoScriptText(SAY_TH_CHURCH_END, me);
SetRun();
break;
case 91:
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
SetRun(false);
break;
case 93:
me->SummonCreature(MOB_ENTRY_INN_PROTECTOR,2652.71,660.31,61.93,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_INN_LOOKOUT,2648.96,662.59,61.93,0.79,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2657.36,662.34,61.93,2.68,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2656.39,659.77,61.93,2.61,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 94:
if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA))
{
if (Unit* Taretha = Unit::GetUnit((*me), TarethaGUID))
DoScriptText(SAY_TA_ESCAPED, Taretha, me);
}
break;
case 95:
DoScriptText(SAY_TH_MEET_TARETHA, me);
pInstance->SetData(TYPE_THRALL_PART3,DONE);
SetEscortPaused(true);
break;
case 96:
DoScriptText(SAY_TH_EPOCH_WONDER, me);
break;
case 97:
DoScriptText(SAY_TH_EPOCH_KILL_TARETHA, me);
SetRun();
break;
case 98:
//trigger epoch Yell("Thrall! Come outside and face your fate! ....")
//from here, thrall should not never be allowed to move to point 106 which he currently does.
break;
case 106:
{
//trigger taretha to run down outside
if (Creature* Taretha = pInstance->instance->GetCreature(pInstance->GetData64(DATA_TARETHA)))
{
if (Player* pPlayer = GetPlayerForEscort())
CAST_AI(npc_escortAI, (Taretha->AI()))->Start(false, true, pPlayer->GetGUID());
}
//kill credit Creature for quest
Map* pMap = me->GetMap();
Map::PlayerList const& players = pMap->GetPlayers();
if (!players.isEmpty() && pMap->IsDungeon())
{
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (Player* pPlayer = itr->getSource())
pPlayer->KilledMonsterCredit(20156,me->GetGUID());
}
}
//alot will happen here, thrall and taretha talk, erozion appear at spot to explain
me->SummonCreature(EROZION_ENTRY,2646.47,680.416,55.38,4.16,TEMPSUMMON_TIMED_DESPAWN,120000);
}
break;
case 108:
//last waypoint, just set Thrall invisible, respawn is turned off
me->SetVisibility(VISIBILITY_OFF);
break;
}
}
void Reset()
{
LowHp = false;
if (HadMount)
DoMount();
SetRun();
break;
case 37:
//possibly regular patrollers? If so, remove this and let database handle them
me->SummonCreature(MOB_ENTRY_WATCHMAN,2124.26,522.16,56.87,3.99,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_WATCHMAN,2121.69,525.37,57.11,4.01,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_SENTRY,2124.65,524.55,56.63,3.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 59:
me->SummonCreature(SKARLOC_MOUNT,2488.64,625.77,58.26,4.71,TEMPSUMMON_TIMED_DESPAWN,10000);
if (!HasEscortState(STATE_ESCORT_ESCORTING))
{
DoUnmount();
HadMount = false;
SetRun(false);
break;
case 60:
me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
//make horsie run off
SetEscortPaused(true);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
pInstance->SetData(TYPE_THRALL_PART2, DONE);
SetRun();
break;
case 64:
SetRun(false);
break;
case 68:
me->SummonCreature(MOB_ENTRY_BARN_PROTECTOR,2500.22,692.60,55.50,2.84,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_BARN_LOOKOUT,2500.13,696.55,55.51,3.38,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.55,693.64,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.94,695.81,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 71:
SetRun();
break;
case 81:
SetRun(false);
break;
case 83:
me->SummonCreature(MOB_ENTRY_CHURCH_PROTECTOR,2627.33,646.82,56.03,4.28,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
me->SummonCreature(MOB_ENTRY_CHURCH_LOOKOUT,2624.14,648.03,56.03,4.50,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
me->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2625.32,649.60,56.03,4.38,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
me->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2627.22,649.00,56.03,4.34,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
break;
case 84:
DoScriptText(SAY_TH_CHURCH_END, me);
SetRun();
break;
case 91:
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
SetRun(false);
break;
case 93:
me->SummonCreature(MOB_ENTRY_INN_PROTECTOR,2652.71,660.31,61.93,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_INN_LOOKOUT,2648.96,662.59,61.93,0.79,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2657.36,662.34,61.93,2.68,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2656.39,659.77,61.93,2.61,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 94:
if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA))
{
if (Unit* Taretha = Unit::GetUnit((*me), TarethaGUID))
DoScriptText(SAY_TA_ESCAPED, Taretha, me);
}
break;
case 95:
DoScriptText(SAY_TH_MEET_TARETHA, me);
pInstance->SetData(TYPE_THRALL_PART3,DONE);
SetEscortPaused(true);
break;
case 96:
DoScriptText(SAY_TH_EPOCH_WONDER, me);
break;
case 97:
DoScriptText(SAY_TH_EPOCH_KILL_TARETHA, me);
SetRun();
break;
case 98:
//trigger epoch Yell("Thrall! Come outside and face your fate! ....")
//from here, thrall should not never be allowed to move to point 106 which he currently does.
break;
case 106:
{
//trigger taretha to run down outside
if (Creature* Taretha = pInstance->instance->GetCreature(pInstance->GetData64(DATA_TARETHA)))
{
if (Player* pPlayer = GetPlayerForEscort())
CAST_AI(npc_escortAI, (Taretha->AI()))->Start(false, true, pPlayer->GetGUID());
}
//kill credit Creature for quest
Map* pMap = me->GetMap();
Map::PlayerList const& players = pMap->GetPlayers();
if (!players.isEmpty() && pMap->IsDungeon())
{
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (Player* pPlayer = itr->getSource())
pPlayer->KilledMonsterCredit(20156,me->GetGUID());
}
}
//alot will happen here, thrall and taretha talk, erozion appear at spot to explain
me->SummonCreature(EROZION_ENTRY,2646.47,680.416,55.38,4.16,TEMPSUMMON_TIMED_DESPAWN,120000);
}
break;
case 108:
//last waypoint, just set Thrall invisible, respawn is turned off
me->SetVisibility(VISIBILITY_OFF);
break;
}
}
void Reset()
{
LowHp = false;
if (HadMount)
DoMount();
if (!HasEscortState(STATE_ESCORT_ESCORTING))
{
DoUnmount();
HadMount = false;
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
me->SetDisplayId(THRALL_MODEL_UNEQUIPPED);
}
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
DoScriptText(RAND(SAY_TH_LEAVE_COMBAT1,SAY_TH_LEAVE_COMBAT2,SAY_TH_LEAVE_COMBAT3), me);
}
}
void StartWP()
{
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetEscortPaused(false);
}
void DoMount()
{
me->Mount(SKARLOC_MOUNT_MODEL);
me->SetSpeed(MOVE_RUN,SPEED_MOUNT);
}
void DoUnmount()
{
me->Unmount();
me->SetSpeed(MOVE_RUN,SPEED_RUN);
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(RAND(SAY_TH_RANDOM_AGGRO1,SAY_TH_RANDOM_AGGRO2,SAY_TH_RANDOM_AGGRO3,SAY_TH_RANDOM_AGGRO4), me);
if (me->IsMounted())
{
DoUnmount();
HadMount = true;
}
}
void JustSummoned(Creature* summoned)
{
switch(summoned->GetEntry())
{
//TODO: make Scarloc start into event instead, and not start attack directly
case MOB_ENTRY_BARN_GUARDSMAN:
case MOB_ENTRY_BARN_PROTECTOR:
case MOB_ENTRY_BARN_LOOKOUT:
case SKARLOC_MOUNT:
case EROZION_ENTRY:
break;
default:
summoned->AI()->AttackStart(me);
break;
}
}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_TH_RANDOM_KILL1,SAY_TH_RANDOM_KILL2,SAY_TH_RANDOM_KILL3), me);
}
void JustDied(Unit *slayer)
{
if (pInstance)
pInstance->SetData(TYPE_THRALL_EVENT,FAIL);
// Don't do a yell if he kills self (if player goes too far or at the end).
if (slayer == me)
return;
DoScriptText(RAND(SAY_TH_RANDOM_DIE1,SAY_TH_RANDOM_DIE2), me);
}
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
if (!UpdateVictim())
return;
//TODO: add his abilities'n-crap here
if (!LowHp && ((me->GetHealth()*100 / me->GetMaxHealth()) < 20))
{
DoScriptText(RAND(SAY_TH_RANDOM_LOW_HP1,SAY_TH_RANDOM_LOW_HP2), me);
LowHp = true;
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
me->SetDisplayId(THRALL_MODEL_UNEQUIPPED);
}
}
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
DoScriptText(RAND(SAY_TH_LEAVE_COMBAT1,SAY_TH_LEAVE_COMBAT2,SAY_TH_LEAVE_COMBAT3), me);
}
}
void StartWP()
{
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetEscortPaused(false);
}
void DoMount()
{
me->Mount(SKARLOC_MOUNT_MODEL);
me->SetSpeed(MOVE_RUN,SPEED_MOUNT);
}
void DoUnmount()
{
me->Unmount();
me->SetSpeed(MOVE_RUN,SPEED_RUN);
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(RAND(SAY_TH_RANDOM_AGGRO1,SAY_TH_RANDOM_AGGRO2,SAY_TH_RANDOM_AGGRO3,SAY_TH_RANDOM_AGGRO4), me);
if (me->IsMounted())
{
DoUnmount();
HadMount = true;
}
}
void JustSummoned(Creature* summoned)
{
switch(summoned->GetEntry())
{
//TODO: make Scarloc start into event instead, and not start attack directly
case MOB_ENTRY_BARN_GUARDSMAN:
case MOB_ENTRY_BARN_PROTECTOR:
case MOB_ENTRY_BARN_LOOKOUT:
case SKARLOC_MOUNT:
case EROZION_ENTRY:
break;
default:
summoned->AI()->AttackStart(me);
break;
}
}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_TH_RANDOM_KILL1,SAY_TH_RANDOM_KILL2,SAY_TH_RANDOM_KILL3), me);
}
void JustDied(Unit *slayer)
{
if (pInstance)
pInstance->SetData(TYPE_THRALL_EVENT,FAIL);
// Don't do a yell if he kills self (if player goes too far or at the end).
if (slayer == me)
return;
DoScriptText(RAND(SAY_TH_RANDOM_DIE1,SAY_TH_RANDOM_DIE2), me);
}
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
if (!UpdateVictim())
return;
//TODO: add his abilities'n-crap here
if (!LowHp && ((me->GetHealth()*100 / me->GetMaxHealth()) < 20))
{
DoScriptText(RAND(SAY_TH_RANDOM_LOW_HP1,SAY_TH_RANDOM_LOW_HP2), me);
LowHp = true;
}
}
};
};
CreatureAI* GetAI_npc_thrall_old_hillsbrad(Creature* pCreature)
{
return new npc_thrall_old_hillsbradAI(pCreature);
}
bool GossipHello_npc_thrall_old_hillsbrad(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
{
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
pPlayer->SendPreparedQuest(pCreature->GetGUID());
}
ScriptedInstance* pInstance = pCreature->GetInstanceData();
if (pInstance)
{
if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE && !pInstance->GetData(TYPE_THRALL_EVENT))
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_WALKING, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_START, pCreature->GetGUID());
}
if (pInstance->GetData(TYPE_THRALL_PART1) == DONE && !pInstance->GetData(TYPE_THRALL_PART2))
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC1, pCreature->GetGUID());
}
if (pInstance->GetData(TYPE_THRALL_PART2) == DONE && !pInstance->GetData(TYPE_THRALL_PART3))
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TARREN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_TARREN, pCreature->GetGUID());
}
}
return true;
}
bool GossipSelect_npc_thrall_old_hillsbrad(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
ScriptedInstance* pInstance = pCreature->GetInstanceData();
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
pPlayer->CLOSE_GOSSIP_MENU();
if (pInstance)
{
pInstance->SetData(TYPE_THRALL_EVENT,IN_PROGRESS);
pInstance->SetData(TYPE_THRALL_PART1,IN_PROGRESS);
}
DoScriptText(SAY_TH_START_EVENT_PART1, pCreature);
if (npc_escortAI* pEscortAI = CAST_AI(npc_thrall_old_hillsbradAI, pCreature->AI()))
pEscortAI->Start(true, true, pPlayer->GetGUID());
CAST_AI(npc_escortAI, (pCreature->AI()))->SetMaxPlayerDistance(100.0f);//not really needed, because it will not despawn if player is too far
CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtEnd(false);
CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtFar(false);
break;
case GOSSIP_ACTION_INFO_DEF+2:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC2, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+20:
pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC3, pCreature->GetGUID());
pCreature->SummonCreature(SKARLOC_MOUNT,2038.81,270.26,63.20,5.41,TEMPSUMMON_TIMED_DESPAWN,12000);
if (pInstance)
pInstance->SetData(TYPE_THRALL_PART2,IN_PROGRESS);
DoScriptText(SAY_TH_START_EVENT_PART2, pCreature);
CAST_AI(npc_thrall_old_hillsbradAI, pCreature->AI())->StartWP();
break;
case GOSSIP_ACTION_INFO_DEF+3:
pPlayer->CLOSE_GOSSIP_MENU();
if (pInstance)
pInstance->SetData(TYPE_THRALL_PART3,IN_PROGRESS);
CAST_AI(npc_thrall_old_hillsbradAI, pCreature->AI())->StartWP();
break;
}
return true;
}
/*######
## npc_taretha
@@ -554,80 +570,89 @@ bool GossipSelect_npc_thrall_old_hillsbrad(Player* pPlayer, Creature* pCreature,
#define GOSSIP_ITEM_EPOCH1 "Strange wizard?"
#define GOSSIP_ID_EPOCH2 9613 //Yes, friends. This man was no wizard of
#define GOSSIP_ITEM_EPOCH2 "We'll get you out. Taretha. Don't worry. I doubt the wizard would wander too far away."
struct npc_tarethaAI : public npc_escortAI
class npc_taretha : public CreatureScript
{
npc_tarethaAI(Creature *c) : npc_escortAI(c)
public:
npc_taretha() : CreatureScript("npc_taretha") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
return new npc_tarethaAI(pCreature);
}
ScriptedInstance *pInstance;
void WaypointReached(uint32 i)
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
switch(i)
InstanceScript* pInstance = pCreature->GetInstanceScript();
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
{
case 6:
DoScriptText(SAY_TA_FREE, me);
break;
case 7:
me->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
break;
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH2, pCreature->GetGUID());
}
}
void Reset() {}
void EnterCombat(Unit* /*who*/) {}
if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
{
pPlayer->CLOSE_GOSSIP_MENU();
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
{
pInstance->SetData(TYPE_THRALL_PART4,IN_PROGRESS);
if (pInstance->GetData64(DATA_EPOCH) == 0)
pCreature->SummonCreature(ENTRY_EPOCH,2639.13,698.55,65.43,4.59,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000);
if (uint64 ThrallGUID = pInstance->GetData64(DATA_THRALL))
{
Creature* Thrall = (Unit::GetCreature((*pCreature), ThrallGUID));
if (Thrall)
CAST_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, Thrall->AI())->StartWP();
}
}
}
return true;
}
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
InstanceScript* pInstance = pCreature->GetInstanceScript();
if (pInstance && pInstance->GetData(TYPE_THRALL_PART3) == DONE && pInstance->GetData(TYPE_THRALL_PART4) == NOT_STARTED)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH1, pCreature->GetGUID());
}
return true;
}
struct npc_tarethaAI : public npc_escortAI
{
npc_tarethaAI(Creature *c) : npc_escortAI(c)
{
pInstance = c->GetInstanceScript();
}
InstanceScript *pInstance;
void WaypointReached(uint32 i)
{
switch(i)
{
case 6:
DoScriptText(SAY_TA_FREE, me);
break;
case 7:
me->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
break;
}
}
void Reset() {}
void EnterCombat(Unit* /*who*/) {}
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
}
};
};
CreatureAI* GetAI_npc_taretha(Creature* pCreature)
{
return new npc_tarethaAI(pCreature);
}
bool GossipHello_npc_taretha(Player* pPlayer, Creature* pCreature)
{
ScriptedInstance* pInstance = pCreature->GetInstanceData();
if (pInstance && pInstance->GetData(TYPE_THRALL_PART3) == DONE && pInstance->GetData(TYPE_THRALL_PART4) == NOT_STARTED)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH1, pCreature->GetGUID());
}
return true;
}
bool GossipSelect_npc_taretha(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
ScriptedInstance* pInstance = pCreature->GetInstanceData();
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH2, pCreature->GetGUID());
}
if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
{
pPlayer->CLOSE_GOSSIP_MENU();
if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
{
pInstance->SetData(TYPE_THRALL_PART4,IN_PROGRESS);
if (pInstance->GetData64(DATA_EPOCH) == 0)
pCreature->SummonCreature(ENTRY_EPOCH,2639.13,698.55,65.43,4.59,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000);
if (uint64 ThrallGUID = pInstance->GetData64(DATA_THRALL))
{
Creature* Thrall = (Unit::GetCreature((*pCreature), ThrallGUID));
if (Thrall)
CAST_AI(npc_thrall_old_hillsbradAI, Thrall->AI())->StartWP();
}
}
}
return true;
}
/*######
## AddSC
@@ -635,26 +660,7 @@ bool GossipSelect_npc_taretha(Player* pPlayer, Creature* pCreature, uint32 /*uiS
void AddSC_old_hillsbrad()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_erozion";
newscript->pGossipHello = &GossipHello_npc_erozion;
newscript->pGossipSelect = &GossipSelect_npc_erozion;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_thrall_old_hillsbrad";
newscript->pGossipHello = &GossipHello_npc_thrall_old_hillsbrad;
newscript->pGossipSelect = &GossipSelect_npc_thrall_old_hillsbrad;
newscript->GetAI = &GetAI_npc_thrall_old_hillsbrad;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_taretha";
newscript->pGossipHello = &GossipHello_npc_taretha;
newscript->pGossipSelect = &GossipSelect_npc_taretha;
newscript->GetAI = &GetAI_npc_taretha;
newscript->RegisterSelf();
new npc_erozion();
new npc_thrall_old_hillsbrad();
new npc_taretha();
}