PDA

View Full Version : [SB508] My Custom Construction For SB508!.



Scar
December 4th, 2010, 10:12
Hello People!, This Is Just My Custom Construction That I Thaught I Would Releace. Its Nothing Special But I Thaught It Would Help Some Newbs :D. Basically Most Of The Codeing Is In Player.Java And ItemOnItem.Java!.
Basically Wat It Dose is You Use A Hammer On A Plank And It Makes A Chair/Table Ect. But There Is More To It.
Difficutly 2/10

Firstly Go To Player.Java And Search For


public class Player {

Right Under That Add In This.


public boolean Con = false;
public int ConTimer = -1;
public int ConAmount = 0;
public int ConXP = 0;
public int ConGet = 0;
public int ConID = 0;

public void ResetSkillSuff()
{
ConTimer = -1;
ConAmount = 0;
ConXP = 0;
ConGet = 0;
ConID = 0;
Con = false;
}

public void ConstructThat(Player p, int XP, int ID, int Get)
{
if(Engine.playerItems.HasItemAmount(this, ID, 1) == false)
{
ResetSkillSuff();
p.frames.sendMessage(this, "You ran out of Oak Planks To Construct.");
}
else
{
p.requestAnim(888, 0);
Engine.playerItems.deleteItem(this, ID, Engine.playerItems.getItemSlot(this, ID), 1);
Engine.playerItems.addItem(this, Get, 1);
p.addSkillXP(XP*p.skillLvl[22] ,22);
p.frames.sendMessage(this, "You make a Oak Chair.");
ConTimer = 3;
ConAmount -= 1;
}
}

Next Search For


public void process() {

And Right Under That Add In This.


if(ConTimer > 0) ConTimer -= 1;

if(ConTimer == 0)
{
if(ConAmount == 0)
{
ConTimer = -1;
}
else
{
ConstructThat(this, ConXP, ConID, ConGet);
}
}

Save And Close Player.Java.

Next Go To ItemOnItem.Java And Search For


PlayerItems pi = new PlayerItems();

Right UnderThat Add In This.


//======================================= CONSCTRUCTION ===============================

if (itemUsed == 2347 && usedWith == 8778 || itemUsed == 2347 && usedWith == 8778) {
player.frames.setString(player, "Make 1", 458, 1);
player.frames.setString(player, "Make 5", 458, 2);
player.frames.setString(player, "Make All", 458, 3);
player.frames.showChatboxInterface(player, 458);
player.ConXP = 2000;
player.ConID = 8778;
player.ConGet = 8312;
player.Con = true;
}

if (itemUsed == 2347 && usedWith == 8780 || itemUsed == 2347 && usedWith == 8780) {
if(player.skillLvl[22] < 50)
{
player.frames.sendMessage(player, "You need level 50 Construction to make this.");
}
else
{
player.frames.setString(player, "Make 1", 458, 1);
player.frames.setString(player, "Make 5", 458, 2);
player.frames.setString(player, "Make All", 458, 3);
player.frames.showChatboxInterface(player, 458);
player.ConXP = 6000;
player.ConID = 8780;
player.ConGet = 8314;
player.Con = true;
}}

if (itemUsed == 2347 && usedWith == 8782 || itemUsed == 2347 && usedWith == 8782) {
if(player.skillLvl[22] < 75)
{
player.frames.sendMessage(player, "You need level 75 Construction to make this.");
}
else
{
player.frames.setString(player, "Make 1", 458, 1);
player.frames.setString(player, "Make 5", 458, 2);
player.frames.setString(player, "Make All", 458, 3);
player.frames.showChatboxInterface(player, 458);
player.ConXP = 15000;
player.ConID = 8782;
player.ConGet = 8315;
player.Con = true;
}}

Save And Close ItemOnItem.Java.

Now Go To ActionButtons.Java And Search For


case 458:

Directly Under Case 458: Add In


if(p.Con == true)
{
p.ConAmount = 1;
p.ConstructThat(p, p.ConXP, p.ConID, p.ConGet);
p.frames.removeShownInterface(p);
p.frames.removeChatboxInterface(p);
}
if(p.Con == true)
{
p.ConAmount = 5;
p.ConstructThat(p, p.ConXP, p.ConID, p.ConGet);
p.frames.removeShownInterface(p);
p.frames.removeChatboxInterface(p);
}
if(p.Con == true)
{
p.ConAmount = 28;
p.ConstructThat(p, p.ConXP, p.ConID, p.ConGet);
p.frames.removeShownInterface(p);
p.frames.removeChatboxInterface(p);
}

If You Have Not Got Case 458 Add This Eny Where You Think It Might Fit In.


case 458:
if(p.Con == true)
{
p.ConAmount = 1;
p.ConstructThat(p, p.ConXP, p.ConID, p.ConGet);
p.frames.removeShownInterface(p);
p.frames.removeChatboxInterface(p);
}
if(p.Con == true)
{
p.ConAmount = 5;
p.ConstructThat(p, p.ConXP, p.ConID, p.ConGet);
p.frames.removeShownInterface(p);
p.frames.removeChatboxInterface(p);
}
if(p.Con == true)
{
p.ConAmount = 28;
p.ConstructThat(p, p.ConXP, p.ConID, p.ConGet);
p.frames.removeShownInterface(p);
p.frames.removeChatboxInterface(p);
}


Save And Close ActionButtons.Java And Then Compile!

You Can Easily Edit The Amount Of Xp Per Cut I Just Typed Enything In. You Could Add More Planks Easily Just Pm Me If You Want Help!.

Hope This Tutorial Helped You! Good Luck!

Scar
December 4th, 2010, 10:47
Please Post Your Opinions :D

pivotgamer84
December 4th, 2010, 17:46
So this is just like: plank on nails = make chair (check for amount of supplies) :kind of deal?

Scar
December 4th, 2010, 18:51
Nop Its Just hammer On Planks And thats it You Can Easily Add Nails Not To hard This Is Just A Base :P

pivotgamer84
December 5th, 2010, 03:53
I know that, I was just wondering if Item1+Item2 = Item3 was the whole plan for this.

I had a similar idea to this, but you would be able to place chairs on the croung, sit on them, and have completely custom houses.

Scar
December 5th, 2010, 07:12
Just Read The Codes :P

Faab234
December 5th, 2010, 09:11
Try to read about naming conventions.

Emtec
December 19th, 2010, 11:34
lol This is a pritty ^^ bad Construction.
Anyway il give u 2/10 for the work ;)

Stacx
December 19th, 2010, 11:53
This is horrible.