mirror of
https://github.com/telegramcores/mod-premium.git
synced 2026-01-13 00:58:36 +00:00
Merge pull request #3 from talamortis/master
Module update with more features
This commit is contained in:
@@ -13,33 +13,44 @@ PremiumAccount = 1
|
|||||||
# 0 - (Disabled)
|
# 0 - (Disabled)
|
||||||
Morph = 1
|
Morph = 1
|
||||||
|
|
||||||
# Bank
|
|
||||||
# Description: Allow Players to use mobile bank
|
|
||||||
# Default: 1 - (Enabled)
|
|
||||||
# 0 - (Disabled)
|
|
||||||
Bank = 1
|
|
||||||
|
|
||||||
# Auction
|
|
||||||
# Description: Allow Players to use mobile Auction
|
|
||||||
# Default: 1 - (Enabled)
|
|
||||||
# 0 - (Disabled)
|
|
||||||
Auction = 1
|
|
||||||
|
|
||||||
# Mount
|
# Mount
|
||||||
# Description: Allow Players to use mount
|
# Description: Allow Players to use mount
|
||||||
# Default: 1 - (Enabled)
|
# Default: 1 - (Enabled)
|
||||||
# 0 - (Disabled)
|
# 0 - (Disabled)
|
||||||
Mount = 1
|
Mount = 1
|
||||||
|
|
||||||
|
# Class Trainers
|
||||||
|
# Description: Allows players to spawn class trainers
|
||||||
|
# Default: 1 - (Enabled)
|
||||||
|
# 0 - (Disabled)
|
||||||
|
Trainers = 1
|
||||||
|
|
||||||
|
##################################################################################################################
|
||||||
|
# PlayerInteraction
|
||||||
|
# Description: This enables the submenu for the below
|
||||||
|
# Default: 1 - (Enabled)
|
||||||
|
# 0 - (Disabled)
|
||||||
|
PlayerInteraction = 1
|
||||||
|
#
|
||||||
|
# Bank
|
||||||
|
# Description: Allow Players to use mobile bank
|
||||||
|
# Default: 1 - (Enabled)
|
||||||
|
# 0 - (Disabled)
|
||||||
|
Bank = 1
|
||||||
|
#
|
||||||
|
# Auction
|
||||||
|
# Description: Allow Players to use mobile Auction
|
||||||
|
# Default: 1 - (Enabled)
|
||||||
|
# 0 - (Disabled)
|
||||||
|
Auction = 1
|
||||||
# Vendor
|
# Vendor
|
||||||
# Description: Allow Players to use vendor
|
# Description: Allow Players to use vendor
|
||||||
# Default: 1 - (Enabled)
|
# Default: 1 - (Enabled)
|
||||||
# 0 - (Disabled)
|
# 0 - (Disabled)
|
||||||
Vendor = 1
|
Vendor = 1
|
||||||
|
#
|
||||||
# Mail Box
|
# Mail Box
|
||||||
# Description: Allow Players Access ingame Mail
|
# Description: Allow Players Access ingame Mail
|
||||||
# Default: 1 - (Enabled)
|
# Default: 1 - (Enabled)
|
||||||
# 0 - (Disabled)
|
# 0 - (Disabled)
|
||||||
MailBox = 1
|
MailBox = 1
|
||||||
|
|
||||||
|
|||||||
322
src/premium.cpp
322
src/premium.cpp
@@ -9,11 +9,51 @@
|
|||||||
|
|
||||||
enum vendor
|
enum vendor
|
||||||
{
|
{
|
||||||
NPC_VENDOR = 54,
|
NPC_VENDOR = 54, //Alliance
|
||||||
|
NPC_VENDOR2 = 3163, //Horde
|
||||||
NPC_AUCTION = 9856, //Horde
|
NPC_AUCTION = 9856, //Horde
|
||||||
NPC_AUCTION2 = 8670, //Alliance
|
NPC_AUCTION2 = 8670 //Alliance
|
||||||
ALLIANCE_MOUNT = 470,
|
};
|
||||||
HORDE_MOUNT = 6653
|
|
||||||
|
enum trainers
|
||||||
|
{
|
||||||
|
//Alliance NPC's
|
||||||
|
AROGUE = 918,
|
||||||
|
AWARRIOR = 5479,
|
||||||
|
AHUNTER = 5515,
|
||||||
|
APRIEST = 376,
|
||||||
|
APALADIN = 928,
|
||||||
|
ADRUID = 5504,
|
||||||
|
ASHAMAN = 20407,
|
||||||
|
AMAGE = 5497,
|
||||||
|
AWARLOCK = 461,
|
||||||
|
|
||||||
|
//Horde NPCS
|
||||||
|
HHUNTER = 3406,
|
||||||
|
HWARRIOR = 3354,
|
||||||
|
HSHAMAN = 3344,
|
||||||
|
HPALADIN = 23128,
|
||||||
|
HROGUE = 3401,
|
||||||
|
HWARLOCK = 3324,
|
||||||
|
HMAGE = 5883,
|
||||||
|
HPRIEST = 3045,
|
||||||
|
HDRUID = 3033,
|
||||||
|
|
||||||
|
DKTRAINER = 28472
|
||||||
|
};
|
||||||
|
|
||||||
|
enum mounts
|
||||||
|
{
|
||||||
|
HUMAN_MOUNT = 470,
|
||||||
|
ORC_MOUNT = 6653,
|
||||||
|
GNOME_MOUNT = 17454,
|
||||||
|
NIGHTELF_MOUNT = 8394,
|
||||||
|
DWARF_MOUNT = 6899,
|
||||||
|
UNEAD_MOUNT = 17463,
|
||||||
|
TAUREN_MOUNT = 64657,
|
||||||
|
TROLL_MOUNT = 8395,
|
||||||
|
BLOODELF_MOUNT = 35022,
|
||||||
|
DRAENEI_MOUNT = 34406
|
||||||
};
|
};
|
||||||
|
|
||||||
class premium_account : public ItemScript
|
class premium_account : public ItemScript
|
||||||
@@ -34,6 +74,31 @@ public:
|
|||||||
if (player->IsInCombat())
|
if (player->IsInCombat())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (player->FindNearestCreature(NPC_AUCTION2, 10.0f) ||
|
||||||
|
player->FindNearestCreature(NPC_AUCTION, 10.0f) ||
|
||||||
|
player->FindNearestCreature(NPC_VENDOR, 10.0f) ||
|
||||||
|
player->FindNearestCreature(NPC_VENDOR2, 10.0f) ||
|
||||||
|
player->FindNearestCreature(AROGUE, 10.0f) ||
|
||||||
|
player->FindNearestCreature(AWARRIOR, 10.0f) ||
|
||||||
|
player->FindNearestCreature(AHUNTER, 10.0f) ||
|
||||||
|
player->FindNearestCreature(APRIEST, 10.0f) ||
|
||||||
|
player->FindNearestCreature(APALADIN, 10.0f) ||
|
||||||
|
player->FindNearestCreature(ADRUID, 10.0f) ||
|
||||||
|
player->FindNearestCreature(ASHAMAN, 10.0f) ||
|
||||||
|
player->FindNearestCreature(AMAGE, 10.0f) ||
|
||||||
|
player->FindNearestCreature(AWARLOCK, 10.0f) ||
|
||||||
|
player->FindNearestCreature(HHUNTER, 10.0f) ||
|
||||||
|
player->FindNearestCreature(HWARRIOR, 10.0f) ||
|
||||||
|
player->FindNearestCreature(HSHAMAN, 10.0f) ||
|
||||||
|
player->FindNearestCreature(HPALADIN, 10.0f) ||
|
||||||
|
player->FindNearestCreature(HROGUE, 10.0f) ||
|
||||||
|
player->FindNearestCreature(HWARLOCK, 10.0f) ||
|
||||||
|
player->FindNearestCreature(HMAGE, 10.0f) ||
|
||||||
|
player->FindNearestCreature(HPRIEST, 10.0f) ||
|
||||||
|
player->FindNearestCreature(HDRUID, 10.0f) ||
|
||||||
|
player->FindNearestCreature(DKTRAINER, 10.0f))
|
||||||
|
return false;
|
||||||
|
|
||||||
player->PlayerTalkClass->ClearMenus();
|
player->PlayerTalkClass->ClearMenus();
|
||||||
|
|
||||||
if (sConfigMgr->GetBoolDefault("Morph", true))
|
if (sConfigMgr->GetBoolDefault("Morph", true))
|
||||||
@@ -41,23 +106,19 @@ public:
|
|||||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Morph", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Morph", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Demorph", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Demorph", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||||
}
|
}
|
||||||
if (sConfigMgr->GetBoolDefault("Bank", true))
|
|
||||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, "Show Bank", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
|
||||||
if (sConfigMgr->GetBoolDefault("MailBox", true))
|
|
||||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, "Mail Box", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
|
||||||
if (sConfigMgr->GetBoolDefault("Vendor", true))
|
|
||||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, "Vendor", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
|
|
||||||
if (sConfigMgr->GetBoolDefault("Mount", true))
|
if (sConfigMgr->GetBoolDefault("Mount", true))
|
||||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT_16, "Mount", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
|
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT_16, "Mount", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
|
||||||
if (sConfigMgr->GetBoolDefault("Auction", true))
|
if (sConfigMgr->GetBoolDefault("Trainers", true))
|
||||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, "Auction House", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
|
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
|
||||||
|
if (sConfigMgr->GetBoolDefault("PlayerInteraction", true))
|
||||||
|
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Player interactions", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
|
||||||
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, item->GetGUID());
|
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, item->GetGUID());
|
||||||
|
|
||||||
return false; // Cast the spell on use normally
|
return false; // Cast the spell on use normally
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnGossipSelect(Player* player, Item* /*item*/, uint32 /*sender*/, uint32 action) override
|
void OnGossipSelect(Player* player, Item* item, uint32 /*sender*/, uint32 action)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case GOSSIP_ACTION_INFO_DEF + 1: /*Morph*/
|
case GOSSIP_ACTION_INFO_DEF + 1: /*Morph*/
|
||||||
@@ -111,45 +172,246 @@ public:
|
|||||||
player->GetSession()->SendShowMailBox(player->GetGUID());
|
player->GetSession()->SendShowMailBox(player->GetGUID());
|
||||||
break;
|
break;
|
||||||
case GOSSIP_ACTION_INFO_DEF + 5: /*Vendor*/
|
case GOSSIP_ACTION_INFO_DEF + 5: /*Vendor*/
|
||||||
|
if (player->GetTeamId() == TEAM_ALLIANCE)
|
||||||
{
|
{
|
||||||
Creature* vendor = player->SummonCreature(NPC_VENDOR, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
Creature* vendor = player->SummonCreature(NPC_VENDOR, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
vendor->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
vendor->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
vendor->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
vendor->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
vendor->setFaction(player->getFaction());
|
vendor->setFaction(player->getFaction());
|
||||||
vendor->MonsterWhisper("At your service", player, false);
|
vendor->MonsterWhisper("Greetings", player, false);
|
||||||
|
player->CLOSE_GOSSIP_MENU();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Creature* vendor = player->SummonCreature(NPC_VENDOR2, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
vendor->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
|
vendor->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
|
vendor->setFaction(player->getFaction());
|
||||||
|
vendor->MonsterWhisper("Zug Zug", player, false);
|
||||||
player->CLOSE_GOSSIP_MENU();
|
player->CLOSE_GOSSIP_MENU();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GOSSIP_ACTION_INFO_DEF + 6: /*Mount*/
|
case GOSSIP_ACTION_INFO_DEF + 6: /*Mount*/
|
||||||
player->CLOSE_GOSSIP_MENU();
|
player->CLOSE_GOSSIP_MENU();
|
||||||
if (player->GetTeamId() == TEAM_HORDE)
|
switch (player->getRace())
|
||||||
player->CastSpell(player, HORDE_MOUNT);
|
{
|
||||||
else
|
case RACE_HUMAN:
|
||||||
player->CastSpell(player, ALLIANCE_MOUNT);
|
player->CastSpell(player, HUMAN_MOUNT);
|
||||||
|
break;
|
||||||
|
case RACE_ORC:
|
||||||
|
player->CastSpell(player, ORC_MOUNT);
|
||||||
|
break;
|
||||||
|
case RACE_GNOME:
|
||||||
|
player->CastSpell(player, GNOME_MOUNT);
|
||||||
|
break;
|
||||||
|
case RACE_NIGHTELF:
|
||||||
|
player->CastSpell(player, NIGHTELF_MOUNT);
|
||||||
|
break;
|
||||||
|
case RACE_DWARF:
|
||||||
|
player->CastSpell(player, DWARF_MOUNT);
|
||||||
|
break;
|
||||||
|
case RACE_DRAENEI:
|
||||||
|
player->CastSpell(player, DRAENEI_MOUNT);
|
||||||
|
break;
|
||||||
|
case RACE_UNDEAD_PLAYER:
|
||||||
|
player->CastSpell(player, UNEAD_MOUNT);
|
||||||
|
break;
|
||||||
|
case RACE_TAUREN:
|
||||||
|
player->CastSpell(player, TAUREN_MOUNT);
|
||||||
|
break;
|
||||||
|
case RACE_TROLL:
|
||||||
|
player->CastSpell(player, TROLL_MOUNT);
|
||||||
|
break;
|
||||||
|
case RACE_BLOODELF:
|
||||||
|
player->CastSpell(player, BLOODELF_MOUNT);
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case GOSSIP_ACTION_INFO_DEF + 7: /*Auction House*/
|
case GOSSIP_ACTION_INFO_DEF + 7: /*Auction House*/
|
||||||
|
|
||||||
if (player->GetTeamId() == TEAM_HORDE)
|
if (player->GetTeamId() == TEAM_HORDE)
|
||||||
{
|
{
|
||||||
Creature* auction = player->SummonCreature(NPC_AUCTION, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
Creature* npc_auction = player->SummonCreature(NPC_AUCTION, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||||
auction->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
npc_auction->MonsterWhisper("I will go shortly, i need to get back to Orgrimmar", player, false);
|
||||||
auction->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
npc_auction->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
auction->setFaction(player->getFaction());
|
npc_auction->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
auction->MonsterWhisper("I will go shortly, i need to get back to Orgrimmar", player, false);
|
npc_auction->setFaction(player->getFaction());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Creature* auction = player->SummonCreature(NPC_AUCTION2, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
Creature* npc_auction = player->SummonCreature(NPC_AUCTION2, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||||
auction->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
npc_auction->MonsterWhisper("I will go shortly, i need to get back to Stormwind City", player, false);
|
||||||
auction->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
npc_auction->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
auction->setFaction(player->getFaction());
|
npc_auction->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
auction->MonsterWhisper("I will go shortly, i need to get back to Stormwind City", player, false);
|
npc_auction->setFaction(player->getFaction());
|
||||||
}
|
}
|
||||||
player->CLOSE_GOSSIP_MENU();
|
player->CLOSE_GOSSIP_MENU();
|
||||||
|
break;
|
||||||
|
case GOSSIP_ACTION_INFO_DEF + 8: /* Class Trainers*/
|
||||||
|
switch (player->getClass())
|
||||||
|
{
|
||||||
|
case CLASS_ROGUE:
|
||||||
|
if (player->GetTeamId() == TEAM_ALLIANCE)
|
||||||
|
{
|
||||||
|
Creature* trainer = player->SummonCreature(AROGUE, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
trainer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
|
trainer->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
|
trainer->setFaction(player->getFaction());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Creature* trainer = player->SummonCreature(HROGUE, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
trainer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
|
trainer->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
|
trainer->setFaction(player->getFaction());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CLASS_WARRIOR:
|
||||||
|
if (player->GetTeamId() == TEAM_ALLIANCE)
|
||||||
|
{
|
||||||
|
Creature* trainer = player->SummonCreature(AWARRIOR, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
trainer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
|
trainer->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
|
trainer->setFaction(player->getFaction());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Creature* trainer = player->SummonCreature(HWARRIOR, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
trainer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
|
trainer->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
|
trainer->setFaction(player->getFaction());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CLASS_PRIEST:
|
||||||
|
if (player->GetTeamId() == TEAM_ALLIANCE)
|
||||||
|
{
|
||||||
|
Creature* trainer = player->SummonCreature(APRIEST, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
trainer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
|
trainer->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
|
trainer->setFaction(player->getFaction());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Creature* trainer = player->SummonCreature(HPRIEST, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
trainer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
|
trainer->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
|
trainer->setFaction(player->getFaction());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CLASS_MAGE:
|
||||||
|
if (player->GetTeamId() == TEAM_ALLIANCE)
|
||||||
|
{
|
||||||
|
Creature* trainer = player->SummonCreature(AMAGE, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
trainer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
|
trainer->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
|
trainer->setFaction(player->getFaction());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Creature* trainer = player->SummonCreature(HMAGE, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CLASS_PALADIN:
|
||||||
|
if (player->GetTeamId() == TEAM_ALLIANCE)
|
||||||
|
{
|
||||||
|
Creature* trainer = player->SummonCreature(APALADIN, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Creature* trainer = player->SummonCreature(HPALADIN, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
trainer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
|
trainer->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
|
trainer->setFaction(player->getFaction());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CLASS_HUNTER:
|
||||||
|
if (player->GetTeamId() == TEAM_ALLIANCE)
|
||||||
|
{
|
||||||
|
Creature* trainer = player->SummonCreature(AHUNTER, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
trainer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
|
trainer->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
|
trainer->setFaction(player->getFaction());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Creature* trainer = player->SummonCreature(HHUNTER, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
trainer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
|
trainer->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
|
trainer->setFaction(player->getFaction());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CLASS_DRUID:
|
||||||
|
if (player->GetTeamId() == TEAM_ALLIANCE)
|
||||||
|
{
|
||||||
|
Creature* trainer = player->SummonCreature(ADRUID, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
trainer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
|
trainer->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
|
trainer->setFaction(player->getFaction());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Creature* trainer = player->SummonCreature(HDRUID, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
trainer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
|
trainer->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
|
trainer->setFaction(player->getFaction());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CLASS_SHAMAN:
|
||||||
|
if (player->GetTeamId() == TEAM_ALLIANCE)
|
||||||
|
{
|
||||||
|
Creature* trainer = player->SummonCreature(ASHAMAN, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
trainer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
|
trainer->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
|
trainer->setFaction(player->getFaction());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Creature* trainer = player->SummonCreature(HSHAMAN, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
trainer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
|
trainer->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
|
trainer->setFaction(player->getFaction());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CLASS_WARLOCK:
|
||||||
|
if (player->GetTeamId() == TEAM_ALLIANCE)
|
||||||
|
{
|
||||||
|
Creature* trainer = player->SummonCreature(AWARLOCK, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
trainer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
|
trainer->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
|
trainer->setFaction(player->getFaction());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Creature* trainer = player->SummonCreature(HWARLOCK, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
trainer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
|
trainer->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
|
trainer->setFaction(player->getFaction());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CLASS_DEATH_KNIGHT:
|
||||||
|
Creature* trainer = player->SummonCreature(DKTRAINER, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||||
|
trainer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
|
trainer->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, player->GetFollowAngle());
|
||||||
|
trainer->setFaction(player->getFaction());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case GOSSIP_ACTION_INFO_DEF + 9: /*Player Interactions*/
|
||||||
|
{
|
||||||
player->PlayerTalkClass->ClearMenus();
|
player->PlayerTalkClass->ClearMenus();
|
||||||
|
if (sConfigMgr->GetBoolDefault("Vendor", true))
|
||||||
|
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, "Vendor", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
|
||||||
|
if (sConfigMgr->GetBoolDefault("MailBox", true))
|
||||||
|
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, "Mail Box", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||||
|
if (sConfigMgr->GetBoolDefault("Bank", true))
|
||||||
|
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, "Show Bank", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||||
|
if (sConfigMgr->GetBoolDefault("Auction", true))
|
||||||
|
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, "Auction House", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
|
||||||
|
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, item->GetGUID());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user