Fixed numerous interfaces, including Puro puro, Destroy item, Equipment, kept on death, Cooking (single prompts i.e. raw fish -> range), Fletching (make set i.e. fletching arrows, bow)

Rewrote herb cleaning to listener
Fixed studded leather crafting level requirement and xp
Fixed bow stringing stealing strings
::quest <player> can now be used to look up a player's completed quests
This commit is contained in:
Woahscam 2023-11-11 03:16:35 +00:00 committed by Ryan
parent 098d947d87
commit 8ef5d8bce4
23 changed files with 792 additions and 575 deletions

View file

@ -1,7 +1,7 @@
[ [
{ {
"id": "5", "id": "5",
"interfaceType": "1", "interfaceType": "8",
"walkable": "true", "walkable": "true",
"tabIndex": "-1" "tabIndex": "-1"
}, },
@ -25,7 +25,49 @@
}, },
{ {
"id": "24", "id": "24",
"interfaceType": "1", "interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{
"id": "34",
"interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{
"id": "38",
"interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{
"id": "42",
"interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{
"id": "46",
"interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{
"id": "57",
"interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{
"id": "58",
"interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{
"id": "59",
"interfaceType": "8",
"walkable": "true", "walkable": "true",
"tabIndex": "-1" "tabIndex": "-1"
}, },
@ -125,6 +167,12 @@
"walkable": "true", "walkable": "true",
"tabIndex": "-1" "tabIndex": "-1"
}, },
{
"id": "139",
"interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{ {
"id": "140", "id": "140",
"interfaceType": "4", "interfaceType": "4",
@ -137,6 +185,12 @@
"walkable": "true", "walkable": "true",
"tabIndex": "3" "tabIndex": "3"
}, },
{
"id": "169",
"interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{ {
"id": "172", "id": "172",
"interfaceType": "4", "interfaceType": "4",
@ -197,15 +251,33 @@
"walkable": "true", "walkable": "true",
"tabIndex": "6" "tabIndex": "6"
}, },
{
"id": "194",
"interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{ {
"id": "195", "id": "195",
"interfaceType": "1", "interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{
"id": "196",
"interfaceType": "8",
"walkable": "true", "walkable": "true",
"tabIndex": "-1" "tabIndex": "-1"
}, },
{ {
"id": "198", "id": "198",
"interfaceType": "1", "interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{
"id": "209",
"interfaceType": "8",
"walkable": "true", "walkable": "true",
"tabIndex": "-1" "tabIndex": "-1"
}, },
@ -263,6 +335,12 @@
"walkable": "false", "walkable": "false",
"tabIndex": "-1" "tabIndex": "-1"
}, },
{
"id": "240",
"interfaceType": "3",
"walkable": "true",
"tabIndex": "-1"
},
{ {
"id": "241", "id": "241",
"interfaceType": "4", "interfaceType": "4",
@ -287,6 +365,12 @@
"walkable": "false", "walkable": "false",
"tabIndex": "-1" "tabIndex": "-1"
}, },
{
"id": "256",
"interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{ {
"id": "259", "id": "259",
"interfaceType": "2", "interfaceType": "2",
@ -377,6 +461,12 @@
"walkable": "false", "walkable": "false",
"tabIndex": "-1" "tabIndex": "-1"
}, },
{
"id": "328",
"interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{ {
"id": "336", "id": "336",
"interfaceType": "3", "interfaceType": "3",
@ -401,6 +491,12 @@
"walkable": "true", "walkable": "true",
"tabIndex": "-1" "tabIndex": "-1"
}, },
{
"id": "377",
"interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{ {
"id": "380", "id": "380",
"interfaceType": "1", "interfaceType": "1",
@ -455,12 +551,24 @@
"walkable": "true", "walkable": "true",
"tabIndex": "4" "tabIndex": "4"
}, },
{
"id": "418",
"interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{ {
"id": "421", "id": "421",
"interfaceType": "4", "interfaceType": "4",
"walkable": "false", "walkable": "false",
"tabIndex": "-1" "tabIndex": "-1"
}, },
{
"id": "428",
"interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{ {
"id": "430", "id": "430",
"interfaceType": "2", "interfaceType": "2",
@ -479,6 +587,30 @@
"walkable": "true", "walkable": "true",
"tabIndex": "-1" "tabIndex": "-1"
}, },
{
"id": "485",
"interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{
"id": "486",
"interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{
"id": "487",
"interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{
"id": "488",
"interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{ {
"id": "498", "id": "498",
"interfaceType": "0", "interfaceType": "0",
@ -499,7 +631,7 @@
}, },
{ {
"id": "532", "id": "532",
"interfaceType": "1", "interfaceType": "8",
"walkable": "true", "walkable": "true",
"tabIndex": "-1" "tabIndex": "-1"
}, },
@ -611,9 +743,15 @@
"walkable": "false", "walkable": "false",
"tabIndex": "-1" "tabIndex": "-1"
}, },
{
"id": "653",
"interfaceType": "8",
"walkable": "true",
"tabIndex": "-1"
},
{ {
"id": "656", "id": "656",
"interfaceType": "1", "interfaceType": "8",
"walkable": "true", "walkable": "true",
"tabIndex": "-1" "tabIndex": "-1"
}, },
@ -727,7 +865,7 @@
}, },
{ {
"id": "809", "id": "809",
"interfaceType": "1", "interfaceType": "8",
"walkable": "true", "walkable": "true",
"tabIndex": "-1" "tabIndex": "-1"
} }

View file

