merge latest version, fix up gradle depends

This commit is contained in:
mstoppelli
2018-12-07 01:38:09 -05:00
56 changed files with 3892 additions and 386 deletions

View File

@@ -12,6 +12,7 @@ import java.util.logging.Logger;
import com.wurmonline.server.Servers;
import com.wurmonline.server.behaviours.Action;
import mod.sin.lib.Util;
import mod.sin.items.caches.*;
import org.gotti.wurmunlimited.modloader.ReflectionUtil;
import org.gotti.wurmunlimited.modloader.classhooks.HookManager;
import org.gotti.wurmunlimited.modloader.classhooks.InvocationHandlerFactory;
@@ -37,7 +38,8 @@ import mod.sin.weapons.titan.*;
public class ItemMod {
public static Logger logger = Logger.getLogger(ItemMod.class.getName());
public static AffinityCatcher AFFINITY_CATCHER = new AffinityCatcher();
public static AffinityOrb AFFINITY_ORB = new AffinityOrb();
public static ArenaCache ARENA_CACHE = new ArenaCache();
public static ArenaSupplyDepot ARENA_SUPPLY_DEPOT = new ArenaSupplyDepot();
@@ -50,6 +52,7 @@ public class ItemMod {
public static CorpseDecoration CORPSE_DECORATION = new CorpseDecoration();
public static DepthDrill DEPTH_DRILL = new DepthDrill();
public static DisintegrationRod DISINTEGRATION_ROD = new DisintegrationRod();
//public static TitaniumLump ELECTRUM_LUMP = new TitaniumLump();
public static EnchantOrb ENCHANT_ORB = new EnchantOrb();
public static EternalOrb ETERNAL_ORB = new EternalOrb();
public static Eviscerator EVISCERATOR = new Eviscerator();
@@ -104,10 +107,11 @@ public class ItemMod {
public static StableContract STABLE_CONTRACT = new StableContract();
public static MoreAnchors MORE_ANCHORS = new MoreAnchors();
public static WoodEssence WOOD_ESSENCE = new WoodEssence();
public static void createItems(){
logger.info("createItems()");
try{
AFFINITY_CATCHER.createTemplate();
AFFINITY_ORB.createTemplate();
ARENA_CACHE.createTemplate();
ARENA_SUPPLY_DEPOT.createTemplate();
@@ -120,6 +124,7 @@ public class ItemMod {
CORPSE_DECORATION.createTemplate();
DEPTH_DRILL.createTemplate();
DISINTEGRATION_ROD.createTemplate();
//ELECTRUM_LUMP.createTemplate();
ENCHANT_ORB.createTemplate();
ETERNAL_ORB.createTemplate();
EVISCERATOR.createTemplate();
@@ -178,6 +183,8 @@ public class ItemMod {
}
public static void registerActions(){
ModActions.registerAction(new AffinityCatcherCaptureAction());
ModActions.registerAction(new AffinityCatcherConsumeAction());
ModActions.registerAction(new AffinityOrbAction());
ModActions.registerAction(new ArenaCacheOpenAction());
ModActions.registerAction(new ArrowPackUnpackAction());
@@ -190,6 +197,7 @@ public class ItemMod {
ModActions.registerAction(new EnchantOrbAction());
ModActions.registerAction(new EternalOrbAction());
ModActions.registerAction(new FriyanTabletAction());
ModActions.registerAction(new KeyCombinationAction());
ModActions.registerAction(new SealedMapAction());
ModActions.registerAction(new SupplyDepotAction());
ModActions.registerAction(new TreasureBoxAction());
@@ -207,6 +215,7 @@ public class ItemMod {
//COIN_DECORATION.initCreationEntry();
//CORPSE_DECORATION.initCreationEntry();
DEPTH_DRILL.initCreationEntry();
//ELECTRUM_LUMP.initCreationEntry();
EVISCERATOR.initCreationEntry();
KNUCKLES.initCreationEntry();
MASS_STORAGE_UNIT.initCreationEntry();
@@ -288,6 +297,7 @@ public class ItemMod {
new Weapon(Club.templateId, 8.1f, 4.5f, 0.002f, 3, 3, 0.4f, 0.5d);
new Weapon(Knuckles.templateId, 3.6f, 2.1f, 0.002f, 1, 1, 0.2f, 0.5d);
new Weapon(Warhammer.templateId, 9.40f, 5.6f, 0.008f, 4, 3, 1f, 0d);
//new Weapon(ItemList.stoneChisel, 50f, 1f, 0.5f, 8, 1, 3f, -5f);
// Titan weaponry
new Weapon(MaartensMight.templateId, 11, 5, 0.02f, 4, 4, 1.0f, 0d);
new Weapon(RaffehsRage.templateId, 9.5f, 4.25f, 0.02f, 3, 3, 1.0f, 0d);
@@ -328,19 +338,35 @@ public class ItemMod {
}
return -10;
}
private static void setFragments(int templateId, int fragmentCount){
try {
ItemTemplate item = ItemTemplateFactory.getInstance().getTemplate(templateId);
ReflectionUtil.setPrivateField(item, ReflectionUtil.getField(item.getClass(), "fragmentAmount"), fragmentCount);
} catch (IllegalAccessException | NoSuchFieldException | NoSuchTemplateException e) {
e.printStackTrace();
}
}
public static void modifyItems() throws NoSuchTemplateException, IllegalArgumentException, IllegalAccessException, ClassCastException, NoSuchFieldException{
// Make leather able to be combined.
ItemTemplate leather = ItemTemplateFactory.getInstance().getTemplate(ItemList.leather);
ReflectionUtil.setPrivateField(leather, ReflectionUtil.getField(leather.getClass(), "combine"), true);
// Make logs able to be combined.
// Make logs able to be combined. Also reduce their volume.
ItemTemplate log = ItemTemplateFactory.getInstance().getTemplate(ItemList.log);
ReflectionUtil.setPrivateField(log, ReflectionUtil.getField(log.getClass(), "combine"), true);
ReflectionUtil.setPrivateField(log, ReflectionUtil.getField(log.getClass(), "centimetersZ"), 50);
int newVolume = log.getSizeX()*log.getSizeY()*log.getSizeZ();
ReflectionUtil.setPrivateField(log, ReflectionUtil.getField(log.getClass(), "volume"), newVolume);
// Reduce kindling volume as well to make sure they're not larger than logs.
ItemTemplate kindling = ItemTemplateFactory.getInstance().getTemplate(ItemList.kindling);
ReflectionUtil.setPrivateField(kindling, ReflectionUtil.getField(kindling.getClass(), "centimetersY"), 10);
ReflectionUtil.setPrivateField(kindling, ReflectionUtil.getField(kindling.getClass(), "centimetersZ"), 10);
int newKindlingVolume = kindling.getSizeX()*kindling.getSizeY()*kindling.getSizeZ();
ReflectionUtil.setPrivateField(kindling, ReflectionUtil.getField(kindling.getClass(), "volume"), newKindlingVolume);
// Set silver mirror price to 10 silver instead of 1 iron.
ItemTemplate handMirror = ItemTemplateFactory.getInstance().getTemplate(ItemList.handMirror);
ReflectionUtil.setPrivateField(handMirror, ReflectionUtil.getField(handMirror.getClass(), "value"), 200000);
@@ -362,6 +388,14 @@ public class ItemMod {
ItemTemplate transmutationRod = ItemTemplateFactory.getInstance().getTemplate(ItemList.rodTransmutation);
ReflectionUtil.setPrivateField(transmutationRod, ReflectionUtil.getField(transmutationRod.getClass(), "value"), 2000000);
// Creature crates to 10 silver.
ItemTemplate creatureCage = ItemTemplateFactory.getInstance().getTemplate(ItemList.creatureCrate);
ReflectionUtil.setPrivateField(creatureCage, ReflectionUtil.getField(creatureCage.getClass(), "value"), 100000);
ReflectionUtil.setPrivateField(creatureCage, ReflectionUtil.getField(creatureCage.getClass(), "fullprice"), true);
// Set transmutation rod to 2 gold instead of 50 silver.
//ItemTemplate transmutationRod = ItemTemplateFactory.getInstance().getTemplate(668);
//ReflectionUtil.setPrivateField(transmutationRod, ReflectionUtil.getField(transmutationRod.getClass(), "value"), 2000000);
// " return this.isTransportable || (this.getTemplateId() >= 510 && this.getTemplateId() <= 513) || this.getTemplateId() == 722 || this.getTemplateId() == 670;"
// Make mailboxes loadable (PvE Only)
@@ -413,8 +447,37 @@ public class ItemMod {
ReflectionUtil.setPrivateField(marbleKeystone, ReflectionUtil.getField(marbleKeystone.getClass(), "decoration"), true);
ItemTemplate skull = ItemTemplateFactory.getInstance().getTemplate(ItemList.skull);
ReflectionUtil.setPrivateField(skull, ReflectionUtil.getField(skull.getClass(), "decoration"), true);
// Modify fragment counts
setFragments(ArmourCache.templateId, 18);
setFragments(ArtifactCache.templateId, 33);
setFragments(CrystalCache.templateId, 11);
setFragments(DragonCache.templateId, 19);
setFragments(GemCache.templateId, 7);
setFragments(MoonCache.templateId, 14);
setFragments(PotionCache.templateId, 18);
setFragments(RiftCache.templateId, 24);
setFragments(TitanCache.templateId, 100);
setFragments(ToolCache.templateId, 27);
setFragments(TreasureMapCache.templateId, 38);
setFragments(AffinityOrb.templateId, 20);
// Tier 4
setFragments(ItemList.statueWorg, 40);
setFragments(ItemList.statueEagle, 40);
// Tier 5
setFragments(ItemList.statueHellHorse, 45);
setFragments(ItemList.statueDrake, 45);
// Tier 6
setFragments(ItemList.statueFo, 50);
setFragments(ItemList.statueMagranon, 50);
setFragments(ItemList.statueLibila, 50);
setFragments(ItemList.statueVynora, 50);
// Still need to override the method for getting spaceLeft
createCustomWeapons();
createCustomArmours();