|
Ok so when you Use the effigy it doesn't Disappear and give you then next stage it just Removes the effigy completely
http://puu.sh/8Xx5Z.jpg
http://puu.sh/8Xx6n.jpg
Code:public static void effigyInvestigation(Player player, int id) { Inventory inv = player.getInventory(); inv.deleteItem(id, 1); if (inv.containsOneItem(STARVED_ANCIENT_EFFIGY)) inv.addItem(NOURISHED_ANCIENT_EFFIGY, 1); else if (inv.containsOneItem(NOURISHED_ANCIENT_EFFIGY)) inv.addItem(SATED_ANCIENT_EFFIGY, 1); else if (inv.containsOneItem(SATED_ANCIENT_EFFIGY)) inv.addItem(GORGED_ANCIENT_EFFIGY, 1); else if (inv.containsOneItem(GORGED_ANCIENT_EFFIGY)) inv.addItem(DRAGONKIN_LAMP, 1); }
Alright fixed that Cheers deaths, But when i use it, it moves across a inventory slot Now ?
For a better outlook of what actually Happens, it shifts slots and honestly don't know why
http://puu.sh/8XG49
http://puu.sh/8XG5v
I actually fixed this yesterday, use this instead:
You're welcome.Code:Inventory inv = player.getInventory(); switch(id){ case STARVED_ANCIENT_EFFIGY: inv.deleteItem(id, 1); inv.addItem(NOURISHED_ANCIENT_EFFIGY, 1); break; case NOURISHED_ANCIENT_EFFIGY: inv.deleteItem(id, 1); inv.addItem(SATED_ANCIENT_EFFIGY, 1); break; case SATED_ANCIENT_EFFIGY: inv.deleteItem(id, 1); inv.addItem(GORGED_ANCIENT_EFFIGY, 1); break; case GORGED_ANCIENT_EFFIGY: inv.deleteItem(id, 1); inv.addItem(DRAGONKIN_LAMP, 1); break; default: player.closeInterfaces(); break; }
Edit: The reason your code doesn't work is; it deletes the item first, THEN checks if the inventory still contains the item (which it obviously doesn't anymore as it deleted it first), then do code. There's no code to run as the inventory doesn't contain any of the item cases.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |