mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-09 16:45:44 -07:00
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:
parent
098d947d87
commit
8ef5d8bce4
23 changed files with 792 additions and 575 deletions
|
|
@ -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"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
|
|
@ -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,18 +18,14 @@ 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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -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
|
||||||
player.dialogueInterpreter.open(CookingDialogue(item.id,obj))
|
if (amountInInventory(player, item.id) > 1) {
|
||||||
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -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,473 +24,490 @@ 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
|
||||||
public final class PuroPuroPlugin extends MapZone implements Plugin<Object> {
|
public final class PuroPuroPlugin extends MapZone implements Plugin<Object> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The moving wheat.
|
* The moving wheat.
|
||||||
*/
|
*/
|
||||||
private static final List<WheatSet> WHEAT = new ArrayList<>(20);
|
private static final List<WheatSet> WHEAT = new ArrayList<>(20);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The pulse.
|
* The pulse.
|
||||||
*/
|
*/
|
||||||
private static final Pulse PULSE = new Pulse(1) {
|
private static final Pulse PULSE = new Pulse(1) {
|
||||||
@Override
|
@Override
|
||||||
public boolean pulse() {
|
public boolean pulse() {
|
||||||
for (WheatSet set : WHEAT) {
|
for (WheatSet set : WHEAT) {
|
||||||
if (set.canWhilt()) {
|
if (set.canWhilt()) {
|
||||||
set.whilt();
|
set.whilt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new {@code PuroPuroActivity} {@code Object}.
|
* Constructs a new {@code PuroPuroActivity} {@code Object}.
|
||||||
*/
|
*/
|
||||||
public PuroPuroPlugin() {
|
public PuroPuroPlugin() {
|
||||||
super("puro puro", true);
|
super("puro puro", true);
|
||||||
setZoneType(ZoneType.SAFE.getId());
|
setZoneType(ZoneType.SAFE.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
||||||
PULSE.stop();
|
PULSE.stop();
|
||||||
ZoneBuilder.configure(this);
|
ZoneBuilder.configure(this);
|
||||||
ClassScanner.definePlugin(new FairyAerykaDialogue());
|
ClassScanner.definePlugin(new FairyAerykaDialogue());
|
||||||
ClassScanner.definePlugin(new WanderingImplingDialogue());
|
ClassScanner.definePlugin(new WanderingImplingDialogue());
|
||||||
ClassScanner.definePlugin(new ElnockInquisitorDialogue());
|
ClassScanner.definePlugin(new ElnockInquisitorDialogue());
|
||||||
ClassScanner.definePlugin(new PuroOptionHandler());
|
ClassScanner.definePlugin(new PuroOptionHandler());
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object fireEvent(String identifier, Object... args) {
|
public Object fireEvent(String identifier, Object... args) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean enter(Entity e) {
|
public boolean enter(Entity e) {
|
||||||
if (e instanceof Player) {
|
if (e instanceof Player) {
|
||||||
Player p = e.asPlayer();
|
Player p = e.asPlayer();
|
||||||
PacketRepository.send(MinimapState.class, new MinimapStateContext(p, 2));
|
PacketRepository.send(MinimapState.class, new MinimapStateContext(p, 2));
|
||||||
}
|
}
|
||||||
if (!PULSE.isRunning()) {
|
if (!PULSE.isRunning()) {
|
||||||
spawnWheat();
|
spawnWheat();
|
||||||
PULSE.restart();
|
PULSE.restart();
|
||||||
PULSE.start();
|
PULSE.start();
|
||||||
GameWorld.getPulser().submit(PULSE);
|
GameWorld.getPulser().submit(PULSE);
|
||||||
}
|
}
|
||||||
return super.enter(e);
|
return super.enter(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean leave(Entity e, boolean logout) {
|
public boolean leave(Entity e, boolean logout) {
|
||||||
if (e instanceof Player) {
|
if (e instanceof Player) {
|
||||||
Player p = e.asPlayer();
|
Player p = e.asPlayer();
|
||||||
if (!logout) {
|
if (!logout) {
|
||||||
p.getInterfaceManager().close();
|
p.getInterfaceManager().close();
|
||||||
p.getInterfaceManager().closeOverlay();
|
p.getInterfaceManager().closeOverlay();
|
||||||
PacketRepository.send(MinimapState.class, new MinimapStateContext(p, 0));
|
PacketRepository.send(MinimapState.class, new MinimapStateContext(p, 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return super.leave(e, logout);
|
return super.leave(e, logout);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean interact(Entity e, Node target, Option option) {
|
public boolean interact(Entity e, Node target, Option option) {
|
||||||
if (e instanceof Player) {
|
if (e instanceof Player) {
|
||||||
Player p = (Player) e;
|
Player p = (Player) e;
|
||||||
switch (target.getId()) {
|
switch (target.getId()) {
|
||||||
case 25016:
|
case 25016:
|
||||||
case 25029:
|
case 25029:
|
||||||
case 25019:
|
case 25019:
|
||||||
case 25018:
|
case 25018:
|
||||||
case 25020:
|
case 25020:
|
||||||
case 25021:
|
case 25021:
|
||||||
pushThrough(p, (Scenery) target);
|
pushThrough(p, (Scenery) target);
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return super.interact(e, target, option);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pushes through the wheat.
|
||||||
|
*
|
||||||
|
* @param player the player.
|
||||||
|
* @param object the object.
|
||||||
|
*/
|
||||||
|
private void pushThrough(final Player player, final Scenery object) {
|
||||||
|
if (player.getSkills().getStaticLevel(Skills.HUNTER) < 17) {
|
||||||
|
player.sendMessage("You need a Hunting level of at least 17 to enter the maze.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (hasImplingBox(player)) {
|
||||||
|
player.getDialogueInterpreter().sendDialogue("Something prevents you from entering. You think the portal is", "offended by your imp boxes. They are not popular on imp", "and impling planes.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final Location dest = object.getLocation().transform(Direction.getLogicalDirection(player.getLocation(), object.getLocation()), 1);
|
||||||
|
if (RegionManager.getObject(dest) != null) {
|
||||||
|
player.sendMessage("An object on the other side is in your way.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (RandomFunction.random(2) == 0) {
|
||||||
|
player.sendMessage("You use your strength to push through the wheat.");
|
||||||
|
} else {
|
||||||
|
player.sendMessage("You use your strength to push through the wheat. It's hard work though.");
|
||||||
|
}
|
||||||
|
player.setAttribute("cantMove", true);
|
||||||
|
forceMove(player, player.getLocation(), dest, 0, 265, null, 6595, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Spawns the wheat.
|
||||||
|
*/
|
||||||
|
private void spawnWheat() {
|
||||||
|
for (WheatSet set : WHEAT) {
|
||||||
|
set.init();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the player has an impling box.
|
||||||
|
*
|
||||||
|
* @param player the player.
|
||||||
|
* @return {@code True} if so.
|
||||||
|
*/
|
||||||
|
private boolean hasImplingBox(Player player) {
|
||||||
|
return player.getInventory().contains(10025, 1) || player.getInventory().contains(10027, 1) || player.getInventory().contains(10028, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void configure() {
|
||||||
|
registerRegion(10307);
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2606, 4329, 0), Location.create(2606, 4328, 0)));
|
||||||
|
WHEAT.add(new WheatSet(1, Location.create(2596, 4331, 0), Location.create(2597, 4331, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2580, 4326, 0), Location.create(2580, 4325, 0)));
|
||||||
|
WHEAT.add(new WheatSet(1, Location.create(2595, 4308, 0), Location.create(2596, 4308, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2603, 4314, 0), Location.create(2603, 4313, 0)));
|
||||||
|
WHEAT.add(new WheatSet(1, Location.create(2599, 4305, 0), Location.create(2600, 4305, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2577, 4327, 0), Location.create(2577, 4328, 0)));
|
||||||
|
WHEAT.add(new WheatSet(1, Location.create(2587, 4334, 0), Location.create(2586, 4334, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2609, 4310, 0), Location.create(2609, 4309, 0)));
|
||||||
|
WHEAT.add(new WheatSet(1, Location.create(2586, 4302, 0), Location.create(2587, 4302, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2574, 4310, 0), Location.create(2574, 4311, 0)));
|
||||||
|
WHEAT.add(new WheatSet(1, Location.create(2582, 4337, 0), Location.create(2581, 4337, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2571, 4316, 0), Location.create(2571, 4315, 0)));
|
||||||
|
WHEAT.add(new WheatSet(1, Location.create(2601, 4340, 0), Location.create(2602, 4340, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2612, 4324, 0), Location.create(2612, 4323, 0)));
|
||||||
|
WHEAT.add(new WheatSet(1, Location.create(2584, 4296, 0), Location.create(2583, 4296, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2568, 4329, 0), Location.create(2568, 4330, 0)));
|
||||||
|
WHEAT.add(new WheatSet(1, Location.create(2595, 4343, 0), Location.create(2596, 4343, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2615, 4315, 0), Location.create(2615, 4314, 0)));
|
||||||
|
WHEAT.add(new WheatSet(1, Location.create(2601, 4293, 0), Location.create(2600, 4293, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2565, 4310, 0), Location.create(2565, 4311, 0)));
|
||||||
|
WHEAT.add(new WheatSet(1, Location.create(2582, 4346, 0), Location.create(2583, 4346, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2568, 4348, 0), Location.create(2568, 4347, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2615, 4347, 0), Location.create(2615, 4348, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2612, 4345, 0), Location.create(2612, 4344, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2614, 4292, 0), Location.create(2614, 4291, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2568, 4292, 0), Location.create(2568, 4291, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2571, 4295, 0), Location.create(2571, 4294, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2575, 4297, 0), Location.create(2575, 4298, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2584, 4330, 0), Location.create(2584, 4329, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2599, 4329, 0), Location.create(2599, 4330, 0)));
|
||||||
|
WHEAT.add(new WheatSet(1, Location.create(2602, 4312, 0), Location.create(2601, 4312, 0)));
|
||||||
|
WHEAT.add(new WheatSet(1, Location.create(2610, 4312, 0), Location.create(2611, 4312, 0)));
|
||||||
|
WHEAT.add(new WheatSet(1, Location.create(2570, 4309, 0), Location.create(2569, 4309, 0)));
|
||||||
|
WHEAT.add(new WheatSet(0, Location.create(2583, 4304, 0), Location.create(2583, 4303, 0)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles the puro puro options.
|
||||||
|
*
|
||||||
|
* @author Vexia
|
||||||
|
*/
|
||||||
|
public class PuroOptionHandler extends OptionHandler {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
||||||
|
NPCDefinition.forId(6070).getHandlers().put("option:trade", this);
|
||||||
|
ItemDefinition.forId(11273).getHandlers().put("option:toggle-view", this);
|
||||||
|
ItemDefinition.forId(11258).getHandlers().put("option:butterfly-jar", this);
|
||||||
|
ItemDefinition.forId(11258).getHandlers().put("option:impling-jar", this);
|
||||||
|
ItemDefinition.forId(11258).getHandlers().put("option:check", this);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean handle(Player player, Node node, String option) {
|
||||||
|
switch (node.getId()) {
|
||||||
|
case 11258:
|
||||||
|
handleJarGenerator(player, (Item) node, option);
|
||||||
|
break;
|
||||||
|
case 6070:
|
||||||
|
ElnockInquisitorDialogue.openShop(player);
|
||||||
|
break;
|
||||||
|
case 11273:
|
||||||
|
if (!player.getZoneMonitor().isInZone("puro puro")) {
|
||||||
|
player.sendMessage("You can only use this in the Puro Puro Maze.");
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
if (player.getInterfaceManager().getOverlay() != null) {
|
||||||
|
player.getInterfaceManager().closeOverlay();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return super.interact(e, target, option);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
player.getInterfaceManager().openOverlay(new Component(169));
|
||||||
* Pushes through the wheat.
|
}
|
||||||
* @param player the player.
|
return true;
|
||||||
* @param object the object.
|
}
|
||||||
*/
|
return true;
|
||||||
private void pushThrough(final Player player, final Scenery object) {
|
}
|
||||||
if (player.getSkills().getStaticLevel(Skills.HUNTER) < 17) {
|
|
||||||
player.sendMessage("You need a Hunting level of at least 17 to enter the maze.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (hasImplingBox(player)) {
|
|
||||||
player.getDialogueInterpreter().sendDialogue("Something prevents you from entering. You think the portal is", "offended by your imp boxes. They are not popular on imp", "and impling planes.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final Location dest = object.getLocation().transform(Direction.getLogicalDirection(player.getLocation(), object.getLocation()), 1);
|
|
||||||
if (RegionManager.getObject(dest) != null) {
|
|
||||||
player.sendMessage("An object on the other side is in your way.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (RandomFunction.random(2) == 0) {
|
|
||||||
player.sendMessage("You use your strength to push through the wheat.");
|
|
||||||
} else {
|
|
||||||
player.sendMessage("You use your strength to push through the wheat. It's hard work though.");
|
|
||||||
}
|
|
||||||
player.setAttribute("cantMove", true);
|
|
||||||
forceMove(player, player.getLocation(), dest, 0, 265, null, 6595, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Spawns the wheat.
|
* Handles the jar generator.
|
||||||
*/
|
*
|
||||||
private void spawnWheat() {
|
* @param player the player.
|
||||||
for (WheatSet set : WHEAT) {
|
* @param item the item.
|
||||||
set.init();
|
* @param option the option.
|
||||||
}
|
*/
|
||||||
}
|
private void handleJarGenerator(Player player, Item item, String option) {
|
||||||
|
switch (option) {
|
||||||
|
case "butterfly-jar":
|
||||||
|
case "impling-jar":
|
||||||
|
generate(player, item, option);
|
||||||
|
break;
|
||||||
|
case "check":
|
||||||
|
player.sendMessage("Your jar generator has a charge percentage of " + getPercent(item) + ".");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the player has an impling box.
|
* Generates a new jar.
|
||||||
* @param player the player.
|
*
|
||||||
* @return {@code True} if so.
|
* @param player the player.
|
||||||
*/
|
* @param item the item.
|
||||||
private boolean hasImplingBox(Player player) {
|
* @param option the option.
|
||||||
return player.getInventory().contains(10025, 1) || player.getInventory().contains(10027, 1) || player.getInventory().contains(10028, 1);
|
*/
|
||||||
}
|
private void generate(Player player, Item item, String option) {
|
||||||
|
final Item jar = option.equals("butterfly-jar") ? new Item(10012) : new Item(11260);
|
||||||
|
final int percent = jar.getId() == 10012 ? 1 : 3;
|
||||||
|
if (!hasPercent(item, percent)) {
|
||||||
|
player.sendMessage("Your jar generator doesn't have enough charges to make another " + jar.getName().toLowerCase() + ".");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
player.lock(5);
|
||||||
|
player.animate(new Animation(6592));
|
||||||
|
player.getInventory().add(jar);
|
||||||
|
setPercent(item, percent);
|
||||||
|
player.sendMessage("Your jar generator generates a " + jar.getName().toLowerCase() + ".");
|
||||||
|
if (getPercent(item) <= 0) {
|
||||||
|
player.getInventory().remove(item);
|
||||||
|
player.sendMessage("Your jar generator runs out of charges.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public void configure() {
|
* Checks if the player has the percent.
|
||||||
registerRegion(10307);
|
*
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2606, 4329, 0), Location.create(2606, 4328, 0)));
|
* @param item the item.
|
||||||
WHEAT.add(new WheatSet(1, Location.create(2596, 4331, 0), Location.create(2597, 4331, 0)));
|
* @param percent the percent.
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2580, 4326, 0), Location.create(2580, 4325, 0)));
|
* @return
|
||||||
WHEAT.add(new WheatSet(1, Location.create(2595, 4308, 0), Location.create(2596, 4308, 0)));
|
*/
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2603, 4314, 0), Location.create(2603, 4313, 0)));
|
private boolean hasPercent(Item item, int percent) {
|
||||||
WHEAT.add(new WheatSet(1, Location.create(2599, 4305, 0), Location.create(2600, 4305, 0)));
|
return getPercent(item) - percent >= 0;
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2577, 4327, 0), Location.create(2577, 4328, 0)));
|
}
|
||||||
WHEAT.add(new WheatSet(1, Location.create(2587, 4334, 0), Location.create(2586, 4334, 0)));
|
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2609, 4310, 0), Location.create(2609, 4309, 0)));
|
|
||||||
WHEAT.add(new WheatSet(1, Location.create(2586, 4302, 0), Location.create(2587, 4302, 0)));
|
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2574, 4310, 0), Location.create(2574, 4311, 0)));
|
|
||||||
WHEAT.add(new WheatSet(1, Location.create(2582, 4337, 0), Location.create(2581, 4337, 0)));
|
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2571, 4316, 0), Location.create(2571, 4315, 0)));
|
|
||||||
WHEAT.add(new WheatSet(1, Location.create(2601, 4340, 0), Location.create(2602, 4340, 0)));
|
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2612, 4324, 0), Location.create(2612, 4323, 0)));
|
|
||||||
WHEAT.add(new WheatSet(1, Location.create(2584, 4296, 0), Location.create(2583, 4296, 0)));
|
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2568, 4329, 0), Location.create(2568, 4330, 0)));
|
|
||||||
WHEAT.add(new WheatSet(1, Location.create(2595, 4343, 0), Location.create(2596, 4343, 0)));
|
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2615, 4315, 0), Location.create(2615, 4314, 0)));
|
|
||||||
WHEAT.add(new WheatSet(1, Location.create(2601, 4293, 0), Location.create(2600, 4293, 0)));
|
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2565, 4310, 0), Location.create(2565, 4311, 0)));
|
|
||||||
WHEAT.add(new WheatSet(1, Location.create(2582, 4346, 0), Location.create(2583, 4346, 0)));
|
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2568, 4348, 0), Location.create(2568, 4347, 0)));
|
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2615, 4347, 0), Location.create(2615, 4348, 0)));
|
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2612, 4345, 0), Location.create(2612, 4344, 0)));
|
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2614, 4292, 0), Location.create(2614, 4291, 0)));
|
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2568, 4292, 0), Location.create(2568, 4291, 0)));
|
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2571, 4295, 0), Location.create(2571, 4294, 0)));
|
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2575, 4297, 0), Location.create(2575, 4298, 0)));
|
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2584, 4330, 0), Location.create(2584, 4329, 0)));
|
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2599, 4329, 0), Location.create(2599, 4330, 0)));
|
|
||||||
WHEAT.add(new WheatSet(1, Location.create(2602, 4312, 0), Location.create(2601, 4312, 0)));
|
|
||||||
WHEAT.add(new WheatSet(1, Location.create(2610, 4312, 0), Location.create(2611, 4312, 0)));
|
|
||||||
WHEAT.add(new WheatSet(1, Location.create(2570, 4309, 0), Location.create(2569, 4309, 0)));
|
|
||||||
WHEAT.add(new WheatSet(0, Location.create(2583, 4304, 0), Location.create(2583, 4303, 0)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the puro puro options.
|
* The percent to set.
|
||||||
* @author Vexia
|
*
|
||||||
*/
|
* @param item the item.
|
||||||
public class PuroOptionHandler extends OptionHandler {
|
* @param percent the percent.
|
||||||
|
*/
|
||||||
|
private void setPercent(Item item, int percent) {
|
||||||
|
item.setCharge(item.getCharge() - percent);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
* Gets the percent.
|
||||||
NPCDefinition.forId(6070).getHandlers().put("option:trade", this);
|
*
|
||||||
ItemDefinition.forId(11273).getHandlers().put("option:toggle-view", this);
|
* @param item the item.
|
||||||
ItemDefinition.forId(11258).getHandlers().put("option:butterfly-jar", this);
|
* @return the percent.
|
||||||
ItemDefinition.forId(11258).getHandlers().put("option:impling-jar", this);
|
*/
|
||||||
ItemDefinition.forId(11258).getHandlers().put("option:check", this);
|
private int getPercent(Item item) {
|
||||||
return this;
|
int difference = item.getCharge() - 1000;
|
||||||
}
|
return difference + 100;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(Player player, Node node, String option) {
|
public boolean isWalk(Player p, Node n) {
|
||||||
switch (node.getId()) {
|
return !(n instanceof Item);
|
||||||
case 11258:
|
|
||||||
handleJarGenerator(player, (Item) node, option);
|
|
||||||
break;
|
|
||||||
case 6070:
|
|
||||||
ElnockInquisitorDialogue.openShop(player);
|
|
||||||
break;
|
|
||||||
case 11273:
|
|
||||||
if (!player.getZoneMonitor().isInZone("puro puro")) {
|
|
||||||
player.sendMessage("You can only use this in the Puro Puro Maze.");
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
if (player.getInterfaceManager().getOverlay() != null) {
|
|
||||||
player.getInterfaceManager().closeOverlay();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
player.getInterfaceManager().openOverlay(new Component(541));
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
}
|
||||||
* Handles the jar generator.
|
|
||||||
* @param player the player.
|
|
||||||
* @param item the item.
|
|
||||||
* @param option the option.
|
|
||||||
*/
|
|
||||||
private void handleJarGenerator(Player player, Item item, String option) {
|
|
||||||
switch (option) {
|
|
||||||
case "butterfly-jar":
|
|
||||||
case "impling-jar":
|
|
||||||
generate(player, item, option);
|
|
||||||
break;
|
|
||||||
case "check":
|
|
||||||
player.sendMessage("Your jar generator has a charge percentage of " + getPercent(item) + ".");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Generates a new jar.
|
public boolean isWalk() {
|
||||||
* @param player the player.
|
return false;
|
||||||
* @param item the item.
|
}
|
||||||
* @param option the option.
|
}
|
||||||
*/
|
|
||||||
private void generate(Player player, Item item, String option) {
|
|
||||||
final Item jar = option.equals("butterfly-jar") ? new Item(10012) : new Item(11260);
|
|
||||||
final int percent = jar.getId() == 10012 ? 1 : 3;
|
|
||||||
if (!hasPercent(item, percent)) {
|
|
||||||
player.sendMessage("Your jar generator doesn't have enough charges to make another " + jar.getName().toLowerCase() + ".");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
player.lock(5);
|
|
||||||
player.animate(new Animation(6592));
|
|
||||||
player.getInventory().add(jar);
|
|
||||||
setPercent(item, percent);
|
|
||||||
player.sendMessage("Your jar generator generates a " + jar.getName().toLowerCase() + ".");
|
|
||||||
if (getPercent(item) <= 0) {
|
|
||||||
player.getInventory().remove(item);
|
|
||||||
player.sendMessage("Your jar generator runs out of charges.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the player has the percent.
|
* A wheat set.
|
||||||
* @param item the item.
|
*/
|
||||||
* @param percent the percent.
|
public static class WheatSet {
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private boolean hasPercent(Item item, int percent) {
|
|
||||||
return getPercent(item) - percent >= 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The percent to set.
|
* The locations of the wheat.
|
||||||
* @param item the item.
|
*/
|
||||||
* @param percent the percent.
|
private final Location[] locations;
|
||||||
*/
|
|
||||||
private void setPercent(Item item, int percent) {
|
|
||||||
item.setCharge(item.getCharge() - percent);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the percent.
|
* The scenerys.
|
||||||
* @param item the item.
|
*/
|
||||||
* @return the percent.
|
private Scenery[] objects = new Scenery[2];
|
||||||
*/
|
|
||||||
private int getPercent(Item item) {
|
|
||||||
int difference = item.getCharge() - 1000;
|
|
||||||
return difference + 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public boolean isWalk(Player p, Node n) {
|
* The rotation.
|
||||||
return !(n instanceof Item);
|
*/
|
||||||
|
private int rot;
|
||||||
|
|
||||||
}
|
/**
|
||||||
|
* The time until the next whilt.
|
||||||
|
*/
|
||||||
|
private int nextWhilt;
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public boolean isWalk() {
|
* The busy ticks.
|
||||||
return false;
|
*/
|
||||||
}
|
private int busyTicks;
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A wheat set.
|
* If the wheat is removed.
|
||||||
*/
|
*/
|
||||||
public static class WheatSet {
|
private boolean removed;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The locations of the wheat.
|
* Constructs a new {@code WheatSet} {@code Object}.
|
||||||
*/
|
*
|
||||||
private final Location[] locations;
|
* @param locations the locations.
|
||||||
|
*/
|
||||||
|
public WheatSet(int rot, Location... locations) {
|
||||||
|
this.rot = rot;
|
||||||
|
this.locations = locations;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The scenerys.
|
* Initializes the wheat.
|
||||||
*/
|
*/
|
||||||
private Scenery[] objects = new Scenery[2];
|
public void init() {
|
||||||
|
int index = 0;
|
||||||
|
for (Location location : locations) {
|
||||||
|
Scenery object = new Scenery(25021, location, 22, rot);
|
||||||
|
SceneryBuilder.add(object);
|
||||||
|
objects[index] = object;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
setNextWhilt();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The rotation.
|
* Whilts the wheat.
|
||||||
*/
|
*/
|
||||||
private int rot;
|
public void whilt() {
|
||||||
|
busyTicks = GameWorld.getTicks() + 5;
|
||||||
|
for (Scenery object : objects) {
|
||||||
|
if (object == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (removed) {
|
||||||
|
submitWorldPulse(new Pulse() {
|
||||||
|
int counter = 0;
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* The time until the next whilt.
|
public boolean pulse() {
|
||||||
*/
|
if (counter++ == 0) {
|
||||||
private int nextWhilt;
|
animateScenery(object, 6596);
|
||||||
|
setDelay(animationDuration(new Animation(6596)));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
SceneryBuilder.add(object);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
submitWorldPulse(new Pulse() {
|
||||||
|
int counter = 0;
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* The busy ticks.
|
public boolean pulse() {
|
||||||
*/
|
if (counter++ == 0) {
|
||||||
private int busyTicks;
|
animateScenery(object, 6599);
|
||||||
|
setDelay(animationDuration(new Animation(6599)));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
SceneryBuilder.remove(object);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
removed = !removed;
|
||||||
|
setNextWhilt();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the wheat is removed.
|
* Sets the object spawns.
|
||||||
*/
|
*/
|
||||||
private boolean removed;
|
public void setObjects() {
|
||||||
|
for (int i = 0; i < locations.length; i++) {
|
||||||
|
objects[i] = RegionManager.getObject(locations[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new {@code WheatSet} {@code Object}.
|
* Sets the next whilt.
|
||||||
* @param locations the locations.
|
*/
|
||||||
*/
|
public void setNextWhilt() {
|
||||||
public WheatSet(int rot, Location... locations) {
|
this.nextWhilt = GameWorld.getTicks() + RandomFunction.random(40, 300);
|
||||||
this.rot = rot;
|
}
|
||||||
this.locations = locations;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the wheat.
|
* Checks if the wheat can whilt.
|
||||||
*/
|
*
|
||||||
public void init() {
|
* @return {@code True} if so.
|
||||||
int index = 0;
|
*/
|
||||||
for (Location location : locations) {
|
public boolean canWhilt() {
|
||||||
Scenery object = new Scenery(25021, location, 22, rot);
|
return GameWorld.getTicks() > nextWhilt && GameWorld.getTicks() > busyTicks;
|
||||||
SceneryBuilder.add(object);
|
}
|
||||||
objects[index] = object;
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
setNextWhilt();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whilts the wheat.
|
* Gets the nextWhilt.
|
||||||
*/
|
*
|
||||||
public void whilt() {
|
* @return The nextWhilt.
|
||||||
busyTicks = GameWorld.getTicks() + 5;
|
*/
|
||||||
for (Scenery object : objects) {
|
public int getNextWhilt() {
|
||||||
if (object == null) {
|
return nextWhilt;
|
||||||
continue;
|
}
|
||||||
}
|
|
||||||
if (removed) {
|
|
||||||
submitWorldPulse(new Pulse() {
|
|
||||||
int counter = 0;
|
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public boolean pulse() {
|
* Sets the nextWhilt.
|
||||||
if (counter++ == 0) {
|
*
|
||||||
animateScenery (object, 6596);
|
* @param nextWhilt The nextWhilt to set.
|
||||||
setDelay(animationDuration(new Animation(6596)));
|
*/
|
||||||
return false;
|
public void setNextWhilt(int nextWhilt) {
|
||||||
}
|
this.nextWhilt = nextWhilt;
|
||||||
return true;
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
SceneryBuilder.add(object);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
submitWorldPulse(new Pulse() {
|
|
||||||
int counter = 0;
|
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public boolean pulse() {
|
* Gets the locations.
|
||||||
if (counter++ == 0) {
|
*
|
||||||
animateScenery (object, 6599);
|
* @return The locations.
|
||||||
setDelay(animationDuration(new Animation(6599)));
|
*/
|
||||||
return false;
|
public Location[] getLocations() {
|
||||||
}
|
return locations;
|
||||||
SceneryBuilder.remove(object);
|
}
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
removed = !removed;
|
|
||||||
setNextWhilt();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
}
|
||||||
* Sets the object spawns.
|
|
||||||
*/
|
|
||||||
public void setObjects() {
|
|
||||||
for (int i = 0; i < locations.length; i++) {
|
|
||||||
objects[i] = RegionManager.getObject(locations[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the next whilt.
|
|
||||||
*/
|
|
||||||
public void setNextWhilt() {
|
|
||||||
this.nextWhilt = GameWorld.getTicks() + RandomFunction.random(40, 300);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if the wheat can whilt.
|
|
||||||
* @return {@code True} if so.
|
|
||||||
*/
|
|
||||||
public boolean canWhilt() {
|
|
||||||
return GameWorld.getTicks() > nextWhilt && GameWorld.getTicks() > busyTicks;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the nextWhilt.
|
|
||||||
* @return The nextWhilt.
|
|
||||||
*/
|
|
||||||
public int getNextWhilt() {
|
|
||||||
return nextWhilt;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the nextWhilt.
|
|
||||||
* @param nextWhilt The nextWhilt to set.
|
|
||||||
*/
|
|
||||||
public void setNextWhilt(int nextWhilt) {
|
|
||||||
this.nextWhilt = nextWhilt;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the locations.
|
|
||||||
* @return The locations.
|
|
||||||
*/
|
|
||||||
public Location[] getLocations() {
|
|
||||||
return locations;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
|
|
||||||
|
|
@ -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++) {
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -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++)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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()) {
|
||||||
|
|
|
||||||
|
|
@ -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()); //
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue