Core/ObjectMgr: Refactor sItemStorage
This commit is contained in:
@@ -3250,7 +3250,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const * aurApp, uint8 m
|
||||
{
|
||||
if (Item *pItem = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
|
||||
{
|
||||
target->ToPlayer()->_ApplyWeaponDamage(EQUIPMENT_SLOT_MAINHAND, pItem->GetProto(), NULL, apply);
|
||||
target->ToPlayer()->_ApplyWeaponDamage(EQUIPMENT_SLOT_MAINHAND, pItem->GetTemplate(), NULL, apply);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3622,7 +3622,7 @@ void AuraEffect::HandleAuraModDisarm(AuraApplication const * aurApp, uint8 mode,
|
||||
uint8 attacktype = Player::GetAttackBySlot(slot);
|
||||
|
||||
if (attacktype < MAX_ATTACK)
|
||||
target->ToPlayer()->_ApplyWeaponDamage(slot, pItem->GetProto(), NULL, !apply);
|
||||
target->ToPlayer()->_ApplyWeaponDamage(slot, pItem->GetTemplate(), NULL, !apply);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -468,7 +468,7 @@ m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo))
|
||||
if ((m_caster->getClassMask() & CLASSMASK_WAND_USERS) != 0 && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK))
|
||||
m_spellSchoolMask = SpellSchoolMask(1 << pItem->GetProto()->Damage[0].DamageType);
|
||||
m_spellSchoolMask = SpellSchoolMask(1 << pItem->GetTemplate()->Damage[0].DamageType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3802,7 +3802,7 @@ void Spell::SendCastResult(Player* caster, SpellEntry const* spellInfo, uint8 ca
|
||||
for (int8 x=0;x < 3;x++)
|
||||
if (spellInfo->EffectItemType[x])
|
||||
item = spellInfo->EffectItemType[x];
|
||||
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(item);
|
||||
ItemTemplate const *pProto = sObjectMgr->GetItemTemplate(item);
|
||||
if (pProto && pProto->ItemLimitCategory)
|
||||
data << uint32(pProto->ItemLimitCategory);
|
||||
break;
|
||||
@@ -3981,15 +3981,15 @@ void Spell::WriteAmmoToPacket(WorldPacket * data)
|
||||
Item *pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK);
|
||||
if (pItem)
|
||||
{
|
||||
ammoInventoryType = pItem->GetProto()->InventoryType;
|
||||
ammoInventoryType = pItem->GetTemplate()->InventoryType;
|
||||
if (ammoInventoryType == INVTYPE_THROWN)
|
||||
ammoDisplayID = pItem->GetProto()->DisplayInfoID;
|
||||
ammoDisplayID = pItem->GetTemplate()->DisplayInfoID;
|
||||
else
|
||||
{
|
||||
uint32 ammoID = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID);
|
||||
if (ammoID)
|
||||
{
|
||||
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(ammoID);
|
||||
ItemTemplate const *pProto = sObjectMgr->GetItemTemplate(ammoID);
|
||||
if (pProto)
|
||||
{
|
||||
ammoDisplayID = pProto->DisplayInfoID;
|
||||
@@ -4307,7 +4307,7 @@ void Spell::TakeCastItem()
|
||||
if (m_IsTriggeredSpell)
|
||||
return;
|
||||
|
||||
ItemPrototype const *proto = m_CastItem->GetProto();
|
||||
ItemTemplate const *proto = m_CastItem->GetTemplate();
|
||||
|
||||
if (!proto)
|
||||
{
|
||||
@@ -4426,10 +4426,10 @@ void Spell::TakeAmmo()
|
||||
Item *pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK);
|
||||
|
||||
// wands don't have ammo
|
||||
if (!pItem || pItem->IsBroken() || pItem->GetProto()->SubClass == ITEM_SUBCLASS_WEAPON_WAND)
|
||||
if (!pItem || pItem->IsBroken() || pItem->GetTemplate()->SubClass == ITEM_SUBCLASS_WEAPON_WAND)
|
||||
return;
|
||||
|
||||
if (pItem->GetProto()->InventoryType == INVTYPE_THROWN)
|
||||
if (pItem->GetTemplate()->InventoryType == INVTYPE_THROWN)
|
||||
{
|
||||
if (pItem->GetMaxStackCount() == 1)
|
||||
{
|
||||
@@ -4579,7 +4579,7 @@ void Spell::TakeReagents()
|
||||
return;
|
||||
|
||||
// do not take reagents for these item casts
|
||||
if (m_CastItem && m_CastItem->GetProto()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST)
|
||||
if (m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST)
|
||||
return;
|
||||
|
||||
Player* p_caster = (Player*)m_caster;
|
||||
@@ -4597,7 +4597,7 @@ void Spell::TakeReagents()
|
||||
// if CastItem is also spell reagent
|
||||
if (m_CastItem)
|
||||
{
|
||||
ItemPrototype const *proto = m_CastItem->GetProto();
|
||||
ItemTemplate const *proto = m_CastItem->GetTemplate();
|
||||
if (proto && proto->ItemId == itemid)
|
||||
{
|
||||
for (int s = 0; s < MAX_ITEM_PROTO_SPELLS; ++s)
|
||||
@@ -5140,10 +5140,10 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (!pet)
|
||||
return SPELL_FAILED_NO_PET;
|
||||
|
||||
if (!pet->HaveInDiet(foodItem->GetProto()))
|
||||
if (!pet->HaveInDiet(foodItem->GetTemplate()))
|
||||
return SPELL_FAILED_WRONG_PET_FOOD;
|
||||
|
||||
if (!pet->GetCurrentFoodBenefitLevel(foodItem->GetProto()->ItemLevel))
|
||||
if (!pet->GetCurrentFoodBenefitLevel(foodItem->GetTemplate()->ItemLevel))
|
||||
return SPELL_FAILED_FOOD_LOWLEVEL;
|
||||
|
||||
if (m_caster->isInCombat() || pet->isInCombat())
|
||||
@@ -5224,7 +5224,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
// we need a go target, or an openable item target in case of TARGET_GAMEOBJECT_ITEM
|
||||
if (m_spellInfo->EffectImplicitTargetA[i] == TARGET_GAMEOBJECT_ITEM &&
|
||||
!m_targets.getGOTarget() &&
|
||||
(!pTempItem || !pTempItem->GetProto()->LockID || !pTempItem->IsLocked()))
|
||||
(!pTempItem || !pTempItem->GetTemplate()->LockID || !pTempItem->IsLocked()))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
if (m_spellInfo->Id != 1842 || (m_targets.getGOTarget() &&
|
||||
@@ -5242,7 +5242,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
else if (Item* itm = m_targets.getItemTarget())
|
||||
lockId = itm->GetProto()->LockID;
|
||||
lockId = itm->GetTemplate()->LockID;
|
||||
|
||||
SkillType skillId = SKILL_NONE;
|
||||
int32 reqSkillValue = 0;
|
||||
@@ -5901,7 +5901,7 @@ SpellCastResult Spell::CheckItems()
|
||||
if (!p_caster->HasItemCount(itemid, 1))
|
||||
return SPELL_FAILED_ITEM_NOT_READY;
|
||||
|
||||
ItemPrototype const *proto = m_CastItem->GetProto();
|
||||
ItemTemplate const *proto = m_CastItem->GetTemplate();
|
||||
if (!proto)
|
||||
return SPELL_FAILED_ITEM_NOT_READY;
|
||||
|
||||
@@ -6003,7 +6003,7 @@ SpellCastResult Spell::CheckItems()
|
||||
}
|
||||
|
||||
// do not take reagents for these item casts
|
||||
if (!(m_CastItem && m_CastItem->GetProto()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST))
|
||||
if (!(m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST))
|
||||
{
|
||||
bool checkReagents = !m_IsTriggeredSpell && !p_caster->CanNoReagentCast(m_spellInfo);
|
||||
// Not own traded item (in trader trade slot) requires reagents even if triggered spell
|
||||
@@ -6026,7 +6026,7 @@ SpellCastResult Spell::CheckItems()
|
||||
// if CastItem is also spell reagent
|
||||
if (m_CastItem && m_CastItem->GetEntry() == itemid)
|
||||
{
|
||||
ItemPrototype const *proto = m_CastItem->GetProto();
|
||||
ItemTemplate const *proto = m_CastItem->GetTemplate();
|
||||
if (!proto)
|
||||
return SPELL_FAILED_ITEM_NOT_READY;
|
||||
for (int s=0; s < MAX_ITEM_PROTO_SPELLS; ++s)
|
||||
@@ -6095,7 +6095,7 @@ SpellCastResult Spell::CheckItems()
|
||||
uint8 msg = p_caster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, m_spellInfo->EffectItemType[i], 1);
|
||||
if (msg != EQUIP_ERR_OK)
|
||||
{
|
||||
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(m_spellInfo->EffectItemType[i]);
|
||||
ItemTemplate const *pProto = sObjectMgr->GetItemTemplate(m_spellInfo->EffectItemType[i]);
|
||||
// TODO: Needs review
|
||||
if (pProto && !(pProto->ItemLimitCategory))
|
||||
{
|
||||
@@ -6124,7 +6124,7 @@ SpellCastResult Spell::CheckItems()
|
||||
if (m_targets.getItemTarget()->GetOwner() != m_caster)
|
||||
return SPELL_FAILED_NOT_TRADEABLE;
|
||||
// do not allow to enchant vellum from scroll made by vellum-prevent exploit
|
||||
if (m_CastItem && m_CastItem->GetProto()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST)
|
||||
if (m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST)
|
||||
return SPELL_FAILED_TOTEM_CATEGORY;
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = p_caster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, m_spellInfo->EffectItemType[i], 1);
|
||||
@@ -6140,13 +6140,13 @@ SpellCastResult Spell::CheckItems()
|
||||
if (!targetItem)
|
||||
return SPELL_FAILED_ITEM_NOT_FOUND;
|
||||
|
||||
if (targetItem->GetProto()->ItemLevel < m_spellInfo->baseLevel)
|
||||
if (targetItem->GetTemplate()->ItemLevel < m_spellInfo->baseLevel)
|
||||
return SPELL_FAILED_LOWLEVEL;
|
||||
|
||||
bool isItemUsable = false;
|
||||
for (uint8 e = 0; e < MAX_ITEM_PROTO_SPELLS; ++e)
|
||||
{
|
||||
ItemPrototype const *proto = targetItem->GetProto();
|
||||
ItemTemplate const *proto = targetItem->GetTemplate();
|
||||
if (proto->Spells[e].SpellId && (
|
||||
proto->Spells[e].SpellTrigger == ITEM_SPELLTRIGGER_ON_USE ||
|
||||
proto->Spells[e].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE))
|
||||
@@ -6202,7 +6202,7 @@ SpellCastResult Spell::CheckItems()
|
||||
if (m_targets.getItemTarget()->GetOwnerGUID() != m_caster->GetGUID())
|
||||
return SPELL_FAILED_CANT_BE_DISENCHANTED;
|
||||
|
||||
ItemPrototype const* itemProto = m_targets.getItemTarget()->GetProto();
|
||||
ItemTemplate const* itemProto = m_targets.getItemTarget()->GetTemplate();
|
||||
if (!itemProto)
|
||||
return SPELL_FAILED_CANT_BE_DISENCHANTED;
|
||||
|
||||
@@ -6226,13 +6226,13 @@ SpellCastResult Spell::CheckItems()
|
||||
if (!m_targets.getItemTarget())
|
||||
return SPELL_FAILED_CANT_BE_PROSPECTED;
|
||||
//ensure item is a prospectable ore
|
||||
if (!(m_targets.getItemTarget()->GetProto()->Flags & ITEM_PROTO_FLAG_PROSPECTABLE))
|
||||
if (!(m_targets.getItemTarget()->GetTemplate()->Flags & ITEM_PROTO_FLAG_PROSPECTABLE))
|
||||
return SPELL_FAILED_CANT_BE_PROSPECTED;
|
||||
//prevent prospecting in trade slot
|
||||
if (m_targets.getItemTarget()->GetOwnerGUID() != m_caster->GetGUID())
|
||||
return SPELL_FAILED_CANT_BE_PROSPECTED;
|
||||
//Check for enough skill in jewelcrafting
|
||||
uint32 item_prospectingskilllevel = m_targets.getItemTarget()->GetProto()->RequiredSkillRank;
|
||||
uint32 item_prospectingskilllevel = m_targets.getItemTarget()->GetTemplate()->RequiredSkillRank;
|
||||
if (item_prospectingskilllevel >p_caster->GetSkillValue(SKILL_JEWELCRAFTING))
|
||||
return SPELL_FAILED_LOW_CASTLEVEL;
|
||||
//make sure the player has the required ores in inventory
|
||||
@@ -6249,13 +6249,13 @@ SpellCastResult Spell::CheckItems()
|
||||
if (!m_targets.getItemTarget())
|
||||
return SPELL_FAILED_CANT_BE_MILLED;
|
||||
//ensure item is a millable herb
|
||||
if (!(m_targets.getItemTarget()->GetProto()->Flags & ITEM_PROTO_FLAG_MILLABLE))
|
||||
if (!(m_targets.getItemTarget()->GetTemplate()->Flags & ITEM_PROTO_FLAG_MILLABLE))
|
||||
return SPELL_FAILED_CANT_BE_MILLED;
|
||||
//prevent milling in trade slot
|
||||
if (m_targets.getItemTarget()->GetOwnerGUID() != m_caster->GetGUID())
|
||||
return SPELL_FAILED_CANT_BE_MILLED;
|
||||
//Check for enough skill in inscription
|
||||
uint32 item_millingskilllevel = m_targets.getItemTarget()->GetProto()->RequiredSkillRank;
|
||||
uint32 item_millingskilllevel = m_targets.getItemTarget()->GetTemplate()->RequiredSkillRank;
|
||||
if (item_millingskilllevel >p_caster->GetSkillValue(SKILL_INSCRIPTION))
|
||||
return SPELL_FAILED_LOW_CASTLEVEL;
|
||||
//make sure the player has the required herbs in inventory
|
||||
@@ -6277,7 +6277,7 @@ SpellCastResult Spell::CheckItems()
|
||||
if (!pItem || pItem->IsBroken())
|
||||
return SPELL_FAILED_EQUIPPED_ITEM;
|
||||
|
||||
switch(pItem->GetProto()->SubClass)
|
||||
switch(pItem->GetTemplate()->SubClass)
|
||||
{
|
||||
case ITEM_SUBCLASS_WEAPON_THROWN:
|
||||
{
|
||||
@@ -6299,7 +6299,7 @@ SpellCastResult Spell::CheckItems()
|
||||
return SPELL_FAILED_NO_AMMO;
|
||||
}
|
||||
|
||||
ItemPrototype const *ammoProto = ObjectMgr::GetItemPrototype(ammo);
|
||||
ItemTemplate const *ammoProto = sObjectMgr->GetItemTemplate(ammo);
|
||||
if (!ammoProto)
|
||||
return SPELL_FAILED_NO_AMMO;
|
||||
|
||||
@@ -6307,7 +6307,7 @@ SpellCastResult Spell::CheckItems()
|
||||
return SPELL_FAILED_NO_AMMO;
|
||||
|
||||
// check ammo ws. weapon compatibility
|
||||
switch(pItem->GetProto()->SubClass)
|
||||
switch(pItem->GetTemplate()->SubClass)
|
||||
{
|
||||
case ITEM_SUBCLASS_WEAPON_BOW:
|
||||
case ITEM_SUBCLASS_WEAPON_CROSSBOW:
|
||||
@@ -6338,7 +6338,7 @@ SpellCastResult Spell::CheckItems()
|
||||
case SPELL_EFFECT_CREATE_MANA_GEM:
|
||||
{
|
||||
uint32 item_id = m_spellInfo->EffectItemType[i];
|
||||
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(item_id);
|
||||
ItemTemplate const *pProto = sObjectMgr->GetItemTemplate(item_id);
|
||||
|
||||
if (!pProto)
|
||||
return SPELL_FAILED_ITEM_AT_MAX_CHARGES;
|
||||
|
||||
@@ -714,13 +714,13 @@ void Spell::SpellDamageSchoolDmg(SpellEffIndex effIndex)
|
||||
Item *item = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK);
|
||||
if (item)
|
||||
{
|
||||
float dmg_min = item->GetProto()->Damage->DamageMin;
|
||||
float dmg_max = item->GetProto()->Damage->DamageMax;
|
||||
float dmg_min = item->GetTemplate()->Damage->DamageMin;
|
||||
float dmg_max = item->GetTemplate()->Damage->DamageMax;
|
||||
if (dmg_max == 0.0f && dmg_min > dmg_max)
|
||||
damage += int32(dmg_min);
|
||||
else
|
||||
damage += irand(int32(dmg_min), int32(dmg_max));
|
||||
damage += int32(m_caster->ToPlayer()->GetAmmoDPS()*item->GetProto()->Delay*0.001f);
|
||||
damage += int32(m_caster->ToPlayer()->GetAmmoDPS()*item->GetTemplate()->Delay*0.001f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2377,7 +2377,7 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype)
|
||||
Player* player = (Player*)unitTarget;
|
||||
|
||||
uint32 newitemid = itemtype;
|
||||
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(newitemid);
|
||||
ItemTemplate const *pProto = sObjectMgr->GetItemTemplate(newitemid);
|
||||
if (!pProto)
|
||||
{
|
||||
player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
|
||||
@@ -2458,7 +2458,7 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype)
|
||||
}
|
||||
|
||||
// set the "Crafted by ..." property of the item
|
||||
if (pItem->GetProto()->Class != ITEM_CLASS_CONSUMABLE && pItem->GetProto()->Class != ITEM_CLASS_QUEST && newitemid != 6265 && newitemid != 6948)
|
||||
if (pItem->GetTemplate()->Class != ITEM_CLASS_CONSUMABLE && pItem->GetTemplate()->Class != ITEM_CLASS_QUEST && newitemid != 6265 && newitemid != 6948)
|
||||
pItem->SetUInt32Value(ITEM_FIELD_CREATOR, player->GetGUIDLow());
|
||||
|
||||
// send info to the client
|
||||
@@ -2811,7 +2811,7 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex)
|
||||
}
|
||||
else if (itemTarget)
|
||||
{
|
||||
lockId = itemTarget->GetProto()->LockID;
|
||||
lockId = itemTarget->GetTemplate()->LockID;
|
||||
guid = itemTarget->GetGUID();
|
||||
}
|
||||
else
|
||||
@@ -3478,7 +3478,7 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex)
|
||||
else
|
||||
{
|
||||
// do not increase skill if vellum used
|
||||
if (!(m_CastItem && m_CastItem->GetProto()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST))
|
||||
if (!(m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST))
|
||||
p_caster->UpdateCraftSkill(m_spellInfo->Id);
|
||||
|
||||
uint32 enchant_id = m_spellInfo->EffectMiscValue[effIndex];
|
||||
@@ -3498,7 +3498,7 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex)
|
||||
{
|
||||
sLog->outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)",
|
||||
p_caster->GetName(),p_caster->GetSession()->GetAccountId(),
|
||||
itemTarget->GetProto()->Name1,itemTarget->GetEntry(),
|
||||
itemTarget->GetTemplate()->Name1,itemTarget->GetEntry(),
|
||||
item_owner->GetName(),item_owner->GetSession()->GetAccountId());
|
||||
}
|
||||
|
||||
@@ -3559,7 +3559,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex)
|
||||
{
|
||||
sLog->outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)",
|
||||
p_caster->GetName(),p_caster->GetSession()->GetAccountId(),
|
||||
itemTarget->GetProto()->Name1,itemTarget->GetEntry(),
|
||||
itemTarget->GetTemplate()->Name1,itemTarget->GetEntry(),
|
||||
item_owner->GetName(),item_owner->GetSession()->GetAccountId());
|
||||
}
|
||||
|
||||
@@ -3689,7 +3689,7 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex)
|
||||
{
|
||||
sLog->outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(temp): %s (Entry: %d) for player: %s (Account: %u)",
|
||||
p_caster->GetName(), p_caster->GetSession()->GetAccountId(),
|
||||
itemTarget->GetProto()->Name1, itemTarget->GetEntry(),
|
||||
itemTarget->GetTemplate()->Name1, itemTarget->GetEntry(),
|
||||
item_owner->GetName(), item_owner->GetSession()->GetAccountId());
|
||||
}
|
||||
|
||||
@@ -3987,7 +3987,7 @@ void Spell::SpellDamageWeaponDmg(SpellEffIndex effIndex)
|
||||
// 50% more damage with daggers
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
if (Item* item = m_caster->ToPlayer()->GetWeaponForAttack(m_attackType, true))
|
||||
if (item->GetProto()->SubClass == ITEM_SUBCLASS_WEAPON_DAGGER)
|
||||
if (item->GetTemplate()->SubClass == ITEM_SUBCLASS_WEAPON_DAGGER)
|
||||
totalDamagePercentMod *= 1.5f;
|
||||
}
|
||||
// Mutilate (for each hand)
|
||||
@@ -5697,7 +5697,7 @@ void Spell::EffectDisEnchant(SpellEffIndex /*effIndex*/)
|
||||
return;
|
||||
|
||||
Player* p_caster = (Player*)m_caster;
|
||||
if (!itemTarget || !itemTarget->GetProto()->DisenchantID)
|
||||
if (!itemTarget || !itemTarget->GetTemplate()->DisenchantID)
|
||||
return;
|
||||
|
||||
p_caster->UpdateCraftSkill(m_spellInfo->Id);
|
||||
@@ -5740,7 +5740,7 @@ void Spell::EffectFeedPet(SpellEffIndex effIndex)
|
||||
if (!pet->isAlive())
|
||||
return;
|
||||
|
||||
int32 benefit = pet->GetCurrentFoodBenefitLevel(foodItem->GetProto()->ItemLevel);
|
||||
int32 benefit = pet->GetCurrentFoodBenefitLevel(foodItem->GetTemplate()->ItemLevel);
|
||||
if (benefit <= 0)
|
||||
return;
|
||||
|
||||
@@ -6484,7 +6484,7 @@ void Spell::EffectProspecting(SpellEffIndex /*effIndex*/)
|
||||
return;
|
||||
|
||||
Player* p_caster = (Player*)m_caster;
|
||||
if (!itemTarget || !(itemTarget->GetProto()->Flags & ITEM_PROTO_FLAG_PROSPECTABLE))
|
||||
if (!itemTarget || !(itemTarget->GetTemplate()->Flags & ITEM_PROTO_FLAG_PROSPECTABLE))
|
||||
return;
|
||||
|
||||
if (itemTarget->GetCount() < 5)
|
||||
@@ -6493,7 +6493,7 @@ void Spell::EffectProspecting(SpellEffIndex /*effIndex*/)
|
||||
if (sWorld->getBoolConfig(CONFIG_SKILL_PROSPECTING))
|
||||
{
|
||||
uint32 SkillValue = p_caster->GetPureSkillValue(SKILL_JEWELCRAFTING);
|
||||
uint32 reqSkillValue = itemTarget->GetProto()->RequiredSkillRank;
|
||||
uint32 reqSkillValue = itemTarget->GetTemplate()->RequiredSkillRank;
|
||||
p_caster->UpdateGatherSkill(SKILL_JEWELCRAFTING, SkillValue, reqSkillValue);
|
||||
}
|
||||
|
||||
@@ -6506,7 +6506,7 @@ void Spell::EffectMilling(SpellEffIndex /*effIndex*/)
|
||||
return;
|
||||
|
||||
Player* p_caster = (Player*)m_caster;
|
||||
if (!itemTarget || !(itemTarget->GetProto()->Flags & ITEM_PROTO_FLAG_MILLABLE))
|
||||
if (!itemTarget || !(itemTarget->GetTemplate()->Flags & ITEM_PROTO_FLAG_MILLABLE))
|
||||
return;
|
||||
|
||||
if (itemTarget->GetCount() < 5)
|
||||
@@ -6515,7 +6515,7 @@ void Spell::EffectMilling(SpellEffIndex /*effIndex*/)
|
||||
if (sWorld->getBoolConfig(CONFIG_SKILL_MILLING))
|
||||
{
|
||||
uint32 SkillValue = p_caster->GetPureSkillValue(SKILL_INSCRIPTION);
|
||||
uint32 reqSkillValue = itemTarget->GetProto()->RequiredSkillRank;
|
||||
uint32 reqSkillValue = itemTarget->GetTemplate()->RequiredSkillRank;
|
||||
p_caster->UpdateGatherSkill(SKILL_INSCRIPTION, SkillValue, reqSkillValue);
|
||||
}
|
||||
|
||||
@@ -6874,7 +6874,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const *
|
||||
|
||||
// level of pet summoned using engineering item based at engineering skill level
|
||||
if (m_CastItem && caster->GetTypeId() == TYPEID_PLAYER)
|
||||
if (ItemPrototype const *proto = m_CastItem->GetProto())
|
||||
if (ItemTemplate const *proto = m_CastItem->GetTemplate())
|
||||
if (proto->RequiredSkill == SKILL_ENGINERING)
|
||||
if (uint16 skill202 = caster->ToPlayer()->GetSkillValue(SKILL_ENGINERING))
|
||||
level = skill202/5;
|
||||
@@ -7095,7 +7095,7 @@ void Spell::EffectRechargeManaGem(SpellEffIndex /*effIndex*/)
|
||||
|
||||
uint32 item_id = m_spellInfo->EffectItemType[0];
|
||||
|
||||
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(item_id);
|
||||
ItemTemplate const *pProto = sObjectMgr->GetItemTemplate(item_id);
|
||||
if (!pProto)
|
||||
{
|
||||
player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
|
||||
|
||||
@@ -2366,7 +2366,7 @@ bool SpellMgr::IsSpellValid(SpellEntry const *spellInfo, Player *pl, bool msg)
|
||||
|
||||
}
|
||||
// also possible IsLootCraftingSpell case but fake item must exist anyway
|
||||
else if (!ObjectMgr::GetItemPrototype(spellInfo->EffectItemType[i]))
|
||||
else if (!sObjectMgr->GetItemTemplate(spellInfo->EffectItemType[i]))
|
||||
{
|
||||
if (msg)
|
||||
{
|
||||
@@ -2404,7 +2404,7 @@ bool SpellMgr::IsSpellValid(SpellEntry const *spellInfo, Player *pl, bool msg)
|
||||
{
|
||||
for (uint8 j = 0; j < MAX_SPELL_REAGENTS; ++j)
|
||||
{
|
||||
if (spellInfo->Reagent[j] > 0 && !ObjectMgr::GetItemPrototype(spellInfo->Reagent[j]))
|
||||
if (spellInfo->Reagent[j] > 0 && !sObjectMgr->GetItemTemplate(spellInfo->Reagent[j]))
|
||||
{
|
||||
if (msg)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user