[EO] Show NPC Levels

Been a while since I don’t post a tutorial. By the end of this tutorial, your NPCs will have their level displayed at their side. It’s really a simple edit, all client-side.

Go to modText, we will do all of our edits there.
In Sub DrawNpcName, look for:

            Name = Trim$(Npc(npcNum).Name)

Delete it. We don’t need that.
Now, just above, look for:

    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

And replace it with:

    Select Case Npc(npcNum).Behaviour
        Case NPC_BEHAVIOUR_ATTACKONSIGHT
            color = QBColor(BrightRed)
            Name = Trim$(Npc(npcNum).Name) & " [" & Npc(npcNum).Level & "]"
        Case NPC_BEHAVIOUR_ATTACKWHENATTACKED
            color = QBColor(Yellow)
            Name = Trim$(Npc(npcNum).Name) & " [" & Npc(npcNum).Level & "]"
        Case NPC_BEHAVIOUR_GUARD
            color = QBColor(Grey)
            Name = Trim$(Npc(npcNum).Name) & " [" & Npc(npcNum).Level & "]"
        Case Else
            color = QBColor(BrightGreen)
            Name = Trim$(Npc(npcNum).Name)
    End Select

This code will show their levels only if they are attack on sight, attack when attacked, or guards. We don’t want a friendly/shopkeeper NPC’s level to be visible if we can’t attack it… right?

That’s pretty much it. Hope it helps.

Thanks.!

instead of using text how can I show an img?

hey can you help me for showing level for player ?

Simple and great, 8. Thanks for sharing.

hey can you help me for showing level for player ?

Put this in modText, drawplayername```
Name = Trim$(Player(index).Name) & " [" & GetPlayerLevel(index) & “]”

Same formatting as above.

> instead of using text how can I show an img?

I understand that your question is relevant in theme. In terms of the actual code required, a separate topic in Q&A would be more appropriate than in thus tutorial, because of both the scope of the request and since the methods have practically nothing to do with each other. All the same… a lot of people have asked for this in the past and I don't think a tutorial exists. So I've just uploaded one. [Here's the link](http://www.touchofdeathforums.com/community/index.php?/topic/133157-eo-images-by-player-names-base-for-further-specific-coding/).
Log in to reply