mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-18 20:40:18 -07:00
Fixed hat clipping + sack bug + made farmer payment requests more human parsable
This commit is contained in:
parent
396f5c2775
commit
ee2e7d5f7e
4 changed files with 56 additions and 21 deletions
|
|
@ -28530,7 +28530,8 @@
|
||||||
"equipment_slot": "0",
|
"equipment_slot": "0",
|
||||||
"ge_buy_limit": "2",
|
"ge_buy_limit": "2",
|
||||||
"archery_ticket_price": "0",
|
"archery_ticket_price": "0",
|
||||||
"durability": null
|
"durability": null,
|
||||||
|
"remove_head": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "2634",
|
"id": "2634",
|
||||||
|
|
@ -28553,7 +28554,8 @@
|
||||||
"equipment_slot": "0",
|
"equipment_slot": "0",
|
||||||
"ge_buy_limit": "2",
|
"ge_buy_limit": "2",
|
||||||
"archery_ticket_price": "0",
|
"archery_ticket_price": "0",
|
||||||
"durability": null
|
"durability": null,
|
||||||
|
"remove_head": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "2636",
|
"id": "2636",
|
||||||
|
|
@ -28576,7 +28578,8 @@
|
||||||
"equipment_slot": "0",
|
"equipment_slot": "0",
|
||||||
"ge_buy_limit": "2",
|
"ge_buy_limit": "2",
|
||||||
"archery_ticket_price": "0",
|
"archery_ticket_price": "0",
|
||||||
"durability": null
|
"durability": null,
|
||||||
|
"remove_head": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "2638",
|
"id": "2638",
|
||||||
|
|
@ -97038,7 +97041,8 @@
|
||||||
"grand_exchange_price": "64066",
|
"grand_exchange_price": "64066",
|
||||||
"equipment_slot": "0",
|
"equipment_slot": "0",
|
||||||
"archery_ticket_price": "0",
|
"archery_ticket_price": "0",
|
||||||
"durability": null
|
"durability": null,
|
||||||
|
"remove_head": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "10694",
|
"id": "10694",
|
||||||
|
|
@ -97051,7 +97055,8 @@
|
||||||
"grand_exchange_price": "158274",
|
"grand_exchange_price": "158274",
|
||||||
"equipment_slot": "0",
|
"equipment_slot": "0",
|
||||||
"archery_ticket_price": "0",
|
"archery_ticket_price": "0",
|
||||||
"durability": null
|
"durability": null,
|
||||||
|
"remove_head": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "10695",
|
"id": "10695",
|
||||||
|
|
@ -97064,7 +97069,8 @@
|
||||||
"grand_exchange_price": "281900",
|
"grand_exchange_price": "281900",
|
||||||
"equipment_slot": "0",
|
"equipment_slot": "0",
|
||||||
"archery_ticket_price": "0",
|
"archery_ticket_price": "0",
|
||||||
"durability": null
|
"durability": null,
|
||||||
|
"remove_head": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "10696",
|
"id": "10696",
|
||||||
|
|
@ -128305,7 +128311,8 @@
|
||||||
"absorb": "0,0,0",
|
"absorb": "0,0,0",
|
||||||
"bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
|
"bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
|
||||||
"archery_ticket_price": "0",
|
"archery_ticket_price": "0",
|
||||||
"durability": null
|
"durability": null,
|
||||||
|
"remove_head": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "13812",
|
"id": "13812",
|
||||||
|
|
@ -128321,7 +128328,8 @@
|
||||||
"absorb": "0,0,0",
|
"absorb": "0,0,0",
|
||||||
"bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
|
"bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
|
||||||
"archery_ticket_price": "0",
|
"archery_ticket_price": "0",
|
||||||
"durability": null
|
"durability": null,
|
||||||
|
"remove_head": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "13813",
|
"id": "13813",
|
||||||
|
|
@ -128337,7 +128345,8 @@
|
||||||
"absorb": "0,0,0",
|
"absorb": "0,0,0",
|
||||||
"bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
|
"bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
|
||||||
"archery_ticket_price": "0",
|
"archery_ticket_price": "0",
|
||||||
"durability": null
|
"durability": null,
|
||||||
|
"remove_head": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "13814",
|
"id": "13814",
|
||||||
|
|
|
||||||
|
|
@ -6,15 +6,12 @@ import core.game.container.impl.EquipmentContainer;
|
||||||
import core.game.node.entity.combat.equipment.WeaponInterface;
|
import core.game.node.entity.combat.equipment.WeaponInterface;
|
||||||
import core.game.node.entity.impl.Animator.Priority;
|
import core.game.node.entity.impl.Animator.Priority;
|
||||||
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 rs09.game.system.config.ItemConfigParser;
|
|
||||||
import core.game.world.update.flag.context.Animation;
|
import core.game.world.update.flag.context.Animation;
|
||||||
import core.game.world.update.flag.player.AppearanceFlag;
|
import core.game.world.update.flag.player.AppearanceFlag;
|
||||||
import org.json.simple.JSONArray;
|
import org.json.simple.JSONArray;
|
||||||
import org.json.simple.JSONObject;
|
import org.json.simple.JSONObject;
|
||||||
|
import rs09.game.system.config.ItemConfigParser;
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents an appearance managing class of a player.
|
* Represents an appearance managing class of a player.
|
||||||
|
|
@ -237,6 +234,10 @@ public final class Appearance {
|
||||||
this.bodyParts[part] = 0;
|
this.bodyParts[part] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void flagHatClipping() {
|
||||||
|
this.bodyParts[8] = 0x100;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepares the data used for the appearance update mask.
|
* Prepares the data used for the appearance update mask.
|
||||||
* @param player The player.
|
* @param player The player.
|
||||||
|
|
@ -302,7 +303,7 @@ public final class Appearance {
|
||||||
drawClothes(7, getLegs().getLook());
|
drawClothes(7, getLegs().getLook());
|
||||||
}
|
}
|
||||||
if ((hat != null && hat.getDefinition().getConfiguration(ItemConfigParser.REMOVE_HEAD, false)) || castleWarsHood) {
|
if ((hat != null && hat.getDefinition().getConfiguration(ItemConfigParser.REMOVE_HEAD, false)) || castleWarsHood) {
|
||||||
clearBodyPart(8);
|
flagHatClipping();
|
||||||
} else {
|
} else {
|
||||||
drawClothes(8, getHair().getLook());
|
drawClothes(8, getHair().getLook());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import core.game.node.entity.player.Player
|
||||||
import core.game.node.item.Item
|
import core.game.node.item.Item
|
||||||
import core.plugin.Initializable
|
import core.plugin.Initializable
|
||||||
import core.plugin.Plugin
|
import core.plugin.Plugin
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
|
||||||
@Initializable
|
@Initializable
|
||||||
class FarmerPayOptionHandler : OptionHandler() {
|
class FarmerPayOptionHandler : OptionHandler() {
|
||||||
|
|
@ -76,10 +77,24 @@ class FarmerPayOptionHandler : OptionHandler() {
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
item = patch?.plantable?.protectionItem
|
item = patch?.plantable?.protectionItem
|
||||||
|
val protectionText = when(item?.id){
|
||||||
|
Items.COMPOST_6032 -> if(item?.amount == 1) "bucket of compost" else "buckets of compost"
|
||||||
|
Items.POTATOES10_5438 -> if(item?.amount == 1) "sack of potatoes" else "sacks of potatoes"
|
||||||
|
Items.ONIONS10_5458 -> if(item?.amount == 1) "sack of onions" else "sacks of onions"
|
||||||
|
Items.CABBAGES10_5478 -> if(item?.amount == 1) "sack of cabbages" else "sacks of cabbages"
|
||||||
|
Items.JUTE_FIBRE_5931 -> "jute fibres"
|
||||||
|
Items.APPLES5_5386 -> if(item?.amount == 1) "basket of apples" else "baskets of apples"
|
||||||
|
Items.MARIGOLDS_6010 -> "harvest of marigold"
|
||||||
|
Items.TOMATOES5_5968 -> if(item?.amount == 1) "basket of tomatoes" else "baskets of tomatoes"
|
||||||
|
Items.ORANGES5_5396 -> if(item?.amount == 1) "basket of oranges" else "baskets of oranges"
|
||||||
|
Items.COCONUT_5974 -> "coconuts"
|
||||||
|
Items.STRAWBERRIES5_5406 -> if(item?.amount == 1) "basket of strawberries" else "baskets of strawberries"
|
||||||
|
Items.BANANAS5_5416 -> if(item?.amount == 1) "basket of bananas" else "baskets of bananas"
|
||||||
|
else -> item?.name?.toLowerCase()
|
||||||
|
}
|
||||||
if(item == null) npc("Sorry, I won't protect that.").also { stage = 1000 }
|
if(item == null) npc("Sorry, I won't protect that.").also { stage = 1000 }
|
||||||
else{
|
else{
|
||||||
val name = item?.name?.toLowerCase()
|
npc("I would like ${item?.amount} $protectionText","to protect that patch.")
|
||||||
npc("I would like ${item?.amount} $name","to protect that patch.")
|
|
||||||
stage = 0
|
stage = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -114,13 +114,23 @@ class SackBasketOptionHandler : OptionHandler() {
|
||||||
val container = BasketsAndSacks.forId(containerID)
|
val container = BasketsAndSacks.forId(containerID)
|
||||||
val produce = if(container == null){
|
val produce = if(container == null){
|
||||||
var selected = 0
|
var selected = 0
|
||||||
for(i in (fruit + produce)){
|
if(containerID == Items.EMPTY_SACK_5418) {
|
||||||
if(player.inventory.contains(i,1)){
|
for (i in (produce)) {
|
||||||
selected = i
|
if (player.inventory.contains(i, 1)) {
|
||||||
break
|
selected = i
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
selected
|
||||||
|
} else {
|
||||||
|
for (i in (fruit)) {
|
||||||
|
if (player.inventory.contains(i, 1)) {
|
||||||
|
selected = i
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
selected
|
||||||
}
|
}
|
||||||
selected
|
|
||||||
} else {
|
} else {
|
||||||
container.produceID
|
container.produceID
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue