Purpose:To add 3rd age mini game
Server Base:Any
Difficulty:5/10
Credits: 80% to me and 20% to Killah for giving me idea for this
STEP 1. - open your npchandler.java and search for
Code:
public void MonsterDropItem(int NPCID)
under that add this
Code:
if(npcs[NPCID].npcType == 52)
{
int Player = npcs[NPCID].StartKilling;
client ppl = (client) server.playerHandler.players[Player];
ppl.sendMessage("Great, You have defeted your first wave of monster, move to another one");
ppl.teleportToX = 2717;
ppl.teleportToY = 9816;
}
if(npcs[NPCID].npcType == 941)
{
int Player = npcs[NPCID].StartKilling;
client ppl = (client) server.playerHandler.players[Player];
ppl.sendMessage("Great, You have defeted your second wave of monster, move to another one");
ppl.teleportToX = 2338;
ppl.teleportToY = 4747;
}
if(npcs[NPCID].npcType == 1590)
{
int Player = npcs[NPCID].StartKilling;
client ppl = (client) server.playerHandler.players[Player];
ppl.sendMessage("Great, You have defeted your last wave of monster, move to the FINAL one");
ppl.teleportToX = 2463;
ppl.teleportToY = 4775;
}
STEP 2. - open your autospawn.cfg and on the end you should see
press enter and above that add this
Code:
spawn = 52 2605 4772 0 3262 3424 3262 3424 1 baby blue drag
spawn = 52 2604 4776 0 3262 3424 3262 3424 1 baby blue drag
spawn = 52 2598 4776 0 3262 3424 3262 3424 1 baby blue drag
spawn = 1589 2606 4774 0 3262 3424 3262 3424 1 baby red drag
spawn = 1589 2602 4780 0 3262 3424 3262 3424 1 baby red drag
spawn = 1589 2598 4772 0 3262 3424 3262 3424 1 baby red drag
spawn = 52 2596 4774 0 3262 3424 3262 3424 1 baby blue drag
spawn = 3376 2600 4778 0 3262 3424 3262 3424 1 baby blk drag
spawn = 3376 2596 4774 0 3262 3424 3262 3424 1 baby blk drag
spawn = 3376 2597 4778 0 3262 3424 3262 3424 1 baby blk drag
spawn = 55 2718 9814 0 2653 9834 2673 9817 1 Blue drag
spawn = 55 2721 9816 0 2653 9834 2673 9817 1 Blue drag
spawn = 55 2719 9825 0 3100 3929 3108 3937 1 blue drag
spawn = 55 2716 9804 0 3262 3424 3262 3424 1 Blue drag
spawn = 941 2722 9821 0 3262 3424 3262 3424 1 Green drag
spawn = 941 2714 9818 0 3262 3424 3262 3424 1 Green drag
spawn = 941 2722 9822 0 3262 3424 3262 3424 1 Green drag
spawn = 941 2712 9808 0 3262 3424 3262 3424 1 Green drag
spawn = 54 2724 9818 0 3262 3424 3262 3424 1 blk drag
spawn = 54 2717 9809 0 3262 3424 3262 3424 1 blk drag
spawn = 54 2715 9827 0 3262 3424 3262 3424 1 blk drag
spawn = 53 2722 9815 0 3262 3424 3262 3424 1 red drag
spawn = 53 2725 9810 0 3262 3424 3262 3424 1 red drag
spawn = 1591 2648 4497 0 3262 3424 3262 3424 1 iron drag
spawn = 1592 2647 4501 0 3262 3424 3262 3424 1 steel drag
spawn = 1591 2645 4501 0 3262 3424 3262 3424 1 iron drag
spawn = 1590 2654 4498 0 3262 3424 3262 3424 1 bronze dragon
spawn = 1592 2660 4495 0 3262 3424 3262 3424 1 steel drag
spawn = 1590 2647 4507 0 3262 3424 3262 3424 1 bronze dragon
spawn = 1615 2463 4781 0 3262 3424 3262 3424 1 abyssal
STEP 3. - open your item2.java and in there add this
Code:
public static int abyssal[] = {4272,4272,4272,4272};
public static int randomAbyssal()
{
return abyssal[(int)(Math.random()*abyssal.length)];
}
STEP 4. - open your client.java and search for
under that press enter and past this in
Code:
if (command.startsWith("3rdage")) {
teleportToX = 2602;
teleportToY = 4773;
sendMessage("Welcome to 3rd age mini game, kill one of these to teleport on other wave");
}
search for
and in there you should see something like this
Code:
case 4499:
if (objectX == 2797 && objectY == 3614)
{
sendMessage("You crawl through the cave");
teleportToX = 2772;
teleportToY = 10231;
}
break;
under break; hit enter one time and add this in
Code:
case 8997:
teleportToX = 2650;
teleportToY = 4508;
break;
now in your client.java search for
Code:
else if(useItemID == 2353 && atObjectID == 2783)//steel
and you should see something like this
Code:
else if(useItemID == 2353 && atObjectID == 2783)//steel
{
initSmithing(2353);
flushOutStream();
}
under the last
press enter and add this in
Code:
else if(useItemID == 4272 && atObjectID == 4130) // reward
{
sendMessage("Well done, you have just finished your mini game, here's your reward :)");
addSkillXP((486000000*playerLevel[6]), 6);
deleteItem(4272,getItemSlot(4272), 1);
addItem(11142, 1);
addItem(11143, 1);
addItem(11144, 1);
addItem(11145, 1);
}
Now in your global objects add this one
Code:
makeGlobalObject(2461, 4783, 4130, 0, 10);//silver chest
!POST ANY ERRORS HERE!