Simple ::event command

Mental Piracy

Previously Hyperion
 
 
Jan 5, 2009
1,254
35
0
Say you want to make an event for pking, or for a minigame that you are holding. This will let you add a command ::event, by setting event coords ingame and removing the event. No clue if this has been posted before, but I had never seen it until I added it to my server. First off add these to server.java
We add these so that when you use the ::setevent command it copies the absX and absY as well as the height level for all the server to use. As well the eventTele is used to determine whether an event is being held or not
Code:
	public static boolean eventTele = false;
	public static int ABSX = 0;
    	public static int ABSY = 0;
    	public static int HLEVEL = 0;
Then open up client.java and add these with your commands
Code:
if(command.equalsIgnoreCase("event"))
{
if(server.eventTele == true)
{
sendMessage("welcome to the event!");
triggerTele(server.ABSX, server.ABSY, server.HLEVEL);
}
else if(server.eventTele == false)
{
sendMessage("There is no event taking place!");
}
}
if(command.equalsIgnoreCase("setevent") && playerRights > 0)
{
server.ABSX = absX;
server.ABSY = absY;
server.HLEVEL = heightLevel;
server.eventTele = true;
sendMessage("Event successfully set!");
}
if(command.equalsIgnoreCase("endevent") && playerRights > 0){
server.ABSX = 0;
server.ABSY = 0;
server.HLEVEL = 0;
server.eventTele = false;
sendMessage("Event successfully ended!");
}
Very simple and adds a little extra to the same old boring pking. Can set events anywhere ingame and end them. Adding another layer to the pretty stupid ::pking or ::drags tele most servers have. Think this is actually my first release lol. So chill with the flaming. Like I said dont know if its ever been released, but I have only seen it on mine.

For a little more realism for players you can add an npc to talk to instead of ::event.
Here is the method for the npc dialogue

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~havent tested anything below this. Did it all here~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Code:
public void eventTalk() 
	{
		interfaceEffect = 11;
		clearQuestInterface();
		sendFrame126("", 2494);
		sendFrame126("Can I be teleported to the event?", 2495);
		sendFrame126("nevermind, i dont feel like going to the event", 2496);
		sendFrame126("", 2497);
		sendFrame126("", 2498);
		sendQuestSomething(8143);
		sendFrame164(2492);
		flushOutStream();
	}
Then add this with your other dialogue cases
Code:
case 200:
				talk("'Hello there is an event running, would you like to go?", XXXX);
				break;
			case 201:
				talk("Come back if you want to go to the event!", XXXX);
				break;
			case 202:
				talk("There is currently no event running!", XXXX);
				break;
Search for case 40 then add this
Code:
else if (NpcDialogue == 200) {
eventTalk();
}else if (NpcDialouge == 201) {
closeInterface();
}
Add it with the rest of the dialogue

Now open up clickingmost and go to case 9191
Add this there
Code:
		if (c.interfaceEffect == 11) {
				c.talk("Be prepared for battle!", XXXX);
c.triggerTele(server.ABSX, server.ABSY, server.HLEVEL);
}
Then add this with all your npc first clicks
Code:
if(NPCID == XXXX){
if(server.eventTele == true){
NpcDialogue = 200;
}else {
NpcDialogue = 202;
}
}
Then replace the XXXX with your npc id.
Someone comment back if it works
 
That's fine, not gonna use it anyway :D I alreaddy have something similar to this.

Repped + though
 

Users who are viewing this thread (total: 1, members: 0, guests: 1)

Who read this thread (total members: 1)