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

[EO 1.3.1] NPC Strength Display


thezeus
 Share

Recommended Posts

I was brainstorming is helping teach people how hard monsters are.. it is obviously an option I'd like to convert eventually to be within the options to turn off and on; however, I think this is a good start.

If anyone knows why the # is lower than the text let me know and provide a bug fix.

Search within Client

```
Public Sub DrawNpcName(ByVal Index As Long)

```
Change the code to

```
Public Sub DrawNpcName(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim color As Long
Dim Name As String
Dim NpcNum As Long
Dim TextA As Long
Dim TextB As Long
Dim Strength As String

    NpcNum = MapNpc(Index).num

    Select Case Npc(NpcNum).Behaviour
        Case NPC_BEHAVIOUR_ATTACKONSIGHT
            color = QBColor(BrightRed)
        Case NPC_BEHAVIOUR_ATTACKWHENATTACKED
            color = QBColor(Yellow)
        Case NPC_BEHAVIOUR_GUARD
            color = QBColor(Grey)
        Case Else
            color = QBColor(BrightGreen)
    End Select

    Name = Trim$(Npc(NpcNum).Name)
    Strength = Trim$("STR: " & Npc(NpcNum).Stat(Stats.Strength))
    TextX = ConvertMapX(MapNpc(Index).x * PIC_X) + MapNpc(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Name)))
    If Npc(NpcNum).Sprite < 1 Or Npc(NpcNum).Sprite > NumCharacters Then
        TextA = ConvertMapX(MapNpc(Index).x * PIC_X) + MapNpc(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$("STR: " & Npc(NpcNum).Stat(Stats.Strength))))
        TextB = ConvertMapY(MapNpc(Index).y * PIC_Y) + MapNpc(Index).YOffset - 32
        TextY = ConvertMapY(MapNpc(Index).y * PIC_Y) + MapNpc(Index).YOffset - 16
    Else
        ' Determine location for text
        TextA = ConvertMapX(MapNpc(Index).x * PIC_X) + MapNpc(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$("STR: " & Npc(NpcNum).Stat(Stats.Strength))))
        TextB = ConvertMapY(MapNpc(Index).y * PIC_Y) + MapNpc(Index).YOffset - 32
        TextY = ConvertMapY(MapNpc(Index).y * PIC_Y) + MapNpc(Index).YOffset - (DDSD_Character(Npc(NpcNum).Sprite).lHeight / 4) + 16
    End If

    ' Draw name
    Call DrawText(TexthDC, TextA, TextB, Strength, QBColor(White))
    Call DrawText(TexthDC, TextX, TextY, Name, color)
End Sub
```
![](http://i747.photobucket.com/albums/xx117/richconner/display.jpg)
Link to comment
Share on other sites

Works!Thank you.But can you make it also to show the hp.I tryd changing STR to HP and Strength to Health but it dident work it just gived me an error.

Edit: I found a bug.It says the str only to the npc's you awredy had in the game.But if you make a new one the str and name are on same high line.
Link to comment
Share on other sites

I've actually modifying it to change the npc name color instead of displaying the level.  It goes yellow for monsters easily killable, white for average, and red for difficult.  If that is something people would like me to release let me know.
Link to comment
Share on other sites

  • 2 weeks later...
@thezeus:

> I've actually modifying it to change the npc name color instead of displaying the level.  It goes yellow for monsters easily killable, white for average, and red for difficult.  If that is something people would like me to release let me know.

i would like it
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...