mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[9397] Fixed unexpected rounding in healamount = healamount * int32(TakenTotalMod);
This commit is contained in:
parent
9e4829ecef
commit
f9db93e78b
7 changed files with 41 additions and 40 deletions
|
|
@ -8447,7 +8447,7 @@ uint32 ObjectMgr::GetScriptId(const char *name)
|
|||
ScriptNameMap::const_iterator itr =
|
||||
std::lower_bound(m_scriptNames.begin(), m_scriptNames.end(), name);
|
||||
if(itr == m_scriptNames.end() || *itr != name) return 0;
|
||||
return itr - m_scriptNames.begin();
|
||||
return uint32(itr - m_scriptNames.begin());
|
||||
}
|
||||
|
||||
void ObjectMgr::CheckScripts(ScriptMapMap const& scripts,std::set<int32>& ids)
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
|
|||
m_charmInfo->LoadPetActionBar(fields[13].GetCppString());
|
||||
|
||||
// since last save (in seconds)
|
||||
uint32 timediff = uint32(time(NULL) - fields[14].GetUInt32());
|
||||
uint32 timediff = uint32(time(NULL) - fields[14].GetUInt64());
|
||||
|
||||
m_resetTalentsCost = fields[15].GetUInt32();
|
||||
m_resetTalentsTime = fields[16].GetUInt64();
|
||||
|
|
|
|||
|
|
@ -12038,27 +12038,27 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool
|
|||
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);
|
||||
ApplyStatBuffMod(STAT_AGILITY, float(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);
|
||||
ApplyStatBuffMod(STAT_STRENGTH, float(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);
|
||||
ApplyStatBuffMod(STAT_INTELLECT, float(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);
|
||||
ApplyStatBuffMod(STAT_SPIRIT, float(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);
|
||||
ApplyStatBuffMod(STAT_STAMINA, float(enchant_amount), apply);
|
||||
break;
|
||||
case ITEM_MOD_DEFENSE_SKILL_RATING:
|
||||
((Player*)this)->ApplyRatingMod(CR_DEFENSE_SKILL, enchant_amount, apply);
|
||||
|
|
|
|||
|
|
@ -3506,7 +3506,7 @@ void Aura::HandleAuraTrackStealthed(bool apply, bool /*Real*/)
|
|||
|
||||
void Aura::HandleAuraModScale(bool apply, bool /*Real*/)
|
||||
{
|
||||
m_target->ApplyPercentModFloatValue(OBJECT_FIELD_SCALE_X, m_modifier.m_amount, apply);
|
||||
m_target->ApplyPercentModFloatValue(OBJECT_FIELD_SCALE_X, float(m_modifier.m_amount), apply);
|
||||
}
|
||||
|
||||
void Aura::HandleModPossess(bool apply, bool Real)
|
||||
|
|
@ -4221,7 +4221,7 @@ void Aura::HandleModThreat(bool apply, bool Real)
|
|||
if (m_target->GetTypeId() == TYPEID_PLAYER)
|
||||
for(int8 x=0;x < MAX_SPELL_SCHOOL;x++)
|
||||
if (m_modifier.m_miscvalue & int32(1<<x))
|
||||
ApplyPercentModFloatVar(m_target->m_threatModifier[x], m_modifier.m_amount, apply);
|
||||
ApplyPercentModFloatVar(m_target->m_threatModifier[x], float(m_modifier.m_amount), apply);
|
||||
}
|
||||
|
||||
void Aura::HandleAuraModTotalThreat(bool apply, bool Real)
|
||||
|
|
@ -4888,7 +4888,7 @@ void Aura::HandleAuraModResistanceExclusive(bool apply, bool /*Real*/)
|
|||
{
|
||||
m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_VALUE, float(m_modifier.m_amount), apply);
|
||||
if(m_target->GetTypeId() == TYPEID_PLAYER)
|
||||
m_target->ApplyResistanceBuffModsMod(SpellSchools(x), m_positive, m_modifier.m_amount, apply);
|
||||
m_target->ApplyResistanceBuffModsMod(SpellSchools(x), m_positive, float(m_modifier.m_amount), apply);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4901,7 +4901,7 @@ void Aura::HandleAuraModResistance(bool apply, bool /*Real*/)
|
|||
{
|
||||
m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), TOTAL_VALUE, float(m_modifier.m_amount), apply);
|
||||
if(m_target->GetTypeId() == TYPEID_PLAYER || ((Creature*)m_target)->isPet())
|
||||
m_target->ApplyResistanceBuffModsMod(SpellSchools(x), m_positive, m_modifier.m_amount, apply);
|
||||
m_target->ApplyResistanceBuffModsMod(SpellSchools(x), m_positive, float(m_modifier.m_amount), apply);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4934,8 +4934,8 @@ void Aura::HandleModResistancePercent(bool apply, bool /*Real*/)
|
|||
m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + i), TOTAL_PCT, float(m_modifier.m_amount), apply);
|
||||
if(m_target->GetTypeId() == TYPEID_PLAYER || ((Creature*)m_target)->isPet())
|
||||
{
|
||||
m_target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), true, m_modifier.m_amount, apply);
|
||||
m_target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), false, m_modifier.m_amount, apply);
|
||||
m_target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), true, float(m_modifier.m_amount), apply);
|
||||
m_target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), false, float(m_modifier.m_amount), apply);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4978,7 +4978,7 @@ void Aura::HandleAuraModStat(bool apply, bool /*Real*/)
|
|||
//m_target->ApplyStatMod(Stats(i), m_modifier.m_amount,apply);
|
||||
m_target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_VALUE, float(m_modifier.m_amount), apply);
|
||||
if(m_target->GetTypeId() == TYPEID_PLAYER || ((Creature*)m_target)->isPet())
|
||||
m_target->ApplyStatBuffMod(Stats(i), m_modifier.m_amount, apply);
|
||||
m_target->ApplyStatBuffMod(Stats(i), float(m_modifier.m_amount), apply);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5078,7 +5078,7 @@ void Aura::HandleModTotalPercentStat(bool apply, bool /*Real*/)
|
|||
{
|
||||
m_target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(m_modifier.m_amount), apply);
|
||||
if(m_target->GetTypeId() == TYPEID_PLAYER || ((Creature*)m_target)->isPet())
|
||||
m_target->ApplyStatPercentBuffMod(Stats(i), m_modifier.m_amount, apply );
|
||||
m_target->ApplyStatPercentBuffMod(Stats(i), float(m_modifier.m_amount), apply );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5430,22 +5430,22 @@ void Aura::HandleModSpellCritChanceShool(bool /*apply*/, bool Real)
|
|||
|
||||
void Aura::HandleModCastingSpeed(bool apply, bool /*Real*/)
|
||||
{
|
||||
m_target->ApplyCastTimePercentMod(m_modifier.m_amount,apply);
|
||||
m_target->ApplyCastTimePercentMod(float(m_modifier.m_amount),apply);
|
||||
}
|
||||
|
||||
void Aura::HandleModMeleeRangedSpeedPct(bool apply, bool /*Real*/)
|
||||
{
|
||||
m_target->ApplyAttackTimePercentMod(BASE_ATTACK, m_modifier.m_amount, apply);
|
||||
m_target->ApplyAttackTimePercentMod(OFF_ATTACK, m_modifier.m_amount, apply);
|
||||
m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_modifier.m_amount, apply);
|
||||
m_target->ApplyAttackTimePercentMod(BASE_ATTACK, float(m_modifier.m_amount), apply);
|
||||
m_target->ApplyAttackTimePercentMod(OFF_ATTACK, float(m_modifier.m_amount), apply);
|
||||
m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(m_modifier.m_amount), apply);
|
||||
}
|
||||
|
||||
void Aura::HandleModCombatSpeedPct(bool apply, bool /*Real*/)
|
||||
{
|
||||
m_target->ApplyCastTimePercentMod(m_modifier.m_amount, apply);
|
||||
m_target->ApplyAttackTimePercentMod(BASE_ATTACK, m_modifier.m_amount, apply);
|
||||
m_target->ApplyAttackTimePercentMod(OFF_ATTACK, m_modifier.m_amount, apply);
|
||||
m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_modifier.m_amount, apply);
|
||||
m_target->ApplyCastTimePercentMod(float(m_modifier.m_amount), apply);
|
||||
m_target->ApplyAttackTimePercentMod(BASE_ATTACK, float(m_modifier.m_amount), apply);
|
||||
m_target->ApplyAttackTimePercentMod(OFF_ATTACK, float(m_modifier.m_amount), apply);
|
||||
m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(m_modifier.m_amount), apply);
|
||||
}
|
||||
|
||||
void Aura::HandleModAttackSpeed(bool apply, bool /*Real*/)
|
||||
|
|
@ -5453,26 +5453,26 @@ void Aura::HandleModAttackSpeed(bool apply, bool /*Real*/)
|
|||
if(!m_target->isAlive() )
|
||||
return;
|
||||
|
||||
m_target->ApplyAttackTimePercentMod(BASE_ATTACK,m_modifier.m_amount,apply);
|
||||
m_target->ApplyAttackTimePercentMod(BASE_ATTACK,float(m_modifier.m_amount),apply);
|
||||
}
|
||||
|
||||
void Aura::HandleHaste(bool apply, bool /*Real*/)
|
||||
{
|
||||
m_target->ApplyAttackTimePercentMod(BASE_ATTACK, m_modifier.m_amount, apply);
|
||||
m_target->ApplyAttackTimePercentMod(OFF_ATTACK, m_modifier.m_amount, apply);
|
||||
m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_modifier.m_amount, apply);
|
||||
m_target->ApplyAttackTimePercentMod(BASE_ATTACK, float(m_modifier.m_amount), apply);
|
||||
m_target->ApplyAttackTimePercentMod(OFF_ATTACK, float(m_modifier.m_amount), apply);
|
||||
m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(m_modifier.m_amount), apply);
|
||||
}
|
||||
|
||||
void Aura::HandleAuraModRangedHaste(bool apply, bool /*Real*/)
|
||||
{
|
||||
m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_modifier.m_amount, apply);
|
||||
m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(m_modifier.m_amount), apply);
|
||||
}
|
||||
|
||||
void Aura::HandleRangedAmmoHaste(bool apply, bool /*Real*/)
|
||||
{
|
||||
if(m_target->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
m_target->ApplyAttackTimePercentMod(RANGED_ATTACK,m_modifier.m_amount, apply);
|
||||
m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(m_modifier.m_amount), apply);
|
||||
}
|
||||
|
||||
/********************************/
|
||||
|
|
|
|||
|
|
@ -8996,8 +8996,8 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
|
|||
if (Aura *dummy = pVictim->GetDummyAura(45182))
|
||||
{
|
||||
float mod = -((Player*)pVictim)->GetRatingBonusValue(CR_CRIT_TAKEN_SPELL)*2*4;
|
||||
if (mod < dummy->GetModifier()->m_amount)
|
||||
mod = dummy->GetModifier()->m_amount;
|
||||
if (mod < float(dummy->GetModifier()->m_amount))
|
||||
mod = float(dummy->GetModifier()->m_amount);
|
||||
TakenTotalMod *= (mod+100.0f)/100.0f;
|
||||
}
|
||||
}
|
||||
|
|
@ -9182,7 +9182,7 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
|
|||
crit_chance = GetFloatValue( PLAYER_SPELL_CRIT_PERCENTAGE1 + GetFirstSchoolInMask(schoolMask));
|
||||
else
|
||||
{
|
||||
crit_chance = m_baseSpellCritChance;
|
||||
crit_chance = float(m_baseSpellCritChance);
|
||||
crit_chance += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL, schoolMask);
|
||||
}
|
||||
// taken
|
||||
|
|
@ -9383,18 +9383,18 @@ int32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, int32
|
|||
float TakenTotalMod = 1.0f;
|
||||
|
||||
// Healing taken percent
|
||||
float minval = pVictim->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
|
||||
float minval = float(pVictim->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT));
|
||||
if(minval)
|
||||
TakenTotalMod *= (100.0f + minval) / 100.0f;
|
||||
|
||||
float maxval = pVictim->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
|
||||
float maxval = float(pVictim->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT));
|
||||
if(maxval)
|
||||
TakenTotalMod *= (100.0f + maxval) / 100.0f;
|
||||
|
||||
// No heal amount for this class spells
|
||||
if (spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE)
|
||||
{
|
||||
healamount = healamount * int32(TakenTotalMod);
|
||||
healamount = int32(healamount * TakenTotalMod);
|
||||
return healamount < 0 ? 0 : healamount;
|
||||
}
|
||||
|
||||
|
|
@ -9912,8 +9912,8 @@ uint32 Unit::MeleeDamageBonus(Unit *pVictim, uint32 pdamage,WeaponAttackType att
|
|||
continue;
|
||||
|
||||
float mod = ((Player*)pVictim)->GetRatingBonusValue(CR_CRIT_TAKEN_MELEE)*(-8.0f);
|
||||
if (mod < (*i)->GetModifier()->m_amount)
|
||||
mod = (*i)->GetModifier()->m_amount;
|
||||
if (mod < float((*i)->GetModifier()->m_amount))
|
||||
mod = float((*i)->GetModifier()->m_amount);
|
||||
|
||||
TakenPercent *= (mod + 100.0f) / 100.0f;
|
||||
}
|
||||
|
|
@ -10084,7 +10084,8 @@ float Unit::GetWeaponProcChance() const
|
|||
float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM) const
|
||||
{
|
||||
// proc per minute chance calculation
|
||||
if (PPM <= 0.0f) return 0.0f;
|
||||
if (PPM <= 0.0f)
|
||||
return 0.0f;
|
||||
return WeaponSpeed * PPM / 600.0f; // result is chance in percents (probability = Speed_in_sec * (PPM / 60))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -545,7 +545,7 @@ int WorldSocket::handle_input_missing_data (void)
|
|||
recv_size);
|
||||
|
||||
if (n <= 0)
|
||||
return n;
|
||||
return (int)n;
|
||||
|
||||
message_block.wr_ptr (n);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9396"
|
||||
#define REVISION_NR "9397"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue