Purpose: To add a nice holiday event!
Difficulty: 2/10
Assumed Knowledge: How to copy and paste, how to not cause 100 errors (stupid noobs), know how to fix your errors if you get any.
Server Base: Dodian AKA devolution but should work on all
Classes Modified: Client.java, NPCHandler.java
Procedure
Step 1: Adding The Voids...
Find:
Code:
public class client extends Player implements Runnable {
Underneath that add:
Code:
public int cpoints = 0;
public void loadChristmasevent() {
IsSnowing = 1;
sendQuest("Christmas", 640);
sendQuest("Event",663);
/*Free Quests*/
sendQuest("@[email protected] Event", 7332);
sendQuest("@[email protected] chickens for", 7333);
sendQuest("@[email protected] points and", 7334);
sendQuest("@[email protected] them below.", 7336);
sendQuest("", 7383);
sendQuest("@[email protected] Points:", 7339);
sendQuest("", 7340);
sendQuest("@[email protected]:", 7346);
sendQuest("@[email protected] Phat - 125", 7341);
sendQuest("@[email protected] Phat - 130", 7342);
sendQuest("@[email protected] Phat - 140", 7337);
sendQuest("@[email protected] Phat - 145", 7343);
sendQuest("@[email protected] Phat - 150", 7335);
sendQuest("@[email protected] Phat - 170", 7344);
sendQuest("@[email protected] @[email protected] - 350", 7345);
sendQuest("", 7347);
sendQuest("", 7348);
}
Then find;
Code:
public boolean process()
Underneath it add:
Search for:
Underneath it add or replace your quests with this:
Code:
case 28164:
case 28165:
case 28166:
case 28168:
case 28215:
case 28171:
case 28170:
case 28172:
case 28178:
break;
case 28173:
if (cpoints > 124) {
cpoints -= 125;
addItem(1046, 1);
} else if (cpoints < 125) {
sendMessage("You need 125 points to buy a purple phat");
sendMessage("You currently have: " + cpoints + ".");
}
break;
case 28174:
if (cpoints > 129) {
cpoints -= 130;
addItem(1040, 1);
} else if (cpoints < 130) {
sendMessage("You need 130 points to buy a yellow phat");
sendMessage("You currently have: " + cpoints + ".");
}
break;
case 28169:
if (cpoints > 139) {
cpoints -= 140;
addItem(1038, 1);
} else if (cpoints < 140) {
sendMessage("You need 140 points to buy a red phat");
sendMessage("You currently have: " + cpoints + ".");
}
break;
case 28175:
if (cpoints > 144) {
cpoints -= 145;
addItem(1044, 1);
} else if (cpoints < 145) {
sendMessage("You need 145 points to buy a green phat");
sendMessage("You currently have: " + cpoints + ".");
}
break;
case 28167:
if (cpoints > 149) {
cpoints -= 150;
addItem(1042, 1);
} else if (cpoints < 150) {
sendMessage("You need 150 points to buy a blue phat");
sendMessage("You currently have: " + cpoints + ".");
}
break;
case 28176:
if (cpoints > 169) {
cpoints -= 170;
addItem(1048, 1);
} else if (cpoints < 170) {
sendMessage("You need 170 points to buy a white phat");
sendMessage("You currently have: " + cpoints + ".");
}
break;
case 28177:
if (cpoints > 349) {
cpoints -= 350;
addItem(1050, 1);
} else if (cpoints < 350) {
sendMessage("You need 350 points to buy a santa hat");
sendMessage("You currently have: " + cpoints + ".");
}
break;
case 28179:
case 28180:
break;
Find:
Underneath it add:
Code:
} else if (token.equals("character-ChristmasPoints")) {
cpoints = Integer.parseInt(token2);
Then find:
Code:
characterfile.write("character-energy = ", 0, 19);
Underneath add:
Code:
characterfile.newLine();
characterfile.write("character-ChristmasPoints = ", 0, 25);
characterfile.write(Integer.toString(cpoints), 0, Integer.toString(cpoints).length());
characterfile.newLine();
Step 2: Adding The Points...
Find:
Code:
if (npcs[i].npcType == 50) {
Underneath it add:
Code:
if (npcs[i].npcType == ANYNPCIDYOUWANTHERE) {
client c = (client) PlayerHandler.players[GetNpcKiller(i)];
c.cpoints += 2;
c.sendMessage("You killed the chicken and recieve 2 points.");
}
REMEMBER TO CHANGE THE "ANYNPCIDYOUWANTHERE" TO A NPC ID!
Feel free to edit but do not leech
Credits: Me 100%