PDA

View Full Version : [317][508] Making NPC's Shout [317][508]



Techn0fev3r
June 17th, 2010, 23:36
So lets start off.
Open NPCHandler.java (.JAVA NOT .CLASS)

I have seen alot of stupidos that were too lazy to find out where to put it, yeah, under "moo", but only server that are remade of RuneScape have Moo in it, (it's cows that Moo in real RS for if you dont know).

So, I ain't like that? here it is, search for:
Code:

npcs[i].getnextnpcmovement()
and right under it add:
Code:


if (npcs[i].npcType == 13) { //npc id, the npc that says it.
if (misc.random2(10) <= 3) //Time between saying your text.
{
npcs[i].updateRequired = true;
npcs[i].textUpdateRequired = true;
npcs[i].textUpdate = "Your text here that will be shouted :)"; //change that to what you want.
}
}
So it will look like this:
Code:
}
Code:
if (npcs[i].RandomWalk == true) {
npcs[i].getNextNPCMovement();
}
if (npcs[i].npcType == 13) { //Npc ID!
if (misc.random2(40) <= 3) //time delay, time between they say your shout text.
{
npcs[i].updateRequired = true;
npcs[i].textUpdateRequired = true;
npcs[i].textUpdate = "your text here that will be shouted :)"; //change to what you want.
}
}
So, it will work fine now, save, compile and run, spawn a npc... it works with ::npc.

But now you're gonna want to have it special, like it says different things when different thing happen.
For Example the uptime.
Or how many online.
Or if the owner is online.

After you added your first NPCshout, you can just put others under it.

(spellt players wrong but idc, its just a tut )

Code:
if (npcs[i].npcType == 14) { //Npc ID!
if (misc.random2(40) <= 3) //time delay, time between they say your shout text.
{
npcs[i].updateRequired = true;
npcs[i].textUpdateRequired = true;
npcs[i].textUpdate = "there are currently " + PlayerHandler.getPlayerCount()+ " players online";
}
}

-Techn0fev3r

Ninga Nun
June 25th, 2010, 09:37
Nice TuT
Thanks for this :D:D:D

Denbruno
July 29th, 2010, 14:01
Wish there was a tut for doing this on 562... Can't seem to find where to put it there... Cool tut though, very usefull!

DutchVengz__
July 31st, 2010, 09:17
Can u give me the code for is the owner online? I dunno it lol :P

Faab234
July 31st, 2010, 09:43
How is this 317 or 508?

Sceptylos
August 17th, 2010, 09:37
You sure this 508 too? I'm having a hard time finding NPCHandler, Actually never seen it in a 508.