I need some help with Damage over time

I’m having a weird thing happen with spells that do damage over time.

The first attack does like 260 damage and every bit of damage over time after that does 3100.

Here’s my damage over time code.

Public Sub HandleDoT_Npc(ByVal mapnum As Long, ByVal index As Long, ByVal dotNum As Long)
    With MapNpc(mapnum).Npc(index).DoT(dotNum)
        If .Used And .Spell > 0 Then
            ' time to tick?
            If GetTick > .Timer + (Spell(.Spell).Interval * 1000) Then
                If CanPlayerAttackNpc(.Caster, index, True) Then

                Dim Vital As Long
                Dim Intel As Long
                Dim Will As Long

                Vital = Spell(.Spell).Vital
                Intel = GetPlayerStat(.Caster, Intelligence)
                Will = GetPlayerStat(.Caster, Willpower)
                ' set the vital

                ' scale spells edit 
                Vital = Round((Vital * 0.7)) * Round(((Intel / 2) + Will))
                    PlayerAttackNpc .Caster, index, Vital, , True

                End If
                .Timer = GetTick
                ' check if DoT is still active - if NPC died it'll have been purged
                If .Used And .Spell > 0 Then
                    ' destroy DoT if finished
                    If GetTick - .StartTime >= (Spell(.Spell).Duration * 1000) Then
                        .Used = False
                        .Spell = 0
                        .Timer = 0
                        .Caster = 0
                        .StartTime = 0
                    End If
                End If
            End If
        End If
    End With
End Sub

And here’s a snip of my normal cast spell sub.

...
    ' set the vital
    Vital = Spell(spellnum).Vital

    ' scale spells edit
    Vital = Round((Vital * 0.7)) * Round(((Stats.Intelligence / 2) + Stats.Willpower))

    If Spell(spellnum).Type = SPELL_TYPE_HEALHP Then
    Vital = Vital + Round((GetPlayerStat(index, Stats.Willpower) * 0.6))
    End If

    If Spell(spellnum).Type = SPELL_TYPE_DAMAGEHP Then
    Vital = Vital + Round((GetPlayerStat(index, Stats.Intelligence) * 0.6))
    End If
...

Thanks for any input you may have 🙂

why do you set the vital twice in the cast spell sub?

it’s just easier for me to understand. I set the vital then modify it right after.

Hi,

Sorry for my english

Vital = Round((Vital * 0.7)) * Round(((Intel / 2) + Will))

Maybe this is the problem ?

Vital = Round((Vital * 0.7))   "    *    "   Round(((Intel / 2) + Will))

^ what or3o says is a critical clue. You’re doing things wrong way.

Ohhh, my bad, i didn’t saw the date… 04-17-2016, 07:25 AM

Sorry for the up, just wanna helpa bit, and i don’t have the good answer 😕

Log in to reply