Convert Ahnkahet, Azjol-Nerub, Drak'tharon Keep, and Forge of Souls to the new format.

--HG--
branch : trunk
This commit is contained in:
silinoron
2010-08-07 16:03:37 -07:00
parent c260b3f778
commit 1bc8730b33
19 changed files with 4570 additions and 4514 deletions

View File

@@ -86,274 +86,275 @@ const Position SpawnPointGuardian[2] =
{ 550.188660, 324.264557, 237.7412 },
};
struct boss_anub_arakAI : public ScriptedAI
class boss_anub_arak : public CreatureScript
{
boss_anub_arakAI(Creature *c) : ScriptedAI(c), lSummons(me)
public:
boss_anub_arak() : CreatureScript("boss_anub_arak") { }
struct boss_anub_arakAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
}
ScriptedInstance *pInstance;
bool bChanneling;
bool bGuardianSummoned;
bool bVenomancerSummoned;
bool bDatterSummoned;
uint8 uiPhase;
uint32 uiUndergroundPhase;
uint32 uiCarrionBeetlesTimer;
uint32 uiLeechingSwarmTimer;
uint32 uiPoundTimer;
uint32 uiSubmergeTimer;
uint32 uiUndergroundTimer;
uint32 uiVenomancerTimer;
uint32 uiDatterTimer;
uint32 uiImpaleTimer;
uint32 uiImpalePhase;
uint64 uiImpaleTarget;
SummonList lSummons;
void Reset()
{
uiCarrionBeetlesTimer = 8*IN_MILLISECONDS;
uiLeechingSwarmTimer = 20*IN_MILLISECONDS;
uiImpaleTimer = 9*IN_MILLISECONDS;
uiPoundTimer = 15*IN_MILLISECONDS;
uiPhase = PHASE_MELEE;
uiUndergroundPhase = 0;
bChanneling = false;
uiImpalePhase = IMPALE_PHASE_TARGET;
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
me->RemoveAura(SPELL_SUBMERGE);
lSummons.DespawnAll();
if (pInstance)
boss_anub_arakAI(Creature *c) : ScriptedAI(c), lSummons(me)
{
pInstance->SetData(DATA_ANUBARAK_EVENT, NOT_STARTED);
pInstance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
}
}
Creature* DoSummonImpaleTarget(Unit *pTarget)
{
Position targetPos;
pTarget->GetPosition(&targetPos);
if (TempSummon* pImpaleTarget = me->SummonCreature(CREATURE_IMPALE_TARGET, targetPos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 6*IN_MILLISECONDS))
{
uiImpaleTarget = pImpaleTarget->GetGUID();
pImpaleTarget->SetReactState(REACT_PASSIVE);
pImpaleTarget->SetDisplayId(DISPLAY_INVISIBLE);
pImpaleTarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE|UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
return pImpaleTarget;
pInstance = c->GetInstanceData();
}
return NULL;
}
ScriptedInstance *pInstance;
void EnterCombat(Unit * /*pWho*/)
{
DoScriptText(SAY_AGGRO, me);
if (pInstance)
bool bChanneling;
bool bGuardianSummoned;
bool bVenomancerSummoned;
bool bDatterSummoned;
uint8 uiPhase;
uint32 uiUndergroundPhase;
uint32 uiCarrionBeetlesTimer;
uint32 uiLeechingSwarmTimer;
uint32 uiPoundTimer;
uint32 uiSubmergeTimer;
uint32 uiUndergroundTimer;
uint32 uiVenomancerTimer;
uint32 uiDatterTimer;
uint32 uiImpaleTimer;
uint32 uiImpalePhase;
uint64 uiImpaleTarget;
SummonList lSummons;
void Reset()
{
pInstance->SetData(DATA_ANUBARAK_EVENT, IN_PROGRESS);
pInstance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
}
}
uiCarrionBeetlesTimer = 8*IN_MILLISECONDS;
uiLeechingSwarmTimer = 20*IN_MILLISECONDS;
uiImpaleTimer = 9*IN_MILLISECONDS;
uiPoundTimer = 15*IN_MILLISECONDS;
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
uiPhase = PHASE_MELEE;
uiUndergroundPhase = 0;
bChanneling = false;
uiImpalePhase = IMPALE_PHASE_TARGET;
switch (uiPhase)
{
case PHASE_UNDERGROUND:
if (uiImpaleTimer <= diff)
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
me->RemoveAura(SPELL_SUBMERGE);
lSummons.DespawnAll();
if (pInstance)
{
switch(uiImpalePhase)
{
case IMPALE_PHASE_TARGET:
if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
pInstance->SetData(DATA_ANUBARAK_EVENT, NOT_STARTED);
pInstance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
}
}
Creature* DoSummonImpaleTarget(Unit *pTarget)
{
Position targetPos;
pTarget->GetPosition(&targetPos);
if (TempSummon* pImpaleTarget = me->SummonCreature(CREATURE_IMPALE_TARGET, targetPos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 6*IN_MILLISECONDS))
{
uiImpaleTarget = pImpaleTarget->GetGUID();
pImpaleTarget->SetReactState(REACT_PASSIVE);
pImpaleTarget->SetDisplayId(DISPLAY_INVISIBLE);
pImpaleTarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE|UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
return pImpaleTarget;
}
return NULL;
}
void EnterCombat(Unit * /*pWho*/)
{
DoScriptText(SAY_AGGRO, me);
if (pInstance)
{
pInstance->SetData(DATA_ANUBARAK_EVENT, IN_PROGRESS);
pInstance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
}
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
switch (uiPhase)
{
case PHASE_UNDERGROUND:
if (uiImpaleTimer <= diff)
{
switch(uiImpalePhase)
{
case IMPALE_PHASE_TARGET:
if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
if (Creature *pImpaleTarget = DoSummonImpaleTarget(target))
pImpaleTarget->CastSpell(pImpaleTarget, SPELL_IMPALE_SHAKEGROUND, true);
uiImpaleTimer = 3*IN_MILLISECONDS;
uiImpalePhase = IMPALE_PHASE_ATTACK;
}
break;
case IMPALE_PHASE_ATTACK:
if (Creature* pImpaleTarget = Unit::GetCreature(*me, uiImpaleTarget))
{
pImpaleTarget->CastSpell(pImpaleTarget, SPELL_IMPALE_SPIKE, false);
pImpaleTarget->RemoveAurasDueToSpell(SPELL_IMPALE_SHAKEGROUND);
}
uiImpalePhase = IMPALE_PHASE_DMG;
uiImpaleTimer = 1*IN_MILLISECONDS;
break;
case IMPALE_PHASE_DMG:
if (Creature* pImpaleTarget = Unit::GetCreature(*me, uiImpaleTarget))
me->CastSpell(pImpaleTarget, DUNGEON_MODE(SPELL_IMPALE_DMG, SPELL_IMPALE_DMG_H), true);
uiImpalePhase = IMPALE_PHASE_TARGET;
uiImpaleTimer = 9*IN_MILLISECONDS;
break;
}
} else uiImpaleTimer -= diff;
if (!bGuardianSummoned)
{
for (uint8 i = 0; i < 2; ++i)
{
if (Creature *Guardian = me->SummonCreature(CREATURE_GUARDIAN,SpawnPointGuardian[i],TEMPSUMMON_CORPSE_DESPAWN,0))
{
Guardian->AddThreat(me->getVictim(), 0.0f);
DoZoneInCombat(Guardian);
}
}
bGuardianSummoned = true;
}
if (!bVenomancerSummoned)
{
if (uiVenomancerTimer <= diff)
{
if (uiUndergroundPhase > 1)
{
for (uint8 i = 0; i < 2; ++i)
{
if (Creature *Venomancer = me->SummonCreature(CREATURE_VENOMANCER,SpawnPoint[i],TEMPSUMMON_CORPSE_DESPAWN,0))
{
Venomancer->AddThreat(me->getVictim(), 0.0f);
DoZoneInCombat(Venomancer);
}
}
bVenomancerSummoned = true;
}
} else uiVenomancerTimer -= diff;
}
if (!bDatterSummoned)
{
if (uiDatterTimer <= diff)
{
if (uiUndergroundPhase > 2)
{
for (uint8 i = 0; i < 2; ++i)
{
if (Creature *Datter = me->SummonCreature(CREATURE_DATTER,SpawnPoint[i],TEMPSUMMON_CORPSE_DESPAWN,0))
{
Datter->AddThreat(me->getVictim(), 0.0f);
DoZoneInCombat(Datter);
}
}
bDatterSummoned = true;
}
} else uiDatterTimer -= diff;
}
if (uiUndergroundTimer <= diff)
{
me->RemoveAura(SPELL_SUBMERGE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
uiPhase = PHASE_MELEE;
} else uiUndergroundTimer -= diff;
break;
case PHASE_MELEE:
if (((uiUndergroundPhase == 0 && HealthBelowPct(75))
|| (uiUndergroundPhase == 1 && HealthBelowPct(50))
|| (uiUndergroundPhase == 2 && HealthBelowPct(25)))
&& !me->hasUnitState(UNIT_STAT_CASTING))
{
bGuardianSummoned = false;
bVenomancerSummoned = false;
bDatterSummoned = false;
uiUndergroundTimer = 40*IN_MILLISECONDS;
uiVenomancerTimer = 25*IN_MILLISECONDS;
uiDatterTimer = 32*IN_MILLISECONDS;
uiImpalePhase = 0;
uiImpaleTimer = 9*IN_MILLISECONDS;
DoCast(me, SPELL_SUBMERGE, false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
uiPhase = PHASE_UNDERGROUND;
++uiUndergroundPhase;
}
if (bChanneling == true)
{
for (uint8 i = 0; i < 8; ++i)
DoCast(me->getVictim(), SPELL_SUMMON_CARRION_BEETLES, true);
bChanneling = false;
}
else if (uiCarrionBeetlesTimer <= diff)
{
bChanneling = true;
DoCastVictim(SPELL_CARRION_BEETLES);
uiCarrionBeetlesTimer = 25*IN_MILLISECONDS;
} else uiCarrionBeetlesTimer -= diff;
if (uiLeechingSwarmTimer <= diff)
{
DoCast(me, SPELL_LEECHING_SWARM, true);
uiLeechingSwarmTimer = 19*IN_MILLISECONDS;
} else uiLeechingSwarmTimer -= diff;
if (uiPoundTimer <= diff)
{
if (Unit *target = me->getVictim())
{
if (Creature *pImpaleTarget = DoSummonImpaleTarget(target))
pImpaleTarget->CastSpell(pImpaleTarget, SPELL_IMPALE_SHAKEGROUND, true);
uiImpaleTimer = 3*IN_MILLISECONDS;
uiImpalePhase = IMPALE_PHASE_ATTACK;
me->CastSpell(pImpaleTarget, DUNGEON_MODE(SPELL_POUND, SPELL_POUND_H), false);
}
break;
case IMPALE_PHASE_ATTACK:
if (Creature* pImpaleTarget = Unit::GetCreature(*me, uiImpaleTarget))
{
pImpaleTarget->CastSpell(pImpaleTarget, SPELL_IMPALE_SPIKE, false);
pImpaleTarget->RemoveAurasDueToSpell(SPELL_IMPALE_SHAKEGROUND);
}
uiImpalePhase = IMPALE_PHASE_DMG;
uiImpaleTimer = 1*IN_MILLISECONDS;
break;
case IMPALE_PHASE_DMG:
if (Creature* pImpaleTarget = Unit::GetCreature(*me, uiImpaleTarget))
me->CastSpell(pImpaleTarget, DUNGEON_MODE(SPELL_IMPALE_DMG, SPELL_IMPALE_DMG_H), true);
uiImpalePhase = IMPALE_PHASE_TARGET;
uiImpaleTimer = 9*IN_MILLISECONDS;
break;
}
} else uiImpaleTimer -= diff;
uiPoundTimer = 16.5*IN_MILLISECONDS;
} else uiPoundTimer -= diff;
if (!bGuardianSummoned)
{
for (uint8 i = 0; i < 2; ++i)
{
if (Creature *Guardian = me->SummonCreature(CREATURE_GUARDIAN,SpawnPointGuardian[i],TEMPSUMMON_CORPSE_DESPAWN,0))
{
Guardian->AddThreat(me->getVictim(), 0.0f);
DoZoneInCombat(Guardian);
}
}
bGuardianSummoned = true;
DoMeleeAttackIfReady();
break;
}
if (!bVenomancerSummoned)
{
if (uiVenomancerTimer <= diff)
{
if (uiUndergroundPhase > 1)
{
for (uint8 i = 0; i < 2; ++i)
{
if (Creature *Venomancer = me->SummonCreature(CREATURE_VENOMANCER,SpawnPoint[i],TEMPSUMMON_CORPSE_DESPAWN,0))
{
Venomancer->AddThreat(me->getVictim(), 0.0f);
DoZoneInCombat(Venomancer);
}
}
bVenomancerSummoned = true;
}
} else uiVenomancerTimer -= diff;
}
if (!bDatterSummoned)
{
if (uiDatterTimer <= diff)
{
if (uiUndergroundPhase > 2)
{
for (uint8 i = 0; i < 2; ++i)
{
if (Creature *Datter = me->SummonCreature(CREATURE_DATTER,SpawnPoint[i],TEMPSUMMON_CORPSE_DESPAWN,0))
{
Datter->AddThreat(me->getVictim(), 0.0f);
DoZoneInCombat(Datter);
}
}
bDatterSummoned = true;
}
} else uiDatterTimer -= diff;
}
if (uiUndergroundTimer <= diff)
{
me->RemoveAura(SPELL_SUBMERGE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
uiPhase = PHASE_MELEE;
} else uiUndergroundTimer -= diff;
break;
case PHASE_MELEE:
if (((uiUndergroundPhase == 0 && HealthBelowPct(75))
|| (uiUndergroundPhase == 1 && HealthBelowPct(50))
|| (uiUndergroundPhase == 2 && HealthBelowPct(25)))
&& !me->hasUnitState(UNIT_STAT_CASTING))
{
bGuardianSummoned = false;
bVenomancerSummoned = false;
bDatterSummoned = false;
uiUndergroundTimer = 40*IN_MILLISECONDS;
uiVenomancerTimer = 25*IN_MILLISECONDS;
uiDatterTimer = 32*IN_MILLISECONDS;
uiImpalePhase = 0;
uiImpaleTimer = 9*IN_MILLISECONDS;
DoCast(me, SPELL_SUBMERGE, false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
uiPhase = PHASE_UNDERGROUND;
++uiUndergroundPhase;
}
if (bChanneling == true)
{
for (uint8 i = 0; i < 8; ++i)
DoCast(me->getVictim(), SPELL_SUMMON_CARRION_BEETLES, true);
bChanneling = false;
}
else if (uiCarrionBeetlesTimer <= diff)
{
bChanneling = true;
DoCastVictim(SPELL_CARRION_BEETLES);
uiCarrionBeetlesTimer = 25*IN_MILLISECONDS;
} else uiCarrionBeetlesTimer -= diff;
if (uiLeechingSwarmTimer <= diff)
{
DoCast(me, SPELL_LEECHING_SWARM, true);
uiLeechingSwarmTimer = 19*IN_MILLISECONDS;
} else uiLeechingSwarmTimer -= diff;
if (uiPoundTimer <= diff)
{
if (Unit *target = me->getVictim())
{
if (Creature *pImpaleTarget = DoSummonImpaleTarget(target))
me->CastSpell(pImpaleTarget, DUNGEON_MODE(SPELL_POUND, SPELL_POUND_H), false);
}
uiPoundTimer = 16.5*IN_MILLISECONDS;
} else uiPoundTimer -= diff;
DoMeleeAttackIfReady();
break;
}
}
void JustDied(Unit * /*pKiller*/)
{
DoScriptText(SAY_DEATH, me);
lSummons.DespawnAll();
if (pInstance)
pInstance->SetData(DATA_ANUBARAK_EVENT, DONE);
}
void JustDied(Unit * /*pKiller*/)
{
DoScriptText(SAY_DEATH, me);
lSummons.DespawnAll();
if (pInstance)
pInstance->SetData(DATA_ANUBARAK_EVENT, DONE);
}
void KilledUnit(Unit *pVictim)
{
if (pVictim == me)
return;
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
void KilledUnit(Unit *pVictim)
{
if (pVictim == me)
return;
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
void JustSummoned(Creature* summon)
void JustSummoned(Creature* summon)
{
lSummons.Summon(summon);
}
};
CreatureAI *GetAI(Creature *creature) const
{
lSummons.Summon(summon);
return new boss_anub_arakAI(creature);
}
};
CreatureAI* GetAI_boss_anub_arak(Creature *pCreature)
{
return new boss_anub_arakAI (pCreature);
}
void AddSC_boss_anub_arak()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_anub_arak";
newscript->GetAI = &GetAI_boss_anub_arak;
newscript->RegisterSelf();
new boss_anub_arak;
}

View File

@@ -44,162 +44,162 @@ enum Spells
H_SPELL_WEB_GRAB = 59421
};
struct boss_hadronoxAI : public ScriptedAI
class boss_hadronox : public CreatureScript
{
boss_hadronoxAI(Creature* c) : ScriptedAI(c)
public:
boss_hadronox() : CreatureScript("boss_hadronox") { }
struct boss_hadronoxAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
fMaxDistance = 50.0f;
bFirstTime = true;
}
ScriptedInstance* pInstance;
uint32 uiAcidTimer;
uint32 uiLeechTimer;
uint32 uiPierceTimer;
uint32 uiGrabTimer;
uint32 uiDoorsTimer;
uint32 uiCheckDistanceTimer;
bool bFirstTime;
float fMaxDistance;
void Reset()
{
me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 9.0f);
me->SetFloatValue(UNIT_FIELD_COMBATREACH, 9.0f);
uiAcidTimer = urand(10*IN_MILLISECONDS,14*IN_MILLISECONDS);
uiLeechTimer = urand(3*IN_MILLISECONDS,9*IN_MILLISECONDS);
uiPierceTimer = urand(1*IN_MILLISECONDS,3*IN_MILLISECONDS);
uiGrabTimer = urand(15*IN_MILLISECONDS,19*IN_MILLISECONDS);
uiDoorsTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS);
uiCheckDistanceTimer = 2*IN_MILLISECONDS;
if (pInstance && (pInstance->GetData(DATA_HADRONOX_EVENT) != DONE && !bFirstTime))
pInstance->SetData(DATA_HADRONOX_EVENT, FAIL);
bFirstTime = false;
}
//when Hadronox kills any enemy (that includes a party member) she will regain 10% of her HP if the target had Leech Poison on
void KilledUnit(Unit* Victim)
{
// not sure if this aura check is correct, I think it is though
if (!Victim || !Victim->HasAura(DUNGEON_MODE(SPELL_LEECH_POISON, H_SPELL_LEECH_POISON)) || !me->isAlive())
return;
uint32 health = me->GetMaxHealth()/10;
if ((me->GetHealth()+health) >= me->GetMaxHealth())
me->SetHealth(me->GetMaxHealth());
else
me->SetHealth(me->GetHealth()+health);
}
void JustDied(Unit* /*Killer*/)
{
if (pInstance)
pInstance->SetData(DATA_HADRONOX_EVENT, DONE);
}
void EnterCombat(Unit* /*who*/)
{
if (pInstance)
pInstance->SetData(DATA_HADRONOX_EVENT, IN_PROGRESS);
me->SetInCombatWithZone();
}
void CheckDistance(float dist, const uint32 uiDiff)
{
if (!me->isInCombat())
return;
float x=0.0f, y=0.0f, z=0.0f;
me->GetRespawnCoord(x,y,z);
if (uiCheckDistanceTimer <= uiDiff)
uiCheckDistanceTimer = 5*IN_MILLISECONDS;
else
boss_hadronoxAI(Creature* c) : ScriptedAI(c)
{
uiCheckDistanceTimer -= uiDiff;
return;
pInstance = c->GetInstanceData();
fMaxDistance = 50.0f;
bFirstTime = true;
}
if (me->IsInEvadeMode() || !me->getVictim())
return;
if (me->GetDistance(x,y,z) > dist)
EnterEvadeMode();
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim()) return;
ScriptedInstance* pInstance;
// Without he comes up through the air to players on the bridge after krikthir if players crossing this bridge!
CheckDistance(fMaxDistance, diff);
uint32 uiAcidTimer;
uint32 uiLeechTimer;
uint32 uiPierceTimer;
uint32 uiGrabTimer;
uint32 uiDoorsTimer;
uint32 uiCheckDistanceTimer;
if (me->HasAura(SPELL_WEB_FRONT_DOORS) || me->HasAura(SPELL_WEB_SIDE_DOORS))
bool bFirstTime;
float fMaxDistance;
void Reset()
{
if (IsCombatMovement())
SetCombatMovement(false);
me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 9.0f);
me->SetFloatValue(UNIT_FIELD_COMBATREACH, 9.0f);
uiAcidTimer = urand(10*IN_MILLISECONDS,14*IN_MILLISECONDS);
uiLeechTimer = urand(3*IN_MILLISECONDS,9*IN_MILLISECONDS);
uiPierceTimer = urand(1*IN_MILLISECONDS,3*IN_MILLISECONDS);
uiGrabTimer = urand(15*IN_MILLISECONDS,19*IN_MILLISECONDS);
uiDoorsTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS);
uiCheckDistanceTimer = 2*IN_MILLISECONDS;
if (pInstance && (pInstance->GetData(DATA_HADRONOX_EVENT) != DONE && !bFirstTime))
pInstance->SetData(DATA_HADRONOX_EVENT, FAIL);
bFirstTime = false;
}
else if (!IsCombatMovement())
SetCombatMovement(true);
if (uiPierceTimer <= diff)
//when Hadronox kills any enemy (that includes a party member) she will regain 10% of her HP if the target had Leech Poison on
void KilledUnit(Unit* Victim)
{
DoCast(me->getVictim(), SPELL_PIERCE_ARMOR);
uiPierceTimer = 8*IN_MILLISECONDS;
} else uiPierceTimer -= diff;
// not sure if this aura check is correct, I think it is though
if (!Victim || !Victim->HasAura(DUNGEON_MODE(SPELL_LEECH_POISON, H_SPELL_LEECH_POISON)) || !me->isAlive())
return;
if (uiAcidTimer <= diff)
uint32 health = me->GetMaxHealth()/10;
if ((me->GetHealth()+health) >= me->GetMaxHealth())
me->SetHealth(me->GetMaxHealth());
else
me->SetHealth(me->GetHealth()+health);
}
void JustDied(Unit* /*Killer*/)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_ACID_CLOUD);
if (pInstance)
pInstance->SetData(DATA_HADRONOX_EVENT, DONE);
}
uiAcidTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS);
} else uiAcidTimer -= diff;
if (uiLeechTimer <= diff)
void EnterCombat(Unit* /*who*/)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_LEECH_POISON);
if (pInstance)
pInstance->SetData(DATA_HADRONOX_EVENT, IN_PROGRESS);
me->SetInCombatWithZone();
}
uiLeechTimer = urand(11*IN_MILLISECONDS,14*IN_MILLISECONDS);
} else uiLeechTimer -= diff;
if (uiGrabTimer <= diff)
void CheckDistance(float dist, const uint32 uiDiff)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) // Draws all players (and attacking Mobs) to itself.
DoCast(pTarget, SPELL_WEB_GRAB);
if (!me->isInCombat())
return;
uiGrabTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS);
} else uiGrabTimer -= diff;
float x=0.0f, y=0.0f, z=0.0f;
me->GetRespawnCoord(x,y,z);
if (uiDoorsTimer <= diff)
if (uiCheckDistanceTimer <= uiDiff)
uiCheckDistanceTimer = 5*IN_MILLISECONDS;
else
{
uiCheckDistanceTimer -= uiDiff;
return;
}
if (me->IsInEvadeMode() || !me->getVictim())
return;
if (me->GetDistance(x,y,z) > dist)
EnterEvadeMode();
}
void UpdateAI(const uint32 diff)
{
//DoCast(me, RAND(SPELL_WEB_FRONT_DOORS, SPELL_WEB_SIDE_DOORS));
uiDoorsTimer = urand(30*IN_MILLISECONDS,60*IN_MILLISECONDS);
} else uiDoorsTimer -= diff;
//Return since we have no target
if (!UpdateVictim()) return;
DoMeleeAttackIfReady();
// Without he comes up through the air to players on the bridge after krikthir if players crossing this bridge!
CheckDistance(fMaxDistance, diff);
if (me->HasAura(SPELL_WEB_FRONT_DOORS) || me->HasAura(SPELL_WEB_SIDE_DOORS))
{
if (IsCombatMovement())
SetCombatMovement(false);
}
else if (!IsCombatMovement())
SetCombatMovement(true);
if (uiPierceTimer <= diff)
{
DoCast(me->getVictim(), SPELL_PIERCE_ARMOR);
uiPierceTimer = 8*IN_MILLISECONDS;
} else uiPierceTimer -= diff;
if (uiAcidTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_ACID_CLOUD);
uiAcidTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS);
} else uiAcidTimer -= diff;
if (uiLeechTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_LEECH_POISON);
uiLeechTimer = urand(11*IN_MILLISECONDS,14*IN_MILLISECONDS);
} else uiLeechTimer -= diff;
if (uiGrabTimer <= diff)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) // Draws all players (and attacking Mobs) to itself.
DoCast(pTarget, SPELL_WEB_GRAB);
uiGrabTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS);
} else uiGrabTimer -= diff;
if (uiDoorsTimer <= diff)
{
uiDoorsTimer = urand(30*IN_MILLISECONDS,60*IN_MILLISECONDS);
} else uiDoorsTimer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new boss_hadronoxAI(creature);
}
};
CreatureAI* GetAI_boss_hadronox(Creature* pCreature)
{
return new boss_hadronoxAI (pCreature);
}
void AddSC_boss_hadronox()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_hadronox";
newscript->GetAI = &GetAI_boss_hadronox;
newscript->RegisterSelf();
new boss_hadronox;
}

View File

