Justin Knight Posted April 17, 2016 Author Share Posted April 17, 2016 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 WithEnd 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 More sharing options...
or3o Posted April 17, 2016 Share Posted April 17, 2016 why do you set the vital twice in the cast spell sub? Link to comment Share on other sites More sharing options...
Justin Knight Posted April 17, 2016 Author Share Posted April 17, 2016 it's just easier for me to understand. I set the vital then modify it right after. Link to comment Share on other sites More sharing options...
DarkAge Posted October 18, 2016 Share Posted October 18, 2016 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))``` Link to comment Share on other sites More sharing options...
Lavos Posted October 18, 2016 Share Posted October 18, 2016 ^ what or3o says is a critical clue. You're doing things wrong way. Link to comment Share on other sites More sharing options...
DarkAge Posted October 19, 2016 Share Posted October 19, 2016 Ohhh, my bad, i didn't saw the date… 04-17-2016, 07:25 AMSorry for the up, just wanna helpa bit, and i don't have the good answer :/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now