Feat(Core/Item): Proper way to add item signature (#1623)

Co-authored-by: PolarCookie <PolarCookie@users.noreply.github.com>
This commit is contained in:
Viste
2019-03-27 18:44:56 +03:00
committed by Nefertumm
parent 6a05b0402c
commit 801847b718
2 changed files with 11 additions and 2 deletions

View File

@@ -154,7 +154,7 @@ enum ItemFieldFlags
ITEM_FLAG_UNK9 = 0x00004000, // ?
ITEM_FLAG_UNK10 = 0x00008000, // ?
ITEM_FLAG_UNK11 = 0x00010000, // ?
ITEM_FLAG_UNK12 = 0x00020000, // ?
ITEM_FLAG_NO_CREATOR = 0x00020000,
ITEM_FLAG_UNK13 = 0x00040000, // ?
ITEM_FLAG_UNK14 = 0x00080000, // ?
ITEM_FLAG_UNK15 = 0x00100000, // ?
@@ -659,6 +659,15 @@ struct ItemTemplate
WorldPacket queryData; // pussywizard
// helpers
bool HasSignature() const
{
return GetMaxStackSize() == 1 &&
Class != ITEM_CLASS_CONSUMABLE &&
Class != ITEM_CLASS_QUEST &&
(Flags & ITEM_FLAG_NO_CREATOR) == 0 &&
ItemId != 6948; /*Hearthstone*/
}
bool CanChangeEquipStateInCombat() const
{
switch (InventoryType)

View File

@@ -1771,7 +1771,7 @@ void Spell::DoCreateItem(uint8 /*effIndex*/, uint32 itemId)
}
// set the "Crafted by ..." property of the item
if (pItem->GetTemplate()->Class != ITEM_CLASS_CONSUMABLE && pItem->GetTemplate()->Class != ITEM_CLASS_QUEST && newitemid != 6265 && newitemid != 6948)
if (pItem->GetTemplate()->HasSignature())
pItem->SetUInt32Value(ITEM_FIELD_CREATOR, player->GetGUIDLow());
// send info to the client