/**
* Test for dice in gambling zone.
*/
@Test
public void testDropDice() {
final StendhalRPZone localzone = new StendhalRPZone(ZONE_NAME, 20, 20); // zone with disabled collision detection
final Player player = PlayerTestHelper.createPlayer("bob");
localzone.add(player);
Item item = SingletonRepository.getEntityManager().getItem("dice");
player.equip(item, 1);
assertEquals(0, localzone.getItemsOnGround().size());
item = player.getFirstEquipped("dice");
RPObject parent = item.getContainer();
final RPAction action = new RPAction();
action.put("type", "drop");
action.put("baseitem", item.getID().getObjectID());
action.put(EquipActionConsts.BASE_OBJECT, parent.getID().getObjectID());
action.put(EquipActionConsts.BASE_SLOT, item.getContainerSlot().getName());
action.put("x", player.getX());
action.put("y", player.getY() + 1);
new DropAction().onAction(player, action);
assertEquals(0, player.events().size());
Item[] items = localzone.getItemsOnGround().toArray(new Item[0]);
assertEquals(1, items.length);
assertEquals(0, items[0].getX());
assertEquals(1, items[0].getY());
}