PDA

View Full Version : [317]Changing npc's name and features[317]



colesp3
July 9th, 2010, 18:08
This is my Tutorial that pretty much every great coder knows. It's just here to help people who don't know.
how hard is it? 4/10


1.First open up your source and go into npc.CFG and find the npc you want to change the name or something to.(for example. i will be using npc 0 if needed)
so what you do is change the name the npc to what ever you want. im going to change hans to da_nub.
2.Now open up your client files and go into class5.java
and since im doing hans, i would find(most clients have Graardor) one with the id 1115 wich would look like this:


if(i == 3000) {
aClass30_Sub2_Sub2_60.anInt1406 = anIntArray72[630];
class5.method165(true, aClass30_Sub2_Sub2_60)
class5.aStringArray66 = new String[5];
class5.aStringArray66[1] = "Attack";
class5.anIntArray94 = new int[2];
int changedColors = 1;
class5.anIntArray76 = new int[changedColors];
class5.anIntArray70 = new int[changedColors];
class5.anIntArray76[0] = 61;
class5.anIntArray70[0] = 926;
class5.anIntArray94[0] = 5000;
class5.anIntArray94[1] = 5001;
class5.aString65 = "General Graardor";
class5.anInt61 = 624;
class5.aByteArray89 = "An huge war chief.".getBytes();
}

then below that you add:

if(i == 0) {
class5.aString65 = "Da_Nub";
class5.aByteArray89 = "wow what a nub".getBytes();
}

note: a brief explanation of the words and numbers: if == 0 : the 0 being the npc id.
Da_Nub being its name
Wow what a nub is what it will say when you examine it.

so it will look like this:

if(i == 3000) {
aClass30_Sub2_Sub2_60.anInt1406 = anIntArray72[630];
class5.method165(true, aClass30_Sub2_Sub2_60)
class5.aStringArray66 = new String[5];
class5.aStringArray66[1] = "Attack";
class5.anIntArray94 = new int[2];
int changedColors = 1;
class5.anIntArray76 = new int[changedColors];
class5.anIntArray70 = new int[changedColors];
class5.anIntArray76[0] = 61;
class5.anIntArray70[0] = 926;
class5.anIntArray94[0] = 5000;
class5.anIntArray94[1] = 5001;
class5.aString65 = "General Graardor";
class5.anInt61 = 624;
class5.aByteArray89 = "An huge war chief.".getBytes();
}
if(i == 0) {
class5.aString65 = "Da_Nub";
class5.aByteArray89 = "wow what a nub".getBytes();
}

now save& compile your client and source. reload them both and type ::npc 0
it should say: Da_Nub and when you examine it will will say: wow what a nub

credits:
10% to me for presenting it
80% to the guy who thought of this(dont know his name)
10% to the flamers who will flame at me and post anything i did wrong wich i will then edit to make it right.

dasa
July 9th, 2010, 18:28
what if u dont have a class5.. :P

Mish
July 9th, 2010, 18:30
what if u dont have a class5.. :P

You do :S

dasa
July 9th, 2010, 20:20
not that i can see lol searched for it dunno howmany times :P guess ill find a new client =3 lol

Purox
July 17th, 2010, 07:24
You do :S

Hilarious. Good tut, I was just wondering what class it was but was too lazy to check. Nice to know, learn something new every day. May want to tell people how to change their combat levels as well.

Mish
July 17th, 2010, 09:02
not that i can see lol searched for it dunno howmany times :P guess ill find a new client =3 lol
Lol, it should be there though.

Coolblaze1
July 26th, 2010, 05:07
U shuld make a tut on how to change its lvl as well

Relapse
July 27th, 2010, 01:59
Use code blocks so its readable :)

xaves
July 27th, 2010, 11:25
If you dont have Class5, then you are using a refactored client, its something like Entitydef

mojo
July 27th, 2010, 12:01
That is awesome, I am going to give an npc my name (im owner) and people will be like wtf owner is an npc! It will have some funny chat dialogue... :)

A D A M
November 8th, 2010, 09:54
how do you make an npc wear + wield items?

broken hate
November 8th, 2010, 19:04
very nice goodjob