mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 22:37:02 +00:00
[9508] Finish impement new functionlity for item 5513 and similar.
* Implement recharge low rank item in inventory. * Implement recharge item at loading after 15 offline mins
This commit is contained in:
parent
4c4629e861
commit
84e5f7520b
8 changed files with 80 additions and 10 deletions
|
|
@ -5614,16 +5614,22 @@ SpellCastResult Spell::CheckItems()
|
|||
{
|
||||
if (!m_IsTriggeredSpell && m_spellInfo->EffectItemType[i])
|
||||
{
|
||||
// Conjure Mana Gem
|
||||
// Conjure Mana Gem (skip same or low level ranks for later recharge)
|
||||
if (i == EFFECT_INDEX_0 && m_spellInfo->Effect[EFFECT_INDEX_1] == SPELL_EFFECT_DUMMY)
|
||||
{
|
||||
if (Item* item = p_caster->GetItemByEntry(m_spellInfo->EffectItemType[i]))
|
||||
if (ItemPrototype const* itemProto = ObjectMgr::GetItemPrototype(m_spellInfo->EffectItemType[i]))
|
||||
{
|
||||
if (item->HasMaxCharges())
|
||||
return SPELL_FAILED_ITEM_AT_MAX_CHARGES;
|
||||
if (Item* item = p_caster->GetItemByLimitedCategory(itemProto->ItemLimitCategory))
|
||||
{
|
||||
if (item->GetProto()->ItemLevel <= itemProto->ItemLevel)
|
||||
{
|
||||
if (item->HasMaxCharges())
|
||||
return SPELL_FAILED_ITEM_AT_MAX_CHARGES;
|
||||
|
||||
// will recharge in next effect
|
||||
continue;
|
||||
// will recharge in next effect
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue