Changed the script processor code to no longer incorrectly close interfaces on SOFT queue scripts
Rewrote Jarvald
This commit is contained in:
@@ -45,6 +45,7 @@ class EctophialListener : InteractionListener {
|
||||
return@on true
|
||||
}
|
||||
delayEntity(player, 10)
|
||||
closeAllInterfaces(player)
|
||||
queueScript(player, 0, QueueStrength.SOFT) { stage: Int ->
|
||||
when (stage) {
|
||||
0 -> {
|
||||
|
||||
@@ -52,6 +52,7 @@ class EnchantJewelleryTabListener : InteractionListener {
|
||||
|
||||
override fun defineListeners() {
|
||||
on(IntType.ITEM, "break") {player, node ->
|
||||
closeAllInterfaces(player)
|
||||
delayEntity(player, 1)
|
||||
queueScript(player, strength = QueueStrength.SOFT) {
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ class GrandSeedPodHandler : InteractionListener {
|
||||
}
|
||||
|
||||
if (opt == "squash") {
|
||||
closeAllInterfaces(player)
|
||||
visualize(player, SQUASH_ANIM_BEGIN, SQUASH_GRAPHICS_BEGIN)
|
||||
delayEntity(player, 12)
|
||||
queueScript(player, 3, QueueStrength.SOFT) {stage: Int ->
|
||||
|
||||
@@ -40,6 +40,7 @@ class SteppingStoneShortcut : OptionHandler() {
|
||||
}
|
||||
val offset = getOffset(player,finalDest)
|
||||
player.debug("Offset: ${offset.first},${offset.second}")
|
||||
closeAllInterfaces(player)
|
||||
lock(player, 3)
|
||||
player.locks.lockTeleport(3)
|
||||
queueScript(player, 2, QueueStrength.SOFT) {
|
||||
|
||||
@@ -19,6 +19,7 @@ class StileShortcut : InteractionListener {
|
||||
val startLoc = p.location.transform(direction, 1)
|
||||
val endLoc = p.location.transform(direction, 2)
|
||||
|
||||
closeAllInterfaces(p)
|
||||
p.walkingQueue.reset()
|
||||
p.walkingQueue.addPath(startLoc.x, startLoc.y)
|
||||
forceMove(p, startLoc, endLoc, 0, animationCycles(839), direction, 839)
|
||||
|
||||
+1
-1
@@ -106,7 +106,7 @@ abstract class AbstractGrappleShortcut : InteractionListener {
|
||||
}
|
||||
|
||||
protected fun grapple(player: Player, message: String?): Boolean {
|
||||
|
||||
closeAllInterfaces(player)
|
||||
lock(player, animationDuration)
|
||||
// TODO is this right? should we force the player to cross?
|
||||
queueScript(player, strength = QueueStrength.SOFT) { stage: Int ->
|
||||
|
||||
@@ -23,6 +23,7 @@ class WallGrappleInterfaceImpl: WallGrappleInterface{
|
||||
|
||||
override fun jump(player: Player, destination: Location): Boolean {
|
||||
// todo this doesn't look great compared to what it used to look like
|
||||
closeAllInterfaces(player)
|
||||
forceWalk(player, destination,"smart" )
|
||||
face(player, destination)
|
||||
// We're teleporting if we are animating so make the strength SOFT
|
||||
|
||||
@@ -1,251 +0,0 @@
|
||||
package content.region.fremennik.rellekka.dialogue;
|
||||
|
||||
import core.game.component.Component;
|
||||
import core.game.dialogue.DialoguePlugin;
|
||||
import core.game.node.entity.npc.NPC;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.item.Item;
|
||||
import core.game.system.task.Pulse;
|
||||
import kotlin.Unit;
|
||||
import core.game.world.GameWorld;
|
||||
import core.game.world.map.Location;
|
||||
|
||||
import static core.api.ContentAPIKt.*;
|
||||
|
||||
/**
|
||||
* Handles the jarvald dialogue.
|
||||
* @author Vexia
|
||||
*/
|
||||
public final class JarvaldDialogue extends DialoguePlugin {
|
||||
|
||||
/**
|
||||
* Constructs a new {@code JarvaldDialogue} {@code Object}.
|
||||
*/
|
||||
public JarvaldDialogue() {
|
||||
/**
|
||||
* empty.
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new {@code JarvaldDialogue} {@code Object}.
|
||||
* @param player the player.
|
||||
*/
|
||||
public JarvaldDialogue(Player player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DialoguePlugin newInstance(Player player) {
|
||||
return new JarvaldDialogue(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
npc = (NPC) args[0];
|
||||
if (args.length > 1) {
|
||||
handleTravelStage();
|
||||
return true;
|
||||
}
|
||||
if (npc.getId() == 2438) {
|
||||
npc("Ah, you live yet, outerlander!");
|
||||
stage = 37;
|
||||
return true;
|
||||
}
|
||||
npc("What do you want from me outerlander?", "It is our policy not to associate with those not of our", "tribe.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(int interfaceId, int buttonId) {
|
||||
switch (stage) {
|
||||
case 0:
|
||||
options("Where is your chieftain?", "What Jarvald is doing.", "Nothing");
|
||||
stage++;
|
||||
break;
|
||||
case 1:
|
||||
switch (buttonId) {
|
||||
case 1:
|
||||
player("Where is your chieftain?", "I find it highly discriminatory to refuse to talk to", "someone on the grounds that they are not part of your", "tribe.");
|
||||
stage = 10;
|
||||
break;
|
||||
case 2:
|
||||
player("So what are you doing here?");
|
||||
stage = 20;
|
||||
break;
|
||||
case 3:
|
||||
end();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
npc("I don't rightly understand your speech outerlander, but", "my loyality is with Chieftain Brundt.");
|
||||
stage++;
|
||||
break;
|
||||
case 11:
|
||||
npc("He resides in our longhall; it is the large building over", "there, you should speak to him for he speaks for us all.");
|
||||
stage++;
|
||||
break;
|
||||
case 12:
|
||||
end();
|
||||
break;
|
||||
case 20:
|
||||
handleTravelStage();
|
||||
break;
|
||||
case 21:
|
||||
player("Hey, scary barbarian type guy, think I can join you on", "this expedition?");
|
||||
stage++;
|
||||
break;
|
||||
case 22:
|
||||
npc("An outerlander join us on a honoured hunt???");
|
||||
stage++;
|
||||
break;
|
||||
case 23:
|
||||
npc("Well.....", "I gues...", "I might be able to allow you to join us, although it is a", "breach of many of our customs...");
|
||||
stage++;
|
||||
break;
|
||||
case 24:
|
||||
player("Oh, pleeeeeeease?", "I really LOVE killing stuff!");
|
||||
stage++;
|
||||
break;
|
||||
case 25:
|
||||
npc("Well...", "I remain unconvinced that it would be wise to allow an", "outerlander to join us in such dangerous battle, but", "your ethusiasm seems genuine enough...");
|
||||
stage++;
|
||||
break;
|
||||
case 26:
|
||||
npc("I will allow you to escort us, but you must pay me a", "sum of money first.");
|
||||
stage++;
|
||||
break;
|
||||
case 27:
|
||||
player("What?", "That's outrageous, why charge me money?", "And, uh, how much does it cost me?");
|
||||
stage++;
|
||||
break;
|
||||
case 28:
|
||||
npc("Ah, the outerlander have stolen from my people for", "many years, in this way you can help my community", "with a small amount of money...");
|
||||
stage++;
|
||||
break;
|
||||
case 29:
|
||||
npc("Let us say...", "1000 coins.", "Payable in advance, of course.");
|
||||
stage++;
|
||||
break;
|
||||
case 30:
|
||||
npc("For this I will take you to Waterbirth Island on my", "boat, and will bring you back here when you have had", "your fill of the hunt.", "Assuming you are still alive to wish to leave, of course.");
|
||||
stage++;
|
||||
break;
|
||||
case 31:
|
||||
setVarp(player, 520, 1 << 13, true);
|
||||
end();
|
||||
break;
|
||||
case 32:
|
||||
options("YES", "NO");
|
||||
stage++;
|
||||
break;
|
||||
case 33:
|
||||
switch (buttonId) {
|
||||
case 1:
|
||||
if (!player.getInventory().contains(995, 1000)) {
|
||||
player("Sorry, I don't have enough coins.");
|
||||
stage = 35;
|
||||
break;
|
||||
}
|
||||
if (player.getInventory().remove(new Item(995, 1000))) {
|
||||
sail(player, true);
|
||||
}
|
||||
end();
|
||||
break;
|
||||
case 2:
|
||||
player("No, actually I have some stuff to do here first.");
|
||||
stage = 34;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 34:
|
||||
npc("As you wish.", "Come and see me when your bloodlust needs sating.");
|
||||
stage++;
|
||||
break;
|
||||
case 35:
|
||||
end();
|
||||
break;
|
||||
case 36:
|
||||
switch (buttonId) {
|
||||
case 1:
|
||||
npc("Then let us away;", "There will be death to bring here another day!");
|
||||
stage = 39;
|
||||
break;
|
||||
case 2:
|
||||
end();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 37:
|
||||
npc("Have you had your fill of the hunt and wish to return,", "or are you still feeling the joy of the cull?");
|
||||
stage++;
|
||||
break;
|
||||
case 38:
|
||||
interpreter.sendOptions("Leave island?", "YES", "NO");
|
||||
stage = 36;
|
||||
break;
|
||||
case 39:
|
||||
end();
|
||||
sail(player, false);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sails the player to and from waterbirth.
|
||||
* @param player the player.
|
||||
*/
|
||||
public void sail(final Player player, final boolean to) {
|
||||
player.lock();
|
||||
player.getInterfaceManager().open(new Component(224));
|
||||
player.logoutListeners.put("jarvald", player1 -> {
|
||||
player.setLocation(to ? Location.create(2544, 3759, 0) : Location.create(2620, 3685, 0));
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
GameWorld.getPulser().submit(new Pulse(1, player) {
|
||||
int count;
|
||||
|
||||
@Override
|
||||
public boolean pulse() {
|
||||
switch (++count) {
|
||||
case 5:
|
||||
player.unlock();
|
||||
player.getInterfaceManager().close();
|
||||
player.getProperties().setTeleportLocation(to ? Location.create(2544, 3759, 0) : Location.create(2620, 3685, 0));
|
||||
player.getDialogueInterpreter().close();
|
||||
player.getDialogueInterpreter().sendDialogue("The ship arrives at " + (to ? "Waterbirth Island" : "Rellekka") + ".");
|
||||
player.logoutListeners.remove("jarvald");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the travel stage.
|
||||
*/
|
||||
private void handleTravelStage() {
|
||||
if (npc.getId() == 2438) {
|
||||
interpreter.sendOptions("Leave island?", "YES", "NO");
|
||||
stage = 36;
|
||||
return;
|
||||
}
|
||||
if (getVarp(player, 520) == 0) {
|
||||
npc("This should not concern you, outerlander.", "I am awaiting other Fremenniks to join me on an", "expedition to Waterbirth Island.");
|
||||
stage = 21;
|
||||
} else {
|
||||
npc("So do you have the 1000 coins for my service, and are", "you ready to leave?");
|
||||
stage = 32;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIds() {
|
||||
return new int[] { 2435, 2436, 2437, 2438 };
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
package content.region.fremennik.rellekka.dialogue
|
||||
|
||||
import core.api.*
|
||||
import core.game.dialogue.DialoguePlugin
|
||||
import core.game.interaction.QueueStrength
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.item.Item
|
||||
import core.game.world.map.Location
|
||||
import core.plugin.Initializable
|
||||
import core.tools.END_DIALOGUE
|
||||
import org.rs09.consts.Items
|
||||
import org.rs09.consts.NPCs
|
||||
|
||||
|
||||
/**
|
||||
* @author Player Name
|
||||
*/
|
||||
|
||||
@Initializable
|
||||
class JarvaldDialogue(player: Player? = null) : DialoguePlugin(player) {
|
||||
override fun open(vararg args: Any?): Boolean {
|
||||
npc = args[0] as NPC
|
||||
val travelOption = args.size > 1
|
||||
val fremname = player.getAttribute("fremennikname","lebron james")
|
||||
if (npc.id == NPCs.JARVALD_2438) {
|
||||
// We're on Waterbirth Island
|
||||
if (isQuestComplete(player, "Fremennik Trials")) {
|
||||
if (travelOption) {
|
||||
npc("So what say you, stay here for the hunt,","or return home to sweet Rellekka to feast","and drink with your tribe?").also { stage = 201 }
|
||||
} else {
|
||||
npc("Ah, ${fremname}! Such glorious battle","makes you feel glad of life, does it not?").also { stage = 220 }
|
||||
}
|
||||
} else {
|
||||
if (travelOption) {
|
||||
npc("Have you had your fill of the hunt and wish to return,", "or are you still feeling the joy of the cull?").also { stage = 201 }
|
||||
} else {
|
||||
npc("Ah, you live yet, outerlander!").also { stage = 200 }
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// We're in Rellekka
|
||||
if (isQuestComplete(player, "Fremennik Trials")) {
|
||||
if (travelOption) {
|
||||
npc("Of course, ${fremname}! Your presence is more than welcome","on this cull! You wish to leave now?").also { stage = 131 }
|
||||
} else {
|
||||
npc("Greetings, ${fremname}!").also { stage = if (fremname == "Jarvald") 100 else 102 }
|
||||
}
|
||||
} else {
|
||||
if (travelOption) {
|
||||
npc("So do you have the 1,000 coins for my service, and are", "you ready to leave?").also { stage = 41 }
|
||||
} else if (isQuestInProgress(player, "Fremennik Trials", 1, 100)) {
|
||||
player("Hi, I don't suppose you are a member of", "the council of elders are you?").also { stage = 0 }
|
||||
} else {
|
||||
npc("What do you want from me outerlander?", "It is our policy not to associate with those not of our", "tribe.").also { stage = 3 }
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
fun sail(to: Boolean) {
|
||||
lock(player, 5)
|
||||
closeAllInterfaces(player)
|
||||
openInterface(player, 224)
|
||||
queueScript(player, 5, QueueStrength.SOFT) {
|
||||
closeInterface(player)
|
||||
unlock(player)
|
||||
if (to) {
|
||||
player.teleport(Location.create(2544, 3759, 0))
|
||||
sendDialogue("The ship arrives at Waterbirth Island.")
|
||||
} else {
|
||||
player.teleport(Location.create(2620, 3685, 0))
|
||||
sendDialogue("The ship arrives at Rellekka.")
|
||||
}
|
||||
return@queueScript stopExecuting(player)
|
||||
}
|
||||
}
|
||||
|
||||
override fun handle(interfaceId: Int, buttonID: Int): Boolean {
|
||||
val fremname = player.getAttribute("fremennikname","lebron james")
|
||||
when (stage) {
|
||||
0 -> npc("No, outerlander, I have never had the honour to be asked.").also { stage++ }
|
||||
1 -> npc("I am but a lowly warrior, fighting for my people","wherever threats may appear against us...").also { stage++ }
|
||||
2 -> npc("So what do you want from me, outerlander?").also { stage++ }
|
||||
3 -> options("Where is your chieftain?", "What Jarvald is doing.", "Nothing").also { stage++ }
|
||||
4 -> when (buttonID) {
|
||||
1 -> player("Where is your chieftain?", "I find it highly discriminatory to refuse to talk to", "someone on the grounds that they are not part of your", "tribe.").also { stage++ }
|
||||
2 -> player("So what are you doing here?").also { stage = if (getVarp(player, 520) == 0) 10 else 40 }
|
||||
3 -> player("Actually, I don't think I have","anything to speak to you about...").also { stage = END_DIALOGUE }
|
||||
}
|
||||
5 -> npc("I don't rightly understand your speech outerlander, but", "my loyality is with Chieftain Brundt.").also { stage++ }
|
||||
6 -> npc("He resides in our longhall; it is the large building over", "there, you should speak to him for he speaks for us all.").also { stage++ }
|
||||
7 -> end().also { stage = END_DIALOGUE }
|
||||
10 -> npc("This should not concern you, outerlander.", "I am awaiting other Fremenniks to join me on an", "expedition to Waterbirth Island.").also { stage++ }
|
||||
11 -> options("Waterbirth Island?", "Can I come?", "Nice hat!", "Ok, 'bye.").also { stage++ }
|
||||
12 -> when (buttonID) {
|
||||
1 -> npc("It is a small crescent-shaped island","just north-west of here, outerlander.").also { stage++ }
|
||||
2 -> player("Can I come?").also { stage = 20 }
|
||||
3 -> player("Hey, I have to say, that's a fine looking","hat you are wearing there.").also { stage = 30 }
|
||||
4 -> player("Wow, you Fremenniks sure know how to party.","Well, see ya around.").also { stage = END_DIALOGUE }
|
||||
}
|
||||
13 -> npc("We have many legends about it,","such as the tale of the broken sky,","and the day of the green seas.").also { stage++ }
|
||||
14 -> npc("The reason I am travelling there is more serious","Fremennik business, however. I doubt an outerlander","would be interested.").also { stage++ }
|
||||
15 -> options("Can I come?", "Nice hat!", "Ok, 'bye.").also { stage++ }
|
||||
16 -> when (buttonID) {
|
||||
1 -> player("Can I come?").also { stage = 20 }
|
||||
2 -> player("Hey, I have to say, that's a fine looking","hat you are wearing there.").also { stage = 30 }
|
||||
3 -> player("Wow, you Fremenniks sure know how to party.","Well, see ya around.").also { stage = END_DIALOGUE }
|
||||
}
|
||||
20 -> npc("An outerlander join us on an honoured hunt???").also { stage++ }
|
||||
21 -> npc("Well....", "I guess...", "I might be able to allow you to join us, although it is a", "breach of many of our customs...").also { stage++ }
|
||||
22 -> player("Oh, pleeeeease?", "I really LOVE killing stuff!").also { stage++ }
|
||||
23 -> npc("Well...", "I remain unconvinced that it would be wise to allow an", "outerlander to join us in such dangerous battle, but", "your ethusiasm seems genuine enough...").also { stage++ }
|
||||
24 -> npc("I will allow you to escort us, but you must pay me a", "sum of money first.").also { stage++ }
|
||||
25 -> player("What?", "That's outrageous, why charge me money?", "And, uh, how much does it cost me?").also { stage++ }
|
||||
26 -> npc("Ah, the outerlanders have stolen from my people for", "many years, in this way you can help my community", "with a small amount of money...").also { stage++ }
|
||||
27 -> npc("Let us say...", "1,000 coins.", "Payable in advance, of course.").also { stage++ }
|
||||
28 -> npc("For this I will take you to Waterbirth Island on my", "boat, and will bring you back here when you have had", "your fill of the hunt.", "Assuming you are still alive to wish to leave, of course.").also { setVarp(player, 520, 1 shl 13, true) }.also{ stage = END_DIALOGUE }
|
||||
29 -> npc("Wow, you Fremenniks sure know how to party.","Well, see ya around.").also { stage = END_DIALOGUE }
|
||||
30 -> npc("It is actually a helm, outerlander,","but the sentiment is appreciated nonetheless.").also { stage = END_DIALOGUE }
|
||||
40 -> npc("So do you have the 1,000 coins for my service, and are", "you ready to leave?").also { stage++ }
|
||||
41 -> options("YES", "NO").also { stage++ }
|
||||
42 -> when (buttonID) {
|
||||
1 -> if (player.inventory.contains(Items.COINS_995, 1000)) {
|
||||
if (player.inventory.remove(Item(Items.COINS_995, 1000))) {
|
||||
sail(true)
|
||||
}
|
||||
} else {
|
||||
player("Sorry, I don't have enough coins.").also { stage = END_DIALOGUE }
|
||||
}
|
||||
2 -> player("No, actually I have some stuff to do here first.").also { stage++ }
|
||||
}
|
||||
43 -> npc("As you wish.", "Come and see me when your bloodlust needs sating.").also { stage = END_DIALOGUE }
|
||||
100 -> npc("Ah, and what a glorious name that is! Worthy of only the finest warriors!").also { stage++ }
|
||||
101 -> player("Heh. Yup, you're right there.").also { stage++ }
|
||||
|
||||
102 -> npc("So what brings you back to fair Rellekka?","It has been too long since you have drunk in the longhall","with us and sang of your battles!").also { stage++ }
|
||||
103 -> options("What Jarvald is doing.", "Nothing").also { stage++ }
|
||||
104 -> when (buttonID) {
|
||||
1 -> player("So what are you doing here?").also { stage = if (getVarp(player, 520) and (1 shl 13) == 0) 105 else 130 }
|
||||
2 -> player("Actually, I don't think I have","anything to speak to you about...").also { stage = END_DIALOGUE }
|
||||
}
|
||||
105 -> npc("You have not heard, ${fremname}?","I am leading an expedition to Waterbirth Island!").also { stage++ }
|
||||
106 -> options("Waterbirth Island?", "Can I come?", "Nice hat!", "Ok, 'bye.").also { stage++ }
|
||||
107 -> when (buttonID) {
|
||||
1 -> npc("You have not ever travelled to Waterbirth Island, ${fremname}?","I am surprised, it is a place of outstanding natural beauty.").also { stage++ }
|
||||
2 -> player("Can I come?").also { stage = 130 }
|
||||
3 -> player("Hey, I have to say, that's a fine looking","hat you are wearing there.").also { stage = 140 }
|
||||
4 -> player("Wow, you Fremenniks sure know how to party. Well, see ya around.").also { stage = END_DIALOGUE }
|
||||
}
|
||||
108 -> npc("Or at least it used to be! But things have now changed...").also { stage++ }
|
||||
109 -> player("Changed? How do you mean, changed?").also { stage++ }
|
||||
110 -> npc("It seems as though the sea-beasts known to us as","the dagger-mouths have begun their hatching once again...","And there may be others of their ilk there too.").also { stage++ }
|
||||
111 -> player("Dagger-mouths?").also { stage++ }
|
||||
112 -> npc("Aye, the dagger-mouths! The vile creatures lived","near here once, but we had thought them all driven back","to the ocean depths many moons past.").also { stage++ }
|
||||
113 -> npc("I can only imagine a dagger-mouth queen has nested","somewhere nearby and spawned her foul brood","under the sea once more, and some of them have","migrated to fair Waterbirth Island.").also { stage++ }
|
||||
114 -> player("So you're scared they might attack Rellekka?").also { stage++ }
|
||||
115 -> npc("Scared? Ha ha ha!").also { stage++ }
|
||||
116 -> npc("You wound us with your questioning, ${fremname}!").also { stage++ }
|
||||
117 -> npc("We are glad the dagger-mouths have returned to","these shores, for it means we will get the chance","to hunt them once again as our ancestors did!").also { stage++ }
|
||||
118 -> npc("When treated in the correct manner, the creatures'","remains can be used to make fine battleworthy armour!").also { setVarp(player, 520, 1 shl 13, true) }.also{ stage++ }
|
||||
119 -> options("Can I come?", "Nice hat!", "Ok, 'bye.").also { stage++ }
|
||||
120 -> when (buttonID) {
|
||||
1 -> player("Can I come?").also { stage = 130 }
|
||||
2 -> player("Hey, I have to say, that's a fine looking","hat you are wearing there.").also { stage = 140 }
|
||||
3 -> player("Wow, you Fremenniks sure know how to party. Well, see ya around.").also { stage = END_DIALOGUE }
|
||||
}
|
||||
130 -> npc("Of course, ${fremname}! Your presence is more than welcome","on this cull! You wish to leave now?").also { stage++ }
|
||||
131 -> options("YES", "NO").also { stage++ }
|
||||
132 -> when (buttonID) {
|
||||
1 -> sail(true)
|
||||
2 -> player("No, actually I have some stuff to do here first.").also { stage = 43 }
|
||||
}
|
||||
140 -> player("Hey, I have to say, that's a fine looking","hat you are wearing there.").also { stage++ }
|
||||
141 -> npc("Aye, that it is ${fremname}!","Skulgrimen fashioned it for me from the carcass of","one of the monsters on Waterbirth Island after our last hunt!").also { stage++ }
|
||||
142 -> npc("I hope to kill enough creatures to fashion","some fine armour as well","when next we leave!").also { stage++ }
|
||||
143 -> options("Waterbirth Island?", "Can I come?", "Ok, 'bye.").also { stage++ }
|
||||
144 -> when (buttonID) {
|
||||
1 -> npc("You have not ever travelled to Waterbirth Island, ${fremname}?","I am surprised, it is a place of outstanding natural beauty.").also { stage = 108 }
|
||||
2 -> player("Can I come?").also { stage = 130 }
|
||||
3 -> player("Wow, you Fremenniks sure know how to party.","Well, see ya around.").also { stage = END_DIALOGUE }
|
||||
}
|
||||
200 -> npc("Have you had your fill of the hunt and wish to return,", "or are you still feeling the joy of the cull?").also { stage++ }
|
||||
201 -> options("I wish to return to Rellekka.", "I want to stay here.").also { stage++ }
|
||||
202 -> when (buttonID) {
|
||||
1 -> player("I wish to return to Rellekka.").also { stage++ }
|
||||
2 -> player("I want to stay here.").also { stage = 210 }
|
||||
}
|
||||
203 -> npc("Then let us away;", "There will be death to bring here another day!").also{ sail(false) }
|
||||
210 -> npc("Ha Ha Ha! A true huntsman at heart!").also { stage++ }
|
||||
211 -> npc("I myself have killed over a hundred of the dagger-","mouths, and did not think it too many!").also { stage = END_DIALOGUE }
|
||||
220 -> npc("So what say you, stay here for the hunt,","or return home to sweet Rellekka to feast","and drink with your tribe?").also { stage = 201 }
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun newInstance(player: Player?): DialoguePlugin {
|
||||
return JarvaldDialogue(player)
|
||||
}
|
||||
|
||||
override fun getIds(): IntArray {
|
||||
// 2435 is a wrapper for 2436
|
||||
return intArrayOf(2435, NPCs.JARVALD_2436, NPCs.JARVALD_2437, NPCs.JARVALD_2438)
|
||||
}
|
||||
}
|
||||
@@ -1606,6 +1606,16 @@ fun closeTabInterface(player: Player) {
|
||||
player.interfaceManager.closeSingleTab()
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes any open (both chat and non-chat) interfaces for the player
|
||||
* @param player the player to close the interfaces for
|
||||
*/
|
||||
fun closeAllInterfaces(player: Player) {
|
||||
player.interfaceManager.close()
|
||||
player.interfaceManager.closeChatbox()
|
||||
player.dialogueInterpreter.close()
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a dialogue that uses the player's chathead.
|
||||
* @param player the player to send the dialogue to
|
||||
|
||||
@@ -46,6 +46,7 @@ class DropListener : InteractionListener {
|
||||
if (getAttribute(player, "equipLock:${node.id}", 0 ) > getWorldTicks())
|
||||
return false
|
||||
|
||||
closeAllInterfaces(player)
|
||||
queueScript (player, strength = QueueStrength.SOFT) {
|
||||
if (player.inventory.replace(null, item.slot) != item) return@queueScript stopExecuting(player)
|
||||
val droppedItem = item.dropItem
|
||||
|
||||
@@ -12,7 +12,6 @@ import core.game.world.map.Location
|
||||
import core.game.world.map.path.Pathfinder
|
||||
import core.game.bots.AIPlayer
|
||||
import core.tools.Log
|
||||
import core.tools.SystemLogger
|
||||
import java.lang.Integer.max
|
||||
import java.io.*
|
||||
|
||||
@@ -97,11 +96,9 @@ class ScriptProcessor(val entity: Entity) {
|
||||
strongInQueue = hasTypeInQueue(QueueStrength.STRONG)
|
||||
softInQueue = hasTypeInQueue(QueueStrength.SOFT)
|
||||
|
||||
if (softInQueue || strongInQueue) {
|
||||
if (strongInQueue) {
|
||||
if (entity is Player) {
|
||||
entity.interfaceManager.close()
|
||||
entity.interfaceManager.closeChatbox()
|
||||
entity.dialogueInterpreter.close()
|
||||
closeAllInterfaces(entity)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,10 +115,8 @@ class ScriptProcessor(val entity: Entity) {
|
||||
continue
|
||||
if (script.nextExecution > GameWorld.ticks)
|
||||
continue
|
||||
if ((script.strength == QueueStrength.STRONG || script.strength == QueueStrength.SOFT) && entity is Player) {
|
||||
entity.interfaceManager.close()
|
||||
entity.interfaceManager.closeChatbox()
|
||||
entity.dialogueInterpreter.close()
|
||||
if ((script.strength == QueueStrength.STRONG) && entity is Player) {
|
||||
closeAllInterfaces(entity)
|
||||
}
|
||||
script.nextExecution = GameWorld.ticks + 1
|
||||
val finished = executeScript(script)
|
||||
@@ -142,10 +137,8 @@ class ScriptProcessor(val entity: Entity) {
|
||||
}
|
||||
if (script.nextExecution > GameWorld.ticks)
|
||||
continue
|
||||
if ((script.strength == QueueStrength.STRONG || script.strength == QueueStrength.SOFT)) {
|
||||
entity.interfaceManager.close()
|
||||
entity.interfaceManager.closeChatbox()
|
||||
entity.dialogueInterpreter.close()
|
||||
if ((script.strength == QueueStrength.STRONG)) {
|
||||
closeAllInterfaces(entity)
|
||||
}
|
||||
script.nextExecution = GameWorld.ticks + 1
|
||||
val finished = executeScript(script)
|
||||
@@ -284,9 +277,7 @@ class ScriptProcessor(val entity: Entity) {
|
||||
return
|
||||
}
|
||||
if (strength == QueueStrength.STRONG && entity is Player) {
|
||||
entity.interfaceManager.close()
|
||||
entity.interfaceManager.closeChatbox()
|
||||
entity.dialogueInterpreter.close()
|
||||
closeAllInterfaces(entity)
|
||||
}
|
||||
script.nextExecution = max(GameWorld.ticks + 1, script.nextExecution)
|
||||
queue.add(script)
|
||||
|
||||
Reference in New Issue
Block a user