Basic Java Rules:If you put “//” in a java file it will disregard the rest of the line from that point. e.g:
actionTimer = 25; //Timer to reset animation
Always in .cfg files you have to use tab! Not spacebar, it work work otherwise.
Stopping People From Mass Clicking:People clicking others really fast in wildy makes them hit much fast than the actual wepon speed. It is a very common problem in alot of servers, but i will show you how to disable it
Firstly,
Open Client.java, Hit Ctrl + F, Then search for:
Public Boolean Process
Above it you should see this:
public int eX = 0;
public int eY = 0;
public int etimer = 0;
public boolean showingCity = false;
public int showCityTimer = 0;
public int cityX = 0;
public int cityY = 0;
public boolean drunk = false;
public int drunkTimer = 0;
public boolean newAnimRequired = false;
public int newAnimDelay = 0;
public int newAnim = 0;
public int kitstarter = 0;
public int blackmark = 0;
public int mageTimer = 0;
public int Reptimer = 0;
In there add this line
long lastProcess = System.currentTimeMillis();
So it looks something like this:
public int eX = 0;
public int eY = 0;
public int etimer = 0;
public boolean showingCity = false;
public int showCityTimer = 0;
public int cityX = 0;
public int cityY = 0;
public boolean drunk = false;
public int drunkTimer = 0;
long lastProcess = System.currentTimeMillis();
public boolean newAnimRequired = false;
public int newAnimDelay = 0;
public int newAnim = 0;
public int kitstarter = 0;
public int blackmark = 0;
public int mageTimer = 0;
public int Reptimer = 0;
Then Below
Public Boolean Process
Add this:
long timeSpent = System.currentTimeMillis()-lastProcess; //stop rapid clicking to speed up timers - By nirvana
if(timeSpent >= server.cycleTime) {
timeSpent = server.cycleTime;
lastProcess = System.currentTimeMillis(); // By Nirvana
}
So it looks like this:
public boolean process() { // is being called regularily every 500ms
long timeSpent = System.currentTimeMillis()-lastProcess; //stop rapid clicking to speed up timers - By nirvana
if(timeSpent >= server.cycleTime) {
timeSpent = server.cycleTime;
lastProcess = System.currentTimeMillis(); // By Nirvana
}
There no more anoying mass clickers in wildy!
Player Rights:Player Rights is the amount of power a player has, normally used for Commands, Teles in the Emote tab, uses of items, and much, much more.
Player Rights = 0 // Normal Player
Player Rights = 1 // Moderator
Player Rights = 2 // Admin
Player Rights = 3+ // (co)Owner
To change Player Rights Open the Characters Folder > (TheUser).txt open and in there it should say Player Rights = 0 (default). Change to anything.
Commands:To Make Commands you have to follow a simple piece of code, commands are one of the simplest things in server coding.
Search for
else if(command
Then after a command Under the last } of it add in a command
Heres some examples:
if (command.startsWith("COMMANDNAME") && playerRights >= PLAYERRIGHTS) {
addItem(ITEMID, AMT);
}
you can add multiple items like this
if (command.startsWith("COMMANDNAME") && playerRights >= PLAYERRIGHTS) {
addItem(ITEMID, AMT);
addItem(ITEMID, AMT);
addItem(ITEMID, AMT);
addItem(ITEMID, AMT);
}
Then theres Tele Commands
else if (command.equalsIgnoreCase("COMMANDNAME") && playerRights >= PLAYERRIGHTS)
{
teleportToX = XCO;
teleportToY = YCO;
}
else if (command.equalsIgnoreCase("COMMANDNAME") && playerRights >= PLAYERRIGHTS)
{
teleportToX = XCO;
teleportToY = YCO;
addItem(ITEMID, AMT); // You can mix then up.
sendmessage("WANT TO SEND A MESSAGE TYPE IT HERE"); // <<< used for discriptions normally
}
You can make commands to lots of things those are the most basic
You can just add the lines doesn’t matter how many times
and it doesn’t matter which sort it will operate all the commands it is set
so in game you type ::COMMANDNAME
Talking NpcsTo make an npc something something is quite simple. Open up NpcHandler.java, Hit Ctrl +f and type "moo" in the box and find next you should see this
if (misc.random2(50) == 1) {
npcs[i].updateRequired = true;
npcs[i].textUpdateRequired = true;
npcs[i].textUpdate = "Moo";
}
}
Or something like it
To add a Npc Talking use this layout
if (npcs[i].npcType == NPCID) {
if (misc.random2(50) == 1) {
npcs[i].updateRequired = true;
npcs[i].textUpdateRequired = true;
npcs[i].textUpdate = "YOUR TEXT HERE";
}
}
And if you want it to say in someone in online use this
if (npcs[i].npcType == NPC ID) {
if (misc.random2(25) <= 3) {
npcs[i].updateRequired = true;
npcs[i].textUpdateRequired = true;
if (PlayerHandler.isPlayerOn("PERSONSNAME")){
npcs[i].textUpdate = "Owner PERSONSNAME is Online";
}
else{
npcs[i].textUpdate = "Owner PERSONNAME is Offline";
}
}
}
To change what an npc is saying just use Ctrl + f in there and change the line of what they are saying rather simple..