@@ -91,462 +91,475 @@ const Position SpawnPoint[] =
{ 504.01, 637.693, 777.479, 0.506145 },
{ 552.625, 706.408, 777.177, 3.4383 }
};
struct boss_krik_thirAI : public ScriptedAI
class boss_krik_thir : public CreatureScript
{
boss_krik_thirAI(Creature *c) : ScriptedAI(c)
public:
boss_krik_thir() : CreatureScript("boss_krik_thir") { }
struct boss_krik_thirAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
uint32 uiMindFlayTimer;
uint32 uiCurseFatigueTimer;
uint32 uiSummonTimer;
void Reset()
{
uiMindFlayTimer = 15*IN_MILLISECONDS;
uiCurseFatigueTimer = 12*IN_MILLISECONDS;
if (pInstance)
pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
Summon();
uiSummonTimer = 15*IN_MILLISECONDS;
if (pInstance)
pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, IN_PROGRESS);
}
void Summon()
{
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[0],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[0],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[1],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[1],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[2],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[2],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[3],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[3],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[4],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[4],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[5],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[5],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[6],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[6],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[7],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[7],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (uiSummonTimer <= diff)
boss_krik_thirAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
uint32 uiMindFlayTimer;
uint32 uiCurseFatigueTimer;
uint32 uiSummonTimer;
void Reset()
{
uiMindFlayTimer = 15*IN_MILLISECONDS;
uiCurseFatigueTimer = 12*IN_MILLISECONDS;
if (pInstance)
pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
Summon();
uiSummonTimer = 15*IN_MILLISECONDS;
} else uiSummonTimer -= diff;
if (uiMindFlayTimer <= diff)
if (pInstance)
pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, IN_PROGRESS);
}
void Summon()
{
DoCast(me->getVictim(), SPELL_MIND_FLAY);
uiMindFlayTimer = 15*IN_MILLISECONDS;
} else uiMindFlayTimer -= diff;
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[0],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[0],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[1],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[1],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[2],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[2],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[3],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[3],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[4],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[4],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[5],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[5],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_INFECTIOR,SpawnPoint[6],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[6],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[7],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
me->SummonCreature(MOB_SKITTERING_SWARMER,SpawnPoint[7],TEMPSUMMON_TIMED_DESPAWN,25*IN_MILLISECONDS);
}
if (uiCurseFatigueTimer <= diff)
void UpdateAI(const uint32 diff)
{
//WowWiki say "Curse of Fatigue-Kirk'thir will cast Curse of Fatigue on 2-3 targets periodically."
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
Unit *pTarget_1 = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
if (!UpdateVictim())
return;
DoCast(pTarget, SPELL_CURSE_OF_FATIGUE);
DoCast(pTarget_1, SPELL_CURSE_OF_FATIGUE);
uiCurseFatigueTimer = 10*IN_MILLISECONDS;
} else uiCurseFatigueTimer -= diff;
if (!me->HasAura(SPELL_FRENZY) && HealthBelowPct(10))
DoCast(me, SPELL_FRENZY, true);
DoMeleeAttackIfReady();
}
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
if (!pInstance)
return;
pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, DONE);
//Achievement: Watch him die
Creature *pAdd = Unit::GetCreature(*me, pInstance->GetData64(DATA_WATCHER_GASHRA));
if (!pAdd || !pAdd->isAlive())
return;
pAdd = Unit::GetCreature(*me, pInstance->GetData64(DATA_WATCHER_SILTHIK));
if (!pAdd || !pAdd->isAlive())
return;
pAdd = Unit::GetCreature(*me, pInstance->GetData64(DATA_WATCHER_NARJIL));
if (!pAdd || !pAdd->isAlive())
return;
pInstance->DoCompleteAchievement(ACHIEV_WATH_HIM_DIE);
}
void KilledUnit(Unit * victim)
{
if (victim == me)
return;
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void JustSummoned(Creature* summoned)
{
summoned->GetMotionMaster()->MovePoint(0,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ());
}
};
struct npc_skittering_infectorAI : public ScriptedAI
{
npc_skittering_infectorAI(Creature *c) : ScriptedAI(c) {}
void JustDied(Unit* /*killer*/)
{
//The spell is not working propperly
DoCast(me->getVictim(),SPELL_ACID_SPLASH, true);
}
};
struct npc_anub_ar_skirmisherAI : public ScriptedAI
{
npc_anub_ar_skirmisherAI(Creature *c) : ScriptedAI(c) {}
uint32 uiChargeTimer;
uint32 uiBackstabTimer;
void Reset()
{
uiChargeTimer = 11*IN_MILLISECONDS;
uiBackstabTimer = 7*IN_MILLISECONDS;
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (uiChargeTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (uiSummonTimer <= diff)
{
DoResetThreat();
me->AddThreat(pTarget,1.0f);
DoCast(pTarget, SPELL_CHARGE, true);
}
uiChargeTimer = 15*IN_MILLISECONDS;
} else uiChargeTimer -= diff;
Summon();
uiSummonTimer = 15*IN_MILLISECONDS;
} else uiSummonTimer -= diff;
if (uiBackstabTimer <= diff)
if (uiMindFlayTimer <= diff)
{
DoCast(me->getVictim(), SPELL_MIND_FLAY);
uiMindFlayTimer = 15*IN_MILLISECONDS;
} else uiMindFlayTimer -= diff;
if (uiCurseFatigueTimer <= diff)
{
//WowWiki say "Curse of Fatigue-Kirk'thir will cast Curse of Fatigue on 2-3 targets periodically."
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
Unit *pTarget_1 = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
DoCast(pTarget, SPELL_CURSE_OF_FATIGUE);
DoCast(pTarget_1, SPELL_CURSE_OF_FATIGUE);
uiCurseFatigueTimer = 10*IN_MILLISECONDS;
} else uiCurseFatigueTimer -= diff;
if (!me->HasAura(SPELL_FRENZY) && HealthBelowPct(10))
DoCast(me, SPELL_FRENZY, true);
DoMeleeAttackIfReady();
}
void JustDied(Unit* /*killer*/)
{
DoCast(me->getVictim(), SPELL_BACKSTAB);
uiBackstabTimer = 12*IN_MILLISECONDS;
} else uiBackstabTimer -= diff;
DoScriptText(SAY_DEATH, me);
DoMeleeAttackIfReady();
if (!pInstance)
return;
pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, DONE);
//Achievement: Watch him die
Creature *pAdd = Unit::GetCreature(*me, pInstance->GetData64(DATA_WATCHER_GASHRA));
if (!pAdd || !pAdd->isAlive())
return;
pAdd = Unit::GetCreature(*me, pInstance->GetData64(DATA_WATCHER_SILTHIK));
if (!pAdd || !pAdd->isAlive())
return;
pAdd = Unit::GetCreature(*me, pInstance->GetData64(DATA_WATCHER_NARJIL));
if (!pAdd || !pAdd->isAlive())
return;
pInstance->DoCompleteAchievement(ACHIEV_WATH_HIM_DIE);
}
void KilledUnit(Unit * victim)
{
if (victim == me)
return;
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void JustSummoned(Creature* summoned)
{
summoned->GetMotionMaster()->MovePoint(0,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ());
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new boss_krik_thirAI(creature);
}
};
struct npc_anub_ar_shadowcasterAI : public ScriptedAI
class npc_skittering_infector : public CreatureScript
{
npc_anub_ar_shadowcasterAI(Creature *c) : ScriptedAI(c) {}
public:
npc_skittering_infector() : CreatureScript("npc_skittering_infector") { }
uint32 uiShadowBoltTimer;
uint32 uiShadowNovaTimer;
void Reset()
struct npc_skittering_infectorAI : public ScriptedAI
{
uiShadowBoltTimer = 6*IN_MILLISECONDS;
uiShadowNovaTimer = 15*IN_MILLISECONDS;
}
npc_skittering_infectorAI(Creature *c) : ScriptedAI(c) {}
void UpdateAI(const uint32 diff)
void JustDied(Unit* /*killer*/)
{
//The spell is not working propperly
DoCast(me->getVictim(),SPELL_ACID_SPLASH, true);
}
};
CreatureAI *GetAI(Creature *creature) const
{
if (!UpdateVictim())
return;
if (uiShadowBoltTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_SHADOW_BOLT, true);
uiShadowBoltTimer = 15*IN_MILLISECONDS;
} else uiShadowBoltTimer -= diff;
if (uiShadowNovaTimer <= diff)
{
DoCast(me->getVictim(), SPELL_SHADOW_NOVA, true);
uiShadowNovaTimer = 17*IN_MILLISECONDS;
} else uiShadowNovaTimer -= diff;
DoMeleeAttackIfReady();
return new npc_skittering_infectorAI(creature);
}
};
struct npc_anub_ar_warriorAI : public ScriptedAI
class npc_anub_ar_skirmisher : public CreatureScript
{
npc_anub_ar_warriorAI(Creature *c) : ScriptedAI(c){}
public:
npc_anub_ar_skirmisher() : CreatureScript("npc_anub_ar_skirmisher") { }
uint32 uiCleaveTimer;
uint32 uiStrikeTimer;
void Reset()
struct npc_anub_ar_skirmisherAI : public ScriptedAI
{
uiCleaveTimer = 11*IN_MILLISECONDS;
uiStrikeTimer = 6*IN_MILLISECONDS;
}
npc_anub_ar_skirmisherAI(Creature *c) : ScriptedAI(c) {}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
uint32 uiChargeTimer;
uint32 uiBackstabTimer;
if (uiStrikeTimer <= diff)
void Reset()
{
DoCast(me->getVictim(), SPELL_STRIKE, true);
uiStrikeTimer = 15*IN_MILLISECONDS;
} else uiStrikeTimer -= diff;
uiChargeTimer = 11*IN_MILLISECONDS;
uiBackstabTimer = 7*IN_MILLISECONDS;
}
if (uiCleaveTimer <= diff)
void UpdateAI(const uint32 diff)
{
DoCast(me->getVictim(), SPELL_CLEAVE, true);
uiCleaveTimer = 17*IN_MILLISECONDS;
} else uiCleaveTimer -= diff;
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
if (uiChargeTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
DoResetThreat();
me->AddThreat(pTarget,1.0f);
DoCast(pTarget, SPELL_CHARGE, true);
}
uiChargeTimer = 15*IN_MILLISECONDS;
} else uiChargeTimer -= diff;
}
if (uiBackstabTimer <= diff)
{
DoCast(me->getVictim(), SPELL_BACKSTAB);
uiBackstabTimer = 12*IN_MILLISECONDS;
} else uiBackstabTimer -= diff;
};
DoMeleeAttackIfReady();
struct npc_watcher_gashraAI : public ScriptedAI
{
npc_watcher_gashraAI(Creature *c) : ScriptedAI(c) {}
}
};
uint32 uiWebWrapTimer;
uint32 uiInfectedBiteTimer;
void Reset()
CreatureAI *GetAI(Creature *creature) const
{
uiWebWrapTimer = 11*IN_MILLISECONDS;
uiInfectedBiteTimer = 4*IN_MILLISECONDS;
}
void EnterCombat(Unit* /*who*/)
{
DoCast(me, SPELL_ENRAGE, true);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (uiWebWrapTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_WEB_WRAP, true);
uiWebWrapTimer = 17*IN_MILLISECONDS;
} else uiWebWrapTimer -= diff;
if (uiInfectedBiteTimer <= diff)
{
DoCast(me->getVictim(), SPELL_INFECTED_BITE, true);
uiInfectedBiteTimer = 15*IN_MILLISECONDS;
} else uiInfectedBiteTimer -= diff;
DoMeleeAttackIfReady();
return new npc_anub_ar_skirmisherAI(creature);
}
};
struct npc_watcher_narjilAI : public ScriptedAI
class npc_anub_ar_shadowcaster : public CreatureScript
{
npc_watcher_narjilAI(Creature *c) : ScriptedAI(c) {}
public:
npc_anub_ar_shadowcaster() : CreatureScript("npc_anub_ar_shadowcaster") { }
uint32 uiWebWrapTimer;
uint32 uiInfectedBiteTimer;
uint32 uiBindingWebsTimer;
void Reset()
struct npc_anub_ar_shadowcasterAI : public ScriptedAI
{
uiWebWrapTimer = 11*IN_MILLISECONDS;
uiInfectedBiteTimer = 4*IN_MILLISECONDS;
uiBindingWebsTimer = 17*IN_MILLISECONDS;
npc_anub_ar_shadowcasterAI(Creature *c) : ScriptedAI(c) {}
uint32 uiShadowBoltTimer;
uint32 uiShadowNovaTimer;
void Reset()
{
uiShadowBoltTimer = 6*IN_MILLISECONDS;
uiShadowNovaTimer = 15*IN_MILLISECONDS;
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (uiShadowBoltTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_SHADOW_BOLT, true);
uiShadowBoltTimer = 15*IN_MILLISECONDS;
} else uiShadowBoltTimer -= diff;
if (uiShadowNovaTimer <= diff)
{
DoCast(me->getVictim(), SPELL_SHADOW_NOVA, true);
uiShadowNovaTimer = 17*IN_MILLISECONDS;
} else uiShadowNovaTimer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new npc_anub_ar_shadowcasterAI(creature);
}
};
void UpdateAI(const uint32 diff)
class npc_anub_ar_warrior : public CreatureScript
{
public:
npc_anub_ar_warrior() : CreatureScript("npc_anub_ar_warrior") { }
struct npc_anub_ar_warriorAI : public ScriptedAI
{
if (!UpdateVictim())
return;
npc_anub_ar_warriorAI(Creature *c) : ScriptedAI(c){}
if (uiWebWrapTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_WEB_WRAP, true);
uiWebWrapTimer = 15*IN_MILLISECONDS;
} else uiWebWrapTimer -= diff;
uint32 uiCleaveTimer;
uint32 uiStrikeTimer;
if (uiInfectedBiteTimer <= diff)
void Reset()
{
DoCast(me->getVictim(), SPELL_INFECTED_BITE, true);
uiInfectedBiteTimer = 11*IN_MILLISECONDS;
} else uiInfectedBiteTimer -= diff;
uiCleaveTimer = 11*IN_MILLISECONDS;
uiStrikeTimer = 6*IN_MILLISECONDS;
}
if (uiBindingWebsTimer <= diff)
void UpdateAI(const uint32 diff)
{
DoCast(me->getVictim(), SPELL_BLINDING_WEBS, true);
if (!UpdateVictim())
return;
if (uiStrikeTimer <= diff)
{
DoCast(me->getVictim(), SPELL_STRIKE, true);
uiStrikeTimer = 15*IN_MILLISECONDS;
} else uiStrikeTimer -= diff;
if (uiCleaveTimer <= diff)
{
DoCast(me->getVictim(), SPELL_CLEAVE, true);
uiCleaveTimer = 17*IN_MILLISECONDS;
} else uiCleaveTimer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new npc_anub_ar_warriorAI(creature);
}
};
class npc_watcher_gashra : public CreatureScript
{
public:
npc_watcher_gashra() : CreatureScript("npc_watcher_gashra") { }
struct npc_watcher_gashraAI : public ScriptedAI
{
npc_watcher_gashraAI(Creature *c) : ScriptedAI(c) {}
uint32 uiWebWrapTimer;
uint32 uiInfectedBiteTimer;
void Reset()
{
uiWebWrapTimer = 11*IN_MILLISECONDS;
uiInfectedBiteTimer = 4*IN_MILLISECONDS;
}
void EnterCombat(Unit* /*who*/)
{
DoCast(me, SPELL_ENRAGE, true);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (uiWebWrapTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_WEB_WRAP, true);
uiWebWrapTimer = 17*IN_MILLISECONDS;
} else uiWebWrapTimer -= diff;
if (uiInfectedBiteTimer <= diff)
{
DoCast(me->getVictim(), SPELL_INFECTED_BITE, true);
uiInfectedBiteTimer = 15*IN_MILLISECONDS;
} else uiInfectedBiteTimer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new npc_watcher_gashraAI(creature);
}
};
class npc_watcher_narjil : public CreatureScript
{
public:
npc_watcher_narjil() : CreatureScript("npc_watcher_narjil") { }
struct npc_watcher_narjilAI : public ScriptedAI
{
npc_watcher_narjilAI(Creature *c) : ScriptedAI(c) {}
uint32 uiWebWrapTimer;
uint32 uiInfectedBiteTimer;
uint32 uiBindingWebsTimer;
void Reset()
{
uiWebWrapTimer = 11*IN_MILLISECONDS;
uiInfectedBiteTimer = 4*IN_MILLISECONDS;
uiBindingWebsTimer = 17*IN_MILLISECONDS;
} else uiBindingWebsTimer -= diff;
}
DoMeleeAttackIfReady();
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (uiWebWrapTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_WEB_WRAP, true);
uiWebWrapTimer = 15*IN_MILLISECONDS;
} else uiWebWrapTimer -= diff;
if (uiInfectedBiteTimer <= diff)
{
DoCast(me->getVictim(), SPELL_INFECTED_BITE, true);
uiInfectedBiteTimer = 11*IN_MILLISECONDS;
} else uiInfectedBiteTimer -= diff;
if (uiBindingWebsTimer <= diff)
{
DoCast(me->getVictim(), SPELL_BLINDING_WEBS, true);
uiBindingWebsTimer = 17*IN_MILLISECONDS;
} else uiBindingWebsTimer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new npc_watcher_narjilAI(creature);
}
};
struct npc_watcher_silthikAI : public ScriptedAI
class npc_watcher_silthik : public CreatureScript
{
npc_watcher_silthikAI(Creature *c) : ScriptedAI(c) {}
public:
npc_watcher_silthik() : CreatureScript("npc_watcher_silthik") { }
uint32 uiWebWrapTimer;
uint32 uiInfectedBiteTimer;
uint32 uiPoisonSprayTimer;
void Reset()
struct npc_watcher_silthikAI : public ScriptedAI
{
uiWebWrapTimer = 11*IN_MILLISECONDS;
uiInfectedBiteTimer = 4*IN_MILLISECONDS;
uiPoisonSprayTimer = 15*IN_MILLISECONDS;
}
npc_watcher_silthikAI(Creature *c) : ScriptedAI(c) {}
void UpdateAI(const uint32 diff)
uint32 uiWebWrapTimer;
uint32 uiInfectedBiteTimer;
uint32 uiPoisonSprayTimer;
void Reset()
{
uiWebWrapTimer = 11*IN_MILLISECONDS;
uiInfectedBiteTimer = 4*IN_MILLISECONDS;
uiPoisonSprayTimer = 15*IN_MILLISECONDS;
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (uiWebWrapTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_WEB_WRAP, true);
uiWebWrapTimer = 15*IN_MILLISECONDS;
} else uiWebWrapTimer -= diff;
if (uiInfectedBiteTimer <= diff)
{
DoCast(me->getVictim(), SPELL_INFECTED_BITE, true);
uiInfectedBiteTimer = 15*IN_MILLISECONDS;
} else uiInfectedBiteTimer -= diff;
if (uiPoisonSprayTimer <= diff)
{
DoCast(me->getVictim(), SPELL_POSION_SPRAY, true);
uiPoisonSprayTimer = 17*IN_MILLISECONDS;
} else uiPoisonSprayTimer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI *GetAI(Creature *creature) const
{
if (!UpdateVictim())
return;
if (uiWebWrapTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_WEB_WRAP, true);
uiWebWrapTimer = 15*IN_MILLISECONDS;
} else uiWebWrapTimer -= diff;
if (uiInfectedBiteTimer <= diff)
{
DoCast(me->getVictim(), SPELL_INFECTED_BITE, true);
uiInfectedBiteTimer = 15*IN_MILLISECONDS;
} else uiInfectedBiteTimer -= diff;
if (uiPoisonSprayTimer <= diff)
{
DoCast(me->getVictim(), SPELL_POSION_SPRAY, true);
uiPoisonSprayTimer = 17*IN_MILLISECONDS;
} else uiPoisonSprayTimer -= diff;
DoMeleeAttackIfReady();
return new npc_watcher_silthikAI(creature);
}
};
CreatureAI* GetAI_boss_krik_thir(Creature* pCreature)
{
return new boss_krik_thirAI (pCreature);
}
CreatureAI* GetAI_npc_anub_ar_skirmisher (Creature* pCreature)
{
return new npc_anub_ar_skirmisherAI (pCreature);
}
CreatureAI* GetAI_npc_skittering_infector (Creature* pCreature)
{
return new npc_skittering_infectorAI (pCreature);
}
CreatureAI* GetAI_npc_anub_ar_shadowcaster (Creature* pCreature)
{
return new npc_anub_ar_shadowcasterAI (pCreature);
}
CreatureAI* GetAI_npc_anub_ar_warrior (Creature* pCreature)
{
return new npc_anub_ar_warriorAI (pCreature);
}
CreatureAI* GetAI_npc_watcher_gashra (Creature* pCreature)
{
return new npc_watcher_gashraAI (pCreature);
}
CreatureAI* GetAI_npc_watcher_narjil (Creature* pCreature)
{
return new npc_watcher_narjilAI (pCreature);
}
CreatureAI* GetAI_npc_watcher_silthik (Creature* pCreature)
{
return new npc_watcher_silthikAI (pCreature);
}
void AddSC_boss_krik_thir()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_krik_thir";
newscript->GetAI = &GetAI_boss_krik_thir;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_skittering_infector";
newscript->GetAI = &GetAI_npc_skittering_infector;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_anub_ar_skirmisher";
newscript->GetAI = &GetAI_npc_anub_ar_skirmisher;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_anub_ar_shadowcaster";
newscript->GetAI = &GetAI_npc_anub_ar_shadowcaster;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_watcher_gashra";
newscript->GetAI = &GetAI_npc_watcher_gashra;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_anub_ar_warrior";
newscript->GetAI = &GetAI_npc_anub_ar_warrior;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_watcher_silthik";
newscript->GetAI = &GetAI_npc_watcher_silthik;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_watcher_narjil";
newscript->GetAI = &GetAI_npc_watcher_narjil;
newscript->RegisterSelf();
new boss_krik_thir;
new npc_skittering_infector;
new npc_anub_ar_skirmisher;
new npc_anub_ar_shadowcaster;
new npc_watcher_gashra;
new npc_anub_ar_warrior;
new npc_watcher_silthik;
new npc_watcher_narjil;
}

View File

@@ -26,189 +26,191 @@
2 - Anub'arak
*/
struct instance_azjol_nerub : public ScriptedInstance
class instance_azjol_nerub : public InstanceMapScript
{
instance_azjol_nerub(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
public:
instance_azjol_nerub() : InstanceMapScript("instance_azjol_nerub") { }
uint64 uiKrikthir;
uint64 uiHadronox;
uint64 uiAnubarak;
uint64 uiWatcherGashra;
uint64 uiWatcherSilthik;
uint64 uiWatcherNarjil;
uint64 uiAnubarakDoor[3];
uint64 uiKrikthirDoor;
uint32 auiEncounter[MAX_ENCOUNTER];
void Initialize()
{
memset(&auiEncounter, 0, sizeof(auiEncounter));
memset(&uiAnubarakDoor, 0, sizeof(uiAnubarakDoor));
uiKrikthir = 0;
uiHadronox = 0;
uiAnubarak = 0;
uiWatcherGashra = 0;
uiWatcherSilthik = 0;
uiWatcherNarjil = 0;
uiKrikthirDoor = 0;
}
bool IsEncounterInProgress() const
struct instance_azjol_nerub_ScriptedInstance : public ScriptedInstance
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (auiEncounter[i] == IN_PROGRESS) return true;
instance_azjol_nerub_ScriptedInstance(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
return false;
}
uint64 uiKrikthir;
uint64 uiHadronox;
uint64 uiAnubarak;
uint64 uiWatcherGashra;
uint64 uiWatcherSilthik;
uint64 uiWatcherNarjil;
uint64 uiAnubarakDoor[3];
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
switch(pCreature->GetEntry())
{
case 28684: uiKrikthir = pCreature->GetGUID(); break;
case 28921: uiHadronox = pCreature->GetGUID(); break;
case 29120: uiAnubarak = pCreature->GetGUID(); break;
case 28730: uiWatcherGashra = pCreature->GetGUID(); break;
case 28731: uiWatcherSilthik = pCreature->GetGUID(); break;
case 28729: uiWatcherNarjil = pCreature->GetGUID(); break;
}
}
uint64 uiKrikthirDoor;
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
{
switch (pGo->GetEntry())
{
case 192395:
uiKrikthirDoor = pGo->GetGUID();
if (auiEncounter[0] == DONE)
HandleGameObject(NULL,true,pGo);
break;
case 192396:
uiAnubarakDoor[0] = pGo->GetGUID();
break;
case 192397:
uiAnubarakDoor[1] = pGo->GetGUID();
break;
case 192398:
uiAnubarakDoor[2] = pGo->GetGUID();
break;
}
}
uint32 auiEncounter[MAX_ENCOUNTER];
void Initialize()
{
memset(&auiEncounter, 0, sizeof(auiEncounter));
memset(&uiAnubarakDoor, 0, sizeof(uiAnubarakDoor));
uint64 GetData64(uint32 identifier)
{
switch(identifier)
{
case DATA_KRIKTHIR_THE_GATEWATCHER: return uiKrikthir;
case DATA_HADRONOX: return uiHadronox;
case DATA_ANUBARAK: return uiAnubarak;
case DATA_WATCHER_GASHRA: return uiWatcherGashra;
case DATA_WATCHER_SILTHIK: return uiWatcherSilthik;
case DATA_WATCHER_NARJIL: return uiWatcherNarjil;
uiKrikthir = 0;
uiHadronox = 0;
uiAnubarak = 0;
uiWatcherGashra = 0;
uiWatcherSilthik = 0;
uiWatcherNarjil = 0;
uiKrikthirDoor = 0;
}
return 0;
}
void SetData(uint32 type, uint32 data)
{
switch(type)
bool IsEncounterInProgress() const
{
case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT:
auiEncounter[0] = data;
if (data == DONE)
HandleGameObject(uiKrikthirDoor,true);
break;
case DATA_HADRONOX_EVENT:
auiEncounter[1] = data;
break;
case DATA_ANUBARAK_EVENT:
auiEncounter[2] = data;
if (data == IN_PROGRESS)
for (uint8 i = 0; i < 3; ++i)
HandleGameObject(uiAnubarakDoor[i], false);
else if (data == NOT_STARTED || data == DONE)
for (uint8 i = 0; i < 3; ++i)
HandleGameObject(uiAnubarakDoor[i], true);
break;
}
if (data == DONE)
{
SaveToDB();
}
}
uint32 GetData(uint32 type)
{
switch(type)
{
case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT: return auiEncounter[0];
case DATA_HADRONOX_EVENT: return auiEncounter[1];
case DATA_ANUBARAK_EVENT: return auiEncounter[2];
}
return 0;
}
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << "A N " << auiEncounter[0] << " " << auiEncounter[1] << " "
<< auiEncounter[2];
OUT_SAVE_INST_DATA_COMPLETE;
return saveStream.str();
}
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;
std::istringstream loadStream(in);
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2;
if (dataHead1 == 'A' && dataHead2 == 'N')
{
auiEncounter[0] = data0;
auiEncounter[1] = data1;
auiEncounter[2] = data2;
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (auiEncounter[i] == IN_PROGRESS)
auiEncounter[i] = NOT_STARTED;
if (auiEncounter[i] == IN_PROGRESS) return true;
} else OUT_LOAD_INST_DATA_FAIL;
return false;
}
OUT_LOAD_INST_DATA_COMPLETE;
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
switch(pCreature->GetEntry())
{
case 28684: uiKrikthir = pCreature->GetGUID(); break;
case 28921: uiHadronox = pCreature->GetGUID(); break;
case 29120: uiAnubarak = pCreature->GetGUID(); break;
case 28730: uiWatcherGashra = pCreature->GetGUID(); break;
case 28731: uiWatcherSilthik = pCreature->GetGUID(); break;
case 28729: uiWatcherNarjil = pCreature->GetGUID(); break;
}
}
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
{
switch (pGo->GetEntry())
{
case 192395:
uiKrikthirDoor = pGo->GetGUID();
if (auiEncounter[0] == DONE)
HandleGameObject(NULL,true,pGo);
break;
case 192396:
uiAnubarakDoor[0] = pGo->GetGUID();
break;
case 192397:
uiAnubarakDoor[1] = pGo->GetGUID();
break;
case 192398:
uiAnubarakDoor[2] = pGo->GetGUID();
break;
}
}
uint64 GetData64(uint32 identifier)
{
switch(identifier)
{
case DATA_KRIKTHIR_THE_GATEWATCHER: return uiKrikthir;
case DATA_HADRONOX: return uiHadronox;
case DATA_ANUBARAK: return uiAnubarak;
case DATA_WATCHER_GASHRA: return uiWatcherGashra;
case DATA_WATCHER_SILTHIK: return uiWatcherSilthik;
case DATA_WATCHER_NARJIL: return uiWatcherNarjil;
}
return 0;
}
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT:
auiEncounter[0] = data;
if (data == DONE)
HandleGameObject(uiKrikthirDoor,true);
break;
case DATA_HADRONOX_EVENT:
auiEncounter[1] = data;
break;
case DATA_ANUBARAK_EVENT:
auiEncounter[2] = data;
if (data == IN_PROGRESS)
for (uint8 i = 0; i < 3; ++i)
HandleGameObject(uiAnubarakDoor[i], false);
else if (data == NOT_STARTED || data == DONE)
for (uint8 i = 0; i < 3; ++i)
HandleGameObject(uiAnubarakDoor[i], true);
break;
}
if (data == DONE)
{
SaveToDB();
}
}
uint32 GetData(uint32 type)
{
switch(type)
{
case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT: return auiEncounter[0];
case DATA_HADRONOX_EVENT: return auiEncounter[1];
case DATA_ANUBARAK_EVENT: return auiEncounter[2];
}
return 0;
}
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << "A N " << auiEncounter[0] << " " << auiEncounter[1] << " "
<< auiEncounter[2];
OUT_SAVE_INST_DATA_COMPLETE;
return saveStream.str();
}
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;
std::istringstream loadStream(in);
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2;
if (dataHead1 == 'A' && dataHead2 == 'N')
{
auiEncounter[0] = data0;
auiEncounter[1] = data1;
auiEncounter[2] = data2;
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (auiEncounter[i] == IN_PROGRESS)
auiEncounter[i] = NOT_STARTED;
} else OUT_LOAD_INST_DATA_FAIL;
OUT_LOAD_INST_DATA_COMPLETE;
}
};
InstanceData* GetInstanceData(InstanceMap *map) const
{
return new instance_azjol_nerub_ScriptedInstance(map);
}
};
InstanceData* GetInstanceData_instance_azjol_nerub(Map* pMap)
{
return new instance_azjol_nerub(pMap);
}
void AddSC_instance_azjol_nerub()
{
Script *newscript;
newscript = new Script;
newscript->Name = "instance_azjol_nerub";
newscript->GetInstanceData = &GetInstanceData_instance_azjol_nerub;
newscript->RegisterSelf();
new instance_azjol_nerub;
}

View File

