~~~ New Skill: Gladiator + Gladiator Mini-Game ~~~
What is a Gladiator?
A Gladiator is a professional fighter who fights wild animals, or people, for entertainment and prizes
How Gladiator works?
In this case, the gladiator arena will be set in the duel arena
A player will type command - "gladiatorarena" , and be teleported to the arena
Were he will face his first opponent.
When the player kills his first opponent, his prize status will rise
and he will receive Gladiator xp, Thus a new npc will enter the arena...
This will continue until the Gladiator dies, or finishes every npc (extremely hard)
and will be teleported out, and depending on his prize status, he will recieve
a prize based on his prize status..
Video Preview
Coming Soon...
Pictures (MORE COMING TOMMOROW)
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
Procedure
Part 1 - Adding the Gladiator Level
Step 1
Open client.java and search for:
Code:
case 20: //Runecrafting
//sendFrame164(4267);
//sendFrame126("Congratulations, you just advanced a runecrafting level!", 4268);
//sendFrame126("Your runecrafting level is now "+playerLevel[20]+" .", 4269);
sendMessage("Congratulations, you just advanced a runecrafting level.");
//NpcDialogueSend = true;
break;
Under it add:
Code:
case 22: //Gladiator
//sendFrame164(4267);
//sendFrame126("Congratulations, you just advanced a Gladiator level!", 4268);
//sendFrame126("Your Gladiator level is now "+playerLevel[22]+" .", 4269);
sendMessage("Congratulations, you just advanced a Gladiator level.");
//NpcDialogueSend = true;
break;
Step 2
Next search for:
Code:
public void saveStats()
{
and under:
Code:
int Farminglvl = getLevelForXP(playerXP[19]);
add:
Code:
int Gladiatorlvl = getLevelForXP(playerXP[22]);
Then under
Code:
int Farmingxp = playerXP[19];
add:
Code:
int Gladiatorxp = playerXP[22];
Step 3
Next search for:
Code:
public String statName[] = {
and after
add
should be like this
Code:
"runecrafting", "gladiator"
Step 4:
Next search for:
Code:
public boolean addSkillXP(int amount, int skill){
And under:
Code:
int Runecrafting = getLevelForXP(playerXP[20]);
Add:
Code:
int Gladiator = getLevelForXP(playerXP[22]);
Step 5:
Next search for
Code:
if (Runecrafting < getLevelForXP(playerXP[20])) {
playerLevel[20] = getLevelForXP(playerXP[20]);
levelup(20);
updateRequired = true;
appearanceUpdateRequired = true;
}
and under it add:
Code:
if (Gladiator < getLevelForXP(playerXP[22])) {
playerLevel[22] = getLevelForXP(playerXP[22]);
levelup(22);
updateRequired = true;
appearanceUpdateRequired = true;
}
END OF PART 1
Part 2 - Adding the ints, booleans and methods
Step 6:
In client.java search for
Code:
public class client extends Player implements Runnable {
and under it add
Code:
public static int gladiatorTimer = 1;
public static int prizestatus = 0;
public static boolean gladiator = false;
public void finishg() {
gladiatorTimer = 0;
gladiator = false;
teleportToX = 3217;
teleportToY = 3429;
}
public void showgstats() {
sendMessage("Your prize status is "+prizestatus+"");
sendMessage("Your gladiator level is "+playerLevel[22]+"");
sendMessage("You have "+gladiatorTimer+" seconds to kill the enemy");
}
Part 3 - Adding the processes and commands
Step 7:
In client.java search for
or
Code:
public void process()
and under it add
Code:
if(gladiatorTimer > 0) {
gladiatorTimer -= 1;
}
if(prizestatus > 0 && gladiatorTimer == 0) {
int prizestatusy = prizestatus*10;
int prizestatusx = prizestatus*10000;
if(prizestatus > 100) {
addItem(Item2.cgladiator(), 1);
addItem(Item2.cgladiator(), 1);
addItem(Item2.cgladiator(), 1);
addItem(Item2.cgladiator(), 1);
addItem(Item2.cgladiator(), 1);
}
addSkillXP((prizestatusy*playerLevel[22]), 5);
sendMessage("You finished the Gladiator Mini-Game with a Prize Status: "+prizestatus+"");
finishg();
addItem(995, prizestatusx);
prizestatus = 0;
}
Next find where your commands are...
Code:
public void customCommand(String command) {
and add these commands
Code:
if (command.startsWith("gladiatorstats")) {
showgstats();
}
if (command.startsWith("gladiatorarena")) {
server.npcHandler.newNPC(2031, 3350, (3251 + 0), heightLevel, 0, 0, 0, 0, 1, server.npcHandler.GetNpcListHP(2031), false);
gladiatorTimer += 120;
gladiator = true;
teleportToX = 3336;
teleportToY = 3251;
sendMessage("You entered the Gladiator Arena");
}
if (command.startsWith("gladiatorwatch")) {
gladiator = true;
teleportToX = 3330 + misc.random(25);
teleportToY = 3261;
sendMessage("You join the crowd at the Gladiator Arena");
}
Part 4 - Adding The Npc's
Step 8:
In NPCHandler.java search for
Code:
if (npcs[i].actionTimer == 0 && npcs[i].DeadApply == false && npcs[i].NeedRespawn == false) {
and under it add
Code:
int Player = npcs[i].StartKilling;
client p = (client) server.playerHandler.players[Player];
if(client.gladiator = true) {
if (npcs[i].npcType == 2031) {
newNPC(1200, 3350, (3251 + 0), p.heightLevel, 0, 0, 0, 0, 1, server.npcHandler.GetNpcListHP(1200), false);
p.addSkillXP((50*p.playerLevel[22]), 5);
p.showgstats();
client.gladiatorTimer += 60;
npcs[i].animNumber = 0x900;
client.prizestatus = client.prizestatus + 3;
} else if (npcs[i].npcType == 1200){
newNPC(2598, 3350, (3251 + 0), p.heightLevel, 0, 0, 0, 0, 1, server.npcHandler.GetNpcListHP(2598), false);
npcs[i].animNumber = 0x900;
p.addSkillXP((75*p.playerLevel[22]), 5);
p.showgstats();
client.gladiatorTimer += 70;
client.prizestatus = client.prizestatus + 5;
} else if (npcs[i].npcType == 2598){
newNPC(1951, 3350, (3251 + 0), p.heightLevel, 0, 0, 0, 0, 1, server.npcHandler.GetNpcListHP(1951), false);
npcs[i].animNumber = 0x900;
p.addSkillXP((100*p.playerLevel[22]), 5);
p.showgstats();
client.gladiatorTimer += 75;
client.prizestatus = client.prizestatus + 7;
} else if (npcs[i].npcType == 1951){
newNPC(2591, 3350, (3251 + 0), p.heightLevel, 0, 0, 0, 0, 1, server.npcHandler.GetNpcListHP(2591), false);
npcs[i].animNumber = 0x900;
client.gladiatorTimer += 75;
p.addSkillXP((125*p.playerLevel[22]), 5);
p.showgstats();
client.prizestatus = client.prizestatus + 10;
} else if (npcs[i].npcType == 2591){
newNPC(1936, 3350, (3251 + 0), p.heightLevel, 0, 0, 0, 0, 1, server.npcHandler.GetNpcListHP(1936), false);
npcs[i].animNumber = 0x900;
client.gladiatorTimer += 80;
p.addSkillXP((150*p.playerLevel[22]), 5);
p.showgstats();
client.prizestatus = client.prizestatus + 12;
} else if (npcs[i].npcType == 1936){
newNPC(2030, 3350, (3251 + 0), p.heightLevel, 0, 0, 0, 0, 1, server.npcHandler.GetNpcListHP(2030), false);
npcs[i].animNumber = 0x900;
client.gladiatorTimer += 87;
p.addSkillXP((180*p.playerLevel[22]), 5);
p.showgstats();
client.prizestatus = client.prizestatus + 15;
} else if (npcs[i].npcType == 2030){
newNPC(51, 3350, (3251 + 0), p.heightLevel, 0, 0, 0, 0, 1, server.npcHandler.GetNpcListHP(251), false);
npcs[i].animNumber = 0x900;
client.gladiatorTimer += 90;
p.addSkillXP((200*p.playerLevel[22]), 5);
p.showgstats();
client.prizestatus = client.prizestatus + 18;
} else if (npcs[i].npcType == 51){
newNPC(941, 3350, (3251 + 0), p.heightLevel, 0, 0, 0, 0, 1, server.npcHandler.GetNpcListHP(941), false);
npcs[i].animNumber = 0x900;
p.addSkillXP((220*p.playerLevel[22]), 5);
p.showgstats();
client.gladiatorTimer += 90;
client.prizestatus = client.prizestatus + 20;
} else if (npcs[i].npcType == 941){
newNPC(55, 3350, (3251 + 0), p.heightLevel, 0, 0, 0, 0, 1, server.npcHandler.GetNpcListHP(55), false);
npcs[i].animNumber = 0x900;
p.addSkillXP((250*p.playerLevel[22]), 5);
p.showgstats();
client.prizestatus = client.prizestatus + 23;
} else if (npcs[i].npcType == 55){
newNPC(53, 3350, (3251 + 0), p.heightLevel, 0, 0, 0, 0, 1, server.npcHandler.GetNpcListHP(53), false);
npcs[i].animNumber = 0x900;
p.addSkillXP((280*p.playerLevel[22]), 5);
p.showgstats();
client.gladiatorTimer += 90;
client.prizestatus = client.prizestatus + 24;
} else if (npcs[i].npcType == 53){
newNPC(54, 3350, (3251 + 0), p.heightLevel, 0, 0, 0, 0, 1, server.npcHandler.GetNpcListHP(54), false);
npcs[i].animNumber = 0x900;
p.addSkillXP((300*p.playerLevel[22]), 5);
p.showgstats();
client.gladiatorTimer += 90;
client.prizestatus = client.prizestatus + 25;
} else if (npcs[i].npcType == 54){
newNPC(1590, 3350, (3251 + 0), p.heightLevel, 0, 0, 0, 0, 1, server.npcHandler.GetNpcListHP(1590), false);
npcs[i].animNumber = 0x900;
p.addSkillXP((350*p.playerLevel[22]), 5);
p.showgstats();
client.gladiatorTimer += 90;
client.prizestatus = client.prizestatus + 30;
} else if (npcs[i].npcType == 1590){
newNPC(1591, 3350, (3251 + 0), p.heightLevel, 0, 0, 0, 0, 1, server.npcHandler.GetNpcListHP(1591), false);
npcs[i].animNumber = 0x900;
p.addSkillXP((400*p.playerLevel[22]), 5);
p.showgstats();
client.gladiatorTimer += 90;
client.prizestatus = client.prizestatus + 35;
} else if (npcs[i].npcType == 1591){
newNPC(1592, 3350, (3251 + 0), p.heightLevel, 0, 0, 0, 0, 1, server.npcHandler.GetNpcListHP(1592), false);
npcs[i].animNumber = 0x900;
p.addSkillXP((500*p.playerLevel[22]), 5);
client.gladiatorTimer += 100;
p.showgstats();
client.prizestatus = client.prizestatus + 40;
} else if (npcs[i].npcType == 1592){
newNPC(50, 3350, (3251 + 0), p.heightLevel, 0, 0, 0, 0, 1, server.npcHandler.GetNpcListHP(50), false);
npcs[i].animNumber = 0x900;
p.addSkillXP((1000*p.playerLevel[22]), 5);
client.gladiatorTimer += 100;
client.prizestatus = client.prizestatus + 50;
p.sendMessage("You are a Champion Gladiator");
p.finishg();
}
}
Part 5: Adding the Item rewards
Step 9:
Open Item2.java and search for
Code:
public class Item2
{
under it add
Code:
public static int cgladiator[] = {538,662,636,4151,6611,6570,7336,7158,4730,4857,4585,4087,3204,3140,1187,1149, 1575,3140,1575,1575,4119,4119,4119,4119,4119,2503,2503,2503,2503,2503,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1580,5013,5013,5013,1611,1611,1611,1611,1611,1611,1611,1611,1611,1611,1611,1611,2599,2599,2599,2599,2599,2599,4170,4170,4170,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,1635,2683,2683};
public static int cgladiator()
{
return cgladiator[(int)(Math.random()*cgladiator.length)];
}
And your done!
If you use, please comment on it
Please post any errors, and i will help fix
Umm this might be missing some stuff, because i may
have changed it, but ill have a look through it in the morning
Credits: Me
Thanks~
Icepkz :ninja: