diff options
author | click <none@none> | 2010-05-01 22:39:02 +0200 |
---|---|---|
committer | click <none@none> | 2010-05-01 22:39:02 +0200 |
commit | 18782ec1f79ef31eb9af7f8d6560aa71f7ac3a48 (patch) | |
tree | 1861c81684e8e2619964e6d69ebc91ec83a16973 | |
parent | 3683de3f8032a05eb584964c044b9f2d3857706e (diff) |
Add support for quest 10512 (Getting the Bladespire Tanked)
Patch by supabad - closes issue #1217
--HG--
branch : trunk
-rw-r--r-- | sql/updates/8063_world_creature_template.sql | 2 | ||||
-rw-r--r-- | src/scripts/outland/blades_edge_mountains.cpp | 106 |
2 files changed, 107 insertions, 1 deletions
diff --git a/sql/updates/8063_world_creature_template.sql b/sql/updates/8063_world_creature_template.sql new file mode 100644 index 00000000000..de5a4c6218e --- /dev/null +++ b/sql/updates/8063_world_creature_template.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_ogre_brute' WHERE `creature_template`.`entry`=19995; +UPDATE `creature_template` SET `ScriptName` = 'npc_bloodmaul_brutebane' WHERE `creature_template`.`entry`=21241; diff --git a/src/scripts/outland/blades_edge_mountains.cpp b/src/scripts/outland/blades_edge_mountains.cpp index de7aadc07ec..e675b1b1a05 100644 --- a/src/scripts/outland/blades_edge_mountains.cpp +++ b/src/scripts/outland/blades_edge_mountains.cpp @@ -378,6 +378,100 @@ bool GOHello_go_legion_obelisk(Player* pPlayer, GameObject* pGo) return true; } + +/*###### +## npc_bloodmaul_brutebane +######*/ + + +enum eBloodmaul +{ + NPC_OGRE_BRUTE = 19995, + NPC_QUEST_CREDIT = 21241, + GO_KEG = 184315 +}; + +struct npc_bloodmaul_brutebaneAI : public ScriptedAI +{ + npc_bloodmaul_brutebaneAI(Creature *c) : ScriptedAI(c) + { + if(Creature* Ogre = me->FindNearestCreature(NPC_OGRE_BRUTE, 50, true)) + { + Ogre->SetReactState(REACT_DEFENSIVE); + Ogre->GetMotionMaster()->MovePoint(1, me->GetPositionX()-1, me->GetPositionY()+1, me->GetPositionZ()); + } + } + + uint64 OgreGUID; + + void Reset() + { + OgreGUID = 0; + } + + void UpdateAI(const uint32 uiDiff) {} +}; + +CreatureAI* GetAI_npc_bloodmaul_brutebane(Creature* pCreature) +{ + return new npc_bloodmaul_brutebaneAI (pCreature); +} + +/*###### +## npc_ogre_brute +######*/ + +struct npc_ogre_bruteAI : public ScriptedAI +{ + npc_ogre_bruteAI(Creature *c) : ScriptedAI(c) {} + + uint64 PlayerGUID; + + void Reset() + { + PlayerGUID = 0; + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || (!who->isAlive())) return; + + if (me->IsWithinDistInMap(who, 50.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(10512) == QUEST_STATUS_INCOMPLETE) + { + PlayerGUID = who->GetGUID(); + } + } + + void MovementInform(uint32 type, uint32 id) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + if(id == 1) + { + GameObject* Keg = me->FindNearestGameObject(GO_KEG, 20); + if(Keg) + Keg->Delete(); + me->HandleEmoteCommand(7); + me->SetReactState(REACT_AGGRESSIVE); + me->GetMotionMaster()->MoveTargetedHome(); + Creature* Credit = me->FindNearestCreature(NPC_QUEST_CREDIT, 50, true); + if(pPlayer) + pPlayer->KilledMonster(Credit->GetCreatureInfo(),Credit->GetGUID()); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_ogre_brute(Creature* pCreature) +{ + return new npc_ogre_bruteAI(pCreature); +} + /*###### ## AddSC ######*/ @@ -415,7 +509,17 @@ void AddSC_blades_edge_mountains() newscript = new Script; newscript->Name = "go_legion_obelisk"; - newscript->pGOHello = &GOHello_go_legion_obelisk; + newscript->pGOHello = &GOHello_go_legion_obelisk; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_bloodmaul_brutebane"; + newscript->GetAI = &GetAI_npc_bloodmaul_brutebane; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_ogre_brute"; + newscript->GetAI = &GetAI_npc_ogre_brute; newscript->RegisterSelf(); } |