All pastes #460069 Raw Edit

Miscellany

public text v1 · immutable
#460069 ·published 2007-04-26 20:45 UTC
rendered paste body
//test teleporter script


#include "../sc_defines.h"


#define TELEPORT_TEXT_IF "Teleport me to Ironforge"
#define TELEPORT_TEXT_GS "Teleport me to Goldshire"

bool GossipHello_teleporter1(Player *player, Creature *_Creature)
{
    player->ADD_GOSSIP_ITEM( 6, TELEPORT_TEXT_IF          , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
    player->ADD_GOSSIP_ITEM( 2, TELEPORT_TEXT_GS       , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);

    player->SEND_GOSSIP_MENU(1,_Creature->GetGUID());

    return true;
}

/*******************************************************
 *				Start of GOSSIP_MENU
 *******************************************************/

void SendDefaultMenu_teleporter1(Player *player, Creature *_Creature, uint32 action)
{

    if (action == GOSSIP_ACTION_INFO_DEF + 1)//Teleport to Ironforge
    {
        player->TeleportTo(0, -4919.979980 , -957.887024 , 501.503998 , 0, false, true );
    }

    if (action == GOSSIP_ACTION_INFO_DEF + 2)//Teleport to Goldshire
    {
        player->TeleportTo(0, -9443.450195 , 59.894402  , 56.070400 , 0, false, true );
    }

}

bool GossipSelect_teleporter1(Player *player, Creature *_Creature, uint32 sender, uint32 action )
{
    if (sender == GOSSIP_SENDER_MAIN)
        SendDefaultMenu_teleporter1(player, _Creature, action);

    return true;
}

/*******************************************************
 *				End of GOSSIP_MENU
 *******************************************************/

void AddSC_teleporter1()
{
    Script *newscript;

    newscript = new Script;
    newscript->Name="teleporter1";
    newscript->pGossipHello          = &GossipHello_teleporter1;
    newscript->pGossipSelect         = &GossipSelect_teleporter1;

    m_scripts[nrscripts++] = newscript;
}