mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-05 16:49:06 +00:00
Gptaqbc new stuff 6 (#328)
* Some stuff on weight Some stuff on weight * Cleaned some code related to trading and fixed most likely the issue where the player stays busy and cant trade till relog Cleaned some code related to trading and fixed most likely the issue where the player stays busy and cant trade till relog * removed a shitload of '== true' I did a search and replace but I manually checked the changes that were made so there shouldn't be any issue with that. * Fixed drop issue * Fixed duel arena, changed some chat message so they are all the same, changed Additem Fixed duel arena: > 98% completed duel (the winning duel sound is still missing) > Added forfeiting > Added checks to prevent tbing, teleothers, teleport and logout from duel > Remove the check for same IP to disable duel Item Assistant: > Changed the AddItem method so it now drops items on the ground if inventory is full Cleaned some stuff while I was at it... * Update ItemAssistant.java Oupsie * Resolving my issues * Allow walking during movement * Why won't commit work Co-authored-by: Gptaqbc <56596815+Gptaqbc@users.noreply.github.com>
This commit is contained in:
@@ -160,7 +160,7 @@ public class GlobalDropsHandler {
|
||||
}
|
||||
if (player.getItemAssistant().freeSlots() < 1) {
|
||||
if (!(player.getItemAssistant().playerHasItem(player.pItemId) && player.getItemAssistant().isStackable(player.pItemId))) {
|
||||
player.getPacketSender().sendMessage("Not enough inventory space...");
|
||||
player.getPacketSender().sendMessage("Not enough space in your inventory.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ public class ItemHandler {
|
||||
ItemList[i] = null;
|
||||
}
|
||||
loadItemList("item.cfg");
|
||||
loadItemPrices("prices.txt");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -327,6 +328,22 @@ public int itemAmount(String name, int itemId, int itemX, int itemY) {
|
||||
ItemList[slot] = newItemList;
|
||||
}
|
||||
|
||||
public void loadItemPrices(String filename) {
|
||||
try {
|
||||
@SuppressWarnings("resource")
|
||||
Scanner s = new Scanner(new File("./data/cfg/" + filename));
|
||||
while (s.hasNextLine()) {
|
||||
String[] line = s.nextLine().split(" ");
|
||||
ItemList temp = getItemList(Integer.parseInt(line[0]));
|
||||
if (temp != null) {
|
||||
temp.ShopValue = Integer.parseInt(line[1]);
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public ItemList getItemList(int i) {
|
||||
for (com.rebotted.game.items.ItemList element : ItemList) {
|
||||
if (element != null) {
|
||||
@@ -359,7 +376,7 @@ public int itemAmount(String name, int itemId, int itemX, int itemY) {
|
||||
Misc.println(FileName + ": error loading file.");
|
||||
// return false;
|
||||
}
|
||||
while (!EndOfFile && line != null) {
|
||||
while (EndOfFile == false && line != null) {
|
||||
line = line.trim();
|
||||
int spot = line.indexOf("=");
|
||||
if (spot > -1) {
|
||||
|
||||
Reference in New Issue
Block a user