use of com.solinia.solinia.Models.SoliniaLootDropEntry in project solinia3-core by mixxit.
the class SoliniaLootFactory method CreateLootDropItem.
public static void CreateLootDropItem(int lootdropid, int itemid, int count, boolean always, int chance, boolean operatorCreated) throws CoreStateInitException {
ISoliniaLootDrop lootdroptable = StateManager.getInstance().getConfigurationManager().getLootDrop(lootdropid);
SoliniaLootDropEntry lootdrop = new SoliniaLootDropEntry();
int id = 1;
for (ISoliniaLootDropEntry entry : lootdroptable.getEntries()) {
if (entry.getId() > id)
id = entry.getId() + 1;
}
lootdrop.setId(id);
lootdrop.setLootdropid(lootdropid);
lootdrop.setItemid(itemid);
lootdrop.setCount(count);
lootdrop.setAlways(always);
lootdrop.setChance(chance);
lootdrop.setOperatorCreated(operatorCreated);
StateManager.getInstance().getConfigurationManager().getLootDrop(lootdropid).getEntries().add(lootdrop);
}
Aggregations