1)Vá no Servidor
2)Procure por:
modPlayer -> Sub AttackNpc
3)Procure por:
4)Embaixo coloque:
5)Va no cliente
6)Procure por:
modDirectDraw7 -> Public Sub Render_Graphics
7)Procure por:
8)Substitua por:
9)Procure por:
Public Sub BltNpc
10)Embaixo do código coloque:
11)Para Muda a posição do nome, procure por:
12)Se você quiser que ele mostre o nome sem precisar atacar, retire as linhas:
2)Procure por:
modPlayer -> Sub AttackNpc
3)Procure por:
- Código:
' NPC not dead, just do the damage
MapNpc(MapNum).Npc(MapNpcNum).Vital(Vitals.HP) = MapNpc(MapNum).Npc(MapNpcNum).Vital(Vitals.HP) - Damage
' Check for a weapon and say damage
SendActionMsg MapNum, "-" & Damage, BrightRed, 1, (MapNpc(MapNum).Npc(MapNpcNum).x * 32), (MapNpc(MapNum).Npc(MapNpcNum).y * 32)
SendBlood GetPlayerMap(Attacker), MapNpc(MapNum).Npc(MapNpcNum).x, MapNpc(MapNum).Npc(MapNpcNum).y
4)Embaixo coloque:
- Código:
SendMapNpcVitals GetPlayerMap(Attacker), MapNpcNum
5)Va no cliente
6)Procure por:
modDirectDraw7 -> Public Sub Render_Graphics
7)Procure por:
- Código:
' Npcs
For I = 1 To MAX_MAP_NPCS
If MapNpc(I).Y = Y Then
Call BltNpc(I)
End If
Next
8)Substitua por:
- Código:
' Npcs
For I = 1 To MAX_MAP_NPCS
' Draw out npc hp bars
Call BltNpcHP(I)
If MapNpc(I).Y = Y Then
Call BltNpc(I)
End If
Next
9)Procure por:
Public Sub BltNpc
10)Embaixo do código coloque:
- Código:
Public Sub BltNpcHP(ByVal Index As Long)
Dim X As Long, Y As Long, Sprite As Long, NpcNum As Long
NpcNum = MapNpc(Index).Num
If NpcNum = 0 Then
Exit Sub
End If
' Don't display the HP if the npc is at max hp
If MapNpc(Index).Vital(Vitals.HP) = Npc(NpcNum).HP Then
Exit Sub
End If
' Only display HP for npcs that we can attack
If Npc(NpcNum).Behaviour <> NPC_BEHAVIOUR_ATTACKONSIGHT And Npc(NpcNum).Behaviour <> NPC_BEHAVIOUR_ATTACKWHENATTACKED Then
Exit Sub
End If
Sprite = Npc(NpcNum).Sprite
' Calculate the X coordinate to place the name
X = MapNpc(Index).X * PIC_X + MapNpc(Index).XOffset
If Sprite < 1 Or Sprite > NumCharacters Then
Y = MapNpc(Index).Y * PIC_Y + MapNpc(Index).YOffset - 22
Else
Y = MapNpc(Index).Y * PIC_Y + MapNpc(Index).YOffset - (DDSD_Character(Sprite).lHeight) + 227
End If
' Draw the outside box
Call DDS_BackBuffer.SetFillColor(RGB(0, 0, 0))
Call DDS_BackBuffer.DrawBox(ConvertMapX(X), ConvertMapY(Y), ConvertMapX(X + 32), ConvertMapY(Y + 4))
' Draw the HP
Call DDS_BackBuffer.SetFillColor(RGB(0, 255, 0))
Call DDS_BackBuffer.DrawBox(ConvertMapX(X), ConvertMapY(Y), ConvertMapX(X + Int(((MapNpc(Index).Vital(Vitals.HP) / 32) / (Npc(NpcNum).HP / 32)) * 32)), ConvertMapY(Y + 4))
End Sub
11)Para Muda a posição do nome, procure por:
- Código:
Y = MapNpc(Index).Y * PIC_Y + MapNpc(Index).YOffset - 22
Y = MapNpc(Index).Y * PIC_Y + MapNpc(Index).YOffset - (DDSD_Character(Sprite).lHeight) + 227
12)Se você quiser que ele mostre o nome sem precisar atacar, retire as linhas:
- Código:
' Don't display the HP if the npc is at max hp
If MapNpc(Index).Vital(Vitals.HP) = Npc(NpcNum).HP Then
Exit Sub
End If
Última edição por Marlos Gama em Sex Jan 28, 2011 12:46 pm, editado 2 vez(es)