12-11-2008, 05:08 PM
For example when I change map I send the npc hp because my monsters has hp bars. But I dont want to send the hp bar packet from server to client unless there are npcs on the map. In that case you could add this. Could also be used for other things similar to the one I explained.
Code:
Function NpcOnMap(ByVal MapNum As Long) As Boolean
Dim i As Byte
NpcOnMap = False
For i = 1 To MAX_MAP_NPCS
If MapNpc(MapNum, i).num > 0 Then
NpcOnMap = True
Exit Function
End If
Next i
End Function