// TextIDs from npc_text
enum eEnums
{
TEXT_MAIN_H = 400000, //Horde main menu text
TEXT_MAIN_A = 400001, //Alliance main menu text
TEXT_DUNGEON = 400002, //Dungeon teleport menu texts
TEXT_RAID = 400003, //Raid teleport menu text
TEXT_AREA = 400004, //Area teleport location menu texts
TELEPORT_COUNT = sizeof TeLe/sizeof(*TeLe),
};
#define ARE_YOU_SURE "|cffffffffGetting a Move on to|r "
#define ERROR_COMBAT "|cffff0000Kill Whatever that thing is first!|r"
bool Custom_FactCheck (uint32 Fact, unsigned char Key)
{
bool Show = false;
switch (TeLe[Key].faction)
{
case 0:
Show = true;
break;
case 1:
if (Fact == HORDE)
Show = true;
break;
case 2:
if (Fact == ALLIANCE)
Show = true;
break;
}
return (Show);
}
uint32 Custom_GetText (unsigned int menu, Player* pPlayer)
{
uint32 TEXT = TEXT_AREA;
switch (menu)
{
case 0:
switch (pPlayer->GetTeam())
{
case ALLIANCE:
TEXT = TEXT_MAIN_A;
break;
case HORDE:
TEXT = TEXT_MAIN_H;
break;
}
case 1:
case 2:
case 3:
TEXT = TEXT_DUNGEON;
break;
case 4:
TEXT = TEXT_RAID;
break;
}
return (TEXT);
}
void Custom_GetMenu (Player* pPlayer, Creature* pCreature, uint32 Key)
{
bool ENDMENU = false;
for(uint32 i = 0; i < TELEPORT_COUNT; i++)
{
if (ENDMENU && TeLe.menu_id != Key)
break;
if (TeLe.menu_id == Key && pPlayer->getLevel() >= TeLe.level && Custom_FactCheck(pPlayer->GetTeam(), i))
{
if (TeLe.next_menu_id != 0)
pPlayer->ADD_GOSSIP_ITEM_EXTENDED(TeLe.icon, TeLe.name, GOSSIP_SENDER_MAIN, i, "", TeLe.cost, false);
else
pPlayer->ADD_GOSSIP_ITEM_EXTENDED(TeLe.icon, TeLe.name, GOSSIP_SENDER_MAIN, i, ARE_YOU_SURE+TeLe.name, TeLe.cost, false);
ENDMENU = true;
}
}
pPlayer->PlayerTalkClass->SendGossipMenu(Custom_GetText(Key, pPlayer), pCreature->GetGUID());
}
class tele_script_mortal : public CreatureScript
{
public:
tele_script_mortal()
: CreatureScript("tele_script_mortal")
{
}