![]() |
[Feature] HP Bars for NPC - Printable Version +- Mirage Engine (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Source Code Development (https://mirage-engine.uk/forums/forumdisplay.php?fid=51) +----- Forum: Mirage Source 4 (Visual Basic 6) (https://mirage-engine.uk/forums/forumdisplay.php?fid=44) +------ Forum: Tutorials (https://mirage-engine.uk/forums/forumdisplay.php?fid=13) +------ Thread: [Feature] HP Bars for NPC (/showthread.php?tid=2730) |
[Feature] HP Bars for NPC - Labmonkey - 11-04-2009 [SERVERSIDE] First we have to add a new packet In mod Enumerations under Code: SCastSpell Code: SUpdateNpcHP Now let us make the sub to send the packet AT the bottom of modServerTcp put Code: Public Sub SendNpcHp(ByVal Map As Long, ByVal Index As Byte) Now lets send the packet. In the attacknpc sub, under Code: ' Reduce durability of weapon Code: 'Lets update the hp of the npc incase it got hurt [CLIENTSIDE] We have to add the new packet to the client too. In mod Enumerations under Code: SCastSpell Code: SUpdateNpcHP We have to add a value to MapNpcRec called MaxHp Find Code: Private Type MapNpcRec Code: AttackTimer As Long Code: MaxHp As Long Now lets actually change the hp when we get the packet. in modHandleData under Code: HandleSpellCast Parse Code: Case SUpdateNpcHP now at the bottom of modHandleData put this sub Code: ' :::::::::::::::::::::::::: Now the last step, draw the hp bar. In sub BltNpc at the bottom put Code: If MapNpc(MapNpcNum).Vital(Vitals.HP) = 0 Then Exit Sub Re: [Feature] HP Bars for NPC - Clu - 28-06-2009 I having a little trouble getting this over to MS4, solely because ive been programming for over 12 hours on it lol, can anyone give me a hand by letting me know how i can get an NPC max health, on the client side? or do I have to make another packet? any help would be absolutely fantastic. Re: [Feature] HP Bars for NPC - Labmonkey - 25-07-2009 What do you mean it sends the packet at the wrong time? And the tutorial was written for an earlier version of ms, and i can guarantee for that version it worked fine. Re: [Feature] HP Bars for NPC - ShadowMaster - 09-08-2009 All is needed is MP and SP bars. |