All pastes #773685 Raw Edit

Someone

public text v1 · immutable
·published 2007-11-14 18:38 UTC
rendered paste body
// AkamaAI

#define SendQuickMenu(textid) objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), textid, plr); \
    Menu->SendTo(plr);

class SCRIPT_DECL AkamaGossip : public GossipScript
{
public:
    void GossipHello(Object* pObject, Player* plr, bool AutoSend)
    {
        GossipMenu *Menu;
        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, plr);
        
		Menu->AddItem( 0, "Let's free Outland!", 1);

        if(AutoSend)
            Menu->SendTo(plr);
    }

	void GossipSelectOption(Object* pObject, Player* plr, uint32 Id, uint32 IntId, const char * EnteredCode)
    {
		switch (IntId)
		{
			case 0:
				GossipHello(pObject, plr, true);
				break;

			case 1:
			{
				pObject->SetUInt32Value(UNIT_NPC_FLAGS,0);
				WayStart = 0;
			}break;
		}
	}

    void Destroy()
    {
        delete this;
    }
};

void SetupBlackTemple(ScriptMgr * mgr)
{
	GossipScript * AG = (GossipScript*) new AkamaGossip();
	mgr->register_gossip_script(CN_AKAMA, AG);
}