Support for quest Doing your Duty by Malcrom. Thanks to Supabad.

--HG--
branch : trunk
This commit is contained in:
_manuel_
2010-03-08 11:07:47 -03:00
parent f63ee4050c
commit 887583bf09
4 changed files with 124 additions and 0 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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);
}
@@ -376,4 +430,9 @@ void AddSC_grizzly_hills()
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_mrfloppy";
newscript->GetAI = &GetAI_npc_mrfloppy;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_outhouse_bunny";

View File

@@ -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();
}