mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[7738] Use proper indent instead if() for() style.
This commit is contained in:
parent
dba73b611d
commit
c05a531281
2 changed files with 267 additions and 265 deletions
|
|
@ -11441,301 +11441,303 @@ void Player::ApplyEnchantment(Item *item,EnchantmentSlot slot,bool apply, bool a
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!item->IsBroken())
|
if (!item->IsBroken())
|
||||||
for (int s=0; s<3; s++)
|
|
||||||
{
|
{
|
||||||
uint32 enchant_display_type = pEnchant->type[s];
|
for (int s=0; s<3; s++)
|
||||||
uint32 enchant_amount = pEnchant->amount[s];
|
|
||||||
uint32 enchant_spell_id = pEnchant->spellid[s];
|
|
||||||
|
|
||||||
switch(enchant_display_type)
|
|
||||||
{
|
{
|
||||||
case ITEM_ENCHANTMENT_TYPE_NONE:
|
uint32 enchant_display_type = pEnchant->type[s];
|
||||||
break;
|
uint32 enchant_amount = pEnchant->amount[s];
|
||||||
case ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL:
|
uint32 enchant_spell_id = pEnchant->spellid[s];
|
||||||
// processed in Player::CastItemCombatSpell
|
|
||||||
break;
|
switch(enchant_display_type)
|
||||||
case ITEM_ENCHANTMENT_TYPE_DAMAGE:
|
{
|
||||||
if (item->GetSlot() == EQUIPMENT_SLOT_MAINHAND)
|
case ITEM_ENCHANTMENT_TYPE_NONE:
|
||||||
HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_VALUE, float(enchant_amount), apply);
|
break;
|
||||||
else if (item->GetSlot() == EQUIPMENT_SLOT_OFFHAND)
|
case ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL:
|
||||||
HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_VALUE, float(enchant_amount), apply);
|
// processed in Player::CastItemCombatSpell
|
||||||
else if (item->GetSlot() == EQUIPMENT_SLOT_RANGED)
|
break;
|
||||||
HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_VALUE, float(enchant_amount), apply);
|
case ITEM_ENCHANTMENT_TYPE_DAMAGE:
|
||||||
break;
|
if (item->GetSlot() == EQUIPMENT_SLOT_MAINHAND)
|
||||||
case ITEM_ENCHANTMENT_TYPE_EQUIP_SPELL:
|
HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_VALUE, float(enchant_amount), apply);
|
||||||
if(enchant_spell_id)
|
else if (item->GetSlot() == EQUIPMENT_SLOT_OFFHAND)
|
||||||
{
|
HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_VALUE, float(enchant_amount), apply);
|
||||||
if(apply)
|
else if (item->GetSlot() == EQUIPMENT_SLOT_RANGED)
|
||||||
|
HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_VALUE, float(enchant_amount), apply);
|
||||||
|
break;
|
||||||
|
case ITEM_ENCHANTMENT_TYPE_EQUIP_SPELL:
|
||||||
|
if(enchant_spell_id)
|
||||||
{
|
{
|
||||||
int32 basepoints = 0;
|
if(apply)
|
||||||
// Random Property Exist - try found basepoints for spell (basepoints depends from item suffix factor)
|
|
||||||
if (item->GetItemRandomPropertyId())
|
|
||||||
{
|
{
|
||||||
ItemRandomSuffixEntry const *item_rand = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId()));
|
int32 basepoints = 0;
|
||||||
if (item_rand)
|
// Random Property Exist - try found basepoints for spell (basepoints depends from item suffix factor)
|
||||||
|
if (item->GetItemRandomPropertyId())
|
||||||
{
|
{
|
||||||
// Search enchant_amount
|
ItemRandomSuffixEntry const *item_rand = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId()));
|
||||||
for (int k=0; k<3; k++)
|
if (item_rand)
|
||||||
{
|
{
|
||||||
if(item_rand->enchant_id[k] == enchant_id)
|
// Search enchant_amount
|
||||||
|
for (int k=0; k<3; k++)
|
||||||
{
|
{
|
||||||
basepoints = int32((item_rand->prefix[k]*item->GetItemSuffixFactor()) / 10000 );
|
if(item_rand->enchant_id[k] == enchant_id)
|
||||||
break;
|
{
|
||||||
|
basepoints = int32((item_rand->prefix[k]*item->GetItemSuffixFactor()) / 10000 );
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Cast custom spell vs all equal basepoints getted from enchant_amount
|
||||||
|
if (basepoints)
|
||||||
|
CastCustomSpell(this,enchant_spell_id,&basepoints,&basepoints,&basepoints,true,item);
|
||||||
|
else
|
||||||
|
CastSpell(this,enchant_spell_id,true,item);
|
||||||
}
|
}
|
||||||
// Cast custom spell vs all equal basepoints getted from enchant_amount
|
|
||||||
if (basepoints)
|
|
||||||
CastCustomSpell(this,enchant_spell_id,&basepoints,&basepoints,&basepoints,true,item);
|
|
||||||
else
|
else
|
||||||
CastSpell(this,enchant_spell_id,true,item);
|
RemoveAurasDueToItemSpell(item,enchant_spell_id);
|
||||||
}
|
}
|
||||||
else
|
break;
|
||||||
RemoveAurasDueToItemSpell(item,enchant_spell_id);
|
case ITEM_ENCHANTMENT_TYPE_RESISTANCE:
|
||||||
}
|
if (!enchant_amount)
|
||||||
break;
|
|
||||||
case ITEM_ENCHANTMENT_TYPE_RESISTANCE:
|
|
||||||
if (!enchant_amount)
|
|
||||||
{
|
|
||||||
ItemRandomSuffixEntry const *item_rand = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId()));
|
|
||||||
if(item_rand)
|
|
||||||
{
|
{
|
||||||
for (int k=0; k<3; k++)
|
ItemRandomSuffixEntry const *item_rand = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId()));
|
||||||
|
if(item_rand)
|
||||||
{
|
{
|
||||||
if(item_rand->enchant_id[k] == enchant_id)
|
for (int k=0; k<3; k++)
|
||||||
{
|
{
|
||||||
enchant_amount = uint32((item_rand->prefix[k]*item->GetItemSuffixFactor()) / 10000 );
|
if(item_rand->enchant_id[k] == enchant_id)
|
||||||
break;
|
{
|
||||||
|
enchant_amount = uint32((item_rand->prefix[k]*item->GetItemSuffixFactor()) / 10000 );
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + enchant_spell_id), TOTAL_VALUE, float(enchant_amount), apply);
|
HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + enchant_spell_id), TOTAL_VALUE, float(enchant_amount), apply);
|
||||||
break;
|
break;
|
||||||
case ITEM_ENCHANTMENT_TYPE_STAT:
|
case ITEM_ENCHANTMENT_TYPE_STAT:
|
||||||
{
|
|
||||||
if (!enchant_amount)
|
|
||||||
{
|
{
|
||||||
ItemRandomSuffixEntry const *item_rand_suffix = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId()));
|
if (!enchant_amount)
|
||||||
if(item_rand_suffix)
|
|
||||||
{
|
{
|
||||||
for (int k=0; k<3; k++)
|
ItemRandomSuffixEntry const *item_rand_suffix = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId()));
|
||||||
|
if(item_rand_suffix)
|
||||||
{
|
{
|
||||||
if(item_rand_suffix->enchant_id[k] == enchant_id)
|
for (int k=0; k<3; k++)
|
||||||
{
|
{
|
||||||
enchant_amount = uint32((item_rand_suffix->prefix[k]*item->GetItemSuffixFactor()) / 10000 );
|
if(item_rand_suffix->enchant_id[k] == enchant_id)
|
||||||
break;
|
{
|
||||||
|
enchant_amount = uint32((item_rand_suffix->prefix[k]*item->GetItemSuffixFactor()) / 10000 );
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
sLog.outDebug("Adding %u to stat nb %u",enchant_amount,enchant_spell_id);
|
sLog.outDebug("Adding %u to stat nb %u",enchant_amount,enchant_spell_id);
|
||||||
switch (enchant_spell_id)
|
switch (enchant_spell_id)
|
||||||
{
|
|
||||||
case ITEM_MOD_AGILITY:
|
|
||||||
sLog.outDebug("+ %u AGILITY",enchant_amount);
|
|
||||||
HandleStatModifier(UNIT_MOD_STAT_AGILITY, TOTAL_VALUE, float(enchant_amount), apply);
|
|
||||||
ApplyStatBuffMod(STAT_AGILITY, enchant_amount, apply);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_STRENGTH:
|
|
||||||
sLog.outDebug("+ %u STRENGTH",enchant_amount);
|
|
||||||
HandleStatModifier(UNIT_MOD_STAT_STRENGTH, TOTAL_VALUE, float(enchant_amount), apply);
|
|
||||||
ApplyStatBuffMod(STAT_STRENGTH, enchant_amount, apply);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_INTELLECT:
|
|
||||||
sLog.outDebug("+ %u INTELLECT",enchant_amount);
|
|
||||||
HandleStatModifier(UNIT_MOD_STAT_INTELLECT, TOTAL_VALUE, float(enchant_amount), apply);
|
|
||||||
ApplyStatBuffMod(STAT_INTELLECT, enchant_amount, apply);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_SPIRIT:
|
|
||||||
sLog.outDebug("+ %u SPIRIT",enchant_amount);
|
|
||||||
HandleStatModifier(UNIT_MOD_STAT_SPIRIT, TOTAL_VALUE, float(enchant_amount), apply);
|
|
||||||
ApplyStatBuffMod(STAT_SPIRIT, enchant_amount, apply);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_STAMINA:
|
|
||||||
sLog.outDebug("+ %u STAMINA",enchant_amount);
|
|
||||||
HandleStatModifier(UNIT_MOD_STAT_STAMINA, TOTAL_VALUE, float(enchant_amount), apply);
|
|
||||||
ApplyStatBuffMod(STAT_STAMINA, enchant_amount, apply);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_DEFENSE_SKILL_RATING:
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_DEFENSE_SKILL, enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u DEFENCE", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_DODGE_RATING:
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_DODGE, enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u DODGE", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_PARRY_RATING:
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_PARRY, enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u PARRY", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_BLOCK_RATING:
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_BLOCK, enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u SHIELD_BLOCK", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_HIT_MELEE_RATING:
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_HIT_MELEE, enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u MELEE_HIT", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_HIT_RANGED_RATING:
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_HIT_RANGED, enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u RANGED_HIT", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_HIT_SPELL_RATING:
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_HIT_SPELL, enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u SPELL_HIT", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_CRIT_MELEE_RATING:
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_CRIT_MELEE, enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u MELEE_CRIT", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_CRIT_RANGED_RATING:
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_CRIT_RANGED, enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u RANGED_CRIT", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_CRIT_SPELL_RATING:
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_CRIT_SPELL, enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u SPELL_CRIT", enchant_amount);
|
|
||||||
break;
|
|
||||||
// Values from ITEM_STAT_MELEE_HA_RATING to ITEM_MOD_HASTE_RANGED_RATING are never used
|
|
||||||
// in Enchantments
|
|
||||||
// case ITEM_MOD_HIT_TAKEN_MELEE_RATING:
|
|
||||||
// ((Player*)this)->ApplyRatingMod(CR_HIT_TAKEN_MELEE, enchant_amount, apply);
|
|
||||||
// break;
|
|
||||||
// case ITEM_MOD_HIT_TAKEN_RANGED_RATING:
|
|
||||||
// ((Player*)this)->ApplyRatingMod(CR_HIT_TAKEN_RANGED, enchant_amount, apply);
|
|
||||||
// break;
|
|
||||||
// case ITEM_MOD_HIT_TAKEN_SPELL_RATING:
|
|
||||||
// ((Player*)this)->ApplyRatingMod(CR_HIT_TAKEN_SPELL, enchant_amount, apply);
|
|
||||||
// break;
|
|
||||||
// case ITEM_MOD_CRIT_TAKEN_MELEE_RATING:
|
|
||||||
// ((Player*)this)->ApplyRatingMod(CR_CRIT_TAKEN_MELEE, enchant_amount, apply);
|
|
||||||
// break;
|
|
||||||
// case ITEM_MOD_CRIT_TAKEN_RANGED_RATING:
|
|
||||||
// ((Player*)this)->ApplyRatingMod(CR_CRIT_TAKEN_RANGED, enchant_amount, apply);
|
|
||||||
// break;
|
|
||||||
// case ITEM_MOD_CRIT_TAKEN_SPELL_RATING:
|
|
||||||
// ((Player*)this)->ApplyRatingMod(CR_CRIT_TAKEN_SPELL, enchant_amount, apply);
|
|
||||||
// break;
|
|
||||||
// case ITEM_MOD_HASTE_MELEE_RATING:
|
|
||||||
// ((Player*)this)->ApplyRatingMod(CR_HASTE_MELEE, enchant_amount, apply);
|
|
||||||
// break;
|
|
||||||
// case ITEM_MOD_HASTE_RANGED_RATING:
|
|
||||||
// ((Player*)this)->ApplyRatingMod(CR_HASTE_RANGED, enchant_amount, apply);
|
|
||||||
// break;
|
|
||||||
case ITEM_MOD_HASTE_SPELL_RATING:
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_HASTE_SPELL, enchant_amount, apply);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_HIT_RATING:
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_HIT_MELEE, enchant_amount, apply);
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_HIT_RANGED, enchant_amount, apply);
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_HIT_SPELL, enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u HIT", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_CRIT_RATING:
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_CRIT_MELEE, enchant_amount, apply);
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_CRIT_RANGED, enchant_amount, apply);
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_CRIT_SPELL, enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u CRITICAL", enchant_amount);
|
|
||||||
break;
|
|
||||||
// Values ITEM_MOD_HIT_TAKEN_RATING and ITEM_MOD_CRIT_TAKEN_RATING are never used in Enchantment
|
|
||||||
// case ITEM_MOD_HIT_TAKEN_RATING:
|
|
||||||
// ((Player*)this)->ApplyRatingMod(CR_HIT_TAKEN_MELEE, enchant_amount, apply);
|
|
||||||
// ((Player*)this)->ApplyRatingMod(CR_HIT_TAKEN_RANGED, enchant_amount, apply);
|
|
||||||
// ((Player*)this)->ApplyRatingMod(CR_HIT_TAKEN_SPELL, enchant_amount, apply);
|
|
||||||
// break;
|
|
||||||
// case ITEM_MOD_CRIT_TAKEN_RATING:
|
|
||||||
// ((Player*)this)->ApplyRatingMod(CR_CRIT_TAKEN_MELEE, enchant_amount, apply);
|
|
||||||
// ((Player*)this)->ApplyRatingMod(CR_CRIT_TAKEN_RANGED, enchant_amount, apply);
|
|
||||||
// ((Player*)this)->ApplyRatingMod(CR_CRIT_TAKEN_SPELL, enchant_amount, apply);
|
|
||||||
// break;
|
|
||||||
case ITEM_MOD_RESILIENCE_RATING:
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_CRIT_TAKEN_MELEE, enchant_amount, apply);
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_CRIT_TAKEN_RANGED, enchant_amount, apply);
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_CRIT_TAKEN_SPELL, enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u RESILIENCE", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_HASTE_RATING:
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_HASTE_MELEE, enchant_amount, apply);
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_HASTE_RANGED, enchant_amount, apply);
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_HASTE_SPELL, enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u HASTE", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_EXPERTISE_RATING:
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_EXPERTISE, enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u EXPERTISE", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_ATTACK_POWER:
|
|
||||||
HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_VALUE, float(enchant_amount), apply);
|
|
||||||
HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(enchant_amount), apply);
|
|
||||||
sLog.outDebug("+ %u ATTACK_POWER", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_RANGED_ATTACK_POWER:
|
|
||||||
HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(enchant_amount), apply);
|
|
||||||
sLog.outDebug("+ %u RANGED_ATTACK_POWER", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_FERAL_ATTACK_POWER:
|
|
||||||
((Player*)this)->ApplyFeralAPBonus(enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u FERAL_ATTACK_POWER", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_SPELL_HEALING_DONE:
|
|
||||||
((Player*)this)->ApplySpellHealingBonus(enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u SPELL_HEALING_DONE", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_SPELL_DAMAGE_DONE:
|
|
||||||
((Player*)this)->ApplySpellDamageBonus(enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u SPELL_DAMAGE_DONE", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_MANA_REGENERATION:
|
|
||||||
((Player*)this)->ApplyManaRegenBonus(enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u MANA_REGENERATION", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_ARMOR_PENETRATION_RATING:
|
|
||||||
((Player*)this)->ApplyRatingMod(CR_ARMOR_PENETRATION, enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u ARMOR PENETRATION", enchant_amount);
|
|
||||||
break;
|
|
||||||
case ITEM_MOD_SPELL_POWER:
|
|
||||||
((Player*)this)->ApplySpellHealingBonus(enchant_amount, apply);
|
|
||||||
((Player*)this)->ApplySpellDamageBonus(enchant_amount, apply);
|
|
||||||
sLog.outDebug("+ %u SPELL_POWER", enchant_amount);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case ITEM_ENCHANTMENT_TYPE_TOTEM: // Shaman Rockbiter Weapon
|
|
||||||
{
|
|
||||||
if(getClass() == CLASS_SHAMAN)
|
|
||||||
{
|
|
||||||
float addValue = 0.0f;
|
|
||||||
if(item->GetSlot() == EQUIPMENT_SLOT_MAINHAND)
|
|
||||||
{
|
{
|
||||||
addValue = float(enchant_amount * item->GetProto()->Delay/1000.0f);
|
case ITEM_MOD_AGILITY:
|
||||||
HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_VALUE, addValue, apply);
|
sLog.outDebug("+ %u AGILITY",enchant_amount);
|
||||||
}
|
HandleStatModifier(UNIT_MOD_STAT_AGILITY, TOTAL_VALUE, float(enchant_amount), apply);
|
||||||
else if(item->GetSlot() == EQUIPMENT_SLOT_OFFHAND )
|
ApplyStatBuffMod(STAT_AGILITY, enchant_amount, apply);
|
||||||
{
|
break;
|
||||||
addValue = float(enchant_amount * item->GetProto()->Delay/1000.0f);
|
case ITEM_MOD_STRENGTH:
|
||||||
HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_VALUE, addValue, apply);
|
sLog.outDebug("+ %u STRENGTH",enchant_amount);
|
||||||
|
HandleStatModifier(UNIT_MOD_STAT_STRENGTH, TOTAL_VALUE, float(enchant_amount), apply);
|
||||||
|
ApplyStatBuffMod(STAT_STRENGTH, enchant_amount, apply);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_INTELLECT:
|
||||||
|
sLog.outDebug("+ %u INTELLECT",enchant_amount);
|
||||||
|
HandleStatModifier(UNIT_MOD_STAT_INTELLECT, TOTAL_VALUE, float(enchant_amount), apply);
|
||||||
|
ApplyStatBuffMod(STAT_INTELLECT, enchant_amount, apply);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_SPIRIT:
|
||||||
|
sLog.outDebug("+ %u SPIRIT",enchant_amount);
|
||||||
|
HandleStatModifier(UNIT_MOD_STAT_SPIRIT, TOTAL_VALUE, float(enchant_amount), apply);
|
||||||
|
ApplyStatBuffMod(STAT_SPIRIT, enchant_amount, apply);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_STAMINA:
|
||||||
|
sLog.outDebug("+ %u STAMINA",enchant_amount);
|
||||||
|
HandleStatModifier(UNIT_MOD_STAT_STAMINA, TOTAL_VALUE, float(enchant_amount), apply);
|
||||||
|
ApplyStatBuffMod(STAT_STAMINA, enchant_amount, apply);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_DEFENSE_SKILL_RATING:
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_DEFENSE_SKILL, enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u DEFENCE", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_DODGE_RATING:
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_DODGE, enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u DODGE", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_PARRY_RATING:
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_PARRY, enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u PARRY", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_BLOCK_RATING:
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_BLOCK, enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u SHIELD_BLOCK", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_HIT_MELEE_RATING:
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_HIT_MELEE, enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u MELEE_HIT", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_HIT_RANGED_RATING:
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_HIT_RANGED, enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u RANGED_HIT", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_HIT_SPELL_RATING:
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_HIT_SPELL, enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u SPELL_HIT", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_CRIT_MELEE_RATING:
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_CRIT_MELEE, enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u MELEE_CRIT", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_CRIT_RANGED_RATING:
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_CRIT_RANGED, enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u RANGED_CRIT", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_CRIT_SPELL_RATING:
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_CRIT_SPELL, enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u SPELL_CRIT", enchant_amount);
|
||||||
|
break;
|
||||||
|
// Values from ITEM_STAT_MELEE_HA_RATING to ITEM_MOD_HASTE_RANGED_RATING are never used
|
||||||
|
// in Enchantments
|
||||||
|
// case ITEM_MOD_HIT_TAKEN_MELEE_RATING:
|
||||||
|
// ((Player*)this)->ApplyRatingMod(CR_HIT_TAKEN_MELEE, enchant_amount, apply);
|
||||||
|
// break;
|
||||||
|
// case ITEM_MOD_HIT_TAKEN_RANGED_RATING:
|
||||||
|
// ((Player*)this)->ApplyRatingMod(CR_HIT_TAKEN_RANGED, enchant_amount, apply);
|
||||||
|
// break;
|
||||||
|
// case ITEM_MOD_HIT_TAKEN_SPELL_RATING:
|
||||||
|
// ((Player*)this)->ApplyRatingMod(CR_HIT_TAKEN_SPELL, enchant_amount, apply);
|
||||||
|
// break;
|
||||||
|
// case ITEM_MOD_CRIT_TAKEN_MELEE_RATING:
|
||||||
|
// ((Player*)this)->ApplyRatingMod(CR_CRIT_TAKEN_MELEE, enchant_amount, apply);
|
||||||
|
// break;
|
||||||
|
// case ITEM_MOD_CRIT_TAKEN_RANGED_RATING:
|
||||||
|
// ((Player*)this)->ApplyRatingMod(CR_CRIT_TAKEN_RANGED, enchant_amount, apply);
|
||||||
|
// break;
|
||||||
|
// case ITEM_MOD_CRIT_TAKEN_SPELL_RATING:
|
||||||
|
// ((Player*)this)->ApplyRatingMod(CR_CRIT_TAKEN_SPELL, enchant_amount, apply);
|
||||||
|
// break;
|
||||||
|
// case ITEM_MOD_HASTE_MELEE_RATING:
|
||||||
|
// ((Player*)this)->ApplyRatingMod(CR_HASTE_MELEE, enchant_amount, apply);
|
||||||
|
// break;
|
||||||
|
// case ITEM_MOD_HASTE_RANGED_RATING:
|
||||||
|
// ((Player*)this)->ApplyRatingMod(CR_HASTE_RANGED, enchant_amount, apply);
|
||||||
|
// break;
|
||||||
|
case ITEM_MOD_HASTE_SPELL_RATING:
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_HASTE_SPELL, enchant_amount, apply);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_HIT_RATING:
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_HIT_MELEE, enchant_amount, apply);
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_HIT_RANGED, enchant_amount, apply);
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_HIT_SPELL, enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u HIT", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_CRIT_RATING:
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_CRIT_MELEE, enchant_amount, apply);
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_CRIT_RANGED, enchant_amount, apply);
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_CRIT_SPELL, enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u CRITICAL", enchant_amount);
|
||||||
|
break;
|
||||||
|
// Values ITEM_MOD_HIT_TAKEN_RATING and ITEM_MOD_CRIT_TAKEN_RATING are never used in Enchantment
|
||||||
|
// case ITEM_MOD_HIT_TAKEN_RATING:
|
||||||
|
// ((Player*)this)->ApplyRatingMod(CR_HIT_TAKEN_MELEE, enchant_amount, apply);
|
||||||
|
// ((Player*)this)->ApplyRatingMod(CR_HIT_TAKEN_RANGED, enchant_amount, apply);
|
||||||
|
// ((Player*)this)->ApplyRatingMod(CR_HIT_TAKEN_SPELL, enchant_amount, apply);
|
||||||
|
// break;
|
||||||
|
// case ITEM_MOD_CRIT_TAKEN_RATING:
|
||||||
|
// ((Player*)this)->ApplyRatingMod(CR_CRIT_TAKEN_MELEE, enchant_amount, apply);
|
||||||
|
// ((Player*)this)->ApplyRatingMod(CR_CRIT_TAKEN_RANGED, enchant_amount, apply);
|
||||||
|
// ((Player*)this)->ApplyRatingMod(CR_CRIT_TAKEN_SPELL, enchant_amount, apply);
|
||||||
|
// break;
|
||||||
|
case ITEM_MOD_RESILIENCE_RATING:
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_CRIT_TAKEN_MELEE, enchant_amount, apply);
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_CRIT_TAKEN_RANGED, enchant_amount, apply);
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_CRIT_TAKEN_SPELL, enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u RESILIENCE", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_HASTE_RATING:
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_HASTE_MELEE, enchant_amount, apply);
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_HASTE_RANGED, enchant_amount, apply);
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_HASTE_SPELL, enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u HASTE", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_EXPERTISE_RATING:
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_EXPERTISE, enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u EXPERTISE", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_ATTACK_POWER:
|
||||||
|
HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_VALUE, float(enchant_amount), apply);
|
||||||
|
HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(enchant_amount), apply);
|
||||||
|
sLog.outDebug("+ %u ATTACK_POWER", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_RANGED_ATTACK_POWER:
|
||||||
|
HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(enchant_amount), apply);
|
||||||
|
sLog.outDebug("+ %u RANGED_ATTACK_POWER", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_FERAL_ATTACK_POWER:
|
||||||
|
((Player*)this)->ApplyFeralAPBonus(enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u FERAL_ATTACK_POWER", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_SPELL_HEALING_DONE:
|
||||||
|
((Player*)this)->ApplySpellHealingBonus(enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u SPELL_HEALING_DONE", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_SPELL_DAMAGE_DONE:
|
||||||
|
((Player*)this)->ApplySpellDamageBonus(enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u SPELL_DAMAGE_DONE", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_MANA_REGENERATION:
|
||||||
|
((Player*)this)->ApplyManaRegenBonus(enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u MANA_REGENERATION", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_ARMOR_PENETRATION_RATING:
|
||||||
|
((Player*)this)->ApplyRatingMod(CR_ARMOR_PENETRATION, enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u ARMOR PENETRATION", enchant_amount);
|
||||||
|
break;
|
||||||
|
case ITEM_MOD_SPELL_POWER:
|
||||||
|
((Player*)this)->ApplySpellHealingBonus(enchant_amount, apply);
|
||||||
|
((Player*)this)->ApplySpellDamageBonus(enchant_amount, apply);
|
||||||
|
sLog.outDebug("+ %u SPELL_POWER", enchant_amount);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
case ITEM_ENCHANTMENT_TYPE_TOTEM: // Shaman Rockbiter Weapon
|
||||||
}
|
{
|
||||||
case ITEM_ENCHANTMENT_TYPE_USE_SPELL:
|
if(getClass() == CLASS_SHAMAN)
|
||||||
// processed in Player::CastItemUseSpell
|
{
|
||||||
break;
|
float addValue = 0.0f;
|
||||||
case ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET:
|
if(item->GetSlot() == EQUIPMENT_SLOT_MAINHAND)
|
||||||
// nothing do..
|
{
|
||||||
break;
|
addValue = float(enchant_amount * item->GetProto()->Delay/1000.0f);
|
||||||
default:
|
HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_VALUE, addValue, apply);
|
||||||
sLog.outError("Unknown item enchantment (id = %d) display type: %d", enchant_id, enchant_display_type);
|
}
|
||||||
break;
|
else if(item->GetSlot() == EQUIPMENT_SLOT_OFFHAND )
|
||||||
} /*switch(enchant_display_type)*/
|
{
|
||||||
} /*for*/
|
addValue = float(enchant_amount * item->GetProto()->Delay/1000.0f);
|
||||||
|
HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_VALUE, addValue, apply);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ITEM_ENCHANTMENT_TYPE_USE_SPELL:
|
||||||
|
// processed in Player::CastItemUseSpell
|
||||||
|
break;
|
||||||
|
case ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET:
|
||||||
|
// nothing do..
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
sLog.outError("Unknown item enchantment (id = %d) display type: %d", enchant_id, enchant_display_type);
|
||||||
|
break;
|
||||||
|
} /*switch(enchant_display_type)*/
|
||||||
|
} /*for*/
|
||||||
|
}
|
||||||
|
|
||||||
// visualize enchantment at player and equipped items
|
// visualize enchantment at player and equipped items
|
||||||
if(slot < MAX_INSPECTED_ENCHANTMENT_SLOT)
|
if(slot < MAX_INSPECTED_ENCHANTMENT_SLOT)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7737"
|
#define REVISION_NR "7738"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue