Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

I need some help with Damage over time


Justin Knight
 Share

Recommended Posts

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 :)
Link to comment
Share on other sites

  • 6 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...