• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Question

Newbie Spellweaver
Joined
Jun 14, 2013
Messages
9
Reaction score
0
How can I make it so npc's talk aloud on a 667 server, ex. Welcoming people to the server.
 
Junior Spellweaver
Joined
Sep 23, 2013
Messages
135
Reaction score
21
if you got any errors, tell me

NPC's name: Ozan
ID - 7888


Make a new class


Here's my class so you can test..


Name: Ozan


Place -> Dialogues

Code:
package com.rs.game.player.dialogues;

import com.rs.game.WorldTile;


public final class Ozan extends Dialogue {


	@Override
	public void start() {
		sendDialogue(SEND_3_TEXT_INFO,
				"Hello! I'll take you to lumbridge",
				"Lumbridge is a basic small city",
				"It's mostly country, so you better watch out if your from the city.");
	}


	@Override
	public void run(int interfaceId, int componentId) {
		if (stage == -1) {
			stage = 0;
			sendDialogue(SEND_2_OPTIONS,
					"Do you want me to teleport you to Lumbridge?",
					"Yes please", "Stay here.");
		} else if (stage == 0) {
			if (componentId == 1) {
				player.setNextWorldTile(new WorldTile(3122, 3122, 0));
				player.getControlerManager().startControler("ZGDControler");
			}
			end();
		}


	}


	@Override
	public void finish() {
		// TODO Auto-generated method stub


	}


}


Add this to NPCHandler.java


Code:
				if (npc.getId() == 7888)
					player.getDialogueManager().startDialogue("Ozan",
							npc.getId());


You should know where to put this or... /Fp


Add this to DialogueHandler.java


Code:
			Class<Dialogue> value43 = (Class<Dialogue>) Class
					.forName(Ozan.class.getCanonicalName());
			handledDialogues.put("Ozan", value43);
Then done, compile & run.
 
Back
Top