From b788d13c319c480900d2634009af288b263003a6 Mon Sep 17 00:00:00 2001 From: DPSCryptic <45051384+DPSCryptic@users.noreply.github.com> Date: Fri, 18 Oct 2019 17:18:56 +0200 Subject: [PATCH] My development cryptic (#61) * i dont even know what i changed * Delete Hatchet.java * Delete Tree.java * Delete WoodcuttingEvent.java * wealth command * sell all option * haha --- .../src/redone/game/shops/ShopAssistant.java | 46 +++++++++--------- .../src/redone/net/packets/impl/Bank10.java | 5 +- .../src/redone/net/packets/impl/BankAll.java | 4 +- .../src/redone/net/packets/impl/Commands.java | 7 +++ .../redone/game/shops/ShopAssistant.class | Bin 12748 -> 12861 bytes .../redone/net/packets/impl/Bank10.class | Bin 3022 -> 3038 bytes .../redone/net/packets/impl/BankAll.class | Bin 3531 -> 3536 bytes git | 0 8 files changed, 36 insertions(+), 26 deletions(-) create mode 100644 git diff --git a/2006Redone Server/src/redone/game/shops/ShopAssistant.java b/2006Redone Server/src/redone/game/shops/ShopAssistant.java index 91d03225..190db852 100644 --- a/2006Redone Server/src/redone/game/shops/ShopAssistant.java +++ b/2006Redone Server/src/redone/game/shops/ShopAssistant.java @@ -5,7 +5,9 @@ import redone.game.items.Item; import redone.game.items.ItemAssistant; import redone.game.items.ItemDefinitions; import redone.game.players.Client; +import redone.game.players.Player; import redone.game.players.PlayerHandler; +import redone.net.ActionSender; import redone.util.GameLogger; @@ -21,7 +23,7 @@ public class ShopAssistant { public ShopAssistant(Client client) { player = client; } - + public static final int RANGE_SHOP = 111, PEST_SHOP = 175, CASTLE_SHOP = 112; public boolean shopSellsItem(int itemID) { @@ -170,7 +172,7 @@ public class ShopAssistant { ItemAssistant.getItemName(removeId) + ": currently costs " + ShopValue + " coins" + ShopAdd); } - + public int getCastleItemValue(int id) { switch (id) { /*Red Items*/ @@ -212,14 +214,14 @@ public class ShopAssistant { } return 0; } - - + + public int getPestItemValue(int id) { switch (id) { } return 0; } - + public int getRGItemValue(int id) { switch (id) { case 47: @@ -237,7 +239,7 @@ public class ShopAssistant { } return 0; } - + public int getTokkulValue(int id) { switch (id) { @@ -283,7 +285,7 @@ public class ShopAssistant { } return 0; } - + /** * Sell item to shop (Shop Price) **/ @@ -367,29 +369,27 @@ public class ShopAssistant { } // double ShopValue; // double TotPrice; - int TotPrice2 = 0; String itemName = ItemAssistant.getItemName(itemID).toLowerCase(); - for (int i = amount; i > 0; i--) { - TotPrice2 = (int) Math.floor(getItemShopValue(itemID, 1, true)); - if (player.getItemAssistant().freeSlots() > 0 || player.getItemAssistant().playerHasItem(995)) { - if (ItemDefinitions.getDef()[itemID].isNoteable == false) { - player.getItemAssistant().deleteItem(itemID, player.getItemAssistant().getItemSlot(itemID), 1); - } else { - player.getItemAssistant().deleteItem(itemID, fromSlot, 1); - } - player.getItemAssistant().addItem(995, TotPrice2); - addShopItem(itemID, 1); - if (player.getPlayerAssistant().isPlayer()) { - GameLogger.writeLog(player.playerName, "shopselling", player.playerName + " sold " + itemName + " to store id: " + player.myShopId + " for" + GameLogger.formatCurrency(TotPrice2) + " coins"); - } + int TotPrice2 = (int) Math.floor(getItemShopValue(itemID, amount, true) * amount); //Something about total price of item? + if (player.getItemAssistant().freeSlots() > 0 || player.getItemAssistant().playerHasItem(995)) { //Checks to see if player has room for coins. + if (!ItemDefinitions.getDef()[itemID].isNoteable) { //Check to see if its notable. + player.getItemAssistant().deleteItem(itemID, player.getItemAssistant().getItemSlot(itemID), amount); //don't really understand if the item isn't notable why it still needs to find the slot. } else { - player.getActionSender().sendMessage("You don't have enough space in your inventory."); - break; + player.getItemAssistant().deleteItem(itemID, fromSlot, amount); } + player.getItemAssistant().addItem(995, TotPrice2); //Add the coins to your inventory. + addShopItem(itemID, amount); //Add item to the shop. + if (player.getPlayerAssistant().isPlayer()) { //Logger + GameLogger.writeLog(player.playerName, "shopselling", player.playerName + " sold " + itemName + " to store id: " + player.myShopId + " for" + GameLogger.formatCurrency(TotPrice2) + " coins"); + player.getActionSender().sendMessage("You sold " + amount + " " +itemName + " for " + TotPrice2 + " gp." ); + } + } else { + player.getActionSender().sendMessage("You don't have enough space in your inventory."); } player.getItemAssistant().resetItems(3823); resetShop(player.myShopId); updatePlayerShop(); + player.getActionSender().sendMessage("You sold " + amount + " " +itemName + " for " + TotPrice2 + " gp." ); return true; } return true; diff --git a/2006Redone Server/src/redone/net/packets/impl/Bank10.java b/2006Redone Server/src/redone/net/packets/impl/Bank10.java index b23206b8..73a0e806 100644 --- a/2006Redone Server/src/redone/net/packets/impl/Bank10.java +++ b/2006Redone Server/src/redone/net/packets/impl/Bank10.java @@ -28,14 +28,15 @@ public class Bank10 implements PacketType { player.getPlayerAssistant().useOperate(removeId); break; case 3900: - player.getShopAssistant().buyItem(removeId, removeSlot, 5); + player.getShopAssistant().buyItem(removeId, removeSlot, 10); break; case 3823: if(!player.getItemAssistant().playerHasItem(removeId)) { return; } - player.getShopAssistant().sellItem(removeId, removeSlot, 5); + player.getShopAssistant().sellItem(removeId, removeSlot, 10); + player.getItemAssistant().resetItems(3823); break; case 7423: diff --git a/2006Redone Server/src/redone/net/packets/impl/BankAll.java b/2006Redone Server/src/redone/net/packets/impl/BankAll.java index d2902c23..0ff5824a 100644 --- a/2006Redone Server/src/redone/net/packets/impl/BankAll.java +++ b/2006Redone Server/src/redone/net/packets/impl/BankAll.java @@ -4,6 +4,7 @@ import redone.game.content.random.PartyRoom; import redone.game.items.GameItem; import redone.game.items.Item; import redone.game.players.Client; +import redone.game.players.Player; import redone.net.packets.PacketType; /** @@ -25,7 +26,8 @@ public class BankAll implements PacketType { if(!player.getItemAssistant().playerHasItem(removeId)) { return; } - player.getShopAssistant().sellItem(removeId, removeSlot, 10); + player.getShopAssistant().sellItem(removeId, + removeSlot, player.playerItemsN[removeSlot] ); break; case 7423: diff --git a/2006Redone Server/src/redone/net/packets/impl/Commands.java b/2006Redone Server/src/redone/net/packets/impl/Commands.java index 7b39c444..c979a65e 100644 --- a/2006Redone Server/src/redone/net/packets/impl/Commands.java +++ b/2006Redone Server/src/redone/net/packets/impl/Commands.java @@ -86,6 +86,13 @@ public class Commands implements PacketType { } } + if (playerCommand.equalsIgnoreCase("wealth")) { + + int totalWealth = player.getPlayerAssistant().totalGold(); + player.getActionSender().sendMessage("You currently have " + totalWealth + "gp."); + + } + if (playerCommand.contains("clip") && player.playerRights < 2) { return; } diff --git a/CompiledServer/production/2006rebotted/redone/game/shops/ShopAssistant.class b/CompiledServer/production/2006rebotted/redone/game/shops/ShopAssistant.class index 84feeb037f93e12ee8837135e9c3dc0caf1f2c9e..93ede5c473798762fe59ed5c3035d4fcdd99346e 100644 GIT binary patch delta 4404 zcmb7Gd3;pW75=_AGkI?&50VTdgiHt{APIydtcvVAqAXz%Dk2a=Kuky=8Pp;W6mdtC z=YoKUD^R0tghoJXtJb9!rEXQL;?h>T*;-qzfSQW zvn7qMoI3mrfWdq`f~)a%7-!+PVZ4KP!*~zBi%7g5!3X%zXvZS>2p>l@%}lW96j5b}E9?gf!BjWit># z3EmcT2Bk6NFwJ~zhfV~8OBmMv7_pgdmbeZ(m~Tgi8RnbmFe`wJabp}t9d>fq*JsJk%PXq}dKZPZHQtK*TwH^V zHfOn<%{ewNa5)#7T+ZVUY+mScJ}+{)fEU|b=yDNuy0~A0i_zq=f|uB=bh!ivTvls>Y)s~cnjd$8B$)h@5$Mi)Ovvv(w| z`><=N;p=!k5git= zVcBYgXQFq95qF~5?Tt3W4T<$T(_v%=1i;(pWm!#c= zyNP`7v2Yh}W%x+?KK{t&qb{5H*#60p3VY_&%IgrKhE3AC;#zD1ah-Gv*Qu zIQ`YrqC+n-t8;`3DA0`V=!Upt0nS8E-%4DTE$Q2Y#n>xsvsZ|Fe0!P502g3jJH&I_Jj}(tz6U~q_buMh zX+fj0n1?jUA?8k0JkG{&48sJq&%>xTOBT-cQByO|PuVnBUHDi}U~CfY?j%}`jM5Ix z9@F~9S`coQX2E!i_`PGbw{h6oOC8D3rnLc0OF5#+d;@g9*Lebcq?aqAz(m-Xq?4J9 z&O+54QxucQD8f`lVVdGF1EW!{)=bR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}ecX7*Nfnkf=)K>~N(>`EU%GGi$TPt6z3a)DHQsw;YIYCYe z?ox5~LfctcFw%BU5Ca#;m&RLnZ2Bb-1jlLZJXW6Rve;#*%d;Ii?`eJstlwIn0AF5t z9sKLsf6>Tz2Is^HA-ysM5ub7q`Zv`677rN#^EpOShT<)pA)|$>DSfKlAtU4rm@Pc{ zrkL6=+otzEj^+PdE8n(){`D5VCST*v@Go{En(qwg@pdx(8=7gXc@9WVBWljupOR=i zF}KdWBg#i&d}n|k4DyR1{;*9TE-n({W>|VjN|cnu7?C8Sl47@vF(%`rWrDquB_qe! zCpq>@iE$}2Ar%hFWhUh+hvW`fdB9;=Vn!ZuR9fWZ702Zbg`B+SlzgHfYZTe8zcSTX z25}Nv=~_sVLf@lm2RpI-QzNSEc;o}4svK;RRd%T|=#$rthu+@J0W0E)SixYRCmhhD K6Vf`)#-6`D&v2Ch delta 556 zcmYk3O=uHQ6otQ=WG0!(2Y{Kb!jSOhy9At61Q)ZE9IHdnew&D(!4PkwgiJH z$eOKd9FI$)Qe5M)YQujHJ@s~_Bp?`9*0Cp^(G{Ls{ht6SY5MdCMo5ZYq(}Cz$(?KYi)04@n=L9{|g-rzk16g z78<@bxn|l9NR~FQWZLTisha=8Ix0!O+nx)*#PeUBulfq}FbtM!VkFTq{wbE~(mwm_7Uh+~ShC6i mr3l;PJ^e}sZSux{72na4a#GP&CzDC1vS~d!VNl0~82SfNoN5gK diff --git a/CompiledServer/production/2006rebotted/redone/net/packets/impl/BankAll.class b/CompiledServer/production/2006rebotted/redone/net/packets/impl/BankAll.class index 24cf72ef2a95b5688bcebaa3ba262dcbd5c00246..614676c38c6036de8438fccec840b73ed493c167 100644 GIT binary patch delta 703 zcmY+BTS!z<6o$XOoH@=pogte#8BQUjn76!4)-!cu-1MRd>b4H`Aq8A zXHh>^RV}3hHrKgoa|73A5S`vkrnk6lb0?_{aW|EFHuovB8OC)JQfp{if`Rd`(kKDD zyR)UQ?R2E4t?SHQg&c{vVQ=1eue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