@@ -41,185 +41,188 @@ enum Creatures
NPC_POISONOUS_MUSHROOM = 30435
};
struct boss_amanitarAI : public ScriptedAI
class boss_amanitar : public CreatureScript
{
boss_amanitarAI(Creature *c) : ScriptedAI(c)
public:
boss_amanitar() : CreatureScript("boss_amanitar") { }
struct boss_amanitarAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
bFirstTime = true;
}
ScriptedInstance* pInstance;
uint32 uiRootTimer;
uint32 uiBashTimer;
uint32 uiBoltTimer;
uint32 uiSpawnTimer;
bool bFirstTime;
void Reset()
{
uiRootTimer = urand(5*IN_MILLISECONDS,9*IN_MILLISECONDS);
uiBashTimer = urand(10*IN_MILLISECONDS,14*IN_MILLISECONDS);
uiBoltTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS);
uiSpawnTimer = 0;
me->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE);
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
if (pInstance)
boss_amanitarAI(Creature *c) : ScriptedAI(c)
{
pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MINI);
if (!bFirstTime)
pInstance->SetData(DATA_AMANITAR_EVENT, FAIL);
else
bFirstTime = false;
pInstance = c->GetInstanceData();
bFirstTime = true;
}
}
void JustDied(Unit * /*Killer*/)
{
if (pInstance)
ScriptedInstance* pInstance;
uint32 uiRootTimer;
uint32 uiBashTimer;
uint32 uiBoltTimer;
uint32 uiSpawnTimer;
bool bFirstTime;
void Reset()
{
pInstance->SetData(DATA_AMANITAR_EVENT, DONE);
pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MINI);
}
}
uiRootTimer = urand(5*IN_MILLISECONDS,9*IN_MILLISECONDS);
uiBashTimer = urand(10*IN_MILLISECONDS,14*IN_MILLISECONDS);
uiBoltTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS);
uiSpawnTimer = 0;
void EnterCombat(Unit * /*who*/)
{
if (pInstance)
pInstance->SetData(DATA_AMANITAR_EVENT, IN_PROGRESS);
me->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE);
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
DoCast(me, SPELL_MINI, false);
}
void SpawnAdds()
{
for (uint8 i = 0; i < 30; ++i)
{
Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (victim)
if (pInstance)
{
Position pos;
victim->GetPosition(&pos);
me->GetRandomNearPosition(pos, float(urand(5,80)));
me->SummonCreature(NPC_POISONOUS_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30*IN_MILLISECONDS);
me->GetRandomNearPosition(pos, float(urand(5,80)));
me->SummonCreature(NPC_HEALTHY_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30*IN_MILLISECONDS);
pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MINI);
if (!bFirstTime)
pInstance->SetData(DATA_AMANITAR_EVENT, FAIL);
else
bFirstTime = false;
}
}
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (uiSpawnTimer <= diff)
void JustDied(Unit * /*Killer*/)
{
SpawnAdds();
uiSpawnTimer = urand(35*IN_MILLISECONDS,40*IN_MILLISECONDS);
} else uiSpawnTimer -= diff;
if (uiRootTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_ENTANGLING_ROOTS);
uiRootTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS);
} else uiRootTimer -= diff;
if (uiBashTimer <= diff)
{
DoCastVictim(SPELL_BASH);
uiBashTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS);
} else uiBashTimer -= diff;
if (uiBoltTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_VENOM_BOLT_VOLLEY);
uiBoltTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS);
} else uiBoltTimer -= diff;
DoMeleeAttackIfReady();
}
};
struct mob_amanitar_mushroomsAI : public Scripted_NoMovementAI
{
mob_amanitar_mushroomsAI(Creature* c) : Scripted_NoMovementAI(c) {}
uint32 uiAuraTimer;
uint32 uiDeathTimer;
void Reset()
{
DoCast(me, SPELL_PUTRID_MUSHROOM, true); // Hack, to make the mushrooms visible, can't find orig. spell...
if (me->GetEntry() == NPC_POISONOUS_MUSHROOM)
DoCast(me, SPELL_POISONOUS_MUSHROOM_VISUAL_AURA, true);
uiAuraTimer = 0;
uiDeathTimer = 30*IN_MILLISECONDS;
}
void JustDied(Unit *killer)
{
if (!killer)
return;
if (me->GetEntry() == NPC_HEALTHY_MUSHROOM && killer->GetTypeId() == TYPEID_PLAYER)
{
me->InterruptNonMeleeSpells(false);
DoCast(killer, SPELL_HEALTHY_MUSHROOM_POTENT_FUNGUS, false);
}
}
void EnterCombat(Unit * /*who*/) {}
void AttackStart(Unit * /*victim*/) {}
void UpdateAI(const uint32 diff)
{
if (me->GetEntry() == NPC_POISONOUS_MUSHROOM)
{
if (uiAuraTimer <= diff)
if (pInstance)
{
DoCast(me, SPELL_POISONOUS_MUSHROOM_VISUAL_AREA, true);
DoCast(me, SPELL_POISONOUS_MUSHROOM_POISON_CLOUD, false);
uiAuraTimer = 7*IN_MILLISECONDS;
} else uiAuraTimer -= diff;
pInstance->SetData(DATA_AMANITAR_EVENT, DONE);
pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MINI);
}
}
if (uiDeathTimer <= diff)
me->DisappearAndDie();
else uiDeathTimer -= diff;
void EnterCombat(Unit * /*who*/)
{
if (pInstance)
pInstance->SetData(DATA_AMANITAR_EVENT, IN_PROGRESS);
DoCast(me, SPELL_MINI, false);
}
void SpawnAdds()
{
for (uint8 i = 0; i < 30; ++i)
{
Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (victim)
{
Position pos;
victim->GetPosition(&pos);
me->GetRandomNearPosition(pos, float(urand(5,80)));
me->SummonCreature(NPC_POISONOUS_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30*IN_MILLISECONDS);
me->GetRandomNearPosition(pos, float(urand(5,80)));
me->SummonCreature(NPC_HEALTHY_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30*IN_MILLISECONDS);
}
}
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (uiSpawnTimer <= diff)
{
SpawnAdds();
uiSpawnTimer = urand(35*IN_MILLISECONDS,40*IN_MILLISECONDS);
} else uiSpawnTimer -= diff;
if (uiRootTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_ENTANGLING_ROOTS);
uiRootTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS);
} else uiRootTimer -= diff;
if (uiBashTimer <= diff)
{
DoCastVictim(SPELL_BASH);
uiBashTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS);
} else uiBashTimer -= diff;
if (uiBoltTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_VENOM_BOLT_VOLLEY);
uiBoltTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS);
} else uiBoltTimer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new boss_amanitarAI(creature);
}
};
CreatureAI* GetAI_boss_amanitar(Creature* pCreature)
class mob_amanitar_mushrooms : public CreatureScript
{
return new boss_amanitarAI (pCreature);
}
public:
mob_amanitar_mushrooms() : CreatureScript("mob_amanitar_mushrooms") { }
CreatureAI* GetAI_mob_amanitar_mushrooms(Creature *pCreature)
{
return new mob_amanitar_mushroomsAI (pCreature);
}
struct mob_amanitar_mushroomsAI : public Scripted_NoMovementAI
{
mob_amanitar_mushroomsAI(Creature* c) : Scripted_NoMovementAI(c) {}
uint32 uiAuraTimer;
uint32 uiDeathTimer;
void Reset()
{
DoCast(me, SPELL_PUTRID_MUSHROOM, true); // Hack, to make the mushrooms visible, can't find orig. spell...
if (me->GetEntry() == NPC_POISONOUS_MUSHROOM)
DoCast(me, SPELL_POISONOUS_MUSHROOM_VISUAL_AURA, true);
uiAuraTimer = 0;
uiDeathTimer = 30*IN_MILLISECONDS;
}
void JustDied(Unit *killer)
{
if (!killer)
return;
if (me->GetEntry() == NPC_HEALTHY_MUSHROOM && killer->GetTypeId() == TYPEID_PLAYER)
{
me->InterruptNonMeleeSpells(false);
DoCast(killer, SPELL_HEALTHY_MUSHROOM_POTENT_FUNGUS, false);
}
}
void EnterCombat(Unit * /*who*/) {}
void AttackStart(Unit * /*victim*/) {}
void UpdateAI(const uint32 diff)
{
if (me->GetEntry() == NPC_POISONOUS_MUSHROOM)
{
if (uiAuraTimer <= diff)
{
DoCast(me, SPELL_POISONOUS_MUSHROOM_VISUAL_AREA, true);
DoCast(me, SPELL_POISONOUS_MUSHROOM_POISON_CLOUD, false);
uiAuraTimer = 7*IN_MILLISECONDS;
} else uiAuraTimer -= diff;
}
if (uiDeathTimer <= diff)
me->DisappearAndDie();
else uiDeathTimer -= diff;
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new mob_amanitar_mushroomsAI(creature);
}
};
void AddSC_boss_amanitar()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_amanitar";
newscript->GetAI = &GetAI_boss_amanitar;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_amanitar_mushrooms";
newscript->GetAI = &GetAI_mob_amanitar_mushrooms;
newscript->RegisterSelf();
new boss_amanitar;
new mob_amanitar_mushrooms;
}

View File

@@ -55,228 +55,233 @@ enum Creatures
#define EMOTE_HATCHES "An Ahn'kahar Guardian hatches!"
struct boss_elder_nadoxAI : public ScriptedAI
class boss_elder_nadox : public CreatureScript
{
boss_elder_nadoxAI(Creature *c) : ScriptedAI(c)
public:
boss_elder_nadox() : CreatureScript("boss_elder_nadox") { }
struct boss_elder_nadoxAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
}
uint32 uiPlagueTimer;
uint32 uiRagueTimer;
uint32 uiSwarmerSpawnTimer;
uint32 uiGuardSpawnTimer;
uint32 uiEnragueTimer;
bool bGuardSpawned;
ScriptedInstance *pInstance;
void Reset()
{
uiPlagueTimer = 13*IN_MILLISECONDS;
uiRagueTimer = 20*IN_MILLISECONDS;
uiSwarmerSpawnTimer = 10*IN_MILLISECONDS;
uiGuardSpawnTimer = 25*IN_MILLISECONDS;
uiEnragueTimer = 5*IN_MILLISECONDS;
DeadAhnkaharGuardian = false;
bGuardSpawned = false;
if (pInstance)
pInstance->SetData(DATA_ELDER_NADOX_EVENT, NOT_STARTED);
}
void EnterCombat(Unit * /*who*/)
{
DoScriptText(SAY_DEATH,me);
if (pInstance)
pInstance->SetData(DATA_ELDER_NADOX_EVENT, IN_PROGRESS);
}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_SLAY_3,me); //SAY_SLAY_3 on death?
if (pInstance)
boss_elder_nadoxAI(Creature *c) : ScriptedAI(c)
{
pInstance->SetData(DATA_ELDER_NADOX_EVENT, DONE);
if (IsHeroic() && !DeadAhnkaharGuardian)
pInstance->DoCompleteAchievement(ACHIEV_RESPECT_YOUR_ELDERS);
pInstance = c->GetInstanceData();
}
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
uint32 uiPlagueTimer;
uint32 uiRagueTimer;
if (uiPlagueTimer <= diff)
uint32 uiSwarmerSpawnTimer;
uint32 uiGuardSpawnTimer;
uint32 uiEnragueTimer;
bool bGuardSpawned;
ScriptedInstance *pInstance;
void Reset()
{
DoCast(me->getVictim(), SPELL_BROOD_PLAGUE);
uiPlagueTimer = 15*IN_MILLISECONDS;
} else uiPlagueTimer -= diff;
if (IsHeroic())
if (uiRagueTimer <= diff)
{
if (Creature *pSwarmer = me->FindNearestCreature(MOB_AHNKAHAR_SWARMER, 35))
{
DoCast(pSwarmer, H_SPELL_BROOD_RAGE, true);
uiRagueTimer = 15*IN_MILLISECONDS;
}
} else uiRagueTimer -= diff;
if (uiSwarmerSpawnTimer <= diff)
{
DoCast(me, SPELL_SUMMON_SWARMERS, true);
DoCast(me, SPELL_SUMMON_SWARMERS);
if (urand(1,3) == 3) // 33% chance of dialog
DoScriptText(RAND(SAY_EGG_SAC_1,SAY_EGG_SAC_2), me);
uiPlagueTimer = 13*IN_MILLISECONDS;
uiRagueTimer = 20*IN_MILLISECONDS;
uiSwarmerSpawnTimer = 10*IN_MILLISECONDS;
} else uiSwarmerSpawnTimer -= diff;
if (!bGuardSpawned && uiGuardSpawnTimer <= diff)
{
me->MonsterTextEmote(EMOTE_HATCHES,me->GetGUID(),true);
DoCast(me, SPELL_SUMMON_SWARM_GUARD);
bGuardSpawned = true;
} else uiGuardSpawnTimer -= diff;
if (uiEnragueTimer <= diff)
{
if (me->HasAura(SPELL_ENRAGE,0))
return;
float x, y, z, o;
me->GetHomePosition(x, y, z, o);
if (z < 24)
if (!me->IsNonMeleeSpellCasted(false))
DoCast(me, SPELL_ENRAGE, true);
uiGuardSpawnTimer = 25*IN_MILLISECONDS;
uiEnragueTimer = 5*IN_MILLISECONDS;
} else uiEnragueTimer -= diff;
DoMeleeAttackIfReady();
DeadAhnkaharGuardian = false;
bGuardSpawned = false;
if (pInstance)
pInstance->SetData(DATA_ELDER_NADOX_EVENT, NOT_STARTED);
}
void EnterCombat(Unit * /*who*/)
{
DoScriptText(SAY_DEATH,me);
if (pInstance)
pInstance->SetData(DATA_ELDER_NADOX_EVENT, IN_PROGRESS);
}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_SLAY_3,me); //SAY_SLAY_3 on death?
if (pInstance)
{
pInstance->SetData(DATA_ELDER_NADOX_EVENT, DONE);
if (IsHeroic() && !DeadAhnkaharGuardian)
pInstance->DoCompleteAchievement(ACHIEV_RESPECT_YOUR_ELDERS);
}
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (uiPlagueTimer <= diff)
{
DoCast(me->getVictim(), SPELL_BROOD_PLAGUE);
uiPlagueTimer = 15*IN_MILLISECONDS;
} else uiPlagueTimer -= diff;
if (IsHeroic())
if (uiRagueTimer <= diff)
{
if (Creature *pSwarmer = me->FindNearestCreature(MOB_AHNKAHAR_SWARMER, 35))
{
DoCast(pSwarmer, H_SPELL_BROOD_RAGE, true);
uiRagueTimer = 15*IN_MILLISECONDS;
}
} else uiRagueTimer -= diff;
if (uiSwarmerSpawnTimer <= diff)
{
DoCast(me, SPELL_SUMMON_SWARMERS, true);
DoCast(me, SPELL_SUMMON_SWARMERS);
if (urand(1,3) == 3) // 33% chance of dialog
DoScriptText(RAND(SAY_EGG_SAC_1,SAY_EGG_SAC_2), me);
uiSwarmerSpawnTimer = 10*IN_MILLISECONDS;
} else uiSwarmerSpawnTimer -= diff;
if (!bGuardSpawned && uiGuardSpawnTimer <= diff)
{
me->MonsterTextEmote(EMOTE_HATCHES,me->GetGUID(),true);
DoCast(me, SPELL_SUMMON_SWARM_GUARD);
bGuardSpawned = true;
} else uiGuardSpawnTimer -= diff;
if (uiEnragueTimer <= diff)
{
if (me->HasAura(SPELL_ENRAGE,0))
return;
float x, y, z, o;
me->GetHomePosition(x, y, z, o);
if (z < 24)
if (!me->IsNonMeleeSpellCasted(false))
DoCast(me, SPELL_ENRAGE, true);
uiEnragueTimer = 5*IN_MILLISECONDS;
} else uiEnragueTimer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new boss_elder_nadoxAI(creature);
}
};
CreatureAI* GetAI_boss_elder_nadox(Creature* pCreature)
{
return new boss_elder_nadoxAI(pCreature);
}
enum AddSpells
{
SPELL_SPRINT = 56354,
SPELL_GUARDIAN_AURA = 56151
};
struct mob_ahnkahar_nerubianAI : public ScriptedAI
class mob_ahnkahar_nerubian : public CreatureScript
{
mob_ahnkahar_nerubianAI(Creature *c) : ScriptedAI(c)
public:
mob_ahnkahar_nerubian() : CreatureScript("mob_ahnkahar_nerubian") { }
struct mob_ahnkahar_nerubianAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
}
ScriptedInstance *pInstance;
uint32 uiSprintTimer;
void Reset()
{
if (me->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY) //magic numbers are bad!
DoCast(me, SPELL_GUARDIAN_AURA, true);
uiSprintTimer = 10*IN_MILLISECONDS;
}
void JustDied(Unit * /*killer*/)
{
if (me->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY)
DeadAhnkaharGuardian = true;
}
void EnterCombat(Unit * /*who*/){}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (me->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY)
me->RemoveAurasDueToSpell(SPELL_GUARDIAN_AURA);
if (pInstance)
mob_ahnkahar_nerubianAI(Creature *c) : ScriptedAI(c)
{
if (pInstance->GetData(DATA_ELDER_NADOX_EVENT) != IN_PROGRESS)
{
me->DisappearAndDie();
}
pInstance = c->GetInstanceData();
}
if (!UpdateVictim())
return;
ScriptedInstance *pInstance;
uint32 uiSprintTimer;
if (uiSprintTimer <= diff)
void Reset()
{
DoCast(me, SPELL_SPRINT);
uiSprintTimer = 25*IN_MILLISECONDS;
} else uiSprintTimer -= diff;
if (me->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY) //magic numbers are bad!
DoCast(me, SPELL_GUARDIAN_AURA, true);
uiSprintTimer = 10*IN_MILLISECONDS;
}
DoMeleeAttackIfReady();
void JustDied(Unit * /*killer*/)
{
if (me->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY)
DeadAhnkaharGuardian = true;
}
void EnterCombat(Unit * /*who*/){}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (me->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY)
me->RemoveAurasDueToSpell(SPELL_GUARDIAN_AURA);
if (pInstance)
{
if (pInstance->GetData(DATA_ELDER_NADOX_EVENT) != IN_PROGRESS)
{
me->DisappearAndDie();
}
}
if (!UpdateVictim())
return;
if (uiSprintTimer <= diff)
{
DoCast(me, SPELL_SPRINT);
uiSprintTimer = 25*IN_MILLISECONDS;
} else uiSprintTimer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new mob_ahnkahar_nerubianAI(creature);
}
};
//HACK: No, AI. Replace with proper db content?
struct mob_nadox_eggsAI : public Scripted_NoMovementAI
class mob_nadox_eggs : public CreatureScript
{
mob_nadox_eggsAI(Creature* c) : Scripted_NoMovementAI(c)
public:
mob_nadox_eggs() : CreatureScript("mob_nadox_eggs") { }
struct mob_nadox_eggsAI : public Scripted_NoMovementAI
{
c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
c->UpdateAllStats();
mob_nadox_eggsAI(Creature* c) : Scripted_NoMovementAI(c)
{
c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
c->UpdateAllStats();
}
void Reset() {}
void EnterCombat(Unit* /*who*/) {}
void AttackStart(Unit* /*victim*/) {}
void MoveInLineOfSight(Unit* /*who*/) {}
void UpdateAI(const uint32 /*diff*/) {}
};
CreatureAI *GetAI(Creature* creature) const
{
return new mob_nadox_eggsAI(creature);
}
void Reset() {}
void EnterCombat(Unit* /*who*/) {}
void AttackStart(Unit* /*victim*/) {}
void MoveInLineOfSight(Unit* /*who*/) {}
void UpdateAI(const uint32 /*diff*/) {}
};
CreatureAI* GetAI_mob_ahnkahar_nerubian(Creature* pCreature)
{
return new mob_ahnkahar_nerubianAI(pCreature);
}
CreatureAI* GetAI_mob_nadox_eggs(Creature* _Creature)
{
return new mob_nadox_eggsAI(_Creature);
}
void AddSC_boss_elder_nadox()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_elder_nadox";
newscript->GetAI = &GetAI_boss_elder_nadox;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_ahnkahar_nerubian";
newscript->GetAI = &GetAI_mob_ahnkahar_nerubian;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_nadox_eggs";
newscript->GetAI = &GetAI_mob_nadox_eggs;
newscript->RegisterSelf();
new boss_elder_nadox;
new mob_ahnkahar_nerubian;
new mob_nadox_eggs;
}

View File

@@ -60,265 +60,266 @@ enum Achievements
ACHIEV_QUICK_DEMISE_START_EVENT = 20382,
};
struct boss_volazjAI : public ScriptedAI
class boss_volazj : public CreatureScript
{
boss_volazjAI(Creature* pCreature) : ScriptedAI(pCreature),Summons(me)
public:
boss_volazj() : CreatureScript("boss_volazj") { }
struct boss_volazjAI : public ScriptedAI
{
pInstance = pCreature->GetInstanceData();
}
ScriptedInstance *pInstance;
uint32 uiMindFlayTimer;
uint32 uiShadowBoltVolleyTimer;
uint32 uiShiverTimer;
uint32 insanityHandled;
SummonList Summons;
// returns the percentage of health after taking the given damage.
uint32 GetHealthPct(uint32 damage)
{
if (damage > me->GetHealth())
return 0;
return 100*(me->GetHealth()-damage)/me->GetMaxHealth();
}
void DamageTaken(Unit * /*pAttacker*/, uint32 &damage)
{
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
damage = 0;
if ((GetHealthPct(0) >= 66 && GetHealthPct(damage) < 66)||
(GetHealthPct(0) >= 33 && GetHealthPct(damage) < 33))
boss_volazjAI(Creature* pCreature) : ScriptedAI(pCreature),Summons(me)
{
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_INSANITY, false);
pInstance = pCreature->GetInstanceData();
}
}
void SpellHitTarget(Unit *pTarget, const SpellEntry *spell)
{
if (spell->Id == SPELL_INSANITY)
ScriptedInstance *pInstance;
uint32 uiMindFlayTimer;
uint32 uiShadowBoltVolleyTimer;
uint32 uiShiverTimer;
uint32 insanityHandled;
SummonList Summons;
// returns the percentage of health after taking the given damage.
uint32 GetHealthPct(uint32 damage)
{
// Not good target or too many players
if (pTarget->GetTypeId() != TYPEID_PLAYER || insanityHandled > 4)
return;
// First target - start channel visual and set self as unnattackable
if (!insanityHandled)
if (damage > me->GetHealth())
return 0;
return 100*(me->GetHealth()-damage)/me->GetMaxHealth();
}
void DamageTaken(Unit * /*pAttacker*/, uint32 &damage)
{
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
damage = 0;
if ((GetHealthPct(0) >= 66 && GetHealthPct(damage) < 66)||
(GetHealthPct(0) >= 33 && GetHealthPct(damage) < 33))
{
// Channel visual
DoCast(me, INSANITY_VISUAL, true);
// Unattackable
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetControlled(true, UNIT_STAT_STUNNED);
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_INSANITY, false);
}
// phase mask
pTarget->CastSpell(pTarget, SPELL_INSANITY_TARGET+insanityHandled, true);
// summon twisted party members for this target
}
void SpellHitTarget(Unit *pTarget, const SpellEntry *spell)
{
if (spell->Id == SPELL_INSANITY)
{
// Not good target or too many players
if (pTarget->GetTypeId() != TYPEID_PLAYER || insanityHandled > 4)
return;
// First target - start channel visual and set self as unnattackable
if (!insanityHandled)
{
// Channel visual
DoCast(me, INSANITY_VISUAL, true);
// Unattackable
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetControlled(true, UNIT_STAT_STUNNED);
}
// phase mask
pTarget->CastSpell(pTarget, SPELL_INSANITY_TARGET+insanityHandled, true);
// summon twisted party members for this target
Map::PlayerList const &players = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
{
Player *plr = i->getSource();
if (!plr || !plr->isAlive())
continue;
// Summon clone
if (Unit *summon = me->SummonCreature(MOB_TWISTED_VISAGE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(),TEMPSUMMON_CORPSE_DESPAWN,0))
{
// clone
plr->CastSpell(summon, SPELL_CLONE_PLAYER, true);
// set phase
summon->SetPhaseMask((1<<(4+insanityHandled)),true);
}
}
++insanityHandled;
}
}
void ResetPlayersPhaseMask()
{
Map::PlayerList const &players = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
{
Player *plr = i->getSource();
if (!plr || !plr->isAlive())
continue;
// Summon clone
if (Unit *summon = me->SummonCreature(MOB_TWISTED_VISAGE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(),TEMPSUMMON_CORPSE_DESPAWN,0))
Player* pPlayer = i->getSource();
pPlayer->RemoveAurasDueToSpell(GetSpellForPhaseMask(pPlayer->GetPhaseMask()));
}
}
void Reset()
{
uiMindFlayTimer = 8*IN_MILLISECONDS;
uiShadowBoltVolleyTimer = 5*IN_MILLISECONDS;
uiShiverTimer = 15*IN_MILLISECONDS;
if (pInstance)
{
pInstance->SetData(DATA_HERALD_VOLAZJ, NOT_STARTED);
pInstance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_QUICK_DEMISE_START_EVENT);
}
// Visible for all players in insanity
me->SetPhaseMask((1|16|32|64|128|256),true);
// Used for Insanity handling
insanityHandled = 0;
ResetPlayersPhaseMask();
// Cleanup
Summons.DespawnAll();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
if (pInstance)
{
pInstance->SetData(DATA_HERALD_VOLAZJ, IN_PROGRESS);
pInstance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_QUICK_DEMISE_START_EVENT);
}
}
void JustSummoned(Creature *summon)
{
Summons.Summon(summon);
}
uint32 GetSpellForPhaseMask(uint32 phase)
{
uint32 spell = 0;
switch (phase)
{
case 16:
spell = SPELL_INSANITY_PHASING_1;
break;
case 32:
spell = SPELL_INSANITY_PHASING_2;
break;
case 64:
spell = SPELL_INSANITY_PHASING_3;
break;
case 128:
spell = SPELL_INSANITY_PHASING_4;
break;
case 256:
spell = SPELL_INSANITY_PHASING_5;
break;
}
return spell;
}
void SummonedCreatureDespawn(Creature *summon)
{
uint32 phase= summon->GetPhaseMask();
uint32 nextPhase = 0;
Summons.Despawn(summon);
// Check if all summons in this phase killed
for (SummonList::const_iterator iter = Summons.begin(); iter != Summons.end(); ++iter)
{
if (Creature *visage = Unit::GetCreature(*me, *iter))
{
// clone
plr->CastSpell(summon, SPELL_CLONE_PLAYER, true);
// set phase
summon->SetPhaseMask((1<<(4+insanityHandled)),true);
// Not all are dead
if (phase == visage->GetPhaseMask())
return;
else
nextPhase = visage->GetPhaseMask();
}
}
++insanityHandled;
}
}
void ResetPlayersPhaseMask()
{
Map::PlayerList const &players = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
{
Player* pPlayer = i->getSource();
pPlayer->RemoveAurasDueToSpell(GetSpellForPhaseMask(pPlayer->GetPhaseMask()));
}
}
// Roll Insanity
uint32 spell = GetSpellForPhaseMask(phase);
uint32 spell2 = GetSpellForPhaseMask(nextPhase);
Map* pMap = me->GetMap();
if (!pMap)
return;
void Reset()
{
uiMindFlayTimer = 8*IN_MILLISECONDS;
uiShadowBoltVolleyTimer = 5*IN_MILLISECONDS;
uiShiverTimer = 15*IN_MILLISECONDS;
if (pInstance)
{
pInstance->SetData(DATA_HERALD_VOLAZJ, NOT_STARTED);
pInstance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_QUICK_DEMISE_START_EVENT);
}
// Visible for all players in insanity
me->SetPhaseMask((1|16|32|64|128|256),true);
// Used for Insanity handling
insanityHandled = 0;
ResetPlayersPhaseMask();
// Cleanup
Summons.DespawnAll();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
if (pInstance)
{
pInstance->SetData(DATA_HERALD_VOLAZJ, IN_PROGRESS);
pInstance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_QUICK_DEMISE_START_EVENT);
}
}
void JustSummoned(Creature *summon)
{
Summons.Summon(summon);
}
uint32 GetSpellForPhaseMask(uint32 phase)
{
uint32 spell = 0;
switch (phase)
{
case 16:
spell = SPELL_INSANITY_PHASING_1;
break;
case 32:
spell = SPELL_INSANITY_PHASING_2;
break;
case 64:
spell = SPELL_INSANITY_PHASING_3;
break;
case 128:
spell = SPELL_INSANITY_PHASING_4;
break;
case 256:
spell = SPELL_INSANITY_PHASING_5;
break;
}
return spell;
}
void SummonedCreatureDespawn(Creature *summon)
{
uint32 phase= summon->GetPhaseMask();
uint32 nextPhase = 0;
Summons.Despawn(summon);
// Check if all summons in this phase killed
for (SummonList::const_iterator iter = Summons.begin(); iter != Summons.end(); ++iter)
{
if (Creature *visage = Unit::GetCreature(*me, *iter))
Map::PlayerList const &PlayerList = pMap->GetPlayers();
if (!PlayerList.isEmpty())
{
// Not all are dead
if (phase == visage->GetPhaseMask())
return;
else
nextPhase = visage->GetPhaseMask();
}
}
// Roll Insanity
uint32 spell = GetSpellForPhaseMask(phase);
uint32 spell2 = GetSpellForPhaseMask(nextPhase);
Map* pMap = me->GetMap();
if (!pMap)
return;
Map::PlayerList const &PlayerList = pMap->GetPlayers();
if (!PlayerList.isEmpty())
{
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (Player* pPlayer = i->getSource())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (pPlayer->HasAura(spell))
if (Player* pPlayer = i->getSource())
{
pPlayer->RemoveAurasDueToSpell(spell);
if (spell2) // if there is still some different mask cast spell for it
pPlayer->CastSpell(pPlayer, spell2, true);
if (pPlayer->HasAura(spell))
{
pPlayer->RemoveAurasDueToSpell(spell);
if (spell2) // if there is still some different mask cast spell for it
pPlayer->CastSpell(pPlayer, spell2, true);
}
}
}
}
}
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (insanityHandled)
void UpdateAI(const uint32 diff)
{
if (!Summons.empty())
//Return since we have no target
if (!UpdateVictim())
return;
insanityHandled = 0;
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetControlled(false, UNIT_STAT_STUNNED);
me->RemoveAurasDueToSpell(INSANITY_VISUAL);
if (insanityHandled)
{
if (!Summons.empty())
return;
insanityHandled = 0;
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetControlled(false, UNIT_STAT_STUNNED);
me->RemoveAurasDueToSpell(INSANITY_VISUAL);
}
if (uiMindFlayTimer <= diff)
{
DoCast(me->getVictim(), SPELL_MIND_FLAY);
uiMindFlayTimer = 20*IN_MILLISECONDS;
} else uiMindFlayTimer -= diff;
if (uiShadowBoltVolleyTimer <= diff)
{
DoCast(me->getVictim(), SPELL_SHADOW_BOLT_VOLLEY);
uiShadowBoltVolleyTimer = 5*IN_MILLISECONDS;
} else uiShadowBoltVolleyTimer -= diff;
if (uiShiverTimer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_SHIVER);
uiShiverTimer = 15*IN_MILLISECONDS;
} else uiShiverTimer -= diff;
DoMeleeAttackIfReady();
}
if (uiMindFlayTimer <= diff)
void JustDied(Unit* /*killer*/)
{
DoCast(me->getVictim(), SPELL_MIND_FLAY);
uiMindFlayTimer = 20*IN_MILLISECONDS;
} else uiMindFlayTimer -= diff;
DoScriptText(SAY_DEATH_1, me);
if (uiShadowBoltVolleyTimer <= diff)
if (pInstance)
pInstance->SetData(DATA_HERALD_VOLAZJ, DONE);
Summons.DespawnAll();
ResetPlayersPhaseMask();
}
void KilledUnit(Unit * /*victim*/)
{
DoCast(me->getVictim(), SPELL_SHADOW_BOLT_VOLLEY);
uiShadowBoltVolleyTimer = 5*IN_MILLISECONDS;
} else uiShadowBoltVolleyTimer -= diff;
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
};
if (uiShiverTimer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_SHIVER);
uiShiverTimer = 15*IN_MILLISECONDS;
} else uiShiverTimer -= diff;
DoMeleeAttackIfReady();
}
void JustDied(Unit* /*killer*/)
CreatureAI *GetAI(Creature *creature) const
{
DoScriptText(SAY_DEATH_1, me);
if (pInstance)
pInstance->SetData(DATA_HERALD_VOLAZJ, DONE);
Summons.DespawnAll();
ResetPlayersPhaseMask();
}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
return new boss_volazjAI(creature);
}
};
CreatureAI* GetAI_boss_volazj(Creature* pCreature)
{
return new boss_volazjAI (pCreature);
}
void AddSC_boss_volazj()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_volazj";
newscript->GetAI = &GetAI_boss_volazj;
newscript->RegisterSelf();
new boss_volazj;
}

