Ejemplo n.º 1
0
int32 Client::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target) {

    if (target == nullptr)
        return value;

    int32 value_BaseEffect = 0;
    int32 extra_dmg = 0;
    int16 chance = 0;
    chance += itembonuses.CriticalDoTChance + spellbonuses.CriticalDoTChance + aabonuses.CriticalDoTChance;

    if (spellbonuses.CriticalDotDecay)
        chance += GetDecayEffectValue(spell_id, SE_CriticalDotDecay);

    value_BaseEffect = value + (value*GetFocusEffect(focusFcBaseEffects, spell_id)/100);

    if (chance > 0 && (zone->random.Roll(chance))) {
        int32 ratio = 200;
        ratio += itembonuses.DotCritDmgIncrease + spellbonuses.DotCritDmgIncrease + aabonuses.DotCritDmgIncrease;
        value = value_BaseEffect*ratio/100;
        value += int(value_BaseEffect*GetFocusEffect(focusImprovedDamage, spell_id)/100)*ratio/100;
        value += int(value_BaseEffect*GetFocusEffect(focusFcDamagePctCrit, spell_id)/100)*ratio/100;
        value += int(value_BaseEffect*target->GetVulnerability(this, spell_id, 0)/100)*ratio/100;
        extra_dmg = target->GetFcDamageAmtIncoming(this, spell_id) +
                    int(GetFocusEffect(focusFcDamageAmtCrit, spell_id)*ratio/100) +
                    GetFocusEffect(focusFcDamageAmt, spell_id);

        if (extra_dmg) {
            int duration = CalcBuffDuration(this, this, spell_id);
            if (duration > 0)
                extra_dmg /= duration;
        }

        value -= extra_dmg;

        return value;
    }

    value = value_BaseEffect;
    value += value_BaseEffect*GetFocusEffect(focusImprovedDamage, spell_id)/100;
    value += value_BaseEffect*GetFocusEffect(focusFcDamagePctCrit, spell_id)/100;
    value += value_BaseEffect*target->GetVulnerability(this, spell_id, 0)/100;
    extra_dmg = target->GetFcDamageAmtIncoming(this, spell_id) +
                GetFocusEffect(focusFcDamageAmtCrit, spell_id) +
                GetFocusEffect(focusFcDamageAmt, spell_id);

    if (extra_dmg) {
        int duration = CalcBuffDuration(this, this, spell_id);
        if (duration > 0)
            extra_dmg /= duration;
    }

    value -= extra_dmg;

    return value;
}
Ejemplo n.º 2
0
int32 Client::Additional_Heal(uint16 spell_id)
{
    int32 heal_amt = 0;

    heal_amt  += GetFocusEffect(focusAdditionalHeal, spell_id);
    heal_amt  += GetFocusEffect(focusAdditionalHeal2, spell_id);

    if (heal_amt) {
        int duration = CalcBuffDuration(this, this, spell_id);
        if (duration > 0)
            return heal_amt /= duration;
    }

    return heal_amt;
}
Ejemplo n.º 3
0
int32 Client::Additional_SpellDmg(uint16 spell_id, bool bufftick)
{
    int32 spell_dmg = 0;
    spell_dmg  += GetFocusEffect(focusFF_Damage_Amount, spell_id);
    spell_dmg  += GetFocusEffect(focusSpellDamage, spell_id);

    //For DOTs you need to apply the damage over the duration of the dot to each tick (this is how live did it)
    if (bufftick) {
        int duration = CalcBuffDuration(this, this, spell_id);
        if (duration > 0)
            return spell_dmg /= duration;
        else
            return 0;
    }
    return spell_dmg;
}