Na pasta Trinity\src\server\scripts\Custom criei Transmogrification.cpp e Transmogrification.h
Transmogrification.cpp
Código:
/*
5.3
Transmogrification 3.3.5a - Gossip menu
By Rochet2
ScriptName for NPC:
Creature_Transmogrify
TODO:
Fix the cost formula
-- Too much data handling, use default costs
Are the qualities right?
Blizzard might have changed the quality requirements.
(TC handles it with stat checks)
Cant transmogrify rediculus items // Foereaper: would be fun to stab people with a fish
-- Cant think of any good way to handle this easily, could rip flagged items from cata DB
*/
#include "ScriptPCH.h"
#include "Config.h"
#include "Language.h"
#include "Transmogrification.h"
#define GTS session->GetTrinityString
namespace
{
class CS_Transmogrification : public CreatureScript
{
public:
CS_Transmogrification(): CreatureScript("Creature_Transmogrify") {}
bool OnGossipHello(Player* player, Creature* creature) override
{
WorldSession* session = player->GetSession();
if (sTransmogrification->EnableTransmogInfo)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Book_11:30:30:-18:0|tHow transmogrification works", EQUIPMENT_SLOT_END + 9, 0);
for (uint8 slot = EQUIPMENT_SLOT_START; slot < EQUIPMENT_SLOT_END; ++slot)
{
if (const char* slotName = sTransmogrification->GetSlotName(slot, session))
{
Item* newItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot);
uint32 entry = newItem ? sTransmogrification->GetFakeEntry(newItem) : 0;
std::string icon = entry ? sTransmogrification->GetItemIcon(entry, 30, 30, -18, 0) : sTransmogrification->GetSlotIcon(slot, 30, 30, -18, 0);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, icon + std::string(slotName), EQUIPMENT_SLOT_END, slot);
}
}
#ifdef PRESETS
if (sTransmogrification->EnableSets)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/RAIDFRAME/UI-RAIDFRAME-MAINASSIST:30:30:-18:0|tManage sets", EQUIPMENT_SLOT_END + 4, 0);
#endif
player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Enchant_Disenchant:30:30:-18:0|tRemove all transmogrifications", EQUIPMENT_SLOT_END + 2, 0, "Remove transmogrifications from all equipped items?", 0, false);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/PaperDollInfoFrame/UI-GearManager-Undo:30:30:-18:0|tUpdate menu", EQUIPMENT_SLOT_END + 1, 0);
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
return true;
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) override
{
player->PlayerTalkClass->ClearMenus();
WorldSession* session = player->GetSession();
switch (sender)
{
case EQUIPMENT_SLOT_END: // Show items you can use
ShowTransmogItems(player, creature, action);
break;
case EQUIPMENT_SLOT_END + 1: // Main menu
OnGossipHello(player, creature);
break;
case EQUIPMENT_SLOT_END + 2: // Remove Transmogrifications
{
bool removed = false;
for (uint8 slot = EQUIPMENT_SLOT_START; slot < EQUIPMENT_SLOT_END; ++slot)
{
if (Item* newItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
{
if (!sTransmogrification->GetFakeEntry(newItem))
continue;
sTransmogrification->DeleteFakeEntry(player, newItem);
removed = true;
}
}
if (removed)
session->SendAreaTriggerMessage(GTS(LANG_ERR_UNTRANSMOG_OK));
else
session->SendNotification(LANG_ERR_UNTRANSMOG_NO_TRANSMOGS);
OnGossipHello(player, creature);
} break;
case EQUIPMENT_SLOT_END + 3: // Remove Transmogrification from single item
{
if (Item* newItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, action))
{
if (sTransmogrification->GetFakeEntry(newItem))
{
sTransmogrification->DeleteFakeEntry(player, newItem);
session->SendAreaTriggerMessage(GTS(LANG_ERR_UNTRANSMOG_OK));
}
else
session->SendNotification(LANG_ERR_UNTRANSMOG_NO_TRANSMOGS);
}
OnGossipSelect(player, creature, EQUIPMENT_SLOT_END, action);
} break;
#ifdef PRESETS
case EQUIPMENT_SLOT_END + 4: // Presets menu
{
if (!sTransmogrification->EnableSets)
{
OnGossipHello(player, creature);
return true;
}
if (sTransmogrification->EnableSetInfo)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Book_11:30:30:-18:0|tHow sets work", EQUIPMENT_SLOT_END + 10, 0);
ACE_Auto_Ptr<Transmogrification::presetIdMap> data(sTransmogrification->presetMap.GetCopy(player->GetGUID()));
if (data.get())
{
for (Transmogrification::presetIdMap::const_iterator it = data->begin(); it != data->end(); ++it)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Statue_02:30:30:-18:0|t" + it->second.name, EQUIPMENT_SLOT_END + 6, it->first);
if (data->size() < sTransmogrification->MaxSets)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/GuildBankFrame/UI-GuildBankFrame-NewTab:30:30:-18:0|tSave set", EQUIPMENT_SLOT_END + 8, 0);
}
else
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/GuildBankFrame/UI-GuildBankFrame-NewTab:30:30:-18:0|tSave set", EQUIPMENT_SLOT_END + 8, 0);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tBack..", EQUIPMENT_SLOT_END + 1, 0);
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
} break;
case EQUIPMENT_SLOT_END + 5: // Use preset
{
if (!sTransmogrification->EnableSets)
{
OnGossipHello(player, creature);
return true;
}
// action = presetID
ACE_Auto_Ptr<Transmogrification::presetIdMap> data(sTransmogrification->presetMap.GetCopy(player->GetGUID()));
if (data.get())
{
Transmogrification::presetIdMap::const_iterator it = data->find(action);
if (it != data->end())
{
for (Transmogrification::presetslotMap::const_iterator it2 = it->second.slotMap.begin(); it2 != it->second.slotMap.end(); ++it2)
if (Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, it2->first))
sTransmogrification->PresetTransmog(player, item, it2->second, it2->first);
}
}
OnGossipSelect(player, creature, EQUIPMENT_SLOT_END + 6, action);
} break;
case EQUIPMENT_SLOT_END + 6: // view preset
{
if (!sTransmogrification->EnableSets)
{
OnGossipHello(player, creature);
return true;
}
// action = presetID
ACE_Auto_Ptr<Transmogrification::presetIdMap> data(sTransmogrification->presetMap.GetCopy(player->GetGUID()));
if (!data.get())
{
OnGossipSelect(player, creature, EQUIPMENT_SLOT_END + 4, 0);
return true;
}
Transmogrification::presetIdMap::const_iterator it = data->find(action);
if (it == data->end())
{
OnGossipSelect(player, creature, EQUIPMENT_SLOT_END + 4, 0);
return true;
}
for (Transmogrification::presetslotMap::const_iterator it2 = it->second.slotMap.begin(); it2 != it->second.slotMap.end(); ++it2)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, sTransmogrification->GetItemIcon(it2->second, 30, 30, -18, 0) + sTransmogrification->GetItemLink(it2->second, session), sender, action);
player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Statue_02:30:30:-18:0|tUse set", EQUIPMENT_SLOT_END + 5, action, "Using this set for transmogrify will bind transmogrified items to you and make them non-refundable and non-tradeable.\nDo you wish to continue?\n\n" + it->second.name, 0, false);
player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG, "|TInterface/PaperDollInfoFrame/UI-GearManager-LeaveItem-Opaque:30:30:-18:0|tDelete set", EQUIPMENT_SLOT_END + 7, action, "Are you sure you want to delete " + it->second.name + "?", 0, false);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tBack..", EQUIPMENT_SLOT_END + 4, 0);
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
} break;
case EQUIPMENT_SLOT_END + 7: // Delete preset
{
if (!sTransmogrification->EnableSets)
{
OnGossipHello(player, creature);
return true;
}
// action = presetID
{
TRINITY_WRITE_GUARD(Transmogrification::presetPlayers::LockType, sTransmogrification->presetMap.GetLock());
Transmogrification::presetPlayers::MapType& data = sTransmogrification->presetMap.GetContainer();
Transmogrification::presetPlayers::MapType::iterator it = data.find(player->GetGUID());
if (it != data.end())
{
it->second.erase(action);
}
}
OnGossipSelect(player, creature, EQUIPMENT_SLOT_END + 4, 0);
} break;
case EQUIPMENT_SLOT_END + 8: // Save preset
{
if (!sTransmogrification->EnableSets)
{
OnGossipHello(player, creature);
return true;
}
ACE_Auto_Ptr<Transmogrification::presetIdMap> data(sTransmogrification->presetMap.GetCopy(player->GetGUID()));
if (data.get() && data->size() >= sTransmogrification->MaxSets)
{
OnGossipHello(player, creature);
return true;
}
uint32 cost = 0;
bool canSave = false;
for (uint8 slot = EQUIPMENT_SLOT_START; slot < EQUIPMENT_SLOT_END; ++slot)
{
if (!sTransmogrification->GetSlotName(slot, session))
continue;
if (Item* newItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
{
uint32 entry = sTransmogrification->GetFakeEntry(newItem);
if (!entry)
continue;
const ItemTemplate* temp = sObjectMgr->GetItemTemplate(entry);
if (!temp)
continue;
if (!sTransmogrification->SuitableForTransmogrification(player, temp)) // no need to check?
continue;
cost += sTransmogrification->GetSpecialPrice(temp);
canSave = true;
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, sTransmogrification->GetItemIcon(entry, 30, 30, -18, 0) + sTransmogrification->GetItemLink(entry, session), EQUIPMENT_SLOT_END + 8, 0);
}
}
if (canSave)
player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG, "|TInterface/GuildBankFrame/UI-GuildBankFrame-NewTab:30:30:-18:0|tSave set", 0, 0, "Insert set name", cost*sTransmogrification->SetCostModifier + sTransmogrification->SetCopperCost, true);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/PaperDollInfoFrame/UI-GearManager-Undo:30:30:-18:0|tUpdate menu", sender, action);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tBack..", EQUIPMENT_SLOT_END + 4, 0);
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
} break;
case EQUIPMENT_SLOT_END + 10: // Set info
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tBack..", EQUIPMENT_SLOT_END + 4, 0);
player->SEND_GOSSIP_MENU(sTransmogrification->SetNpcText, creature->GetGUID());
} break;
#endif
case EQUIPMENT_SLOT_END + 9: // Transmog info
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tBack..", EQUIPMENT_SLOT_END + 1, 0);
player->SEND_GOSSIP_MENU(sTransmogrification->TransmogNpcText, creature->GetGUID());
} break;
default: // Transmogrify
{
if (!sender && !action)
{
OnGossipHello(player, creature);
return true;
}
// sender = slot, action = display
TransmogTrinityStrings res = sTransmogrification->Transmogrify(player, MAKE_NEW_GUID(action, 0, HIGHGUID_ITEM), sender);
if (res == LANG_ERR_TRANSMOG_OK)
session->SendAreaTriggerMessage(GTS(LANG_ERR_TRANSMOG_OK));
else
session->SendNotification(res);
OnGossipSelect(player, creature, EQUIPMENT_SLOT_END, sender);
} break;
}
return true;
}
#ifdef PRESETS
bool OnGossipSelectCode(Player* player, Creature* creature, uint32 sender, uint32 action, const char* code) override
{
player->PlayerTalkClass->ClearMenus();
if (sender || action)
return true; // should never happen
if (!sTransmogrification->EnableSets)
{
OnGossipHello(player, creature);
return true;
}
std::string name(code);
if (name.find('"') != std::string::npos || name.find('\\') != std::string::npos)
player->GetSession()->SendNotification(LANG_PRESET_ERR_INVALID_NAME);
else
{
int32 cost = 0;
Transmogrification::presetslotMap items;
for (uint8 slot = EQUIPMENT_SLOT_START; slot < EQUIPMENT_SLOT_END; ++slot)
{
if (!sTransmogrification->GetSlotName(slot, player->GetSession()))
continue;
if (Item* newItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
{
uint32 entry = sTransmogrification->GetFakeEntry(newItem);
if (!entry)
continue;
const ItemTemplate* temp = sObjectMgr->GetItemTemplate(entry);
if (!temp)
continue;
if (!sTransmogrification->SuitableForTransmogrification(player, temp))
continue;
cost += sTransmogrification->GetSpecialPrice(temp);
items[slot] = entry;
}
}
if (!items.empty())
{
// transmogrified items were found to be saved
cost *= sTransmogrification->SetCostModifier;
cost += sTransmogrification->SetCopperCost;
if (!player->HasEnoughMoney(cost))
{
player->GetSession()->SendNotification(LANG_ERR_TRANSMOG_NOT_ENOUGH_MONEY);
}
else
{
TRINITY_WRITE_GUARD(Transmogrification::presetPlayers::LockType, sTransmogrification->presetMap.GetLock());
uint8 presetID = 0;
Transmogrification::presetPlayers::MapType& data = sTransmogrification->presetMap.GetContainer();
Transmogrification::presetPlayers::MapType::const_iterator it = data.find(player->GetGUID());
if (it != data.end())
{
for (; presetID < sTransmogrification->MaxSets; ++presetID) // should never reach over max
{
if (it->second.find(presetID) == it->second.end())
break; // trying to find free preset
}
}
if (presetID < sTransmogrification->MaxSets)
{
// Make sure code doesnt mess up SQL!
data[player->GetGUID()][presetID].name = name;
data[player->GetGUID()][presetID].slotMap = items;
if (cost)
player->ModifyMoney(-cost);
}
}
}
}
OnGossipSelect(player, creature, EQUIPMENT_SLOT_END + 4, 0);
return true;
}
#endif
void ShowTransmogItems(Player* player, Creature* creature, uint8 slot) // Only checks bags while can use an item from anywhere in inventory
{
WorldSession* session = player->GetSession();
Item* oldItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot);
if (oldItem)
{
uint32 limit = 0;
uint32 price = sTransmogrification->GetSpecialPrice(oldItem->GetTemplate());
price *= sTransmogrification->ScaledCostModifier;
price += sTransmogrification->CopperCost;
std::ostringstream ss;
ss << std::endl;
if (sTransmogrification->RequireToken)
ss << std::endl << std::endl << sTransmogrification->TokenAmount << " x " << sTransmogrification->GetItemLink(sTransmogrification->TokenEntry, session);
for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i)
{
if (limit > MAX_OPTIONS)
break;
Item* newItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
if (!newItem)
continue;
if (!sTransmogrification->CanTransmogrifyItemWithItem(player, oldItem->GetTemplate(), newItem->GetTemplate()))
continue;
if (sTransmogrification->GetFakeEntry(oldItem) == newItem->GetEntry())
continue;
++limit;
player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG, sTransmogrification->GetItemIcon(newItem->GetEntry(), 30, 30, -18, 0) + sTransmogrification->GetItemLink(newItem, session), slot, newItem->GetGUIDLow(), "Using this item for transmogrify will bind it to you and make it non-refundable and non-tradeable.\nDo you wish to continue?\n\n" + sTransmogrification->GetItemIcon(newItem->GetEntry(), 40, 40, -15, -10) + sTransmogrification->GetItemLink(newItem, session) + ss.str(), price, false);
}
for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
{
Bag* bag = player->GetBagByPos(i);
if (!bag)
continue;
for (uint32 j = 0; j < bag->GetBagSize(); ++j)
{
if (limit > MAX_OPTIONS)
break;
Item* newItem = player->GetItemByPos(i, j);
if (!newItem)
continue;
if (!sTransmogrification->CanTransmogrifyItemWithItem(player, oldItem->GetTemplate(), newItem->GetTemplate()))
continue;
if (sTransmogrification->GetFakeEntry(oldItem) == newItem->GetEntry())
continue;
++limit;
player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG, sTransmogrification->GetItemIcon(newItem->GetEntry(), 30, 30, -18, 0) + sTransmogrification->GetItemLink(newItem, session), slot, newItem->GetGUIDLow(), "Using this item for transmogrify will bind it to you and make it non-refundable and non-tradeable.\nDo you wish to continue?\n\n" + sTransmogrification->GetItemIcon(newItem->GetEntry(), 40, 40, -15, -10) + sTransmogrification->GetItemLink(newItem, session) + ss.str(), price, false);
}
}
}
player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Enchant_Disenchant:30:30:-18:0|tRemove transmogrification", EQUIPMENT_SLOT_END + 3, slot, "Remove transmogrification from the slot?", 0, false);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/PaperDollInfoFrame/UI-GearManager-Undo:30:30:-18:0|tUpdate menu", EQUIPMENT_SLOT_END, slot);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tBack..", EQUIPMENT_SLOT_END + 1, 0);
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
}
};
}
void AddSC_CS_Transmogrification()
{
new CS_Transmogrification();
}
#undef GTS
Transmogrification.h
Código:
#ifndef DEF_TRANSMOGRIFICATION_H
#define DEF_TRANSMOGRIFICATION_H
#define PRESETS // comment this line to disable preset feature totally
#define MAX_OPTIONS 25 // do not alter
class Item;
class Player;
class WorldSession;
struct ItemTemplate;
enum TransmogTrinityStrings // Language.h might have same entries, appears when executing SQL, change if needed
{
LANG_ERR_TRANSMOG_OK = 11100, // change this
LANG_ERR_TRANSMOG_INVALID_SLOT,
LANG_ERR_TRANSMOG_INVALID_SRC_ENTRY,
LANG_ERR_TRANSMOG_MISSING_SRC_ITEM,
LANG_ERR_TRANSMOG_MISSING_DEST_ITEM,
LANG_ERR_TRANSMOG_INVALID_ITEMS,
LANG_ERR_TRANSMOG_NOT_ENOUGH_MONEY,
LANG_ERR_TRANSMOG_NOT_ENOUGH_TOKENS,
LANG_ERR_UNTRANSMOG_OK,
LANG_ERR_UNTRANSMOG_NO_TRANSMOGS,
#ifdef PRESETS
LANG_PRESET_ERR_INVALID_NAME,
#endif
};
namespace
{
template <typename K, typename V>
class KVRWHashMap
{
public:
typedef std::unordered_map<K, V> MapType;
typedef ACE_RW_Thread_Mutex LockType;
void Insert(K k, V v)
{
TRINITY_WRITE_GUARD(LockType, i_lock);
m_hashMap[k] = v;
}
void Remove(K k)
{
TRINITY_WRITE_GUARD(LockType, i_lock);
m_hashMap.erase(k);
}
// Note, returns a pointer to a copy of the value
// You MUST manually delete it to avoid mem leaks
// use ACE_Auto_Ptr<K>
V* GetCopy(K k)
{
TRINITY_READ_GUARD(LockType, i_lock);
typename MapType::iterator itr = m_hashMap.find(k);
if (itr != m_hashMap.end())
return new V(itr->second);
else
return NULL;
}
MapType& GetContainer() { return m_hashMap; }
LockType& GetLock() { return i_lock; }
private:
LockType i_lock;
MapType m_hashMap;
};
}
class Transmogrification
{
public:
#ifdef PRESETS
typedef std::map<uint8, uint32> presetslotMap;
struct presetData
{
std::string name;
presetslotMap slotMap;
};
typedef std::map<uint8, presetData> presetIdMap; // remember to lock
typedef KVRWHashMap<uint64, presetIdMap> presetPlayers;
presetPlayers presetMap; // presetByName[pGUID][presetID] = presetData
bool EnableSetInfo;
uint32 SetNpcText;
bool EnableSets;
uint8 MaxSets;
float SetCostModifier;
int32 SetCopperCost;
void LoadPlayerSets(uint64 pGUID);
void UnloadPlayerSets(uint64 pGUID);
void PresetTransmog(Player* player, Item* itemTransmogrified, uint32 fakeEntry, uint8 slot);
#endif
typedef std::unordered_map<uint64, uint32> transmogData; // remember to lock
typedef KVRWHashMap<uint64, transmogData> transmogMap;
// typedef KVRWHashMap<uint64, uint64> transmogPlayers;
transmogMap entryMap; // entryMap[pGUID][iGUID] = entry
// transmogPlayers playerMap; // dataMap[iGUID] = pGUID
bool EnableTransmogInfo;
uint32 TransmogNpcText;
// Use IsAllowed() and IsNotAllowed()
// these are thread unsafe, but assumed to be static data so it should be safe
std::set<uint32> Allowed;
std::set<uint32> NotAllowed;
float ScaledCostModifier;
int32 CopperCost;
bool RequireToken;
uint32 TokenEntry;
uint32 TokenAmount;
bool AllowPoor;
bool AllowCommon;
bool AllowUncommon;
bool AllowRare;
bool AllowEpic;
bool AllowLegendary;
bool AllowArtifact;
bool AllowHeirloom;
bool AllowMixedArmorTypes;
bool AllowMixedWeaponTypes;
bool AllowFishingPoles;
bool IgnoreReqRace;
bool IgnoreReqClass;
bool IgnoreReqSkill;
bool IgnoreReqSpell;
bool IgnoreReqLevel;
bool IgnoreReqEvent;
bool IgnoreReqStats;
bool IsAllowed(uint32 entry) const;
bool IsNotAllowed(uint32 entry) const;
bool IsAllowedQuality(uint32 quality) const;
bool IsRangedWeapon(uint32 Class, uint32 SubClass) const;
void LoadConfig(bool reload); // thread unsafe
std::string GetItemIcon(uint32 entry, uint32 width, uint32 height, int x, int y) const;
std::string GetSlotIcon(uint8 slot, uint32 width, uint32 height, int x, int y) const;
const char * GetSlotName(uint8 slot, WorldSession* session) const;
std::string GetItemLink(Item* item, WorldSession* session) const;
std::string GetItemLink(uint32 entry, WorldSession* session) const;
uint32 GetFakeEntry(const Item* item);
void UpdateItem(Player* player, Item* item) const;
void DeleteFakeEntry(Player* player, Item* item);
void SetFakeEntry(Player* player, Item* item, uint32 entry);
TransmogTrinityStrings Transmogrify(Player* player, uint64 itemGUID, uint8 slot, bool no_cost = false);
bool CanTransmogrifyItemWithItem(Player* player, ItemTemplate const* destination, ItemTemplate const* source) const;
bool SuitableForTransmogrification(Player* player, ItemTemplate const* proto) const;
// bool CanBeTransmogrified(Item const* item);
// bool CanTransmogrify(Item const* item);
uint32 GetSpecialPrice(ItemTemplate const* proto) const;
std::vector<uint64> GetItemList(const Player* player) const;
};
#define sTransmogrification ACE_Singleton<Transmogrification, ACE_Null_Mutex>::instance()
#endif
No CMakeList.txt dentro da pasta Trinity\src\server\scripts\Custom Coloquei
Código:
#ifdef SCRIPTS
/* This is where custom scripts' loading functions should be declared. */
void AddSC_cs_world_chat();
void AddSC_npc_enchantment();
void AddSC_Reset();
void AddSC_CS_Transmogrification();
#endif
void AddCustomScripts()
{
#ifdef SCRIPTS
/* This is where custom scripts should be added. */
AddSC_cs_world_chat();
AddSC_npc_enchantment();
AddSC_Reset();
AddSC_CS_Transmogrification();
#endif
}
Somente essas alterações que coloquei e criei.
OBS: Nenhum dos npcs estão funcionando