View File

@@ -63,417 +63,426 @@ const Position JedogaPosition[2] =
{372.330994f, -705.278015f, -16.179716f, 5.427970f}
};
struct boss_jedoga_shadowseekerAI : public ScriptedAI
class boss_jedoga_shadowseeker : public CreatureScript
{
boss_jedoga_shadowseekerAI(Creature* c) : ScriptedAI(c)
public:
boss_jedoga_shadowseeker() : CreatureScript("boss_jedoga_shadowseeker") { }
struct boss_jedoga_shadowseekerAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
bFirstTime = true;
bPreDone = false;
}
ScriptedInstance* pInstance;
uint32 uiOpFerTimer;
uint32 uiCycloneTimer;
uint32 uiBoltTimer;
uint32 uiThunderTimer;
bool bPreDone;
bool bOpFerok;
bool bOnGround;
bool bOpFerokFail;
bool bCanDown;
bool bFirstTime;
void Reset()
{
uiOpFerTimer = urand(15*IN_MILLISECONDS,20*IN_MILLISECONDS);
uiCycloneTimer = 3*IN_MILLISECONDS;
uiBoltTimer = 7*IN_MILLISECONDS;
uiThunderTimer = 12*IN_MILLISECONDS;
bOpFerok = false;
bOpFerokFail = false;
bOnGround = false;
bCanDown = false;
if (pInstance)
boss_jedoga_shadowseekerAI(Creature* c) : ScriptedAI(c)
{
if (!bFirstTime)
pInstance->SetData(DATA_JEDOGA_SHADOWSEEKER_EVENT, FAIL);
pInstance->SetData64(DATA_PL_JEDOGA_TARGET, 0);
pInstance->SetData64(DATA_ADD_JEDOGA_OPFER, 0);
pInstance->SetData(DATA_JEDOGA_RESET_INITIANDS, 0);
}
MoveUp();
bFirstTime = false;
}
void EnterCombat(Unit* who)
{
if (!pInstance || (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_JEDOGA_CONTROLLER))
return;
DoScriptText(TEXT_AGGRO, me);
me->SetInCombatWithZone();
pInstance->SetData(DATA_JEDOGA_SHADOWSEEKER_EVENT, IN_PROGRESS);
}
void AttackStart(Unit* who)
{
if (!who || (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_JEDOGA_CONTROLLER))
return;
ScriptedAI::AttackStart(who);
}
void KilledUnit(Unit* Victim)
{
if (!Victim || Victim->GetTypeId() != TYPEID_PLAYER)
return;
DoScriptText(RAND(TEXT_SLAY_1, TEXT_SLAY_2, TEXT_SLAY_3), me);
}
void JustDied(Unit* /*Killer*/)
{
DoScriptText(TEXT_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_JEDOGA_SHADOWSEEKER_EVENT, DONE);
}
void MoveInLineOfSight(Unit* who)
{
if (!pInstance || !who || (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_JEDOGA_CONTROLLER))
return;
if (!bPreDone && who->GetTypeId() == TYPEID_PLAYER && me->GetDistance(who) < 100.0f)
{
DoScriptText(RAND(TEXT_PREACHING_1, TEXT_PREACHING_2, TEXT_PREACHING_3, TEXT_PREACHING_4, TEXT_PREACHING_5), me);
bPreDone = true;
pInstance = c->GetInstanceData();
bFirstTime = true;
bPreDone = false;
}
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS || !bOnGround)
return;
ScriptedInstance* pInstance;
if (!me->getVictim() && who->isTargetableForAttack() && me->IsHostileTo(who) && who->isInAccessiblePlaceFor(me))
uint32 uiOpFerTimer;
uint32 uiCycloneTimer;
uint32 uiBoltTimer;
uint32 uiThunderTimer;
bool bPreDone;
bool bOpFerok;
bool bOnGround;
bool bOpFerokFail;
bool bCanDown;
bool bFirstTime;
void Reset()
{
float attackRadius = me->GetAttackDistance(who);
if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
{
if (!me->getVictim())
{
who->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
AttackStart(who);
}
else if (me->GetMap()->IsDungeon())
{
who->SetInCombatWith(me);
me->AddThreat(who, 0.0f);
}
}
}
}
uiOpFerTimer = urand(15*IN_MILLISECONDS,20*IN_MILLISECONDS);
void MoveDown()
{
if (!pInstance)
return;
uiCycloneTimer = 3*IN_MILLISECONDS;
uiBoltTimer = 7*IN_MILLISECONDS;
uiThunderTimer = 12*IN_MILLISECONDS;
bOpFerokFail = false;
pInstance->SetData(DATA_JEDOGA_TRIGGER_SWITCH, 0);
me->GetMotionMaster()->MovePoint(1, JedogaPosition[1]);
/* me->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING);
me->SendMonsterMove(JedogaPosition[1], MOVEFLAG_JUMP, 0);
me->Relocate(JedogaPosition[1][0], JedogaPosition[1][1], JedogaPosition[1][2], JedogaPosition[1][3]);
me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
*/
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, false);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, false);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
me->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);
bOnGround = true;
if (UpdateVictim())
{
AttackStart(me->getVictim());
me->GetMotionMaster()->MoveChase(me->getVictim());
}
else
{
if (Unit* pTarget = Unit::GetUnit(*me, pInstance->GetData64(DATA_PL_JEDOGA_TARGET)))
{
AttackStart(pTarget);
pInstance->SetData(DATA_JEDOGA_RESET_INITIANDS, 0);
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS)
EnterCombat(pTarget);
}
else if (!me->isInCombat())
EnterEvadeMode();
}
}
void MoveUp()
{
if (!pInstance)
return;
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
me->AttackStop();
me->RemoveAllAuras();
me->LoadCreaturesAddon();
me->GetMotionMaster()->MovePoint(0, JedogaPosition[0]);
/* me->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING);
me->SendMonsterMove(JedogaPosition[0][0], JedogaPosition[0][1], JedogaPosition[0][2], 0, MOVEFLAG_JUMP, 0);
me->Relocate(JedogaPosition[0][0], JedogaPosition[0][1], JedogaPosition[0][2], JedogaPosition[0][3]);
me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
me->StopMoving();
*/
pInstance->SetData(DATA_JEDOGA_TRIGGER_SWITCH, 1);
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == IN_PROGRESS) OpferRufen();
bOnGround = false;
uiOpFerTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS);
}
void OpferRufen()
{
if (!pInstance)
return;
uint64 opfer = pInstance->GetData64(DATA_ADD_JEDOGA_INITIAND);
if (opfer)
{
DoScriptText(RAND(TEXT_SACRIFICE_1_1, TEXT_SACRIFICE_1_2), me);
pInstance->SetData64(DATA_ADD_JEDOGA_OPFER, opfer);
} else
bCanDown = true;
}
void Opfern()
{
DoScriptText(RAND(TEXT_SACRIFICE_2_1, TEXT_SACRIFICE_2_2), me);
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_GIFT_OF_THE_HERALD, false);
bOpFerok = false;
bCanDown = true;
}
void UpdateAI(const uint32 diff)
{
if (!pInstance)
return;
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS && pInstance->GetData(DATA_ALL_INITIAND_DEAD))
MoveDown();
if (bOpFerok && !bOnGround && !bCanDown) Opfern();
if (bOpFerokFail && !bOnGround && !bCanDown)
bCanDown = true;
if (bCanDown)
{
MoveDown();
bOpFerok = false;
bOpFerokFail = false;
bOnGround = false;
bCanDown = false;
if (pInstance)
{
if (!bFirstTime)
pInstance->SetData(DATA_JEDOGA_SHADOWSEEKER_EVENT, FAIL);
pInstance->SetData64(DATA_PL_JEDOGA_TARGET, 0);
pInstance->SetData64(DATA_ADD_JEDOGA_OPFER, 0);
pInstance->SetData(DATA_JEDOGA_RESET_INITIANDS, 0);
}
MoveUp();
bFirstTime = false;
}
if (bOnGround)
void EnterCombat(Unit* who)
{
if (!UpdateVictim())
if (!pInstance || (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_JEDOGA_CONTROLLER))
return;
if (uiCycloneTimer <= diff)
{
DoCast(me, SPELL_CYCLONE_STRIKE, false);
uiCycloneTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS);
} else uiCycloneTimer -= diff;
if (uiBoltTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
me->CastSpell(pTarget, DUNGEON_MODE(SPELL_LIGHTNING_BOLT, SPELL_LIGHTNING_BOLT_H), false);
uiBoltTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS);
} else uiBoltTimer -= diff;
if (uiThunderTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
me->CastSpell(pTarget, DUNGEON_MODE(SPELL_THUNDERSHOCK, SPELL_THUNDERSHOCK_H), false);
uiThunderTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS);
} else uiThunderTimer -= diff;
if (uiOpFerTimer <= diff)
MoveUp();
else
uiOpFerTimer -= diff;
DoMeleeAttackIfReady();
DoScriptText(TEXT_AGGRO, me);
me->SetInCombatWithZone();
pInstance->SetData(DATA_JEDOGA_SHADOWSEEKER_EVENT, IN_PROGRESS);
}
}
};
struct mob_jedoga_initiandAI : public ScriptedAI
{
mob_jedoga_initiandAI(Creature* c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
uint32 bCheckTimer;
bool bWalking;
void Reset()
{
if (!pInstance)
return;
bWalking = false;
bCheckTimer = 2*IN_MILLISECONDS;
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS)
void AttackStart(Unit* who)
{
me->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);
if (!who || (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_JEDOGA_CONTROLLER))
return;
ScriptedAI::AttackStart(who);
}
void KilledUnit(Unit* Victim)
{
if (!Victim || Victim->GetTypeId() != TYPEID_PLAYER)
return;
DoScriptText(RAND(TEXT_SLAY_1, TEXT_SLAY_2, TEXT_SLAY_3), me);
}
void JustDied(Unit* /*Killer*/)
{
DoScriptText(TEXT_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_JEDOGA_SHADOWSEEKER_EVENT, DONE);
}
void MoveInLineOfSight(Unit* who)
{
if (!pInstance || !who || (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_JEDOGA_CONTROLLER))
return;
if (!bPreDone && who->GetTypeId() == TYPEID_PLAYER && me->GetDistance(who) < 100.0f)
{
DoScriptText(RAND(TEXT_PREACHING_1, TEXT_PREACHING_2, TEXT_PREACHING_3, TEXT_PREACHING_4, TEXT_PREACHING_5), me);
bPreDone = true;
}
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS || !bOnGround)
return;
if (!me->getVictim() && who->isTargetableForAttack() && me->IsHostileTo(who) && who->isInAccessiblePlaceFor(me))
{
float attackRadius = me->GetAttackDistance(who);
if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
{
if (!me->getVictim())
{
who->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
AttackStart(who);
}
else if (me->GetMap()->IsDungeon())
{
who->SetInCombatWith(me);
me->AddThreat(who, 0.0f);
}
}
}
}
void MoveDown()
{
if (!pInstance)
return;
bOpFerokFail = false;
pInstance->SetData(DATA_JEDOGA_TRIGGER_SWITCH, 0);
me->GetMotionMaster()->MovePoint(1, JedogaPosition[1]);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, false);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, false);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
me->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);
bOnGround = true;
if (UpdateVictim())
{
AttackStart(me->getVictim());
me->GetMotionMaster()->MoveChase(me->getVictim());
}
else
{
if (Unit* pTarget = Unit::GetUnit(*me, pInstance->GetData64(DATA_PL_JEDOGA_TARGET)))
{
AttackStart(pTarget);
pInstance->SetData(DATA_JEDOGA_RESET_INITIANDS, 0);
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS)
EnterCombat(pTarget);
}
else if (!me->isInCombat())
EnterEvadeMode();
}
}
else
void MoveUp()
{
DoCast(me, SPELL_SPHERE_VISUAL, false);
if (!pInstance)
return;
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
me->AttackStop();
me->RemoveAllAuras();
me->LoadCreaturesAddon();
me->GetMotionMaster()->MovePoint(0, JedogaPosition[0]);
pInstance->SetData(DATA_JEDOGA_TRIGGER_SWITCH, 1);
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == IN_PROGRESS) OpferRufen();
bOnGround = false;
uiOpFerTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS);
}
}
void JustDied(Unit* Killer)
{
if (!Killer || !pInstance) return;
if (bWalking)
void OpferRufen()
{
Creature* boss = me->GetMap()->GetCreature(pInstance->GetData64(DATA_JEDOGA_SHADOWSEEKER));
if (boss && !CAST_AI(boss_jedoga_shadowseekerAI, boss->AI())->bOpFerok) CAST_AI(boss_jedoga_shadowseekerAI, boss->AI())->bOpFerokFail = true;
if (!pInstance)
return;
if (Killer->GetTypeId() == TYPEID_PLAYER) pInstance->SetData(DATA_INITIAND_KILLED, 1);
pInstance->SetData64(DATA_ADD_JEDOGA_OPFER, 0);
uint64 opfer = pInstance->GetData64(DATA_ADD_JEDOGA_INITIAND);
if (opfer)
{
DoScriptText(RAND(TEXT_SACRIFICE_1_1, TEXT_SACRIFICE_1_2), me);
pInstance->SetData64(DATA_ADD_JEDOGA_OPFER, opfer);
} else
bCanDown = true;
}
void Opfern()
{
DoScriptText(RAND(TEXT_SACRIFICE_2_1, TEXT_SACRIFICE_2_2), me);
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_GIFT_OF_THE_HERALD, false);
bOpFerok = false;
bCanDown = true;
}
void UpdateAI(const uint32 diff)
{
if (!pInstance)
return;
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS && pInstance->GetData(DATA_ALL_INITIAND_DEAD))
MoveDown();
if (bOpFerok && !bOnGround && !bCanDown) Opfern();
if (bOpFerokFail && !bOnGround && !bCanDown)
bCanDown = true;
if (bCanDown)
{
MoveDown();
bCanDown = false;
}
if (bOnGround)
{
if (!UpdateVictim())
return;
if (uiCycloneTimer <= diff)
{
DoCast(me, SPELL_CYCLONE_STRIKE, false);
uiCycloneTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS);
} else uiCycloneTimer -= diff;
if (uiBoltTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
me->CastSpell(pTarget, DUNGEON_MODE(SPELL_LIGHTNING_BOLT, SPELL_LIGHTNING_BOLT_H), false);
uiBoltTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS);
} else uiBoltTimer -= diff;
if (uiThunderTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
me->CastSpell(pTarget, DUNGEON_MODE(SPELL_THUNDERSHOCK, SPELL_THUNDERSHOCK_H), false);
uiThunderTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS);
} else uiThunderTimer -= diff;
if (uiOpFerTimer <= diff)
MoveUp();
else
uiOpFerTimer -= diff;
DoMeleeAttackIfReady();
}
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new boss_jedoga_shadowseekerAI(creature);
}
};
class mob_jedoga_initiand : public CreatureScript
{
public:
mob_jedoga_initiand() : CreatureScript("mob_jedoga_initiand") { }
struct mob_jedoga_initiandAI : public ScriptedAI
{
mob_jedoga_initiandAI(Creature* c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
uint32 bCheckTimer;
bool bWalking;
void Reset()
{
if (!pInstance)
return;
bWalking = false;
}
if (Killer->GetTypeId() == TYPEID_PLAYER) pInstance->SetData64(DATA_PL_JEDOGA_TARGET, Killer->GetGUID());
}
bCheckTimer = 2*IN_MILLISECONDS;
void EnterCombat(Unit* who)
{
if ((pInstance && pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == IN_PROGRESS) || !who) return;
}
void AttackStart(Unit* victim)
{
if ((pInstance && pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == IN_PROGRESS) || !victim) return;
ScriptedAI::AttackStart(victim);
}
void MoveInLineOfSight(Unit* who)
{
if ((pInstance && pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == IN_PROGRESS) || !who) return;
ScriptedAI::MoveInLineOfSight(who);
}
void MovementInform(uint32 uiType, uint32 uiPointId)
{
if (uiType != POINT_MOTION_TYPE || !pInstance) return;
switch(uiPointId)
{
case 1:
{
Creature* boss = me->GetMap()->GetCreature(pInstance->GetData64(DATA_JEDOGA_SHADOWSEEKER));
if (boss)
{
CAST_AI(boss_jedoga_shadowseekerAI, boss->AI())->bOpFerok = true;
CAST_AI(boss_jedoga_shadowseekerAI, boss->AI())->bOpFerokFail = false;
me->Kill(me);
}
}
break;
}
}
void UpdateAI(const uint32 diff)
{
if (pInstance && bCheckTimer <= diff)
{
if (me->GetGUID() == pInstance->GetData64(DATA_ADD_JEDOGA_OPFER) && !bWalking)
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS)
{
me->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, false);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, false);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
float distance = me->GetDistance(JedogaPosition[1]);
if (distance < 9.0f)
me->SetSpeed(MOVE_WALK, 0.5f, true);
else if (distance < 15.0f)
me->SetSpeed(MOVE_WALK, 0.75f, true);
else if (distance < 20.0f)
me->SetSpeed(MOVE_WALK, 1.0f, true);
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MovePoint(1, JedogaPosition[1]);
bWalking = true;
}
if (!bWalking)
else
{
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS && me->HasAura(SPELL_SPHERE_VISUAL))
DoCast(me, SPELL_SPHERE_VISUAL, false);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
}
}
void JustDied(Unit* Killer)
{
if (!Killer || !pInstance) return;
if (bWalking)
{
Creature* boss = me->GetMap()->GetCreature(pInstance->GetData64(DATA_JEDOGA_SHADOWSEEKER));
if (boss && !CAST_AI(boss_jedoga_shadowseeker::boss_jedoga_shadowseekerAI, boss->AI())->bOpFerok) CAST_AI(boss_jedoga_shadowseeker::boss_jedoga_shadowseekerAI, boss->AI())->bOpFerokFail = true;
if (Killer->GetTypeId() == TYPEID_PLAYER) pInstance->SetData(DATA_INITIAND_KILLED, 1);
pInstance->SetData64(DATA_ADD_JEDOGA_OPFER, 0);
bWalking = false;
}
if (Killer->GetTypeId() == TYPEID_PLAYER) pInstance->SetData64(DATA_PL_JEDOGA_TARGET, Killer->GetGUID());
}
void EnterCombat(Unit* who)
{
if ((pInstance && pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == IN_PROGRESS) || !who) return;
}
void AttackStart(Unit* victim)
{
if ((pInstance && pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == IN_PROGRESS) || !victim) return;
ScriptedAI::AttackStart(victim);
}
void MoveInLineOfSight(Unit* who)
{
if ((pInstance && pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == IN_PROGRESS) || !who) return;
ScriptedAI::MoveInLineOfSight(who);
}
void MovementInform(uint32 uiType, uint32 uiPointId)
{
if (uiType != POINT_MOTION_TYPE || !pInstance) return;
switch(uiPointId)
{
case 1:
{
Creature* boss = me->GetMap()->GetCreature(pInstance->GetData64(DATA_JEDOGA_SHADOWSEEKER));
if (boss)
{
CAST_AI(boss_jedoga_shadowseeker::boss_jedoga_shadowseekerAI, boss->AI())->bOpFerok = true;
CAST_AI(boss_jedoga_shadowseeker::boss_jedoga_shadowseekerAI, boss->AI())->bOpFerokFail = false;
me->Kill(me);
}
}
break;
}
}
void UpdateAI(const uint32 diff)
{
if (pInstance && bCheckTimer <= diff)
{
if (me->GetGUID() == pInstance->GetData64(DATA_ADD_JEDOGA_OPFER) && !bWalking)
{
me->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, false);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, false);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
float distance = me->GetDistance(JedogaPosition[1]);
if (distance < 9.0f)
me->SetSpeed(MOVE_WALK, 0.5f, true);
else if (distance < 15.0f)
me->SetSpeed(MOVE_WALK, 0.75f, true);
else if (distance < 20.0f)
me->SetSpeed(MOVE_WALK, 1.0f, true);
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MovePoint(1, JedogaPosition[1]);
bWalking = true;
}
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == IN_PROGRESS && !me->HasAura(SPELL_SPHERE_VISUAL))
if (!bWalking)
{
DoCast(me, SPELL_SPHERE_VISUAL, false);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS && me->HasAura(SPELL_SPHERE_VISUAL))
{
me->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, false);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, false);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
}
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == IN_PROGRESS && !me->HasAura(SPELL_SPHERE_VISUAL))
{
DoCast(me, SPELL_SPHERE_VISUAL, false);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
}
}
}
bCheckTimer = 2*IN_MILLISECONDS;
} else bCheckTimer -= diff;
bCheckTimer = 2*IN_MILLISECONDS;
} else bCheckTimer -= diff;
//Return since we have no target
if (!UpdateVictim())
return;
//Return since we have no target
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
DoMeleeAttackIfReady();
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new mob_jedoga_initiandAI(creature);
}
};
@@ -486,102 +495,83 @@ enum AufseherSpell
SPELL_BEAM_VISUAL_JEDOGAS_AUFSEHER_2 = 56312
};
struct npc_jedogas_aufseher_triggerAI : public Scripted_NoMovementAI
class npc_jedogas_aufseher_trigger : public CreatureScript
{
npc_jedogas_aufseher_triggerAI(Creature* c) : Scripted_NoMovementAI(c)
public:
npc_jedogas_aufseher_trigger() : CreatureScript("npc_jedogas_aufseher_trigger") { }
struct npc_jedogas_aufseher_triggerAI : public Scripted_NoMovementAI
{
pInstance = c->GetInstanceData();
// c->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
// c->setFaction(35);
bRemoved = false;
bRemoved2 = false;
bCasted = false;
bCasted2 = false;
}
ScriptedInstance* pInstance;
bool bRemoved;
bool bRemoved2;
bool bCasted;
bool bCasted2;
void Reset() {}
void EnterCombat(Unit* /*who*/) {}
void AttackStart(Unit* /*victim*/) {}
void MoveInLineOfSight(Unit* /*who*/) {}
void UpdateAI(const uint32 /*diff*/)
{
if (!pInstance)
return;
if (!bRemoved && me->GetPositionX() > 440.0f)
npc_jedogas_aufseher_triggerAI(Creature* c) : Scripted_NoMovementAI(c)
{
if (pInstance->GetData(DATA_PRINCE_TALDARAM_EVENT) == DONE)
{
me->InterruptNonMeleeSpells(true);
bRemoved = true;
pInstance = c->GetInstanceData();
bRemoved = false;
bRemoved2 = false;
bCasted = false;
bCasted2 = false;
}
ScriptedInstance* pInstance;
bool bRemoved;
bool bRemoved2;
bool bCasted;
bool bCasted2;
void Reset() {}
void EnterCombat(Unit* /*who*/) {}
void AttackStart(Unit* /*victim*/) {}
void MoveInLineOfSight(Unit* /*who*/) {}
void UpdateAI(const uint32 /*diff*/)
{
if (!pInstance)
return;
}
if (!bCasted)
if (!bRemoved && me->GetPositionX() > 440.0f)
{
DoCast(me, SPELL_BEAM_VISUAL_JEDOGAS_AUFSEHER_1, false);
bCasted = true;
}
}
if (!bRemoved2 && me->GetPositionX() < 440.0f)
{
if (!bCasted2 && pInstance->GetData(DATA_JEDOGA_TRIGGER_SWITCH))
{
DoCast(me, SPELL_BEAM_VISUAL_JEDOGAS_AUFSEHER_2, false);
bCasted2 = true;
}
if (bCasted2 && !pInstance->GetData(DATA_JEDOGA_TRIGGER_SWITCH))
{
me->InterruptNonMeleeSpells(true);
bCasted2 = false;
}
if (!bRemoved2 && pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == DONE)
{
me->InterruptNonMeleeSpells(true);
bRemoved2 = true;
if (pInstance->GetData(DATA_PRINCE_TALDARAM_EVENT) == DONE)
{
me->InterruptNonMeleeSpells(true);
bRemoved = true;
return;
}
if (!bCasted)
{
DoCast(me, SPELL_BEAM_VISUAL_JEDOGAS_AUFSEHER_1, false);
bCasted = true;
}
}
if (!bRemoved2 && me->GetPositionX() < 440.0f)
{
if (!bCasted2 && pInstance->GetData(DATA_JEDOGA_TRIGGER_SWITCH))
{
DoCast(me, SPELL_BEAM_VISUAL_JEDOGAS_AUFSEHER_2, false);
bCasted2 = true;
}
if (bCasted2 && !pInstance->GetData(DATA_JEDOGA_TRIGGER_SWITCH))
{
me->InterruptNonMeleeSpells(true);
bCasted2 = false;
}
if (!bRemoved2 && pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == DONE)
{
me->InterruptNonMeleeSpells(true);
bRemoved2 = true;
}
}
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new npc_jedogas_aufseher_triggerAI(creature);
}
};
CreatureAI* GetAI_boss_jedoga_shadowseeker(Creature* pCreature)
{
return new boss_jedoga_shadowseekerAI (pCreature);
}
CreatureAI* GetAI_mob_jedoga_initiand(Creature* pCreature)
{
return new mob_jedoga_initiandAI (pCreature);
}
CreatureAI* GetAI_npc_jedogas_aufseher_trigger(Creature* pCreature)
{
return new npc_jedogas_aufseher_triggerAI (pCreature);
}
void AddSC_boss_jedoga_shadowseeker()
{
Script* newscript;
newscript = new Script;
newscript->Name = "boss_jedoga_shadowseeker";
newscript->GetAI = &GetAI_boss_jedoga_shadowseeker;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_jedoga_initiand";
newscript->GetAI = &GetAI_mob_jedoga_initiand;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_jedogas_aufseher_trigger";
newscript->GetAI = &GetAI_npc_jedogas_aufseher_trigger;
newscript->RegisterSelf();
new boss_jedoga_shadowseeker;
new mob_jedoga_initiand;
new npc_jedogas_aufseher_trigger;
}

View File

@@ -72,340 +72,345 @@ enum GameObjects
GO_SPHERE2 = 193094
};
struct boss_taldaramAI : public ScriptedAI
class boss_taldaram : public CreatureScript
{
boss_taldaramAI(Creature *c) : ScriptedAI(c)
public:
boss_taldaram() : CreatureScript("boss_taldaram") { }
struct boss_taldaramAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
uint32 uiBloodthirstTimer;
uint32 uiVanishTimer;
uint32 uiWaitTimer;
uint32 uiEmbraceTimer;
uint32 uiEmbraceTakenDamage;
uint32 uiFlamesphereTimer;
uint32 uiPhaseTimer;
uint64 uiEmbraceTarget;
CombatPhase Phase;
ScriptedInstance* pInstance;
void Reset()
{
uiBloodthirstTimer = 10*IN_MILLISECONDS;
uiVanishTimer = urand(25*IN_MILLISECONDS,35*IN_MILLISECONDS);
uiEmbraceTimer = 20*IN_MILLISECONDS;
uiFlamesphereTimer = 5*IN_MILLISECONDS;
uiEmbraceTakenDamage = 0;
Phase = NORMAL;
uiPhaseTimer = 0;
uiEmbraceTarget = 0;
if (pInstance)
pInstance->SetData(DATA_PRINCE_TALDARAM_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/)
{
if (pInstance)
pInstance->SetData(DATA_PRINCE_TALDARAM_EVENT, IN_PROGRESS);
DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (uiPhaseTimer <= diff)
boss_taldaramAI(Creature *c) : ScriptedAI(c)
{
switch (Phase)
{
case CASTING_FLAME_SPHERES:
{
Creature* pSpheres[3];
//DoCast(me, SPELL_FLAME_SPHERE_SUMMON_1);
pSpheres[0] = DoSpawnCreature(CREATURE_FLAME_SPHERE, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS);
Unit *pSphereTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (pSphereTarget && pSpheres[0])
{
float angle,x,y;
angle = pSpheres[0]->GetAngle(pSphereTarget);
x = pSpheres[0]->GetPositionX() + DATA_SPHERE_DISTANCE * cos(angle);
y = pSpheres[0]->GetPositionY() + DATA_SPHERE_DISTANCE * sin(angle);
pSpheres[0]->GetMotionMaster()->MovePoint(0, x, y, pSpheres[0]->GetPositionZ());
}
if (IsHeroic())
{
//DoCast(me, H_SPELL_FLAME_SPHERE_SUMMON_1);
pSpheres[1] = DoSpawnCreature(H_CREATURE_FLAME_SPHERE_1, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS);
//DoCast(me, H_SPELL_FLAME_SPHERE_SUMMON_2);
pSpheres[2] = DoSpawnCreature(H_CREATURE_FLAME_SPHERE_2, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS);
if (pSphereTarget && pSpheres[1] && pSpheres[2])
{
float angle,x,y;
angle = pSpheres[1]->GetAngle(pSphereTarget) + DATA_SPHERE_ANGLE_OFFSET;
x = pSpheres[1]->GetPositionX() + DATA_SPHERE_DISTANCE/2 * cos(angle);
y = pSpheres[1]->GetPositionY() + DATA_SPHERE_DISTANCE/2 * sin(angle);
pSpheres[1]->GetMotionMaster()->MovePoint(0, x, y, pSpheres[1]->GetPositionZ());
angle = pSpheres[2]->GetAngle(pSphereTarget) - DATA_SPHERE_ANGLE_OFFSET;
x = pSpheres[2]->GetPositionX() + DATA_SPHERE_DISTANCE/2 * cos(angle);
y = pSpheres[2]->GetPositionY() + DATA_SPHERE_DISTANCE/2 * sin(angle);
pSpheres[2]->GetMotionMaster()->MovePoint(0, x, y, pSpheres[2]->GetPositionZ());
}
}
Phase = NORMAL;
uiPhaseTimer = 0;
break;
}
case JUST_VANISHED:
if (Unit *pEmbraceTarget = GetEmbraceTarget())
{
me->GetMotionMaster()->Clear();
me->SetSpeed(MOVE_WALK, 2.0f, true);
me->GetMotionMaster()->MoveChase(pEmbraceTarget);
}
Phase = VANISHED;
uiPhaseTimer = 1300;
break;
case VANISHED:
if (Unit *pEmbraceTarget = GetEmbraceTarget())
DoCast(pEmbraceTarget, SPELL_EMBRACE_OF_THE_VAMPYR);
me->GetMotionMaster()->Clear();
me->SetSpeed(MOVE_WALK, 1.0f, true);
me->GetMotionMaster()->MoveChase(me->getVictim());
Phase = FEEDING;
uiPhaseTimer = 20*IN_MILLISECONDS;
break;
case FEEDING:
Phase = NORMAL;
uiPhaseTimer = 0;
uiEmbraceTarget = 0;
break;
case NORMAL:
if (uiBloodthirstTimer <= diff)
{
DoCast(me->getVictim(), SPELL_BLOODTHIRST);
uiBloodthirstTimer = 10*IN_MILLISECONDS;
} else uiBloodthirstTimer -= diff;
if (uiFlamesphereTimer <= diff)
{
DoCast(me, SPELL_CONJURE_FLAME_SPHERE);
Phase = CASTING_FLAME_SPHERES;
uiPhaseTimer = 3*IN_MILLISECONDS + diff;
uiFlamesphereTimer = 15*IN_MILLISECONDS;
} else uiFlamesphereTimer -= diff;
if (uiVanishTimer <= diff)
{
//Count alive players
Unit *pTarget = NULL;
std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
std::vector<Unit *> target_list;
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
// exclude pets & totems
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive())
target_list.push_back(pTarget);
pTarget = NULL;
}
//He only vanishes if there are 3 or more alive players
if (target_list.size() > 2)
{
DoScriptText(RAND(SAY_VANISH_1,SAY_VANISH_2), me);
DoCast(me, SPELL_VANISH);
Phase = JUST_VANISHED;
uiPhaseTimer = 500;
if (Unit* pEmbraceTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
uiEmbraceTarget = pEmbraceTarget->GetGUID();
}
uiVanishTimer = urand(25*IN_MILLISECONDS,35*IN_MILLISECONDS);
} else uiVanishTimer -= diff;
DoMeleeAttackIfReady();
break;
}
} else uiPhaseTimer -= diff;
}
void DamageTaken(Unit* /*done_by*/, uint32 &damage)
{
Unit* pEmbraceTarget = GetEmbraceTarget();
if (Phase == FEEDING && pEmbraceTarget && pEmbraceTarget->isAlive())
{
uiEmbraceTakenDamage += damage;
if (uiEmbraceTakenDamage > DUNGEON_MODE(DATA_EMBRACE_DMG, H_DATA_EMBRACE_DMG))
{
Phase = NORMAL;
uiPhaseTimer = 0;
uiEmbraceTarget = 0;
me->CastStop();
}
pInstance = c->GetInstanceData();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
}
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
uint32 uiBloodthirstTimer;
uint32 uiVanishTimer;
uint32 uiWaitTimer;
uint32 uiEmbraceTimer;
uint32 uiEmbraceTakenDamage;
uint32 uiFlamesphereTimer;
uint32 uiPhaseTimer;
if (pInstance)
pInstance->SetData(DATA_PRINCE_TALDARAM_EVENT, DONE);
}
uint64 uiEmbraceTarget;
void KilledUnit(Unit * victim)
{
if (victim == me)
return;
CombatPhase Phase;
Unit* pEmbraceTarget = GetEmbraceTarget();
if (Phase == FEEDING && pEmbraceTarget && victim == pEmbraceTarget)
ScriptedInstance* pInstance;
void Reset()
{
uiBloodthirstTimer = 10*IN_MILLISECONDS;
uiVanishTimer = urand(25*IN_MILLISECONDS,35*IN_MILLISECONDS);
uiEmbraceTimer = 20*IN_MILLISECONDS;
uiFlamesphereTimer = 5*IN_MILLISECONDS;
uiEmbraceTakenDamage = 0;
Phase = NORMAL;
uiPhaseTimer = 0;
uiEmbraceTarget = 0;
if (pInstance)
pInstance->SetData(DATA_PRINCE_TALDARAM_EVENT, NOT_STARTED);
}
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
bool CheckSpheres()
{
if (!pInstance)
return false;
uint64 uiSphereGuids[2];
uiSphereGuids[0] = pInstance->GetData64(DATA_SPHERE1);
uiSphereGuids[1] = pInstance->GetData64(DATA_SPHERE2);
for (uint8 i=0; i < 2; ++i)
void EnterCombat(Unit* /*who*/)
{
GameObject *pSpheres = pInstance->instance->GetGameObject(uiSphereGuids[i]);
if (!pSpheres)
return false;
if (pSpheres->GetGoState() != GO_STATE_ACTIVE)
return false;
if (pInstance)
pInstance->SetData(DATA_PRINCE_TALDARAM_EVENT, IN_PROGRESS);
DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (uiPhaseTimer <= diff)
{
switch (Phase)
{
case CASTING_FLAME_SPHERES:
{
Creature* pSpheres[3];
//DoCast(me, SPELL_FLAME_SPHERE_SUMMON_1);
pSpheres[0] = DoSpawnCreature(CREATURE_FLAME_SPHERE, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS);
Unit *pSphereTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (pSphereTarget && pSpheres[0])
{
float angle,x,y;
angle = pSpheres[0]->GetAngle(pSphereTarget);
x = pSpheres[0]->GetPositionX() + DATA_SPHERE_DISTANCE * cos(angle);
y = pSpheres[0]->GetPositionY() + DATA_SPHERE_DISTANCE * sin(angle);
pSpheres[0]->GetMotionMaster()->MovePoint(0, x, y, pSpheres[0]->GetPositionZ());
}
if (IsHeroic())
{
//DoCast(me, H_SPELL_FLAME_SPHERE_SUMMON_1);
pSpheres[1] = DoSpawnCreature(H_CREATURE_FLAME_SPHERE_1, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS);
//DoCast(me, H_SPELL_FLAME_SPHERE_SUMMON_2);
pSpheres[2] = DoSpawnCreature(H_CREATURE_FLAME_SPHERE_2, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS);
if (pSphereTarget && pSpheres[1] && pSpheres[2])
{
float angle,x,y;
angle = pSpheres[1]->GetAngle(pSphereTarget) + DATA_SPHERE_ANGLE_OFFSET;
x = pSpheres[1]->GetPositionX() + DATA_SPHERE_DISTANCE/2 * cos(angle);
y = pSpheres[1]->GetPositionY() + DATA_SPHERE_DISTANCE/2 * sin(angle);
pSpheres[1]->GetMotionMaster()->MovePoint(0, x, y, pSpheres[1]->GetPositionZ());
angle = pSpheres[2]->GetAngle(pSphereTarget) - DATA_SPHERE_ANGLE_OFFSET;
x = pSpheres[2]->GetPositionX() + DATA_SPHERE_DISTANCE/2 * cos(angle);
y = pSpheres[2]->GetPositionY() + DATA_SPHERE_DISTANCE/2 * sin(angle);
pSpheres[2]->GetMotionMaster()->MovePoint(0, x, y, pSpheres[2]->GetPositionZ());
}
}
Phase = NORMAL;
uiPhaseTimer = 0;
break;
}
case JUST_VANISHED:
if (Unit *pEmbraceTarget = GetEmbraceTarget())
{
me->GetMotionMaster()->Clear();
me->SetSpeed(MOVE_WALK, 2.0f, true);
me->GetMotionMaster()->MoveChase(pEmbraceTarget);
}
Phase = VANISHED;
uiPhaseTimer = 1300;
break;
case VANISHED:
if (Unit *pEmbraceTarget = GetEmbraceTarget())
DoCast(pEmbraceTarget, SPELL_EMBRACE_OF_THE_VAMPYR);
me->GetMotionMaster()->Clear();
me->SetSpeed(MOVE_WALK, 1.0f, true);
me->GetMotionMaster()->MoveChase(me->getVictim());
Phase = FEEDING;
uiPhaseTimer = 20*IN_MILLISECONDS;
break;
case FEEDING:
Phase = NORMAL;
uiPhaseTimer = 0;
uiEmbraceTarget = 0;
break;
case NORMAL:
if (uiBloodthirstTimer <= diff)
{
DoCast(me->getVictim(), SPELL_BLOODTHIRST);
uiBloodthirstTimer = 10*IN_MILLISECONDS;
} else uiBloodthirstTimer -= diff;
if (uiFlamesphereTimer <= diff)
{
DoCast(me, SPELL_CONJURE_FLAME_SPHERE);
Phase = CASTING_FLAME_SPHERES;
uiPhaseTimer = 3*IN_MILLISECONDS + diff;
uiFlamesphereTimer = 15*IN_MILLISECONDS;
} else uiFlamesphereTimer -= diff;
if (uiVanishTimer <= diff)
{
//Count alive players
Unit *pTarget = NULL;
std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
std::vector<Unit *> target_list;
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
// exclude pets & totems
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive())
target_list.push_back(pTarget);
pTarget = NULL;
}
//He only vanishes if there are 3 or more alive players
if (target_list.size() > 2)
{
DoScriptText(RAND(SAY_VANISH_1,SAY_VANISH_2), me);
DoCast(me, SPELL_VANISH);
Phase = JUST_VANISHED;
uiPhaseTimer = 500;
if (Unit* pEmbraceTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
uiEmbraceTarget = pEmbraceTarget->GetGUID();
}
uiVanishTimer = urand(25*IN_MILLISECONDS,35*IN_MILLISECONDS);
} else uiVanishTimer -= diff;
DoMeleeAttackIfReady();
break;
}
} else uiPhaseTimer -= diff;
}
void DamageTaken(Unit* /*done_by*/, uint32 &damage)
{
Unit* pEmbraceTarget = GetEmbraceTarget();
if (Phase == FEEDING && pEmbraceTarget && pEmbraceTarget->isAlive())
{
uiEmbraceTakenDamage += damage;
if (uiEmbraceTakenDamage > DUNGEON_MODE(DATA_EMBRACE_DMG, H_DATA_EMBRACE_DMG))
{
Phase = NORMAL;
uiPhaseTimer = 0;
uiEmbraceTarget = 0;
me->CastStop();
}
}
}
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_PRINCE_TALDARAM_EVENT, DONE);
}
void KilledUnit(Unit * victim)
{
if (victim == me)
return;
Unit* pEmbraceTarget = GetEmbraceTarget();
if (Phase == FEEDING && pEmbraceTarget && victim == pEmbraceTarget)
{
Phase = NORMAL;
uiPhaseTimer = 0;
uiEmbraceTarget = 0;
}
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
bool CheckSpheres()
{
if (!pInstance)
return false;
uint64 uiSphereGuids[2];
uiSphereGuids[0] = pInstance->GetData64(DATA_SPHERE1);
uiSphereGuids[1] = pInstance->GetData64(DATA_SPHERE2);
for (uint8 i=0; i < 2; ++i)
{
GameObject *pSpheres = pInstance->instance->GetGameObject(uiSphereGuids[i]);
if (!pSpheres)
return false;
if (pSpheres->GetGoState() != GO_STATE_ACTIVE)
return false;
}
RemovePrison();
return true;
}
Unit* GetEmbraceTarget()
{
if (!uiEmbraceTarget)
return NULL;
return Unit::GetUnit(*me, uiEmbraceTarget);
}
void RemovePrison()
{
if (!pInstance)
return;
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->RemoveAurasDueToSpell(SPELL_BEAM_VISUAL);
me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), DATA_GROUND_POSITION_Z, me->GetOrientation());
uint64 prison_GUID = pInstance->GetData64(DATA_PRINCE_TALDARAM_PLATFORM);
pInstance->HandleGameObject(prison_GUID,true);
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new boss_taldaramAI(creature);
}
};
class mob_taldaram_flamesphere : public CreatureScript
{
public:
mob_taldaram_flamesphere() : CreatureScript("mob_taldaram_flamesphere") { }
struct mob_taldaram_flamesphereAI : public ScriptedAI
{
mob_taldaram_flamesphereAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
uint32 uiDespawnTimer;
ScriptedInstance* pInstance;
void Reset()
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
me->setFaction(16);
me->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f);
DoCast(me, SPELL_FLAME_SPHERE_VISUAL);
DoCast(me, SPELL_FLAME_SPHERE_SPAWN_EFFECT);
DoCast(me, SPELL_FLAME_SPHERE_PERIODIC);
uiDespawnTimer = 10*IN_MILLISECONDS;
}
void EnterCombat(Unit * /*who*/) {}
void MoveInLineOfSight(Unit * /*who*/) {}
void JustDied(Unit* /*who*/)
{
DoCast(me, SPELL_FLAME_SPHERE_DEATH_EFFECT);
}
void UpdateAI(const uint32 diff)
{
if (uiDespawnTimer <= diff)
me->DisappearAndDie();
else
uiDespawnTimer -= diff;
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new mob_taldaram_flamesphereAI(creature);
}
};
class prince_taldaram_sphere : public GameObjectScript
{
public:
prince_taldaram_sphere() : GameObjectScript("prince_taldaram_sphere") { }
bool OnGossipHello(Player * /*pPlayer*/, GameObject *pGO)
{
ScriptedInstance *pInstance = pGO->GetInstanceData();
Creature *pPrinceTaldaram = Unit::GetCreature(*pGO, pInstance ? pInstance->GetData64(DATA_PRINCE_TALDARAM) : 0);
if (pPrinceTaldaram && pPrinceTaldaram->isAlive())
{
// maybe these are hacks :(
pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
pGO->SetGoState(GO_STATE_ACTIVE);
switch(pGO->GetEntry())
{
case GO_SPHERE1: pInstance->SetData(DATA_SPHERE1_EVENT,IN_PROGRESS); break;
case GO_SPHERE2: pInstance->SetData(DATA_SPHERE2_EVENT,IN_PROGRESS); break;
}
CAST_AI(boss_taldaram::boss_taldaramAI, pPrinceTaldaram->AI())->CheckSpheres();
}
RemovePrison();
return true;
}
Unit* GetEmbraceTarget()
{
if (!uiEmbraceTarget)
return NULL;
return Unit::GetUnit(*me, uiEmbraceTarget);
}
void RemovePrison()
{
if (!pInstance)
return;
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->RemoveAurasDueToSpell(SPELL_BEAM_VISUAL);
me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), DATA_GROUND_POSITION_Z, me->GetOrientation());
uint64 prison_GUID = pInstance->GetData64(DATA_PRINCE_TALDARAM_PLATFORM);
pInstance->HandleGameObject(prison_GUID,true);
}
};
struct mob_taldaram_flamesphereAI : public ScriptedAI
{
mob_taldaram_flamesphereAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
uint32 uiDespawnTimer;
ScriptedInstance* pInstance;
void Reset()
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
me->setFaction(16);
me->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f);
DoCast(me, SPELL_FLAME_SPHERE_VISUAL);
DoCast(me, SPELL_FLAME_SPHERE_SPAWN_EFFECT);
DoCast(me, SPELL_FLAME_SPHERE_PERIODIC);
uiDespawnTimer = 10*IN_MILLISECONDS;
}
void EnterCombat(Unit * /*who*/) {}
void MoveInLineOfSight(Unit * /*who*/) {}
void JustDied(Unit* /*who*/)
{
DoCast(me, SPELL_FLAME_SPHERE_DEATH_EFFECT);
}
void UpdateAI(const uint32 diff)
{
if (uiDespawnTimer <= diff)
me->DisappearAndDie();
else
uiDespawnTimer -= diff;
}
};
CreatureAI* GetAI_boss_taldaram(Creature* pCreature)
{
return new boss_taldaramAI (pCreature);
}
CreatureAI* GetAI_mob_taldaram_flamesphere(Creature* pCreature)
{
return new mob_taldaram_flamesphereAI (pCreature);
}
bool GOHello_prince_taldaram_sphere(Player * /*pPlayer*/, GameObject *pGO)
{
ScriptedInstance *pInstance = pGO->GetInstanceData();
Creature *pPrinceTaldaram = Unit::GetCreature(*pGO, pInstance ? pInstance->GetData64(DATA_PRINCE_TALDARAM) : 0);
if (pPrinceTaldaram && pPrinceTaldaram->isAlive())
{
// maybe these are hacks :(
pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
pGO->SetGoState(GO_STATE_ACTIVE);
switch(pGO->GetEntry())
{
case GO_SPHERE1: pInstance->SetData(DATA_SPHERE1_EVENT,IN_PROGRESS); break;
case GO_SPHERE2: pInstance->SetData(DATA_SPHERE2_EVENT,IN_PROGRESS); break;
}
CAST_AI(boss_taldaramAI, pPrinceTaldaram->AI())->CheckSpheres();
}
return true;
}
void AddSC_boss_taldaram()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_taldaram";
newscript->GetAI = &GetAI_boss_taldaram;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_taldaram_flamesphere";
newscript->GetAI = &GetAI_mob_taldaram_flamesphere;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "prince_taldaram_sphere";
newscript->pGOHello = &GOHello_prince_taldaram_sphere;
newscript->RegisterSelf();
new boss_taldaram;
new mob_taldaram_flamesphere;
new prince_taldaram_sphere;
}

View File

@@ -33,280 +33,282 @@ enum Achievements
ACHIEV_VOLUNTEER_WORK = 2056
};
struct instance_ahnkahet : public ScriptedInstance
class instance_ahnkahet : public InstanceMapScript
{
instance_ahnkahet(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
public:
instance_ahnkahet() : InstanceMapScript("instance_ahnkahet") { }
uint64 Elder_Nadox;
uint64 Prince_Taldaram;
uint64 Jedoga_Shadowseeker;
uint64 Herald_Volazj;
uint64 Amanitar;
uint64 Prince_TaldaramSpheres[2];
uint64 Prince_TaldaramPlatform;
uint64 Prince_TaldaramGate;
std::set<uint64> InitiandGUIDs;
uint64 JedogaSacrifices;
uint64 JedogaTarget;
uint32 m_auiEncounter[MAX_ENCOUNTER];
uint32 spheres[2];
uint8 InitiandCnt,
switchtrigger,
initiandkilled;
std::string str_data;
void Initialize()
struct instance_ahnkahet_ScriptedInstance : public ScriptedInstance
{
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
InitiandGUIDs.clear();
instance_ahnkahet_ScriptedInstance(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
Elder_Nadox =0;
Prince_Taldaram =0;
Jedoga_Shadowseeker =0;
Herald_Volazj =0;
Amanitar =0;
uint64 Elder_Nadox;
uint64 Prince_Taldaram;
uint64 Jedoga_Shadowseeker;
uint64 Herald_Volazj;
uint64 Amanitar;
spheres[0] = NOT_STARTED;
spheres[1] = NOT_STARTED;
uint64 Prince_TaldaramSpheres[2];
uint64 Prince_TaldaramPlatform;
uint64 Prince_TaldaramGate;
InitiandCnt = 0;
switchtrigger = 0;
initiandkilled = 0;
JedogaSacrifices = 0;
JedogaTarget = 0;
}
std::set<uint64> InitiandGUIDs;
uint64 JedogaSacrifices;
uint64 JedogaTarget;
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
uint32 m_auiEncounter[MAX_ENCOUNTER];
uint32 spheres[2];
return false;
}
uint8 InitiandCnt,
switchtrigger,
initiandkilled;
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
switch(pCreature->GetEntry())
std::string str_data;
void Initialize()
{
case 29309: Elder_Nadox = pCreature->GetGUID(); break;
case 29308: Prince_Taldaram = pCreature->GetGUID(); break;
case 29310: Jedoga_Shadowseeker = pCreature->GetGUID(); break;
case 29311: Herald_Volazj = pCreature->GetGUID(); break;
case 30258: Amanitar = pCreature->GetGUID(); break;
case 30114: InitiandGUIDs.insert(pCreature->GetGUID()); break;
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
InitiandGUIDs.clear();
Elder_Nadox =0;
Prince_Taldaram =0;
Jedoga_Shadowseeker =0;
Herald_Volazj =0;
Amanitar =0;
spheres[0] = NOT_STARTED;
spheres[1] = NOT_STARTED;
InitiandCnt = 0;
switchtrigger = 0;
initiandkilled = 0;
JedogaSacrifices = 0;
JedogaTarget = 0;
}
}
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
{
switch(pGo->GetEntry())
bool IsEncounterInProgress() const
{
case 193564: Prince_TaldaramPlatform = pGo->GetGUID();
if (m_auiEncounter[1] == DONE) HandleGameObject(NULL,true,pGo); break;
case 193093: Prince_TaldaramSpheres[0] = pGo->GetGUID();
if (spheres[0] == IN_PROGRESS)
{
pGo->SetGoState(GO_STATE_ACTIVE);
pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
}
else pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
break;
case 193094: Prince_TaldaramSpheres[1] = pGo->GetGUID();
if (spheres[1] == IN_PROGRESS)
{
pGo->SetGoState(GO_STATE_ACTIVE);
pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
}
else pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
break;
case 192236: Prince_TaldaramGate = pGo->GetGUID(); // Web gate past Prince Taldaram
if (m_auiEncounter[1] == DONE)HandleGameObject(NULL,true,pGo);break;
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
return false;
}
}
void SetData64(uint32 idx, uint64 guid)
{
switch(idx)
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
case DATA_ADD_JEDOGA_OPFER: JedogaSacrifices = guid; break;
case DATA_PL_JEDOGA_TARGET: JedogaTarget = guid; break;
}
}
uint64 GetData64(uint32 identifier)
{
switch(identifier)
{
case DATA_ELDER_NADOX: return Elder_Nadox;
case DATA_PRINCE_TALDARAM: return Prince_Taldaram;
case DATA_JEDOGA_SHADOWSEEKER: return Jedoga_Shadowseeker;
case DATA_HERALD_VOLAZJ: return Herald_Volazj;
case DATA_AMANITAR: return Amanitar;
case DATA_SPHERE1: return Prince_TaldaramSpheres[0];
case DATA_SPHERE2: return Prince_TaldaramSpheres[1];
case DATA_PRINCE_TALDARAM_PLATFORM: return Prince_TaldaramPlatform;
case DATA_ADD_JEDOGA_INITIAND:
switch(pCreature->GetEntry())
{
std::vector<uint64> vInitiands;
vInitiands.clear();
for (std::set<uint64>::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr)
{
Creature* cr = instance->GetCreature(*itr);
if (cr && cr->isAlive())
vInitiands.push_back(*itr);
}
if (vInitiands.empty())
return 0;
uint8 j = urand(0,vInitiands.size() -1);
return vInitiands[j];
case 29309: Elder_Nadox = pCreature->GetGUID(); break;
case 29308: Prince_Taldaram = pCreature->GetGUID(); break;
case 29310: Jedoga_Shadowseeker = pCreature->GetGUID(); break;
case 29311: Herald_Volazj = pCreature->GetGUID(); break;
case 30258: Amanitar = pCreature->GetGUID(); break;
case 30114: InitiandGUIDs.insert(pCreature->GetGUID()); break;
}
case DATA_ADD_JEDOGA_OPFER: return JedogaSacrifices;
case DATA_PL_JEDOGA_TARGET: return JedogaTarget;
}
return 0;
}
void SetData(uint32 type, uint32 data)
{
switch(type)
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
{
case DATA_ELDER_NADOX_EVENT: m_auiEncounter[0] = data; break;
case DATA_PRINCE_TALDARAM_EVENT:
if (data == DONE)
HandleGameObject(Prince_TaldaramGate,true);
m_auiEncounter[1] = data;
break;
case DATA_JEDOGA_SHADOWSEEKER_EVENT:
m_auiEncounter[2] = data;
if (data == DONE)
switch(pGo->GetEntry())
{
case 193564: Prince_TaldaramPlatform = pGo->GetGUID();
if (m_auiEncounter[1] == DONE) HandleGameObject(NULL,true,pGo); break;
case 193093: Prince_TaldaramSpheres[0] = pGo->GetGUID();
if (spheres[0] == IN_PROGRESS)
{
pGo->SetGoState(GO_STATE_ACTIVE);
pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
}
else pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
break;
case 193094: Prince_TaldaramSpheres[1] = pGo->GetGUID();
if (spheres[1] == IN_PROGRESS)
{
pGo->SetGoState(GO_STATE_ACTIVE);
pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
}
else pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
break;
case 192236: Prince_TaldaramGate = pGo->GetGUID(); // Web gate past Prince Taldaram
if (m_auiEncounter[1] == DONE)HandleGameObject(NULL,true,pGo);break;
}
}
void SetData64(uint32 idx, uint64 guid)
{
switch(idx)
{
case DATA_ADD_JEDOGA_OPFER: JedogaSacrifices = guid; break;
case DATA_PL_JEDOGA_TARGET: JedogaTarget = guid; break;
}
}
uint64 GetData64(uint32 identifier)
{
switch(identifier)
{
case DATA_ELDER_NADOX: return Elder_Nadox;
case DATA_PRINCE_TALDARAM: return Prince_Taldaram;
case DATA_JEDOGA_SHADOWSEEKER: return Jedoga_Shadowseeker;
case DATA_HERALD_VOLAZJ: return Herald_Volazj;
case DATA_AMANITAR: return Amanitar;
case DATA_SPHERE1: return Prince_TaldaramSpheres[0];
case DATA_SPHERE2: return Prince_TaldaramSpheres[1];
case DATA_PRINCE_TALDARAM_PLATFORM: return Prince_TaldaramPlatform;
case DATA_ADD_JEDOGA_INITIAND:
{
std::vector<uint64> vInitiands;
vInitiands.clear();
for (std::set<uint64>::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr)
{
Creature* cr = instance->GetCreature(*itr);
if (cr && cr->isAlive())
vInitiands.push_back(*itr);
}
if (vInitiands.empty())
return 0;
uint8 j = urand(0,vInitiands.size() -1);
return vInitiands[j];
}
case DATA_ADD_JEDOGA_OPFER: return JedogaSacrifices;
case DATA_PL_JEDOGA_TARGET: return JedogaTarget;
}
return 0;
}
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_ELDER_NADOX_EVENT: m_auiEncounter[0] = data; break;
case DATA_PRINCE_TALDARAM_EVENT:
if (data == DONE)
HandleGameObject(Prince_TaldaramGate,true);
m_auiEncounter[1] = data;
break;
case DATA_JEDOGA_SHADOWSEEKER_EVENT:
m_auiEncounter[2] = data;
if (data == DONE)
{
for (std::set<uint64>::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr)
{
cr->SetVisibility(VISIBILITY_OFF);
cr->setDeathState(JUST_DIED);
cr->RemoveCorpse();
Creature* cr = instance->GetCreature(*itr);
if (cr && cr->isAlive())
{
cr->SetVisibility(VISIBILITY_OFF);
cr->setDeathState(JUST_DIED);
cr->RemoveCorpse();
}
}
if (!initiandkilled && instance->IsHeroic())
DoCompleteAchievement(ACHIEV_VOLUNTEER_WORK);
}
break;
case DATA_HERALD_VOLAZJ_EVENT: m_auiEncounter[3] = data; break;
case DATA_AMANITAR_EVENT: m_auiEncounter[4] = data; break;
case DATA_SPHERE1_EVENT: spheres[0] = data; break;
case DATA_SPHERE2_EVENT: spheres[1] = data; break;
case DATA_JEDOGA_TRIGGER_SWITCH: switchtrigger = data; break;
case DATA_INITIAND_KILLED: initiandkilled = data; break;
case DATA_JEDOGA_RESET_INITIANDS:
for (std::set<uint64>::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr)
{
Creature* cr = instance->GetCreature(*itr);
if (cr)
{
cr->Respawn();
if (!cr->IsInEvadeMode()) cr->AI()->EnterEvadeMode();
}
}
if (!initiandkilled && instance->IsHeroic())
DoCompleteAchievement(ACHIEV_VOLUNTEER_WORK);
}
break;
case DATA_HERALD_VOLAZJ_EVENT: m_auiEncounter[3] = data; break;
case DATA_AMANITAR_EVENT: m_auiEncounter[4] = data; break;
case DATA_SPHERE1_EVENT: spheres[0] = data; break;
case DATA_SPHERE2_EVENT: spheres[1] = data; break;
case DATA_JEDOGA_TRIGGER_SWITCH: switchtrigger = data; break;
case DATA_INITIAND_KILLED: initiandkilled = data; break;
case DATA_JEDOGA_RESET_INITIANDS:
for (std::set<uint64>::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr)
{
Creature* cr = instance->GetCreature(*itr);
if (cr)
break;
}
if (data == DONE)
SaveToDB();
}
uint32 GetData(uint32 type)
{
switch(type)
{
case DATA_ELDER_NADOX_EVENT: return m_auiEncounter[0];
case DATA_PRINCE_TALDARAM_EVENT: return m_auiEncounter[1];
case DATA_JEDOGA_SHADOWSEEKER_EVENT: return m_auiEncounter[2];
case DATA_HERALD_VOLAZJ: return m_auiEncounter[3];
case DATA_AMANITAR_EVENT: return m_auiEncounter[4];
case DATA_SPHERE1_EVENT: return spheres[0];
case DATA_SPHERE2_EVENT: return spheres[1];
case DATA_ALL_INITIAND_DEAD:
for (std::set<uint64>::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr)
{
cr->Respawn();
if (!cr->IsInEvadeMode()) cr->AI()->EnterEvadeMode();
Creature* cr = instance->GetCreature(*itr);
if (!cr || (cr && cr->isAlive())) return 0;
}
}
break;
}
if (data == DONE)
SaveToDB();
}
uint32 GetData(uint32 type)
{
switch(type)
{
case DATA_ELDER_NADOX_EVENT: return m_auiEncounter[0];
case DATA_PRINCE_TALDARAM_EVENT: return m_auiEncounter[1];
case DATA_JEDOGA_SHADOWSEEKER_EVENT: return m_auiEncounter[2];
case DATA_HERALD_VOLAZJ: return m_auiEncounter[3];
case DATA_AMANITAR_EVENT: return m_auiEncounter[4];
case DATA_SPHERE1_EVENT: return spheres[0];
case DATA_SPHERE2_EVENT: return spheres[1];
case DATA_ALL_INITIAND_DEAD:
for (std::set<uint64>::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr)
{
Creature* cr = instance->GetCreature(*itr);
if (!cr || (cr && cr->isAlive())) return 0;
}
return 1;
case DATA_JEDOGA_TRIGGER_SWITCH: return switchtrigger;
case DATA_INITIAND_KILLED: return initiandkilled;
}
return 0;
}
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << "A K " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
<< m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4] << " "
<< spheres[0] << " " << spheres[1];
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;
return 1;
case DATA_JEDOGA_TRIGGER_SWITCH: return switchtrigger;
case DATA_INITIAND_KILLED: return initiandkilled;
}
return 0;
}
OUT_LOAD_INST_DATA(in);
char dataHead1, dataHead2;
uint16 data0, data1, data2, data3, data4, data5, data6;
std::istringstream loadStream(in);
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3 >> data4 >> data5 >> data6;
if (dataHead1 == 'A' && dataHead2 == 'K')
std::string GetSaveData()
{
m_auiEncounter[0] = data0;
m_auiEncounter[1] = data1;
m_auiEncounter[2] = data2;
m_auiEncounter[3] = data3;
m_auiEncounter[4] = data4;
OUT_SAVE_INST_DATA;
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS)
m_auiEncounter[i] = NOT_STARTED;
std::ostringstream saveStream;
saveStream << "A K " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
<< m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4] << " "
<< spheres[0] << " " << spheres[1];
spheres[0] = data5;
spheres[1] = data6;
str_data = saveStream.str();
} else OUT_LOAD_INST_DATA_FAIL;
OUT_SAVE_INST_DATA_COMPLETE;
return str_data;
}
OUT_LOAD_INST_DATA_COMPLETE;
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, data5, data6;
std::istringstream loadStream(in);
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3 >> data4 >> data5 >> data6;
if (dataHead1 == 'A' && dataHead2 == 'K')
{
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;
spheres[0] = data5;
spheres[1] = data6;
} else OUT_LOAD_INST_DATA_FAIL;
OUT_LOAD_INST_DATA_COMPLETE;
}
};
InstanceData* GetInstanceData(InstanceMap *map) const
{
return new instance_ahnkahet_ScriptedInstance(map);
}
};
InstanceData* GetInstanceData_instance_ahnkahet(Map* pMap)
{
return new instance_ahnkahet(pMap);
}
void AddSC_instance_ahnkahet()
{
Script *newscript;
newscript = new Script;
newscript->Name = "instance_ahnkahet";
newscript->GetInstanceData = &GetInstanceData_instance_ahnkahet;
newscript->RegisterSelf();
new instance_ahnkahet;
}

