All pastes #552281 Raw Edit

GossipQuest9803

public cpp v1 · immutable
·published 2007-06-09 06:19 UTC
rendered paste body
#include "StdAfx.h"#include "Setup.h"/************************************************************************//* GENERAL GUARD SCRIPT                                                 *//************************************************************************/// Covers *all* guard types, scripting their texts to guide players around.// Enable this define to make all gossip texts have a "back" / "I was looking// for somethinge else" button added.#define BACK_BUTTON#ifdef BACK_BUTTON// Make code neater with this define.#define SendQuickMenu(textid) objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), textid, Plr); \    Menu->SendTo(Plr);#else// Make code neater with this define.#define SendQuickMenu(textid) objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), textid, Plr); \    Menu->AddItem(0, "I was looking for something else.", 0); \    Menu->SendTo(Plr);#endif/************************************************************************//* Elder Kuruti Quest 9803                                              *//************************************************************************/class SCRIPT_DECL KurutiGossip : public GossipScript{public:    ADD_GOSSIP_FACTORY_FUNCTION(KurutiGossip);    void GossipHello(Creature * pCreature, Player * Plr, bool AutoSend)    {        GossipMenu *Menu;        objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), 18197, Plr);        Menu->AddItem(0, "Peace", 1);        Menu->AddItem(0, "Continue", 2);        if(AutoSend)            Menu->SendTo(Plr);    }    void GossipSelectOption(Creature* pCreature, Player* Plr, uint32 Id, uint32 IntId)    {        GossipMenu * Menu;        switch(IntId)        {        case 0:			{				GossipHello(pCreature, Plr, true);			}break;            //////////////////////            // Main menu handlers            /////        case 1:			{				SendQuickMenu(18197);			}break;		case 2:			{				GossipMenu *Menu;				SendQuickMenu(18972);			}break;        }    }};void SetupKurutiGossip(ScriptMgr * mgr){    /* Guard List */    mgr->register_gossip_script(18197,  &KurutiQuest::Create);}