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

This is the one thing I hate about programming…


zade_o
 Share

Recommended Posts

Ok, the NPC the script involves is NPC #5 on map #3\. In my list of created NPCs he is #1\. (keep that in mind)

```
Dim mc
If GetMapNpcHP(3,1) > 0 Then
mc=mc+1
End If
If GetMapNpcHP(3,2)>0 Then
mc=mc+2
End If
If GetMapNpcHP(3,3)>0 Then
mc=mc+3
End If
If GetMapNpcHP(3,4)>0 Then
mc=mc+4
End If

dim added
added=Rand(100,300+(200*mc))
dim curhp
dim newhp
curhp = GetMapNpcHP(3,5)
newhp = GetMapNpcHp(3,5)+added
If newhp>GetNpcMaxHP(1) Then
newhp=GetNpcMaxHP(1)
End If

'SetMapNpcHP(3,1,newhp)
'SendNPC(3,5)

Call MapMsg(3,"Old HP: " & curhp &" New HP: " & newhp,4)

mc=0
```
That works perfectly. 

However, if I uncomment those two commented commands, it fails and nothing shows up.
Soooo….what's the problem ?
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...