![]() |
|
Easter Event - Project Insanity - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Gaming (https://sinister.ly/Forum-Gaming) +--- Forum: PC Gaming (https://sinister.ly/Forum-PC-Gaming) +---- Forum: RuneScape (https://sinister.ly/Forum-RuneScape) +---- Thread: Easter Event - Project Insanity (/Thread-Easter-Event-Project-Insanity) |
Easter Event - Project Insanity - Mod Mark - 04-01-2013 I've been working on an Easter event over Easter. The event is pretty basic, but it will act as a good base, and I'm sure you can branch off of it. So here it is; Server sided: Player class Code: public int EasterEvent = 0;
public int EasterEgg1 = 0;
public int EasterEgg2 = 0;
public int EasterEgg3 = 0;
public int EasterEgg4 = 0;
public int EasterEgg5 = 0;
public int EasterEgg6 = 0;
public int EasterEgg7 = 0;Playersave class Code: } else if (token.equals("EasterEvent")) {
p.EasterEvent = Integer.parseInt(token2);
} else if (token.equals("EasterEgg1")) {
p.EasterEgg1 = Integer.parseInt(token2);
} else if (token.equals("EasterEgg2")) {
p.EasterEgg2 = Integer.parseInt(token2);
} else if (token.equals("EasterEgg3")) {
p.EasterEgg3 = Integer.parseInt(token2);
} else if (token.equals("EasterEgg4")) {
p.EasterEgg4 = Integer.parseInt(token2);
} else if (token.equals("EasterEgg5")) {
p.EasterEgg5 = Integer.parseInt(token2);
} else if (token.equals("EasterEgg6")) {
p.EasterEgg6 = Integer.parseInt(token2);
} else if (token.equals("EasterEgg7")) {
p.EasterEgg7 = Integer.parseInt(token2);
characterfile.write("EasterEvent = ", 0, 14);
characterfile.write(Integer.toString(p.EasterEvent), 0, Integer.toString(p.EasterEvent).length());
characterfile.newLine();
characterfile.write("EasterEgg1 = ", 0, 13);
characterfile.write(Integer.toString(p.EasterEgg1), 0, Integer.toString(p.EasterEgg1).length());
characterfile.newLine();
characterfile.write("EasterEgg2 = ", 0, 13);
characterfile.write(Integer.toString(p.EasterEgg2), 0, Integer.toString(p.EasterEgg2).length());
characterfile.newLine();
characterfile.write("EasterEgg3 = ", 0, 13);
characterfile.write(Integer.toString(p.EasterEgg3), 0, Integer.toString(p.EasterEgg3).length());
characterfile.newLine();
characterfile.write("EasterEgg4 = ", 0, 13);
characterfile.write(Integer.toString(p.EasterEgg4), 0, Integer.toString(p.EasterEgg4).length());
characterfile.newLine();
characterfile.write("EasterEgg5 = ", 0, 13);
characterfile.write(Integer.toString(p.EasterEgg5), 0, Integer.toString(p.EasterEgg5).length());
characterfile.newLine();
characterfile.write("EasterEgg6 = ", 0, 13);
characterfile.write(Integer.toString(p.EasterEgg6), 0, Integer.toString(p.EasterEgg6).length());
characterfile.newLine();
characterfile.write("EasterEgg7 = ", 0, 13);
characterfile.write(Integer.toString(p.EasterEgg7), 0, Integer.toString(p.EasterEgg7).length());
characterfile.newLine();Clickobject class Code: case 302: //First object
if(c.EasterEgg1 == 1) {
c.sendMessage("You cannot do this again");
}else{
c.EasterEvent +=1;
c.EasterEgg1 +=1;
c.getItems().addItem(1961, 1);
if(c.EasterEvent ==1) {
c.sendMessage("You need to find the other 6 eggs");
} else if(c.EasterEvent ==2) {
c.sendMessage("You need to find the other 5 eggs");
} else if(c.EasterEvent ==3) {
c.sendMessage("You need to find the other 4 eggs");
} else if(c.EasterEvent ==4) {
c.sendMessage("You need to find the other 3 eggs");
} else if(c.EasterEvent ==5) {
c.sendMessage("You need to find the other 2 eggs");
} else if(c.EasterEvent ==6) {
c.sendMessage("You need to find the other 1 eggs");
} else if(c.EasterEvent ==7) {
c.sendMessage("<shad=15007744>Congratulations, you found all the eggs! report back to the Easter Bunny");
}
}
break;
case 2977: //Second object
if(c.EasterEgg2 == 1) {
c.sendMessage("You cannot do this again");
}else{
c.EasterEvent +=1;
c.EasterEgg2 +=1;
c.getItems().addItem(5078, 1);
if(c.EasterEvent ==1) {
c.sendMessage("You need to find the other 6 eggs");
} else if(c.EasterEvent ==2) {
c.sendMessage("You need to find the other 5 eggs");
} else if(c.EasterEvent ==3) {
c.sendMessage("You need to find the other 4 eggs");
} else if(c.EasterEvent ==4) {
c.sendMessage("You need to find the other 3 eggs");
} else if(c.EasterEvent ==5) {
c.sendMessage("You need to find the other 2 eggs");
} else if(c.EasterEvent ==6) {
c.sendMessage("You need to find the other 1 eggs");
} else if(c.EasterEvent ==7) {
c.sendMessage("<shad=15007744>Congratulations, you found all the eggs! report back to the Easter Bunny");
}
}
break;
case 2317: //Third object
if(c.EasterEgg3 == 1) {
c.sendMessage("You cannot do this again");
}else{
c.EasterEvent +=1;
c.EasterEgg3 +=1;
c.getItems().addItem(7544, 1);
if(c.EasterEvent ==1) {
c.sendMessage("You need to find the other 6 eggs");
} else if(c.EasterEvent ==2) {
c.sendMessage("You need to find the other 5 eggs");
} else if(c.EasterEvent ==3) {
c.sendMessage("You need to find the other 4 eggs");
} else if(c.EasterEvent ==4) {
c.sendMessage("You need to find the other 3 eggs");
} else if(c.EasterEvent ==5) {
c.sendMessage("You need to find the other 2 eggs");
} else if(c.EasterEvent ==6) {
c.sendMessage("You need to find the other 1 eggs");
} else if(c.EasterEvent ==7) {
c.sendMessage("<shad=15007744>Congratulations, you found all the eggs! report back to the Easter Bunny");
}
}
break;
case 2533: //four object
if(c.EasterEgg4 == 1) {
c.sendMessage("You cannot do this again");
}else{
c.EasterEvent +=1;
c.EasterEgg4 +=1;
c.getItems().addItem(7928, 1);
if(c.EasterEvent ==1) {
c.sendMessage("You need to find the other 6 eggs");
} else if(c.EasterEvent ==2) {
c.sendMessage("You need to find the other 5 eggs");
} else if(c.EasterEvent ==3) {
c.sendMessage("You need to find the other 4 eggs");
} else if(c.EasterEvent ==4) {
c.sendMessage("You need to find the other 3 eggs");
} else if(c.EasterEvent ==5) {
c.sendMessage("You need to find the other 2 eggs");
} else if(c.EasterEvent ==6) {
c.sendMessage("You need to find the other 1 eggs");
} else if(c.EasterEvent ==7) {
c.sendMessage("<shad=15007744>Congratulations, you found all the eggs! report back to the Easter Bunny");
}
}
break;
case 3265: //Five object
if(c.EasterEgg5 == 1) {
c.sendMessage("You cannot do this again");
}else{
c.EasterEvent +=1;
c.EasterEgg5 +=1;
c.getItems().addItem(7929, 1);
if(c.EasterEvent ==1) {
c.sendMessage("You need to find the other 6 eggs");
} else if(c.EasterEvent ==2) {
c.sendMessage("You need to find the other 5 eggs");
} else if(c.EasterEvent ==3) {
c.sendMessage("You need to find the other 4 eggs");
} else if(c.EasterEvent ==4) {
c.sendMessage("You need to find the other 3 eggs");
} else if(c.EasterEvent ==5) {
c.sendMessage("You need to find the other 2 eggs");
} else if(c.EasterEvent ==6) {
c.sendMessage("You need to find the other 1 eggs");
} else if(c.EasterEvent ==7) {
c.sendMessage("<shad=15007744>Congratulations, you found all the eggs! report back to the Easter Bunny!");
}
}
break;
case 354: //Six object
if(c.EasterEgg6 == 1) {
c.sendMessage("You cannot do this again");
}else{
c.EasterEvent +=1;
c.EasterEgg6 +=1;
c.getItems().addItem(7930, 1);
if(c.EasterEvent ==1) {
c.sendMessage("You need to find the other 6 eggs");
} else if(c.EasterEvent ==2) {
c.sendMessage("You need to find the other 5 eggs");
} else if(c.EasterEvent ==3) {
c.sendMessage("You need to find the other 4 eggs");
} else if(c.EasterEvent ==4) {
c.sendMessage("You need to find the other 3 eggs");
} else if(c.EasterEvent ==5) {
c.sendMessage("You need to find the other 2 eggs");
} else if(c.EasterEvent ==6) {
c.sendMessage("You need to find the other 1 eggs");
} else if(c.EasterEvent ==7) {
c.sendMessage("<shad=15007744>Congratulations, you found all the eggs! report back to the Easter Bunny");
}
}
break;
case 3969: //seven object
if(c.EasterEgg7 == 1) {
c.sendMessage("You cannot do this again");
}else{
c.EasterEvent +=1;
c.EasterEgg7 +=1;
c.getItems().addItem(7931, 1);
if(c.EasterEvent ==1) {
c.sendMessage("You need to find the other 6 eggs");
} else if(c.EasterEvent ==2) {
c.sendMessage("You need to find the other 5 eggs");
} else if(c.EasterEvent ==3) {
c.sendMessage("You need to find the other 4 eggs");
} else if(c.EasterEvent ==4) {
c.sendMessage("You need to find the other 3 eggs");
} else if(c.EasterEvent ==5) {
c.sendMessage("You need to find the other 2 eggs");
} else if(c.EasterEvent ==6) {
c.sendMessage("You need to find the other 1 eggs");
} else if(c.EasterEvent ==7) {
c.sendMessage("<shad=15007744>Congratulations, you found all the eggs! report back to the Easter Bunny");
}
}
break;Objectmanager class Code: //Easter Event
c.getPA().checkObjectSpawn(302, 3333, 3333, 2, 10); //pile of eggs
c.getPA().checkObjectSpawn(2977, 3304, 3119, 2, 10); //sand
c.getPA().checkObjectSpawn(3969, 3525, 3483, 2, 10); //pile of skulls
c.getPA().checkObjectSpawn(2317, 2700, 3442, 2, 10); //pile of rubble
c.getPA().checkObjectSpawn(2533, 2969, 3237, 2, 10); //pile of mud
c.getPA().checkObjectSpawn(3265, 3190, 3180, 2, 10); //pile of rocks
c.getPA().checkObjectSpawn(354, 3481, 3276, 2, 10); //crates
c.getPA().checkObjectSpawn(20264, 3420, 3458, 2, 10); //hopperDialoguehandler class Code: /**
*Easter Event
**/
case 89:
sendNpcChat3("Hi. I need some help", "Darkone has stolen all my Easter eggs!", "and hidden them in several locations around the world!", c.talkingNpc, "Easter Bunny");
c.nextChat = 90;
break;
case 90:
sendNpcChat3("Can you please look for them,", "and take them to Sir Jerro", "I heard he was stumbling around castle wars", c.talkingNpc, "Easter Bunny");
c.nextChat = 0;
break;
case 93:
if (c.getItems().playerHasItem(1961, 1) && c.getItems().playerHasItem(5078, 1)
&& c.getItems().playerHasItem(7544, 1) && c.getItems().playerHasItem(7928, 1)
&& c.getItems().playerHasItem(7929, 1) && c.getItems().playerHasItem(7930, 1)
&& c.getItems().playerHasItem(7931, 1)) {
sendNpcChat3("Great! You've brought me the eggs!", "Here, take this spanner, you will have to use it on the egg hopper", "I think the stupid rabbit set it up in a swamp", c.talkingNpc, "Sir Jerro");
c.getItems().addItem(10975, 1);
c.getItems().deleteItem(1961, c.getItems().getItemSlot(1961), 1);
c.getItems().deleteItem(5078, c.getItems().getItemSlot(5078), 1);
c.getItems().deleteItem(7544, c.getItems().getItemSlot(7544), 1);
c.getItems().deleteItem(7929, c.getItems().getItemSlot(7929), 1);
c.getItems().deleteItem(7928, c.getItems().getItemSlot(7928), 1);
c.getItems().deleteItem(7930, c.getItems().getItemSlot(7930), 1);
c.getItems().deleteItem(7931, c.getItems().getItemSlot(7931), 1);
} else {
if (c.getItems().playerHasItem(1961, 0) && c.getItems().playerHasItem(5078, 0)
&& c.getItems().playerHasItem(7544, 0) && c.getItems().playerHasItem(7928, 0)
&& c.getItems().playerHasItem(7929, 0) && c.getItems().playerHasItem(7930, 0)
&& c.getItems().playerHasItem(7931, 0)) {
sendNpcChat2("You have not found all the eggs", "come back when you have found them!", c.talkingNpc, "Sir Jerro");
}
}
break;
/**
*End of Event
**/
}
}ActionHandler class Code: case 1835:
c.getDH().sendDialogues(89, npcType);
break;
case 988:
c.getDH().sendDialogues(93, npcType);
break;Itemonobject class Code: if (itemId == 10975 && c.objectId == 20264) {
c.getItems().deleteItem(10975, 1);
c.getItems().addItem(227, 1);
c.sendMessage("<shad=10073213>You manage to fix the loose bolt on the egg hopper...</shad>");
c.sendMessage("<shad=10073213>...................</shad>");
c.sendMessage("<shad=10073213>You here a slight clutter coming from the machine..</shad>");
c.sendMessage("<shad=10073213>It shoots out a random reward, you manage to catch it in your inventory!</shad>");
c.sendMessage("<shad=321363>Happy Easter! On behalf of all of us at Infexis!</shad>");
}Client sided objectDef class Code: if (i == 302) {
objectDef.name = "Pile of eggs";
objectDef.description = "I think this is related to the easter event!".getBytes();
objectDef.itemActions = new String[5];
objectDef.itemActions[0] = "search";
objectDef.hasActions = true;
}
if (i == 3969) {
objectDef.name = "Pile of skulls";
objectDef.description = "I think this is related to the easter event!".getBytes();
objectDef.itemActions = new String[5];
objectDef.itemActions[0] = "search";
objectDef.hasActions = true;
}Easter Event - Project Insanity - One - 04-02-2013 Nice work, thanks for the share. Easter Event - Project Insanity - infamous_CnC - 04-02-2013 Just sent this to a friend who is running a server of his own. He says thanks! RE: Easter Event - Project Insanity - Mod Mark - 04-02-2013 (04-02-2013, 01:39 AM)Zombie Wrote: Just sent this to a friend who is running a server of his own. Awesome! EDIT: Has he added it to his server yet? |