本文整理汇总了C++中GetRatingBonusValue函数的典型用法代码示例。如果您正苦于以下问题:C++ GetRatingBonusValue函数的具体用法?C++ GetRatingBonusValue怎么用?C++ GetRatingBonusValue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetRatingBonusValue函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTotalAuraModifier
void Player::UpdateBlockPercentage()
{
// No block
float value = 0.0f;
if (CanBlock())
{
// Base value
value = 5.0f;
// Increase from SPELL_AURA_MOD_BLOCK_PERCENT aura
value += GetTotalAuraModifier(SPELL_AURA_MOD_BLOCK_PERCENT);
// Increase from rating
value += GetRatingBonusValue(CR_BLOCK);
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_BLOCK) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_BLOCK) : value;
value = value < 0.0f ? 0.0f : value;
}
SetStatFloatValue(PLAYER_BLOCK_PERCENTAGE, value);
}
示例2: GetTotalAuraModifier
void Player::UpdateMasteryPercentage()
{
// No mastery
float value = 0.0f;
if (CanMastery() && getLevel() >= 80)
{
// Mastery from SPELL_AURA_MASTERY aura
value += GetTotalAuraModifier(SPELL_AURA_MASTERY);
// Mastery from rating
value += GetRatingBonusValue(CR_MASTERY);
value = value < 0.0f ? 0.0f : value;
}
SetFloatValue(PLAYER_MASTERY, value);
// Custom MoP Script
// 76671 - Mastery : Divine Bulwark - Update Block Percentage
// 76857 - Mastery : Critical Block - Update Block Percentage
if (HasAura(76671) || HasAura(76857))
UpdateBlockPercentage();
// 77494 - Mastery : Nature's Guardian - Update Armor
if (HasAura(77494))
UpdateArmor();
}
示例3: SetFloatValue
void Player::UpdateSpellCritChance(uint32 school)
{
// For normal school set zero crit chance
if (school == SPELL_SCHOOL_NORMAL)
{
SetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1, 0.0f);
return;
}
// For others recalculate it from:
float crit = 0.0f;
// Crit from Intellect
crit += GetSpellCritFromIntellect();
// Increase crit from SPELL_AURA_MOD_SPELL_CRIT_CHANCE
crit += GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE);
// Increase crit by school from SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL
crit += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL, 1<<school);
// Increase crit from spell crit ratings
crit += GetRatingBonusValue(CR_CRIT_SPELL);
// Store crit value
SetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1 + school, crit);
}
示例4: getClass
void Player::UpdateParryPercentage()
{
const float parry_cap[MAX_CLASSES] =
{
65.631440f, // Warrior
65.631440f, // Paladin
145.560408f, // Hunter
145.560408f, // Rogue
0.0f, // Priest
65.631440f, // DK
145.560408f, // Shaman
0.0f, // Mage
0.0f, // Warlock
90.6425f, // Monk
0.0f, // Druid
65.631440f // Demon Hunter
};
// No parry
float value = 0.0f;
uint32 pclass = getClass()-1;
if (CanParry() && parry_cap[pclass] > 0.0f)
{
float nondiminishing = 5.0f;
// Parry from rating
float diminishing = GetRatingBonusValue(CR_PARRY);
// Parry from SPELL_AURA_MOD_PARRY_PERCENT aura
nondiminishing += GetTotalAuraModifier(SPELL_AURA_MOD_PARRY_PERCENT);
// apply diminishing formula to diminishing parry chance
value = nondiminishing + diminishing * parry_cap[pclass] / (diminishing + parry_cap[pclass] * m_diminishing_k[pclass]);
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_PARRY) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_PARRY) : value;
value = value < 0.0f ? 0.0f : value;
}
SetStatFloatValue(PLAYER_PARRY_PERCENTAGE, value);
}
示例5: SetFloatValue
void Player::UpdateMastery()
{
if (!IsMasteryLearned())
{
SetFloatValue(PLAYER_MASTERY, 0.0f);
return;
}
TalentTabEntry const* talentTab = sTalentTabStore.LookupEntry(GetPrimaryTalentTree(GetActiveSpec()));
if (!talentTab)
{
SetFloatValue(PLAYER_MASTERY, 0.0f);
return;
}
float value = GetTotalAuraModifier(SPELL_AURA_MASTERY);
value += GetRatingBonusValue(CR_MASTERY);
SetFloatValue(PLAYER_MASTERY, value);
for (uint32 i = 0; i < MAX_MASTERY_SPELLS; ++i)
{
if (!talentTab->MasterySpells[i])
continue;
if (Aura* aura = GetAura(talentTab->MasterySpells[i]))
{
for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
{
if (!aura->HasEffect(j))
continue;
if (aura->GetSpellInfo()->Effects[j].BasePoints == 0)
aura->GetEffect(j)->ChangeAmount(int32(value * aura->GetSpellInfo()->Effects[j].BonusMultiplier));
}
}
}
}
示例6: SetFloatValue
void Player::UpdateMastery()
{
if (!CanUseMastery())
{
SetFloatValue(PLAYER_MASTERY, 0.0f);
return;
}
float value = GetTotalAuraModifier(SPELL_AURA_MASTERY);
value += GetRatingBonusValue(CR_MASTERY);
SetFloatValue(PLAYER_MASTERY, value);
ChrSpecializationEntry const* chrSpec = sChrSpecializationStore.LookupEntry(GetActiveTalentSpec());
if (!chrSpec)
return;
for (uint32 i = 0; i < MAX_MASTERY_SPELLS; ++i)
{
if (!chrSpec->MasterySpellID[i])
continue;
if (Aura* aura = GetAura(chrSpec->MasterySpellID[i]))
{
for (SpellEffectInfo const* effect : aura->GetSpellEffectInfos())
{
if (!effect)
continue;
float mult = effect->BonusCoefficient;
if (G3D::fuzzyEq(mult, 0.0f))
continue;
aura->GetEffect(effect->EffectIndex)->ChangeAmount(int32(value * effect->BonusCoefficient));
}
}
}
}
示例7: getClass
void Player::UpdateParryPercentage()
{
const float parry_cap[MAX_CLASSES] =
{
65.631440f, // Warrior
65.631440f, // Paladin
145.560408f, // Hunter
145.560408f, // Rogue
0.0f, // Priest
65.631440f, // DK
145.560408f, // Shaman
0.0f, // Mage
0.0f, // Warlock
0.0f, // ??
0.0f // Druid
};
// No parry
float value = 0.0f;
uint32 pclass = getClass() - 1;
if (CanParry() && parry_cap[pclass] > 0.0f)
{
// Base parry
float nondiminishing = 5.0f;
float diminishing = 0.0f;
GetParryFromStrength(diminishing, nondiminishing);
// Parry from rating
diminishing += GetRatingBonusValue(CR_PARRY);
// Parry from SPELL_AURA_MOD_PARRY_PERCENT aura
nondiminishing += GetTotalAuraModifier(SPELL_AURA_MOD_PARRY_PERCENT);
// apply diminishing formula to diminishing parry chance
value = nondiminishing + diminishing * parry_cap[pclass] /
(diminishing + parry_cap[pclass] * m_diminishing_k[pclass]);
value = value < 0.0f ? 0.0f : value;
}
SetStatFloatValue(PLAYER_PARRY_PERCENTAGE, value);
}
示例8: SetFloatValue
void Player::UpdateMastery()
{
if (!CanUseMastery())
{
SetFloatValue(PLAYER_FIELD_MASTERY, 0.0f);
return;
}
float value = GetTotalAuraModifier(SPELL_AURA_MASTERY);
value += GetRatingBonusValue(CR_MASTERY);
SetFloatValue(PLAYER_FIELD_MASTERY, value);
/*
TalentTabEntry const* talentTab = sTalentTabStore.LookupEntry(GetTalentSpecialization(GetActiveSpec()));
if (!talentTab)
return;
for (uint32 i = 0; i < MAX_MASTERY_SPELLS; ++i)
{
if (!talentTab->MasterySpellId[i])
continue;
if (Aura* aura = GetAura(talentTab->MasterySpellId[i]))
{
for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
{
if (!aura->HasEffect(j))
continue;
float mult = aura->GetSpellInfo()->Effects[j].BonusMultiplier;
if (G3D::fuzzyEq(mult, 0.0f))
continue;
aura->GetEffect(j)->ChangeAmount(int32(value * aura->GetSpellInfo()->Effects[j].BonusMultiplier));
}
}
}*/
}
示例9: switch
void Player::UpdateCritPercentage(WeaponAttackType attType)
{
BaseModGroup modGroup;
uint16 index;
CombatRating cr;
switch (attType)
{
case OFF_ATTACK:
modGroup = OFFHAND_CRIT_PERCENTAGE;
index = PLAYER_FIELD_OFFHAND_CRIT_PERCENTAGE;
cr = CR_CRIT_MELEE;
break;
case RANGED_ATTACK:
modGroup = RANGED_CRIT_PERCENTAGE;
index = PLAYER_FIELD_RANGED_CRIT_PERCENTAGE;
cr = CR_CRIT_RANGED;
break;
case BASE_ATTACK:
default:
modGroup = CRIT_PERCENTAGE;
index = PLAYER_FIELD_CRIT_PERCENTAGE;
cr = CR_CRIT_MELEE;
break;
}
float value = GetTotalPercentageModValue(modGroup) + GetRatingBonusValue(cr);
// Modify crit from weapon skill and maximized defense skill of same level victim difference
value += (int32(GetMaxSkillValueForLevel()) - int32(GetMaxSkillValueForLevel())) * 0.04f;
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_CRIT) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_CRIT) : value;
value = value < 0.0f ? 0.0f : value;
SetStatFloatValue(index, value);
}
示例10: GetRatingBonusValue
void Player::UpdateSpellHitChances()
{
m_modSpellHitChance = (float)GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_HIT_CHANCE);
m_modSpellHitChance += GetRatingBonusValue(CR_HIT_SPELL);
}
示例11: getClass
void Player::UpdateDodgePercentage()
{
// Table for base dodge values
const int dodge_base[MAX_CLASSES] =
{
3, // Warrior
3, // Paladin
3, // Hunter
3, // Rogue
3, // Priest
5, // DK
3, // Shaman
3, // Mage
3, // Warlock
3, // Monk
5 // Druid
};
// Table for dodge cap values
const float dodge_cap[MAX_CLASSES] =
{
90.6425f, // Warrior
66.567f, // Paladin
145.560408f, // Hunter
145.560408f, // Rogue
150.375940f, // Priest
90.6426f, // DK
66.567f, // Shaman
150.375940f, // Mage
150.375940f, // Warlock
501.253f, // Monk
150.375940f // Druid
};
float diminishing = 0.0f, nondiminishing = 0.0f;
uint32 pclass = getClass() - 1;
// Warriors, Death Knights and Paladins no longer gain dodge from agility
if (getClass() != CLASS_WARRIOR && getClass() != CLASS_DEATH_KNIGHT && getClass() != CLASS_PALADIN)
{
// TODO: research if talents/effects that increase total agility by x% should increase non-diminishing part
float base_agility = GetCreateStat(STAT_AGILITY) * m_auraModifiersGroup[UNIT_MOD_STAT_START + STAT_AGILITY][BASE_PCT];
float bonus_agility = GetTotalStatValue(STAT_AGILITY) - base_agility;
float perc_cap = sObjectMgr->GetDodgeCapForClassLevel(pclass * GT_MAX_LEVEL + getLevel() - 1);
// calculate diminishing (green in char screen) and non-diminishing (white) contribution
diminishing = (bonus_agility / perc_cap) / ((bonus_agility / perc_cap) / dodge_cap[pclass] + m_diminishing_k[pclass]);
nondiminishing = dodge_base[pclass] + base_agility / perc_cap;
}
else
nondiminishing = dodge_base[pclass];
// Dodge from SPELL_AURA_MOD_DODGE_PERCENT aura
nondiminishing += GetTotalAuraModifier(SPELL_AURA_MOD_DODGE_PERCENT);
// Dodge from rating
diminishing += GetRatingBonusValue(CR_DODGE);
// apply diminishing formula to diminishing dodge chance
float value = nondiminishing + diminishing;
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) : value;
value = value < 0.0f ? 0.0f : value;
SetStatFloatValue(PLAYER_DODGE_PERCENTAGE, value);
}
示例12: GetRatingBonusValue
void Player::UpdateArmorPenetration()
{
m_armorPenetrationPct = GetRatingBonusValue(CR_ARMOR_PENETRATION);
}
示例13: GetRatingBonusValue
void Player::UpdateRangedHitChances()
{
m_modRangedHitChance = (float)GetTotalAuraModifier(SPELL_AURA_MOD_HIT_CHANCE);
m_modRangedHitChance += GetRatingBonusValue(CR_HIT_RANGED);
SetFloatValue(PLAYER_FIELD_UI_HIT_MODIFIER, (float)GetTotalAuraModifier(SPELL_AURA_MOD_HIT_CHANCE));
}