View File

@@ -46,224 +46,229 @@ enum Creatures
NPC_RAPTOR_2 = 26628
};
struct boss_dredAI : public ScriptedAI
class boss_dred : public CreatureScript
{
boss_dredAI(Creature *c) : ScriptedAI(c)
public:
boss_dred() : CreatureScript("boss_dred") { }
struct boss_dredAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
}
uint32 uiBellowingRoarTimer;
uint32 uiGrievousBiteTimer;
uint32 uiManglingSlashTimer;
uint32 uiFearsomeRoarTimer;
uint32 uiPiercingSlashTimer;
uint32 uiRaptorCallTimer;
ScriptedInstance* pInstance;
void Reset()
{
if (pInstance)
boss_dredAI(Creature *c) : ScriptedAI(c)
{
pInstance->SetData(DATA_DRED_EVENT,NOT_STARTED);
pInstance->SetData(DATA_KING_DRED_ACHIEV, 0);
pInstance = c->GetInstanceData();
}
uiBellowingRoarTimer = 33*IN_MILLISECONDS;
uiGrievousBiteTimer = 20*IN_MILLISECONDS;
uiManglingSlashTimer = 18.5*IN_MILLISECONDS;
uiFearsomeRoarTimer = urand(10*IN_MILLISECONDS,20*IN_MILLISECONDS);
uiPiercingSlashTimer = 17*IN_MILLISECONDS;
uiRaptorCallTimer = urand(20*IN_MILLISECONDS,25*IN_MILLISECONDS);
}
uint32 uiBellowingRoarTimer;
uint32 uiGrievousBiteTimer;
uint32 uiManglingSlashTimer;
uint32 uiFearsomeRoarTimer;
uint32 uiPiercingSlashTimer;
uint32 uiRaptorCallTimer;
void EnterCombat(Unit* /*who*/)
{
if (pInstance)
pInstance->SetData(DATA_DRED_EVENT,IN_PROGRESS);
}
ScriptedInstance* pInstance;
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (uiBellowingRoarTimer < diff)
void Reset()
{
DoCastAOE(SPELL_BELLOWING_ROAR, false);
uiBellowingRoarTimer = 40*IN_MILLISECONDS;
} else uiBellowingRoarTimer -=diff;
if (pInstance)
{
pInstance->SetData(DATA_DRED_EVENT,NOT_STARTED);
pInstance->SetData(DATA_KING_DRED_ACHIEV, 0);
}
if (uiGrievousBiteTimer < diff)
{
DoCastVictim(SPELL_GRIEVOUS_BITE ,false);
uiGrievousBiteTimer = 20*IN_MILLISECONDS;
} else uiGrievousBiteTimer -=diff;
if (uiManglingSlashTimer < diff)
{
DoCastVictim(SPELL_MANGLING_SLASH,false);
uiManglingSlashTimer = 20*IN_MILLISECONDS;
} else uiManglingSlashTimer -=diff;
if (uiFearsomeRoarTimer < diff)
{
DoCastAOE(SPELL_FEARSOME_ROAR,false);
uiFearsomeRoarTimer = urand(16*IN_MILLISECONDS,18*IN_MILLISECONDS);
} else uiFearsomeRoarTimer -=diff;
if (uiPiercingSlashTimer < diff)
{
DoCastVictim(SPELL_PIERCING_SLASH,false);
uiPiercingSlashTimer = 20*IN_MILLISECONDS;
} else uiPiercingSlashTimer -=diff;
if (uiRaptorCallTimer < diff)
{
DoCastVictim(SPELL_RAPTOR_CALL,false);
float x,y,z;
me->GetClosePoint(x,y,z,me->GetObjectSize()/3,10.0f);
me->SummonCreature(RAND(NPC_RAPTOR_1,NPC_RAPTOR_2),x,y,z,0,TEMPSUMMON_DEAD_DESPAWN,1*IN_MILLISECONDS);
uiRaptorCallTimer = urand(20*IN_MILLISECONDS,25*IN_MILLISECONDS);
} else uiRaptorCallTimer -=diff;
DoMeleeAttackIfReady();
}
void JustDied(Unit* /*killer*/)
{
if (pInstance)
{
pInstance->SetData(DATA_DRED_EVENT,DONE);
if (IsHeroic() && pInstance->GetData(DATA_KING_DRED_ACHIEV) == 6)
pInstance->DoCompleteAchievement(ACHIEV_BETTER_OFF_DRED);
uiBellowingRoarTimer = 33*IN_MILLISECONDS;
uiGrievousBiteTimer = 20*IN_MILLISECONDS;
uiManglingSlashTimer = 18.5*IN_MILLISECONDS;
uiFearsomeRoarTimer = urand(10*IN_MILLISECONDS,20*IN_MILLISECONDS);
uiPiercingSlashTimer = 17*IN_MILLISECONDS;
uiRaptorCallTimer = urand(20*IN_MILLISECONDS,25*IN_MILLISECONDS);
}
void EnterCombat(Unit* /*who*/)
{
if (pInstance)
pInstance->SetData(DATA_DRED_EVENT,IN_PROGRESS);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (uiBellowingRoarTimer < diff)
{
DoCastAOE(SPELL_BELLOWING_ROAR, false);
uiBellowingRoarTimer = 40*IN_MILLISECONDS;
} else uiBellowingRoarTimer -=diff;
if (uiGrievousBiteTimer < diff)
{
DoCastVictim(SPELL_GRIEVOUS_BITE ,false);
uiGrievousBiteTimer = 20*IN_MILLISECONDS;
} else uiGrievousBiteTimer -=diff;
if (uiManglingSlashTimer < diff)
{
DoCastVictim(SPELL_MANGLING_SLASH,false);
uiManglingSlashTimer = 20*IN_MILLISECONDS;
} else uiManglingSlashTimer -=diff;
if (uiFearsomeRoarTimer < diff)
{
DoCastAOE(SPELL_FEARSOME_ROAR,false);
uiFearsomeRoarTimer = urand(16*IN_MILLISECONDS,18*IN_MILLISECONDS);
} else uiFearsomeRoarTimer -=diff;
if (uiPiercingSlashTimer < diff)
{
DoCastVictim(SPELL_PIERCING_SLASH,false);
uiPiercingSlashTimer = 20*IN_MILLISECONDS;
} else uiPiercingSlashTimer -=diff;
if (uiRaptorCallTimer < diff)
{
DoCastVictim(SPELL_RAPTOR_CALL,false);
float x,y,z;
me->GetClosePoint(x,y,z,me->GetObjectSize()/3,10.0f);
me->SummonCreature(RAND(NPC_RAPTOR_1,NPC_RAPTOR_2),x,y,z,0,TEMPSUMMON_DEAD_DESPAWN,1*IN_MILLISECONDS);
uiRaptorCallTimer = urand(20*IN_MILLISECONDS,25*IN_MILLISECONDS);
} else uiRaptorCallTimer -=diff;
DoMeleeAttackIfReady();
}
void JustDied(Unit* /*killer*/)
{
if (pInstance)
{
pInstance->SetData(DATA_DRED_EVENT,DONE);
if (IsHeroic() && pInstance->GetData(DATA_KING_DRED_ACHIEV) == 6)
pInstance->DoCompleteAchievement(ACHIEV_BETTER_OFF_DRED);
}
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new boss_dredAI(creature);
}
};
CreatureAI* GetAI_boss_dred(Creature* pCreature)
class npc_drakkari_gutripper : public CreatureScript
{
return new boss_dredAI (pCreature);
}
public:
npc_drakkari_gutripper() : CreatureScript("npc_drakkari_gutripper") { }
struct npc_drakkari_gutripperAI : public ScriptedAI
{
npc_drakkari_gutripperAI(Creature *c) : ScriptedAI(c)
struct npc_drakkari_gutripperAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
uint32 GutRipTimer;
void Reset()
{
GutRipTimer = urand(10000,15000);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (GutRipTimer < diff)
npc_drakkari_gutripperAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
uint32 GutRipTimer;
void Reset()
{
DoCastVictim(SPELL_GUT_RIP,false);
GutRipTimer = urand(10000,15000);
}else GutRipTimer -=diff;
}
DoMeleeAttackIfReady();
}
void JustDied(Unit* /*killer*/)
{
if (pInstance)
void UpdateAI(const uint32 diff)
{
if (IsHeroic() && pInstance->GetData(DATA_DRED_EVENT) == IN_PROGRESS && pInstance->GetData(DATA_KING_DRED_ACHIEV) < 6)
//Return since we have no target
if (!UpdateVictim())
return;
if (GutRipTimer < diff)
{
pInstance->SetData(DATA_KING_DRED_ACHIEV, pInstance->GetData(DATA_KING_DRED_ACHIEV) + 1);
DoCastVictim(SPELL_GUT_RIP,false);
GutRipTimer = urand(10000,15000);
}else GutRipTimer -=diff;
DoMeleeAttackIfReady();
}
void JustDied(Unit* /*killer*/)
{
if (pInstance)
{
if (IsHeroic() && pInstance->GetData(DATA_DRED_EVENT) == IN_PROGRESS && pInstance->GetData(DATA_KING_DRED_ACHIEV) < 6)
{
pInstance->SetData(DATA_KING_DRED_ACHIEV, pInstance->GetData(DATA_KING_DRED_ACHIEV) + 1);
}
}
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new npc_drakkari_gutripperAI(creature);
}
};
CreatureAI* GetAI_npc_drakkari_gutripper(Creature* pCreature)
class npc_drakkari_scytheclaw : public CreatureScript
{
return new npc_drakkari_gutripperAI (pCreature);
}
public:
npc_drakkari_scytheclaw() : CreatureScript("npc_drakkari_scytheclaw") { }
struct npc_drakkari_scytheclawAI : public ScriptedAI
{
npc_drakkari_scytheclawAI(Creature *c) : ScriptedAI(c)
struct npc_drakkari_scytheclawAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
uint32 uiRendTimer;
void Reset()
{
uiRendTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (uiRendTimer < diff)
npc_drakkari_scytheclawAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
uint32 uiRendTimer;
void Reset()
{
DoCastVictim(SPELL_REND,false);
uiRendTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS);
}else uiRendTimer -=diff;
}
DoMeleeAttackIfReady();
}
void JustDied(Unit* /*killer*/)
{
if (pInstance)
void UpdateAI(const uint32 diff)
{
if (IsHeroic() && pInstance->GetData(DATA_DRED_EVENT) == IN_PROGRESS && pInstance->GetData(DATA_KING_DRED_ACHIEV) < 6)
//Return since we have no target
if (!UpdateVictim())
return;
if (uiRendTimer < diff)
{
pInstance->SetData(DATA_KING_DRED_ACHIEV, pInstance->GetData(DATA_KING_DRED_ACHIEV) + 1);
DoCastVictim(SPELL_REND,false);
uiRendTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS);
}else uiRendTimer -=diff;
DoMeleeAttackIfReady();
}
void JustDied(Unit* /*killer*/)
{
if (pInstance)
{
if (IsHeroic() && pInstance->GetData(DATA_DRED_EVENT) == IN_PROGRESS && pInstance->GetData(DATA_KING_DRED_ACHIEV) < 6)
{
pInstance->SetData(DATA_KING_DRED_ACHIEV, pInstance->GetData(DATA_KING_DRED_ACHIEV) + 1);
}
}
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new npc_drakkari_scytheclawAI(creature);
}
};
CreatureAI* GetAI_npc_drakkari_scytheclaw(Creature* pCreature)
{
return new npc_drakkari_scytheclawAI (pCreature);
}
void AddSC_boss_dred()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_drakkari_gutripper";
newscript->GetAI = &GetAI_npc_drakkari_gutripper;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_drakkari_scytheclaw";
newscript->GetAI = &GetAI_npc_drakkari_scytheclaw;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "boss_dred";
newscript->GetAI = &GetAI_boss_dred;
newscript->RegisterSelf();
new npc_drakkari_gutripper;
new npc_drakkari_scytheclaw;
new boss_dred;
}

View File

@@ -63,157 +63,168 @@ static Position AddSpawnPoint = { -379.20, -816.76, 59.70 };
static Position CrystalHandlerSpawnPoint = { -326.626343, -709.956604, 27.813314 };
static Position AddDestinyPoint = { -379.314545, -772.577637, 28.58837 };
struct boss_novosAI : public Scripted_NoMovementAI
class boss_novos : public CreatureScript
{
boss_novosAI(Creature *c) : Scripted_NoMovementAI(c), lSummons(me)
public:
boss_novos() : CreatureScript("boss_novos") { }
struct boss_novosAI : public Scripted_NoMovementAI
{
pInstance = c->GetInstanceData();
}
uint32 uiTimer;
uint32 uiCrystalHandlerTimer;
bool bAchiev;
SummonList lSummons;
std::list<uint64> luiCrystals;
CombatPhase Phase;
ScriptedInstance* pInstance;
void Reset()
{
Phase = IDLE;
luiCrystals.clear();
bAchiev = true;
me->CastStop();
lSummons.DespawnAll();
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if (pInstance)
boss_novosAI(Creature *c) : Scripted_NoMovementAI(c), lSummons(me)
{
pInstance->SetData(DATA_NOVOS_EVENT, NOT_STARTED);
luiCrystals.push_back(pInstance->GetData64(DATA_NOVOS_CRYSTAL_1));
luiCrystals.push_back(pInstance->GetData64(DATA_NOVOS_CRYSTAL_2));
luiCrystals.push_back(pInstance->GetData64(DATA_NOVOS_CRYSTAL_3));
luiCrystals.push_back(pInstance->GetData64(DATA_NOVOS_CRYSTAL_4));
for (std::list<uint64>::const_iterator itr = luiCrystals.begin(); itr != luiCrystals.end(); ++itr)
{
if (GameObject* pTemp = pInstance->instance->GetGameObject(*itr))
pTemp->SetGoState(GO_STATE_READY);
}
pInstance = c->GetInstanceData();
}
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
Phase = PHASE_1;
uiCrystalHandlerTimer = 30*IN_MILLISECONDS;
uiTimer = 1*IN_MILLISECONDS;
DoCast(SPELL_ARCANE_FIELD);
if (pInstance)
{
for (std::list<uint64>::const_iterator itr = luiCrystals.begin(); itr != luiCrystals.end(); ++itr)
{
if (GameObject *pTemp = pInstance->instance->GetGameObject(*itr))
pTemp->SetGoState(GO_STATE_ACTIVE);
}
pInstance->SetData(DATA_NOVOS_EVENT, IN_PROGRESS);
}
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void UpdateAI(const uint32 diff)
{
switch (Phase)
{
case PHASE_1:
if (uiTimer <= diff)
{
Creature *pSummon = me->SummonCreature(RAND(CREATURE_FETID_TROLL_CORPSE,CREATURE_HULKING_CORPSE,CREATURE_RISEN_SHADOWCASTER), AddSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILLISECONDS);
pSummon->GetMotionMaster()->MovePoint(0, AddDestinyPoint);
//If spell is casted stops casting arcane field so no spell casting
//DoCast(me, SPELL_SUMMON_MINIONS);
uiTimer = 3*IN_MILLISECONDS;
} else uiTimer -= diff;
if (uiCrystalHandlerTimer <= diff)
{
DoScriptText(SAY_NECRO_ADD, me);
Creature *pCrystalHandler = me->SummonCreature(CREATURE_CRYSTAL_HANDLER, CrystalHandlerSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILLISECONDS);
pCrystalHandler->GetMotionMaster()->MovePoint(0, AddDestinyPoint);
uiCrystalHandlerTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS);
} else uiCrystalHandlerTimer -= diff;
break;
case PHASE_2:
if (uiTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, DUNGEON_MODE(RAND(SPELL_ARCANE_BLAST,SPELL_BLIZZARD,SPELL_FROSTBOLT,SPELL_WRATH_OF_MISERY),
RAND(H_SPELL_ARCANE_BLAST,H_SPELL_BLIZZARD,H_SPELL_FROSTBOLT,H_SPELL_WRATH_OF_MISERY)));
uiTimer = urand(1*IN_MILLISECONDS,3*IN_MILLISECONDS);
} else uiTimer -= diff;
break;
}
}
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance)
{
pInstance->SetData(DATA_NOVOS_EVENT, DONE);
if (IsHeroic() && bAchiev)
pInstance->DoCompleteAchievement(ACHIEV_OH_NOVOS);
}
lSummons.DespawnAll();
}
void KilledUnit(Unit * victim)
{
if (victim == me)
return;
DoScriptText(SAY_KILL, me);
}
void JustSummoned(Creature *summon)
{
lSummons.Summon(summon);
}
void RemoveCrystal()
{
if (!luiCrystals.empty())
{
if (pInstance)
if (GameObject *pTemp = pInstance->instance->GetGameObject(luiCrystals.back()))
pTemp->SetGoState(GO_STATE_READY);
luiCrystals.pop_back();
}
if (luiCrystals.empty())
uint32 uiTimer;
uint32 uiCrystalHandlerTimer;
bool bAchiev;
SummonList lSummons;
std::list<uint64> luiCrystals;
CombatPhase Phase;
ScriptedInstance* pInstance;
void Reset()
{
Phase = IDLE;
luiCrystals.clear();
bAchiev = true;
me->CastStop();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Phase = PHASE_2;
uiTimer = 1*IN_MILLISECONDS;
}
}
lSummons.DespawnAll();
Unit* GetRandomTarget()
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if (pInstance)
{
pInstance->SetData(DATA_NOVOS_EVENT, NOT_STARTED);
luiCrystals.push_back(pInstance->GetData64(DATA_NOVOS_CRYSTAL_1));
luiCrystals.push_back(pInstance->GetData64(DATA_NOVOS_CRYSTAL_2));
luiCrystals.push_back(pInstance->GetData64(DATA_NOVOS_CRYSTAL_3));
luiCrystals.push_back(pInstance->GetData64(DATA_NOVOS_CRYSTAL_4));
for (std::list<uint64>::const_iterator itr = luiCrystals.begin(); itr != luiCrystals.end(); ++itr)
{
if (GameObject* pTemp = pInstance->instance->GetGameObject(*itr))
pTemp->SetGoState(GO_STATE_READY);
}
}
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
Phase = PHASE_1;
uiCrystalHandlerTimer = 30*IN_MILLISECONDS;
uiTimer = 1*IN_MILLISECONDS;
DoCast(SPELL_ARCANE_FIELD);
if (pInstance)
{
for (std::list<uint64>::const_iterator itr = luiCrystals.begin(); itr != luiCrystals.end(); ++itr)
{
if (GameObject *pTemp = pInstance->instance->GetGameObject(*itr))
pTemp->SetGoState(GO_STATE_ACTIVE);
}
pInstance->SetData(DATA_NOVOS_EVENT, IN_PROGRESS);
}
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void UpdateAI(const uint32 diff)
{
switch (Phase)
{
case PHASE_1:
if (uiTimer <= diff)
{
Creature *pSummon = me->SummonCreature(RAND(CREATURE_FETID_TROLL_CORPSE,CREATURE_HULKING_CORPSE,CREATURE_RISEN_SHADOWCASTER), AddSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILLISECONDS);
pSummon->GetMotionMaster()->MovePoint(0, AddDestinyPoint);
//If spell is casted stops casting arcane field so no spell casting
//DoCast(me, SPELL_SUMMON_MINIONS);
uiTimer = 3*IN_MILLISECONDS;
} else uiTimer -= diff;
if (uiCrystalHandlerTimer <= diff)
{
DoScriptText(SAY_NECRO_ADD, me);
Creature *pCrystalHandler = me->SummonCreature(CREATURE_CRYSTAL_HANDLER, CrystalHandlerSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILLISECONDS);
pCrystalHandler->GetMotionMaster()->MovePoint(0, AddDestinyPoint);
uiCrystalHandlerTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS);
} else uiCrystalHandlerTimer -= diff;
break;
case PHASE_2:
if (uiTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, DUNGEON_MODE(RAND(SPELL_ARCANE_BLAST,SPELL_BLIZZARD,SPELL_FROSTBOLT,SPELL_WRATH_OF_MISERY),
RAND(H_SPELL_ARCANE_BLAST,H_SPELL_BLIZZARD,H_SPELL_FROSTBOLT,H_SPELL_WRATH_OF_MISERY)));
uiTimer = urand(1*IN_MILLISECONDS,3*IN_MILLISECONDS);
} else uiTimer -= diff;
break;
}
}
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance)
{
pInstance->SetData(DATA_NOVOS_EVENT, DONE);
if (IsHeroic() && bAchiev)
pInstance->DoCompleteAchievement(ACHIEV_OH_NOVOS);
}
lSummons.DespawnAll();
}
void KilledUnit(Unit * victim)
{
if (victim == me)
return;
DoScriptText(SAY_KILL, me);
}
void JustSummoned(Creature *summon)
{
lSummons.Summon(summon);
}
void RemoveCrystal()
{
if (!luiCrystals.empty())
{
if (pInstance)
if (GameObject *pTemp = pInstance->instance->GetGameObject(luiCrystals.back()))
pTemp->SetGoState(GO_STATE_READY);
luiCrystals.pop_back();
}
if (luiCrystals.empty())
{
me->CastStop();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Phase = PHASE_2;
uiTimer = 1*IN_MILLISECONDS;
}
}
Unit* GetRandomTarget()
{
return SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
}
};
CreatureAI *GetAI(Creature *creature) const
{
return SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
return new boss_novosAI(creature);
}
};
@@ -223,105 +234,99 @@ enum CrystalHandlerSpells
H_SPELL_FLASH_OF_DARKNESS = 59004
};
struct mob_crystal_handlerAI : public ScriptedAI
class mob_crystal_handler : public CreatureScript
{
mob_crystal_handlerAI(Creature *c) : ScriptedAI(c)
public:
mob_crystal_handler() : CreatureScript("mob_crystal_handler") { }
struct mob_crystal_handlerAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
}
uint32 uiFlashOfDarknessTimer;
ScriptedInstance *pInstance;
void Reset()
{
uiFlashOfDarknessTimer = 5*IN_MILLISECONDS;
}
void JustDied(Unit* /*killer*/)
{
if (Creature* pNovos = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_NOVOS) : 0))
CAST_AI(boss_novosAI,pNovos->AI())->RemoveCrystal();
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (uiFlashOfDarknessTimer <= diff)
mob_crystal_handlerAI(Creature *c) : ScriptedAI(c)
{
DoCast(me->getVictim(), DUNGEON_MODE(SPELL_FLASH_OF_DARKNESS,H_SPELL_FLASH_OF_DARKNESS));
uiFlashOfDarknessTimer = 5*IN_MILLISECONDS;
} else uiFlashOfDarknessTimer -= diff;
DoMeleeAttackIfReady();
}
void MovementInform(uint32 type, uint32 id)
{
if (type != POINT_MOTION_TYPE || id != 0)
return;
if (Creature *pNovos = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_NOVOS) : 0))
if (Unit *pTarget = CAST_AI(boss_novosAI, pNovos->AI())->GetRandomTarget())
AttackStart(pTarget);
}
};
struct mob_novos_minionAI : public ScriptedAI
{
mob_novos_minionAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance *pInstance;
void MovementInform(uint32 type, uint32 id)
{
if (type != POINT_MOTION_TYPE || id !=0)
return;
if (Creature* pNovos = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_NOVOS) : 0))
{
CAST_AI(boss_novosAI, pNovos->AI())->bAchiev = false;
if (Unit *pTarget = CAST_AI(boss_novosAI, pNovos->AI())->GetRandomTarget())
AttackStart(pTarget);
pInstance = c->GetInstanceData();
}
uint32 uiFlashOfDarknessTimer;
ScriptedInstance *pInstance;
void Reset()
{
uiFlashOfDarknessTimer = 5*IN_MILLISECONDS;
}
void JustDied(Unit* /*killer*/)
{
if (Creature* pNovos = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_NOVOS) : 0))
CAST_AI(boss_novos::boss_novosAI,pNovos->AI())->RemoveCrystal();
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (uiFlashOfDarknessTimer <= diff)
{
DoCast(me->getVictim(), DUNGEON_MODE(SPELL_FLASH_OF_DARKNESS,H_SPELL_FLASH_OF_DARKNESS));
uiFlashOfDarknessTimer = 5*IN_MILLISECONDS;
} else uiFlashOfDarknessTimer -= diff;
DoMeleeAttackIfReady();
}
void MovementInform(uint32 type, uint32 id)
{
if (type != POINT_MOTION_TYPE || id != 0)
return;
if (Creature *pNovos = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_NOVOS) : 0))
if (Unit *pTarget = CAST_AI(boss_novos::boss_novosAI, pNovos->AI())->GetRandomTarget())
AttackStart(pTarget);
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new mob_crystal_handlerAI(creature);
}
};
CreatureAI* GetAI_boss_novos(Creature* pCreature)
class mob_novos_minion : public CreatureScript
{
return new boss_novosAI (pCreature);
}
public:
mob_novos_minion() : CreatureScript("mob_novos_minion") { }
CreatureAI* GetAI_mob_crystal_handler(Creature* pCreature)
{
return new mob_crystal_handlerAI (pCreature);
}
struct mob_novos_minionAI : public ScriptedAI
{
mob_novos_minionAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
CreatureAI* GetAI_mob_novos_minion(Creature* pCreature)
{
return new mob_novos_minionAI (pCreature);
}
ScriptedInstance *pInstance;
void MovementInform(uint32 type, uint32 id)
{
if (type != POINT_MOTION_TYPE || id !=0)
return;
if (Creature* pNovos = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_NOVOS) : 0))
{
CAST_AI(boss_novos::boss_novosAI, pNovos->AI())->bAchiev = false;
if (Unit *pTarget = CAST_AI(boss_novos::boss_novosAI, pNovos->AI())->GetRandomTarget())
AttackStart(pTarget);
}
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new mob_novos_minionAI(creature);
}
};
void AddSC_boss_novos()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_novos";
newscript->GetAI = &GetAI_boss_novos;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_crystal_handler";
newscript->GetAI = &GetAI_mob_crystal_handler;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_novos_minion";
newscript->GetAI = &GetAI_mob_novos_minion;
newscript->RegisterSelf();
new boss_novos;
new mob_crystal_handler;
new mob_novos_minion;
}

