Fixes for 1.9

This commit is contained in:
Sindusk
2019-04-14 00:24:25 -04:00
parent 550ef20925
commit a5f9c0c48b
5 changed files with 44 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
apply plugin: 'java' apply plugin: 'java'
group "mod.sin" group "mod.sin"
version "1.3" version "1.4"
repositories { repositories {
mavenCentral() mavenCentral()

View File

@@ -8,6 +8,7 @@ import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import com.wurmonline.server.spells.ItemEnchantment;
import org.gotti.wurmunlimited.modloader.ReflectionUtil; import org.gotti.wurmunlimited.modloader.ReflectionUtil;
import org.gotti.wurmunlimited.modsupport.actions.ActionPerformer; import org.gotti.wurmunlimited.modsupport.actions.ActionPerformer;
import org.gotti.wurmunlimited.modsupport.actions.BehaviourProvider; import org.gotti.wurmunlimited.modsupport.actions.BehaviourProvider;
@@ -138,7 +139,12 @@ public class EnchantOrbAction implements ModAction {
} }
}else { }else {
try { try {
Method m = spell.getClass().getDeclaredMethod("precondition", Skill.class, Creature.class, Item.class); Method m;
if (spell instanceof ItemEnchantment){
m = ItemEnchantment.class.getDeclaredMethod("precondition", Skill.class, Creature.class, Item.class);
}else {
m = spell.getClass().getDeclaredMethod("precondition", Skill.class, Creature.class, Item.class);
}
canEnchant = ReflectionUtil.callPrivateMethod(spell, m, player.getChannelingSkill(), performer, target); canEnchant = ReflectionUtil.callPrivateMethod(spell, m, player.getChannelingSkill(), performer, target);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException e) { } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException e) {
e.printStackTrace(); e.printStackTrace();

View File

@@ -12,7 +12,9 @@ public class DeityChanges {
if(Deities.getDeity(101) != null){ // Edit Thelastdab Player God if(Deities.getDeity(101) != null){ // Edit Thelastdab Player God
Deity thelastdab = Deities.getDeity(101); Deity thelastdab = Deities.getDeity(101);
// Set template deity // Set template deity
thelastdab.setTemplateDeity(Deities.DEITY_MAGRANON);
thelastdab.setMountainGod(true); thelastdab.setMountainGod(true);
thelastdab.setHateGod(false); // Rolled Libila
// Add some defining affinities // Add some defining affinities
thelastdab.setMetalAffinity(true); thelastdab.setMetalAffinity(true);
thelastdab.setDeathProtector(true); thelastdab.setDeathProtector(true);
@@ -25,6 +27,13 @@ public class DeityChanges {
thelastdab.setClayAffinity(false); thelastdab.setClayAffinity(false);
thelastdab.setWaterGod(false); thelastdab.setWaterGod(false);
} }
if(Deities.getDeity(102) != null){
Deity reevi = Deities.getDeity(102);
// Set template deity
reevi.setTemplateDeity(Deities.DEITY_MAGRANON);
reevi.setMountainGod(true);
reevi.setWaterGod(false); // Rolled Vynora
}
/*if(Deities.getDeity(102) != null){ // Edit Cyberhusky player god /*if(Deities.getDeity(102) != null){ // Edit Cyberhusky player god
Deity cyberhusky = Deities.getDeity(102); Deity cyberhusky = Deities.getDeity(102);
// Add some defining affinities // Add some defining affinities

View File

@@ -920,6 +920,17 @@ public class MiscChanges {
Util.setReason("Hide buff bar icons for sorceries."); Util.setReason("Hide buff bar icons for sorceries.");
Util.instrumentDescribed(thisClass, ctCommunicator, "sendAddStatusEffect", desc16, "isSendToBuffBar", replace); Util.instrumentDescribed(thisClass, ctCommunicator, "sendAddStatusEffect", desc16, "isSendToBuffBar", replace);
// 1.9 Achievement fix [Bdew]
classPool.getCtClass("com.wurmonline.server.players.Achievements").getMethod("loadAllAchievements", "()V")
.instrument(new ExprEditor(){
@Override
public void edit(MethodCall m) throws CannotCompileException {
if (m.getMethodName().equals("getTimestamp"))
m.replace("$_=com.wurmonline.server.utils.DbUtilities.getTimestampOrNull(rs.getString($1)); " +
"if ($_==null) $_=new java.sql.Timestamp(java.lang.System.currentTimeMillis());");
}
});
} catch (CannotCompileException | NotFoundException | IllegalArgumentException | ClassCastException e) { } catch (CannotCompileException | NotFoundException | IllegalArgumentException | ClassCastException e) {
throw new HookException(e); throw new HookException(e);
} }

View File

@@ -1,10 +1,7 @@
package mod.sin.wyvern; package mod.sin.wyvern;
import com.wurmonline.server.NoSuchItemException;
import com.wurmonline.server.creatures.Creature; import com.wurmonline.server.creatures.Creature;
import com.wurmonline.server.creatures.NoArmourException;
import com.wurmonline.server.items.Item; import com.wurmonline.server.items.Item;
import com.wurmonline.server.items.ItemList;
import com.wurmonline.server.items.NoSpaceException; import com.wurmonline.server.items.NoSpaceException;
import com.wurmonline.shared.constants.BodyPartConstants; import com.wurmonline.shared.constants.BodyPartConstants;
import com.wurmonline.shared.constants.Enchants; import com.wurmonline.shared.constants.Enchants;
@@ -25,26 +22,34 @@ public class MountedChanges {
ArrayList<Item> gear = new ArrayList<>(); ArrayList<Item> gear = new ArrayList<>();
try { try {
Item leftFoot = creature.getEquippedItem(BodyPartConstants.LEFT_FOOT); Item leftFoot = creature.getEquippedItem(BodyPartConstants.LEFT_FOOT);
if (leftFoot != null) {
leftFoot.setDamage(leftFoot.getDamage() + (leftFoot.getDamageModifier() * 0.002f)); leftFoot.setDamage(leftFoot.getDamage() + (leftFoot.getDamageModifier() * 0.002f));
gear.add(leftFoot); gear.add(leftFoot);
}
} catch (NoSpaceException ignored) { } catch (NoSpaceException ignored) {
} }
try { try {
Item rightFoot = creature.getEquippedItem(BodyPartConstants.RIGHT_FOOT); Item rightFoot = creature.getEquippedItem(BodyPartConstants.RIGHT_FOOT);
if (rightFoot != null) {
rightFoot.setDamage(rightFoot.getDamage() + (rightFoot.getDamageModifier() * 0.002f)); rightFoot.setDamage(rightFoot.getDamage() + (rightFoot.getDamageModifier() * 0.002f));
gear.add(rightFoot); gear.add(rightFoot);
}
} catch (NoSpaceException ignored) { } catch (NoSpaceException ignored) {
} }
try { try {
Item leftHand = creature.getEquippedItem(BodyPartConstants.LEFT_HAND); Item leftHand = creature.getEquippedItem(BodyPartConstants.LEFT_HAND);
if (leftHand != null) {
leftHand.setDamage(leftHand.getDamage() + (leftHand.getDamageModifier() * 0.002f)); leftHand.setDamage(leftHand.getDamage() + (leftHand.getDamageModifier() * 0.002f));
gear.add(leftHand); gear.add(leftHand);
}
} catch (NoSpaceException ignored) { } catch (NoSpaceException ignored) {
} }
try { try {
Item rightHand = creature.getEquippedItem(BodyPartConstants.RIGHT_HAND); Item rightHand = creature.getEquippedItem(BodyPartConstants.RIGHT_HAND);
if (rightHand != null) {
rightHand.setDamage(rightHand.getDamage() + (rightHand.getDamageModifier() * 0.002f)); rightHand.setDamage(rightHand.getDamage() + (rightHand.getDamageModifier() * 0.002f));
gear.add(rightHand); gear.add(rightHand);
}
} catch (NoSpaceException ignored) { } catch (NoSpaceException ignored) {
} }
for(Item shoe : gear){ for(Item shoe : gear){