本文整理汇总了C++中SetHitDamage函数的典型用法代码示例。如果您正苦于以下问题:C++ SetHitDamage函数的具体用法?C++ SetHitDamage怎么用?C++ SetHitDamage使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetHitDamage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RecalculateDamage
void RecalculateDamage(SpellEffIndex /*effIndex*/)
{
if (GetHitUnit() && GetHitUnit()->HasAuraState(AURA_STATE_FROZEN, GetSpellInfo(), GetCaster()))
{
if (AuraEffect* aurEff = GetCaster()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_MAGE, ICON_MAGE_SHATTER, EFFECT_1))
{
int32 damage = GetHitDamage();
AddPct(damage, aurEff->GetAmount());
SetHitDamage(damage);
}
}
}
示例2: HandleDamage
void HandleDamage(SpellEffIndex /*effIndex*/)
{
if(!GetCaster() || !GetHitUnit())
return;
PreventHitDamage();
uint32 ticks = 1;
if (constAuraEffectPtr aurEff = GetCaster()->GetAuraEffect(SPELL_BLADE_DANCE_AURA_2, EFFECT_0))
ticks = std::max(aurEff->GetTickNumber(), ticks);
SetHitDamage(urand(11875, 13125) * ticks);
}
示例3: HandleDamage
void HandleDamage(SpellEffIndex /*effIndex*/)
{
int32 damage = GetEffectValue();
ApplyPct(damage, GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK));
if (Unit* target = GetHitUnit())
{
damage = GetCaster()->SpellDamageBonusDone(target, GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE);
damage = target->SpellDamageBonusTaken(GetCaster(), GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE);
}
SetHitDamage(damage);
}
示例4: CalcDamage
void CalcDamage()
{
int32 damage = GetHitDamage();
if (Unit* target = GetHitUnit())
if (AuraEffect const* shockCharges = target->GetAuraEffect(SPELL_AMBER_SHOCK_CHARGE, EFFECT_0, GetCaster()->GetGUID()))
{
damage += shockCharges->GetAmount();
shockCharges->GetBase()->Remove();
}
SetHitDamage(damage);
}
示例5: RecalculateDamage
void RecalculateDamage()
{
if (GetHitUnit()->getPowerType() != POWER_MANA)
return;
const int32 maxDamage = GetCaster()->GetMap()->GetSpawnMode() == 1 ? 15000 : 10000;
int32 newDamage = GetHitDamage();
newDamage += GetHitUnit()->GetMaxPower(POWER_MANA)/2;
newDamage = std::min<int32>(maxDamage, newDamage);
SetHitDamage(newDamage);
}
示例6: CalculateDamage
void CalculateDamage()
{
if (!GetHitUnit())
return;
float radius = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster());
if (!radius)
return;
float distance = GetCaster()->GetDistance2d(GetHitUnit());
if (distance > 1.0f)
SetHitDamage(int32(GetHitDamage() * ((radius - distance) / radius)));
}
示例7: HandleOnHit
void HandleOnHit(SpellEffIndex effIndex)
{
if (Unit* caster = GetCaster())
{
if (caster->HasAura(44544))
SetHitDamage(int32(GetHitDamage() * 1.25f));
if (GetHitUnit())
caster->SetIciclesTarget(GetHitUnit()->GetGUID());
caster->CastSpell(caster, SPELL_MAGE_ICICLE_PERIODIC_TRIGGER, true);
}
}
示例8: DealDamage
void DealDamage()
{
Unit* caster = GetCaster();
Unit* target = GetHitUnit();
if (!caster || !target)
return;
float distance = caster->GetExactDist2d(target);
if (distance >= 0 && distance <= 60)
SetHitDamage(GetHitDamage() * (distance / MAX_DIST));
}
示例9: HandleOnHit
void HandleOnHit()
{
if (Unit* caster = GetCaster())
{
int32 damage = GetHitDamage();
// Mastery: Emberstorm
if (AuraEffect* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, 2129, EFFECT_0))
AddPct(damage, aurEff->GetAmount());
SetHitDamage(damage);
}
}
示例10: HandleOnHit
void HandleOnHit()
{
if (Player* _player = GetCaster()->ToPlayer())
{
if (Unit* unitTarget = GetHitUnit())
{
if (unitTarget->IsImmunedToSpellEffect(sSpellMgr->GetSpellInfo(WARRIOR_SPELL_STORM_BOLT_STUN), 0))
SetHitDamage(GetHitDamage() * 4);
_player->CastSpell(unitTarget, WARRIOR_SPELL_STORM_BOLT_STUN, true);
}
}
}
示例11: RecalculateDamage
void RecalculateDamage(SpellEffIndex /*effIndex*/)
{
if (!GetCaster())
return;
int32 baseDamages = GetHitDamage();
int32 additionalDamages = GetCaster()->GetPower(POWER_ENERGY) * 100;
SetHitDamage(baseDamages + additionalDamages);
GetCaster()->SetPower(POWER_ENERGY, 0);
}
示例12: HandleEffect
void HandleEffect(SpellEffIndex effIndex)
{
if (Unit* caster = GetCaster())
{
if (Unit* target = GetHitUnit())
{
if (Aura* cancellingAura = target->GetAura(SPELL_NOISE_CANCELLING_BUFF))
{
float reducePct = cancellingAura->GetEffect(1)->GetBaseAmount();
SetHitDamage(GetHitDamage() * (reducePct / 100));
}
}
}
}
示例13: ChangeDamage
void ChangeDamage(SpellEffIndex /*effIndex*/)
{
int32 damage = GetHitDamage();
// Because 1 Holy Power (HP) is consumed when casting spell,
// GetPower(POWER_HOLY_POWER) will return 0 when player has 1 HP,
// return 1 at 2 HP, and 2 at 3 HP
int32 hp = GetCaster()->GetPower(POWER_HOLY_POWER);
// Holy Power Scaling: 3 times damage at 2 HP, 6 times at 3 HP
damage *= 0.5*hp*hp + 1.5*hp + 1;
SetHitDamage(damage);
}
示例14: CalculateDamage
void CalculateDamage(SpellEffIndex /*effIndex*/)
{
int32 damagePerCombo = GetHitDamage();
if (AuraEffect const* t5 = GetCaster()->GetAuraEffect(SPELL_ROGUE_T5_2P_SET_BONUS, EFFECT_0))
damagePerCombo += t5->GetAmount();
int32 finalDamage = damagePerCombo;
std::vector<SpellPowerCost> const& costs = GetSpell()->GetPowerCost();
auto c = std::find_if(costs.begin(), costs.end(), [](SpellPowerCost const& cost) { return cost.Power == POWER_COMBO_POINTS; });
if (c != costs.end())
finalDamage *= c->Amount;
SetHitDamage(finalDamage);
}
示例15: DealDamage
void DealDamage()
{
if (Unit* target = GetHitUnit())
{
if (AuraPtr aura = target->GetAura(SPELL_JASPER_CHAINS))
{
uint8 stacks = aura->GetStackAmount();
int32 damage = GetHitDamage();
if (damage && stacks)
SetHitDamage(damage * stacks);
}
}
}