Author Topic: [317] Edit Npc - RightClick Text. [317]  (Read 313 times)

Offline Maniack

  • Steel Member
  • *
  • Posts: 36
  • Rep 0
    • View Profile
[317] Edit Npc - RightClick Text. [317]
« on: March 07, 2011, 05:18:07 pm »
Description: How to customise an NPC.
Difficulty: 1/10 - EASY
Assumed Knowledge: Able to use Ctrl+F, copy + paste
Files/Classes Modified: Client: Class5.java


When you right click an NPC, It says;

  • Talk- to
  • Trade

etc.

This tutorial will show you how to edit what it says.



Client Side

1. Open Class5.java (this contains all your custom NPCs, for example, General Graardor.  :P)

Search for:

Code: [Select]
if(i ==
Above that add:


Code: [Select]
if(i == ####) {  //change #### to your NPC ID.
                Class5.aStringArray66[0] = "Talk-to"; //You can change this if you like
                Class5.aStringArray66[2] = "Trade"; //You can change this if you like
                Class5.aStringArray66[3] = "Examine"; //You can change this if you like
                Class5.aString65 = "Your NPC/SHOP"; //Npc name
                Class5.aByteArray89 = "examine info here, put whatever you like.".getBytes(); //examine info
        }



2. Save and compile.


This is all I will be teaching here.
How to basically edit an NPC text when you right click them.
This doesn't include making the action happen so if you right-click and choose an option, it won't happen,
you will need to add the code yourself.

Maybe sometime I will make a tut for that  :)

Share on Bluesky Share on Facebook


Offline Mark

  • Bronze Member
  • *
  • Posts: 4
  • Rep 0
    • View Profile
Re: [317] Edit Npc - RightClick Text. [317]
« Reply #1 on: March 07, 2011, 05:27:09 pm »
Good tutorial.

Offline Kyle

  • Administrator
  • Torva Member
  • *
  • Posts: 1636
  • Rep 10
    • View Profile
Re: [317] Edit Npc - RightClick Text. [317]
« Reply #2 on: March 07, 2011, 05:33:59 pm »
Nice.  ;;)

Offline Maniack

  • Steel Member
  • *
  • Posts: 36
  • Rep 0
    • View Profile
Re: [317] Edit Npc - RightClick Text. [317]
« Reply #3 on: March 07, 2011, 05:38:19 pm »
Cheers.  :)

Turtle

  • Guest
Re: [317] Edit Npc - RightClick Text. [317]
« Reply #4 on: March 07, 2011, 09:14:16 pm »
Nice (Y)

Offline Jake

  • Bandos Member
  • *
  • Posts: 419
  • Rep 4
    • View Profile
Re: [317] Edit Npc - RightClick Text. [317]
« Reply #5 on: March 07, 2011, 11:44:21 pm »
Very nice, and useful.
Good work! xD

Offline the godfather

  • Rune Member
  • *
  • Posts: 172
  • Rep 0
    • View Profile
Re: [317] Edit Npc - RightClick Text. [317]
« Reply #6 on: March 08, 2011, 03:29:46 am »
Very informative, I have been looking for a guide on this subject.

Offline brandon

  • Veteran
  • Dragon Member
  • *
  • Posts: 240
  • Rep 12
    • View Profile
Re: [317] Edit Npc - RightClick Text. [317]
« Reply #7 on: March 08, 2011, 03:34:22 am »
Nice guide, you should make it for PI servers as well.

Offline the godfather

  • Rune Member
  • *
  • Posts: 172
  • Rep 0
    • View Profile
Re: [317] Edit Npc - RightClick Text. [317]
« Reply #8 on: March 08, 2011, 04:42:30 am »
Can you only change it to certain things or can you put anything at all in the right click options.

Offline brandon

  • Veteran
  • Dragon Member
  • *
  • Posts: 240
  • Rep 12
    • View Profile
Re: [317] Edit Npc - RightClick Text. [317]
« Reply #9 on: March 08, 2011, 11:49:05 am »
You can name it anything you want, but then you have to go server side and make an action for it.

Offline Maniack

  • Steel Member
  • *
  • Posts: 36
  • Rep 0
    • View Profile
Re: [317] Edit Npc - RightClick Text. [317]
« Reply #10 on: March 08, 2011, 11:50:00 am »
Can you only change it to certain things or can you put anything at all in the right click options.

Anything you like.

BUT, I think you can have a maximum of 3 options. I'm not sure about this, I was only told.
So you could try it  :)

Offline brandon

  • Veteran
  • Dragon Member
  • *
  • Posts: 240
  • Rep 12
    • View Profile
Re: [317] Edit Npc - RightClick Text. [317]
« Reply #11 on: March 08, 2011, 11:55:03 am »
No you can have more, I want to say it can go up to five, because for a dirty herb there is clean, use, drop, examine, cancel.

Offline Maniack

  • Steel Member
  • *
  • Posts: 36
  • Rep 0
    • View Profile
Re: [317] Edit Npc - RightClick Text. [317]
« Reply #12 on: March 08, 2011, 12:40:00 pm »
No you can have more, I want to say it can go up to five, because for a dirty herb there is clean, use, drop, examine, cancel.

Well thats answered for anyone who is/was going to ask  ;;)

Offline Sajon

  • Rune Member
  • *
  • Posts: 166
  • Rep -1
  • Never Back down
  • Location: United Kingdom
    • View Profile
Re: [317] Edit Npc - RightClick Text. [317]
« Reply #13 on: March 25, 2011, 10:26:25 pm »
nice tutorial. :D

Offline AdotSells

  • Firecape Member
  • *
  • Posts: 300
  • Rep 4
    • View Profile
Re: [317] Edit Npc - RightClick Text. [317]
« Reply #14 on: March 25, 2011, 11:46:15 pm »
This is nice But it should be in client section