本文整理汇总了C++中UpdateResistances函数的典型用法代码示例。如果您正苦于以下问题:C++ UpdateResistances函数的具体用法?C++ UpdateResistances怎么用?C++ UpdateResistances使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UpdateResistances函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateMaxHealth
bool Creature::UpdateAllStats()
{
UpdateMaxHealth();
UpdateAttackPowerAndDamage();
for (int i = POWER_MANA; i < MAX_POWERS; ++i)
UpdateMaxPower(Powers(i));
for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
UpdateResistances(i);
return true;
}
示例2: UpdateStats
bool Pet::UpdateAllStats()
{
for (int i = STAT_STRENGTH; i < MAX_STATS; ++i)
UpdateStats(Stats(i));
for(int i = POWER_MANA; i < MAX_POWERS; ++i)
UpdateMaxPower(Powers(i));
for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
UpdateResistances(i);
UpdateAttackPowerAndDamage();
UpdateAttackPowerAndDamage(true);
UpdateManaRegen();
UpdateSpellPower();
return true;
}
示例3: 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;
}
示例4: 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;
}
示例5: UpdateResistances
void Unit::UpdateAllResistances()
{
for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
UpdateResistances(i);
}
示例6: GetTotalStatValue
//.........这里部分代码省略.........
if (mainItem && mainItem->GetTemplate()->Class == ITEM_CLASS_WEAPON && !HasAura(125660))
{
RemoveAura(108561); // 2H Staff Override
RemoveAura(115697); // 2H Polearm Override
RemoveAura(115689); // D/W Axes
RemoveAura(115694); // D/W Maces
RemoveAura(115696); // D/W Swords
switch (mainItem->GetTemplate()->SubClass)
{
case ITEM_SUBCLASS_WEAPON_STAFF:
CastSpell(this, 108561, true);
break;
case ITEM_SUBCLASS_WEAPON_POLEARM:
CastSpell(this, 115697, true);
break;
case ITEM_SUBCLASS_WEAPON_AXE:
CastSpell(this, 115689, true);
break;
case ITEM_SUBCLASS_WEAPON_MACE:
CastSpell(this, 115694, true);
break;
case ITEM_SUBCLASS_WEAPON_SWORD:
CastSpell(this, 115696, true);
break;
default:
break;
}
}
else if (HasAura(125660))
{
RemoveAura(108561); // 2H Staff Override
RemoveAura(115697); // 2H Polearm Override
RemoveAura(115689); // D/W Axes
RemoveAura(115694); // D/W Maces
RemoveAura(115696); // D/W Swords
}
}
// Way of the Monk - 120277
if (GetTypeId() == TYPEID_PLAYER)
{
if (getClass() == CLASS_MONK && HasAura(120277))
{
RemoveAurasDueToSpell(120275);
RemoveAurasDueToSpell(108977);
uint32 trigger = 0;
if (IsTwoHandUsed())
{
trigger = 120275;
}
else
{
Item* mainItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
Item* offItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
if (mainItem && mainItem->GetTemplate()->Class == ITEM_CLASS_WEAPON && offItem && offItem->GetTemplate()->Class == ITEM_CLASS_WEAPON)
trigger = 108977;
}
if (trigger)
CastSpell(this, trigger, true);
}
}
// Assassin's Resolve - 84601
if (GetTypeId() == TYPEID_PLAYER)
{
if (getClass() == CLASS_ROGUE && ToPlayer()->GetSpecializationId(ToPlayer()->GetActiveSpec()) == SPEC_ROGUE_ASSASSINATION)
{
Item* mainItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
Item* offItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
if (((mainItem && mainItem->GetTemplate()->SubClass == ITEM_SUBCLASS_WEAPON_DAGGER) || (offItem && offItem->GetTemplate()->SubClass == ITEM_SUBCLASS_WEAPON_DAGGER)))
{
if (HasAura(84601))
RemoveAura(84601);
CastSpell(this, 84601, true);
}
else
RemoveAura(84601);
}
}
UpdateAllRatings();
UpdateAllCritPercentages();
UpdateAllSpellCritChances();
UpdateBlockPercentage();
UpdateParryPercentage();
UpdateDodgePercentage();
UpdateSpellDamageAndHealingBonus();
UpdateManaRegen();
UpdateExpertise(BASE_ATTACK);
UpdateExpertise(OFF_ATTACK);
UpdateExpertise(RANGED_ATTACK);
for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
UpdateResistances(i);
return true;
}
示例7: 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));
// Custom MoP script
// Jab Override Driver
if (GetTypeId() == TYPEID_PLAYER && getClass() == CLASS_MONK)
{
Item* mainItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
if (mainItem && mainItem->GetTemplate()->Class == ITEM_CLASS_WEAPON && !HasAura(125660))
{
RemoveAura(108561); // 2H Staff Override
RemoveAura(115697); // 2H Polearm Override
RemoveAura(115689); // D/W Axes
RemoveAura(115694); // D/W Maces
RemoveAura(115696); // D/W Swords
switch (mainItem->GetTemplate()->SubClass)
{
case ITEM_SUBCLASS_WEAPON_STAFF:
CastSpell(this, 108561, true);
break;
case ITEM_SUBCLASS_WEAPON_POLEARM:
CastSpell(this, 115697, true);
break;
case ITEM_SUBCLASS_WEAPON_AXE:
CastSpell(this, 115689, true);
break;
case ITEM_SUBCLASS_WEAPON_MACE:
CastSpell(this, 115694, true);
break;
case ITEM_SUBCLASS_WEAPON_SWORD:
CastSpell(this, 115696, true);
break;
default:
break;
}
}
else if (HasAura(125660))
{
RemoveAura(108561); // 2H Staff Override
RemoveAura(115697); // 2H Polearm Override
RemoveAura(115689); // D/W Axes
RemoveAura(115694); // D/W Maces
RemoveAura(115696); // D/W Swords
}
}
UpdateAllRatings();
UpdateAllCritPercentages();
UpdateAllSpellCritChances();
UpdateBlockPercentage();
UpdateParryPercentage();
UpdateDodgePercentage();
UpdateSpellDamageAndHealingBonus();
UpdateManaRegen();
UpdateExpertise(BASE_ATTACK);
UpdateExpertise(OFF_ATTACK);
UpdateExpertise(RANGED_ATTACK);
for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
UpdateResistances(i);
return true;
}