Banking[noting done, no swap, insert]
west7man banking
Files modified: Player.java, ActionButton.java, Main.java, the whole bank folder.
Difficulty: 3/10
Credits: Me. And ofcourse Angel for the first tutorial.
Info:
I didn't use wL to make this. All made by myself. I fixed some stupid problems of the old tut. If you used my old tut and you want to upgrade your old banking then download the bank files again. They are re-made. Then go to the step 5, copy and paste the function isItemStackable to your player.java file and you are done!
Tutorial:
1) Okay, first you need to have finished this tutorial
[Only registered and activated users can see links. Click Here To Register...]
2) Delete your whole bank folder stuff. Replace it with this:
[Only registered and activated users can see links. Click Here To Register...]
3) Now go to test.main.java and delete this old stuff:
[PHP]
import net.varek.rs2d.bank.BankFiveItems;
import net.varek.rs2d.bank.BankOneItem;
import net.varek.rs2d.bank.BankTenItems;
[/PHP]
And replace it with this:
[PHP]
import net.varek.rs2d.bank.StoreWithdrawAll;
import net.varek.rs2d.bank.StoreWithdrawFiveItems;
import net.varek.rs2d.bank.StoreWithdrawOneItem;
import net.varek.rs2d.bank.StoreWithdrawTenItems;
[/PHP]
Add to this stuff:
[PHP]
{ 145 },
{ 117 },
{ 43 }
[/PHP]
This packet
[PHP]
{ 129 }
[/PHP]
And now again, replace this:
[PHP]
new BankOneItem(),
new BankFiveItems(),
new BankTenItems()
[/PHP]
With this
[PHP]
new StoreWithdrawOneItem(),
new StoreWithdrawFiveItems(),
new StoreWithdrawTenItems(),
new StoreWithdrawAll()
[/PHP]
Now you are done with main.java...
4) Head to ActionButton.java
Now find this
[PHP]
switch(button) {
[/PHP]
And after it add to the list this:
[PHP]
case 5387:
player.setWithdrawAs(0);
break;
case 5386:
player.setWithdrawAs(1);
break;
[/PHP]
You are done here!
5) Go to player.java
Find this:
[PHP]
public int[] playerItems = new int[27],playerItemsN = new int[27];
[/PHP]
And replace with this
[PHP]
public int[] playerItems = new int[28],playerItemsN = new int[28];
[/PHP]
Find out if you have this stuff(If not then add it!)
Code:
public int returnPlayerItemCount(int slot){
return playerItemsN[slot];
}
public int returnBankItemCount(int slot){
return bankItemsN[slot];
}
Add this into the ints section.. where all private ints are
[PHP] private int withdrawAs = 0; // 0 is for item 1 is for note[/PHP]
Add this stuff somewhere..:
Code:
public void withdrawItemDelete(int slot, int amount, Player p){
if (p.bankItemsN[slot] > amount-1){
p.bankItemsN[slot] = p.bankItemsN[slot]-amount;
}
if (p.bankItemsN[slot]==0){
p.bankItems[slot] = 0;
p.bankItemsN[slot] = 0;
}
p.resetTempItems();
p.resetBank();
p.resetItems();
}
public void setWithdrawAs(int mode){
withdrawAs = mode;
}
public int retWithdrawAs(){
return withdrawAs;
}
public boolean isItemStackable(int itemID){
if(Item.itemStackable[itemID] == true){
return true;
}else{
return false;
}
}
AND YOU SHOULD BE DONE! (I hope if I didn't miss something, please post if something is missing...)
:ninja: