Misc Changes (#633)

* Fix Weight Calculation For Add/Remove Item In ItemAssistant

* Re-Add Simple Stuck Command That Logs To Discord To Prevent Abuse

* Update Discord Log Chanel Var

* Fix int/interface Command

* Add World ID Check To DiscordBot Link Command

* Fix Java Warnings in DiscordBot Link Command
This commit is contained in:
Josh Shippam
2023-03-20 23:35:25 +00:00
committed by GitHub
parent d155a57380
commit e293bde96f
6 changed files with 24 additions and 15 deletions
@@ -515,7 +515,7 @@ public class ItemAssistant {
player.flushOutStream();
}
i = 30;
Weight.calcWeight(player, item, "additem");
Weight.updateWeight(player);
return true;
}
}
@@ -533,7 +533,7 @@ public class ItemAssistant {
}
resetItems(3214);
i = 30;
Weight.calcWeight(player, item, "additem");
Weight.updateWeight(player);
return true;
}
}
@@ -2338,7 +2338,7 @@ public class ItemAssistant {
}
}
resetItems(3214);
Weight.calcWeight(player, id, "deleteitem");
Weight.updateWeight(player);
}
public void deleteItem(int id, int slot, int amount) {
@@ -2353,7 +2353,7 @@ public class ItemAssistant {
player.playerItems[slot] = 0;
}
resetItems(3214);
Weight.calcWeight(player, id, "deleteitem");
Weight.updateWeight(player);
}
}
@@ -13,11 +13,11 @@ public class Weight {
* @param c
* @param item
* @param action
* - deleteitem, additem, equip, unequip.
* - deleteItem, addItem.
*/
public static void calcWeight(Player c, int item, String action) {
double weight = ItemDefinitions.getWeight(item);
if (action.equalsIgnoreCase("deleteitem")) {
if (action.equalsIgnoreCase("deleteItem")) {
if (weight > 99.20) {
c.weight -= weight / 100;
if (c.weight < 0) {
@@ -31,7 +31,7 @@ public class Weight {
c.weight = 0.0;
}
c.getPacketSender().writeWeight((int) c.weight);
} else if (action.equalsIgnoreCase("additem")) {
} else if (action.equalsIgnoreCase("addItem")) {
if (weight > 99.20) {
c.weight += weight / 100;
c.getPacketSender().writeWeight((int) c.weight);
@@ -56,7 +56,7 @@ public class Weight {
calcWeight(player, playerItem, "addItem");
}
}
// Equiped items
// Equipped items
for (int element : player.playerEquipment) {
if (element > -1) {// equipment
if (element == 88) {
@@ -1,7 +1,6 @@
package com.rs2.game.shops;
import com.rs2.Constants;
import com.rs2.game.items.Weight;
import org.apollo.cache.def.ItemDefinition;
import com.rs2.game.bots.BotHandler;
@@ -451,7 +450,6 @@ public class ShopAssistant {
// Add item to the shop
addShopItem(unNotedItemID, amount);
player.getItemAssistant().resetItems(3823);
Weight.updateWeight(player);
resetShop(player.shopId);
updatePlayerShop();
return true;
@@ -613,7 +611,6 @@ public class ShopAssistant {
GameLogger.writeLog(player.playerName, "shopbuying", player.playerName + " bought " + amount + " " + itemName + " for " + totalValue + " " + currencyName + " from store " + shopID + ".");
}
player.getItemAssistant().resetItems(3823);
Weight.updateWeight(player);
resetShop(player.shopId);
updatePlayerShop();
return true; //return TRUE / FALSE Update = shop&Inventory / Doesnt Update