All pastes #947792 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-03-18 18:47 UTC
rendered paste body
/* 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
*/


#include "../sc_defines.h"
#include "../../../../game/GossipDef.h"
#include "../../../../game/Player.h"
long long int money_int;
int costo_int;

// **** This script is designed as an example for others to build on ****
// **** Please modify whatever you'd like to as this script is only for developement ****

// **** Script Info ****
// This script is written in a way that it can be used for both friendly and hostile monsters
// Its primary purpose is to show just how much you can really do with scripts
// I recommend trying it out on both an agressive NPC and on friendly npc

// **** Quick Info ****
// Functions with Handled Function marked above them are functions that are called automatically by the core
// Functions that are marked Custom Function are functions I've created to simplify code

//This function is called when the player clicks an option on the gossip menu
struct MANGOS_DLL_DECL instance : public ScriptedAI
{

};

void SendDefaultMenu_instance(Player *player, Creature *_Creature, uint32 action)
{
    if (action == GOSSIP_ACTION_INFO_DEF + 1)//Ragefire Chasm
    {	
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 8)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Ragefire Chasm with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(389, 3.81, -14.82, -17.84, 4.31931);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 8 to enter Ragefire Chasm.",LANG_UNIVERSAL, NULL);
		}
		player->PlayerTalkClass->CloseGossip();
	}
    if (action == GOSSIP_ACTION_INFO_DEF + 2)//Wailing Caverns
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 10)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Wailing Caverns with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(1, -861.901, -2044.22, 82.1198, 0.375409);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 10 to enter Wailing Caverns.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
    if (action == GOSSIP_ACTION_INFO_DEF + 3)//The Deadmines
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 8)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to The Deadmines with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(0, -11081.8, 1527.01, 43.321, 4.66134);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 8 to enter The Deadmines.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
    if (action == GOSSIP_ACTION_INFO_DEF + 4)//Shadowfang Keep
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 10)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Shadowfang Keep with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(0, -247.625, 1524.89, 77.0431, 1.26284);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 10 to enter Shadowfang Keep.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
    if (action == GOSSIP_ACTION_INFO_DEF + 5)//Blackfathom Deeps
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 10)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Blackfathom Deeps with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(1, 4116.12, 869.897, 9.84358, 5.99259);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 10 to enter Blackfathom Deeps.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
    if (action == GOSSIP_ACTION_INFO_DEF + 6)//The Stockade
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 10)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to The Stockade with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(34, 54.23, 0.28, -18.3424, 6.21668);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 10 to enter The Stockade.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
    if (action == GOSSIP_ACTION_INFO_DEF + 7)//Gnomeregan
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 15)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Gnomeregan with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(0, -5181.16, 631.054, 398.547, 1.51189);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 15 to enter Gnomeregan.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
    if (action == GOSSIP_ACTION_INFO_DEF + 8)//Razorfen Kraul
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 15)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Razorfen Kraul with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(1, -4477.34, -1814.47, 86.5479, 1.61632);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 15 to enter Razorfen Kraul.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
    if (action == GOSSIP_ACTION_INFO_DEF + 9)//The Scarlet Monestary
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 20)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to The Scarlet Monestary with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(0, 2659.85, -673.719, 112.127, 6.00437);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 20 to enter The Scarlet Monestary.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
    if (action == GOSSIP_ACTION_INFO_DEF + 10)//Razorfen Downs
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 20)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Razorfen Downs with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(1, -4422.24, -1961.41, 86.4465, 4.12959);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 20 to enter Razorfen Downs.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
    if (action == GOSSIP_ACTION_INFO_DEF + 11)//Uldaman
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 30)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Uldaman with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(0, -6110.62, -3304.7, 256.591, 1.27628);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 30 to enter Uldaman.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
    if (action == GOSSIP_ACTION_INFO_DEF + 12)//Zul'Farrak
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 30)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Zul'Farrak with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(1, -6887.52, -2901.55, 9.44237, 6.14574);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 30 to enter Zul'Farrak.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
    if (action == GOSSIP_ACTION_INFO_DEF + 13)//Maraudon
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 30)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Maraudon with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(1, -1424.25, 2832.14, 115.948, 1.51421);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 30 to enter Maraudon.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
    if (action == GOSSIP_ACTION_INFO_DEF + 14)//Temple of Atal'Hakkar
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 35)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Temple of Atal'Hakkar with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(0, -10183.9, -3993.01, -109.195, 6.04364);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 35 to enter Temple of Atal'Hakkar.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
    if (action == GOSSIP_ACTION_INFO_DEF + 15)//More
	{
        player->ADD_GOSSIP_ITEM( 0, "Blackrock Depths (52-60) - 1 Gold"        , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 1);
        player->ADD_GOSSIP_ITEM( 0, "Blackrock Spire (55-60) - 1 Gold"        , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 2);
        player->ADD_GOSSIP_ITEM( 0, "Dire Maul (55-60) - 1 Gold"        , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 3);
        player->ADD_GOSSIP_ITEM( 0, "Stratholme (58-60) - 1 Gold"        , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 4);
        player->ADD_GOSSIP_ITEM( 0, "Scholomance (58-60) - 1 Gold"        , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 5);
		player->ADD_GOSSIP_ITEM( 0, "<- [Previous]"        , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 6);
		if (player->GetQuestStatus(6565652) == QUEST_STATUS_COMPLETE)
		{
		player->ADD_GOSSIP_ITEM( 0, "Zul Aman"        , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 7);
		player->ADD_GOSSIP_ITEM( 0, "Black Temple"        , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 8);
		player->ADD_GOSSIP_ITEM( 0, "Coilfang Resevoir"        , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 9);
		player->ADD_GOSSIP_ITEM( 0, "Auchindoun"        , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 10);
		player->ADD_GOSSIP_ITEM( 0, "Tempest Keep"        , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 11);
		}
		else
		{
		player->ADD_GOSSIP_ITEM( 0, "Outland Instances"        , GOSSIP_SENDER_SEC_PROFTRAIN, GOSSIP_ACTION_INFO_DEF + 12);
		}

		player->PlayerTalkClass->SendGossipMenu(907,_Creature->GetGUID());
	}
}
void SendSecMenu_instance(Player *player, Creature *_Creature, uint32 action)
{
    if (action == GOSSIP_ACTION_INFO_DEF + 1)//Blackrock Depths
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;}
		if (player->getLevel() >= 45)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Temple of Blackrock Depths with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(0, -7305.1, -913.556, 165.419, 0.058899);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 45 to enter Blackrock Depths.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
    if (action == GOSSIP_ACTION_INFO_DEF + 2)//Blackrock Spire
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 45)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Temple of Blackrock Spire with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(229, 79.1274, -237.883, 54.561, 1.63168);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 45 to enter Blackrock Spire.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
    if (action == GOSSIP_ACTION_INFO_DEF + 3)//Dire Maul
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 40)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Temple of Dire Maul with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(1, -3519.64, 1121.92, 161.025, 4.73595);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 40 to enter Dire Maul.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
    if (action == GOSSIP_ACTION_INFO_DEF + 4)//Stratholme
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 45)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Temple of Stratholme with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(0, 3180.93, -4039.18, 106.589, 6.26355);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 45 to enter Stratholme.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
    if (action == GOSSIP_ACTION_INFO_DEF + 5)//Scholomance
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 45)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Temple of Scholomance with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(0, 1226.07, -2599.12, 88.1772, 0.444533);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 45 to enter Scholomance.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
	if (action == GOSSIP_ACTION_INFO_DEF + 6)//Previous
    {
        player->ADD_GOSSIP_ITEM( 0, "Ragefire Chasm (13-18) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
        player->ADD_GOSSIP_ITEM( 0, "Wailing Caverns (17-24) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
        player->ADD_GOSSIP_ITEM( 0, "The Deadmines (17-26) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
        player->ADD_GOSSIP_ITEM( 0, "Shadowfang Keep (22-30) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
        player->ADD_GOSSIP_ITEM( 0, "Blackfathom Deeps (24-32) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
        player->ADD_GOSSIP_ITEM( 0, "The Stockade (24-32) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
        player->ADD_GOSSIP_ITEM( 0, "Gnomeregan (29-38) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
        player->ADD_GOSSIP_ITEM( 0, "Razorfen Kraul (29-38) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
        player->ADD_GOSSIP_ITEM( 0, "The Scarlet Monestary (34-45) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
        player->ADD_GOSSIP_ITEM( 0, "Rarorfen Downs (35-40) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
        player->ADD_GOSSIP_ITEM( 0, "Uldaman (41-51) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
        player->ADD_GOSSIP_ITEM( 0, "Zul'Farrak (44-54) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
        player->ADD_GOSSIP_ITEM( 0, "Maraudon (46-55) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
        player->ADD_GOSSIP_ITEM( 0, "Temple of Atal'Hakkar (50-56) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
        player->ADD_GOSSIP_ITEM( 0, "[More] ->"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);

        player->PlayerTalkClass->SendGossipMenu(907,_Creature->GetGUID());
	}
	if (action == GOSSIP_ACTION_INFO_DEF + 7)//Zul Aman
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 68)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Temple of Scholomance with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(530, 6846.95, -7954.50, 170.12, 0.444533);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 68 to enter Zul Aman.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
	if (action == GOSSIP_ACTION_INFO_DEF + 8)//BT
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 70)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Temple of Scholomance with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(530, -3622.79, 329.93, 38.75, 0.444533);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 70 to enter Black Temple.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
	if (action == GOSSIP_ACTION_INFO_DEF + 9)//Coilfang Res
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 70)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Temple of Scholomance with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(530, 721.75, 6847.51, 68.78, 0.444533);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 70 to enter Coilfang Resevoir.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
	if (action == GOSSIP_ACTION_INFO_DEF + 10)//Auchindoun
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 68)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Temple of Scholomance with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(530, -3337.95, 4945.91, -101.49, 0.444533);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 68 to enter Auchindoun.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
	if (action == GOSSIP_ACTION_INFO_DEF + 11)//Tempest Keep
    {
		money_int = player-> GetMoney();
		costo_int = 10000;
		if (money_int < costo_int ) { _Creature->Say("You haven't enough money", LANG_UNIVERSAL, NULL);
		return;
		}
		if (player->getLevel() >= 70)
		{
			//((instance&)_Creature->AI()).DoPlaySoundToSet(_Creature,3226);
			//_Creature->Say("Off to Temple of Scholomance with you, $N!",LANG_UNIVERSAL, NULL);
			player->TeleportTo(530, 3037.02, 1797.48, 142.95, 0.444533);
			player->ModifyMoney(-1*costo_int);
		} else {
			_Creature->Say(" you must be at least level 70 to enter Tempest Keep.",LANG_UNIVERSAL, NULL);
		}
        player->PlayerTalkClass->CloseGossip();
    }
	if (action == GOSSIP_ACTION_INFO_DEF + 12)//Tell ABout Quest
    {
		_Creature->Say("You must speak to my good friend Darkboss first, he will be making sure the black market is safe.",LANG_UNIVERSAL, NULL);

        player->PlayerTalkClass->CloseGossip();
    }
}

//This function is called when the player clicks an option on the gossip menu
bool GossipSelect_instance(Player *player, Creature *_Creature, uint32 sender, uint32 action )
{
    if (sender == GOSSIP_SENDER_MAIN)
        SendDefaultMenu_instance(player, _Creature, action);
    if (sender == GOSSIP_SENDER_SEC_PROFTRAIN)
        SendSecMenu_instance(player, _Creature, action);

    return true;
}

//This function is called when the player opens the gossip menu
bool GossipHello_instance(Player *player, Creature *_Creature)
{
    player->ADD_GOSSIP_ITEM( 0, "Ragefire Chasm (13-18) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
    player->ADD_GOSSIP_ITEM( 0, "Wailing Caverns (17-24) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
    player->ADD_GOSSIP_ITEM( 0, "The Deadmines (17-26) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
    player->ADD_GOSSIP_ITEM( 0, "Shadowfang Keep (22-30) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
    player->ADD_GOSSIP_ITEM( 0, "Blackfathom Deeps (24-32) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
    player->ADD_GOSSIP_ITEM( 0, "The Stockade (24-32) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
    player->ADD_GOSSIP_ITEM( 0, "Gnomeregan (29-38 - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
    player->ADD_GOSSIP_ITEM( 0, "Razorfen Kraul (29-38) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
    player->ADD_GOSSIP_ITEM( 0, "The Scarlet Monestary (34-45) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
    player->ADD_GOSSIP_ITEM( 0, "Rarorfen Downs (35-40) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
    player->ADD_GOSSIP_ITEM( 0, "Uldaman (41-51) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
    player->ADD_GOSSIP_ITEM( 0, "Zul'Farrak (44-54) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
    player->ADD_GOSSIP_ITEM( 0, "Maraudon (46-55) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
    player->ADD_GOSSIP_ITEM( 0, "Temple of Atal'Hakkar (50-56) - 1 Gold"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
    player->ADD_GOSSIP_ITEM( 0, "[More] ->"        , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);

    player->PlayerTalkClass->SendGossipMenu(907,_Creature->GetGUID());

    return true;
}

bool ReciveEmote_instance(Player *player, Creature *_Creature, uint32 emote)
{
    _Creature->HandleEmoteCommand(emote);

    /*if (emote == EMOTE_STATE_DANCE)
        _Creature->Say("Cut out the shenanigans!",LANG_UNIVERSAL,NULL);

    if (emote == EMOTE_ONESHOT_SALUTE)
        _Creature->Say("Carry on soldier.",LANG_UNIVERSAL,NULL);*/

    return true;
}
void AddSC_instance()
{
    Script *newscript;
    newscript = new Script;
    newscript->Name="instance";
    newscript->pGossipHello = &GossipHello_instance;
    newscript->pGossipSelect = &GossipSelect_instance;
    newscript->pReceiveEmote = &ReciveEmote_instance;

    m_scripts[nrscripts++] = newscript;
}