Sceptylos
September 1st, 2010, 00:06
Okay, To start off I want to let you guys know I did this from a scratch so please don't flame...
Things to know.
What are you making? A bow stringing system for your 508 Server.
Difficulty 1/10 - This is easy.
What to do? Copy and Paste, Search, Fixing Errors [If Needed]
What files are being modified? ItemOnItem.java, Commands.java, Frames.java
Base used Bulby
Credits 100% me
First, Open ItemOnItem.java and search for something that should say =====FLETCHING===== or so, under it you should see ===FIREMAKING=== well right above firemaking add this code
// ====================================== FLETCHING - STRINGING ================================== Made by Sceptylos
if (itemUsed == 1777 && usedWith == 50 || itemUsed == 50 && usedWith == 1777) {
player.FletchID = 50;
player.FletchGet = 841;
pi.deleteItem(player, 1777, pi.getItemSlot(player, 1777), 14);
player.FletchXP = 35;
player.FletchAmount = 14;
player.FletchThat(player, player.FletchXP, player.FletchID, player.FletchGet);
}
if (itemUsed == 1777 && usedWith == 54 || itemUsed == 54 && usedWith == 1777) {
if(player.skillLvl[9] >= 15)
{
player.FletchID = 54;
player.FletchGet = 843;
pi.deleteItem(player, 1777, pi.getItemSlot(player, 1777), 14);
player.FletchXP = 40;
player.FletchAmount = 14;
player.FletchThat(player, player.FletchXP, player.FletchID, player.FletchGet);
}
else
{
player.frames.sendMessage(player, "You need level 15 fletching to string this bow.");
}
}
if (itemUsed == 1777 && usedWith == 60 || itemUsed == 60 && usedWith == 1777) {
if(player.skillLvl[9] >= 30)
{
player.FletchID = 60;
player.FletchGet = 849;
pi.deleteItem(player, 1777, pi.getItemSlot(player, 1777), 14);
player.FletchXP = 60;
player.FletchAmount = 14;
player.FletchThat(player, player.FletchXP, player.FletchID, player.FletchGet);
}
else
{
player.frames.sendMessage(player, "You need level 30 fletching to string this bow.");
}
}
if (itemUsed == 1777 && usedWith == 64 || itemUsed == 64 && usedWith == 1777) {
if(player.skillLvl[9] >= 45)
{
player.FletchID = 64;
player.FletchGet = 853;
pi.deleteItem(player, 1777, pi.getItemSlot(player, 1777), 14);
player.FletchXP = 100;
player.FletchAmount = 14;
player.FletchThat(player, player.FletchXP, player.FletchID, player.FletchGet);
}
else
{
player.frames.sendMessage(player, "You need level 45 fletching to string this bow.");
}
}
if (itemUsed == 1777 && usedWith == 68 || itemUsed == 68 && usedWith == 1777) {
if(player.skillLvl[9] >= 65)
{
player.FletchID = 68;
player.FletchGet = 857;
pi.deleteItem(player, 1777, pi.getItemSlot(player, 1777), 14);
player.FletchXP = 150;
player.FletchAmount = 14;
player.FletchThat(player, player.FletchXP, player.FletchID, player.FletchGet);
}
else
{
player.frames.sendMessage(player, "You need level 65 fletching to string this bow.");
}
}
if (itemUsed == 1777 && usedWith == 72 || itemUsed == 72 && usedWith == 1777) {
if(player.skillLvl[9] >= 75)
{
player.FletchID = 72;
player.FletchGet = 861;
pi.deleteItem(player, 1777, pi.getItemSlot(player, 1777), 14);
player.FletchXP = 250;
player.FletchAmount = 14;
player.FletchThat(player, player.FletchXP, player.FletchID, player.FletchGet);
}
else
{
player.frames.sendMessage(player, "You need level 75 fletching to string this bow.");
}
}
Now that the bows can be strung how do players get them? Well now open Commands.java and search for "runes" exactly what I put even with the "" and under it add
else if(cmd[0].equals("strings")) {
Engine.playerItems.addItem(p, 1778, 10000);
}
Basicly that spawns them bow strings, noted. Now you just added this and your players might not know yet...So open up Frames.java and search for
setString(p, "Message of the week!", 17, 0);
}
Under that should be the login message of your server simply change it with
setString(p, "Bow Stringing now works 100% do ::strings for strings!",
17, 3);
There! All done. Here's a vid proof of how it works, I would also like to remind you it might not be looking 100% fine I made this off a scratch.
Only the registered members can see the link. (Only the registered members can see the link.)
Things to know.
What are you making? A bow stringing system for your 508 Server.
Difficulty 1/10 - This is easy.
What to do? Copy and Paste, Search, Fixing Errors [If Needed]
What files are being modified? ItemOnItem.java, Commands.java, Frames.java
Base used Bulby
Credits 100% me
First, Open ItemOnItem.java and search for something that should say =====FLETCHING===== or so, under it you should see ===FIREMAKING=== well right above firemaking add this code
// ====================================== FLETCHING - STRINGING ================================== Made by Sceptylos
if (itemUsed == 1777 && usedWith == 50 || itemUsed == 50 && usedWith == 1777) {
player.FletchID = 50;
player.FletchGet = 841;
pi.deleteItem(player, 1777, pi.getItemSlot(player, 1777), 14);
player.FletchXP = 35;
player.FletchAmount = 14;
player.FletchThat(player, player.FletchXP, player.FletchID, player.FletchGet);
}
if (itemUsed == 1777 && usedWith == 54 || itemUsed == 54 && usedWith == 1777) {
if(player.skillLvl[9] >= 15)
{
player.FletchID = 54;
player.FletchGet = 843;
pi.deleteItem(player, 1777, pi.getItemSlot(player, 1777), 14);
player.FletchXP = 40;
player.FletchAmount = 14;
player.FletchThat(player, player.FletchXP, player.FletchID, player.FletchGet);
}
else
{
player.frames.sendMessage(player, "You need level 15 fletching to string this bow.");
}
}
if (itemUsed == 1777 && usedWith == 60 || itemUsed == 60 && usedWith == 1777) {
if(player.skillLvl[9] >= 30)
{
player.FletchID = 60;
player.FletchGet = 849;
pi.deleteItem(player, 1777, pi.getItemSlot(player, 1777), 14);
player.FletchXP = 60;
player.FletchAmount = 14;
player.FletchThat(player, player.FletchXP, player.FletchID, player.FletchGet);
}
else
{
player.frames.sendMessage(player, "You need level 30 fletching to string this bow.");
}
}
if (itemUsed == 1777 && usedWith == 64 || itemUsed == 64 && usedWith == 1777) {
if(player.skillLvl[9] >= 45)
{
player.FletchID = 64;
player.FletchGet = 853;
pi.deleteItem(player, 1777, pi.getItemSlot(player, 1777), 14);
player.FletchXP = 100;
player.FletchAmount = 14;
player.FletchThat(player, player.FletchXP, player.FletchID, player.FletchGet);
}
else
{
player.frames.sendMessage(player, "You need level 45 fletching to string this bow.");
}
}
if (itemUsed == 1777 && usedWith == 68 || itemUsed == 68 && usedWith == 1777) {
if(player.skillLvl[9] >= 65)
{
player.FletchID = 68;
player.FletchGet = 857;
pi.deleteItem(player, 1777, pi.getItemSlot(player, 1777), 14);
player.FletchXP = 150;
player.FletchAmount = 14;
player.FletchThat(player, player.FletchXP, player.FletchID, player.FletchGet);
}
else
{
player.frames.sendMessage(player, "You need level 65 fletching to string this bow.");
}
}
if (itemUsed == 1777 && usedWith == 72 || itemUsed == 72 && usedWith == 1777) {
if(player.skillLvl[9] >= 75)
{
player.FletchID = 72;
player.FletchGet = 861;
pi.deleteItem(player, 1777, pi.getItemSlot(player, 1777), 14);
player.FletchXP = 250;
player.FletchAmount = 14;
player.FletchThat(player, player.FletchXP, player.FletchID, player.FletchGet);
}
else
{
player.frames.sendMessage(player, "You need level 75 fletching to string this bow.");
}
}
Now that the bows can be strung how do players get them? Well now open Commands.java and search for "runes" exactly what I put even with the "" and under it add
else if(cmd[0].equals("strings")) {
Engine.playerItems.addItem(p, 1778, 10000);
}
Basicly that spawns them bow strings, noted. Now you just added this and your players might not know yet...So open up Frames.java and search for
setString(p, "Message of the week!", 17, 0);
}
Under that should be the login message of your server simply change it with
setString(p, "Bow Stringing now works 100% do ::strings for strings!",
17, 3);
There! All done. Here's a vid proof of how it works, I would also like to remind you it might not be looking 100% fine I made this off a scratch.
Only the registered members can see the link. (Only the registered members can see the link.)