[10050] Implement apply non-trade slot item enchanting at trade complete.

Base at original patch provided by arrai.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
VladimirMangos 2010-06-11 22:46:16 +04:00
parent a248a1a32d
commit 64f959fb82
10 changed files with 438 additions and 183 deletions

View file

@ -63,9 +63,19 @@ int32 GetSpellMaxDuration(SpellEntry const *spellInfo)
uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell)
{
// some triggered spells have data only usable for client
if (spell && spell->IsTriggeredSpellWithRedundentData())
return 0;
if (spell)
{
// some triggered spells have data only usable for client
if (spell->IsTriggeredSpellWithRedundentData())
return 0;
// spell targeted to non-trading trade slot item instant at trade success apply
if (spell->GetCaster()->GetTypeId()==TYPEID_PLAYER)
if (TradeData* my_trade = ((Player*)(spell->GetCaster()))->GetTradeData())
if (Item* nonTrade = my_trade->GetTraderData()->GetItem(TRADE_SLOT_NONTRADED))
if (nonTrade == spell->m_targets.getItemTarget())
return 0;
}
SpellCastTimesEntry const *spellCastTimeEntry = sSpellCastTimesStore.LookupEntry(spellInfo->CastingTimeIndex);