[12187] Fix item random properties and suffixes

Signed-off-by: Yaki Khadafi <elsoldollo@gmail.com>
This commit is contained in:
Yaki Khadafi 2012-09-05 20:36:38 +03:00 committed by Antz
parent c58ffa3c41
commit 4049442c80
5 changed files with 30 additions and 9 deletions

View file

@ -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;