View File

@@ -64,196 +64,196 @@ enum CombatPhase
GOING_SKELETAL
};
struct boss_tharon_jaAI : public ScriptedAI
class boss_tharon_ja : public CreatureScript
{
boss_tharon_jaAI(Creature *c) : ScriptedAI(c)
public:
boss_tharon_ja() : CreatureScript("boss_tharon_ja") { }
struct boss_tharon_jaAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
}
uint32 uiPhaseTimer;
uint32 uiCurseOfLifeTimer;
uint32 uiRainOfFireTimer;
uint32 uiShadowVolleyTimer;
uint32 uiEyeBeamTimer;
uint32 uiLightningBreathTimer;
uint32 uiPoisonCloudTimer;
CombatPhase Phase;
ScriptedInstance* pInstance;
void Reset()
{
uiPhaseTimer = 20*IN_MILLISECONDS;
uiCurseOfLifeTimer = 1*IN_MILLISECONDS;
uiRainOfFireTimer = urand(14*IN_MILLISECONDS,18*IN_MILLISECONDS);
uiShadowVolleyTimer = urand(8*IN_MILLISECONDS,10*IN_MILLISECONDS);
Phase = SKELETAL;
me->SetDisplayId(me->GetNativeDisplayId());
if (pInstance)
pInstance->SetData(DATA_THARON_JA_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_THARON_JA_EVENT, IN_PROGRESS);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
switch (Phase)
boss_tharon_jaAI(Creature *c) : ScriptedAI(c)
{
case SKELETAL:
if (uiCurseOfLifeTimer < diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_CURSE_OF_LIFE);
uiCurseOfLifeTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS);
} else uiCurseOfLifeTimer -= diff;
if (uiShadowVolleyTimer < diff)
{
DoCastVictim(SPELL_SHADOW_VOLLEY);
uiShadowVolleyTimer = urand(8*IN_MILLISECONDS,10*IN_MILLISECONDS);
} else uiShadowVolleyTimer -= diff;
if (uiRainOfFireTimer < diff)
{
DoCastAOE(SPELL_RAIN_OF_FIRE);
uiRainOfFireTimer = urand(14*IN_MILLISECONDS,18*IN_MILLISECONDS);
} else uiRainOfFireTimer -= diff;
if (uiPhaseTimer < diff)
{
DoCast(SPELL_DECAY_FLESH);
Phase = GOING_FLESH;
uiPhaseTimer = 6*IN_MILLISECONDS;
} else uiPhaseTimer -= diff;
DoMeleeAttackIfReady();
break;
case GOING_FLESH:
if (uiPhaseTimer < diff)
{
DoScriptText(RAND(SAY_FLESH_1,SAY_FLESH_2),me);
me->SetDisplayId(MODEL_FLESH);
std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
{
Unit *pTemp = Unit::GetUnit((*me),(*itr)->getUnitGuid());
if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER)
{
me->AddAura(SPELL_GIFT_OF_THARON_JA,pTemp);
pTemp->SetDisplayId(MODEL_SKELETON);
}
}
uiPhaseTimer = 20*IN_MILLISECONDS;
uiLightningBreathTimer = urand(3*IN_MILLISECONDS,4*IN_MILLISECONDS);
uiEyeBeamTimer = urand(4*IN_MILLISECONDS,8*IN_MILLISECONDS);
uiPoisonCloudTimer = urand(6*IN_MILLISECONDS,7*IN_MILLISECONDS);
Phase = FLESH;
} else uiPhaseTimer -= diff;
break;
case FLESH:
if (uiLightningBreathTimer < diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_LIGHTNING_BREATH);
uiLightningBreathTimer = urand(6*IN_MILLISECONDS,7*IN_MILLISECONDS);
} else uiLightningBreathTimer -= diff;
if (uiEyeBeamTimer < diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_EYE_BEAM);
uiEyeBeamTimer = urand(4*IN_MILLISECONDS,6*IN_MILLISECONDS);
} else uiEyeBeamTimer -= diff;
if (uiPoisonCloudTimer < diff)
{
DoCastAOE(SPELL_POISON_CLOUD);
uiPoisonCloudTimer = urand(10*IN_MILLISECONDS,12*IN_MILLISECONDS);
} else uiPoisonCloudTimer -= diff;
if (uiPhaseTimer < diff)
{
DoCast(SPELL_RETURN_FLESH);
Phase = GOING_SKELETAL;
uiPhaseTimer = 6*IN_MILLISECONDS;
} else uiPhaseTimer -= diff;
DoMeleeAttackIfReady();
break;
case GOING_SKELETAL:
if (uiPhaseTimer < diff)
{
DoScriptText(RAND(SAY_SKELETON_1,SAY_SKELETON_2), me);
me->DeMorph();
Phase = SKELETAL;
uiPhaseTimer = 20*IN_MILLISECONDS;
uiCurseOfLifeTimer = 1*IN_MILLISECONDS;
uiRainOfFireTimer = urand(14*IN_MILLISECONDS,18*IN_MILLISECONDS);
uiShadowVolleyTimer = urand(8*IN_MILLISECONDS,10*IN_MILLISECONDS);
std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
{
Unit *pTemp = Unit::GetUnit((*me),(*itr)->getUnitGuid());
if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER)
{
if (pTemp->HasAura(SPELL_GIFT_OF_THARON_JA))
pTemp->RemoveAura(SPELL_GIFT_OF_THARON_JA);
pTemp->DeMorph();
}
}
} else uiPhaseTimer -= diff;
break;
pInstance = c->GetInstanceData();
}
}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2),me);
}
uint32 uiPhaseTimer;
uint32 uiCurseOfLifeTimer;
uint32 uiRainOfFireTimer;
uint32 uiShadowVolleyTimer;
uint32 uiEyeBeamTimer;
uint32 uiLightningBreathTimer;
uint32 uiPoisonCloudTimer;
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH,me);
CombatPhase Phase;
if (pInstance)
ScriptedInstance* pInstance;
void Reset()
{
// clean morph on players
Map::PlayerList const &PlayerList = pInstance->instance->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player *pPlayer = i->getSource())
pPlayer->DeMorph();
// cast is not rewarding the achievement.
// DoCast(SPELL_ACHIEVEMENT_CHECK);
pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, SPELL_ACHIEVEMENT_CHECK);
pInstance->SetData(DATA_THARON_JA_EVENT, DONE);
uiPhaseTimer = 20*IN_MILLISECONDS;
uiCurseOfLifeTimer = 1*IN_MILLISECONDS;
uiRainOfFireTimer = urand(14*IN_MILLISECONDS,18*IN_MILLISECONDS);
uiShadowVolleyTimer = urand(8*IN_MILLISECONDS,10*IN_MILLISECONDS);
Phase = SKELETAL;
me->SetDisplayId(me->GetNativeDisplayId());
if (pInstance)
pInstance->SetData(DATA_THARON_JA_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_THARON_JA_EVENT, IN_PROGRESS);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
switch (Phase)
{
case SKELETAL:
if (uiCurseOfLifeTimer < diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_CURSE_OF_LIFE);
uiCurseOfLifeTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS);
} else uiCurseOfLifeTimer -= diff;
if (uiShadowVolleyTimer < diff)
{
DoCastVictim(SPELL_SHADOW_VOLLEY);
uiShadowVolleyTimer = urand(8*IN_MILLISECONDS,10*IN_MILLISECONDS);
} else uiShadowVolleyTimer -= diff;
if (uiRainOfFireTimer < diff)
{
DoCastAOE(SPELL_RAIN_OF_FIRE);
uiRainOfFireTimer = urand(14*IN_MILLISECONDS,18*IN_MILLISECONDS);
} else uiRainOfFireTimer -= diff;
if (uiPhaseTimer < diff)
{
DoCast(SPELL_DECAY_FLESH);
Phase = GOING_FLESH;
uiPhaseTimer = 6*IN_MILLISECONDS;
} else uiPhaseTimer -= diff;
DoMeleeAttackIfReady();
break;
case GOING_FLESH:
if (uiPhaseTimer < diff)
{
DoScriptText(RAND(SAY_FLESH_1,SAY_FLESH_2),me);
me->SetDisplayId(MODEL_FLESH);
std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
{
Unit *pTemp = Unit::GetUnit((*me),(*itr)->getUnitGuid());
if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER)
{
me->AddAura(SPELL_GIFT_OF_THARON_JA,pTemp);
pTemp->SetDisplayId(MODEL_SKELETON);
}
}
uiPhaseTimer = 20*IN_MILLISECONDS;
uiLightningBreathTimer = urand(3*IN_MILLISECONDS,4*IN_MILLISECONDS);
uiEyeBeamTimer = urand(4*IN_MILLISECONDS,8*IN_MILLISECONDS);
uiPoisonCloudTimer = urand(6*IN_MILLISECONDS,7*IN_MILLISECONDS);
Phase = FLESH;
} else uiPhaseTimer -= diff;
break;
case FLESH:
if (uiLightningBreathTimer < diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_LIGHTNING_BREATH);
uiLightningBreathTimer = urand(6*IN_MILLISECONDS,7*IN_MILLISECONDS);
} else uiLightningBreathTimer -= diff;
if (uiEyeBeamTimer < diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_EYE_BEAM);
uiEyeBeamTimer = urand(4*IN_MILLISECONDS,6*IN_MILLISECONDS);
} else uiEyeBeamTimer -= diff;
if (uiPoisonCloudTimer < diff)
{
DoCastAOE(SPELL_POISON_CLOUD);
uiPoisonCloudTimer = urand(10*IN_MILLISECONDS,12*IN_MILLISECONDS);
} else uiPoisonCloudTimer -= diff;
if (uiPhaseTimer < diff)
{
DoCast(SPELL_RETURN_FLESH);
Phase = GOING_SKELETAL;
uiPhaseTimer = 6*IN_MILLISECONDS;
} else uiPhaseTimer -= diff;
DoMeleeAttackIfReady();
break;
case GOING_SKELETAL:
if (uiPhaseTimer < diff)
{
DoScriptText(RAND(SAY_SKELETON_1,SAY_SKELETON_2), me);
me->DeMorph();
Phase = SKELETAL;
uiPhaseTimer = 20*IN_MILLISECONDS;
uiCurseOfLifeTimer = 1*IN_MILLISECONDS;
uiRainOfFireTimer = urand(14*IN_MILLISECONDS,18*IN_MILLISECONDS);
uiShadowVolleyTimer = urand(8*IN_MILLISECONDS,10*IN_MILLISECONDS);
std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
{
Unit *pTemp = Unit::GetUnit((*me),(*itr)->getUnitGuid());
if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER)
{
if (pTemp->HasAura(SPELL_GIFT_OF_THARON_JA))
pTemp->RemoveAura(SPELL_GIFT_OF_THARON_JA);
pTemp->DeMorph();
}
}
} else uiPhaseTimer -= diff;
break;
}
}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2),me);
}
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH,me);
if (pInstance)
{
// clean morph on players
Map::PlayerList const &PlayerList = pInstance->instance->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player *pPlayer = i->getSource())
pPlayer->DeMorph();
pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, SPELL_ACHIEVEMENT_CHECK);
pInstance->SetData(DATA_THARON_JA_EVENT, DONE);
}
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new boss_tharon_jaAI(creature);
}
};
CreatureAI* GetAI_boss_tharon_ja(Creature* pCreature)
{
return new boss_tharon_jaAI (pCreature);
}
void AddSC_boss_tharon_ja()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_tharon_ja";
newscript->GetAI = &GetAI_boss_tharon_ja;
newscript->RegisterSelf();
new boss_tharon_ja;
}

View File

@@ -54,143 +54,144 @@ enum Creatures
Position AddSpawnPoint = { -260.493011, -622.968018, 26.605301, 3.036870 };
struct boss_trollgoreAI : public ScriptedAI
class boss_trollgore : public CreatureScript
{
boss_trollgoreAI(Creature *c) : ScriptedAI(c), lSummons(me)
public:
boss_trollgore() : CreatureScript("boss_trollgore") { }
struct boss_trollgoreAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
}
uint32 uiConsumeTimer;
uint32 uiAuraCountTimer;
uint32 uiCrushTimer;
uint32 uiInfectedWoundTimer;
uint32 uiExplodeCorpseTimer;
uint32 uiSpawnTimer;
bool bAchiev;
SummonList lSummons;
ScriptedInstance* pInstance;
void Reset()
{
uiConsumeTimer = 15*IN_MILLISECONDS;
uiAuraCountTimer = 15.5*IN_MILLISECONDS;
uiCrushTimer = urand(1*IN_MILLISECONDS,5*IN_MILLISECONDS);
uiInfectedWoundTimer = urand(60*IN_MILLISECONDS,10*IN_MILLISECONDS);
uiExplodeCorpseTimer = 3*IN_MILLISECONDS;
uiSpawnTimer = urand(30*IN_MILLISECONDS,40*IN_MILLISECONDS);
bAchiev = IsHeroic();
lSummons.DespawnAll();
me->RemoveAura(DUNGEON_MODE(SPELL_CONSUME_AURA,H_SPELL_CONSUME_AURA));
if (pInstance)
pInstance->SetData(DATA_TROLLGORE_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_TROLLGORE_EVENT, IN_PROGRESS);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (uiSpawnTimer <= diff)
boss_trollgoreAI(Creature *c) : ScriptedAI(c), lSummons(me)
{
uint32 spawnNumber = urand(2,DUNGEON_MODE(3,5));
for (uint8 i = 0; i < spawnNumber; ++i)
DoSummon(RAND(NPC_DRAKKARI_INVADER_1,NPC_DRAKKARI_INVADER_2), AddSpawnPoint, 0, TEMPSUMMON_DEAD_DESPAWN);
uiSpawnTimer = urand(30*IN_MILLISECONDS,40*IN_MILLISECONDS);
} else uiSpawnTimer -= diff;
pInstance = c->GetInstanceData();
}
if (uiConsumeTimer <= diff)
uint32 uiConsumeTimer;
uint32 uiAuraCountTimer;
uint32 uiCrushTimer;
uint32 uiInfectedWoundTimer;
uint32 uiExplodeCorpseTimer;
uint32 uiSpawnTimer;
bool bAchiev;
SummonList lSummons;
ScriptedInstance* pInstance;
void Reset()
{
DoScriptText(SAY_CONSUME, me);
DoCast(SPELL_CONSUME);
uiConsumeTimer = 15*IN_MILLISECONDS;
} else uiConsumeTimer -= diff;
uiAuraCountTimer = 15.5*IN_MILLISECONDS;
uiCrushTimer = urand(1*IN_MILLISECONDS,5*IN_MILLISECONDS);
uiInfectedWoundTimer = urand(60*IN_MILLISECONDS,10*IN_MILLISECONDS);
uiExplodeCorpseTimer = 3*IN_MILLISECONDS;
uiSpawnTimer = urand(30*IN_MILLISECONDS,40*IN_MILLISECONDS);
if (bAchiev)
{
Aura *pConsumeAura = me->GetAura(DUNGEON_MODE(SPELL_CONSUME_AURA,H_SPELL_CONSUME_AURA));
if (pConsumeAura && pConsumeAura->GetStackAmount() > 9)
bAchiev = false;
bAchiev = IsHeroic();
lSummons.DespawnAll();
me->RemoveAura(DUNGEON_MODE(SPELL_CONSUME_AURA,H_SPELL_CONSUME_AURA));
if (pInstance)
pInstance->SetData(DATA_TROLLGORE_EVENT, NOT_STARTED);
}
if (uiCrushTimer <= diff)
void EnterCombat(Unit* /*who*/)
{
DoCastVictim(SPELL_CRUSH);
uiCrushTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS);
} else uiCrushTimer -= diff;
DoScriptText(SAY_AGGRO, me);
if (uiInfectedWoundTimer <= diff)
if (pInstance)
pInstance->SetData(DATA_TROLLGORE_EVENT, IN_PROGRESS);
}
void UpdateAI(const uint32 diff)
{
DoCastVictim(SPELL_INFECTED_WOUND);
uiInfectedWoundTimer = urand(25*IN_MILLISECONDS,35*IN_MILLISECONDS);
} else uiInfectedWoundTimer -= diff;
//Return since we have no target
if (!UpdateVictim())
return;
if (uiExplodeCorpseTimer <= diff)
{
DoCast(SPELL_CORPSE_EXPLODE);
DoScriptText(SAY_EXPLODE, me);
uiExplodeCorpseTimer = urand(15*IN_MILLISECONDS,19*IN_MILLISECONDS);
} else uiExplodeCorpseTimer -= diff;
if (uiSpawnTimer <= diff)
{
uint32 spawnNumber = urand(2,DUNGEON_MODE(3,5));
for (uint8 i = 0; i < spawnNumber; ++i)
DoSummon(RAND(NPC_DRAKKARI_INVADER_1,NPC_DRAKKARI_INVADER_2), AddSpawnPoint, 0, TEMPSUMMON_DEAD_DESPAWN);
uiSpawnTimer = urand(30*IN_MILLISECONDS,40*IN_MILLISECONDS);
} else uiSpawnTimer -= diff;
DoMeleeAttackIfReady();
}
if (uiConsumeTimer <= diff)
{
DoScriptText(SAY_CONSUME, me);
DoCast(SPELL_CONSUME);
uiConsumeTimer = 15*IN_MILLISECONDS;
} else uiConsumeTimer -= diff;
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
lSummons.DespawnAll();
if (pInstance)
{
if (bAchiev)
pInstance->DoCompleteAchievement(ACHIEV_CONSUMPTION_JUNCTION);
pInstance->SetData(DATA_TROLLGORE_EVENT, DONE);
{
Aura *pConsumeAura = me->GetAura(DUNGEON_MODE(SPELL_CONSUME_AURA,H_SPELL_CONSUME_AURA));
if (pConsumeAura && pConsumeAura->GetStackAmount() > 9)
bAchiev = false;
}
if (uiCrushTimer <= diff)
{
DoCastVictim(SPELL_CRUSH);
uiCrushTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS);
} else uiCrushTimer -= diff;
if (uiInfectedWoundTimer <= diff)
{
DoCastVictim(SPELL_INFECTED_WOUND);
uiInfectedWoundTimer = urand(25*IN_MILLISECONDS,35*IN_MILLISECONDS);
} else uiInfectedWoundTimer -= diff;
if (uiExplodeCorpseTimer <= diff)
{
DoCast(SPELL_CORPSE_EXPLODE);
DoScriptText(SAY_EXPLODE, me);
uiExplodeCorpseTimer = urand(15*IN_MILLISECONDS,19*IN_MILLISECONDS);
} else uiExplodeCorpseTimer -= diff;
DoMeleeAttackIfReady();
}
}
void KilledUnit(Unit * victim)
{
if (victim == me)
return;
DoScriptText(SAY_KILL, me);
}
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
void JustSummoned(Creature* summon)
lSummons.DespawnAll();
if (pInstance)
{
if (bAchiev)
pInstance->DoCompleteAchievement(ACHIEV_CONSUMPTION_JUNCTION);
pInstance->SetData(DATA_TROLLGORE_EVENT, DONE);
}
}
void KilledUnit(Unit * victim)
{
if (victim == me)
return;
DoScriptText(SAY_KILL, me);
}
void JustSummoned(Creature* summon)
{
lSummons.push_back(summon->GetGUID());
if (summon->AI())
summon->AI()->AttackStart(me);
}
};
CreatureAI *GetAI(Creature *creature) const
{
lSummons.push_back(summon->GetGUID());
if (summon->AI())
summon->AI()->AttackStart(me);
return new boss_trollgoreAI(creature);
}
};
CreatureAI* GetAI_boss_trollgore(Creature* pCreature)
{
return new boss_trollgoreAI (pCreature);
}
void AddSC_boss_trollgore()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_trollgore";
newscript->GetAI = &GetAI_boss_trollgore;
newscript->RegisterSelf();
new boss_trollgore;
}

View File

@@ -42,201 +42,203 @@ enum GameObjects
GO_NOVOS_CRYSTAL_4 = 189302
};
struct instance_drak_tharon : public ScriptedInstance
class instance_drak_tharon : public InstanceMapScript
{
instance_drak_tharon(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
public:
instance_drak_tharon() : InstanceMapScript("instance_drak_tharon") { }
uint8 uiDredAchievCounter;
uint64 uiTrollgore;
uint64 uiNovos;
uint64 uiDred;
uint64 uiTharonJa;
uint64 uiNovosCrystal1;
uint64 uiNovosCrystal2;
uint64 uiNovosCrystal3;
uint64 uiNovosCrystal4;
uint8 m_auiEncounter[MAX_ENCOUNTER];
std::string str_data;
void Initialize()
struct instance_drak_tharon_ScriptedInstance : public ScriptedInstance
{
uiTrollgore = 0;
uiNovos = 0;
uiDred = 0;
uiTharonJa = 0;
uiNovosCrystal1 = 0;
uiNovosCrystal2 = 0;
uiNovosCrystal3 = 0;
uiNovosCrystal4 = 0;
uiDredAchievCounter = 0;
}
instance_drak_tharon_ScriptedInstance(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
uint8 uiDredAchievCounter;
return false;
}
uint64 uiTrollgore;
uint64 uiNovos;
uint64 uiDred;
uint64 uiTharonJa;
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
{
switch(pGo->GetEntry())
{
case GO_NOVOS_CRYSTAL_1:
uiNovosCrystal1 = pGo->GetGUID();
break;
case GO_NOVOS_CRYSTAL_2:
uiNovosCrystal2 = pGo->GetGUID();
break;
case GO_NOVOS_CRYSTAL_3:
uiNovosCrystal3 = pGo->GetGUID();
break;
case GO_NOVOS_CRYSTAL_4:
uiNovosCrystal4 = pGo->GetGUID();
break;
}
}
uint64 uiNovosCrystal1;
uint64 uiNovosCrystal2;
uint64 uiNovosCrystal3;
uint64 uiNovosCrystal4;
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
switch(pCreature->GetEntry())
{
case NPC_TROLLGORE:
uiTrollgore = pCreature->GetGUID();
break;
case NPC_NOVOS:
uiNovos = pCreature->GetGUID();
break;
case NPC_KING_DRED:
uiDred = pCreature->GetGUID();
break;
case NPC_THARON_JA:
uiTharonJa = pCreature->GetGUID();
break;
}
}
uint64 GetData64(uint32 identifier)
{
switch(identifier)
{
case DATA_TROLLGORE: return uiTrollgore;
case DATA_NOVOS: return uiNovos;
case DATA_DRED: return uiDred;
case DATA_THARON_JA: return uiTharonJa;
case DATA_NOVOS_CRYSTAL_1: return uiNovosCrystal1;
case DATA_NOVOS_CRYSTAL_2: return uiNovosCrystal2;
case DATA_NOVOS_CRYSTAL_3: return uiNovosCrystal3;
case DATA_NOVOS_CRYSTAL_4: return uiNovosCrystal4;
}
return 0;
}
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_TROLLGORE_EVENT:
m_auiEncounter[0] = data;
break;
case DATA_NOVOS_EVENT:
m_auiEncounter[1] = data;
break;
case DATA_DRED_EVENT:
m_auiEncounter[2] = data;
break;
case DATA_THARON_JA_EVENT:
m_auiEncounter[3] = data;
break;
case DATA_KING_DRED_ACHIEV:
uiDredAchievCounter = data;
break;
}
if (data == DONE)
{
SaveToDB();
}
}
uint32 GetData(uint32 type)
{
switch (type)
{
case DATA_TROLLGORE_EVENT: return m_auiEncounter[0];
case DATA_NOVOS_EVENT: return m_auiEncounter[1];
case DATA_DRED_EVENT: return m_auiEncounter[2];
case DATA_THARON_JA_EVENT: return m_auiEncounter[3];
case DATA_KING_DRED_ACHIEV: return uiDredAchievCounter;
}
return 0;
}
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
uint8 m_auiEncounter[MAX_ENCOUNTER];
std::string str_data;
std::ostringstream saveStream;
saveStream << "D K " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
<< m_auiEncounter[2] << " " << m_auiEncounter[3];
str_data = saveStream.str();
OUT_SAVE_INST_DATA_COMPLETE;
return str_data;
}
void Load(const char* in)
{
if (!in)
void Initialize()
{
OUT_LOAD_INST_DATA_FAIL;
return;
uiTrollgore = 0;
uiNovos = 0;
uiDred = 0;
uiTharonJa = 0;
uiNovosCrystal1 = 0;
uiNovosCrystal2 = 0;
uiNovosCrystal3 = 0;
uiNovosCrystal4 = 0;
uiDredAchievCounter = 0;
}
OUT_LOAD_INST_DATA(in);
char dataHead1, dataHead2;
uint16 data0,data1,data2,data3;
std::istringstream loadStream(in);
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3;
if (dataHead1 == 'D' && dataHead2 == 'K')
bool IsEncounterInProgress() const
{
m_auiEncounter[0] = data0;
m_auiEncounter[1] = data1;
m_auiEncounter[2] = data2;
m_auiEncounter[3] = data3;
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;
if (m_auiEncounter[i] == IN_PROGRESS) return true;
OUT_LOAD_INST_DATA_COMPLETE;
return false;
}
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
{
switch(pGo->GetEntry())
{
case GO_NOVOS_CRYSTAL_1:
uiNovosCrystal1 = pGo->GetGUID();
break;
case GO_NOVOS_CRYSTAL_2:
uiNovosCrystal2 = pGo->GetGUID();
break;
case GO_NOVOS_CRYSTAL_3:
uiNovosCrystal3 = pGo->GetGUID();
break;
case GO_NOVOS_CRYSTAL_4:
uiNovosCrystal4 = pGo->GetGUID();
break;
}
}
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
switch(pCreature->GetEntry())
{
case NPC_TROLLGORE:
uiTrollgore = pCreature->GetGUID();
break;
case NPC_NOVOS:
uiNovos = pCreature->GetGUID();
break;
case NPC_KING_DRED:
uiDred = pCreature->GetGUID();
break;
case NPC_THARON_JA:
uiTharonJa = pCreature->GetGUID();
break;
}
}
uint64 GetData64(uint32 identifier)
{
switch(identifier)
{
case DATA_TROLLGORE: return uiTrollgore;
case DATA_NOVOS: return uiNovos;
case DATA_DRED: return uiDred;
case DATA_THARON_JA: return uiTharonJa;
case DATA_NOVOS_CRYSTAL_1: return uiNovosCrystal1;
case DATA_NOVOS_CRYSTAL_2: return uiNovosCrystal2;
case DATA_NOVOS_CRYSTAL_3: return uiNovosCrystal3;
case DATA_NOVOS_CRYSTAL_4: return uiNovosCrystal4;
}
return 0;
}
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_TROLLGORE_EVENT:
m_auiEncounter[0] = data;
break;
case DATA_NOVOS_EVENT:
m_auiEncounter[1] = data;
break;
case DATA_DRED_EVENT:
m_auiEncounter[2] = data;
break;
case DATA_THARON_JA_EVENT:
m_auiEncounter[3] = data;
break;
case DATA_KING_DRED_ACHIEV:
uiDredAchievCounter = data;
break;
}
if (data == DONE)
{
SaveToDB();
}
}
uint32 GetData(uint32 type)
{
switch (type)
{
case DATA_TROLLGORE_EVENT: return m_auiEncounter[0];
case DATA_NOVOS_EVENT: return m_auiEncounter[1];
case DATA_DRED_EVENT: return m_auiEncounter[2];
case DATA_THARON_JA_EVENT: return m_auiEncounter[3];
case DATA_KING_DRED_ACHIEV: return uiDredAchievCounter;
}
return 0;
}
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
std::string str_data;
std::ostringstream saveStream;
saveStream << "D K " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
<< m_auiEncounter[2] << " " << m_auiEncounter[3];
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;
std::istringstream loadStream(in);
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3;
if (dataHead1 == 'D' && dataHead2 == 'K')
{
m_auiEncounter[0] = data0;
m_auiEncounter[1] = data1;
m_auiEncounter[2] = data2;
m_auiEncounter[3] = data3;
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;
}
};
InstanceData* GetInstanceData(InstanceMap *map) const
{
return new instance_drak_tharon_ScriptedInstance(map);
}
};
InstanceData* GetInstanceData_instance_drak_tharon(Map* pMap)
{
return new instance_drak_tharon(pMap);
}
void AddSC_instance_drak_tharon()
{
Script *newscript;
newscript = new Script;
newscript->Name = "instance_drak_tharon";
newscript->GetInstanceData = &GetInstanceData_instance_drak_tharon;
newscript->RegisterSelf();
new instance_drak_tharon;
}

View File

