本文整理汇总了C++中UpdateArmor函数的典型用法代码示例。如果您正苦于以下问题:C++ UpdateArmor函数的具体用法?C++ UpdateArmor怎么用?C++ UpdateArmor使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UpdateArmor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTotalStatValue
bool Pet::UpdateStats(Stats stat)
{
if (stat > STAT_SPIRIT)
return false;
// value = ((base_value * base_pct) + total_value) * total_pct
float value = GetTotalStatValue(stat);
Unit* owner = GetOwner();
// chained, use original owner instead
if (owner && owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->GetEntry() == GetEntry())
{
if (Unit* creator = GetCreator())
owner = creator;
}
if (stat == STAT_STAMINA)
{
if(owner && owner->GetTypeId() == TYPEID_PLAYER && owner->getClass() == CLASS_WARLOCK)
value += float(owner->GetStat(stat)) * 0.75f;
else if (owner)
value += float(owner->GetStat(stat)) * 0.3f;
}
// warlock's and mage's pets gain 30% of owner's intellect
else if (stat == STAT_INTELLECT && getPetType() == SUMMON_PET)
{
if (owner && (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE))
value += float(owner->GetStat(stat)) * 0.3f;
}
// deathknight's ghoul gain 100% of owner's strength
else if (stat == STAT_STRENGTH && getPetType() == SUMMON_PET)
{
if (owner && (owner->getClass() == CLASS_DEATH_KNIGHT))
{
value += float(owner->GetStat(stat)) * 1.0f;
}
}
SetStat(stat, int32(value));
switch (stat)
{
case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break;
case STAT_AGILITY: UpdateArmor(); break;
case STAT_STAMINA: UpdateMaxHealth(); break;
case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); break;
case STAT_SPIRIT:
default:
break;
}
return true;
}
示例2: GetTotalStatValue
bool Player::UpdateStats(Stats stat)
{
if (stat > STAT_SPIRIT)
{ return false; }
// value = ((base_value * base_pct) + total_value) * total_pct
float value = GetTotalStatValue(stat);
SetStat(stat, int32(value));
switch (stat)
{
case STAT_STRENGTH:
break;
case STAT_AGILITY:
UpdateArmor();
UpdateAllCritPercentages();
UpdateDodgePercentage();
break;
case STAT_STAMINA: UpdateMaxHealth(); break;
case STAT_INTELLECT:
UpdateMaxPower(POWER_MANA);
UpdateAllSpellCritChances();
UpdateArmor(); // SPELL_AURA_MOD_RESISTANCE_OF_INTELLECT_PERCENT, only armor currently
break;
case STAT_SPIRIT:
break;
default:
break;
}
// Need update (exist AP from stat auras)
UpdateAttackPowerAndDamage();
UpdateAttackPowerAndDamage(true);
UpdateSpellDamageAndHealingBonus();
UpdateManaRegen();
return true;
}
示例3: GetTotalAuraModValue
void Player::UpdateResistances(uint32 school)
{
if (school > SPELL_SCHOOL_NORMAL)
{
float value = GetTotalAuraModValue(UnitMods(UNIT_MOD_RESISTANCE_START + school));
SetResistance(SpellSchools(school), int32(value));
RecalculatePetsScalingResistance(school);
}
else
UpdateArmor();
}
示例4: GetTotalAuraModValue
void Player::UpdateResistances(uint32 school)
{
if(school > SPELL_SCHOOL_NORMAL)
{
float value = GetTotalAuraModValue(UnitMods(UNIT_MOD_RESISTANCE_START + school));
SetResistance(SpellSchools(school), int32(value));
}
else
UpdateArmor();
CallForAllControlledUnits(ApplyScalingBonusWithHelper(SCALING_TARGET_RESISTANCE, school, false),CONTROLLED_PET|CONTROLLED_GUARDIANS);
}
示例5: GetTotalAuraModValue
void Player::UpdateResistances(uint32 school)
{
if (school > SPELL_SCHOOL_NORMAL)
{
float value = GetTotalAuraModValue(UnitMods(UNIT_MOD_RESISTANCE_START + school));
SetResistance(SpellSchools(school), int32(value));
Pet* pet = GetPet();
if (pet)
pet->UpdateResistances(school);
}
else
UpdateArmor();
}
示例6: GetTotalStatValue
bool Pet::UpdateStats(Stats stat)
{
if(stat > STAT_SPIRIT)
return false;
// value = ((base_value * base_pct) + total_value) * total_pct
float value = GetTotalStatValue(stat);
Unit *owner = GetOwner();
if ( stat == STAT_STAMINA )
{
if(owner)
{
float scale_coeff = 0.3f;
switch (owner->getClass())
{
case CLASS_HUNTER:
scale_coeff = 0.45f;
break;
case CLASS_WARLOCK:
scale_coeff = 0.75f;
break;
}
value += float(owner->GetStat(stat)) * scale_coeff;
}
}
//warlock's and mage's pets gain 30% of owner's intellect
else if ( stat == STAT_INTELLECT && getPetType() == SUMMON_PET )
{
if(owner && (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE) )
value += float(owner->GetStat(stat)) * 0.3f;
}
SetStat(stat, int32(value));
switch(stat)
{
case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break;
case STAT_AGILITY: UpdateArmor(); break;
case STAT_STAMINA: UpdateMaxHealth(); break;
case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); break;
case STAT_SPIRIT:
default:
break;
}
return true;
}
示例7: GetTotalAuraModValue
void Guardian::UpdateResistances(uint32 school)
{
if (school > SPELL_SCHOOL_NORMAL)
{
float value = GetTotalAuraModValue(UnitMods(UNIT_MOD_RESISTANCE_START + school));
if (isPet())
value += float(CalculatePct(m_owner->GetResistance(SpellSchools(school)), 40));
if (m_owner->HasAura(37386, 0)) // Void Star Talisman
value += 130;
SetResistance(SpellSchools(school), int32(value));
}
else
UpdateArmor();
}
示例8: GetTotalStatValue
bool Pet::UpdateStats(Stats stat)
{
if(stat > STAT_SPIRIT)
return false;
// value = ((base_value * base_pct) + total_value) * total_pct
float value = GetTotalStatValue(stat);
Unit *owner = GetOwner();
if (owner)
{
switch(stat)
{
case STAT_STAMINA:
// warlock's pets gain 75% of owner's stamina
if (getPetType() == SUMMON_PET && owner->getClass() == CLASS_WARLOCK)
value += owner->GetStat(stat) * 0.75f;
else
{
if (getPetType() == SUMMON_PET || getPetType() == HUNTER_PET || owner->getClass() == CLASS_DEATH_KNIGHT)
value += owner->GetStat(stat) * 0.3f;
}
break;
case STAT_INTELLECT:
// warlock's and mage's pets gain 30% of owner's intellect
if (getPetType() == SUMMON_PET && (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE))
value += owner->GetStat(stat) * 0.3f;
break;
};
}
SetStat(stat, int32(value));
switch(stat)
{
case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break;
case STAT_AGILITY: UpdateArmor(); break;
case STAT_STAMINA: UpdateMaxHealth(); break;
case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); break;
case STAT_SPIRIT:
default:
break;
}
return true;
}
示例9: GetTotalStatValue
bool Player::UpdateAllStats()
{
for (int i = STAT_STRENGTH; i < MAX_STATS; ++i)
{
float value = GetTotalStatValue(Stats(i));
SetStat(Stats(i), (int32)value);
}
UpdateArmor();
// calls UpdateAttackPowerAndDamage() in UpdateArmor for SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR
UpdateAttackPowerAndDamage(true);
UpdateMaxHealth();
for (uint32 i = 0; i <= sChrPowerTypesStore.GetNumRows(); i++)
{
ChrPowerTypesEntry const* cEntry = sChrPowerTypesStore.LookupEntry(i);
if (!cEntry)
continue;
if (getClass() != cEntry->classId)
continue;
if (cEntry->power == 10)
continue;
SetMaxPower(Powers(cEntry->power), uint32(GetCreatePowers(Powers(cEntry->power))));
}
UpdateAllRatings();
UpdateAllCritPercentages();
UpdateAllSpellCritChances();
UpdateDefenseBonusesMod();
UpdateShieldBlockValue();
UpdateArmorPenetration();
UpdateSpellDamageAndHealingBonus();
UpdateManaRegen();
UpdateExpertise(BASE_ATTACK);
UpdateExpertise(OFF_ATTACK);
for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
UpdateResistances(i);
return true;
}
示例10: GetTotalStatValue
bool Guardian::UpdateStats(Stats stat)
{
if (stat > STAT_SPIRIT)
return false;
// value = ((base_value * base_pct) + total_value) * total_pct
float value = GetTotalStatValue(stat);
Unit* owner = GetOwner();
if (stat == STAT_STAMINA)
{
if (owner && (IsHunterPet() || owner->getClass() == CLASS_WARLOCK))
value += float(owner->GetStat(stat)) * 0.3f;
}
//warlock's and mage's pets gain 30% of owner's intellect
else if (stat == STAT_INTELLECT && IsPet())
{
if (owner && (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE))
value += float(owner->GetStat(stat)) * 0.3f;
}
SetStat(stat, int32(value));
switch (stat)
{
case STAT_STRENGTH:
UpdateAttackPowerAndDamage();
break;
case STAT_AGILITY:
UpdateArmor();
break;
case STAT_STAMINA:
UpdateMaxHealth();
break;
case STAT_INTELLECT:
UpdateMaxPower(POWER_MANA);
break;
case STAT_SPIRIT:
default:
break;
}
return true;
}
示例11: GetTotalStatValue
bool Guardian::UpdateStats(Stats stat)
{
if (stat >= MAX_STATS)
return false;
float value = GetTotalStatValue(stat);
SetStat(stat, int32(value));
switch (stat)
{
case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break;
case STAT_AGILITY: UpdateArmor(); break;
case STAT_STAMINA: UpdateMaxHealth(); break;
case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); break;
//case STAT_SPIRIT:
}
return true;
}
示例12: GetTotalAuraModValue
void Pet::UpdateResistances(uint32 school)
{
if (school > SPELL_SCHOOL_NORMAL)
{
float value = GetTotalAuraModValue(UnitMods(UNIT_MOD_RESISTANCE_START + school));
Unit *owner = GetOwner();
// chained, use original owner instead
if (owner && owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->GetEntry() == GetEntry())
if (Unit *creator = GetCreator())
owner = creator;
// hunter and warlock pets gain 40% of owner's resistance
if (owner && (getPetType() == HUNTER_PET || (getPetType() == SUMMON_PET && owner->getClass() == CLASS_WARLOCK)))
value += float(owner->GetResistance(SpellSchools(school))) * 0.4f;
SetResistance(SpellSchools(school), int32(value));
}
else
UpdateArmor();
}
示例13: 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();
}
示例14: GetTotalStatValue
bool Player::UpdateAllStats()
{
for (int8 i = STAT_STRENGTH; i < MAX_STATS; ++i)
{
float value = GetTotalStatValue(Stats(i));
SetStat(Stats(i), int32(value));
}
UpdateArmor();
// calls UpdateAttackPowerAndDamage() in UpdateArmor for SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR
UpdateAttackPowerAndDamage(true);
UpdateMaxHealth();
for (uint8 i = POWER_MANA; i < MAX_POWERS; ++i)
UpdateMaxPower(Powers(i));
UpdateAllRatings();
UpdateAllCritPercentages();
UpdateAllSpellCritChances();
UpdateBlockPercentage();
UpdateShieldBlockValue();
UpdateParryPercentage();
UpdateDodgePercentage();
UpdateSpellDamageAndHealingBonus();
UpdateManaRegen();
UpdateFocusRegen();
UpdateEnergyRegen();
UpdateExpertise(BASE_ATTACK);
UpdateExpertise(OFF_ATTACK);
UpdateMastery();
RecalculateRating(CR_ARMOR_PENETRATION);
for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
UpdateResistances(i);
if (getClass() == CLASS_DEATH_KNIGHT)
UpdateAllRunesRegen();
return true;
}
示例15: GetTotalStatValue
bool Guardian::UpdateStats(Stats stat)
{
if (stat >= MAX_STATS)
return false;
// value = ((base_value * base_pct) + total_value) * total_pct
float value = GetTotalStatValue(stat);
ApplyStatBuffMod(stat, m_statFromOwner[stat], false);
float ownersBonus = 0.0f;
Unit* owner = GetOwner();
// Handle Death Knight Glyphs and Talents
float mod = 0.75f;
if (IsPetGhoul() && (stat == STAT_STAMINA || stat == STAT_STRENGTH))
{
if (stat == STAT_STAMINA)
mod = 0.3f; // Default Owner's Stamina scale
else
mod = 0.7f; // Default Owner's Strength scale
// Check just if owner has Ravenous Dead since it's effect is not an aura
AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0);
if (aurEff)
{
SpellInfo const* spellInfo = aurEff->GetSpellInfo(); // Then get the SpellProto and add the dummy effect value
AddPct(mod, spellInfo->Effects[EFFECT_1].CalcValue(owner)); // Ravenous Dead edits the original scale
}
// Glyph of the Ghoul
aurEff = owner->GetAuraEffect(58686, 0);
if (aurEff)
mod += CalculatePct(1.0f, aurEff->GetAmount()); // Glyph of the Ghoul adds a flat value to the scale mod
ownersBonus = float(owner->GetStat(stat)) * mod;
value += ownersBonus;
}
else if (stat == STAT_STAMINA)
{
ownersBonus = CalculatePct(owner->GetStat(STAT_STAMINA), 30);
value += ownersBonus;
}
//warlock's and mage's pets gain 30% of owner's intellect
else if (stat == STAT_INTELLECT)
{
if (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE)
{
ownersBonus = CalculatePct(owner->GetStat(stat), 30);
value += ownersBonus;
}
}
/*
else if (stat == STAT_STRENGTH)
{
if (IsPetGhoul())
value += float(owner->GetStat(stat)) * 0.3f;
}
*/
SetStat(stat, int32(value));
m_statFromOwner[stat] = ownersBonus;
ApplyStatBuffMod(stat, m_statFromOwner[stat], true);
switch (stat)
{
case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break;
case STAT_AGILITY: UpdateArmor(); break;
case STAT_STAMINA: UpdateMaxHealth(); break;
case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); break;
case STAT_SPIRIT:
default:
break;
}
return true;
}