Server Base: Cheezscape 78
Modifyed Files: client.java
Description: To add a highly updated God Wars Minigame
Note:
Smartdude originaly made a clan hideout/war/clan system, which I used as a base for this.
If you have done smartdudes clan hideout/war/clan system in your server already, take it out before attempting this.
Procedure:
Step 1:
Open up notepad and add this into it:
Code:
import java.io.*; //JAVA IMPORT
import java.util.StringTokenizer; //JAVA IMPORT
import java.util.Calendar; //JAVA IMPORT
import java.util.GregorianCalendar; //JAVA IMPORT
import java.net.InetAddress; //JAVA IMPORT
import java.net.URL; //JAVA IMPORT
import java.awt.*; //JAVA IMPORT
import java.awt.event.*; //JAVA IMPORT
import java.net.*; //JAVA IMPORT
public class gw {
public static int godwarTimer = 1320; //Timer for the actual CastleWars game (10 Minutes)
public static int StartTimer = 500; //Timer that initates the CastleWarz Game
public static boolean godwarOn = false; //Turns CastleWars On or Off
public static int maxPlayers = 50; //Max players allowed total in gw
public static int maxZammy = 0; //Max players on Zammy Team
public static int maxSara = 0; //Max players on Saradomin Team
public gw() {
//misc.println("[GW] god wars - (C) Flea Mutt inc");
}
public static boolean setUp() {
/* Skill Setup */
return true;
}
public boolean process () { //Happening every 500MS
StartTimer += 1; //Makes the Timer to start gw go up
if (StartTimer >= 600 && godwarOn == false) { //If castle wars is not on, and the start timer reaches 5 mins,
PlayerHandler.messageToAll = "A God War game has begun!!!";
godwarOn = true;
StartTimer = 0;
}
if (godwarOn == true && godwarTimer >= 0) {
godwarTimer -= 1;
}
if (godwarOn == true && godwarTimer < 0) {
gwEnd();
}
return true;
}
public static void gwLoop(int godwarTimer) {
if(godwarTimer == 0)
return;
}
public static void gwEnd() { //Void to end gw
godwarTimer = 1320;
StartTimer = 0; //Timer that initates the Gw Game (loops back to 0)
godwarOn = false;
PlayerHandler.messageToAll = "A God Wars game has just ended";
maxZammy = 0;
maxSara = 0;
}
}
Save it as
gwhandler.java
in the folder with all your .java files.
Step 2:
go into your client.java and add these where u think they best fit
Code:
public boolean sara = false;
public boolean zammy = false;
Step 3:
Add these to voids
Code:
public void zammycommands()//Start Of zammycommands
{
sendQuest("@dre@Zamorak Commands", 8144);
clearQuestInterface();
sendQuest("::zammyhq - Teleports you to the zamorak head quarters.", 8147);
sendQuest("::zammyoutfit - gives you the zammy uniform", 8148);
sendQuest("::zammywar - teleports you to the battle grounds!", 8149);
sendQuestSomething(8143);
showInterface(8134);
flushOutStream();
}
public void saracommands()//Start Of saracommands
{
sendQuest("@dre@Saradomin Commands", 8144);
clearQuestInterface();
sendQuest("::sarahq - teleports you to the saradomin head quarters", 8147);
sendQuest("::saraoutfit - gives you the saradomin uniform", 8148);
sendQuest("::sarawar - teleports you to the battlefield", 8149);
sendQuestSomething(8143);
showInterface(8134);
flushOutStream();
}
Step 4:
add these with all your other commands
Code:
if (command.equalsIgnoreCase("joinsara")) {
if (sara == false && zammy == false && gw.maxSara < 25);
sara = true;
sendMessage("Your in! Type ::saracommands for clan commands");
sendMessage("Type ::leavesara to leave saradomin.");
} else {
if (gw.maxSara == 25) {
sendMessage("Sorry, this team is full");
}
}
if (command.equalsIgnoreCase("leavesara")) {
if (sara == true) {
sara = false;
teleportToX = 3254;
teleportToY = 3420;
sendMessage("And you left why?????");
} else {
sendMessage("Hey! You have to join sara first!");
}
}
if (command.equalsIgnoreCase("sarahq")) {
if (sara == true) {
teleportToX = 2644;
teleportToY = 9894;
} else {
sendMessage("Hey! You have to join sara first!");
}
}
if (command.equalsIgnoreCase("sarawar")) {
teleportToX = 2057;
teleportToY = 3159;
sendMessage("Cccccchhhhhhhhhaaaarrrrrrgggggeeeee!!!!!!!");
}
if (command.equalsIgnoreCase("saraoutfit")) {
if (sara == true) {
addItem(2661, 1);
addItem(2663, 1);
addItem(2667, 1);
addItem(2412, 1);
addItem(4151, 1);
addItem(1055, 1);
sendMessage("Wear the saradomin's colors with pride!");
} else {
sendMessage("Hey! You have to join sara first!");
}
}
if (command.equalsIgnoreCase("joinzammy")) {
if (sara == false && zammy == false && gw.maxZammy < 25);
zammy = true;
sendMessage("Your in! Type ::zammycommands for clan commands");
sendMessage("Type ::leavezammy to leave zamorak.");
} else {
if (gw.maxZammy == 25) {
sendMessage("Sorry, this team is full");
}
}
if (command.equalsIgnoreCase("leavezammy")) {
if (zammy == true) {
zammy = false;
teleportToX = 3254;
teleportToY = 3420;
sendMessage("And you left why?????");
} else {
sendMessage("Hey! You have to join zammy first!");
}
}
if (command.equalsIgnoreCase("zammyhq")) {
if (zammy == true) {
teleportToX = 3082;
teleportToY = 9896;
} else {
sendMessage("Hey! You have to join zammy first!");
}
}
if (command.equalsIgnoreCase("zammywar")) {
teleportToX = 2099;
teleportToY = 3161;
sendMessage("Cccccchhhhhhhhhaaaarrrrrrgggggeeeee!!!!!!!");
}
if (command.equalsIgnoreCase("zammyoutfit")) {
if (zammy == true) {
addItem(2653, 1);
addItem(2655, 1);
addItem(2659, 1);
addItem(2414, 1);
addItem(1057, 1);
addItem(4151, 1);
sendMessage("Wear the clan's colors with pride!");
} else {
sendMessage("Hey! You have to join zammy first!");
}
}
else if (command.equalsIgnoreCase("zammycommands"))
{
zammycommands();
}
else if (command.equalsIgnoreCase("saracommands"))
{
saracommands();
}
Step 5:
you will need the makeGlobalObject void for this...
Look for public void newObjects()
Under that add this:
Code:
/*start of god wars*/
makeGlobalObject(2071, 3149, 4905, -3, 10);//Catapult
makeGlobalObject(2071, 3152, 660, 0, 10);//corpes
makeGlobalObject(2073, 3162, 5, -3, 10);//Broken cannon
makeGlobalObject(3075, 9885, 4247, -1, 10);//bar
makeGlobalObject(3075, 9887, 4247, -1, 10);//bar
makeGlobalObject(3075, 9887, 4273, -3, 10);//bar pumps
makeGlobalObject(3074, 9888, 4286, -3, 10);//keg
makeGlobalObject(3073, 9888, 4286, -3, 10);//keg
makeGlobalObject(3081, 9888, 2874, -3, 10);//zammy
makeGlobalObject(3075, 9896, 2213, -1, 10);//bank1
makeGlobalObject(3075, 9895, 2213, -1, 10);//bank1
makeGlobalObject(3080, 9895, 4005, -1, 10);//well
makeGlobalObject(3080, 9887, 3918, -1, 10);//Eleven lamp
makeGlobalObject(3080, 9889, 3918, -1, 10);//11lamp
makeGlobalObject(3082, 9887, 3918, -1, 10);//11lamp
makeGlobalObject(3082, 9889, 3918, -1, 10);//11lamp
makeGlobalObject(3079, 9884, 4901, -2, 10);//zammystanderd
makeGlobalObject(3081, 9884, 4901, -2, 10);//zammystanderd
makeGlobalObject(3082, 9880, 6302, -2, 10);//throne
makeGlobalObject(2642, 9893, 4900, -2, 10);//sarastanderd
makeGlobalObject(2643, 9893, 4902, -2, 10);//sarastanderd
makeGlobalObject(2644, 9893, 4902, -2, 10);//sarastanderd
makeGlobalObject(2645, 9893, 4902, -2, 10);//sarastanderd
makeGlobalObject(2651, 9903, 2213, -3, 10);//bank1
makeGlobalObject(2102, 3160, 4901, -3, 10);//zammystanderd
makeGlobalObject(2102, 3161, 4901, -3, 10);//zammystanderd
makeGlobalObject(2102, 3162, 4901, -3, 10);//zammystanderd
makeGlobalObject(2055, 3158, 4902, -1, 10);//sarastanderd
makeGlobalObject(2055, 3157, 4902, -1, 10);//sarastanderd
makeGlobalObject(2055, 3156, 4902, -1, 10);//sarastanderd
/*End of god wars*/
Make sure u make backup files incase any errors *shouldnt be any
Again I wont tell you where to add the bollens and the ints.
25% credits go to d d 3
75% credits go to Mod Damo