@ -1,5 +1,7 @@
package content.global.handlers.iface; package content.global.handlers.iface;
import content.global.skill.summoning.familiar.BurdenBeast;
import core.api.ContentAPIKt;
import core.cache.def.impl.ItemDefinition; import core.cache.def.impl.ItemDefinition;
import core.game.component.Component; import core.game.component.Component;
import core.game.component.ComponentDefinition; import core.game.component.ComponentDefinition;
@ -24,6 +26,7 @@ import core.game.global.action.EquipHandler;
import core.game.interaction.IntType; import core.game.interaction.IntType;
import core.game.interaction.InteractionListeners; import core.game.interaction.InteractionListeners;
import core.game.world.GameWorld; import core.game.world.GameWorld;
import core.tools.Log;
/** /**
* Represents the equipment interface. * Represents the equipment interface.
@ -35,6 +38,7 @@ public final class EquipmentInterface extends ComponentPlugin {
@Override @Override
public Plugin<Object> newInstance(Object arg) throws Throwable { public Plugin<Object> newInstance(Object arg) throws Throwable {
ComponentDefinition.put(102, this);
ComponentDefinition.put(387, this); ComponentDefinition.put(387, this);
ComponentDefinition.put(667, this); ComponentDefinition.put(667, this);
ComponentDefinition.put(670, this); ComponentDefinition.put(670, this);
@ -111,20 +115,46 @@ public final class EquipmentInterface extends ComponentPlugin {
if (p.getInterfaceManager().isOpened() && p.getInterfaceManager().getOpened().getId() == 102) { if (p.getInterfaceManager().isOpened() && p.getInterfaceManager().getOpened().getId() == 102) {
return true; return true;
} }
boolean skulled = p.getSkullManager().isSkulled();
boolean usingProtect = p.getPrayer().get(PrayerType.PROTECT_ITEMS); // (Highlight white items are auto destroyed on death Enum#616 (Items kept on death interface) TODO: Parse server sided
p.getInterfaceManager().openComponent(102); // SCRIPT 118 - Items kept on death interface CS
p.getPacketDispatch().sendIfaceSettings(211, 0, 2, 6684690, 4); // ARG 0: Safe location check Takes: 0 Safe Area/2 in POH/3 in Castle Wars/4 in Trouble Brewing/5 in Barbass
p.getPacketDispatch().sendIfaceSettings(212, 0, 2, 6684693, 42); int zoneType = p.getZoneMonitor().getType();
// ARG 1: Amount of items kept on death Takes: 0/1/3/4
Container[] itemArray = DeathTask.getContainers(p); Container[] itemArray = DeathTask.getContainers(p);
Container kept = itemArray[0]; Container kept = itemArray[0];
int state = 0; // 1=familiar carrying items int amtKeptOnDeath = kept.itemCount();
int keptItems = skulled ? (usingProtect ? 1 : 0) : (usingProtect ? 4 : 3); if (amtKeptOnDeath > 4 && zoneType == 0) {
int zoneType = p.getZoneMonitor().getType(); ContentAPIKt.log(this.getClass(), Log.ERR, "Items kept on death interface should not contain more than 4 items when not in a safe zone!");
int pvpType = p.getSkullManager().isWilderness() ? 0 : 1; }
Object[] params = new Object[] { 11510, 12749, "", state, pvpType, kept.getId(3), kept.getId(2), kept.getId(1), kept.getId(0), keptItems, zoneType }; // ARG 2: Item kept on death slot 0
PacketRepository.send(ContainerPacket.class, new ContainerContext(p, 149, 0, 91, itemArray[1], false)); int slot0 = kept.getId(0);
p.getPacketDispatch().sendRunScript(118, "iiooooiisii", params); // ARG 3: Item kept on death slot 1
int slot1 = kept.getId(1);
// ARG 4: Item kept on death slot 2
int slot2 = kept.getId(2);
// ARG 5: Item kept on death slot 3
int slot3 = kept.getId(3);
// ARG 6: Player skulled Takes: 0 not skulled/1 skulled
int skulled = p.getSkullManager().isSkulled() ? 1 : 0;
// ARG 7: Player has summoning creature out Takes: 0 not out/1 Creature summoned
int hasBoB;
if (p.getFamiliarManager().hasFamiliar()) {
if (p.getFamiliarManager().getFamiliar().isBurdenBeast()) {
hasBoB = ((BurdenBeast) p.getFamiliarManager().getFamiliar()).getContainer().isEmpty() ? 0 : 1;
} else {
hasBoB = 0;
}
} else {
hasBoB = 0;
}
// ARG 8: String for effect:
// if (arg1 == 0) arg8 + " This reduces the items you keep from three to zero!"
// if (arg1 == 1) arg8 + " This reduces the items you keep from three to zero!" + "<br>" + "<br>" + "However, you also have the " + "<col=ff3333>" + "Protect Items" + "<col=ff981f>" + " prayer active, which saves you one extra item!");
Object[] params = new Object[] { hasBoB, skulled, slot3, slot2, slot1, slot0, amtKeptOnDeath, zoneType, "You are skulled." };
p.getPacketDispatch().sendRunScript(118, "siiooooii", params);
p.getInterfaceManager().openComponent(102);
break; break;
case 28: case 28:
if (opcode == 81) { if (opcode == 81) {

View file

@ -4,6 +4,7 @@ import core.api.*
import core.cache.def.impl.ItemDefinition import core.cache.def.impl.ItemDefinition
import core.game.interaction.IntType import core.game.interaction.IntType
import core.game.interaction.InteractionListener import core.game.interaction.InteractionListener
import core.game.node.item.Item
import org.rs09.consts.Items import org.rs09.consts.Items
import org.rs09.consts.Sounds import org.rs09.consts.Sounds
import java.util.* import java.util.*
@ -17,19 +18,15 @@ class EmptyOptionListener : InteractionListener {
on(EmptyItem.emptyItemList.toIntArray(), IntType.ITEM, "empty", "empty bowl", "empty dish") { player, node -> on(EmptyItem.emptyItemList.toIntArray(), IntType.ITEM, "empty", "empty bowl", "empty dish") { player, node ->
if (node.name.contains("brew") || node.name.contains("potion") || node.name.lowercase(Locale.getDefault()).contains("poison") || node.name.lowercase(Locale.getDefault()).contains("serum") || node.name.contains("cure") || node.name.contains("mix") || node.name.contains("balm")) { if (node.name.contains("brew") || node.name.contains("potion") || node.name.lowercase(Locale.getDefault()).contains("poison") || node.name.lowercase(Locale.getDefault()).contains("serum") || node.name.contains("cure") || node.name.contains("mix") || node.name.contains("balm")) {
if (removeItem(player, node.id)) { replaceSlot(player, node.asItem().slot, Item(EmptyItem.getEmpty(Items.POTION_195)!!), node.asItem())
addItem(player, EmptyItem.getEmpty(Items.POTION_195)!!)
playAudio(player, EmptyItem.getEmptyAudio(Items.POTION_195)!!) playAudio(player, EmptyItem.getEmptyAudio(Items.POTION_195)!!)
}
return@on true return@on true
} }
if (EmptyItem.emptyItemMap[node.id] != null) { if (EmptyItem.emptyItemMap[node.id] != null) {
if (removeItem(player, node.id)) { replaceSlot(player, node.asItem().slot, Item(EmptyItem.getEmpty(node.id)!!), node.asItem())
addItem(player, EmptyItem.getEmpty(node.id)!!)
if (EmptyItem.getEmptyAudio(node.id) != -1) playAudio(player, EmptyItem.getEmptyAudio(node.id)!!) if (EmptyItem.getEmptyAudio(node.id) != -1) playAudio(player, EmptyItem.getEmptyAudio(node.id)!!)
EmptyItem.getEmptyMessage(node.id)?.let { sendMessage(player, it) } EmptyItem.getEmptyMessage(node.id)?.let { sendMessage(player, it) }
} }
}
return@on true return@on true
} }
} }

View file

@ -3,7 +3,6 @@ package content.global.skill.cooking
import core.api.* import core.api.*
import core.cache.def.impl.ItemDefinition import core.cache.def.impl.ItemDefinition
import core.game.node.scenery.Scenery import core.game.node.scenery.Scenery
import content.global.skill.cooking.CookableItems
import content.global.skill.cooking.CookingRewrite.Companion.cook import content.global.skill.cooking.CookingRewrite.Companion.cook
import core.net.packet.PacketRepository import core.net.packet.PacketRepository
import core.net.packet.context.ChildPositionContext import core.net.packet.context.ChildPositionContext
@ -15,6 +14,7 @@ import core.tools.START_DIALOGUE
/** /**
* @author Ceikry * @author Ceikry
* @author bushtail - fixing it up * @author bushtail - fixing it up
* @auther Woah - for more fixing up
*/ */
class CookingDialogue(vararg val args: Any) : DialogueFile(){ class CookingDialogue(vararg val args: Any) : DialogueFile(){
@ -47,7 +47,7 @@ class CookingDialogue(vararg val args: Any) : DialogueFile(){
"Dry the meat into sinew", "Dry the meat into sinew",
"Cook the meat" "Cook the meat"
) )
stage = 100 stage = if (amountInInventory(player!!, initial) > 1) 100 else 101
return return
} }
} }
@ -78,7 +78,7 @@ class CookingDialogue(vararg val args: Any) : DialogueFile(){
when (buttonID) { when (buttonID) {
1 -> { 1 -> {
product = Items.SINEW_9436 product = Items.SINEW_9436
display(Items.COOKED_MEAT_2142) display()
} }
2 -> { 2 -> {
product = CookableItems.forId(initial).cooked product = CookableItems.forId(initial).cooked
@ -86,6 +86,19 @@ class CookingDialogue(vararg val args: Any) : DialogueFile(){
} }
} }
} }
101 -> {
when (buttonID) {
1 -> {
end()
cook(player!!, `object`, initial, Items.SINEW_9436, 1)
}
2 -> {
end()
cook(player!!, `object`, initial, CookableItems.forId(initial).cooked, 1)
}
}
}
} }
} }
@ -99,12 +112,23 @@ class CookingDialogue(vararg val args: Any) : DialogueFile(){
return -1 return -1
} }
fun display(vararg args : Int) { fun display() {
player!!.packetDispatch.sendItemZoomOnInterface(initial, 160, 307, 2)
player!!.packetDispatch.sendString("<br><br><br><br>${ItemDefinition.forId(initial).name}", 307, 6)
// Re-format this interface because it is not formatted properly for the chat-box
// Swords
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 307, 0, 12, 15))
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 307, 1, 431, 15))
// "How many would you like to cook?"
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 307, 7, 0, 12))
// Right click context menu boxes
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 307, 3, 58, 27))
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 307, 4, 58, 27))
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 307, 5, 58, 27))
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 307, 6, 58, 27))
player!!.interfaceManager.openChatbox(307) player!!.interfaceManager.openChatbox(307)
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 307, 3, 60, 90))
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 307, 2, 208, 20))
player!!.packetDispatch.sendItemZoomOnInterface(if(args.size == 1) args[0] else product, 160, 307, 2)
player!!.packetDispatch.sendString(ItemDefinition.forId(product).name, 307, 3)
stage = 1 stage = 1
} }
} }

