This commit is contained in:
mstoppelli
2018-05-30 01:39:48 -04:00
parent 4ec6d1cbdd
commit e747e15fb2
30 changed files with 553 additions and 45 deletions

View File

@@ -25,7 +25,6 @@ import mod.sin.lib.Util;
import org.gotti.wurmunlimited.modloader.classhooks.HookException;
import org.gotti.wurmunlimited.modloader.classhooks.HookManager;
import org.gotti.wurmunlimited.modsupport.ModSupportDb;
import org.nyxcode.wurm.discordrelay.DiscordRelay;
import java.sql.Connection;
import java.sql.PreparedStatement;
@@ -46,7 +45,6 @@ public class MiscChanges {
}
public static void sendServerTabMessage(String channel, final String message, final int red, final int green, final int blue){
DiscordRelay.sendToDiscord(channel, message, true);
// WARNING: Never change this from a new Runnable. Lambdas are a lie and will break everything.
Runnable r = new Runnable() {
public void run() {
@@ -84,7 +82,6 @@ public class MiscChanges {
sendGlobalFreedomChat(player, slayMessage+slayers, 200, 25, 25);
addPlayerStatsDeath(player.getName());
addPlayerStatsKill(slayers);
DiscordRelay.sendToDiscord("deaths", player.getName()+" "+slayMessage+slayers, true);
}
public static void addPlayerStat(String playerName, String stat){
@@ -314,8 +311,8 @@ public class MiscChanges {
// - Enable creature custom colors - (Used for creating custom color creatures eg. Lilith) - //
CtClass ctCreature = classPool.get("com.wurmonline.server.creatures.Creature");
replace = "{ return true; }";
Util.setBodyDeclared(thisClass, ctCreature, "hasCustomColor", replace);
/** replace = "{ return true; }";
Util.setBodyDeclared(thisClass, ctCreature, "hasCustomColor", replace);**/
// - Increase the amount of checks for new unique spawns by 5x - //
CtClass ctServer = classPool.get("com.wurmonline.server.Server");
@@ -626,10 +623,16 @@ public class MiscChanges {
"}";
Util.instrumentDeclared(thisClass, ctAffinitiesTimed, "add", "getExpires", replace);
Util.setReason("Make weaponsmithing oils actually help with weaponsmithing");
replace = "if($1 == 1016){" +
"return $0.getSpellEffectPower((byte)77);" +
"}";
Util.insertBeforeDeclared(thisClass, ctItem, "getSkillSpellImprovement", replace);
Util.setReason("Make bed QL affect sleep bonus timer.");
CtClass ctPlayerInfo = classPool.get("com.wurmonline.server.players.PlayerInfo");
replace = "secs = "+MiscChanges.class.getName()+".getBedBonus(secs, this.bed);" +
"$_ = $proceed($$);";
replace = "long secs2 = "+MiscChanges.class.getName()+".getBedBonus(secs, this.bed);" +
"$_ = $proceed((int)(this.sleep + secs2));";
Util.instrumentDeclared(thisClass, ctPlayerInfo, "calculateSleep", "setSleep", replace);
Util.setReason("Fix intrateleport block bug.");