aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-10 01:22:51 -0500
committermegamage <none@none>2009-05-10 01:22:51 -0500
commit1576a44d38eb1d9c035652e2bc109488d12f1ce4 (patch)
treeda693d9dd3068529d1efecc964d91d165836da1f
parentd0bf6edd3603e978a0b1aa47dd25526245e28549 (diff)
*Update naxx script.
--HG-- branch : trunk
-rw-r--r--sql/updates/3233_world_scripts_naxx.sql34
-rw-r--r--src/bindings/scripts/include/sc_creature.cpp13
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp87
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp5
4 files changed, 121 insertions, 18 deletions
diff --git a/sql/updates/3233_world_scripts_naxx.sql b/sql/updates/3233_world_scripts_naxx.sql
new file mode 100644
index 00000000000..7272b328f8e
--- /dev/null
+++ b/sql/updates/3233_world_scripts_naxx.sql
@@ -0,0 +1,34 @@
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (-28169);
+INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
+(-28169, 28206, 0, 'Mutating Injection - Mutagen Explosion'),
+(-28169, 28240, 0, 'Mutating Injection - Poison Cloud');
+
+UPDATE creature_template SET scriptname = 'boss_grobbulus' WHERE entry = 15931;
+
+INSERT INTO creature_template (entry, spell1, flags_extra, scriptname) VALUES
+(16363, 28158, 128, ''), # Grobbulus Cloud
+(29379, 54362, 128, '') # Grobbulus Cloud (H)
+ON DUPLICATE KEY UPDATE
+spell1 = VALUES(spell1),
+flags_extra = VALUES(flags_extra),
+scriptname = VALUES(scriptname);
+
+INSERT INTO creature_template (entry, spell1, spell2, flags_extra, scriptname) VALUES
+(16474, 28547, 1000, 128, 'trigger_periodic'), # Blizzard (Sapphiron)
+(30000, 55699, 1000, 128, 'trigger_periodic') # Blizzard (Sapphiron) (H)
+ON DUPLICATE KEY UPDATE
+spell1 = VALUES(spell1),
+spell2 = VALUES(spell2),
+flags_extra = VALUES(flags_extra),
+scriptname = VALUES(scriptname);
+
+DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (29912);
+INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `quest_id`, `cast_flags`) VALUES
+(29912, 55479, 0, 1); # Obedience Crystal - Force Obedience
+
+DELETE FROM `spell_script_target` WHERE `entry` IN (55479);
+INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES
+(55479, 1, 16803); # Force Obedience - Death Knight Understudy
+
+# Death Knight Understudy
+UPDATE creature_template SET spell1=0, spell2=0, spell3=0, spell4=61696, spell5=29060, spell6=29061 WHERE entry IN (16803,29941);
diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp
index a76fbb8e1ef..82743bcd9e5 100644
--- a/src/bindings/scripts/include/sc_creature.cpp
+++ b/src/bindings/scripts/include/sc_creature.cpp
@@ -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))
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp
index a0ab51a9a2b..22796094557 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp
@@ -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();
}
};
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp
index 9ba4bd1f7ee..682f6cee3a9 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp
@@ -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;
}