Fixes for 1.9
This commit is contained in:
@@ -8,6 +8,7 @@ import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.wurmonline.server.spells.ItemEnchantment;
|
||||
import org.gotti.wurmunlimited.modloader.ReflectionUtil;
|
||||
import org.gotti.wurmunlimited.modsupport.actions.ActionPerformer;
|
||||
import org.gotti.wurmunlimited.modsupport.actions.BehaviourProvider;
|
||||
@@ -138,7 +139,12 @@ public class EnchantOrbAction implements ModAction {
|
||||
}
|
||||
}else {
|
||||
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);
|
||||
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -12,7 +12,9 @@ public class DeityChanges {
|
||||
if(Deities.getDeity(101) != null){ // Edit Thelastdab Player God
|
||||
Deity thelastdab = Deities.getDeity(101);
|
||||
// Set template deity
|
||||
thelastdab.setTemplateDeity(Deities.DEITY_MAGRANON);
|
||||
thelastdab.setMountainGod(true);
|
||||
thelastdab.setHateGod(false); // Rolled Libila
|
||||
// Add some defining affinities
|
||||
thelastdab.setMetalAffinity(true);
|
||||
thelastdab.setDeathProtector(true);
|
||||
@@ -25,6 +27,13 @@ public class DeityChanges {
|
||||
thelastdab.setClayAffinity(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
|
||||
Deity cyberhusky = Deities.getDeity(102);
|
||||
// Add some defining affinities
|
||||
|
||||
@@ -920,6 +920,17 @@ public class MiscChanges {
|
||||
Util.setReason("Hide buff bar icons for sorceries.");
|
||||
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) {
|
||||
throw new HookException(e);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package mod.sin.wyvern;
|
||||
|
||||
import com.wurmonline.server.NoSuchItemException;
|
||||
import com.wurmonline.server.creatures.Creature;
|
||||
import com.wurmonline.server.creatures.NoArmourException;
|
||||
import com.wurmonline.server.items.Item;
|
||||
import com.wurmonline.server.items.ItemList;
|
||||
import com.wurmonline.server.items.NoSpaceException;
|
||||
import com.wurmonline.shared.constants.BodyPartConstants;
|
||||
import com.wurmonline.shared.constants.Enchants;
|
||||
@@ -25,26 +22,34 @@ public class MountedChanges {
|
||||
ArrayList<Item> gear = new ArrayList<>();
|
||||
try {
|
||||
Item leftFoot = creature.getEquippedItem(BodyPartConstants.LEFT_FOOT);
|
||||
leftFoot.setDamage(leftFoot.getDamage()+(leftFoot.getDamageModifier()*0.002f));
|
||||
gear.add(leftFoot);
|
||||
if (leftFoot != null) {
|
||||
leftFoot.setDamage(leftFoot.getDamage() + (leftFoot.getDamageModifier() * 0.002f));
|
||||
gear.add(leftFoot);
|
||||
}
|
||||
} catch (NoSpaceException ignored) {
|
||||
}
|
||||
try {
|
||||
Item rightFoot = creature.getEquippedItem(BodyPartConstants.RIGHT_FOOT);
|
||||
rightFoot.setDamage(rightFoot.getDamage()+(rightFoot.getDamageModifier()*0.002f));
|
||||
gear.add(rightFoot);
|
||||
if (rightFoot != null) {
|
||||
rightFoot.setDamage(rightFoot.getDamage() + (rightFoot.getDamageModifier() * 0.002f));
|
||||
gear.add(rightFoot);
|
||||
}
|
||||
} catch (NoSpaceException ignored) {
|
||||
}
|
||||
try {
|
||||
Item leftHand = creature.getEquippedItem(BodyPartConstants.LEFT_HAND);
|
||||
leftHand.setDamage(leftHand.getDamage()+(leftHand.getDamageModifier()*0.002f));
|
||||
gear.add(leftHand);
|
||||
if (leftHand != null) {
|
||||
leftHand.setDamage(leftHand.getDamage() + (leftHand.getDamageModifier() * 0.002f));
|
||||
gear.add(leftHand);
|
||||
}
|
||||
} catch (NoSpaceException ignored) {
|
||||
}
|
||||
try {
|
||||
Item rightHand = creature.getEquippedItem(BodyPartConstants.RIGHT_HAND);
|
||||
rightHand.setDamage(rightHand.getDamage()+(rightHand.getDamageModifier()*0.002f));
|
||||
gear.add(rightHand);
|
||||
if (rightHand != null) {
|
||||
rightHand.setDamage(rightHand.getDamage() + (rightHand.getDamageModifier() * 0.002f));
|
||||
gear.add(rightHand);
|
||||
}
|
||||
} catch (NoSpaceException ignored) {
|
||||
}
|
||||
for(Item shoe : gear){
|
||||
|
||||
Reference in New Issue
Block a user