diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/scripts/northrend/storm_peaks.cpp | 36 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/world/go_scripts.cpp | 26 |
2 files changed, 61 insertions, 1 deletions
diff --git a/src/bindings/scripts/scripts/northrend/storm_peaks.cpp b/src/bindings/scripts/scripts/northrend/storm_peaks.cpp index ab55c2e1341..c456b91805c 100644 --- a/src/bindings/scripts/scripts/northrend/storm_peaks.cpp +++ b/src/bindings/scripts/scripts/northrend/storm_peaks.cpp @@ -169,6 +169,37 @@ bool GossipSelect_npc_thorim(Player* pPlayer, Creature* pCreature, uint32 uiSend return true; } +/*###### +## npc_goblin_prisioner +######*/ + +enum eGoblinPrisioner +{ + GO_RUSTY_CAGE = 191544 +}; + +struct TRINITY_DLL_DECL npc_goblin_prisionerAI : public ScriptedAI +{ + npc_goblin_prisionerAI(Creature* pCreature) : ScriptedAI (pCreature){} + + void Reset() + { + m_creature->SetReactState(REACT_PASSIVE); + + if(GameObject* pGO = m_creature->FindNearestGameObject(GO_RUSTY_CAGE,5.0f)) + { + if(pGO->GetGoState() == GO_STATE_ACTIVE) + pGO->SetGoState(GO_STATE_READY); + } + } + +}; + +CreatureAI* GetAI_npc_goblin_prisioner(Creature* pCreature) +{ + return new npc_goblin_prisionerAI(pCreature); +} + void AddSC_storm_peaks() { Script* newscript; @@ -191,4 +222,9 @@ void AddSC_storm_peaks() newscript->pGossipHello = &GossipHello_npc_thorim; newscript->pGossipSelect = &GossipSelect_npc_thorim; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_goblin_prisioner"; + newscript->GetAI = &GetAI_npc_goblin_prisioner; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/world/go_scripts.cpp b/src/bindings/scripts/scripts/world/go_scripts.cpp index 668dd513191..630006226bd 100644 --- a/src/bindings/scripts/scripts/world/go_scripts.cpp +++ b/src/bindings/scripts/scripts/world/go_scripts.cpp @@ -17,7 +17,7 @@ /* ScriptData SDName: GO_Scripts SD%Complete: 100 -SDComment: Quest support: 4285,4287,4288(crystal pylons), 4296, 6481, 10990, 10991, 10992, Field_Repair_Bot->Teaches spell 22704. Barov_journal->Teaches spell 26089 +SDComment: Quest support: 4285,4287,4288(crystal pylons), 4296, 6481, 10990, 10991, 10992, Field_Repair_Bot->Teaches spell 22704. Barov_journal->Teaches spell 26089,12843 SDCategory: Game Objects EndScriptData */ @@ -39,6 +39,7 @@ go_tablet_of_madness go_tablet_of_the_seven go_tele_to_dalaran_crystal go_tele_to_violet_stand +go_rusty_cage EndContentData */ #include "precompiled.h" @@ -536,6 +537,24 @@ bool GOHello_go_matrix_punchograph(Player* pPlayer, GameObject* pGo) return false; } +enum eRustyCage +{ + NPC_GOBLIN_PRISIONER = 29466 +}; + +bool GOHello_go_rusty_cage(Player* pPlayer, GameObject* pGO) +{ + if(Creature* m_creature = pGO->FindNearestCreature(NPC_GOBLIN_PRISIONER,5.0f,true)) + { + pGO->SetGoState(GO_STATE_ACTIVE); + pPlayer->KilledMonsterCredit(NPC_GOBLIN_PRISIONER,m_creature->GetGUID()); + m_creature->DisappearAndDie(); + m_creature->RemoveCorpse(); + } + + return true; +} + void AddSC_go_scripts() { Script *newscript; @@ -655,5 +674,10 @@ void AddSC_go_scripts() newscript->Name = "go_matrix_punchograph"; newscript->pGOHello = &GOHello_go_matrix_punchograph; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_rusty_cage"; + newscript->pGOHello = &GOHello_go_rusty_cage; + newscript->RegisterSelf(); } |