@@ -62,203 +62,205 @@ enum CombatPhases
PHASE_2
};
struct boss_bronjahmAI : public ScriptedAI
class boss_bronjahm : public CreatureScript
{
boss_bronjahmAI(Creature *c) : ScriptedAI(c)
public:
boss_bronjahm() : CreatureScript("boss_bronjahm") { }
struct boss_bronjahmAI : public ScriptedAI
{
pInstance = me->GetInstanceData();
}
ScriptedInstance* pInstance;
EventMap events;
CombatPhases phase;
void Reset()
{
phase = PHASE_1;
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
events.Reset();
events.ScheduleEvent(EVENT_SHADOW_BOLT, 2000);
events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000,15000));
events.ScheduleEvent(EVENT_CORRUPT_SOUL, urand(25000,35000));
if (pInstance)
pInstance->SetData(DATA_BRONJAHM_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_BRONJAHM_EVENT, IN_PROGRESS);
}
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_BRONJAHM_EVENT, DONE);
}
void KilledUnit(Unit * /*who*/)
{
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
// Cast aura spell on all players farther than 10y
void ApplySoulStorm()
{
std::list<Unit*> targetList;
SelectTargetList(targetList, 100, SELECT_TARGET_TOPAGGRO, -10.0f);
if (targetList.empty())
return;
for (std::list<Unit *>::const_iterator itr = targetList.begin(); itr != targetList.end(); ++itr)
boss_bronjahmAI(Creature *c) : ScriptedAI(c)
{
Unit* pUnit = (*itr);
if (pUnit && pUnit->isAlive())
me->CastSpell(pUnit, SPELL_SOULSTORM_AURA, true);
}
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
events.Update(diff);
if (me->hasUnitState(UNIT_STAT_CASTING))
return;
if (phase == PHASE_1 && HealthBelowPct(30))
{
phase = PHASE_2;
DoCast(me,SPELL_TELEPORT);
me->GetMotionMaster()->Clear();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
events.CancelEvent(EVENT_CORRUPT_SOUL);
events.ScheduleEvent(EVENT_SOUL_STORM, 1000);
events.ScheduleEvent(EVENT_FEAR, urand(8000,12000));
return;
pInstance = me->GetInstanceData();
}
while (uint32 eventId = events.ExecuteEvent())
ScriptedInstance* pInstance;
EventMap events;
CombatPhases phase;
void Reset()
{
switch(eventId)
phase = PHASE_1;
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
events.Reset();
events.ScheduleEvent(EVENT_SHADOW_BOLT, 2000);
events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000,15000));
events.ScheduleEvent(EVENT_CORRUPT_SOUL, urand(25000,35000));
if (pInstance)
pInstance->SetData(DATA_BRONJAHM_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_BRONJAHM_EVENT, IN_PROGRESS);
}
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_BRONJAHM_EVENT, DONE);
}
void KilledUnit(Unit * /*who*/)
{
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
// Cast aura spell on all players farther than 10y
void ApplySoulStorm()
{
std::list<Unit*> targetList;
SelectTargetList(targetList, 100, SELECT_TARGET_TOPAGGRO, -10.0f);
if (targetList.empty())
return;
for (std::list<Unit *>::const_iterator itr = targetList.begin(); itr != targetList.end(); ++itr)
{
case EVENT_CORRUPT_SOUL:
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
{
DoScriptText(SAY_CORRUPT_SOUL, me);
DoCast(pTarget,SPELL_CORRUPT_SOUL);
}
events.ScheduleEvent(EVENT_CORRUPT_SOUL, urand(25000,35000));
break;
case EVENT_SOUL_STORM:
DoScriptText(SAY_SOUL_STORM, me);
// DoCast(me, SPELL_SOULSTORM); bug: put the aura without the limit of 10 yards.
events.ScheduleEvent(EVENT_SOUL_STORM_AURA, 1000);
break;
case EVENT_SOUL_STORM_AURA:
ApplySoulStorm();
events.ScheduleEvent(EVENT_SOUL_STORM_AURA, 1000);
break;
case EVENT_FEAR:
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
DoCast(pTarget,SPELL_FEAR);
events.ScheduleEvent(EVENT_FEAR, urand(8000,12000));
break;
case EVENT_SHADOW_BOLT:
DoCastVictim(SPELL_SHADOW_BOLT);
events.ScheduleEvent(EVENT_SHADOW_BOLT, 2000);
break;
case EVENT_MAGIC_BANE:
DoCastVictim(SPELL_MAGIC_S_BANE);
events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000,15000));
break;
Unit* pUnit = (*itr);
if (pUnit && pUnit->isAlive())
me->CastSpell(pUnit, SPELL_SOULSTORM_AURA, true);
}
}
DoMeleeAttackIfReady();
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
events.Update(diff);
if (me->hasUnitState(UNIT_STAT_CASTING))
return;
if (phase == PHASE_1 && HealthBelowPct(30))
{
phase = PHASE_2;
DoCast(me,SPELL_TELEPORT);
me->GetMotionMaster()->Clear();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
events.CancelEvent(EVENT_CORRUPT_SOUL);
events.ScheduleEvent(EVENT_SOUL_STORM, 1000);
events.ScheduleEvent(EVENT_FEAR, urand(8000,12000));
return;
}
while (uint32 eventId = events.ExecuteEvent())
{
switch(eventId)
{
case EVENT_CORRUPT_SOUL:
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
{
DoScriptText(SAY_CORRUPT_SOUL, me);
DoCast(pTarget,SPELL_CORRUPT_SOUL);
}
events.ScheduleEvent(EVENT_CORRUPT_SOUL, urand(25000,35000));
break;
case EVENT_SOUL_STORM:
DoScriptText(SAY_SOUL_STORM, me);
events.ScheduleEvent(EVENT_SOUL_STORM_AURA, 1000);
break;
case EVENT_SOUL_STORM_AURA:
ApplySoulStorm();
events.ScheduleEvent(EVENT_SOUL_STORM_AURA, 1000);
break;
case EVENT_FEAR:
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
DoCast(pTarget,SPELL_FEAR);
events.ScheduleEvent(EVENT_FEAR, urand(8000,12000));
break;
case EVENT_SHADOW_BOLT:
DoCastVictim(SPELL_SHADOW_BOLT);
events.ScheduleEvent(EVENT_SHADOW_BOLT, 2000);
break;
case EVENT_MAGIC_BANE:
DoCastVictim(SPELL_MAGIC_S_BANE);
events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000,15000));
break;
}
}
DoMeleeAttackIfReady();
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new boss_bronjahmAI(creature);
}
};
CreatureAI* GetAI_boss_bronjahm(Creature* pCreature)
class mob_corrupted_soul_fragment : public CreatureScript
{
return new boss_bronjahmAI(pCreature);
}
public:
mob_corrupted_soul_fragment() : CreatureScript("mob_corrupted_soul_fragment") { }
struct mob_corrupted_soul_fragmentAI : public ScriptedAI
{
mob_corrupted_soul_fragmentAI(Creature *c) : ScriptedAI(c)
struct mob_corrupted_soul_fragmentAI : public ScriptedAI
{
pInstance = me->GetInstanceData();
}
ScriptedInstance* pInstance;
uint32 uiCheckTimer;
void Reset()
{
uiCheckTimer = 0; // first check is immediate
}
void UpdateAI(const uint32 diff)
{
if (uiCheckTimer <= diff)
mob_corrupted_soul_fragmentAI(Creature *c) : ScriptedAI(c)
{
if (pInstance)
pInstance = me->GetInstanceData();
}
ScriptedInstance* pInstance;
uint32 uiCheckTimer;
void Reset()
{
uiCheckTimer = 0; // first check is immediate
}
void UpdateAI(const uint32 diff)
{
if (uiCheckTimer <= diff)
{
Creature* pBronjham = Unit::GetCreature(*me, pInstance->GetData64(DATA_BRONJAHM));
if (pBronjham && pBronjham->isAlive())
if (pInstance)
{
if (me->IsWithinMeleeRange(pBronjham))
Creature* pBronjham = Unit::GetCreature(*me, pInstance->GetData64(DATA_BRONJAHM));
if (pBronjham && pBronjham->isAlive())
{
pBronjham->CastSpell(pBronjham, SPELL_CONSUME_SOUL, true);
me->ForcedDespawn();
if (me->IsWithinMeleeRange(pBronjham))
{
pBronjham->CastSpell(pBronjham, SPELL_CONSUME_SOUL, true);
me->ForcedDespawn();
}
else
{
Position pos;
pBronjham->GetPosition(&pos);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(0, pos);
}
}
else
{
Position pos;
pBronjham->GetPosition(&pos);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(0, pos);
}
me->ForcedDespawn();
}
else
me->ForcedDespawn();
uiCheckTimer = 500;
}
uiCheckTimer = 500;
else
uiCheckTimer -= diff;
}
else
uiCheckTimer -= diff;
};
CreatureAI *GetAI(Creature *creature) const
{
return new mob_corrupted_soul_fragmentAI(creature);
}
};
CreatureAI* GetAI_mob_corrupted_soul_fragment(Creature* pCreature)
{
return new mob_corrupted_soul_fragmentAI(pCreature);
}
void AddSC_boss_bronjahm()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_bronjahm";
newscript->GetAI = &GetAI_boss_bronjahm;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_corrupted_soul_fragment";
newscript->GetAI = &GetAI_mob_corrupted_soul_fragment;
newscript->RegisterSelf();
new boss_bronjahm;
new mob_corrupted_soul_fragment;
}

View File

@@ -119,232 +119,234 @@ struct
{ 0, 0, { 0, 0, 0, 0 } }
};
struct boss_devourer_of_soulsAI : public ScriptedAI
class boss_devourer_of_souls : public CreatureScript
{
boss_devourer_of_soulsAI(Creature *c) : ScriptedAI(c)
public:
boss_devourer_of_souls() : CreatureScript("boss_devourer_of_souls") { }
struct boss_devourer_of_soulsAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
}
bool bThreeFaceAchievement;
ScriptedInstance* pInstance;
EventMap events;
// wailing soul event
float beamAngle;
float beamAngleDiff;
int8 wailingSoulTick;
uint64 uiMirroredSoulTarget;
void Reset()
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
me->SetDisplayId(DISPLAY_ANGER);
me->SetReactState(REACT_AGGRESSIVE);
events.Reset();
bThreeFaceAchievement = true;
uiMirroredSoulTarget = 0;
if (pInstance)
pInstance->SetData(DATA_DEVOURER_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/)
{
if (pInstance)
pInstance->SetData(DATA_DEVOURER_EVENT, IN_PROGRESS);
DoScriptText(RAND(SAY_FACE_ANGER_AGGRO,SAY_FACE_DESIRE_AGGRO), me);
events.ScheduleEvent(EVENT_PHANTOM_BLAST, 5000);
events.ScheduleEvent(EVENT_MIRRORED_SOUL, 8000);
events.ScheduleEvent(EVENT_WELL_OF_SOULS, 30000);
events.ScheduleEvent(EVENT_UNLEASHED_SOULS, 20000);
events.ScheduleEvent(EVENT_WAILING_SOULS, urand(60000,70000));
}
void DamageTaken(Unit * /*pDoneBy*/, uint32 &uiDamage)
{
if (uiMirroredSoulTarget && me->HasAura(SPELL_MIRRORED_SOUL))
boss_devourer_of_soulsAI(Creature *c) : ScriptedAI(c)
{
if (Player *pPlayer = Unit::GetPlayer(*me, uiMirroredSoulTarget))
{
if (Aura *pAura = pPlayer->GetAura(SPELL_MIRRORED_SOUL))
{
int32 mirrorDamage = (uiDamage * 45)/100;
me->CastCustomSpell(pPlayer, 69034, &mirrorDamage, 0, 0, true);
// me->DealDamage(pPlayer, (uiDamage * 45)/100, 0, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_SHADOW);
}
else
uiMirroredSoulTarget = 0;
}
pInstance = c->GetInstanceData();
}
}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_FACE_ANGER_SLAY_1,SAY_FACE_SORROW_SLAY_1,SAY_FACE_DESIRE_SLAY_1,
SAY_FACE_ANGER_SLAY_2,SAY_FACE_SORROW_SLAY_2,SAY_FACE_DESIRE_SLAY_2), me);
}
bool bThreeFaceAchievement;
void JustDied(Unit* /*killer*/)
{
Position spawnPoint = { 5618.139, 2451.873, 705.854 };
ScriptedInstance* pInstance;
EventMap events;
DoScriptText(RAND(SAY_FACE_SORROW_DEATH,SAY_FACE_DESIRE_DEATH), me);
// wailing soul event
float beamAngle;
float beamAngleDiff;
int8 wailingSoulTick;
if (pInstance)
uint64 uiMirroredSoulTarget;
void Reset()
{
pInstance->SetData(DATA_DEVOURER_EVENT, DONE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
me->SetDisplayId(DISPLAY_ANGER);
me->SetReactState(REACT_AGGRESSIVE);
if (bThreeFaceAchievement && IsHeroic())
pInstance->DoCompleteAchievement(ACHIEV_THREE_FACED);
events.Reset();
int32 entryIndex;
if (pInstance->GetData(DATA_TEAM_IN_INSTANCE) == TEAM_ALLIANCE)
entryIndex = 0;
else
entryIndex = 1;
bThreeFaceAchievement = true;
uiMirroredSoulTarget = 0;
for (int8 i = 0; outroPositions[i].entry[entryIndex] != 0; ++i)
{
if (Creature *pSummon = me->SummonCreature(outroPositions[i].entry[entryIndex], spawnPoint, TEMPSUMMON_DEAD_DESPAWN))
{
pSummon->GetMotionMaster()->MovePoint(0, outroPositions[i].movePosition);
if (pSummon->GetEntry() == NPC_JAINA_PART2)
DoScriptText(SAY_JAINA_OUTRO, pSummon);
else if (pSummon->GetEntry() == NPC_SYLVANAS_PART2)
DoScriptText(SAY_SYLVANAS_OUTRO, pSummon);
}
}
if (pInstance)
pInstance->SetData(DATA_DEVOURER_EVENT, NOT_STARTED);
}
}
void SpellHitTarget(Unit* /*pTarget*/, const SpellEntry *pSpell)
{
if (pSpell->Id == H_SPELL_PHANTOM_BLAST)
bThreeFaceAchievement = false;
}
void UpdateAI(const uint32 diff)
{
// Return since we have no target
if (!UpdateVictim())
return;
events.Update(diff);
if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
void EnterCombat(Unit* /*who*/)
{
switch(eventId)
if (pInstance)
pInstance->SetData(DATA_DEVOURER_EVENT, IN_PROGRESS);
DoScriptText(RAND(SAY_FACE_ANGER_AGGRO,SAY_FACE_DESIRE_AGGRO), me);
events.ScheduleEvent(EVENT_PHANTOM_BLAST, 5000);
events.ScheduleEvent(EVENT_MIRRORED_SOUL, 8000);
events.ScheduleEvent(EVENT_WELL_OF_SOULS, 30000);
events.ScheduleEvent(EVENT_UNLEASHED_SOULS, 20000);
events.ScheduleEvent(EVENT_WAILING_SOULS, urand(60000,70000));
}
void DamageTaken(Unit * /*pDoneBy*/, uint32 &uiDamage)
{
if (uiMirroredSoulTarget && me->HasAura(SPELL_MIRRORED_SOUL))
{
case EVENT_PHANTOM_BLAST:
if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0))
DoCast(pTarget, SPELL_PHANTOM_BLAST);
events.ScheduleEvent(EVENT_PHANTOM_BLAST, 5000);
break;
case EVENT_MIRRORED_SOUL:
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
if (Player *pPlayer = Unit::GetPlayer(*me, uiMirroredSoulTarget))
{
if (Aura *pAura = pPlayer->GetAura(SPELL_MIRRORED_SOUL))
{
uiMirroredSoulTarget = pTarget->GetGUID();
DoCast(pTarget, SPELL_MIRRORED_SOUL);
DoScriptText(EMOTE_MIRRORED_SOUL, me);
int32 mirrorDamage = (uiDamage * 45)/100;
me->CastCustomSpell(pPlayer, 69034, &mirrorDamage, 0, 0, true);
// me->DealDamage(pPlayer, (uiDamage * 45)/100, 0, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_SHADOW);
}
events.ScheduleEvent(EVENT_MIRRORED_SOUL, urand(15000,30000));
break;
case EVENT_WELL_OF_SOULS:
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_WELL_OF_SOULS);
events.ScheduleEvent(EVENT_WELL_OF_SOULS, 20000);
break;
case EVENT_UNLEASHED_SOULS:
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_UNLEASHED_SOULS);
me->SetDisplayId(DISPLAY_SORROW);
DoScriptText(RAND(SAY_FACE_ANGER_UNLEASH_SOUL,SAY_FACE_SORROW_UNLEASH_SOUL,SAY_FACE_DESIRE_UNLEASH_SOUL), me);
DoScriptText(EMOTE_UNLEASH_SOUL, me);
events.ScheduleEvent(EVENT_UNLEASHED_SOULS, 30000);
events.ScheduleEvent(EVENT_FACE_ANGER, 5000);
break;
case EVENT_FACE_ANGER:
me->SetDisplayId(DISPLAY_ANGER);
break;
case EVENT_WAILING_SOULS:
me->SetDisplayId(DISPLAY_DESIRE);
DoScriptText(RAND(SAY_FACE_ANGER_WAILING_SOUL,SAY_FACE_DESIRE_WAILING_SOUL), me);
DoScriptText(EMOTE_WAILING_SOUL, me);
DoCast(me, SPELL_WAILING_SOULS_STARTING);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
me->SetOrientation(me->GetAngle(pTarget));
DoCast(me, SPELL_WAILING_SOULS_BEAM);
}
beamAngle = me->GetOrientation();
beamAngleDiff = PI/30.0f; // PI/2 in 15 sec = PI/30 per tick
if (RAND(true,false))
beamAngleDiff = -beamAngleDiff;
me->InterruptNonMeleeSpells(false);
me->SetReactState(REACT_PASSIVE);
//Remove any target
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
me->GetMotionMaster()->Clear();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
wailingSoulTick = 15;
events.DelayEvents(18000); // no other events during wailing souls
events.ScheduleEvent(EVENT_WAILING_SOULS_TICK, 3000); // first one after 3 secs.
break;
case EVENT_WAILING_SOULS_TICK:
beamAngle += beamAngleDiff;
me->SetOrientation(beamAngle);
me->StopMoving();
DoCast(me, SPELL_WAILING_SOULS);
if (--wailingSoulTick)
events.ScheduleEvent(EVENT_WAILING_SOULS_TICK, 1000);
else
{
me->SetReactState(REACT_AGGRESSIVE);
me->SetDisplayId(DISPLAY_ANGER);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
me->GetMotionMaster()->MoveChase(me->getVictim());
events.ScheduleEvent(EVENT_WAILING_SOULS, urand(60000,70000));
}
break;
uiMirroredSoulTarget = 0;
}
}
}
DoMeleeAttackIfReady();
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_FACE_ANGER_SLAY_1,SAY_FACE_SORROW_SLAY_1,SAY_FACE_DESIRE_SLAY_1,
SAY_FACE_ANGER_SLAY_2,SAY_FACE_SORROW_SLAY_2,SAY_FACE_DESIRE_SLAY_2), me);
}
void JustDied(Unit* /*killer*/)
{
Position spawnPoint = { 5618.139, 2451.873, 705.854 };
DoScriptText(RAND(SAY_FACE_SORROW_DEATH,SAY_FACE_DESIRE_DEATH), me);
if (pInstance)
{
pInstance->SetData(DATA_DEVOURER_EVENT, DONE);
if (bThreeFaceAchievement && IsHeroic())
pInstance->DoCompleteAchievement(ACHIEV_THREE_FACED);
int32 entryIndex;
if (pInstance->GetData(DATA_TEAM_IN_INSTANCE) == TEAM_ALLIANCE)
entryIndex = 0;
else
entryIndex = 1;
for (int8 i = 0; outroPositions[i].entry[entryIndex] != 0; ++i)
{
if (Creature *pSummon = me->SummonCreature(outroPositions[i].entry[entryIndex], spawnPoint, TEMPSUMMON_DEAD_DESPAWN))
{
pSummon->GetMotionMaster()->MovePoint(0, outroPositions[i].movePosition);
if (pSummon->GetEntry() == NPC_JAINA_PART2)
DoScriptText(SAY_JAINA_OUTRO, pSummon);
else if (pSummon->GetEntry() == NPC_SYLVANAS_PART2)
DoScriptText(SAY_SYLVANAS_OUTRO, pSummon);
}
}
}
}
void SpellHitTarget(Unit* /*pTarget*/, const SpellEntry *pSpell)
{
if (pSpell->Id == H_SPELL_PHANTOM_BLAST)
bThreeFaceAchievement = false;
}
void UpdateAI(const uint32 diff)
{
// Return since we have no target
if (!UpdateVictim())
return;
events.Update(diff);
if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch(eventId)
{
case EVENT_PHANTOM_BLAST:
if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0))
DoCast(pTarget, SPELL_PHANTOM_BLAST);
events.ScheduleEvent(EVENT_PHANTOM_BLAST, 5000);
break;
case EVENT_MIRRORED_SOUL:
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
{
uiMirroredSoulTarget = pTarget->GetGUID();
DoCast(pTarget, SPELL_MIRRORED_SOUL);
DoScriptText(EMOTE_MIRRORED_SOUL, me);
}
events.ScheduleEvent(EVENT_MIRRORED_SOUL, urand(15000,30000));
break;
case EVENT_WELL_OF_SOULS:
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_WELL_OF_SOULS);
events.ScheduleEvent(EVENT_WELL_OF_SOULS, 20000);
break;
case EVENT_UNLEASHED_SOULS:
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_UNLEASHED_SOULS);
me->SetDisplayId(DISPLAY_SORROW);
DoScriptText(RAND(SAY_FACE_ANGER_UNLEASH_SOUL,SAY_FACE_SORROW_UNLEASH_SOUL,SAY_FACE_DESIRE_UNLEASH_SOUL), me);
DoScriptText(EMOTE_UNLEASH_SOUL, me);
events.ScheduleEvent(EVENT_UNLEASHED_SOULS, 30000);
events.ScheduleEvent(EVENT_FACE_ANGER, 5000);
break;
case EVENT_FACE_ANGER:
me->SetDisplayId(DISPLAY_ANGER);
break;
case EVENT_WAILING_SOULS:
me->SetDisplayId(DISPLAY_DESIRE);
DoScriptText(RAND(SAY_FACE_ANGER_WAILING_SOUL,SAY_FACE_DESIRE_WAILING_SOUL), me);
DoScriptText(EMOTE_WAILING_SOUL, me);
DoCast(me, SPELL_WAILING_SOULS_STARTING);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
me->SetOrientation(me->GetAngle(pTarget));
DoCast(me, SPELL_WAILING_SOULS_BEAM);
}
beamAngle = me->GetOrientation();
beamAngleDiff = PI/30.0f; // PI/2 in 15 sec = PI/30 per tick
if (RAND(true,false))
beamAngleDiff = -beamAngleDiff;
me->InterruptNonMeleeSpells(false);
me->SetReactState(REACT_PASSIVE);
//Remove any target
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
me->GetMotionMaster()->Clear();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
wailingSoulTick = 15;
events.DelayEvents(18000); // no other events during wailing souls
events.ScheduleEvent(EVENT_WAILING_SOULS_TICK, 3000); // first one after 3 secs.
break;
case EVENT_WAILING_SOULS_TICK:
beamAngle += beamAngleDiff;
me->SetOrientation(beamAngle);
me->StopMoving();
DoCast(me, SPELL_WAILING_SOULS);
if (--wailingSoulTick)
events.ScheduleEvent(EVENT_WAILING_SOULS_TICK, 1000);
else
{
me->SetReactState(REACT_AGGRESSIVE);
me->SetDisplayId(DISPLAY_ANGER);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
me->GetMotionMaster()->MoveChase(me->getVictim());
events.ScheduleEvent(EVENT_WAILING_SOULS, urand(60000,70000));
}
break;
}
}
DoMeleeAttackIfReady();
}
};
CreatureAI *GetAI(Creature *creature) const
{
return new boss_devourer_of_soulsAI(creature);
}
};
CreatureAI* GetAI_boss_devourer_of_souls(Creature* pCreature)
{
return new boss_devourer_of_soulsAI(pCreature);
}
void AddSC_boss_devourer_of_souls()
{
Script *newscript;
newscript = new Script;
newscript->Name="boss_devourer_of_souls";
newscript->GetAI = &GetAI_boss_devourer_of_souls;
newscript->RegisterSelf();
new boss_devourer_of_souls;
}

View File

@@ -25,145 +25,147 @@
1- The Devourer of Souls
*/
struct instance_forge_of_souls : public ScriptedInstance
class instance_forge_of_souls : public InstanceMapScript
{
instance_forge_of_souls(Map* pMap) : ScriptedInstance(pMap) {};
public:
instance_forge_of_souls() : InstanceMapScript("instance_forge_of_souls") { }
uint64 uiBronjahm;
uint64 uiDevourer;
uint32 uiEncounter[MAX_ENCOUNTER];
uint32 uiTeamInInstance;
void Initialize()
struct instance_forge_of_souls_ScriptedInstance : public ScriptedInstance
{
uiBronjahm = 0;
uiDevourer = 0;
instance_forge_of_souls_ScriptedInstance(Map* pMap) : ScriptedInstance(pMap) {};
uiTeamInInstance = 0;
uint64 uiBronjahm;
uint64 uiDevourer;
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
uiEncounter[i] = NOT_STARTED;
}
uint32 uiEncounter[MAX_ENCOUNTER];
uint32 uiTeamInInstance;
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (uiEncounter[i] == IN_PROGRESS) return true;
return false;
}
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
Map::PlayerList const &players = instance->GetPlayers();
if (!players.isEmpty())
if (Player* pPlayer = players.begin()->getSource())
uiTeamInInstance = pPlayer->GetTeam();
switch(pCreature->GetEntry())
void Initialize()
{
case CREATURE_BRONJAHM:
uiBronjahm = pCreature->GetGUID();
break;
case CREATURE_DEVOURER:
uiDevourer = pCreature->GetGUID();
break;
}
}
uiBronjahm = 0;
uiDevourer = 0;
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_BRONJAHM_EVENT:
uiEncounter[0] = data;
break;
case DATA_DEVOURER_EVENT:
uiEncounter[1] = data;
break;
}
if (data == DONE)
SaveToDB();
}
uint32 GetData(uint32 type)
{
switch(type)
{
case DATA_BRONJAHM_EVENT: return uiEncounter[0];
case DATA_DEVOURER_EVENT: return uiEncounter[1];
case DATA_TEAM_IN_INSTANCE: return uiTeamInInstance;
}
return 0;
}
uint64 GetData64(uint32 identifier)
{
switch(identifier)
{
case DATA_BRONJAHM: return uiBronjahm;
case DATA_DEVOURER: return uiBronjahm;
}
return 0;
}
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << "F S " << uiEncounter[0] << " " << uiEncounter[1];
OUT_SAVE_INST_DATA_COMPLETE;
return saveStream.str();
}
void Load(const char* in)
{
if (!in)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(in);
char dataHead1, dataHead2;
uint16 data0, data1;
std::istringstream loadStream(in);
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1;
if (dataHead1 == 'F' && dataHead2 == 'S')
{
uiEncounter[0] = data0;
uiEncounter[1] = data1;
uiTeamInInstance = 0;
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (uiEncounter[i] == IN_PROGRESS)
uiEncounter[i] = NOT_STARTED;
uiEncounter[i] = NOT_STARTED;
}
} else OUT_LOAD_INST_DATA_FAIL;
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (uiEncounter[i] == IN_PROGRESS) return true;
OUT_LOAD_INST_DATA_COMPLETE;
return false;
}
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
Map::PlayerList const &players = instance->GetPlayers();
if (!players.isEmpty())
if (Player* pPlayer = players.begin()->getSource())
uiTeamInInstance = pPlayer->GetTeam();
switch(pCreature->GetEntry())
{
case CREATURE_BRONJAHM:
uiBronjahm = pCreature->GetGUID();
break;
case CREATURE_DEVOURER:
uiDevourer = pCreature->GetGUID();
break;
}
}
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_BRONJAHM_EVENT:
uiEncounter[0] = data;
break;
case DATA_DEVOURER_EVENT:
uiEncounter[1] = data;
break;
}
if (data == DONE)
SaveToDB();
}
uint32 GetData(uint32 type)
{
switch(type)
{
case DATA_BRONJAHM_EVENT: return uiEncounter[0];
case DATA_DEVOURER_EVENT: return uiEncounter[1];
case DATA_TEAM_IN_INSTANCE: return uiTeamInInstance;
}
return 0;
}
uint64 GetData64(uint32 identifier)
{
switch(identifier)
{
case DATA_BRONJAHM: return uiBronjahm;
case DATA_DEVOURER: return uiBronjahm;
}
return 0;
}
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << "F S " << uiEncounter[0] << " " << uiEncounter[1];
OUT_SAVE_INST_DATA_COMPLETE;
return saveStream.str();
}
void Load(const char* in)
{
if (!in)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(in);
char dataHead1, dataHead2;
uint16 data0, data1;
std::istringstream loadStream(in);
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1;
if (dataHead1 == 'F' && dataHead2 == 'S')
{
uiEncounter[0] = data0;
uiEncounter[1] = data1;
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (uiEncounter[i] == IN_PROGRESS)
uiEncounter[i] = NOT_STARTED;
} else OUT_LOAD_INST_DATA_FAIL;
OUT_LOAD_INST_DATA_COMPLETE;
}
};
InstanceData* GetInstanceData(InstanceMap *map) const
{
return new instance_forge_of_souls_ScriptedInstance(map);
}
};
InstanceData* GetInstanceData_instance_forge_of_souls(Map* pMap)
{
return new instance_forge_of_souls(pMap);
}
void AddSC_instance_forge_of_souls()
{
Script *newscript;
newscript = new Script;
newscript->Name = "instance_forge_of_souls";
newscript->GetInstanceData = &GetInstanceData_instance_forge_of_souls;
newscript->RegisterSelf();
new instance_forge_of_souls;
}