*added script for Hunter Pet Trainers for Pet Talent Resetting

--HG--
branch : trunk
This commit is contained in:
Rat
2010-04-14 17:56:18 +02:00
parent 873f8d0380
commit 1e573cf11c
3 changed files with 58 additions and 0 deletions
+1
View File
@@ -161,6 +161,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_highlord_darion_mograine' WHERE
UPDATE `creature_template` SET `ScriptName`='npc_the_lich_king_tirion_dawn' WHERE `entry` IN (29183,29175);
UPDATE `creature_template` SET `ScriptName`='npc_shadowfiend' WHERE `entry` = 19668;
UPDATE `creature_template` SET `ScriptName`='npc_wormhole' WHERE `entry`='35646';
UPDATE `creature_template` SET `ScriptName`='npc_pet_trainer' WHERE `entry` IN (10090,3698,17484,4320,3545,16712,3622,16675,3620,10086,2879,3306,543,2878,3688,10089,16271,10088,3624);
/* */
/* ZONE */
+1
View File
@@ -0,0 +1 @@
UPDATE `creature_template` SET `ScriptName`='npc_pet_trainer' WHERE `entry` IN (10090,3698,17484,4320,3545,16712,3622,16675,3620,10086,2879,3306,543,2878,3688,10089,16271,10088,3624);
+56
View File
@@ -2062,6 +2062,56 @@ bool GossipSelect_npc_wormhole(Player* pPlayer, Creature* pCreature, uint32 uiSe
return true;
}
enum ePetTrainer
{
TEXT_ISHUNTER = 5838,
TEXT_NOTHUNTER = 5839,
TEXT_PETINFO = 13474,
TEXT_CONFIRM = 7722
};
#define GOSSIP_PET1 "How do I train my pet?"
#define GOSSIP_PET2 "I wish to untrain my pet."
#define GOSSIP_PET_CONFIRM "Yes, please do."
bool GossipHello_npc_pet_trainer(Player* pPlayer, Creature* pCreature)
{
if (pPlayer->getClass() == CLASS_HUNTER)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_PET1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
if (pPlayer->GetPet() && pPlayer->GetPet()->getPetType() == HUNTER_PET)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_PET2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
pPlayer->PlayerTalkClass->SendGossipMenu(TEXT_ISHUNTER, pCreature->GetGUID());
return true;
}
pPlayer->PlayerTalkClass->SendGossipMenu(TEXT_NOTHUNTER, pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_pet_trainer(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF + 1:
pPlayer->PlayerTalkClass->SendGossipMenu(TEXT_PETINFO, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2:
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_PET_CONFIRM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
pPlayer->PlayerTalkClass->SendGossipMenu(TEXT_CONFIRM, pCreature->GetGUID());
}
break;
case GOSSIP_ACTION_INFO_DEF + 3:
{
pPlayer->ResetPetTalents();
pPlayer->CLOSE_GOSSIP_MENU();
}
break;
}
return true;
}
void AddSC_npcs_special()
{
Script *newscript;
@@ -2194,5 +2244,11 @@ void AddSC_npcs_special()
newscript->pGossipHello = &GossipHello_npc_wormhole;
newscript->pGossipSelect = &GossipSelect_npc_wormhole;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_pet_trainer";
newscript->pGossipHello = &GossipHello_npc_pet_trainer;
newscript->pGossipSelect = &GossipSelect_npc_pet_trainer;
newscript->RegisterSelf();
}