本文整理汇总了C++中UpdateDodgePercentage函数的典型用法代码示例。如果您正苦于以下问题:C++ UpdateDodgePercentage函数的具体用法?C++ UpdateDodgePercentage怎么用?C++ UpdateDodgePercentage使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UpdateDodgePercentage函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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));
if (stat == STAT_STAMINA || stat == STAT_INTELLECT)
{
Pet* pet = GetPet();
if (pet)
pet->UpdateStats(stat);
}
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();
// Update ratings in exist SPELL_AURA_MOD_RATING_FROM_STAT and only depends from stat
uint32 mask = 0;
AuraList const& modRatingFromStat = GetAurasByType(SPELL_AURA_MOD_RATING_FROM_STAT);
for (AuraList::const_iterator i = modRatingFromStat.begin(); i != modRatingFromStat.end(); ++i)
if (Stats((*i)->GetMiscBValue()) == stat)
mask |= (*i)->GetMiscValue();
if (mask)
{
for (uint32 rating = 0; rating < MAX_COMBAT_RATING; ++rating)
if (mask & (1 << rating))
ApplyRatingMod(CombatRating(rating), 0, true);
}
return true;
}
示例2: 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();
UpdateParryPercentage();
UpdateDodgePercentage();
UpdateSpellDamageAndHealingBonus();
UpdateManaRegen();
UpdateExpertise(BASE_ATTACK);
UpdateExpertise(OFF_ATTACK);
RecalculateRating(CR_ARMOR_PENETRATION);
for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
UpdateResistances(i);
return true;
}
示例3: 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));
if (stat == STAT_STAMINA || stat == STAT_INTELLECT)
{
Pet* pet = GetPet();
if (pet)
pet->UpdateStats(stat);
}
switch (stat)
{
case STAT_STRENGTH:
UpdateAttackPowerAndDamage();
UpdateShieldBlockValue();
break;
case STAT_AGILITY:
UpdateArmor();
UpdateAttackPowerAndDamage(true);
if (getClass() == CLASS_ROGUE || getClass() == CLASS_HUNTER || (getClass() == CLASS_DRUID && m_form == FORM_CAT))
UpdateAttackPowerAndDamage();
UpdateAllCritPercentages();
UpdateDodgePercentage();
break;
case STAT_STAMINA:
UpdateMaxHealth();
break;
case STAT_INTELLECT:
UpdateMaxPower(POWER_MANA);
UpdateAllSpellCritChances();
UpdateAttackPowerAndDamage(true); //SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT, only intellect currently
UpdateArmor(); //SPELL_AURA_MOD_RESISTANCE_OF_INTELLECT_PERCENT, only armor currently
break;
case STAT_SPIRIT:
break;
default:
break;
}
UpdateSpellDamageAndHealingBonus();
UpdateManaRegen();
return true;
}
示例4: 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));
if (stat == STAT_STAMINA || stat == STAT_INTELLECT)
{
Pet* pet = GetPet();
if (pet)
pet->UpdateStats(stat);
}
switch (stat)
{
case STAT_STRENGTH:
UpdateShieldBlockValue();
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;
}
示例5: UpdateBlockPercentage
void Player::UpdateDefenseBonusesMod()
{
UpdateBlockPercentage();
UpdateParryPercentage();
UpdateDodgePercentage();
}
示例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;
}