Fixes for 1.9
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
leftFoot.setDamage(leftFoot.getDamage()+(leftFoot.getDamageModifier()*0.002f));
|
if (leftFoot != null) {
|
||||||
gear.add(leftFoot);
|
leftFoot.setDamage(leftFoot.getDamage() + (leftFoot.getDamageModifier() * 0.002f));
|
||||||
|
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);
|
||||||
rightFoot.setDamage(rightFoot.getDamage()+(rightFoot.getDamageModifier()*0.002f));
|
if (rightFoot != null) {
|
||||||
gear.add(rightFoot);
|
rightFoot.setDamage(rightFoot.getDamage() + (rightFoot.getDamageModifier() * 0.002f));
|
||||||
|
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);
|
||||||
leftHand.setDamage(leftHand.getDamage()+(leftHand.getDamageModifier()*0.002f));
|
if (leftHand != null) {
|
||||||
gear.add(leftHand);
|
leftHand.setDamage(leftHand.getDamage() + (leftHand.getDamageModifier() * 0.002f));
|
||||||
|
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);
|
||||||
rightHand.setDamage(rightHand.getDamage()+(rightHand.getDamageModifier()*0.002f));
|
if (rightHand != null) {
|
||||||
gear.add(rightHand);
|
rightHand.setDamage(rightHand.getDamage() + (rightHand.getDamageModifier() * 0.002f));
|
||||||
|
gear.add(rightHand);
|
||||||
|
}
|
||||||
} catch (NoSpaceException ignored) {
|
} catch (NoSpaceException ignored) {
|
||||||
}
|
}
|
||||||
for(Item shoe : gear){
|
for(Item shoe : gear){
|
||||||
|
|||||||
Reference in New Issue
Block a user