forked from 2009Scape/Server
Implemented Costume Room Bank
Interacting with the fancy dress box in the costume room of a player owned house will allow access to this extra storage. Items stored in this bank count as "worn" when doing treasure trail emote clues.
This commit is contained in:
parent
08ffa6fee6
commit
7538322006
7 changed files with 44 additions and 1 deletions
|
|
@ -192,7 +192,7 @@ public abstract class ClueScrollPlugin extends MapZone implements Plugin<Object>
|
|||
int hasAmt = 0;
|
||||
for (int i = 0; i < equipment.length; i++) {
|
||||
for (int k = 0; k < equipment[i].length; k++) {
|
||||
if (player.getEquipment().contains(equipment[i][k], 1)) {
|
||||
if (player.getEquipment().contains(equipment[i][k], 1) || player.costumeRoomBank.contains(equipment[i][k], 1)) {
|
||||
hasAmt++;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
package content.global.skill.construction.decoration.costume
|
||||
|
||||
import core.game.node.scenery.Scenery
|
||||
import core.game.node.scenery.SceneryBuilder
|
||||
import core.game.interaction.InteractionListener
|
||||
import core.game.interaction.IntType
|
||||
import core.api.*
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
class SnowscapeCostumeRoomBank : InteractionListener {
|
||||
|
||||
val IDs = intArrayOf(18772,18774,18776)
|
||||
|
||||
override fun defineListeners() {
|
||||
on(IDs, IntType.SCENERY, "open"){ player, node ->
|
||||
if (!player.houseManager.isInHouse(player)) {
|
||||
sendMessage(player, "You can only do that in your own house.")
|
||||
return@on true
|
||||
}
|
||||
|
||||
setAttribute(player, "inCostumeRoomBank", true)
|
||||
openBankAccount(player)
|
||||
|
||||
return@on true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -50,6 +50,7 @@ fun permadeath(target: Player) {
|
|||
target.runeSatchel.clear()
|
||||
target.blackSatchel.clear()
|
||||
target.summoningPouches.clear()
|
||||
target.costumeRoomBank.clear()
|
||||
|
||||
// Skills
|
||||
target.skills = Skills(target)
|
||||
|
|
|
|||
|
|
@ -143,6 +143,7 @@ public final class BankContainer extends Container {
|
|||
return;
|
||||
}
|
||||
player.getInterfaceManager().openComponent(762).setCloseEvent((player, c) -> {
|
||||
removeAttribute(player, "inCostumeRoomBank");
|
||||
BankContainer.this.close();
|
||||
return true;
|
||||
});
|
||||
|
|
@ -168,6 +169,7 @@ public final class BankContainer extends Container {
|
|||
return;
|
||||
}
|
||||
player.getInterfaceManager().openComponent(762).setCloseEvent((player1, c) -> {
|
||||
removeAttribute(player, "inCostumeRoomBank");
|
||||
BankContainer.this.close();
|
||||
return true;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -321,6 +321,8 @@ public class Player extends Entity {
|
|||
public final Container runeSatchel = new Container(30, ContainerType.ALWAYS_STACK);
|
||||
// The summoning pouch storage
|
||||
public final Container summoningPouches = new Container(30);
|
||||
// The costume room bank
|
||||
public final BankContainer costumeRoomBank = new BankContainer(this);
|
||||
|
||||
/**
|
||||
* Constructs a new {@code Player} {@code Object}.
|
||||
|
|
@ -1049,6 +1051,9 @@ public class Player extends Entity {
|
|||
* @return Current active bank.
|
||||
*/
|
||||
public BankContainer getBank() {
|
||||
if (getAttribute("inCostumeRoomBank", false)) {
|
||||
return costumeRoomBank;
|
||||
}
|
||||
if (getAttribute("clanbank:enabled",false)) {
|
||||
Player target = Repository.getPlayerByName(this.getCommunication().getCurrentClan());
|
||||
if (target != null) {
|
||||
|
|
|
|||
|
|
@ -389,6 +389,9 @@ class PlayerSaveParser(val player: Player) {
|
|||
|
||||
val summoningPouches = snowscapeData["summoningPouches"]
|
||||
if (summoningPouches != null) player.summoningPouches.parse(summoningPouches as JSONArray)
|
||||
|
||||
val costumeRoomBank = snowscapeData["costumeRoomBank"]
|
||||
if (costumeRoomBank != null) player.costumeRoomBank.parse(costumeRoomBank as JSONArray)
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -658,6 +658,8 @@ class PlayerSaver (val player: Player){
|
|||
|
||||
snowscapeData.put("summoningPouches", saveContainer(player.summoningPouches))
|
||||
|
||||
snowscapeData.put("costumeRoomBank", saveContainer(player.costumeRoomBank))
|
||||
|
||||
root.put("snowscape_data",snowscapeData)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue