PDA

View Full Version : [PI] Skill guides



Fire cape
June 20th, 2010, 17:28
Just converted the creativescape skill guides to Pi.

SkillGuides class:


package server.model.players.content;

import server.model.players.*;

/**
* Skill Guides class. Handles the ingame skill menus.
* @author Fire cape
*/
public class SkillGuides {

public static void sendSkillInterface(Client client, int id[]) {
client.getOutStream().createFrameVarSizeWord(53);
client.getOutStream().writeWord(8847);
client.getOutStream().writeWord(id.length);
for (int i = 0; i < id.length; i++) {
client.getOutStream().writeByte(1);
if(id[i] > 0) {
client.getOutStream().writeWordBigEndianA(id[i]+1);
} else {
client.getOutStream().writeWordBigEndianA(0);
}
}
client.getOutStream().endFrameVarSizeWord();
client.flushOutStream();
}

private static int item[] = new int[31];

public static void skillsInterface(Client client, String skill,
int item1ItemId, int item1lvl, String item1lvldef,
int item2ItemId, int item2lvl, String item2lvldef,
int item3ItemId, int item3lvl, String item3lvldef,
int item4ItemId, int item4lvl, String item4lvldef,
int item5ItemId, int item5lvl, String item5lvldef,
int item6ItemId, int item6lvl, String item6lvldef,
int item7ItemId, int item7lvl, String item7lvldef,
int item8ItemId, int item8lvl, String item8lvldef) {

client.getPA().sendFrame126("@dre@"+skill, 8716);
for(int i = 0;i<31;i++) {
item[i] = 0;
}
item[0] = item1ItemId;
item[1] = item2ItemId;
item[2] = item3ItemId;
item[3] = item4ItemId;
item[4] = item5ItemId;
item[5] = item6ItemId;
item[6] = item7ItemId;
item[7] = item8ItemId;
if(item1lvl > 0)
client.getPA().sendFrame126(""+item1lvl,8720);
client.getPA().sendFrame126(""+item1lvldef,8760);
if(item2lvl > 0)
client.getPA().sendFrame126(""+item2lvl,8721);
client.getPA().sendFrame126(""+item2lvldef, 8761);
if(item3lvl > 0)
client.getPA().sendFrame126(""+item3lvl,8722);
client.getPA().sendFrame126(""+item3lvldef,8762);
if(item4lvl > 0)
client.getPA().sendFrame126(""+item4lvl,8723);
client.getPA().sendFrame126(""+item4lvldef, 8763);
if(item5lvl > 0)
client.getPA().sendFrame126(""+item5lvl,8724);
client.getPA().sendFrame126(""+item5lvldef, 8764);
if(item6lvl > 0)
client.getPA().sendFrame126(""+item6lvl,8725);
client.getPA().sendFrame126(""+item6lvldef,8765);
if(item7lvl > 0)
client.getPA().sendFrame126(""+item7lvl,8726);
client.getPA().sendFrame126(""+item7lvldef, 8766);
if(item8lvl > 0)
client.getPA().sendFrame126(""+item8lvl,8727);
client.getPA().sendFrame126(""+item8lvldef, 8767);
client.getPA().sendFrame126("",8849);
client.getPA().sendFrame126("Attack",8846);
client.getPA().sendFrame126("Strength",8823);
client.getPA().sendFrame126("Defence",8824);
client.getPA().sendFrame126("Hitpoints",8827);
client.getPA().sendFrame126("Ranged",8837);
client.getPA().sendFrame126("Magic",8840);
client.getPA().sendFrame126("Prayer",8843);
client.getPA().sendFrame126("RuneCraf",8859);
client.getPA().sendFrame126("Agility",8862);
client.getPA().sendFrame126("Herblore",8865);
client.getPA().sendFrame126("Thieving",15303);
client.getPA().sendFrame126("Crafting",15306);
client.getPA().sendFrame126("Slayer",15309);

sendSkillInterface(client, item);
client.getPA().showInterface(8714);
}
public static void atkInterface(Client client) {
skillsInterface(client, "Attack",
1291, 1, "Bronze",
1293, 1, "Iron",
1295, 5, "Steel",
1297, 10, "Black",
1299, 20, "Mithril",
1301, 30, "Adamant",
1303, 40, "Rune",
1305, 60, "Dragon");
}
public static void strInterface(Client client) {
skillsInterface(client, "Strength",
3196, 5, "Black halberd",
3198, 10, "Mithril halberd",
3200, 15, "Adamant halberd",
3202, 20, "Rune halberd",
3204, 30, "Dragon halberd",
4153, 50, "Granite maul",
6528, 60, "Tzhaar-Ket-Om",
4718, 70, "Dharok's greataxe");
}
public static void defInterface(Client client) {
skillsInterface(client, "Defence",
1139, 1, "Bronze",
1137, 1, "Iron",
1141, 5, "Steel",
1151, 10, "Black",
1143, 20, "Mithril",
1145, 30, "Adamant",
1147, 40, "Rune",
1149, 60, "Dragon");
}
public static void rangeInterface(Client client) {
skillsInterface(client, "Ranged",
1129, 1, "Plain Leather",
1131, 1, "Hard leather",
1133, 20, "Studded leather",
1135, 40, "Green d'hide leather",
2499, 50, "Blue d'hide leather",
2501, 60, "Red d'hide leather",
2503, 70, "Black d'hide leather",
4736, 70, "Karils");
}
public static void prayInterface(Client client) {
skillsInterface(client, "Prayer",
526, 1, "Bones",
532, 1, "Big bones",
534, 1, "Baby dragon bones",
536, 1, "Dragon bones",
6729, 1, "Dagannoth bones",
4812, 1, "Zogre bones",
4830, 1, "Fayrg bones",
4832, 1, "Raurg bones");
}
public static void hpInterface(Client client) {
skillsInterface(client, "Hitpoints",
0, 0, "",
0, 0, "",
0, 0, "",
0, 0, "",
0, 0, "",
0, 0, "",
0, 0, "",
0, 0, "");
}
public static void mageInterface(Client client) {
skillsInterface(client, "Magic",
579, 1, "Wizard",
4089, 40, "Mystic",
7400, 40, "Enchant",
3385, 40, "Splitbark",
6918, 50, "Infinity",
2412, 60, "God capes and staffs",
6914, 70, "Mage's book and Master Wand",
4708, 70, "Ahrims");
}
public static void rcInterface(Client client) {
skillsInterface(client, "Runecrafting",
6422, 1, "Air runes",
6436, 2, "Mind runes",
6438, 20, "Body runes",
6430, 35, "Chaos runes",
561, 44, "Nature runes",
6434, 54, "Law runes",
6432, 65, "Death runes",
565, 77, "Blood runes");
}
public static void agilityInterface(Client client) {
skillsInterface(client, "Agility",
2150, 1, "Gnome stronghold agility course",
2996, 1, "Low-level agility arena",
2996, 20, "Medium-level agility arena",
2996, 40, "High-level agility arena",
1365, 35, "Barberian outpost agility course",
4024, 48, "Ape attol agility course",
964, 52, "Wilderness agility course",
4170, 60, "Werewolf agility course");
}
public static void herbloreInterface(Client client) {
skillsInterface(client, "Agility",
221, 3, "Attack Potion",
235, 5, "Anti-poison Potion",
225, 12, "Strength Potion",
223, 22, "Restore Potion",
1975, 22, "Energy Potion",
239, 30, "Defence Potion",
1526, 38, "Prayer Potion",
221, 45, "Super Attack Potion");
}
public static void thievingInterface(Client client) {
skillsInterface(client, "Thieving",
3241, 1, "Man",
3243, 10, "Farmer",
3245, 25, "Warrior",
3249, 40, "Guard",
3251, 53, "Knights of ardogne",
3255, 70, "Paladin",
3257, 75, "Gnome",
3259, 80, "Hero");
}
public static void craftingInterface(Client client) {
skillsInterface(client, "Crafting",
1059, 1, "Leather",
1777, 10, "Flax into bow string",
1097, 20, "Hard leather",
1065, 57, "Green dragonhide leather",
2487, 66, "Blue dragonhide leather",
2489, 73, "Red dragonhide leather",
2491, 79, "Black dragonhide leather",
6585, 90, "Onyx amulet");
}
public static void slayerInterface(Client client) {
skillsInterface(client, "Slayer",
4133, 1, "Crawling hand",
4134, 10, "Cave crawler",
4140, 45, "Infernal Mage",
4144, 60, "Aberrant Spectre",
4145, 65, "Dust devil",
4147, 75, "Gargoyle",
4148, 80, "Nechryael",
4149, 85, "Abyssal demon");
}
public static void fletchingInterface(Client client) {
skillsInterface(client, "Fletching",
50, 5, "Normal bows",
54, 20, "Oak bows",
60, 35, "Willow bows",
64, 50, "Maple bows",
68, 65, "Yew bows",
892, 75, "Rune arrow",
72, 80, "Magic shortbow",
70, 85, "Magic longbow");

}
public static void miningInterface(Client client) {
skillsInterface(client, "Mining",
436, 1, "Tin & Cooper",
440, 15, "Iron",
442, 30, "Silver",
453, 30, "Coal",
444, 40, "Gold",
447, 55, "Mithril",
449, 70, "Adamant",
451, 85, "Rune");
}
public static void smithingInterface(Client client) {
skillsInterface(client, "Smithing",
2349, 1, "Bronze",
2351, 15, "Iron",
2355, 20, "Silver",
2353, 30, "Steel",
2357, 40, "Gold",
2359, 50, "Mithril",
2361, 70, "Adamant",
2363, 85, "Rune");
}
public static void fishingInterface(Client client) {
skillsInterface(client, "Fishing",
317, 1, "Shrimps",
335, 20, "Trouts",
359, 35, "Tunas",
377, 40, "Lobsters",
371, 50, "Swordfishes",
383, 76, "Sharks",
395, 79, "Sea Turtles",
389, 81, "Manta rays");
}
public static void cookingInterface(Client client) {
skillsInterface(client, "Cooking",
315, 1, "Shrimps",
333, 20, "Trouts",
361, 30, "Tunas",
379, 40, "Lobsters",
373, 50, "Swordfishes",
385, 76, "Sharks",
397, 79, "Sea Turtles",
391, 81, "Manta rays");
}
public static void woodcuttingInterface(Client client) {
skillsInterface(client, "Woodcutting",
1511, 1, "Normal tree",
1521, 15, "Oak tree",
1519, 30, "Willow tree",
6333, 35, "Teak tree",
1517, 45, "Maple tree",
6332, 50, "Mahogany tree",
1515, 60, "Yews tree",
6739, 61, "Dragon axe");
}
public static void firemakingInterface(Client client) {
skillsInterface(client, "Firemaking",
1511, 1, "Tree logs",
1521, 15, "Oak logs",
1519, 30, "Willow logs",
6333, 35, "Teak logs",
1517, 45, "Maple logs",
4544, 49, "Bullseye lantern",
6332, 50, "Mahogany logs",
1515, 60, "Yew logs");
}
public static void farmingInterface(Client client) {
skillsInterface(client, "Farming",
5291, 1, "Guam seed",
5292, 15, "Marrentill seed",
5293, 20, "Tarromin seed",
5295, 30, "Ranarr seed",
5298, 40, "Avanote seed",
5300, 60, "Snapdragon seed",
5302, 72, "Lantadyme seed",
5304, 90, "Torsol seed");
}
}

In clickingbuttons.java:

case 33206:// Attack button
case 34142:
SkillGuides.atkInterface(c);
break;
case 33209:// str button
case 34119:
SkillGuides.strInterface(c);
break;
case 33212: //Defence
case 34120:
SkillGuides.defInterface(c);
break;
case 34133:
case 33215: //Range
SkillGuides.rangeInterface(c);
break;
case 34123:
case 33207: //Hitpoints
//SkillGuides.hpInterface(c);
break;
case 34139:
case 33218: //Prayer
SkillGuides.prayInterface(c);
break;
case 34136:
case 33221: //Magic

SkillGuides.mageInterface(c);
break;
case 34155:
case 33224: //Runecrafting
SkillGuides.rcInterface(c);
break;
case 34158:
case 33210: //Agility
SkillGuides.agilityInterface(c);
break;
case 34161:
case 33213: //Herblore
SkillGuides.herbloreInterface(c);
break;
case 59199:
case 33216: //Theiving
SkillGuides.thievingInterface(c);
break;
case 59202:
case 33219: //craft
SkillGuides.craftingInterface(c);
break;
case 33222: //Fletching
SkillGuides.fletchingInterface(c);
break;
case 59205:
case 47130: //Slayer
SkillGuides.slayerInterface(c);
break;
case 33208: //Mining
SkillGuides.miningInterface(c);
break;
case 33211: //Smithing
SkillGuides.smithingInterface(c);
break;
case 33214: //Fishing
SkillGuides.fishingInterface(c);
break;
case 33217: //Cooking
SkillGuides.cookingInterface(c);
break;
case 33220: //Firemaking
SkillGuides.firemakingInterface(c);
break;
case 33223: //Woodcutting
SkillGuides.woodcuttingInterface(c);
break;
case 54104: //Farming
SkillGuides.farmingInterface(c);
break;

At the top of clickingbuttons with all of your other imports.
Add:

import server.model.players.content.*;


Only the registered members can see the link.

Credits:
R0cky 0wnz
Fire cape

Break
June 20th, 2010, 17:29
Nice job! Thinking about adding.
Great job converting.

samuraiblood2
June 20th, 2010, 17:32
Instead of having a hundred method parameters you could overload the method or use the varargs operator. Either would be less tedious then that.

Fire cape
June 20th, 2010, 17:33
Instead of having a hundred method parameters you could overload the method or use the varargs operator. Either would be less tedious then that.

Thank for the tip.
Theese are the way they were originaly done in creativescape I just converted them.

Jared
June 21st, 2010, 10:00
client.java:146: illegal start of type
package server.model.players.content;
^
client.java:146: ';' expected
package server.model.players.content;
^
client.java:146: illegal start of type
package server.model.players.content;
^
client.java:146: ';' expected
package server.model.players.content;
^
client.java:146: <identifier> expected
package server.model.players.content;
^
client.java:148: illegal start of type
import server.model.players.*;
^
client.java:148: ';' expected
import server.model.players.*;
^
client.java:148: illegal start of type
import server.model.players.*;
^
client.java:148: ';' expected
import server.model.players.*;
^
client.java:148: <identifier> expected
import server.model.players.*;
^
10 errors
Finished!
Press any key to continue . . .

Fenway`
June 21st, 2010, 15:46
PI fails, filled with tons of bugs and dupes and is always leeched

Fire cape
June 21st, 2010, 15:48
PI fails, filled with tons of bugs and dupes and is always leeched

Yes I agree with you.
I wish to improve it though.

Jared
June 21st, 2010, 22:53
so find a new guide?

kickso
July 30th, 2010, 15:44
Where abouts inclient.java do i add the first snippet of code?

=D

Fire cape
July 30th, 2010, 15:45
Where abouts inclient.java do i add the first snippet of code?

=D

You dont thats in its own file named SkillGuides.java.

kickso
July 30th, 2010, 18:16
Thank you, One more thing, Where do I add" import server.model.players.content.*;"

here is the code at the top of my clickingmost.java

public class clickingMost {

public void clicking(int a){
client c = (client) server.playerHandler.players[a]; System.out.println("Clicked button: " + c.actionButtonId + "");
switch(c.actionButtonId) {
case 4169: // Charge arena spells
if (c.arenaSpellTimer <= 0) {
if (!c.playerHasItem(554, 3) || !c.playerHasItem(565, 3)
|| !c.playerHasItem(556, 3)) {
c.sM("You don't have enough runes to cast this spell.");
} else {

Thanks
Kickso

James
July 30th, 2010, 18:31
PI fails, filled with tons of bugs and dupes and is always leeched

Yeah, but if you know how to code, you can fix those easy? Correct?

kickso
July 30th, 2010, 18:40
Yeah, but if you know how to code, you can fix those easy? Correct?

James do you know how to fix my problem ? :)

Fire cape
July 31st, 2010, 09:59
Thank you, One more thing, Where do I add" import server.model.players.content.*;"

here is the code at the top of my clickingmost.java

public class clickingMost {

public void clicking(int a){
client c = (client) server.playerHandler.players[a]; System.out.println("Clicked button: " + c.actionButtonId + "");
switch(c.actionButtonId) {
case 4169: // Charge arena spells
if (c.arenaSpellTimer <= 0) {
if (!c.playerHasItem(554, 3) || !c.playerHasItem(565, 3)
|| !c.playerHasItem(556, 3)) {
c.sM("You don't have enough runes to cast this spell.");
} else {

Thanks
Kickso

Add it at the verry top just under where it says "package server.model.players.packets;"

Mohammad
August 1st, 2010, 04:31
BOW WOW..
Man thanks alot if i could rep i would do it 69065555566 times :D
It really works awesome.

Abc
August 10th, 2010, 17:40
Worked perfectly thanks!

Xetoc
January 20th, 2012, 00:11
Thank you!

Sir Java
March 1st, 2012, 20:22
Thanks been looking for something like this :D

Sir Java
March 1st, 2012, 20:22
Works likes a beast!

examay
March 3rd, 2012, 22:29
Nothing goes in client.java read the tutorial properly!!

I pk newbies i
March 3rd, 2012, 22:37
Thanks will use :)