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

Fixing Heal Spirit Over Time Spells


Ruins of Hell
 Share

Recommended Posts

[(Fix created because of this bug report.)](http://www.touchofdeathforums.com/smf/index.php/topic,78855.0.html)

It seems that the code for HoTs just assumes that you want to heal HP. Therefore, even setting a Heal MP spell will heal MP for the first tick, but from then on heal HP regardless of spell type. DoTs are not affected by this error. Here's a fix (it's not elegant, but I tried to touch existing code as little as possible):

* * *

Everything is server-side.

**Fixing it for players**

Find:
```
SendActionMsg Player(index).Map, "+" & Spell(.Spell).Vital, BrightGreen, ACTIONMSG_SCROLL, Player(index).x * 32, Player(index).y * 32
Player(index).Vital(Vitals.HP) = Player(index).Vital(Vitals.HP) + Spell(.Spell).Vital

```
and replace it with:
```
If Spell(.Spell).Type = SPELL_TYPE_HEALHP Then
  SendActionMsg Player(index).Map, "+" & Spell(.Spell).Vital, BrightGreen, ACTIONMSG_SCROLL, Player(index).x * 32, Player(index).y * 32
  SetPlayerVital index, Vitals.HP, GetPlayerVital(index, Vitals.HP) + Spell(.Spell).Vital
Else
  SendActionMsg Player(index).Map, "+" & Spell(.Spell).Vital, BrightBlue, ACTIONMSG_SCROLL, Player(index).x * 32, Player(index).y * 32
  SetPlayerVital index, Vitals.MP, GetPlayerVital(index, Vitals.MP) + Spell(.Spell).Vital
End If

```
**Fix for NPCs**

Find:
```
SendActionMsg mapNum, "+" & Spell(.Spell).Vital, BrightGreen, ACTIONMSG_SCROLL, MapNpc(mapNum).Npc(index).x * 32, MapNpc(mapNum).Npc(index).y * 32
MapNpc(mapNum).Npc(index).Vital(Vitals.HP) = MapNpc(mapNum).Npc(index).Vital(Vitals.HP) + Spell(.Spell).Vital

```
and replace it with:
```
If Spell(.Spell).Type = SPELL_TYPE_HEALHP Then
    SendActionMsg mapNum, "+" & Spell(.Spell).Vital, BrightGreen, ACTIONMSG_SCROLL, MapNpc(mapNum).Npc(index).x * 32, MapNpc(mapNum).Npc(index).y * 32
    MapNpc(mapNum).Npc(index).Vital(Vitals.HP) = MapNpc(mapNum).Npc(index).Vital(Vitals.HP) + Spell(.Spell).Vital
Else
    SendActionMsg mapNum, "+" & Spell(.Spell).Vital, BrightBlue, ACTIONMSG_SCROLL, MapNpc(mapNum).Npc(index).x * 32, MapNpc(mapNum).Npc(index).y * 32
    MapNpc(mapNum).Npc(index).Vital(Vitals.MP) = MapNpc(mapNum).Npc(index).Vital(Vitals.MP) + Spell(.Spell).Vital
End If

```
Link to comment
Share on other sites

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...