[11646] Implement support item converting at expire

Example: items 44623->44625->44627 convertion chain

* New table `item_enchantment_template` store original->final item pairs
  Original item must have duration setup.
* Small change in GetItemConvert for consistence (now 0 returned if no convert pair instead original entry id)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
cmaranec 2011-06-18 21:11:23 +04:00 committed by VladimirMangos
parent a97370a7f0
commit 2d7768a5ab
10 changed files with 117 additions and 13 deletions

View file

@ -801,9 +801,9 @@ void WorldSession::SendListInventory(ObjectGuid vendorguid)
// convert if can use and then buy
if (pProto->RequiredReputationFaction && uint32(_player->GetReputationRank(pProto->RequiredReputationFaction)) >= pProto->RequiredReputationRank)
{
itemId = sObjectMgr.GetItemConvert(itemId, _player->getRaceMask());
// checked at convert data loading as existed
pProto = ObjectMgr::GetItemPrototype(itemId);
if (uint32 newItemId = sObjectMgr.GetItemConvert(itemId, _player->getRaceMask()))
pProto = ObjectMgr::GetItemPrototype(newItemId);
}
}