diff options
author | _manuel_ <manue.l@live.com.ar> | 2010-03-08 11:07:47 -0300 |
---|---|---|
committer | _manuel_ <manue.l@live.com.ar> | 2010-03-08 11:07:47 -0300 |
commit | 887583bf092bf3956db493c259d7c5c14c2b5eff (patch) | |
tree | d21b1e7a6ed449037108116bba982cdca5ea72eb /src | |
parent | f63ee4050c708c84b7db068125feba748ef9f60d (diff) |
Support for quest Doing your Duty by Malcrom. Thanks to Supabad.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/scripts/northrend/grizzly_hills.cpp | 59 | ||||
-rw-r--r-- | src/scripts/world/go_scripts.cpp | 61 |
2 files changed, 120 insertions, 0 deletions
diff --git a/src/scripts/northrend/grizzly_hills.cpp b/src/scripts/northrend/grizzly_hills.cpp index b057faf7e5f..d3910db6ab3 100644 --- a/src/scripts/northrend/grizzly_hills.cpp +++ b/src/scripts/northrend/grizzly_hills.cpp @@ -356,6 +356,60 @@ CreatureAI* GetAI_npc_mrfloppy(Creature* pCreature) return new npc_mrfloppyAI(pCreature); } +// Outhouse Bunny + +enum eOuthouseBunny +{ + SPELL_OUTHOUSE_GROANS = 48382, + SPELL_CAMERA_SHAKE = 47533, + SPELL_DUST_FIELD = 48329 +}; + +enum eSounds +{
SOUND_FEMALE = 12671,
SOUND_MALE = 12670
};
+struct npc_outhouse_bunnyAI : public ScriptedAI +{ + npc_outhouse_bunnyAI(Creature* pCreature) : ScriptedAI(pCreature) {} + + uint8 m_counter; + uint8 m_gender; + + void Reset() + { + m_counter = 0; + m_gender = 0; + } + + void SetData(uint32 uiType, uint32 uiData) + { + if (uiType == 1) + m_gender = uiData; + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (pSpell->Id == SPELL_OUTHOUSE_GROANS) + { + ++m_counter; + if (m_counter < 5) + DoCast(pCaster, SPELL_CAMERA_SHAKE, true); + else + m_counter = 0; + DoCast(me, SPELL_DUST_FIELD, true); + switch (m_gender) + { + case GENDER_FEMALE: DoPlaySoundToSet(m_creature, SOUND_FEMALE); break; + case GENDER_MALE: DoPlaySoundToSet(m_creature, SOUND_MALE); break; + } + } + } +}; + +CreatureAI* GetAI_npc_outhouse_bunny(Creature* pCreature) +{ + return new npc_outhouse_bunnyAI (pCreature); +} + void AddSC_grizzly_hills() { Script* newscript; @@ -376,4 +430,9 @@ void AddSC_grizzly_hills() newscript->Name = "npc_mrfloppy"; newscript->GetAI = &GetAI_npc_mrfloppy; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_outhouse_bunny"; + newscript->GetAI = &GetAI_npc_outhouse_bunny; + newscript->RegisterSelf(); } diff --git a/src/scripts/world/go_scripts.cpp b/src/scripts/world/go_scripts.cpp index 67b84279ece..22dd21a1075 100644 --- a/src/scripts/world/go_scripts.cpp +++ b/src/scripts/world/go_scripts.cpp @@ -825,6 +825,61 @@ bool GOHello_go_black_cage(Player *pPlayer, GameObject *pGO) return true; } +/*###### +## go_amberpine_outhouse +######*/ + +#define GOSSIP_USE_OUTHOUSE "Use the outhouse." +#define GO_ANDERHOLS_SLIDER_CIDER_NOT_FOUND "Quest item Anderhol's Slider Cider not found." + +enum eAmberpineOuthouse +{ + ITEM_ANDERHOLS_SLIDER_CIDER = 37247, + NPC_OUTHOUSE_BUNNY = 27326, + QUEST_DOING_YOUR_DUTY = 12227, + SPELL_INDISPOSED = 53017, + SPELL_INDISPOSED_III = 48341, + SPELL_CREATE_AMBERSEEDS = 48330, + GOSSIP_OUTHOUSE_INUSE = 12775, + GOSSIP_OUTHOUSE_VACANT = 12779 +}; + +bool GOHello_go_amberpine_outhouse(Player *pPlayer, GameObject *pGO) +{ + if (pPlayer->GetQuestStatus(QUEST_DOING_YOUR_DUTY) == QUEST_STATUS_INCOMPLETE || + (pPlayer->GetQuestStatus(QUEST_DOING_YOUR_DUTY) == QUEST_STATUS_COMPLETE)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_USE_OUTHOUSE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_OUTHOUSE_VACANT, pGO->GetGUID()); + return true; + } + else + pPlayer->SEND_GOSSIP_MENU(GOSSIP_OUTHOUSE_INUSE, pGO->GetGUID()); + return true; +} + +bool GOSelect_go_amberpine_outhouse(Player *pPlayer, GameObject *pGO, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF +1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + Creature* pTarget = GetClosestCreatureWithEntry(pPlayer, NPC_OUTHOUSE_BUNNY, 3.0f); + if (pTarget) + { + pTarget->AI()->SetData(1,pPlayer->getGender()); + pGO->CastSpell(pTarget, SPELL_INDISPOSED_III); + } + pGO->CastSpell(pPlayer, SPELL_INDISPOSED); + if (pPlayer->HasItemCount(ITEM_ANDERHOLS_SLIDER_CIDER,1)) + pGO->CastSpell(pPlayer, SPELL_CREATE_AMBERSEEDS); + return true; + } + else + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->GetSession()->SendNotification(GO_ANDERHOLS_SLIDER_CIDER_NOT_FOUND); + return false; +} + void AddSC_go_scripts() { Script *newscript; @@ -989,4 +1044,10 @@ void AddSC_go_scripts() newscript->Name = "go_dragonflayer_cage"; newscript->pGOHello = &GOHello_go_dragonflayer_cage; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_amberpine_outhouse"; + newscript->pGOHello = &GOHello_go_amberpine_outhouse; + newscript->pGOSelect = &GOSelect_go_amberpine_outhouse; + newscript->RegisterSelf(); } |