Skip to content

Commit

Permalink
fix: Fixed cheerers for new model IDs (#1770)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoinkwiz authored Sep 28, 2024
1 parent 30afce3 commit d985d18
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 42 deletions.
59 changes: 18 additions & 41 deletions src/main/java/com/questhelper/runeliteobjects/Cheerer.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@

import com.questhelper.runeliteobjects.extendedruneliteobjects.FakeNpc;
import com.questhelper.runeliteobjects.extendedruneliteobjects.RuneliteObjectManager;
import net.runelite.api.Client;
import net.runelite.api.JagexColor;
import net.runelite.api.Model;
import net.runelite.api.ModelData;
import net.runelite.api.*;
import net.runelite.api.coords.WorldPoint;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import net.runelite.client.chat.ChatMessageManager;
import net.runelite.client.config.ConfigManager;

Expand All @@ -45,6 +43,7 @@ public class Cheerer

public static void createCheerers(RuneliteObjectManager runeliteObjectManager, Client client, ConfigManager configManager)
{
cheerers.clear();
createWOM(runeliteObjectManager, client);
createZoinkwiz(runeliteObjectManager, client);
}
Expand All @@ -64,33 +63,18 @@ private static void createWOM(RuneliteObjectManager runeliteObjectManager, Clien

private static Model wiseOldManOutfit(Client client)
{
short clothingColor = JagexColor.rgbToHSL(new Color(102, 93, 44).getRGB(), 0.6d);
short blue = JagexColor.rgbToHSL(Color.BLUE.getRGB(), 1.0d);
ModelData skirt = client.loadModelData(265).cloneColors()
.recolor((short)25238, clothingColor);

ModelData shirt = client.loadModelData(292).cloneColors()
.recolor((short)8741, clothingColor);

ModelData arms = client.loadModelData(170).cloneColors()
.recolor((short)8741, clothingColor);

// 8741
ModelData cape = client.loadModelData(323).cloneColors()
.recolor((short) 926, blue) // Inside
.recolor((short) 7700, blue) // Mail cape
.recolor((short) 11200, (short) 8741); // Trim

ModelData partyhat = client.loadModelData(187).cloneColors()
.recolor((short)926, blue);
ModelData mdf = createModel(client,
9103, // face
4925, // beard
176, // hands
181); // feet?

mdf = createModel(client, mdf, skirt, shirt, arms, cape, partyhat);

NPCComposition wom = client.getNpcDefinition(NpcID.WISE_OLD_MAN);
int[] models = wom.getModels();
short[] coloursToReplace = wom.getColorToReplace();
short[] coloursToReplaceWith = wom.getColorToReplaceWith();
ModelData mdf = createModel(client, models); // feet?

if (coloursToReplace != null && coloursToReplaceWith != null && coloursToReplace.length == coloursToReplaceWith.length) {
for (int i=0; i < coloursToReplace.length; i++)
{
mdf.recolor(coloursToReplace[i], coloursToReplaceWith[i]);
}
}
return mdf.cloneColors()
.light();
}
Expand All @@ -111,25 +95,18 @@ private static void createZoinkwiz(RuneliteObjectManager runeliteObjectManager,
private static Model zoinkwizOutfit(Client client)
{
short qpcDark = (short) -22440;
final int QUEST_HOOD_MALE = 18914;
final int QUEST_CAPE_MALE = 18946;

ModelData hood = client.loadModelData(QUEST_HOOD_MALE).cloneColors()
.recolor((short) -21568, qpcDark) // Inside
.recolor((short) 22464, qpcDark)
.recolor((short) 960, qpcDark);

ModelData cape = client.loadModelData(QUEST_CAPE_MALE).cloneColors()
.recolor((short) -8256, qpcDark) // Outside trim
.recolor((short) -11353, JagexColor.rgbToHSL(Color.WHITE.getRGB(), 1.0d)); // Inside trim

ModelData mdf = createModel(client,
11359, 38101, 38079, 4925, 10706, 358);
mdf = createModel(client, mdf, hood, cape);
46603, 46606, 46607, 46608, 7207);
mdf = createModel(client, mdf, cape);

return mdf.cloneColors()
.light(10 + ModelData.DEFAULT_AMBIENT, 1875 + ModelData.DEFAULT_CONTRAST,
ModelData.DEFAULT_X, ModelData.DEFAULT_Y, 20);
.light(64, 768, -50, -50, 10);
}

private static ModelData createModel(Client client, ModelData... data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ private void setupMenuOptions(ExtendedRuneliteObject extendedRuneliteObject, Men
&& extendedRuneliteObject.getRuneliteObject().getModel() != null)
{
if (!isMouseOverObject(extendedRuneliteObject)) return;
if (event.getOption().equals("Walk here") && isMouseOverObject(extendedRuneliteObject))
if (event.getOption().equals("Walk here"))
{
if (extendedRuneliteObject instanceof ReplacedNpc)
{
Expand Down

0 comments on commit d985d18

Please sign in to comment.