mirror of
https://github.com/mangosfour/server.git
synced 2025-12-24 01:37:02 +00:00
[12187] Fix item random properties and suffixes
Signed-off-by: Yaki Khadafi <elsoldollo@gmail.com>
This commit is contained in:
parent
c58ffa3c41
commit
4049442c80
5 changed files with 30 additions and 9 deletions
|
|
@ -7686,6 +7686,9 @@ void Player::CastItemCombatSpell(Unit* Target, WeaponAttackType attType)
|
|||
// item combat enchantments
|
||||
for (int e_slot = 0; e_slot < MAX_ENCHANTMENT_SLOT; ++e_slot)
|
||||
{
|
||||
if (e_slot > PRISMATIC_ENCHANTMENT_SLOT && e_slot < PROP_ENCHANTMENT_SLOT_0)
|
||||
continue;
|
||||
|
||||
uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(e_slot));
|
||||
SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
|
||||
if (!pEnchant) continue;
|
||||
|
|
@ -7790,6 +7793,9 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
|
|||
// Item enchantments spells casted at use
|
||||
for (int e_slot = 0; e_slot < MAX_ENCHANTMENT_SLOT; ++e_slot)
|
||||
{
|
||||
if (e_slot > PRISMATIC_ENCHANTMENT_SLOT && e_slot < PROP_ENCHANTMENT_SLOT_0)
|
||||
continue;
|
||||
|
||||
uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(e_slot));
|
||||
SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
|
||||
if (!pEnchant)
|
||||
|
|
@ -12309,6 +12315,9 @@ void Player::AddEnchantmentDurations(Item* item)
|
|||
{
|
||||
for (int x = 0; x < MAX_ENCHANTMENT_SLOT; ++x)
|
||||
{
|
||||
if (x > PRISMATIC_ENCHANTMENT_SLOT && x < PROP_ENCHANTMENT_SLOT_0)
|
||||
continue;
|
||||
|
||||
if (!item->GetEnchantmentId(EnchantmentSlot(x)))
|
||||
continue;
|
||||
|
||||
|
|
@ -12405,6 +12414,9 @@ void Player::ApplyEnchantment(Item* item, bool apply)
|
|||
|
||||
void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool apply_dur, bool ignore_condition)
|
||||
{
|
||||
if (slot > PRISMATIC_ENCHANTMENT_SLOT && slot < PROP_ENCHANTMENT_SLOT_0)
|
||||
return;
|
||||
|
||||
if (!item)
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue