mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[8501] Apply code style and cleanups to some Player functions.
This commit is contained in:
parent
afe5c9aef8
commit
bd254e2848
2 changed files with 55 additions and 65 deletions
|
|
@ -11353,19 +11353,19 @@ void Player::SwapItem( uint16 src, uint16 dst )
|
||||||
RemoveItem(srcbag, srcslot, false);
|
RemoveItem(srcbag, srcslot, false);
|
||||||
|
|
||||||
// add to dest
|
// add to dest
|
||||||
if( IsInventoryPos( dst ) )
|
if (IsInventoryPos(dst))
|
||||||
StoreItem(sDest, pSrcItem, true);
|
StoreItem(sDest, pSrcItem, true);
|
||||||
else if( IsBankPos( dst ) )
|
else if (IsBankPos(dst))
|
||||||
BankItem(sDest, pSrcItem, true);
|
BankItem(sDest, pSrcItem, true);
|
||||||
else if( IsEquipmentPos( dst ) )
|
else if (IsEquipmentPos(dst))
|
||||||
EquipItem(eDest, pSrcItem, true);
|
EquipItem(eDest, pSrcItem, true);
|
||||||
|
|
||||||
// add to src
|
// add to src
|
||||||
if( IsInventoryPos( src ) )
|
if (IsInventoryPos(src))
|
||||||
StoreItem(sDest2, pDstItem, true);
|
StoreItem(sDest2, pDstItem, true);
|
||||||
else if( IsBankPos( src ) )
|
else if (IsBankPos(src))
|
||||||
BankItem(sDest2, pDstItem, true);
|
BankItem(sDest2, pDstItem, true);
|
||||||
else if( IsEquipmentPos( src ) )
|
else if (IsEquipmentPos(src))
|
||||||
EquipItem(eDest2, pDstItem, true);
|
EquipItem(eDest2, pDstItem, true);
|
||||||
|
|
||||||
AutoUnequipOffhandIfNeed();
|
AutoUnequipOffhandIfNeed();
|
||||||
|
|
@ -11373,11 +11373,11 @@ void Player::SwapItem( uint16 src, uint16 dst )
|
||||||
|
|
||||||
void Player::AddItemToBuyBackSlot( Item *pItem )
|
void Player::AddItemToBuyBackSlot( Item *pItem )
|
||||||
{
|
{
|
||||||
if( pItem )
|
if (pItem)
|
||||||
{
|
{
|
||||||
uint32 slot = m_currentBuybackSlot;
|
uint32 slot = m_currentBuybackSlot;
|
||||||
// if current back slot non-empty search oldest or free
|
// if current back slot non-empty search oldest or free
|
||||||
if(m_items[slot])
|
if (m_items[slot])
|
||||||
{
|
{
|
||||||
uint32 oldest_time = GetUInt32Value( PLAYER_FIELD_BUYBACK_TIMESTAMP_1 );
|
uint32 oldest_time = GetUInt32Value( PLAYER_FIELD_BUYBACK_TIMESTAMP_1 );
|
||||||
uint32 oldest_slot = BUYBACK_SLOT_START;
|
uint32 oldest_slot = BUYBACK_SLOT_START;
|
||||||
|
|
@ -11385,7 +11385,7 @@ void Player::AddItemToBuyBackSlot( Item *pItem )
|
||||||
for(uint32 i = BUYBACK_SLOT_START+1; i < BUYBACK_SLOT_END; ++i )
|
for(uint32 i = BUYBACK_SLOT_START+1; i < BUYBACK_SLOT_END; ++i )
|
||||||
{
|
{
|
||||||
// found empty
|
// found empty
|
||||||
if(!m_items[i])
|
if (!m_items[i])
|
||||||
{
|
{
|
||||||
slot = i;
|
slot = i;
|
||||||
break;
|
break;
|
||||||
|
|
@ -11393,7 +11393,7 @@ void Player::AddItemToBuyBackSlot( Item *pItem )
|
||||||
|
|
||||||
uint32 i_time = GetUInt32Value( PLAYER_FIELD_BUYBACK_TIMESTAMP_1 + i - BUYBACK_SLOT_START);
|
uint32 i_time = GetUInt32Value( PLAYER_FIELD_BUYBACK_TIMESTAMP_1 + i - BUYBACK_SLOT_START);
|
||||||
|
|
||||||
if(oldest_time > i_time)
|
if (oldest_time > i_time)
|
||||||
{
|
{
|
||||||
oldest_time = i_time;
|
oldest_time = i_time;
|
||||||
oldest_slot = i;
|
oldest_slot = i;
|
||||||
|
|
@ -11413,15 +11413,14 @@ void Player::AddItemToBuyBackSlot( Item *pItem )
|
||||||
uint32 eslot = slot - BUYBACK_SLOT_START;
|
uint32 eslot = slot - BUYBACK_SLOT_START;
|
||||||
|
|
||||||
SetUInt64Value( PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), pItem->GetGUID() );
|
SetUInt64Value( PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), pItem->GetGUID() );
|
||||||
ItemPrototype const *pProto = pItem->GetProto();
|
if (ItemPrototype const *pProto = pItem->GetProto())
|
||||||
if( pProto )
|
|
||||||
SetUInt32Value( PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, pProto->SellPrice * pItem->GetCount() );
|
SetUInt32Value( PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, pProto->SellPrice * pItem->GetCount() );
|
||||||
else
|
else
|
||||||
SetUInt32Value( PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, 0 );
|
SetUInt32Value( PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, 0 );
|
||||||
SetUInt32Value( PLAYER_FIELD_BUYBACK_TIMESTAMP_1 + eslot, (uint32)etime );
|
SetUInt32Value( PLAYER_FIELD_BUYBACK_TIMESTAMP_1 + eslot, (uint32)etime );
|
||||||
|
|
||||||
// move to next (for non filled list is move most optimized choice)
|
// move to next (for non filled list is move most optimized choice)
|
||||||
if(m_currentBuybackSlot < BUYBACK_SLOT_END - 1)
|
if (m_currentBuybackSlot < BUYBACK_SLOT_END - 1)
|
||||||
++m_currentBuybackSlot;
|
++m_currentBuybackSlot;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -11429,7 +11428,7 @@ void Player::AddItemToBuyBackSlot( Item *pItem )
|
||||||
Item* Player::GetItemFromBuyBackSlot( uint32 slot )
|
Item* Player::GetItemFromBuyBackSlot( uint32 slot )
|
||||||
{
|
{
|
||||||
sLog.outDebug( "STORAGE: GetItemFromBuyBackSlot slot = %u", slot);
|
sLog.outDebug( "STORAGE: GetItemFromBuyBackSlot slot = %u", slot);
|
||||||
if( slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END )
|
if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END)
|
||||||
return m_items[slot];
|
return m_items[slot];
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
@ -11437,10 +11436,10 @@ Item* Player::GetItemFromBuyBackSlot( uint32 slot )
|
||||||
void Player::RemoveItemFromBuyBackSlot( uint32 slot, bool del )
|
void Player::RemoveItemFromBuyBackSlot( uint32 slot, bool del )
|
||||||
{
|
{
|
||||||
sLog.outDebug( "STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot);
|
sLog.outDebug( "STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot);
|
||||||
if( slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END )
|
if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END)
|
||||||
{
|
{
|
||||||
Item *pItem = m_items[slot];
|
Item *pItem = m_items[slot];
|
||||||
if( pItem )
|
if (pItem)
|
||||||
{
|
{
|
||||||
pItem->RemoveFromWorld();
|
pItem->RemoveFromWorld();
|
||||||
if(del) pItem->SetState(ITEM_REMOVED, this);
|
if(del) pItem->SetState(ITEM_REMOVED, this);
|
||||||
|
|
@ -11454,7 +11453,7 @@ void Player::RemoveItemFromBuyBackSlot( uint32 slot, bool del )
|
||||||
SetUInt32Value( PLAYER_FIELD_BUYBACK_TIMESTAMP_1 + eslot, 0 );
|
SetUInt32Value( PLAYER_FIELD_BUYBACK_TIMESTAMP_1 + eslot, 0 );
|
||||||
|
|
||||||
// if current backslot is filled set to now free slot
|
// if current backslot is filled set to now free slot
|
||||||
if(m_items[m_currentBuybackSlot])
|
if (m_items[m_currentBuybackSlot])
|
||||||
m_currentBuybackSlot = slot;
|
m_currentBuybackSlot = slot;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -11462,21 +11461,21 @@ void Player::RemoveItemFromBuyBackSlot( uint32 slot, bool del )
|
||||||
void Player::SendEquipError( uint8 msg, Item* pItem, Item *pItem2 )
|
void Player::SendEquipError( uint8 msg, Item* pItem, Item *pItem2 )
|
||||||
{
|
{
|
||||||
sLog.outDebug( "WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg);
|
sLog.outDebug( "WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg);
|
||||||
WorldPacket data( SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : 18) );
|
WorldPacket data(SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : (msg == EQUIP_ERR_OK ? 1 : 18)));
|
||||||
data << uint8(msg);
|
data << uint8(msg);
|
||||||
|
|
||||||
if(msg)
|
if (msg != EQUIP_ERR_OK)
|
||||||
{
|
{
|
||||||
data << uint64(pItem ? pItem->GetGUID() : 0);
|
data << uint64(pItem ? pItem->GetGUID() : 0);
|
||||||
data << uint64(pItem2 ? pItem2->GetGUID() : 0);
|
data << uint64(pItem2 ? pItem2->GetGUID() : 0);
|
||||||
data << uint8(0); // not 0 there...
|
data << uint8(0); // not 0 there...
|
||||||
|
|
||||||
if(msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I)
|
if (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I)
|
||||||
{
|
{
|
||||||
uint32 level = 0;
|
uint32 level = 0;
|
||||||
|
|
||||||
if(pItem)
|
if (pItem)
|
||||||
if(ItemPrototype const* proto = pItem->GetProto())
|
if (ItemPrototype const* proto = pItem->GetProto())
|
||||||
level = proto->RequiredLevel;
|
level = proto->RequiredLevel;
|
||||||
|
|
||||||
data << uint32(level); // new 2.4.0
|
data << uint32(level); // new 2.4.0
|
||||||
|
|
@ -11491,7 +11490,7 @@ void Player::SendBuyError( uint8 msg, Creature* pCreature, uint32 item, uint32 p
|
||||||
WorldPacket data( SMSG_BUY_FAILED, (8+4+4+1) );
|
WorldPacket data( SMSG_BUY_FAILED, (8+4+4+1) );
|
||||||
data << uint64(pCreature ? pCreature->GetGUID() : 0);
|
data << uint64(pCreature ? pCreature->GetGUID() : 0);
|
||||||
data << uint32(item);
|
data << uint32(item);
|
||||||
if( param > 0 )
|
if (param > 0)
|
||||||
data << uint32(param);
|
data << uint32(param);
|
||||||
data << uint8(msg);
|
data << uint8(msg);
|
||||||
GetSession()->SendPacket(&data);
|
GetSession()->SendPacket(&data);
|
||||||
|
|
@ -11503,7 +11502,7 @@ void Player::SendSellError( uint8 msg, Creature* pCreature, uint64 guid, uint32
|
||||||
WorldPacket data( SMSG_SELL_ITEM,(8+8+(param?4:0)+1)); // last check 2.0.10
|
WorldPacket data( SMSG_SELL_ITEM,(8+8+(param?4:0)+1)); // last check 2.0.10
|
||||||
data << uint64(pCreature ? pCreature->GetGUID() : 0);
|
data << uint64(pCreature ? pCreature->GetGUID() : 0);
|
||||||
data << uint64(guid);
|
data << uint64(guid);
|
||||||
if( param > 0 )
|
if (param > 0)
|
||||||
data << uint32(param);
|
data << uint32(param);
|
||||||
data << uint8(msg);
|
data << uint8(msg);
|
||||||
GetSession()->SendPacket(&data);
|
GetSession()->SendPacket(&data);
|
||||||
|
|
@ -11519,15 +11518,15 @@ void Player::ClearTrade()
|
||||||
|
|
||||||
void Player::TradeCancel(bool sendback)
|
void Player::TradeCancel(bool sendback)
|
||||||
{
|
{
|
||||||
if(pTrader)
|
if (pTrader)
|
||||||
{
|
{
|
||||||
// send yellow "Trade canceled" message to both traders
|
// send yellow "Trade canceled" message to both traders
|
||||||
WorldSession* ws;
|
WorldSession* ws;
|
||||||
ws = GetSession();
|
ws = GetSession();
|
||||||
if(sendback)
|
if (sendback)
|
||||||
ws->SendCancelTrade();
|
ws->SendCancelTrade();
|
||||||
ws = pTrader->GetSession();
|
ws = pTrader->GetSession();
|
||||||
if(!ws->PlayerLogout())
|
if (!ws->PlayerLogout())
|
||||||
ws->SendCancelTrade();
|
ws->SendCancelTrade();
|
||||||
|
|
||||||
// cleanup
|
// cleanup
|
||||||
|
|
@ -11541,7 +11540,7 @@ void Player::TradeCancel(bool sendback)
|
||||||
|
|
||||||
void Player::UpdateItemDuration(uint32 time, bool realtimeonly)
|
void Player::UpdateItemDuration(uint32 time, bool realtimeonly)
|
||||||
{
|
{
|
||||||
if(m_itemDuration.empty())
|
if (m_itemDuration.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
sLog.outDebug("Player::UpdateItemDuration(%u,%u)", time, realtimeonly);
|
sLog.outDebug("Player::UpdateItemDuration(%u,%u)", time, realtimeonly);
|
||||||
|
|
@ -11562,17 +11561,17 @@ void Player::UpdateEnchantTime(uint32 time)
|
||||||
{
|
{
|
||||||
assert(itr->item);
|
assert(itr->item);
|
||||||
next = itr;
|
next = itr;
|
||||||
if(!itr->item->GetEnchantmentId(itr->slot))
|
if (!itr->item->GetEnchantmentId(itr->slot))
|
||||||
{
|
{
|
||||||
next = m_enchantDuration.erase(itr);
|
next = m_enchantDuration.erase(itr);
|
||||||
}
|
}
|
||||||
else if(itr->leftduration <= time)
|
else if (itr->leftduration <= time)
|
||||||
{
|
{
|
||||||
ApplyEnchantment(itr->item, itr->slot, false, false);
|
ApplyEnchantment(itr->item, itr->slot, false, false);
|
||||||
itr->item->ClearEnchantment(itr->slot);
|
itr->item->ClearEnchantment(itr->slot);
|
||||||
next = m_enchantDuration.erase(itr);
|
next = m_enchantDuration.erase(itr);
|
||||||
}
|
}
|
||||||
else if(itr->leftduration > time)
|
else if (itr->leftduration > time)
|
||||||
{
|
{
|
||||||
itr->leftduration -= time;
|
itr->leftduration -= time;
|
||||||
++next;
|
++next;
|
||||||
|
|
@ -11584,11 +11583,11 @@ void Player::AddEnchantmentDurations(Item *item)
|
||||||
{
|
{
|
||||||
for(int x = 0; x < MAX_ENCHANTMENT_SLOT; ++x)
|
for(int x = 0; x < MAX_ENCHANTMENT_SLOT; ++x)
|
||||||
{
|
{
|
||||||
if(!item->GetEnchantmentId(EnchantmentSlot(x)))
|
if (!item->GetEnchantmentId(EnchantmentSlot(x)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
uint32 duration = item->GetEnchantmentDuration(EnchantmentSlot(x));
|
uint32 duration = item->GetEnchantmentDuration(EnchantmentSlot(x));
|
||||||
if( duration > 0 )
|
if (duration > 0)
|
||||||
AddEnchantmentDuration(item, EnchantmentSlot(x), duration);
|
AddEnchantmentDuration(item, EnchantmentSlot(x), duration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -11597,7 +11596,7 @@ void Player::RemoveEnchantmentDurations(Item *item)
|
||||||
{
|
{
|
||||||
for(EnchantDurationList::iterator itr = m_enchantDuration.begin(); itr != m_enchantDuration.end();)
|
for(EnchantDurationList::iterator itr = m_enchantDuration.begin(); itr != m_enchantDuration.end();)
|
||||||
{
|
{
|
||||||
if(itr->item == item)
|
if (itr->item == item)
|
||||||
{
|
{
|
||||||
// save duration in item
|
// save duration in item
|
||||||
item->SetEnchantmentDuration(EnchantmentSlot(itr->slot), itr->leftduration);
|
item->SetEnchantmentDuration(EnchantmentSlot(itr->slot), itr->leftduration);
|
||||||
|
|
@ -11614,9 +11613,9 @@ void Player::RemoveAllEnchantments(EnchantmentSlot slot)
|
||||||
for(EnchantDurationList::iterator itr = m_enchantDuration.begin(), next; itr != m_enchantDuration.end(); itr = next)
|
for(EnchantDurationList::iterator itr = m_enchantDuration.begin(), next; itr != m_enchantDuration.end(); itr = next)
|
||||||
{
|
{
|
||||||
next = itr;
|
next = itr;
|
||||||
if(itr->slot == slot)
|
if (itr->slot == slot)
|
||||||
{
|
{
|
||||||
if(itr->item && itr->item->GetEnchantmentId(slot))
|
if (itr->item && itr->item->GetEnchantmentId(slot))
|
||||||
{
|
{
|
||||||
// remove from stats
|
// remove from stats
|
||||||
ApplyEnchantment(itr->item, slot, false, false);
|
ApplyEnchantment(itr->item, slot, false, false);
|
||||||
|
|
@ -11634,47 +11633,38 @@ void Player::RemoveAllEnchantments(EnchantmentSlot slot)
|
||||||
// NOTE: no need to remove these from stats, since these aren't equipped
|
// NOTE: no need to remove these from stats, since these aren't equipped
|
||||||
// in inventory
|
// in inventory
|
||||||
for(int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i)
|
for(int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i)
|
||||||
{
|
if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i))
|
||||||
Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
|
if (pItem->GetEnchantmentId(slot))
|
||||||
if( pItem && pItem->GetEnchantmentId(slot) )
|
pItem->ClearEnchantment(slot);
|
||||||
pItem->ClearEnchantment(slot);
|
|
||||||
}
|
|
||||||
|
|
||||||
// in inventory bags
|
// in inventory bags
|
||||||
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
|
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
|
||||||
{
|
if (Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||||
Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i );
|
|
||||||
if( pBag )
|
|
||||||
{
|
|
||||||
for(uint32 j = 0; j < pBag->GetBagSize(); ++j)
|
for(uint32 j = 0; j < pBag->GetBagSize(); ++j)
|
||||||
{
|
if (Item* pItem = pBag->GetItemByPos(j))
|
||||||
Item* pItem = pBag->GetItemByPos(j);
|
if (pItem->GetEnchantmentId(slot))
|
||||||
if( pItem && pItem->GetEnchantmentId(slot) )
|
pItem->ClearEnchantment(slot);
|
||||||
pItem->ClearEnchantment(slot);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// duration == 0 will remove item enchant
|
// duration == 0 will remove item enchant
|
||||||
void Player::AddEnchantmentDuration(Item *item,EnchantmentSlot slot,uint32 duration)
|
void Player::AddEnchantmentDuration(Item *item,EnchantmentSlot slot,uint32 duration)
|
||||||
{
|
{
|
||||||
if(!item)
|
if (!item)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(slot >= MAX_ENCHANTMENT_SLOT)
|
if (slot >= MAX_ENCHANTMENT_SLOT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for(EnchantDurationList::iterator itr = m_enchantDuration.begin(); itr != m_enchantDuration.end(); ++itr)
|
for(EnchantDurationList::iterator itr = m_enchantDuration.begin(); itr != m_enchantDuration.end(); ++itr)
|
||||||
{
|
{
|
||||||
if(itr->item == item && itr->slot == slot)
|
if (itr->item == item && itr->slot == slot)
|
||||||
{
|
{
|
||||||
itr->item->SetEnchantmentDuration(itr->slot, itr->leftduration);
|
itr->item->SetEnchantmentDuration(itr->slot, itr->leftduration);
|
||||||
m_enchantDuration.erase(itr);
|
m_enchantDuration.erase(itr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(item && duration > 0 )
|
if (item && duration > 0 )
|
||||||
{
|
{
|
||||||
GetSession()->SendItemEnchantTimeUpdate(GetGUID(), item->GetGUID(), slot, uint32(duration/1000));
|
GetSession()->SendItemEnchantTimeUpdate(GetGUID(), item->GetGUID(), slot, uint32(duration/1000));
|
||||||
m_enchantDuration.push_back(EnchantDuration(item, slot, duration));
|
m_enchantDuration.push_back(EnchantDuration(item, slot, duration));
|
||||||
|
|
@ -11689,24 +11679,24 @@ void Player::ApplyEnchantment(Item *item,bool apply)
|
||||||
|
|
||||||
void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool apply_dur, bool ignore_condition)
|
void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool apply_dur, bool ignore_condition)
|
||||||
{
|
{
|
||||||
if(!item)
|
if (!item)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!item->IsEquipped())
|
if (!item->IsEquipped())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(slot >= MAX_ENCHANTMENT_SLOT)
|
if (slot >= MAX_ENCHANTMENT_SLOT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint32 enchant_id = item->GetEnchantmentId(slot);
|
uint32 enchant_id = item->GetEnchantmentId(slot);
|
||||||
if(!enchant_id)
|
if (!enchant_id)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
|
SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
|
||||||
if(!pEnchant)
|
if (!pEnchant)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!ignore_condition && pEnchant->EnchantmentCondition && !((Player*)this)->EnchantmentFitsRequirements(pEnchant->EnchantmentCondition, -1))
|
if (!ignore_condition && pEnchant->EnchantmentCondition && !((Player*)this)->EnchantmentFitsRequirements(pEnchant->EnchantmentCondition, -1))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!item->IsBroken())
|
if (!item->IsBroken())
|
||||||
|
|
@ -11733,9 +11723,9 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool
|
||||||
HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_VALUE, float(enchant_amount), apply);
|
HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_VALUE, float(enchant_amount), apply);
|
||||||
break;
|
break;
|
||||||
case ITEM_ENCHANTMENT_TYPE_EQUIP_SPELL:
|
case ITEM_ENCHANTMENT_TYPE_EQUIP_SPELL:
|
||||||
if(enchant_spell_id)
|
if (enchant_spell_id)
|
||||||
{
|
{
|
||||||
if(apply)
|
if (apply)
|
||||||
{
|
{
|
||||||
int32 basepoints = 0;
|
int32 basepoints = 0;
|
||||||
// Random Property Exist - try found basepoints for spell (basepoints depends from item suffix factor)
|
// Random Property Exist - try found basepoints for spell (basepoints depends from item suffix factor)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8500"
|
#define REVISION_NR "8501"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue