diff options
author | _manuel_ <manue.l@live.com.ar> | 2010-05-20 19:05:18 -0300 |
---|---|---|
committer | _manuel_ <manue.l@live.com.ar> | 2010-05-20 19:05:18 -0300 |
commit | eae2426f405b53bfe1ebd552195cfd409b3901c7 (patch) | |
tree | f8bc102fbbca01c50af3d0692a9d1ad5ab23e122 /src | |
parent | 135f5bb35d0dba137a87b78745dcaa15b2034ebb (diff) |
The Nexus: Oculus.
- Implemented AI for Mage-Lord Urom.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/ScriptLoader.cpp | 2 | ||||
-rw-r--r-- | src/scripts/northrend/nexus/oculus/boss_urom.cpp | 305 | ||||
-rw-r--r-- | src/scripts/northrend/nexus/oculus/instance_oculus.cpp | 11 | ||||
-rw-r--r-- | src/scripts/northrend/nexus/oculus/oculus.h | 3 |
4 files changed, 294 insertions, 27 deletions
diff --git a/src/game/ScriptLoader.cpp b/src/game/ScriptLoader.cpp index 20bda66a611..2a619352420 100644 --- a/src/game/ScriptLoader.cpp +++ b/src/game/ScriptLoader.cpp @@ -355,6 +355,7 @@ void AddSC_boss_ormorok(); void AddSC_boss_keristrasza(); void AddSC_instance_nexus(); void AddSC_boss_drakos(); //The Nexus The Oculus +void AddSC_boss_urom(); void AddSC_instance_oculus(); void AddSC_oculus(); void AddSC_boss_sartharion(); //Obsidian Sanctum @@ -855,6 +856,7 @@ void AddScripts() AddSC_boss_keristrasza(); AddSC_instance_nexus(); AddSC_boss_drakos(); //The Nexus The Oculus + AddSC_boss_urom(); AddSC_instance_oculus(); AddSC_oculus(); AddSC_boss_sartharion(); //Obsidian Sanctum diff --git a/src/scripts/northrend/nexus/oculus/boss_urom.cpp b/src/scripts/northrend/nexus/oculus/boss_urom.cpp index 12176ef4f8a..b8631cbe51a 100644 --- a/src/scripts/northrend/nexus/oculus/boss_urom.cpp +++ b/src/scripts/northrend/nexus/oculus/boss_urom.cpp @@ -14,11 +14,19 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* ScriptData +SDName: Urom +SD%Complete: 80 +SDComment: Is not working SPELL_ARCANE_SHIELD. SPELL_FROSTBOMB has some issues, the damage aura should not stack. +SDCategory: Instance Script +EndScriptData */ + #include "ScriptedPch.h" #include "oculus.h" enum Spells { + SPELL_ARCANE_SHIELD = 53813, //Dummy --> Channeled, shields the caster from damage. SPELL_EMPOWERED_ARCANE_EXPLOSION = 51110, SPELL_EMPOWERED_ARCANE_EXPLOSION_2 = 59377, @@ -30,65 +38,310 @@ enum Spells SPELL_TIME_BOMB = 51121, //Deals arcane damage to a random player, and after 6 seconds, deals zone damage to nearby equal to the health missing of the target afflicted by the debuff. SPELL_TIME_BOMB_2 = 59376 }; -//not in db + enum Yells { - SAY_AGGRO = -1578012, - SAY_KILL_1 = -1578013, - SAY_KILL_2 = -1578014, - SAY_KILL_3 = -1578015, - SAY_DEATH = -1578016, - SAY_EXPLOSION_1 = -1578017, - SAY_EXPLOSION_2 = -1578018, - SAY_SUMMON_1 = -1578019, - SAY_SUMMON_2 = -1578020, - SAY_SUMMON_3 = -1578021 + SAY_AGGRO_1 = -1578000, + SAY_AGGRO_2 = -1578001, + SAY_AGGRO_3 = -1578002, + SAY_AGGRO_4 = -1578003, + SAY_TELEPORT = -1578004, +}; + +enum eData +{ + DATA_SET_SUMMON_GROUP +}; + +enum eCreature +{ + NPC_PHANTASMAL_CLOUDSCRAPER = 27645, + NPC_PHANTASMAL_MAMMOTH = 27642, + NPC_PHANTASMAL_WOLF = 27644, + + NPC_PHANTASMAL_AIR = 27650, + NPC_PHANTASMAL_FIRE = 27651, + NPC_PHANTASMAL_WATER = 27653, + + NPC_PHANTASMAL_MURLOC = 27649, + NPC_PHANTASMAL_NAGAL = 27648, + NPC_PHANTASMAL_OGRE = 27647 +}; + +struct Summons +{ + uint32 uiEntry[4]; +}; + +static Summons Group[]= +{ + {NPC_PHANTASMAL_CLOUDSCRAPER,NPC_PHANTASMAL_CLOUDSCRAPER,NPC_PHANTASMAL_MAMMOTH,NPC_PHANTASMAL_WOLF}, + {NPC_PHANTASMAL_AIR,NPC_PHANTASMAL_AIR,NPC_PHANTASMAL_WATER,NPC_PHANTASMAL_FIRE}, + {NPC_PHANTASMAL_OGRE,NPC_PHANTASMAL_OGRE,NPC_PHANTASMAL_NAGAL,NPC_PHANTASMAL_MURLOC} +}; + +static uint32 TeleportSpells[]= +{ + SPELL_SUMMON_MENAGERIE,SPELL_SUMMON_MENAGERIE_2,SPELL_SUMMON_MENAGERIE_3 +}; + +static int32 SayAggro[]= +{ + SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3,SAY_AGGRO_4 }; struct boss_uromAI : public ScriptedAI { - boss_uromAI(Creature *c) : ScriptedAI(c) + boss_uromAI(Creature* pCreature) : ScriptedAI(pCreature) { - pInstance = c->GetInstanceData(); + pInstance = pCreature->GetInstanceData(); } ScriptedInstance* pInstance; + float x,y; + + bool bCanCast; + bool bCanGoBack; + + uint8 uiGroup[3]; + + uint32 uiTeleportTimer; + uint32 uiArcaneExplosionTimer; + uint32 uiCastArcaneExplosionTimer; + uint32 uiFrostBombTimer; + uint32 uiTimeBombTimer; + void Reset() { + if (pInstance && pInstance->GetData(DATA_VAROS_EVENT) != DONE) + DoCast(SPELL_ARCANE_SHIELD); + if (pInstance) pInstance->SetData(DATA_UROM_EVENT, NOT_STARTED); + + if (pInstance && pInstance->GetData(DATA_UROM_PLATAFORM) == 0) + { + uiGroup[0] = 0; + uiGroup[1] = 0; + uiGroup[2] = 0; + } + + x,y = 0.0f; + bCanCast = false; + bCanGoBack = false; + + me->GetMotionMaster()->MoveIdle(); + + uiTeleportTimer = urand(30000,35000); + uiArcaneExplosionTimer = 9000; + uiCastArcaneExplosionTimer = 2000; + uiFrostBombTimer = urand(5000,8000); + uiTimeBombTimer = urand(20000,25000); } - void EnterCombat(Unit* /*who*/) - { - DoScriptText(SAY_AGGRO, me); + void EnterCombat(Unit* pWho) + { if (pInstance) pInstance->SetData(DATA_UROM_EVENT, IN_PROGRESS); + + SetGroups(); + SummonGroups(); + CastTeleport(); + + if (pInstance && pInstance->GetData(DATA_UROM_PLATAFORM) != 3) + pInstance->SetData(DATA_UROM_PLATAFORM,pInstance->GetData(DATA_UROM_PLATAFORM)+1); + } + + void AttackStart(Unit* pWho) + { + if (!pWho) + return; + + if (me->GetPositionZ() > 518.63) + DoStartNoMovement(pWho); + + if (me->GetPositionZ() < 518.63) + { + if (me->Attack(pWho, true)) + { + DoScriptText(SayAggro[3],me); + + me->SetInCombatWith(pWho); + pWho->SetInCombatWith(me); + + me->GetMotionMaster()->MoveChase(pWho, 0,0); + } + } + } + + void SetGroups() + { + if (!pInstance || pInstance->GetData(DATA_UROM_PLATAFORM) != 0) + return; + + while (uiGroup[0] == uiGroup[1] || uiGroup[0] == uiGroup[2] || uiGroup[1] == uiGroup[2]) + { + uiGroup[0] = urand(0,2); + uiGroup[1] = urand(0,2); + uiGroup[2] = urand(0,2); + } + } + + void SetPosition(uint8 uiI) + { + switch(uiI) + { + case 0: + x = me->GetPositionX() + 4; + y = me->GetPositionY() - 4; + break; + case 1: + x = me->GetPositionX() + 4; + y = me->GetPositionY() + 4; + break; + case 2: + x = me->GetPositionX() - 4; + y = me->GetPositionY() + 4; + break; + case 3: + x = me->GetPositionX() - 4; + y = me->GetPositionY() - 4; + break; + default: + break; + } + } + + void SummonGroups() + { + if (!pInstance || pInstance->GetData(DATA_UROM_PLATAFORM) > 2) + return; + + for (uint8 uiI = 0; uiI < 4 ; uiI++) + { + SetPosition(uiI); + me->SummonCreature(Group[uiGroup[pInstance->GetData(DATA_UROM_PLATAFORM)]].uiEntry[uiI],x,y,me->GetPositionZ(),me->GetOrientation()); + } + } + + void CastTeleport() + { + if (!pInstance || pInstance->GetData(DATA_UROM_PLATAFORM) > 2) + return; + + DoScriptText(SayAggro[pInstance->GetData(DATA_UROM_PLATAFORM)],me); + DoCast(TeleportSpells[pInstance->GetData(DATA_UROM_PLATAFORM)]); } - void AttackStart(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} - void UpdateAI(const uint32 /*diff*/) + void UpdateAI(const uint32 uiDiff) { //Return since we have no target if (!UpdateVictim()) return; + if (!pInstance || pInstance->GetData(DATA_UROM_PLATAFORM) < 2) + return; + + if (uiTeleportTimer <= uiDiff) + { + me->InterruptNonMeleeSpells(false); + DoScriptText(SAY_TELEPORT,me); + me->GetMotionMaster()->MoveIdle(); + DoCast(SPELL_TELEPORT); + uiTeleportTimer = urand(30000,35000); + + } else uiTeleportTimer -= uiDiff; + + if (bCanCast && !me->FindCurrentSpellBySpellId(SPELL_EMPOWERED_ARCANE_EXPLOSION)) + { + if (uiCastArcaneExplosionTimer <= uiDiff) + { + bCanCast = false; + bCanGoBack = true; + DoCastAOE(SPELL_EMPOWERED_ARCANE_EXPLOSION); + uiCastArcaneExplosionTimer = 2000; + }else uiCastArcaneExplosionTimer -= uiDiff; + } + + if (bCanGoBack) + { + if (uiArcaneExplosionTimer <= uiDiff) + { + Position pPos; + me->getVictim()->GetPosition(&pPos); + + me->NearTeleportTo(pPos.GetPositionX(),pPos.GetPositionY(),pPos.GetPositionZ(),pPos.GetOrientation()); + me->GetMotionMaster()->MoveChase(me->getVictim(),0,0); + me->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE); + + bCanCast = false; + bCanGoBack = false; + uiArcaneExplosionTimer = 9000; + } else uiArcaneExplosionTimer -= uiDiff; + } + + if (!me->IsNonMeleeSpellCasted(false, true, true)) + { + if (uiFrostBombTimer <= uiDiff) + { + DoCastVictim(SPELL_FROSTBOMB); + uiFrostBombTimer = urand(5000,8000); + } else uiFrostBombTimer -= uiDiff; + + if (uiTimeBombTimer <= uiDiff) + { + if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM)) + DoCast(pUnit,SPELL_TIME_BOMB); + + uiTimeBombTimer = urand(20000,25000); + } else uiTimeBombTimer -= uiDiff; + } + DoMeleeAttackIfReady(); } + void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); - if (pInstance) pInstance->SetData(DATA_UROM_EVENT, DONE); } - void KilledUnit(Unit * victim) + + void JustSummoned(Creature* pSummon) { - if (victim == me) - return; - DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2,SAY_KILL_3), me); + pSummon->SetInCombatWithZone(); + } + + void LeaveCombat() + { + me->RemoveAllAuras(); + me->CombatStop(false); + me->DeleteThreatList(); + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + switch(pSpell->Id) + { + case SPELL_SUMMON_MENAGERIE: + me->SetHomePosition(968.66,1042.53,527.32,0.077); + LeaveCombat(); + break; + case SPELL_SUMMON_MENAGERIE_2: + me->SetHomePosition(1164.02,1170.85,527.321,3.66); + LeaveCombat(); + break; + case SPELL_SUMMON_MENAGERIE_3: + me->SetHomePosition(1118.31,1080.377,508.361,4.25); + LeaveCombat(); + break; + case SPELL_TELEPORT: + me->AddUnitMovementFlag(MOVEMENTFLAG_FLY_MODE); // with out it the npc will fall down while is casting + bCanCast = true; + break; + default: + break; + } } }; @@ -99,7 +352,7 @@ CreatureAI* GetAI_boss_urom(Creature* pCreature) void AddSC_boss_urom() { - Script *newscript; + Script* newscript; newscript = new Script; newscript->Name = "boss_urom"; diff --git a/src/scripts/northrend/nexus/oculus/instance_oculus.cpp b/src/scripts/northrend/nexus/oculus/instance_oculus.cpp index 00a0e5e2967..49be2385a3c 100644 --- a/src/scripts/northrend/nexus/oculus/instance_oculus.cpp +++ b/src/scripts/northrend/nexus/oculus/instance_oculus.cpp @@ -34,11 +34,18 @@ struct instance_oculus : public ScriptedInstance uint64 uiUrom; uint64 uiEregos; + uint8 uiPlataformUrom; + uint8 m_auiEncounter[MAX_ENCOUNTER]; std::string str_data; std::list<uint64> GameObjectList; + void Initialize() + { + uiPlataformUrom = 0; + } + void OnCreatureCreate(Creature* pCreature, bool /*add*/) { switch(pCreature->GetEntry()) @@ -89,6 +96,9 @@ struct instance_oculus : public ScriptedInstance case DATA_EREGOS_EVENT: m_auiEncounter[3] = data; break; + case DATA_UROM_PLATAFORM: + uiPlataformUrom = data; + break; } if (data == DONE) @@ -103,6 +113,7 @@ struct instance_oculus : public ScriptedInstance case DATA_VAROS_EVENT: return m_auiEncounter[1]; case DATA_UROM_EVENT: return m_auiEncounter[2]; case DATA_EREGOS_EVENT: return m_auiEncounter[3]; + case DATA_UROM_PLATAFORM: return uiPlataformUrom; } return 0; diff --git a/src/scripts/northrend/nexus/oculus/oculus.h b/src/scripts/northrend/nexus/oculus/oculus.h index 93440dd6fc3..b212c9b8b6a 100644 --- a/src/scripts/northrend/nexus/oculus/oculus.h +++ b/src/scripts/northrend/nexus/oculus/oculus.h @@ -6,7 +6,8 @@ enum Data DATA_DRAKOS_EVENT, DATA_VAROS_EVENT, DATA_UROM_EVENT, - DATA_EREGOS_EVENT + DATA_EREGOS_EVENT, + DATA_UROM_PLATAFORM }; enum Data64 |