View file

@ -1,5 +1,6 @@
package content.global.skill.cooking package content.global.skill.cooking
import core.api.amountInInventory
import core.game.interaction.IntType import core.game.interaction.IntType
import core.game.interaction.InteractionListener import core.game.interaction.InteractionListener
import core.game.node.entity.player.Player import core.game.node.entity.player.Player
@ -15,6 +16,7 @@ import org.rs09.consts.Items.UNCOOKED_CAKE_1889
/** /**
* @author Ceikry * @author Ceikry
* @author bushtail - added bear meat for sinew making * @author bushtail - added bear meat for sinew making
* @author Woah - added single food cooking
*/ */
class CookingRewrite : InteractionListener { class CookingRewrite : InteractionListener {
@ -47,7 +49,17 @@ class CookingRewrite : InteractionListener {
} }
//cook a standard item //cook a standard item
if (amountInInventory(player, item.id) > 1) {
player.dialogueInterpreter.open(CookingDialogue(item.id,obj)) player.dialogueInterpreter.open(CookingDialogue(item.id,obj))
} else {
// Don't display dialogue if player only has *1* of the item
val product = if (CookableItems.intentionalBurn(item.id)) { // checks intentional burning
CookableItems.getIntentionalBurn(item.id).id
} else {
CookableItems.forId(item.id).cooked
}
cook(player, obj, item.id, product, 1)
}
return@onUseWith true return@onUseWith true
} }

View file

