aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/FULL/world_scripts_full.sql2
-rw-r--r--sql/updates/7500_world_scriptname.sql2
-rw-r--r--src/scripts/northrend/grizzly_hills.cpp59
-rw-r--r--src/scripts/world/go_scripts.cpp61
4 files changed, 124 insertions, 0 deletions
diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql
index 199649a2d69..e50fbfe63e9 100644
--- a/sql/FULL/world_scripts_full.sql
+++ b/sql/FULL/world_scripts_full.sql
@@ -597,6 +597,8 @@ UPDATE `instance_template` SET `script`='instance_gnomeregan' WHERE `map`=90;
UPDATE `creature_template` SET `ScriptName`='npc_orsonn_and_kodian' WHERE `entry` IN (27274,27275);
UPDATE `creature_template` SET `ScriptName` = 'npc_emily' WHERE `entry`=26588;
UPDATE `creature_template` SET `ScriptName` = 'npc_mrfloppy' WHERE `entry`=26589;
+UPDATE `gameobject_template` SET `ScriptName`= 'go_amberpine_outhouse' WHERE `entry`=188666;
+UPDATE `creature_template` SET `ScriptName`= 'npc_outhouse_bunny' WHERE `entry`=27326;
/* DRAK'THARON KEEP */
UPDATE `instance_template` SET `script`='instance_drak_tharon' WHERE `map`=600;
diff --git a/sql/updates/7500_world_scriptname.sql b/sql/updates/7500_world_scriptname.sql
new file mode 100644
index 00000000000..5b309f48da7
--- /dev/null
+++ b/sql/updates/7500_world_scriptname.sql
@@ -0,0 +1,2 @@
+UPDATE `gameobject_template` SET `ScriptName`= 'go_amberpine_outhouse' WHERE `entry`=188666;
+UPDATE `creature_template` SET `ScriptName`= 'npc_outhouse_bunny' WHERE `entry`=27326; \ No newline at end of file
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();
}