All pastes #605494 Raw Edit

Anonymous

public cpp v1 · immutable
·published 2007-07-06 07:17 UTC
rendered paste body
class KingMagniAI : public GossipScript{public:	ADD_GOSSIP_FACTORY_FUNCTION(KingMagniAI);    void GossipHello(Creature* pCreature, Player* Plr, bool AutoSend);    void GossipSelectOption(Creature* pCreature, Player* Plr, uint32 Id, uint32 IntId);    void GossipEnd(Creature* pCreature, Player* Plr);};void KingMagniAI::GossipHello(Creature* pCreature, Player* Plr, bool AutoSend){	GossipMenu *Menu;	objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), 0, Plr);	Menu->AddItem( 0, "I would like to browse your goods.", 1 );	Menu->AddItem( 0, "I would like to reset my talents.", 2 );	Menu->SendTo(Plr);}void KingMagniAI::GossipSelectOption(Creature* pCreature, Player* Plr, uint32 Id, uint32 IntId){	switch(IntId)	{	case 1:		Plr->GetSession()->SendInventoryList(pCreature);		break;	case 2:		Plr->Reset_Talents();		std::stringstream ss;		ss << "Good luck, " << Plr->GetName();		pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, ss.str().c_str());		break;	}}void KingMagniAI::GossipEnd(Creature* pCreature, Player* Plr){	GossipScript::GossipEnd(pCreature, Plr);	std::stringstream ss;	ss << "Farewell, and safe journeys, " << Plr->GetName();	pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, ss.str().c_str());}