本文整理汇总了C++中GetHitDamage函数的典型用法代码示例。如果您正苦于以下问题:C++ GetHitDamage函数的具体用法?C++ GetHitDamage怎么用?C++ GetHitDamage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetHitDamage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleScript
void HandleScript(SpellEffIndex /*eff*/)
{
Unit* caster = GetCaster();
if (!caster)
return;
if (GetHitDamage() >= int32(GetHitUnit()->GetHealth()))
if (caster->GetAI())
caster->GetAI()->SetData(DATA_GRAVITY_BOMB_CASUALTY, 1);
}
示例2: RecalculateDamage
void RecalculateDamage(SpellEffIndex /*effIndex*/)
{
int32 dmg = GetHitDamage();
float distance = GetHitUnit()->GetExactDist2d(GetCaster());
if (distance < 5.0f)
return;
float distVar = distance >= 20.0f ? 4 : (10.0f/3.0f);
SetHitDamage(int32(dmg * distVar / distance));
}
示例3: HandleDamage
void HandleDamage()
{
int32 damage = GetHitDamage();
// Pain and Suffering reduces damage
if (AuraEffect* aurEff = GetCaster()->GetDummyAuraEffect(SPELLFAMILY_PRIEST, PRIEST_ICON_ID_PAIN_AND_SUFFERING, EFFECT_1))
AddPct(damage, aurEff->GetAmount());
GetCaster()->CastCustomSpell(GetCaster(), SPELL_PRIEST_SHADOW_WORD_DEATH, &damage, nullptr, nullptr, true);
}
示例4: SplitDamage
void SplitDamage()
{
// Mark the unit as hit, even if the spell missed or was dodged/parried
GetCaster()->GetAI()->SetGUID(GetHitUnit()->GetGUID(), DATA_SPIKE_IMMUNE);
if (!_targetCount)
return; // This spell can miss all targets
SetHitDamage(GetHitDamage() / _targetCount);
}
示例5: HandleScript
void HandleScript(SpellEffIndex /*eff*/)
{
Unit* caster = GetCaster();
if (!caster || !GetHitUnit())
return;
if (GetHitDamage() >= int32(GetHitUnit()->GetHealth()))
if (InstanceScript* instance = caster->GetInstanceScript())
if (Creature* Heigan = ObjectAccessor::GetCreature(*caster, instance->GetGuidData(DATA_HEIGAN)))
Heigan->AI()->KilledUnit(GetHitUnit());
}
示例6: CalcDamage
void CalcDamage()
{
if (!GetHitUnit() || !GetCaster())
return;
float distance = GetHitUnit()->GetExactDist2d(GetCaster());
if (distance < 10.0f)
return;
SetHitDamage(int32(GetHitDamage() * 10 / distance));
}
示例7: CalcDamage
void CalcDamage(SpellEffIndex /*effIndex*/)
{
if (!GetHitUnit() || !GetTargetDest())
return;
float distance = GetHitUnit()->GetExactDist2d(GetTargetDest());
if (distance < 3.4f)
return;
SetHitDamage(int32(GetHitDamage() * 10.0f / pow(distance, 1.9f)));
}
示例8: HandleOnHit
void HandleOnHit()
{
int32 damage = 0;
if (Unit* target = GetHitUnit())
{
float dist = target->GetDistance(GetCaster());
damage = int32(GetHitDamage() * (70.0f - std::min(70.0f, dist)) / 70.0f);
}
SetHitDamage(damage);
}
示例9: 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);
}
}
}
示例10: CalcDamage
void CalcDamage()
{
int32 damage = GetHitDamage();
if (Unit* target = GetHitUnit())
if (Aura* aura = target->GetAura(SPELL_AMBER_SHOCK_CHARGE, GetCaster()->GetGUID())) // shock charges from same caster
{
damage += aura->GetStackAmount()*6525;
aura->Remove();
}
SetHitDamage(damage);
}
示例11: 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);
}
示例12: 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);
}
示例13: 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);
}
}
示例14: 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));
}
示例15: 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);
}
}
}