All pastes #605805 Raw Edit

Something

public cpp v1 · immutable
·published 2007-07-06 13:30 UTC
rendered paste body
class KingMagniAI : public GossipScript{public:	ADD_GOSSIP_FACTORY_FUNCTION(KingMagniAI);    void GossipHello(Creature* pCreature, Player* Plr, bool AutoSend)	{			GossipMenu *Menu;	objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), 4474, Plr);	Menu->AddItem( 0, "I would like to browse your goods.", 1 );	Menu->AddItem( 0, "I would like to reset my talents.", 2 );	if(AutoSend)		Menu->SendTo(Plr);	}    void 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 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());	}};void SetupBattleground(ScriptMgr * mgr){	mgr->register_gossip_script(KING_MAGNI_BRONZEBEARD, &KingMagniAI::Create);	mgr->register_gossip_script(THRALL, &KingMagniAI::Create);}