EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Windows Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=587)
-   -   Making item bonus spell dmg apply to Dots (https://www.eqemulator.org/forums/showthread.php?t=40371)

mpeels 02-01-2016 12:01 AM

Making item bonus spell dmg apply to Dots
 
I have been making some changes to a server of my own recently and one change that I have been wanting to make is to get extra spell damage on items to apply to damage over time spells. I have been making changes to the effects.cpp to no avail. I know it has to be simple but I'm new at this. Plzz help

Thank you all

Kingly_Krab 02-01-2016 12:21 AM

Have you tried modifying Mob::GetActDoTDamage's calculations?

Kayen 02-01-2016 01:14 AM

Replace GetActDoTDamage function with the one below...

Code:

int32 Mob::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target) {

        if (target == nullptr)
                return value;

        if (IsNPC())
                value += value*CastToNPC()->GetSpellFocusDMG()/100;

        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);

        if (spells[spell_id].override_crit_chance > 0 && chance > spells[spell_id].override_crit_chance)
                chance = spells[spell_id].override_crit_chance;

        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(focusImprovedDamage2, 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) +
                                        GetFocusEffect(focusFcDamageAmt2, spell_id);
                                       
                if(!spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
                                extra_dmg += GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value)*ratio/100;       

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

                value -= extra_dmg;
        }
        else {

                value = value_BaseEffect;
                value += value_BaseEffect*GetFocusEffect(focusImprovedDamage, spell_id)/100;
                value += value_BaseEffect*GetFocusEffect(focusImprovedDamage2, 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) +
                                        GetFocusEffect(focusFcDamageAmt2, spell_id);
                                       
                if(!spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
                                extra_dmg += GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value);                       

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

                value -= extra_dmg;
        }

        if (IsNPC() && CastToNPC()->GetSpellScale())
                value = int(static_cast<float>(value) * CastToNPC()->GetSpellScale() / 100.0f);

        return value;
}


mpeels 02-01-2016 02:14 AM

Thank you very much! After i see how simple it was i'm not sure why I couldn't get it.


All times are GMT -4. The time now is 02:44 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.