@ -71,7 +71,7 @@ public final class StuddedArmourPlugin extends UseWithHandler {
* @version 1.0 * @version 1.0
*/ */
public enum StuddedArmour { public enum StuddedArmour {
CHAPS(new Item(1095), new Item(1097), 18, 27), BODY(new Item(1129), new Item(1133), 41, 40); CHAPS(new Item(1095), new Item(1097), 44, 42), BODY(new Item(1129), new Item(1133), 41, 40);
/** /**
* Represents the unstudded item. * Represents the unstudded item.

View file

@ -63,7 +63,7 @@ class FletchingListeners : InteractionListener {
onUseWith(IntType.ITEM,ARROW_SHAFT,*FEATHERS){ player, shaft, feather -> onUseWith(IntType.ITEM,ARROW_SHAFT,*FEATHERS){ player, shaft, feather ->
val handler: SkillDialogueHandler = val handler: SkillDialogueHandler =
object : SkillDialogueHandler(player, SkillDialogue.ONE_OPTION, Item(FLETCHED_SHAFT)) { object : SkillDialogueHandler(player, SkillDialogue.MAKE_SET_ONE_OPTION, Item(FLETCHED_SHAFT)) {
override fun create(amount: Int, index: Int) { override fun create(amount: Int, index: Int) {
player.pulseManager.run(HeadlessArrowPulse(player, shaft.asItem(), Item(feather.id), amount)) player.pulseManager.run(HeadlessArrowPulse(player, shaft.asItem(), Item(feather.id), amount))
} }
@ -73,14 +73,13 @@ class FletchingListeners : InteractionListener {
} }
} }
handler.open() handler.open()
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, Components.SKILL_MULTI1_309, 2, 210, 10))
return@onUseWith true return@onUseWith true
} }
onUseWith(IntType.ITEM,FLETCHED_SHAFT,*UNFINISHED_ARROWS){ player, shaft, unfinished -> onUseWith(IntType.ITEM,FLETCHED_SHAFT,*UNFINISHED_ARROWS){ player, shaft, unfinished ->
val head = Fletching.arrowHeadMap[unfinished.id] ?: return@onUseWith false val head = Fletching.arrowHeadMap[unfinished.id] ?: return@onUseWith false
val handler: SkillDialogueHandler = val handler: SkillDialogueHandler =
object : SkillDialogueHandler(player, SkillDialogue.ONE_OPTION, head.getFinished()) { object : SkillDialogueHandler(player, SkillDialogue.MAKE_SET_ONE_OPTION, head.getFinished()) {
override fun create(amount: Int, index: Int) { override fun create(amount: Int, index: Int) {
player.pulseManager.run(ArrowHeadPulse(player, shaft.asItem(), head, amount)) player.pulseManager.run(ArrowHeadPulse(player, shaft.asItem(), head, amount))
} }
@ -90,7 +89,6 @@ class FletchingListeners : InteractionListener {
} }
} }
handler.open() handler.open()
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, Components.SKILL_MULTI1_309, 2, 210, 10))
return@onUseWith true return@onUseWith true
} }

View file

@ -49,7 +49,7 @@ public class FletchingPlugin extends UseWithHandler {
//handle darts //handle darts
if(Fletching.isDart(event.getUsedItem().getId())){ if(Fletching.isDart(event.getUsedItem().getId())){
final Fletching.Darts dart = Fletching.dartMap.get(event.getUsedItem().getId()); final Fletching.Darts dart = Fletching.dartMap.get(event.getUsedItem().getId());
SkillDialogueHandler handler = new SkillDialogueHandler(player, SkillDialogue.ONE_OPTION, dart.getFinished()) { SkillDialogueHandler handler = new SkillDialogueHandler(player, SkillDialogue.MAKE_SET_ONE_OPTION, dart.getFinished()) {
@Override @Override
public void create(final int amount, int index) { public void create(final int amount, int index) {
player.getPulseManager().run(new DartPulse(player, event.getUsedItem(), dart, amount)); player.getPulseManager().run(new DartPulse(player, event.getUsedItem(), dart, amount));
@ -60,7 +60,6 @@ public class FletchingPlugin extends UseWithHandler {
} }
}; };
handler.open(); handler.open();
PacketRepository.send(RepositionChild.class, new ChildPositionContext(player, 309, 2, 230, 10));
return true; return true;
} }
@ -78,7 +77,7 @@ public class FletchingPlugin extends UseWithHandler {
final boolean hasFeather = (featherId == 314 || (featherId >= 10087 && featherId <= 10091)); final boolean hasFeather = (featherId == 314 || (featherId >= 10087 && featherId <= 10091));
if (hasFeather) { if (hasFeather) {
SkillDialogueHandler handler = new SkillDialogueHandler(player, SkillDialogue.ONE_OPTION, bolt.getFinished()) { SkillDialogueHandler handler = new SkillDialogueHandler(player, SkillDialogue.MAKE_SET_ONE_OPTION, bolt.getFinished()) {
@Override @Override
public void create(final int amount, int index) { public void create(final int amount, int index) {
player.getPulseManager().run(new BoltPulse(player, event.getUsedItem(), bolt, new Item(featherId), amount)); player.getPulseManager().run(new BoltPulse(player, event.getUsedItem(), bolt, new Item(featherId), amount));
@ -89,7 +88,6 @@ public class FletchingPlugin extends UseWithHandler {
} }
}; };
handler.open(); handler.open();
PacketRepository.send(RepositionChild.class, new ChildPositionContext(player, 309, 2, 210, 10));
return true; return true;
} }
return false; return false;

View file

@ -53,7 +53,7 @@ class GemBoltListener : InteractionListener {
val handler: SkillDialogueHandler = val handler: SkillDialogueHandler =
object : SkillDialogueHandler(player, SkillDialogue.ONE_OPTION, Item(bolt.product)) { object : SkillDialogueHandler(player, SkillDialogue.MAKE_SET_ONE_OPTION, Item(bolt.product)) {
override fun create(amount: Int, index: Int) { override fun create(amount: Int, index: Int) {
player.pulseManager.run(GemBoltPulse(player, used as? Item, bolt, amount)) player.pulseManager.run(GemBoltPulse(player, used as? Item, bolt, amount))
} }
@ -63,7 +63,6 @@ class GemBoltListener : InteractionListener {
} }
} }
handler.open() handler.open()
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 309, 2, 210, 10))
return@onUseWith true return@onUseWith true
} }
} }

View file

@ -1,5 +1,7 @@
package content.global.skill.fletching.items.bow; package content.global.skill.fletching.items.bow;
import core.api.Container;
import core.api.ContentAPIKt;
import core.game.node.entity.player.link.diary.DiaryType; import core.game.node.entity.player.link.diary.DiaryType;
import core.game.world.map.zone.ZoneBorders; import core.game.world.map.zone.ZoneBorders;
import core.game.node.entity.skill.SkillPulse; import core.game.node.entity.skill.SkillPulse;
@ -46,6 +48,9 @@ public class StringPulse extends SkillPulse<Item> {
player.getDialogueInterpreter().sendDialogue("You need a fletching level of " + bow.level + " to string this bow."); player.getDialogueInterpreter().sendDialogue("You need a fletching level of " + bow.level + " to string this bow.");
return false; return false;
} }
if (!player.getInventory().containsItem(new Item(bow.unfinished))) {
return false;
}
if (!player.getInventory().containsItem(new Item(bow.string))) { if (!player.getInventory().containsItem(new Item(bow.string))) {
player.getDialogueInterpreter().sendDialogue("You seem to have run out of bow strings."); player.getDialogueInterpreter().sendDialogue("You seem to have run out of bow strings.");
return false; return false;

View file

@ -0,0 +1,34 @@
package content.global.skill.herblore
import core.api.*
import core.game.interaction.IntType
import core.game.interaction.InteractionListener
import core.game.node.entity.skill.Skills
import core.game.node.item.Item
import java.util.*
/**
* Dirty herb cleaning listener
* @author Woah
*/
class HerbCleanListener : InteractionListener {
override fun defineListeners() {
on(IntType.ITEM, "clean") { player, node ->
lock(player, 1)
if (!requireQuest(player, "Druidic Ritual", "before you can use Herblore.")) return@on true
val herb: Herbs = Herbs.forItem(node as Item) ?: return@on true
if (getDynLevel(player, Skills.HERBLORE) < herb.level) {
sendMessage(player, "You need level " + herb.level + " Herblore to clean the " + herb.product.name.replace("Clean", "Grimy") + ".")
return@on true
}
val exp = herb.experience
replaceSlot(player, node.asItem().slot, herb.product, node.asItem())
rewardXP(player, Skills.HERBLORE, exp)
playAudio(player, 5153)
sendMessage(player, "You clean the dirt from the " + herb.product.name.lowercase(Locale.getDefault()).replace("clean", "").trim { it <= ' ' } + " leaf.")
return@on true
}
}
}

View file

@ -1,56 +0,0 @@
package content.global.skill.herblore;
import core.api.Container;
import static core.api.ContentAPIKt.*;
import core.cache.def.impl.ItemDefinition;
import core.game.interaction.OptionHandler;
import core.game.node.Node;
import core.game.node.entity.player.Player;
import core.game.node.entity.skill.Skills;
import core.game.node.item.Item;
import core.plugin.Initializable;
import core.plugin.Plugin;
import core.tools.RandomFunction;
/**
* Represents the cleaning of a dirty herb.
* @author Vexia
* @version 1.0
*/
@Initializable
public final class HerbCleanPlugin extends OptionHandler {
@Override
public Plugin<Object> newInstance(Object arg) throws Throwable {
ItemDefinition.setOptionHandler("clean", this);
return this;
}
@Override
public boolean handle(Player player, Node node, String option) {
if (!player.getQuestRepository().isComplete("Druidic Ritual")) {
player.getPacketDispatch().sendMessage("You must complete the Druidic Ritual quest before you can use Herblore.");
return true;
}
final Herbs herb = Herbs.forItem((Item) node);
if (player.getSkills().getLevel(Skills.HERBLORE) < herb.getLevel()) {
player.getPacketDispatch().sendMessage("You need level " + herb.getLevel() + " Herblore to clean the " + herb.getProduct().getName().replace("Clean", "Grimy") + ".");
return true;
}
double exp = herb.getExperience();
if (removeItem(player, node.asItem(), Container.INVENTORY)){
player.getSkills().addExperience(Skills.HERBLORE, exp, true);
addItem(player, herb.getProduct().getId(), 1, Container.INVENTORY);
playAudio(player, 5153);
player.getPacketDispatch().sendMessage("You clean the dirt from the " + herb.getProduct().getName().toLowerCase().replace("clean", "").trim() + " leaf.");
}
player.lock(1);
return true;
}
@Override
public boolean isWalk() {
return false;
}
}

View file

@ -1,21 +1,14 @@
package content.minigame.puropuro; package content.minigame.puropuro;
import java.util.ArrayList;
import java.util.List;
import core.cache.def.impl.ItemDefinition; import core.cache.def.impl.ItemDefinition;
import core.cache.def.impl.NPCDefinition; import core.cache.def.impl.NPCDefinition;
import core.cache.def.impl.SceneryDefinition;
import core.game.component.Component; import core.game.component.Component;
import core.plugin.Initializable;
import core.game.node.entity.skill.Skills;
import core.game.interaction.Option; import core.game.interaction.Option;
import core.game.interaction.OptionHandler; import core.game.interaction.OptionHandler;
import core.game.node.Node; import core.game.node.Node;
import core.game.node.entity.Entity; import core.game.node.entity.Entity;
import core.game.node.entity.impl.ForceMovement;
import core.game.node.entity.player.Player; import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.TeleportManager.TeleportType; import core.game.node.entity.skill.Skills;
import core.game.node.item.Item; import core.game.node.item.Item;
import core.game.node.scenery.Scenery; import core.game.node.scenery.Scenery;
import core.game.node.scenery.SceneryBuilder; import core.game.node.scenery.SceneryBuilder;
@ -31,17 +24,20 @@ import core.game.world.update.flag.context.Animation;
import core.net.packet.PacketRepository; import core.net.packet.PacketRepository;
import core.net.packet.context.MinimapStateContext; import core.net.packet.context.MinimapStateContext;
import core.net.packet.out.MinimapState; import core.net.packet.out.MinimapState;
import core.plugin.Plugin;
import core.plugin.ClassScanner; import core.plugin.ClassScanner;
import core.plugin.Initializable;
import core.plugin.Plugin;
import core.tools.RandomFunction; import core.tools.RandomFunction;
import org.rs09.consts.Items;
import static core.api.ContentAPIKt.animateScenery; import java.util.ArrayList;
import static core.api.ContentAPIKt.submitWorldPulse; import java.util.List;
import static core.api.ContentAPIKt.animationDuration;
import static core.api.ContentAPIKt.forceMove; import static core.api.ContentAPIKt.*;
/** /**
* Handles the puro puro activity. * Handles the puro puro activity.
*
* @author Vexia * @author Vexia
*/ */
@Initializable @Initializable
@ -139,6 +135,7 @@ public final class PuroPuroPlugin extends MapZone implements Plugin<Object> {
/** /**
* Pushes through the wheat. * Pushes through the wheat.
*
* @param player the player. * @param player the player.
* @param object the object. * @param object the object.
*/ */
@ -176,6 +173,7 @@ public final class PuroPuroPlugin extends MapZone implements Plugin<Object> {
/** /**
* Checks if the player has an impling box. * Checks if the player has an impling box.
*
* @param player the player. * @param player the player.
* @return {@code True} if so. * @return {@code True} if so.
*/ */
@ -225,6 +223,7 @@ public final class PuroPuroPlugin extends MapZone implements Plugin<Object> {
/** /**
* Handles the puro puro options. * Handles the puro puro options.
*
* @author Vexia * @author Vexia
*/ */
public class PuroOptionHandler extends OptionHandler { public class PuroOptionHandler extends OptionHandler {
@ -257,7 +256,8 @@ public final class PuroPuroPlugin extends MapZone implements Plugin<Object> {
player.getInterfaceManager().closeOverlay(); player.getInterfaceManager().closeOverlay();
break; break;
} }
player.getInterfaceManager().openOverlay(new Component(541));
player.getInterfaceManager().openOverlay(new Component(169));
} }
return true; return true;
} }
@ -266,6 +266,7 @@ public final class PuroPuroPlugin extends MapZone implements Plugin<Object> {
/** /**
* Handles the jar generator. * Handles the jar generator.
*
* @param player the player. * @param player the player.
* @param item the item. * @param item the item.
* @param option the option. * @param option the option.
@ -284,6 +285,7 @@ public final class PuroPuroPlugin extends MapZone implements Plugin<Object> {
/** /**
* Generates a new jar. * Generates a new jar.
*
* @param player the player. * @param player the player.
* @param item the item. * @param item the item.
* @param option the option. * @param option the option.
@ -308,6 +310,7 @@ public final class PuroPuroPlugin extends MapZone implements Plugin<Object> {
/** /**
* Checks if the player has the percent. * Checks if the player has the percent.
*
* @param item the item. * @param item the item.
* @param percent the percent. * @param percent the percent.
* @return * @return
@ -318,6 +321,7 @@ public final class PuroPuroPlugin extends MapZone implements Plugin<Object> {
/** /**
* The percent to set. * The percent to set.
*
* @param item the item. * @param item the item.
* @param percent the percent. * @param percent the percent.
*/ */
@ -327,6 +331,7 @@ public final class PuroPuroPlugin extends MapZone implements Plugin<Object> {
/** /**
* Gets the percent. * Gets the percent.
*
* @param item the item. * @param item the item.
* @return the percent. * @return the percent.
*/ */
@ -384,6 +389,7 @@ public final class PuroPuroPlugin extends MapZone implements Plugin<Object> {
/** /**
* Constructs a new {@code WheatSet} {@code Object}. * Constructs a new {@code WheatSet} {@code Object}.
*
* @param locations the locations. * @param locations the locations.
*/ */
public WheatSet(int rot, Location... locations) { public WheatSet(int rot, Location... locations) {
@ -421,7 +427,7 @@ public final class PuroPuroPlugin extends MapZone implements Plugin<Object> {
@Override @Override
public boolean pulse() { public boolean pulse() {
if (counter++ == 0) { if (counter++ == 0) {
animateScenery (object, 6596); animateScenery(object, 6596);
setDelay(animationDuration(new Animation(6596))); setDelay(animationDuration(new Animation(6596)));
return false; return false;
} }
@ -437,7 +443,7 @@ public final class PuroPuroPlugin extends MapZone implements Plugin<Object> {
@Override @Override
public boolean pulse() { public boolean pulse() {
if (counter++ == 0) { if (counter++ == 0) {
animateScenery (object, 6599); animateScenery(object, 6599);
setDelay(animationDuration(new Animation(6599))); setDelay(animationDuration(new Animation(6599)));
return false; return false;
} }
@ -468,6 +474,7 @@ public final class PuroPuroPlugin extends MapZone implements Plugin<Object> {
/** /**
* Checks if the wheat can whilt. * Checks if the wheat can whilt.
*
* @return {@code True} if so. * @return {@code True} if so.
*/ */
public boolean canWhilt() { public boolean canWhilt() {
@ -476,6 +483,7 @@ public final class PuroPuroPlugin extends MapZone implements Plugin<Object> {
/** /**
* Gets the nextWhilt. * Gets the nextWhilt.
*
* @return The nextWhilt. * @return The nextWhilt.
*/ */
public int getNextWhilt() { public int getNextWhilt() {
@ -484,6 +492,7 @@ public final class PuroPuroPlugin extends MapZone implements Plugin<Object> {
/** /**
* Sets the nextWhilt. * Sets the nextWhilt.
*
* @param nextWhilt The nextWhilt to set. * @param nextWhilt The nextWhilt to set.
*/ */
public void setNextWhilt(int nextWhilt) { public void setNextWhilt(int nextWhilt) {
@ -492,6 +501,7 @@ public final class PuroPuroPlugin extends MapZone implements Plugin<Object> {
/** /**
* Gets the locations. * Gets the locations.
*
* @return The locations. * @return The locations.
*/ */
public Location[] getLocations() { public Location[] getLocations() {

View file

@ -1551,7 +1551,6 @@ public class ItemDefinition extends Definition<Item> {
if (!player.getAttribute("equip_stats_open", false)) { if (!player.getAttribute("equip_stats_open", false)) {
return; return;
} }
PacketRepository.send(WeightUpdate.class, player.getPacketDispatch().getContext());
int index = 0; int index = 0;
int[] bonuses = player.getProperties().getBonuses(); int[] bonuses = player.getProperties().getBonuses();
for (int i = 36; i < 50; i++) { for (int i = 36; i < 50; i++) {
@ -1563,8 +1562,6 @@ public class ItemDefinition extends Definition<Item> {
player.getPacketDispatch().sendString(BONUS_NAMES[index++] + bonusValue, 667, i); player.getPacketDispatch().sendString(BONUS_NAMES[index++] + bonusValue, 667, i);
} }
player.getPacketDispatch().sendString("Attack bonus", 667, 34); player.getPacketDispatch().sendString("Attack bonus", 667, 34);
DecimalFormat dec = new DecimalFormat("#.#");
player.getPacketDispatch().sendString(dec.format(player.getSettings().getWeight())+" kg", 667, 32);
} }
/** /**

View file

@ -53,7 +53,7 @@ public enum InterfaceType {
/** /**
* Wilderness overlay * Wilderness overlay
*/ */
WILDERNESS_OVERLAY(Components.TOPLEVEL_548, Components.TOPLEVEL_FULLSCREEN_746, 11, 3); OVERLAY_B(Components.TOPLEVEL_548, Components.TOPLEVEL_FULLSCREEN_746, 11, 3);
/** /**
* The fixed window pane id. * The fixed window pane id.

View file

@ -363,7 +363,6 @@ public final class EquipmentContainer extends Container {
if (!player.getInterfaceManager().hasMainComponent(667)) { if (!player.getInterfaceManager().hasMainComponent(667)) {
return; return;
} }
PacketRepository.send(WeightUpdate.class, player.getPacketDispatch().getContext());
int index = 0; int index = 0;
int[] bonuses = player.getProperties().getBonuses(); int[] bonuses = player.getProperties().getBonuses();
for (int i = 36; i < 50; i++) { for (int i = 36; i < 50; i++) {

View file

@ -11,8 +11,10 @@ import core.game.node.entity.npc.NPC;
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.net.packet.PacketRepository; import core.net.packet.PacketRepository;
import core.net.packet.context.ChildPositionContext;
import core.net.packet.context.ContainerContext; import core.net.packet.context.ContainerContext;
import core.net.packet.out.ContainerPacket; import core.net.packet.out.ContainerPacket;
import core.net.packet.out.RepositionChild;
import core.plugin.PluginManifest; import core.plugin.PluginManifest;
import core.plugin.PluginType; import core.plugin.PluginType;
import core.game.system.config.ItemConfigParser; import core.game.system.config.ItemConfigParser;
@ -263,8 +265,6 @@ public final class DialogueInterpreter {
* @return The component. * @return The component.
*/ */
public Component sendDestroyItem(int id, String message) { public Component sendDestroyItem(int id, String message) {
player.getInterfaceManager().openChatbox(94);
PacketRepository.send(ContainerPacket.class, new ContainerContext(player, 94, 93, 93, new Item[] { new Item(id) }, 1, false));
String text = ItemDefinition.forId(id).getConfiguration(ItemConfigParser.DESTROY_MESSAGE, "Are you sure you want to destroy this object?"); String text = ItemDefinition.forId(id).getConfiguration(ItemConfigParser.DESTROY_MESSAGE, "Are you sure you want to destroy this object?");
if (text.length() > 200) { if (text.length() > 200) {
String[] words = text.split(" "); String[] words = text.split(" ");
@ -279,11 +279,11 @@ public final class DialogueInterpreter {
} }
text = sb.toString(); text = sb.toString();
} }
player.getPacketDispatch().sendString("Are you sure you want to destroy this object?", 94, 2);
player.getPacketDispatch().sendString("Yes.", 94, 3);
player.getPacketDispatch().sendString("No.", 94, 4);
player.getPacketDispatch().sendString(text, 94, 7); player.getPacketDispatch().sendString(text, 94, 7);
player.getPacketDispatch().sendString(ItemDefinition.forId(id).getName(), 94, 8); player.getPacketDispatch().sendString(ItemDefinition.forId(id).getName(), 94, 8);
player.getPacketDispatch().sendItemOnInterface(id, 1, 94, 9);
player.getInterfaceManager().openChatbox(94);
return player.getInterfaceManager().getChatbox(); return player.getInterfaceManager().getChatbox();
} }

View file

@ -123,6 +123,37 @@ open class SkillDialogueHandler(
} }
} }
}, },
MAKE_SET_ONE_OPTION(582, 4, 1) {
override fun display(player: Player, handler: SkillDialogueHandler) {
val item = handler.data[0] as Item
// Send item + item name to interface
player.packetDispatch.sendItemZoomOnInterface(item.id, 160, 582, 2)
player.packetDispatch.sendString("<br><br><br><br>" + item.name, 582, 5)
// Re-format this interface because it is not formatted properly for the chat-box
// Swords
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 582, 0, 12, 15))
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 582, 1, 431, 15))
// "How many would you like to make?"
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 582, 6, 0, 12))
// Item displayed
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 582, 2, 207, 23))
// Right click context menu boxes
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 582, 3, 58, 27))
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 582, 4, 58, 27))
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 582, 5, 58, 27))
}
override fun getAmount(handler: SkillDialogueHandler, buttonId: Int): Int {
return when(buttonId){
4 -> 1
3 -> 5
2 -> 10
else -> handler.getAll(getIndex(handler, buttonId))
}
}
},
TWO_OPTION(303, 7, 2) { TWO_OPTION(303, 7, 2) {
override fun display(player: Player, handler: SkillDialogueHandler) { override fun display(player: Player, handler: SkillDialogueHandler) {
var item: Item var item: Item

View file

@ -15,7 +15,6 @@ import core.net.packet.out.WindowsPane;
import core.tools.Log; import core.tools.Log;
import org.rs09.consts.Components; import org.rs09.consts.Components;
import content.region.misc.tutisland.handlers.TutorialStage; import content.region.misc.tutisland.handlers.TutorialStage;
import core.tools.SystemLogger;
import static core.api.ContentAPIKt.log; import static core.api.ContentAPIKt.log;
import static core.api.ContentAPIKt.*; import static core.api.ContentAPIKt.*;
@ -612,7 +611,7 @@ public final class InterfaceManager {
return; return;
} }
overlay = component; overlay = component;
if (overlay.getDefinition().getType() != InterfaceType.OVERLAY) { if (overlay.getDefinition().getType() != InterfaceType.OVERLAY && overlay.getDefinition().getType() != InterfaceType.OVERLAY_B) {
log(this.getClass(), Log.WARN, "Set interface type to OVERLAY for component " + component.getId() + ", definition requires updating!"); log(this.getClass(), Log.WARN, "Set interface type to OVERLAY for component " + component.getId() + ", definition requires updating!");
overlay.getDefinition().setType(InterfaceType.OVERLAY); overlay.getDefinition().setType(InterfaceType.OVERLAY);
overlay.getDefinition().setWalkable(true); overlay.getDefinition().setWalkable(true);
@ -620,23 +619,6 @@ public final class InterfaceManager {
overlay.open(player); overlay.open(player);
} }
/**
* Opens the wilderness overlay.
* @param component The component.
*/
public void openWildernessOverlay(Component component) {
if (wildyOverlay != null && !wildyOverlay.close(player)) {
return;
}
wildyOverlay = component;
if (wildyOverlay.getDefinition().getType() != InterfaceType.WILDERNESS_OVERLAY) {
log(this.getClass(), Log.WARN, "Set interface type to WILDERNESS_OVERLAY for component " + component.getId() + ", definition requires updating!");
wildyOverlay.getDefinition().setType(InterfaceType.WILDERNESS_OVERLAY);
wildyOverlay.getDefinition().setWalkable(true);
}
wildyOverlay.open(player);
}
/** /**
* Closes the current overlay. * Closes the current overlay.
*/ */

View file

@ -428,6 +428,7 @@ public final class Settings {
} }
weight += item.getDefinition().getConfiguration(ItemConfigParser.WEIGHT, 0.0); weight += item.getDefinition().getConfiguration(ItemConfigParser.WEIGHT, 0.0);
} }
player.getPacketDispatch().sendString((int) weight + " kg", 667, 32);
} }
/** /**

View file

@ -3,9 +3,9 @@ package core.game.system.command.sets
import core.game.component.Component import core.game.component.Component
import core.game.node.entity.player.Player import core.game.node.entity.player.Player
import core.game.node.entity.player.link.quest.QuestRepository import core.game.node.entity.player.link.quest.QuestRepository
import core.game.system.command.Command
import core.plugin.Initializable import core.plugin.Initializable
import core.game.system.command.Privilege import core.game.system.command.Privilege
import core.game.world.repository.Repository
@Initializable @Initializable
class QuestCommandSet : CommandSet(Privilege.ADMIN){ class QuestCommandSet : CommandSet(Privilege.ADMIN){
@ -22,8 +22,20 @@ class QuestCommandSet : CommandSet(Privilege.ADMIN){
/** /**
* Displays the currently implemented quests with debug information * Displays the currently implemented quests with debug information
*/ */
define("quest"){player,_ -> define("quest"){player,args ->
sendQuestsDebug(player) if (args.size < 3) {
val lookupP = if (args.size == 1) {
player
} else if (Repository.getPlayerByName(args[1]) != null) {
Repository.getPlayerByName(args[1]) ?: return@define
} else {
reject(player, "ERROR: Username not found. Usage: ::quest <username>")
return@define
}
sendQuestsDebug(player, lookupP)
} else {
reject(player, "Usage: ::quest || ::quest <username>")
}
} }
/** /**
@ -71,20 +83,26 @@ class QuestCommandSet : CommandSet(Privilege.ADMIN){
/** /**
* Sends the list of quests with debug information * Sends the list of quests with debug information
* @param player the player. * @param admin the player.
*/ */
private fun sendQuestsDebug(player: Player?) { private fun sendQuestsDebug(admin: Player?, lookupUser: Player?) {
player!!.interfaceManager.open(Component(275)) admin!!.interfaceManager.open(Component(275))
for (i in 0..310) { for (i in 0..310) {
player.packetDispatch.sendString("", 275, i) admin.packetDispatch.sendString("", 275, i)
} }
var lineId = 11 var lineId = 11
player.packetDispatch.sendString("<col=ecf0f1>" + "Quests Debug" + "</col>", 275, 2) admin.packetDispatch.sendString("<col=ecf0f1>${lookupUser!!.username}'s Quest Debug</col>", 275, 2)
for (q in QuestRepository.getQuests().values) { for (q in QuestRepository.getQuests().values) {
// Add a space to beginning and end of string for the strikethrough // Add a space to beginning and end of string for the strikethrough
player.packetDispatch.sendString("<col=ecf0f1>${q.name}</col>", 275, lineId++) val stage = lookupUser.questRepository.getStage(q)
player.packetDispatch.sendString("<col=ecf0f1>Index: </col><col=ff1f1f>${q.index}</col> | <col=ecf0f1>Stage:</col> <col=ff1f1f>${player.questRepository.getStage(q)}</col>", 275, lineId++) val statusColor = when {
player.packetDispatch.sendString("<str> ", 275, lineId++) stage >= 100 -> "80ff00"
stage in 1..99 -> "ff8400"
else -> "ff0000"
}
admin.packetDispatch.sendString("<col=ecf0f1>${q.name}</col>", 275, lineId++)
admin.packetDispatch.sendString("<col=ecf0f1>Index: </col><col=ff1f1f><shad=2>${q.index}</shad></col> | <col=ecf0f1>Stage:</col> <col=$statusColor><shad=2>${lookupUser.questRepository.getStage(q)}</shad></col>", 275, lineId++)
admin.packetDispatch.sendString("<str> ", 275, lineId++)
} }
} }
} }

View file

@ -232,7 +232,7 @@ public final class WildernessZone extends MapZone {
if (p.getSkullManager().isWildernessDisabled()) { if (p.getSkullManager().isWildernessDisabled()) {
return; return;
} }
p.getInterfaceManager().openWildernessOverlay(new Component(381)); p.getInterfaceManager().openOverlay(new Component(381));
p.getSkullManager().setLevel(getWilderness(p)); p.getSkullManager().setLevel(getWilderness(p));
p.getPacketDispatch().sendString("Level: " + p.getSkullManager().getLevel(), 381, 1); p.getPacketDispatch().sendString("Level: " + p.getSkullManager().getLevel(), 381, 1);
if(GameWorld.getSettings().getWild_pvp_enabled()) { if(GameWorld.getSettings().getWild_pvp_enabled()) {

View file

@ -70,7 +70,7 @@ public final class PacketRepository {
OUTGOING_PACKETS.put(CommunicationMessage.class, new CommunicationMessage()); // OUTGOING_PACKETS.put(CommunicationMessage.class, new CommunicationMessage()); //
OUTGOING_PACKETS.put(UpdateClanChat.class, new UpdateClanChat()); // OUTGOING_PACKETS.put(UpdateClanChat.class, new UpdateClanChat()); //
OUTGOING_PACKETS.put(UpdateGroundItemAmount.class, new UpdateGroundItemAmount()); // OUTGOING_PACKETS.put(UpdateGroundItemAmount.class, new UpdateGroundItemAmount()); //
OUTGOING_PACKETS.put(WeightUpdate.class, new WeightUpdate()); // //OUTGOING_PACKETS.put(WeightUpdate.class, new WeightUpdate()); //
OUTGOING_PACKETS.put(UpdateRandomFile.class, new UpdateRandomFile()); // OUTGOING_PACKETS.put(UpdateRandomFile.class, new UpdateRandomFile()); //
OUTGOING_PACKETS.put(InstancedLocationUpdate.class, new InstancedLocationUpdate()); // OUTGOING_PACKETS.put(InstancedLocationUpdate.class, new InstancedLocationUpdate()); //
OUTGOING_PACKETS.put(CSConfigPacket.class, new CSConfigPacket()); // OUTGOING_PACKETS.put(CSConfigPacket.class, new CSConfigPacket()); //