Fix: Port Sarim water source, Ice Warrior stat rebalance

This commit is contained in:
skelsoft
2021-07-07 12:52:46 +00:00
committed by Ceikry
parent 2037439977
commit ddff4db4b9
3 changed files with 98 additions and 91 deletions
+19 -12
View File
@@ -2462,22 +2462,23 @@
"slayer_task": "48", "slayer_task": "48",
"melee_animation": "451", "melee_animation": "451",
"range_animation": "451", "range_animation": "451",
"attack_speed": "6", "attack_speed": "4",
"defence_animation": "404", "defence_animation": "404",
"weakness": "9", "weakness": "9",
"slayer_exp": "59", "slayer_exp": "59",
"magic_animation": "451", "magic_animation": "451",
"death_animation": "843", "death_animation": "843",
"name": "Ice warrior", "name": "Ice warrior",
"defence_level": "39", "defence_level": "47",
"safespot": null, "safespot": null,
"lifepoints": "59", "lifepoints": "59",
"strength_level": "39", "strength_level": "47",
"id": "125", "id": "125",
"aggressive": "true", "aggressive": "true",
"bonuses": "0,0,0,0,0,30,40,20,10,30,0,0,0,0,0",
"clue_level": "1", "clue_level": "1",
"range_level": "1", "range_level": "1",
"attack_level": "39" "attack_level": "47"
}, },
{ {
"examine": "Looks pretty otherworldly to me!", "examine": "Looks pretty otherworldly to me!",
@@ -2771,23 +2772,26 @@
}, },
{ {
"examine": "A cold-hearted elemental warrior.", "examine": "A cold-hearted elemental warrior.",
"slayer_task": "48",
"melee_animation": "451", "melee_animation": "451",
"range_animation": "451", "range_animation": "451",
"attack_speed": "6", "attack_speed": "4",
"defence_animation": "404", "defence_animation": "404",
"weakness": "9",
"slayer_exp": "59", "slayer_exp": "59",
"magic_animation": "451", "magic_animation": "451",
"death_animation": "843", "death_animation": "843",
"name": "Ice warrior", "name": "Ice warrior",
"defence_level": "39", "defence_level": "47",
"safespot": null, "safespot": null,
"lifepoints": "59", "lifepoints": "59",
"strength_level": "1", "strength_level": "47",
"id": "145", "id": "145",
"aggressive": "true", "aggressive": "true",
"bonuses": "0,0,0,0,0,30,40,20,10,30,0,0,0,0,0",
"clue_level": "1", "clue_level": "1",
"range_level": "1", "range_level": "1",
"attack_level": "39" "attack_level": "47"
}, },
{ {
"examine": "A sea bird.", "examine": "A sea bird.",
@@ -28536,23 +28540,26 @@
}, },
{ {
"examine": "A cold-hearted elemental warrior.", "examine": "A cold-hearted elemental warrior.",
"slayer_task": "48",
"melee_animation": "451", "melee_animation": "451",
"range_animation": "451", "range_animation": "451",
"attack_speed": "6", "attack_speed": "4",
"defence_animation": "404", "defence_animation": "404",
"weakness": "9",
"slayer_exp": "59", "slayer_exp": "59",
"magic_animation": "451", "magic_animation": "451",
"death_animation": "843", "death_animation": "843",
"name": "Ice warrior", "name": "Ice warrior",
"defence_level": "39", "defence_level": "47",
"safespot": null, "safespot": null,
"lifepoints": "59", "lifepoints": "59",
"strength_level": "1", "strength_level": "47",
"id": "3073", "id": "3073",
"aggressive": "true", "aggressive": "true",
"bonuses": "0,0,0,0,0,30,40,20,10,30,0,0,0,0,0",
"clue_level": "1", "clue_level": "1",
"range_level": "1", "range_level": "1",
"attack_level": "39" "attack_level": "47"
}, },
{ {
"name": "Monk", "name": "Monk",
@@ -1,79 +1,79 @@
package core.game.interaction.item.withobject; package core.game.interaction.item.withobject;
import core.game.interaction.NodeUsageEvent; import core.game.interaction.NodeUsageEvent;
import core.game.interaction.UseWithHandler; import core.game.interaction.UseWithHandler;
import core.game.node.entity.player.Player; import core.game.node.entity.player.Player;
import core.game.node.item.Item; import core.game.node.item.Item;
import core.game.system.task.Pulse; import core.game.system.task.Pulse;
import core.game.world.update.flag.context.Animation; import core.game.world.update.flag.context.Animation;
import core.plugin.Initializable; import core.plugin.Initializable;
import core.plugin.Plugin; import core.plugin.Plugin;
@Initializable @Initializable
public final class WaterSkinHandler extends UseWithHandler { public final class WaterSkinHandler extends UseWithHandler {
/** /**
* Represents objects with water in them. * Represents objects with water in them.
*/ */
private static final int[] OBJECTS = new int[]{16302, 6827, 11661, 24160, 34577, 15936, 15937, 15938, 23920, 35469, 24265, 153, 879, 880, 2864, 6232, 10436, 10437, 10827, 11007, 11759, 21764, 22973, 24161, 24214, 24265, 28662, 30223, 30820, 34579, 36781, 873, 874, 4063, 6151, 8699, 9143, 9684, 10175, 12279, 12974, 13563, 13564, 14868, 14917, 15678, 16704, 16705, 20358, 22715, 24112, 24314, 25729, 25929, 26966, 29105, 33458, 34082, 34411, 34496, 34547, 34566, 35762, 36971, 37154, 37155, 878, 884, 3264, 3305, 3359, 4004, 4005, 6097, 6249, 6549, 8747, 8927, 11793, 12201, 12897, 24166, 26945, 31359, 32023, 32024, 34576, 35671, 13561, 13563, 13559}; private static final int[] OBJECTS = new int[]{16302, 6827, 11661, 24160, 34577, 15936, 15937, 15938, 23920, 35469, 24265, 153, 879, 880, 2864, 6232, 10436, 10437, 10827, 11007, 11759, 21764, 22973, 24161, 24214, 24265, 28662, 30223, 30820, 34579, 36781, 873, 874, 4063, 6151, 8699, 9143, 9684, 10175, 12279, 12974, 13563, 13564, 14868, 14917, 15678, 16704, 16705, 20358, 22715, 24112, 24314, 25729, 25929, 26966, 29105, 33458, 34082, 34411, 34496, 34547, 34566, 35762, 36971, 37154, 37155, 878, 884, 3264, 3305, 3359, 4004, 4005, 6097, 6249, 6549, 8747, 8927, 11793, 12201, 12897, 24166, 26945, 31359, 32023, 32024, 34576, 35671, 13561, 13563, 13559, 40063};
/** /**
* Represents the animation to use. * Represents the animation to use.
*/ */
private static final Animation ANIMATION = new Animation(832); private static final Animation ANIMATION = new Animation(832);
// Unfilled waterskin objects // Unfilled waterskin objects
private static final int[] WATERSKINS = new int[]{1831, 1829, 1827, 1825}; private static final int[] WATERSKINS = new int[]{1831, 1829, 1827, 1825};
private static final int FILLED_WATERSKIN = 1823; private static final int FILLED_WATERSKIN = 1823;
// Waterskin fill diag // Waterskin fill diag
private static final String WATERSKIN_TEXT = "You fill the waterskin."; private static final String WATERSKIN_TEXT = "You fill the waterskin.";
/** /**
* Constructs a new {@code FillBucketPlugin} {@code Object}. * Constructs a new {@code FillBucketPlugin} {@code Object}.
*/ */
public WaterSkinHandler() { public WaterSkinHandler() {
super(WATERSKINS); super(WATERSKINS);
} }
@Override @Override
public Plugin<Object> newInstance(Object arg) throws Throwable { public Plugin<Object> newInstance(Object arg) throws Throwable {
for (int i : OBJECTS) { for (int i : OBJECTS) {
addHandler(i, OBJECT_TYPE, this); addHandler(i, OBJECT_TYPE, this);
} }
return this; return this;
} }
@Override @Override
public boolean handle(NodeUsageEvent event) { public boolean handle(NodeUsageEvent event) {
Player player = event.getPlayer(); Player player = event.getPlayer();
player.getPulseManager().run(new Pulse(2, player) { player.getPulseManager().run(new Pulse(2, player) {
@Override @Override
public boolean pulse() { public boolean pulse() {
int curSkin = -1; int curSkin = -1;
for (int i = 0; i < WATERSKINS.length; i++) { for (int i = 0; i < WATERSKINS.length; i++) {
if (player.getInventory().contains(WATERSKINS[i], 1)) { if (player.getInventory().contains(WATERSKINS[i], 1)) {
curSkin = WATERSKINS[i]; curSkin = WATERSKINS[i];
break; break;
} }
} }
if (curSkin == -1) { if (curSkin == -1) {
return true; return true;
} }
if (player.getInventory().remove(new Item(curSkin))) { if (player.getInventory().remove(new Item(curSkin))) {
player.animate(ANIMATION); player.animate(ANIMATION);
player.getPacketDispatch().sendMessage(WATERSKIN_TEXT); player.getPacketDispatch().sendMessage(WATERSKIN_TEXT);
player.getInventory().add(new Item(FILLED_WATERSKIN)); player.getInventory().add(new Item(FILLED_WATERSKIN));
} }
return false; return false;
} }
@Override @Override
public void stop() { public void stop() {
super.stop(); super.stop();
} }
}); });
return true; return true;
} }
} }
@@ -25,7 +25,7 @@ public final class WaterSourcePlugin extends UseWithHandler {
/** /**
* Represents the objects to use the buckets on. * Represents the objects to use the buckets on.
*/ */
private static final int[] OBJECTS = new int[] { 16302, 6827, 11661, 24160, 34577, 15936, 15937, 15938, 23920, 35469, 24265, 153, 879, 880, 2864, 6232, 10436, 10437, 10827, 11007, 11759, 21764, 22973, 24161, 24214, 24265, 28662, 30223, 30820, 34579, 36781, 873, 874, 4063, 6151, 8699, 9143, 9684, 10175, 12279, 12974, 13563, 13564, 14868, 14917, 15678, 16704, 16705, 20358, 22715, 24112, 24314, 25729, 25929, 26966, 29105, 33458, 34082, 34411, 34496, 34547, 34566, 35762, 36971, 37154, 37155, 878, 884, 3264, 3305, 3359, 4004, 4005, 6097, 6249, 6549, 8747, 8927, 11793, 12201, 12897, 24166, 26945, 31359, 32023, 32024, 34576, 35671, 13561, 13563, 13559 }; private static final int[] OBJECTS = new int[] { 16302, 6827, 11661, 24160, 34577, 15936, 15937, 15938, 23920, 35469, 24265, 153, 879, 880, 2864, 6232, 10436, 10437, 10827, 11007, 11759, 21764, 22973, 24161, 24214, 24265, 28662, 30223, 30820, 34579, 36781, 873, 874, 4063, 6151, 8699, 9143, 9684, 10175, 12279, 12974, 13563, 13564, 14868, 14917, 15678, 16704, 16705, 20358, 22715, 24112, 24314, 25729, 25929, 26966, 29105, 33458, 34082, 34411, 34496, 34547, 34566, 35762, 36971, 37154, 37155, 878, 884, 3264, 3305, 3359, 4004, 4005, 6097, 6249, 6549, 8747, 8927, 11793, 12201, 12897, 24166, 26945, 31359, 32023, 32024, 34576, 35671, 40063, 13561, 13563, 13559 };
/** /**
* Represents the animation to use. * Represents the animation to use.