/* Copyright (C) 2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GM NPC Teleporter Script (base for Teleportation Masters)
Biglad
*/
#include "../sc_defines.h"
#include "../../../../game/GossipDef.h"
#include "../../../../game/Player.h"
bool GossipHello_npc_hidden_shop_master(Player *player, Creature *_Creature)
{
player->ADD_GOSSIP_ITEM( 5, "Send me to the Black Market." , GOSSIP_SENDER_MAIN, 1205);
player->ADD_GOSSIP_ITEM( 5, "Forget it." , GOSSIP_SENDER_MAIN, 1206);
player->PlayerTalkClass->SendGossipMenu(5,_Creature->GetGUID());
return true;
}
/*******************************************************
* Start of GOSSIP_MENU
*******************************************************/
void SendDefaultMenu_npc_hidden_shop_master(Player *player, Creature *_Creature, uint32 action )
{
if(player->isAttacked())
{
_Creature->Say("You are in combat!", LANG_UNIVERSAL, NULL);
return;
}
if( player->getLevel() < 60 )
{
_Creature->Say("You must be lvl 60+ to use items from THE shops", LANG_UNIVERSAL, NULL);
return;
}
switch(action)
{
case 1205://Revive Player if has crytsal
player->CLOSE_GOSSIP_MENU();
if (player->GetQuestStatus(104722) == QUEST_STATUS_COMPLETE)
{
player->TeleportTo(0, -4821.69, -976.53, 464.70, 0.627523);
}
else
{
_Creature->Yell("If you want to visit the back market shops you must do something for me 1st, see my wife Alison, she will give you a task todo for me, come back when you have completed it.", LANG_UNIVERSAL, NULL);
}
break;
case 1206://Close menu
player->CLOSE_GOSSIP_MENU();
break;
}
}
/*******************************************************
* End of GOSSIP_MENU
*******************************************************/
bool GossipSelect_npc_hidden_shop_master(Player *player, Creature *_Creature, uint32
sender, uint32 action )
{
// Main menu
if (sender == GOSSIP_SENDER_MAIN)
SendDefaultMenu_npc_hidden_shop_master(player, _Creature, action );
return true;
}
void AddSC_npc_hidden_shop_master()
{
Script *newscript;
newscript = new Script;
newscript->Name="npc_hidden_shop_master";
newscript->pGossipHello = &GossipHello_npc_hidden_shop_master;
newscript->pGossipSelect = &GossipSelect_npc_hidden_shop_master;
m_scripts[nrscripts++] = newscript;
}