Implement Authentic Interaction Subsystem
Implemented authentic script/interaction queues This does now mean we have a total of 3 interaction systems, but this additional system is necessary to fix certain categories of bug and implement some authentic features Converted mining to new system Converted fishing to new system Converted woodcutting to new system Provided an example of soft-queued scripts with GrandTreePodListener Implemented tick-eating (it is now possible to eat a shark, drink a potion, and eat a karambwan all on the same tick) Can now eat and drop items while stunned
This commit is contained in:
@@ -43,7 +43,7 @@ class CombatBot(location: Location) : AIPlayer(location) {
|
||||
this.lock(3)
|
||||
//this.animate(new Animation(829));
|
||||
val food = inventory.getItem(foodItem)
|
||||
var consumable: Consumable? = Consumables.getConsumableById(food.id)
|
||||
var consumable: Consumable? = Consumables.getConsumableById(food.id)?.consumable
|
||||
if (consumable == null) {
|
||||
consumable = Food(IntArray(food.id), HealingEffect(1))
|
||||
}
|
||||
|
||||
@@ -133,10 +133,10 @@ public class PvMBots extends AIPlayer {
|
||||
//this.animate(new Animation(829));
|
||||
Item food = this.getInventory().getItem(foodItem);
|
||||
|
||||
Consumable consumable = Consumables.getConsumableById(food.getId());
|
||||
Consumable consumable = Consumables.getConsumableById(food.getId()).getConsumable();
|
||||
|
||||
if (consumable == null) {
|
||||
consumable = new Food(new int[] {food.getId()}, new HealingEffect(1));
|
||||
return;
|
||||
}
|
||||
|
||||
consumable.consume(food, this);
|
||||
|
||||
@@ -653,7 +653,7 @@ class ScriptAPI(private val bot: Player) {
|
||||
bot.lock(3)
|
||||
//this.animate(new Animation(829));
|
||||
val food = bot.inventory.getItem(foodItem)
|
||||
var consumable: Consumable? = Consumables.getConsumableById(foodId)
|
||||
var consumable: Consumable? = Consumables.getConsumableById(foodId)?.consumable
|
||||
if (consumable == null) {
|
||||
consumable = Food(intArrayOf(food.id), HealingEffect(1))
|
||||
}
|
||||
@@ -673,7 +673,7 @@ class ScriptAPI(private val bot: Player) {
|
||||
bot.lock(3)
|
||||
//this.animate(new Animation(829));
|
||||
val food = bot.inventory.getItem(foodItem)
|
||||
var consumable: Consumable? = Consumables.getConsumableById(foodId)
|
||||
var consumable: Consumable? = Consumables.getConsumableById(foodId)?.consumable
|
||||
if (consumable == null) {
|
||||
consumable = Food(intArrayOf(foodId), HealingEffect(1))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user