*Update naxx script.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-10 01:22:51 -05:00
parent d0bf6edd36
commit 1576a44d38
4 changed files with 121 additions and 18 deletions
+10 -3
View File
@@ -775,14 +775,21 @@ void Scripted_NoMovementAI::AttackStart(Unit* who)
}
}
#define GOBJECT(x) (const_cast<GameObjectInfo*>(GetGameObjectInfo(x)))
void LoadOverridenSQLData()
{
GameObjectInfo *goInfo;
// Sunwell Plateau : Kalecgos : Spectral Rift
goInfo = const_cast<GameObjectInfo*>(GetGameObjectInfo(187055));
if(goInfo && goInfo->type == GAMEOBJECT_TYPE_GOOBER)
goInfo->goober.lockId = 57; // need LOCKTYPE_QUICK_OPEN
if(goInfo = GOBJECT(187055))
if(goInfo->type == GAMEOBJECT_TYPE_GOOBER)
goInfo->goober.lockId = 57; // need LOCKTYPE_QUICK_OPEN
// Naxxramas : Sapphiron Birth
if(goInfo = GOBJECT(181356))
if(goInfo->type == GAMEOBJECT_TYPE_TRAP)
goInfo->trap.radius = 50;
}
#define SPELL(x) const_cast<SpellEntry*>(GetSpellStore()->LookupEntry(x))
@@ -34,6 +34,7 @@ EndScriptData */
#define SPELL_CURSE_PLAGUEBRINGER HEROIC(29213,54835)
#define SPELL_BLINK RAND(29208,29209,29210,29211)
#define SPELL_CRIPPLE HEROIC(29212,54814)
#define SPELL_TELEPORT 29216
#define MOB_WARRIOR 16984
#define MOB_CHAMPION 16983
@@ -62,6 +63,9 @@ enum Events
EVENT_CURSE,
EVENT_BLINK,
EVENT_WARRIOR,
EVENT_BALCONY,
EVENT_WAVE,
EVENT_GROUND,
};
struct TRINITY_DLL_DECL boss_nothAI : public ScriptedAI
@@ -74,6 +78,7 @@ struct TRINITY_DLL_DECL boss_nothAI : public ScriptedAI
EventMap events;
SummonList summons;
ScriptedInstance *instance;
uint32 waveCount, balconyCount;
void Reset()
{
@@ -86,27 +91,38 @@ struct TRINITY_DLL_DECL boss_nothAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, me);
DoZoneInCombat();
me->setActive(true);
events.ScheduleEvent(EVENT_CURSE, 20000+rand()%10000);
events.ScheduleEvent(EVENT_WARRIOR, 30000);
if(HeroicMode)
events.ScheduleEvent(EVENT_BLINK, 20000+rand()%10000);
balconyCount = 0;
EnterPhaseGround();
instance->SetBossState(BOSS_NOTH, IN_PROGRESS);
}
void EnterPhaseGround()
{
DoZoneInCombat();
if(me->getThreatManager().isThreatListEmpty())
EnterEvadeMode();
else
{
events.ScheduleEvent(EVENT_BALCONY, 11000);
events.ScheduleEvent(EVENT_CURSE, 20000+rand()%10000);
events.ScheduleEvent(EVENT_WARRIOR, 30000);
if(HeroicMode)
events.ScheduleEvent(EVENT_BLINK, 20000+rand()%10000);
}
}
void KilledUnit(Unit* victim)
{
DoScriptText(SAY_SLAY, me);
if(!(rand()%5))
DoScriptText(SAY_SLAY, me);
}
void JustSummoned(Creature *summon)
{
summons.Summon(summon);
summon->setActive(true);
DoZoneInCombat(summon);
summon->AI()->DoZoneInCombat();
}
void SummonedCreatureDespawn(Creature *summon) { summons.Despawn(summon); }
@@ -130,8 +146,19 @@ struct TRINITY_DLL_DECL boss_nothAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if(!UpdateVictim())
return;
if(me->HasReactState(REACT_AGGRESSIVE)) // ground
{
if(!UpdateVictim())
return;
}
else // balcony
{
if(me->getThreatManager().isThreatListEmpty()) // if no enemy, go back at once
{
events.Reset();
events.ScheduleEvent(EVENT_GROUND, 0);
}
}
events.Update(diff);
@@ -154,10 +181,46 @@ struct TRINITY_DLL_DECL boss_nothAI : public ScriptedAI
DoResetThreat();
events.ScheduleEvent(EVENT_BLINK, 20000+rand()%10000);
return;
case EVENT_BALCONY:
me->SetReactState(REACT_PASSIVE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->AttackStop();
me->RemoveAllAuras();
me->NearTeleportTo(TELE_X, TELE_Y, TELE_Z, TELE_O);
events.Reset();
events.ScheduleEvent(EVENT_WAVE, 2000);
waveCount = 0;
return;
case EVENT_WAVE:
DoScriptText(SAY_SUMMON, me);
switch(balconyCount)
{
case 0: SummonUndead(MOB_CHAMPION, HEROIC(2,4)); break;
case 1: SummonUndead(MOB_CHAMPION, HEROIC(1,2));
SummonUndead(MOB_GUARDIAN, HEROIC(1,2)); break;
case 2: SummonUndead(MOB_GUARDIAN, HEROIC(2,4)); break;
default:SummonUndead(MOB_CHAMPION, HEROIC(5,10));
SummonUndead(MOB_GUARDIAN, HEROIC(5,10));break;
}
++waveCount;
events.ScheduleEvent(waveCount < 2 ? EVENT_WAVE : EVENT_GROUND, 34000);
return;
case EVENT_GROUND:
{
++balconyCount;
me->SetReactState(REACT_AGGRESSIVE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
float x, y, z, o;
me->GetHomePosition(x, y, z, o);
me->NearTeleportTo(x, y, z, o);
EnterPhaseGround();
return;
}
}
}
DoMeleeAttackIfReady();
if(me->HasReactState(REACT_AGGRESSIVE))
DoMeleeAttackIfReady();
}
};
@@ -89,6 +89,7 @@ struct TRINITY_DLL_DECL boss_sapphironAI : public ScriptedAI
me->GetPosition(x, y, z);
me->SummonGameObject(GO_BIRTH, x, y, z, 0, 0, 0, 0, 0, 0);
me->SetVisibility(VISIBILITY_OFF);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_PASSIVE);
Reset();
@@ -207,10 +208,7 @@ struct TRINITY_DLL_DECL boss_sapphironAI : public ScriptedAI
float x, y, z;
me->GetGroundPointAroundUnit(x, y, z, rand_norm()*20, rand_norm()*2*M_PI);
if(Creature *summon = me->SummonCreature(MOB_BLIZZARD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 25000+rand()%5000))
{
summon->setFaction(me->getFaction());
summon->GetMotionMaster()->MoveRandom(40);
}
events.ScheduleEvent(EVENT_BLIZZARD, HEROIC(20000,7000), 0, PHASE_GROUND);
break;
}
@@ -295,6 +293,7 @@ struct TRINITY_DLL_DECL boss_sapphironAI : public ScriptedAI
return;
case EVENT_BIRTH:
me->SetVisibility(VISIBILITY_ON);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_AGGRESSIVE);
return;
}