New stuff 6 (#325)

* 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
This commit is contained in:
Gptaqbc
2019-12-25 16:09:25 -05:00
committed by Daniel Ginovker
parent 5f500280b2
commit aa6b9a9aa0
7 changed files with 2 additions and 2 deletions
@@ -967,7 +967,7 @@ public class NpcHandler {
// These npcs shouldn't have drops
return;
}
for (ItemDrop possible_drop : NPCDropsHandler.NPC_DROPS(getNpcListName(npcs[i].npcType).toLowerCase(), npcs[i].npcType)) {
for (ItemDrop possible_drop : NPCDropsHandler.NPC_DROPS(getNpcListName(npcs[i].npcType).toLowerCase().replace(" ", "_"), npcs[i].npcType)) {
if (Misc.random(possible_drop.getChance()) == 0) {
int amt = possible_drop.getAmount();
GameEngine.itemHandler.createGroundItem(c, possible_drop.getItemID(), npcs[i].absX, npcs[i].absY, amt, c.playerId);
@@ -820,7 +820,7 @@ public class Commands implements PacketType {
boolean attackPlayer = NpcHandler.getNpcListCombat(newNPC) > 0;
if (newNPC > 0) {
NpcHandler.spawnNpc(player, newNPC, player.absX, player.absY, player.heightLevel, 0, NpcHandler.getNpcListHP(newNPC), maxHit, attack, defence, attackPlayer, false);
player.getPacketSender().sendMessage("You spawn a " + NpcHandler.getNpcListName(newNPC).toLowerCase() + ".");
player.getPacketSender().sendMessage("You spawn a " + NpcHandler.getNpcListName(newNPC) + ".");
//player.npcSpawned = newNPC;
} else {
player.getPacketSender().sendMessage("Npc " + newNPC + " does not exist.");