mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-12 09:30:19 -07:00
Shantay quick-pass now functions authentically
This commit is contained in:
parent
6de25bd7e1
commit
942fd2876e
2 changed files with 18 additions and 4 deletions
|
|
@ -1,10 +1,12 @@
|
||||||
package content.region.desert.handlers;
|
package content.region.desert.handlers;
|
||||||
|
|
||||||
|
import core.api.Container;
|
||||||
import core.cache.def.impl.NPCDefinition;
|
import core.cache.def.impl.NPCDefinition;
|
||||||
import core.cache.def.impl.SceneryDefinition;
|
import core.cache.def.impl.SceneryDefinition;
|
||||||
import core.game.component.Component;
|
import core.game.component.Component;
|
||||||
import core.game.component.ComponentDefinition;
|
import core.game.component.ComponentDefinition;
|
||||||
import core.game.component.ComponentPlugin;
|
import core.game.component.ComponentPlugin;
|
||||||
|
import core.game.dialogue.FacialExpression;
|
||||||
import core.game.global.action.DoorActionHandler;
|
import core.game.global.action.DoorActionHandler;
|
||||||
import content.global.skill.agility.AgilityHandler;
|
import content.global.skill.agility.AgilityHandler;
|
||||||
import core.game.interaction.OptionHandler;
|
import core.game.interaction.OptionHandler;
|
||||||
|
|
@ -16,6 +18,10 @@ import core.game.node.scenery.Scenery;
|
||||||
import core.game.world.map.Location;
|
import core.game.world.map.Location;
|
||||||
import core.plugin.Initializable;
|
import core.plugin.Initializable;
|
||||||
import core.plugin.Plugin;
|
import core.plugin.Plugin;
|
||||||
|
import org.rs09.consts.Items;
|
||||||
|
|
||||||
|
import static core.api.ContentAPIKt.*;
|
||||||
|
import static core.tools.TickUtilsKt.ticksToCycles;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the plugin to handle the shantay pass.
|
* Represents the plugin to handle the shantay pass.
|
||||||
|
|
@ -84,11 +90,15 @@ public class ShantayPassPlugin extends OptionHandler {
|
||||||
player.getInterfaceManager().open(new Component(565));
|
player.getInterfaceManager().open(new Component(565));
|
||||||
break;
|
break;
|
||||||
case "quick-pass":
|
case "quick-pass":
|
||||||
if (player.getLocation().getY() < 3117) {
|
if (player.getLocation().getY() > 3116) {
|
||||||
AgilityHandler.walk(player, 0, player.getLocation(), player.getLocation().transform(0, player.getLocation().getY() > 3116 ? -2 : 2, 0), null, 0, null);
|
if (!inInventory(player, Items.SHANTAY_PASS_1854, 1)) {
|
||||||
return true;
|
sendNPCDialogue(player, 838, "You need a Shantay pass to get through this gate. See Shantay, he will sell you one for a very reasonable price.", FacialExpression.NEUTRAL);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!removeItem(player, Items.SHANTAY_PASS_1854, Container.INVENTORY)) return true;
|
||||||
|
sendMessage(player, "You hand your Shantay pass to the guard and pass through the gate.");
|
||||||
}
|
}
|
||||||
player.getDialogueInterpreter().open(838, 838, true);
|
forceMove(player, player.getLocation(), player.getLocation().transform(0, player.getLocation().getY() > 3116 ? -2 : 2, 0), 0, ticksToCycles(2), null, 819, null);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,10 @@ fun cyclesToTicks (cycles: Int) : Int {
|
||||||
return kotlin.math.ceil (cycles / cyclesPerTick.toDouble()).toInt()
|
return kotlin.math.ceil (cycles / cyclesPerTick.toDouble()).toInt()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun ticksToCycles (ticks: Int) : Int {
|
||||||
|
return ticks * (tick / cycle)
|
||||||
|
}
|
||||||
|
|
||||||
fun minutesToTicks(minutes: Int): Int {
|
fun minutesToTicks(minutes: Int): Int {
|
||||||
val minutesMs = minutes * 60 * 1000
|
val minutesMs = minutes * 60 * 1000
|
||||||
return minutesMs / tick
|
return minutesMs / tick
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue