Clan War ( Script ) Purpose: To Make clans in a server
Difficulty: 4/10 - Takes a while if you only just know what to do!
Server Base: Testscape
Classes Modified: Client.java - ONLY!
Procedure:
Step 1: Open client.java and find this:
Code:
public void ServerHelpMenu()
Now add this exactly above it:
Code:
public void DarkClancommands() {
sendFrame126("@dre@DarkClan Commands", 8144);
clearQuestInterface();
sendFrame126("", 8145);
sendFrame126("@dbl@joinDarkClan - gets you in the clan", 8146);
sendFrame126("@dbl@DarkClanoutfit - special clan outfit", 8147);
sendFrame126("@dbl@DarkClanhq - teleport to clan headquarters", 8148);
sendFrame126("@dre@clanwar - come here when we have a clan war", 8149);
sendQuestSomething(8143);
showInterface(8134);
}
public void HeroClancommands() {
sendFrame126("@dre@HeroClan Commands", 8144);
clearQuestInterface();
sendFrame126("", 8145);
sendFrame126("@dbl@joinHeroClan - gets you in the clan", 8146);
sendFrame126("@dbl@HeroClanoutfit - special clan outfit", 8147);
sendFrame126("@dbl@HeroClanhq - teleport to clan headquarters", 8148);
sendFrame126("@dre@clanwar - come here when we have a clan war", 8149);
sendQuestSomething(8143);
showInterface(8134);
}
Step 2: Still in client.java find this:
Code:
else if (command.equalsIgnoreCase("teletobarrows"))
if(absY >= 3672)
{
sendMessage("You cannot teleport above level 20 wilderness.");
}
else
{
teleportToX = 3565;
teleportToY = 3311;
}
add exactly above that this:
Code:
if (command.equalsIgnoreCase("joinDarkClan")) {
DarkClan = 1;
sendMessage("You have Joined the Dark Side Type ::DarkClancommands for clan commands");
}
if (command.equalsIgnoreCase("DarkClancommands")) {
if (DarkClan == 1) {
DarkClancommands();
} else {
sendMessage("Hey! You have to join the clan first!");
}
}
if (command.equalsIgnoreCase("DarkClanhq")) {
if (DarkClan == 1) {
teleportToX = 2000;
teleportToY = 2000;
} else {
sendMessage("Hey! You have to join the clan first!");
}
}
if (command.equalsIgnoreCase("clanwar")) {
teleportToX = 1500;
teleportToY = 1500;
sendMessage("Defend the clans honor!");
}
if (command.equalsIgnoreCase("DarkClanoutfit")) {
if (DarkClan == 1) {
sendMessage("Wear the clan's colors with pride!");
} else {
sendMessage("Hey! You have to join the clan first!");
}
}
if (command.equalsIgnoreCase("joinHeroClan")) {
HeroClan = 1;
sendMessage("W00T! Your in! Type ::clancommands for clan commands");
}
if (command.equalsIgnoreCase("HeroClancommands")) {
if (HeroClan == 1) {
HeroClancommands();
} else {
sendMessage("Hey! You have to join the clan first!");
}
}
if (command.equalsIgnoreCase("HeroClanhq")) {
if (HeroClan == 1) {
teleportToX = 2000;
teleportToY = 2000;
} else {
sendMessage("Hey! You have to join the clan first!");
}
}
if (command.equalsIgnoreCase("clanwar")) {
teleportToX = 1500;
teleportToY = 1500;
sendMessage("Defend the clans honor!");
}
if (command.equalsIgnoreCase("HeroClanoutfit")) {
if (HeroClan == 1) {
sendMessage("Wear the clan's colors with pride!");
} else {
sendMessage("Hey! You have to join the clan first!");
}
}add the items you want to the clans outfit by adding this in:
Code:
addItem(4214,1);
That adds a crystal bow, change the 4214 to the id no. and the 1 to the amount of that item, change the teleportToX and teleportToY, to your clans headquarters and deathpit
Note: clanwar has to be the same co-ords or you dont get to fight awww!
Step 3: Talking to NPC's to Join!, firstly find this:
Code:
public boolean process
add this directly above it:
Code:
public int HeroClan = 0;
public int DarkClan = 0;
Now search for this:
Code:
else if (NPCID == 1001) // Mage Of Zamorak
{
skillX = server.npcHandler.npcs.absX;
skillY = server.npcHandler.npcs.absY;
NpcWanneTalk = 1001;
}
Add this Directly beneath it:
Code:
else if (NPCID == 198 && HeroClan == 0) //Guild Master
{
sendMessage ("Welcome to the Bright Side!");
HeroClan = 1;
}
else if(HeroClan == 1)
{
sendMessage("You are already in this clan!");
}
else if (NPCID == 410 && DarkClan == 0) //Old Man
{
sendMessage ("Welcome to the Dark Side!");
DarkClan = 1;
}
else if(DarkClan == 1)
{
sendMessage("You are already in the Dark clan!");
}Thats the NPC,s now we have to make it so you cant change when you log out!
Step 4: Firstly find this:
Code:
} else if (token.equals("character-lastlogintime")) {
lastlogintime = Integer.parseInt(token2);
add this beneath it:
Code:
} else if (token.equals("character-HeroClan")) {
goodclan = Integer.parseInt(token2);
} else if (token.equals("character-DarkClan")) {
darkclan = Integer.parseInt(token2);
Now find this:
Code:
characterfile.write("character-lastlogintime = ", 0, 26);
characterfile.write(Integer.toString(playerLastLogin), 0, Integer.toString(playerLastLogin).length());
characterfile.newLine();Under that add this:
Code:
characterfile.write("character-goodclan = ", 0, 23);
characterfile.write(Integer.toString(HeroClan), 0, Integer.toString(goodclan).length());
characterfile.newLine();
characterfile.write("character-darkclan = ", 0, 23);
characterfile.write(Integer.toString(DarkClan), 0, Integer.toString(darkclan).length());
characterfile.newLine();
Step 5: To add the pking area!, open client.java and find this:
Code:
public void checkwildy()
You should see this:
Code:
public void checkwildy()
{
if ((absY <= 10112 && absY >= 3970) || (absY <= 3672))
{
inwildy = false;
}
else
{
inwildy = true;
}
}
public void checkwildy2()
{
if ((absY <= 10112 && absY >= 3970) || (absY <= 3514))
{
inwildy2 = false;
}
else
{
inwildy2 = true;
}
}
Replave that whole code with this:
Code:
public void checkwildy()
{
if((absX >= 2518 && absX <= 2531 && absY >= 4767 && absY <= 4786))
{
inwildy = true;
}
else
{
inwildy = false;
}
}
public void checkwildy2()
{
if((absX >= 2518 && absX <= 2531 && absY >= 4767 && absY <= 4786))
{
inwildy2 = true;
}
else
{
inwildy2 = false;
}
}
To make it so you can have your own little pking zone do this:
Stand in the south-west corner of where you want your safe zone to be, and you get the coords, so lets say where your standing it says 1000, 1001 for example. The 1000 is your x coord,and the 1001 is the y coord. So its like this:
Code:
if((absX >= 1000 && absX <= xcoord && absY >= 1001 && absY <= ycoord))
Now you go to the North east corner and find those coords, lets say those are 1010, 1011
So now it would be this:
Code:
if((absX >= 2518 && absX <= 1010 && absY >= 4767 && absY <= 1011))
Change the co-ords to where ever you want it to be! it also helps if you put the clanwar co-ords in that area!
You also need to add the NPC's spawn points because people would be annoyed if i point in wrong place.
Well then your done. This has no Anti-Leech in it so post all errors you get here! Please dont leech it!
Credits: Rolling on Java - Me 70% and jonyo for making the idea 20% and Slyte for PK zones 10%
Have Fun Pking! In The Clan war!
I will be releasing something that makes your team members go blue and enemies go white! when you join a clan!
Pretty cool eh?
- Rolling on Java!
mitche- 04-02-2007
ya that would be fun i would make a cammel clan
Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.