Code:
//Script made by Nebels
//Ultra Spidey helped me form the base
//Haskin did too
#include "StdAfx.h"
#include "Setup.h"
#ifdef WIN32
#pragma warning(disable:4305)
#endif
#define NPCID 334567 //ID of the Guard
class SCRIPT_DECL CustomGuardNPC : public GossipScript
{
public:
void GossipHello(Object * pObject, Player* Plr, bool AutoSend);
void GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code);
void GossipEnd(Object * pObject, Player* Plr);
void Destroy()
{
delete this;
}
};
void CustomGuardNPC::GossipHello(Object* pObject, Player * Plr, bool AutoSend)
{
GossipMenu *Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 2593, Plr);
Menu->AddItem(0, "Auction House", 1); //Edit this line only
Menu->AddItem(0, "Mall Bank", 2); //Edit this line only
Menu->AddItem(0, "The Inn", 4); //Edit this line only
Menu->AddItem(0, "Guild Master", 6); //Edit this line only
Menu->AddItem(0, "Mailbox", 7); //Edit this line only
Menu->AddItem(0, "Riding Trainer", 8); //Edit this line only //If needed another line, add Menu->AddItem(0, "<INSERT NAME HERE>", <CASEID>);
Menu->AddItem(0, "Weapons Trainer", 9); //Edit this line only
Menu->AddItem(0, "Gear Center", 10); //Edit this line only
Menu->AddItem(0, "Teleporter", 11); //Edit this line only
Menu->AddItem(0, "Morpher", 14); //Edit this line only
Menu->AddItem(0, "Class Trainer", 12); //Edit this line only
Menu->AddItem(0, "Profession Trainer", 13); //Edit this line only
if(AutoSend)
Menu->SendTo(Plr);
}
void CustomGuardNPC::GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
{
Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
if(pCreature==NULL)
return;
GossipMenu * Menu;
switch(IntId)
{
case 0: // Return to start
{
GossipHello(pObject, Plr, true);
}
break;
//////////////////////
// Main menu handlers
/////
case 1: // Auction House
{
//SendQuickMenu(3834);
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 3834, Plr);
Plr->Gossip_SendPOI(7346.06, -1584.47, 6, 6, 0, "Mall Auction House"); //Edit this line only
}
break;
case 2: // Mall Bank
{
//SendQuickMenu(764);
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 764, Plr);
Plr->Gossip_SendPOI(7310.10, -1548.84, 6, 6, 0, "Mall Bank"); //Edit this line only
}
break;
case 4: // The Inn
{
//SendQuickMenu(3860);
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 3860, Plr);
Plr->Gossip_SendPOI(7561.70, -1518.20, 6, 6, 0, "The Mall Inn"); //Edit this line only
}
break;
case 6: // Guild Master
{
//SendQuickMenu(882);
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 882, Plr);
Plr->Gossip_SendPOI(7332.65, -1593.36, 6, 6, 0, "Guild Masters"); //Edit this line only
}
break;
case 7: // Mailbox
{
//SendQuickMenu(3518);
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 3518, Plr);
Plr->Gossip_SendPOI(7511.19, -1534.08, 6, 6, 0, "Mall Mailbox"); //Edit this line only
}
break;
case 8: // Riding Trainer
{
//SendQuickMenu (5984);
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 5984, Plr);
Plr->Gossip_SendPOI(7552.77, -1531.15, 6, 6, 0, "Riding Trainer"); //Edit this line only
}
break;
case 9: // Weapons Master
{
//SendQuickMenu(4516);
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4516, Plr);
Plr->Gossip_SendPOI(7513.50, -1563.02, 6, 6, 0, "Weapon Trainers"); //Edit this line only
}
break;
case 10: // Gear Center
{
//SendQuickMenu(7047);
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 7047, Plr);
Plr->Gossip_SendPOI(7325.28, -1531.90, 6, 6, 0, "Gear Center"); //Edit this line only
}
break;
case 11: // Teleporter
{
//SendQuickMenu(7499);
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 7499, Plr);
Plr->Gossip_SendPOI(7318.90, -1570.83, 6, 6, 0, "Teleporter"); //Edit this line only
}
break;
case 12: // Class Trainers
{
//SendQuickMenu(7499);
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 7499, Plr);
Plr->Gossip_SendPOI(7546.08, -1524.89, 6, 6, 0, "Class Trainers"); //Edit this line only
}
break;
case 13: // Profession Trainers
{
//SendQuickMenu(7499);
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 7499, Plr);
Plr->Gossip_SendPOI(7474.17, -1579.87, 6, 6, 0, "Profession Trainers"); //Edit this line only
}
break;
case 14: // Morpher
{
//SendQuickMenu(7499);
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 7499, Plr);
Plr->Gossip_SendPOI(7500.07, -1540.36, 6, 6, 0, "Morpher"); //Edit this line only
}
break;
}
}
void CustomGuardNPC::GossipEnd(Object * pObject, Player * Plr)
{
GossipScript::GossipEnd(pObject, Plr);
}
void SetupCustomGuardNPC(ScriptMgr * mgr)
{
GossipScript * sw = (GossipScript*) new CustomGuardNPC();
mgr->register_gossip_script(NPCID, sw);
}
Code:
INSERT INTO `creature_names` VALUES ('334567', 'Mall Guard', '', ' ', '0', '7', '0', '0', '0', '0', '18254', '0', '0', '0', '1', '1', '0', null);
INSERT INTO `creature_proto` VALUES ('334567', '85', '85', '1741', '8573', '8573', '0', '1', '1', '1430', '0', '347', '434', '0', '0', '0', '0', '7483', '218171138', '3', '2080', '33490436', '1038', '0', '0', '0', '360000', '0', '0', '0', '0', '0', '0', '0', '1', '1', '0', '0', '251', '0', '0', '2.5', '8', '14', '0');
If you need help please post here and I will try my best to answer your question(s).