From f7057005d7d475df10da12f2e9b8dbcb338e2a2a Mon Sep 17 00:00:00 2001 From: "Luis C.M" <42545778+c0508383@users.noreply.github.com> Date: Sun, 17 Mar 2024 01:14:15 -0500 Subject: [PATCH 1/2] Fixed armor being offset during animations --- .../noppes/npcs/client/model/ModelMPM.java | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/main/java/noppes/npcs/client/model/ModelMPM.java b/src/main/java/noppes/npcs/client/model/ModelMPM.java index 47e38da6f..d778d53d3 100644 --- a/src/main/java/noppes/npcs/client/model/ModelMPM.java +++ b/src/main/java/noppes/npcs/client/model/ModelMPM.java @@ -351,8 +351,10 @@ public class ModelMPM extends ModelNPCMale{ Frame frame = animation.frames.get(animation.currentFrame); if (frame.frameParts.containsKey(EnumAnimationPart.FULL_MODEL)) { FramePart part = frame.frameParts.get(EnumAnimationPart.FULL_MODEL); - part.interpolateOffset(); - part.interpolateAngles(); + if (!this.isArmor) { + part.interpolateOffset(); + part.interpolateAngles(); + } float pi = 180 / (float) Math.PI; GL11.glTranslatef(part.prevPivots[0], part.prevPivots[1], part.prevPivots[2]); GL11.glRotatef(part.prevRotations[0] * pi, 1, 0, 0); @@ -650,11 +652,13 @@ public class ModelMPM extends ModelNPCMale{ if (part != null) { if (part.part != EnumAnimationPart.FULL_MODEL) { ModelRenderer modelRenderer = animPartToModel.get(part.part); - part.interpolateAngles(); + if (!this.isArmor) { + part.interpolateAngles(); + } modelRenderer.rotateAngleX = part.prevRotations[0]; modelRenderer.rotateAngleY = part.prevRotations[1]; modelRenderer.rotateAngleZ = part.prevRotations[2]; - } else { + } else if (!this.isArmor) { part.interpolateAngles(); } } @@ -665,20 +669,24 @@ public class ModelMPM extends ModelNPCMale{ if (part != null) { if (part.part != EnumAnimationPart.FULL_MODEL) { ModelRenderer modelRenderer = animPartToModel.get(part.part); - part.interpolateOffset(); + if (!this.isArmor) { + part.interpolateOffset(); + } modelRenderer.rotationPointX += part.prevPivots[0]; modelRenderer.rotationPointY += part.prevPivots[1]; modelRenderer.rotationPointZ += part.prevPivots[2]; - } else { + } else if (!this.isArmor) { part.interpolateOffset(); } } } - if (frame.frameParts.containsKey(EnumAnimationPart.FULL_MODEL)) { + if (frame.frameParts.containsKey(EnumAnimationPart.FULL_MODEL) && !this.isArmor) { FramePart part = frame.frameParts.get(EnumAnimationPart.FULL_MODEL); - part.interpolateOffset(); - part.interpolateAngles(); + if (!this.isArmor) { + part.interpolateOffset(); + part.interpolateAngles(); + } float pi = 180 / (float) Math.PI; GL11.glTranslatef(part.prevPivots[0],part.prevPivots[1],part.prevPivots[2]); GL11.glRotatef(part.prevRotations[0] * pi,1,0,0); From 3784fa471cf455c24f3abef32acc39b4b1934f0c Mon Sep 17 00:00:00 2001 From: "Luis C.M" <42545778+c0508383@users.noreply.github.com> Date: Sun, 17 Mar 2024 01:27:21 -0500 Subject: [PATCH 2/2] Added configs for toggling the party system and allowing the toggling of friendly fire --- .../java/noppes/npcs/config/ConfigMain.java | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/main/java/noppes/npcs/config/ConfigMain.java b/src/main/java/noppes/npcs/config/ConfigMain.java index 7fa364ad9..8cfaf4e20 100644 --- a/src/main/java/noppes/npcs/config/ConfigMain.java +++ b/src/main/java/noppes/npcs/config/ConfigMain.java @@ -17,6 +17,7 @@ public class ConfigMain public final static String NPC = "NPC"; public final static String UPDATE = "Update"; public final static String SYNC = "SYNC"; + public final static String PARTY = "PARTY"; /** * General Main Properties @@ -67,6 +68,12 @@ public class ConfigMain public static Property MarketDatFormatProperty; public static boolean MarketDatFormat = false; + public static Property PartiesEnabledProperty; + public static boolean PartiesEnabled; + + public static Property PartyFriendlyFireEnabledProperty; + public static boolean PartyFriendlyFireEnabled; + public static Property DefaultMinPartySizeProperty; public static int DefaultMinPartySize = 1; @@ -165,12 +172,6 @@ public class ConfigMain MarketDatFormatProperty = config.get(GENERAL, "Dat Format for Market", false, "You need to use '/kamkeel config market' to convert existing market to new format."); MarketDatFormat = MarketDatFormatProperty.getBoolean(false); - DefaultMinPartySizeProperty = config.get(GENERAL, "Default Min Party Size", 1, "When creating a new Quest sets the default min party size"); - DefaultMinPartySize = DefaultMinPartySizeProperty.getInt(4); - - DefaultMaxPartySizeProperty = config.get(GENERAL, "Default Max Party Size", 4, "When creating a new Quest sets the default max party size"); - DefaultMaxPartySize = DefaultMaxPartySizeProperty.getInt(4); - // NPC NpcNavRangeProperty = config.get(NPC, "NPC Navigation Range", 32, "Navigation search range for NPCs. Not recommended to increase if you have a slow pc or on a server. Minimum of 16, maximum of 96."); NpcNavRange = NpcNavRangeProperty.getInt(32); @@ -199,6 +200,19 @@ public class ConfigMain HitBoxScaleMaxProperty = config.get(NPC, "HitBox Scale Limit", 15, "The maximum scale factor for a custom hitbox"); HitBoxScaleMax = HitBoxScaleMaxProperty.getInt(15); + //PARTY + PartiesEnabledProperty = config.get(PARTY, "Parties Enabled", true, "Determines whether the party system is enabled or not."); + PartiesEnabled = PartiesEnabledProperty.getBoolean(); + + PartyFriendlyFireEnabledProperty = config.get(PARTY, "Party Friendly Fire", true, "Determines whether friendly fire can be toggled in parties."); + PartyFriendlyFireEnabled = PartyFriendlyFireEnabledProperty.getBoolean(); + + DefaultMinPartySizeProperty = config.get(PARTY, "Default Min Party Size", 1, "When creating a new Quest sets the default min party size"); + DefaultMinPartySize = DefaultMinPartySizeProperty.getInt(4); + + DefaultMaxPartySizeProperty = config.get(PARTY, "Default Max Party Size", 4, "When creating a new Quest sets the default max party size"); + DefaultMaxPartySize = DefaultMaxPartySizeProperty.getInt(4); + // Update TrackedQuestUpdateFrequencyProperty = config.get(UPDATE, "Tracked Quest Update Frequency", 5, "How often in seconds to update a players tracked quest. [Only applies to Item Quest currently]"); TrackedQuestUpdateFrequency = TrackedQuestUpdateFrequencyProperty.getInt(5);