diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/ScriptLoader.cpp | 6 | ||||
-rw-r--r-- | src/scripts/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/scripts/northrend/nexus/oculus/boss_drakos.cpp | 156 | ||||
-rw-r--r-- | src/scripts/northrend/nexus/oculus/oculus.cpp | 174 |
4 files changed, 318 insertions, 19 deletions
diff --git a/src/game/ScriptLoader.cpp b/src/game/ScriptLoader.cpp index e7b0a063089..1272f82dfbb 100644 --- a/src/game/ScriptLoader.cpp +++ b/src/game/ScriptLoader.cpp @@ -328,6 +328,9 @@ void AddSC_boss_anomalus(); void AddSC_boss_ormorok(); void AddSC_boss_keristrasza(); void AddSC_instance_nexus(); +void AddSC_boss_drakos(); //The Nexus The Oculus +void AddSC_instance_oculus(); +void AddSC_oculus(); void AddSC_boss_sartharion(); //Obsidian Sanctum void AddSC_instance_obsidian_sanctum(); void AddSC_boss_bjarngrim(); //Ulduar Halls of Lightning @@ -796,6 +799,9 @@ void AddScripts() AddSC_boss_ormorok(); AddSC_boss_keristrasza(); AddSC_instance_nexus(); + AddSC_boss_drakos(); //The Nexus The Oculus + AddSC_instance_oculus(); + AddSC_oculus(); AddSC_boss_sartharion(); //Obsidian Sanctum AddSC_instance_obsidian_sanctum(); AddSC_boss_bjarngrim(); //Ulduar Halls of Lightning diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt index bd081a0128e..25c7b3ea0b2 100644 --- a/src/scripts/CMakeLists.txt +++ b/src/scripts/CMakeLists.txt @@ -378,6 +378,7 @@ SET(scripts_STAT_SRCS northrend/nexus/oculus/boss_varos.cpp northrend/nexus/oculus/boss_eregos.cpp northrend/nexus/oculus/oculus.h + northrend/nexus/oculus/oculus.cpp northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp northrend/obsidian_sanctum/boss_sartharion.cpp northrend/obsidian_sanctum/obsidian_sanctum.h diff --git a/src/scripts/northrend/nexus/oculus/boss_drakos.cpp b/src/scripts/northrend/nexus/oculus/boss_drakos.cpp index 8254aabbaf4..7bedc2d5146 100644 --- a/src/scripts/northrend/nexus/oculus/boss_drakos.cpp +++ b/src/scripts/northrend/nexus/oculus/boss_drakos.cpp @@ -1,22 +1,32 @@ -/* Script Data Start -SDName: Boss drakos -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ +/* Copyright (C) 2006 - 2010 TrinityCore <http://www.trinitycore.org> +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + #include "ScriptedPch.h" #include "oculus.h" enum Spells { - SPELL_MAGIC_PULL = 51336, - SPELL_THUNDERING_STOMP = 50774, - SPELL_THUNDERING_STOMP_2 = 59370 + SPELL_MAGIC_PULL = 51336, + SPELL_MAGIC_PULL_EFFECT = 50770, + SPELL_THUNDERING_STOMP = 50774, + SPELL_THUNDERING_STOMP_H = 59370, + SPELL_UNSTABLE_SPHERE_PASSIVE = 50756, + SPELL_UNSTABLE_SPHERE_PULSE = 50757, + SPELL_UNSTABLE_SPHERE_TIMER = 50758, + NPC_UNSTABLE_SPHERE = 28166, }; //not in db @@ -38,18 +48,32 @@ enum Yells struct boss_drakosAI : public ScriptedAI { - boss_drakosAI(Creature *c) : ScriptedAI(c) + boss_drakosAI(Creature *c) : ScriptedAI(c), lSummons(me) { pInstance = c->GetInstanceData(); } + uint32 magicPullTimer ; + uint32 stompTimer ; + uint32 bombSummonTimer ; + uint32 postPullTimer ; + bool isPulling ; + bool postPull ; ScriptedInstance* pInstance; + SummonList lSummons; void Reset() { + lSummons.DespawnAll(); + magicPullTimer = urand(12000, 15000); + stompTimer = urand(3000, 6000); + bombSummonTimer = 2000; + postPull = false; + isPulling = false; if (pInstance) pInstance->SetData(DATA_DRAKOS_EVENT, NOT_STARTED); } + void EnterCombat(Unit* who) { DoScriptText(SAY_AGGRO, m_creature); @@ -57,14 +81,67 @@ struct boss_drakosAI : public ScriptedAI if (pInstance) pInstance->SetData(DATA_DRAKOS_EVENT, IN_PROGRESS); } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} + void JustSummoned(Creature* summon) + { + lSummons.Summon(summon); + } + void UpdateAI(const uint32 diff) { //Return since we have no target if (!UpdateVictim()) return; + if(bombSummonTimer < diff) + { + if(postPull) + { + m_creature->SummonCreature(NPC_UNSTABLE_SPHERE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + m_creature->SummonCreature(NPC_UNSTABLE_SPHERE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + } + else + m_creature->SummonCreature(NPC_UNSTABLE_SPHERE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + bombSummonTimer = 2000; + } else bombSummonTimer -= diff; + + if(magicPullTimer < diff) + { + if(isPulling) + { + if (pInstance) + { + Map::PlayerList const &players = pInstance->instance->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + DoCast(itr->getSource(), SPELL_MAGIC_PULL_EFFECT, true); + } + isPulling = false; + postPull = true; + postPullTimer = 4000; + magicPullTimer = urand(15000, 25000); + } + else + { + DoScriptText(RAND(SAY_PULL_1,SAY_PULL_2,SAY_PULL_3,SAY_PULL_4), m_creature); + DoCast(SPELL_MAGIC_PULL); + magicPullTimer = 2000; + isPulling = true; + } + } else magicPullTimer -= diff; + + if(postPull) + { + if (postPullTimer < diff) + postPull = false; + else postPullTimer -= diff; + } + + if(stompTimer < diff) + { + DoScriptText(RAND(SAY_STOMP_1,SAY_STOMP_2,SAY_STOMP_3), m_creature); + DoCast(DUNGEON_MODE(SPELL_THUNDERING_STOMP, SPELL_THUNDERING_STOMP_H)); + stompTimer = urand(15000, 18000); + } else stompTimer -= diff ; + DoMeleeAttackIfReady(); } void JustDied(Unit* killer) @@ -76,8 +153,6 @@ struct boss_drakosAI : public ScriptedAI } void KilledUnit(Unit *victim) { - if (victim == m_creature) - return; DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2,SAY_KILL_3), m_creature); } }; @@ -87,6 +162,44 @@ CreatureAI* GetAI_boss_drakos(Creature* pCreature) return new boss_drakosAI (pCreature); } +struct npc_unstable_sphereAI : public ScriptedAI +{ + npc_unstable_sphereAI(Creature *c) : ScriptedAI(c) {} + + uint32 pulseTimer; + uint32 deathTimer; + + void Reset() + { + m_creature->SetReactState(REACT_PASSIVE) ; + m_creature->GetMotionMaster()->MoveRandom(40.0f); + m_creature->SetSpeed(MOVE_RUN, 2, true); + m_creature->setFaction(14); + m_creature->AddAura(SPELL_UNSTABLE_SPHERE_PASSIVE, m_creature); + m_creature->AddAura(SPELL_UNSTABLE_SPHERE_TIMER, m_creature); + pulseTimer = 3000; + deathTimer = 19000; + } + + void UpdateAI(const uint32 diff) + { + if(pulseTimer < diff) + { + DoCast(SPELL_UNSTABLE_SPHERE_PULSE); + pulseTimer = 3000; + } pulseTimer -= diff; + + if(deathTimer < diff) + m_creature->DisappearAndDie(); + else deathTimer -= diff; + } +}; + +CreatureAI* GetAI_npc_unstable_sphere(Creature* pCreature) +{ + return new npc_unstable_sphereAI (pCreature); +} + void AddSC_boss_drakos() { Script *newscript; @@ -95,4 +208,9 @@ void AddSC_boss_drakos() newscript->Name = "boss_drakos"; newscript->GetAI = &GetAI_boss_drakos; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_unstable_sphere"; + newscript->GetAI = &GetAI_npc_unstable_sphere; + newscript->RegisterSelf(); } diff --git a/src/scripts/northrend/nexus/oculus/oculus.cpp b/src/scripts/northrend/nexus/oculus/oculus.cpp new file mode 100644 index 00000000000..c28607462d7 --- /dev/null +++ b/src/scripts/northrend/nexus/oculus/oculus.cpp @@ -0,0 +1,174 @@ +/* Copyright (C) 2006 - 2010 TrinityCore <http://www.trinitycore.org> +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "ScriptedPch.h" +#include "oculus.h" + +#define GOSSIP_ITEM_DRAKES "So where do we go from here?" +#define GOSSIP_ITEM_BELGARISTRASZ1 "I want to fly on the wings of the Red Flight" +#define GOSSIP_ITEM_BELGARISTRASZ2 "What abilities do Ruby Drakes have?" +#define GOSSIP_ITEM_VERDISA1 "I want to fly on the wings of the Green Flight" +#define GOSSIP_ITEM_VERDISA2 "What abilities do Emerald Drakes have?" +#define GOSSIP_ITEM_ETERNOS1 "I want to fly on the wings of the Bronze Flight" +#define GOSSIP_ITEM_ETERNOS2 "What abilities do Amber Drakes have?" + +#define HAS_ESSENCE(a) ((a)->HasItemCount(ITEM_EMERALD_ESSENCE,1) || (a)->HasItemCount(ITEM_AMBER_ESSENCE,1) || (a)->HasItemCount(ITEM_RUBY_ESSENCE,1)) + +enum Drakes +{ + GOSSIP_TEXTID_DRAKES = 13267, + GOSSIP_TEXTID_BELGARISTRASZ1 = 12916, + GOSSIP_TEXTID_BELGARISTRASZ2 = 13466, + GOSSIP_TEXTID_BELGARISTRASZ3 = 13254, + GOSSIP_TEXTID_VERDISA1 = 1, + GOSSIP_TEXTID_VERDISA2 = 1, + GOSSIP_TEXTID_VERDISA3 = 1, + GOSSIP_TEXTID_ETERNOS1 = 1, + GOSSIP_TEXTID_ETERNOS2 = 1, + GOSSIP_TEXTID_ETERNOS3 = 13256, + + ITEM_EMERALD_ESSENCE = 37815, + ITEM_AMBER_ESSENCE = 37859, + ITEM_RUBY_ESSENCE = 37860, + + NPC_VERDISA = 27657, + NPC_BELGARISTRASZ = 27658, + NPC_ETERNOS = 27659 +}; + +bool GossipHello_npc_oculus_drake(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if(pCreature->GetInstanceData()->GetData(DATA_DRAKOS_EVENT) == DONE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DRAKES, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DRAKES, pCreature->GetGUID()); + } + + return true; +} + +bool GossipSelect_npc_oculus_drake(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(pCreature->GetEntry()) + { + case NPC_VERDISA: //Verdisa + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF + 1: + if(!HAS_ESSENCE(pPlayer)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA1, pCreature->GetGUID()); + } + else + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA2, pCreature->GetGUID()); + } + break; + case GOSSIP_ACTION_INFO_DEF + 2: + { + ItemPosCountVec dest; + uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_EMERALD_ESSENCE, 1); + if (msg == EQUIP_ERR_OK) + pPlayer->StoreNewItem(dest, ITEM_EMERALD_ESSENCE, true); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + } + case GOSSIP_ACTION_INFO_DEF + 3: + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA3, pCreature->GetGUID()); + break; + } + break; + case NPC_BELGARISTRASZ: //Belgaristrasz + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF + 1: + if(!HAS_ESSENCE(pPlayer)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ1, pCreature->GetGUID()); + } + else + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ2, pCreature->GetGUID()); + } + break; + case GOSSIP_ACTION_INFO_DEF + 2: + { + ItemPosCountVec dest; + uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_RUBY_ESSENCE, 1); + if (msg == EQUIP_ERR_OK) + pPlayer->StoreNewItem(dest, ITEM_RUBY_ESSENCE, true); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + } + case GOSSIP_ACTION_INFO_DEF + 3: + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ3, pCreature->GetGUID()); + break; + } + break; + case NPC_ETERNOS: //Eternos + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF + 1: + if(!HAS_ESSENCE(pPlayer)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS1, pCreature->GetGUID()); + } + else + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS2, pCreature->GetGUID()); + } + break; + case GOSSIP_ACTION_INFO_DEF + 2: + { + ItemPosCountVec dest; + uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_AMBER_ESSENCE, 1); + if (msg == EQUIP_ERR_OK) + pPlayer->StoreNewItem(dest, ITEM_AMBER_ESSENCE, true); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + } + case GOSSIP_ACTION_INFO_DEF + 3: + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS3, pCreature->GetGUID()); + break; + } + break; + } + + return true; +} + +void AddSC_oculus() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_occulus_drake"; + newscript->pGossipHello = &GossipHello_npc_oculus_drake; + newscript->pGossipSelect = &GossipSelect_npc_oculus_drake; + newscript->RegisterSelf(); +} |