Search in sources :

Example 1 with SoliniaLootDropEntry

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);
}
Also used : ISoliniaLootDropEntry(com.solinia.solinia.Interfaces.ISoliniaLootDropEntry) ISoliniaLootDropEntry(com.solinia.solinia.Interfaces.ISoliniaLootDropEntry) SoliniaLootDropEntry(com.solinia.solinia.Models.SoliniaLootDropEntry) ISoliniaLootDrop(com.solinia.solinia.Interfaces.ISoliniaLootDrop)

Aggregations

ISoliniaLootDrop (com.solinia.solinia.Interfaces.ISoliniaLootDrop)1 ISoliniaLootDropEntry (com.solinia.solinia.Interfaces.ISoliniaLootDropEntry)1 SoliniaLootDropEntry (com.solinia.solinia.Models.SoliniaLootDropEntry)1