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!
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!