Added cats raised to ::stats

Added food cooked to ::stats
This commit is contained in:
Player Name 2025-02-16 05:35:27 +00:00 committed by Ryan
parent bb860b60e0
commit be47c1d5c9
7 changed files with 55 additions and 5 deletions

View file

@ -4,6 +4,8 @@ import content.global.skill.skillcapeperks.SkillcapePerks;
import core.game.event.ResourceProducedEvent; import core.game.event.ResourceProducedEvent;
import core.game.node.entity.impl.Animator; import core.game.node.entity.impl.Animator;
import core.game.node.entity.player.Player; import core.game.node.entity.player.Player;
import core.game.node.entity.player.info.LogType;
import core.game.node.entity.player.info.PlayerMonitor;
import core.game.node.entity.player.link.audio.Audio; import core.game.node.entity.player.link.audio.Audio;
import core.game.node.entity.skill.Skills; import core.game.node.entity.skill.Skills;
import core.game.node.item.GroundItemManager; import core.game.node.item.GroundItemManager;
@ -15,7 +17,7 @@ import core.tools.RandomFunction;
import org.rs09.consts.Items; import org.rs09.consts.Items;
import org.rs09.consts.Sounds; import org.rs09.consts.Sounds;
import static core.api.ContentAPIKt.playAudio; import static core.api.ContentAPIKt.*;
import content.data.Quests; import content.data.Quests;
public class StandardCookingPulse extends Pulse { public class StandardCookingPulse extends Pulse {
@ -39,12 +41,17 @@ public class StandardCookingPulse extends Pulse {
private boolean burned = false; private boolean burned = false;
public CookableItems properties; public CookableItems properties;
private int initialAmount;
private int processedAmount;
public StandardCookingPulse(Player player, Scenery object, int initial, int product, int amount) { public StandardCookingPulse(Player player, Scenery object, int initial, int product, int amount) {
this.player = player; this.player = player;
this.object = object; this.object = object;
this.initial = initial; this.initial = initial;
this.product = product; this.product = product;
this.amount = amount; this.amount = amount;
this.initialAmount = amountInInventory(player, initial);
this.processedAmount = 0;
} }
@Override @Override
@ -170,6 +177,11 @@ public class StandardCookingPulse extends Pulse {
player.getInventory().add(productItem); player.getInventory().add(productItem);
player.dispatch(new ResourceProducedEvent(productItem.getId(), 1, object, initialItem.getId())); player.dispatch(new ResourceProducedEvent(productItem.getId(), 1, object, initialItem.getId()));
player.getSkills().addExperience(Skills.COOKING, experience, true); player.getSkills().addExperience(Skills.COOKING, experience, true);
processedAmount++;
if (processedAmount > initialAmount) {
PlayerMonitor.log(player, LogType.DUPE_ALERT, "cooked item (" + player.getName() + ", " + initialItem.getName() + "): initialAmount " + initialAmount + ", processedAmount " + processedAmount);
}
player.incrementAttribute("/save:stats_manager:food_cooked", 1);
} else { } else {
player.dispatch(new ResourceProducedEvent(CookableItems.getBurnt(initial).getId(), 1, object, initialItem.getId())); player.dispatch(new ResourceProducedEvent(CookableItems.getBurnt(initial).getId(), 1, object, initialItem.getId()));
player.getInventory().add(CookableItems.getBurnt(initial)); player.getInventory().add(CookableItems.getBurnt(initial));

View file

@ -85,7 +85,7 @@ public final class FletchingPulse extends SkillPulse<Item> {
if ( fletch == Fletching.FletchingItems.OGRE_ARROW_SHAFT ) { if ( fletch == Fletching.FletchingItems.OGRE_ARROW_SHAFT ) {
item.setAmount(RandomFunction.random(3,6)); item.setAmount(RandomFunction.random(3,6));
} }
player.getInventory().add(item); player.getInventory().add(item);
player.getSkills().addExperience(Skills.FLETCHING, fletch.experience, true); player.getSkills().addExperience(Skills.FLETCHING, fletch.experience, true);
String message = getMessage(); String message = getMessage();
player.getPacketDispatch().sendMessage(message); player.getPacketDispatch().sendMessage(message);

View file

@ -1,7 +1,7 @@
package content.global.skill.fletching.items.bow; package content.global.skill.fletching.items.bow;
import core.api.Container; import core.game.node.entity.player.info.LogType;
import core.api.ContentAPIKt; import core.game.node.entity.player.info.PlayerMonitor;
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;
@ -10,6 +10,8 @@ import content.global.skill.fletching.Fletching;
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 static core.api.ContentAPIKt.amountInInventory;
/** /**
* Represents the skill pulse of stringing. * Represents the skill pulse of stringing.
* *
@ -27,6 +29,9 @@ public class StringPulse extends SkillPulse<Item> {
*/ */
private int amount; private int amount;
private int initialAmount;
private int processedAmount;
/** /**
* Constructs a new {@code StringbowPlugin.java} {@code Object}. * Constructs a new {@code StringbowPlugin.java} {@code Object}.
* *
@ -37,6 +42,8 @@ public class StringPulse extends SkillPulse<Item> {
super(player, node); super(player, node);
this.bow = bow; this.bow = bow;
this.amount = amount; this.amount = amount;
this.initialAmount = amountInInventory(player, node.getId());
this.processedAmount = 0;
} }
@Override @Override
@ -70,6 +77,10 @@ public class StringPulse extends SkillPulse<Item> {
player.getInventory().add(new Item(bow.product)); player.getInventory().add(new Item(bow.product));
player.getSkills().addExperience(Skills.FLETCHING, bow.experience, true); player.getSkills().addExperience(Skills.FLETCHING, bow.experience, true);
player.getPacketDispatch().sendMessage("You add a string to the bow."); player.getPacketDispatch().sendMessage("You add a string to the bow.");
processedAmount++;
if (processedAmount > initialAmount) {
PlayerMonitor.log(player, LogType.DUPE_ALERT, "fletched item (" + player.getName() + ", " + bow.unfinished + "): initialAmount " + initialAmount + ", processedAmount " + processedAmount);
}
if (bow == Fletching.String.MAGIC_SHORTBOW if (bow == Fletching.String.MAGIC_SHORTBOW
&& (new ZoneBorders(2721, 3489, 2724, 3493, 0).insideBorder(player) && (new ZoneBorders(2721, 3489, 2724, 3493, 0).insideBorder(player)

View file

@ -126,6 +126,9 @@ public final class Pet extends Familiar {
// then this pet is already overgrown // then this pet is already overgrown
return; return;
} }
if (pet.isKitten(itemId)) {
owner.incrementAttribute("/save:stats_manager:cats_raised");
}
owner.getFamiliarManager().removeDetails(getItemId()); owner.getFamiliarManager().removeDetails(getItemId());
owner.getFamiliarManager().addDetails(newItemId, details); owner.getFamiliarManager().addDetails(newItemId, details);
owner.getFamiliarManager().morphPet(new Item(newItemId), false, location, details.getHunger(), 0); owner.getFamiliarManager().morphPet(new Item(newItemId), false, location, details.getHunger(), 0);

View file

@ -18,7 +18,7 @@ public enum Pets {
/** /**
* A cat/kitten pet. * A cat/kitten pet.
*/ */
CAT(1555, 1561, 1567, 761, 768, 774, 0.0154320987654321, 0, 321, 319, 363, 365, 341, 339, 15264, 345, 347, 377, 379, 353, 355, 389, 391, 7944, 7946, 349, 351, 331, 329, 327, 325, 395, 397, 383, 385, 317, 315, 371, 373, 335, 333, 359, 361, 15264, 15270, 1927), CAT_1(1556, 1562, 1568, 762, 769, 775, 0.0154320987654321, 0, 321, 319, 363, 365, 341, 339, 15264, 345, 347, 377, 379, 353, 355, 389, 391, 7944, 7946, 349, 351, 331, 329, 327, 325, 395, 397, 383, 385, 317, 315, 371, 373, 335, 333, 359, 361, 15264, 15270, 1927), CAT_2(1557, 1563, 1569, 763, 770, 776, 0.0154320987654321, 0, 321, 319, 363, 365, 341, 339, 15264, 345, 347, 377, 379, 353, 355, 389, 391, 7944, 7946, 349, 351, 331, 329, 327, 325, 395, 397, 383, 385, 317, 315, 371, 373, 335, 333, 359, 361, 15264, 15270, 1927), CAT_3(1558, 1564, 1570, 764, 771, 777, 0.0154320987654321, 0, 321, 319, 363, 365, 341, 339, 15264, 345, 347, 377, 379, 353, 355, 389, 391, 7944, 7946, 349, 351, 331, 329, 327, 325, 395, 397, 383, 385, 317, 315, 371, 373, 335, 333, 359, 361, 15264, 15270, 1927), CAT_4(1559, 1565, 1571, 765, 772, 778, 0.0154320987654321, 0, 321, 319, 363, 365, 341, 339, 15264, 345, 347, 377, 379, 353, 355, 389, 391, 7944, 7946, 349, 351, 331, 329, 327, 325, 395, 397, 383, 385, 317, 315, 371, 373, 335, 333, 359, 361, 15264, 15270, 1927), CAT_5(1560, 1566, 1572, 766, 773, 779, 0.0154320987654321, 0, 321, 319, 363, 365, 341, 339, 15264, 345, 347, 377, 379, 353, 355, 389, 391, 7944, 7946, 349, 351, 331, 329, 327, 325, 395, 397, 383, 385, 317, 315, 371, 373, 335, 333, 359, 361, 15264, 15270, 1927), HELLCAT(7583, 7582, 7581, 3505, 3504, 3503, 0.0154320987654321, 0, 321, 319, 363, 365, 341, 339, 15264, 345, 347, 377, 379, 353, 355, 389, 391, 7944, 7946, 349, 351, 331, 329, 327, 325, 395, 397, 383, 385, 317, 315, 371, 373, 335, 333, 359, 361, 15264, 15270, 1927), CAT_7(14089, 14090, 15092, 8217, 8214, 8216, 0.0154320987654321, 0, 321, 319, 363, 365, 341, 339, 15264, 345, 347, 377, 379, 353, 355, 389, 391, 7944, 7946, 349, 351, 331, 329, 327, 325, 395, 397, 383, 385, 317, 315, 371, 373, 335, 333, 359, 361, 15264, 15270, 1927), CAT(1555, 1561, 1567, 761, 768, 774, 0.0154320987654321, 0, 321, 319, 363, 365, 341, 339, 15264, 345, 347, 377, 379, 353, 355, 389, 391, 7944, 7946, 349, 351, 331, 329, 327, 325, 395, 397, 383, 385, 317, 315, 371, 373, 335, 333, 359, 361, 15264, 15270, 1927), CAT_1(1556, 1562, 1568, 762, 769, 775, 0.0154320987654321, 0, 321, 319, 363, 365, 341, 339, 15264, 345, 347, 377, 379, 353, 355, 389, 391, 7944, 7946, 349, 351, 331, 329, 327, 325, 395, 397, 383, 385, 317, 315, 371, 373, 335, 333, 359, 361, 15264, 15270, 1927), CAT_2(1557, 1563, 1569, 763, 770, 776, 0.0154320987654321, 0, 321, 319, 363, 365, 341, 339, 15264, 345, 347, 377, 379, 353, 355, 389, 391, 7944, 7946, 349, 351, 331, 329, 327, 325, 395, 397, 383, 385, 317, 315, 371, 373, 335, 333, 359, 361, 15264, 15270, 1927), CAT_3(1558, 1564, 1570, 764, 771, 777, 0.0154320987654321, 0, 321, 319, 363, 365, 341, 339, 15264, 345, 347, 377, 379, 353, 355, 389, 391, 7944, 7946, 349, 351, 331, 329, 327, 325, 395, 397, 383, 385, 317, 315, 371, 373, 335, 333, 359, 361, 15264, 15270, 1927), CAT_4(1559, 1565, 1571, 765, 772, 778, 0.0154320987654321, 0, 321, 319, 363, 365, 341, 339, 15264, 345, 347, 377, 379, 353, 355, 389, 391, 7944, 7946, 349, 351, 331, 329, 327, 325, 395, 397, 383, 385, 317, 315, 371, 373, 335, 333, 359, 361, 15264, 15270, 1927), CAT_5(1560, 1566, 1572, 766, 773, 779, 0.0154320987654321, 0, 321, 319, 363, 365, 341, 339, 15264, 345, 347, 377, 379, 353, 355, 389, 391, 7944, 7946, 349, 351, 331, 329, 327, 325, 395, 397, 383, 385, 317, 315, 371, 373, 335, 333, 359, 361, 15264, 15270, 1927), HELLCAT(7583, 7582, 7581, 3505, 3504, 3503, 0.0154320987654321, 0, 321, 319, 363, 365, 341, 339, 15264, 345, 347, 377, 379, 353, 355, 389, 391, 7944, 7946, 349, 351, 331, 329, 327, 325, 395, 397, 383, 385, 317, 315, 371, 373, 335, 333, 359, 361, 15264, 15270, 1927), CAT_6(14089, 14090, 15092, 8217, 8214, 8216, 0.0154320987654321, 0, 321, 319, 363, 365, 341, 339, 15264, 345, 347, 377, 379, 353, 355, 389, 391, 7944, 7946, 349, 351, 331, 329, 327, 325, 395, 397, 383, 385, 317, 315, 371, 373, 335, 333, 359, 361, 15264, 15270, 1927),
/** /**
* A clockwork cat. * A clockwork cat.
@ -426,4 +426,24 @@ public enum Pets {
} }
return -1; return -1;
} }
/**
* Checks if this pet is a kitten
* @return a boolean, true if the pet is a kitten
*/
public boolean isKitten(int id) {
switch (this) {
case CAT:
case CAT_1:
case CAT_2:
case CAT_3:
case CAT_4:
case CAT_5:
case CAT_6:
case HELLCAT:
return id == babyItemId;
default:
return false;
}
}
} }

View file

@ -7,6 +7,8 @@ const val STATS_LOGS = "logs_chopped"
const val STATS_FISH = "fish_caught" const val STATS_FISH = "fish_caught"
const val STATS_ROCKS = "rocks_mined" const val STATS_ROCKS = "rocks_mined"
const val STATS_RC = "essence_crafted" const val STATS_RC = "essence_crafted"
const val STATS_FOOD_COOKED = "food_cooked"
const val STATS_CATS_RAISED = "cats_raised"
const val STATS_PK_KILLS = "player_kills" const val STATS_PK_KILLS = "player_kills"
const val STATS_PK_DEATHS = "player_deaths" const val STATS_PK_DEATHS = "player_deaths"
const val STATS_ALKHARID_GATE = "alkharid_gate" const val STATS_ALKHARID_GATE = "alkharid_gate"

View file

@ -67,6 +67,8 @@ class StatsCommandSet : CommandSet(Privilege.STANDARD) {
77 -> sendLine(player,"Rocks Mined: ${queryPlayer.getAttribute("$STATS_BASE:$STATS_ROCKS",0)}",i) 77 -> sendLine(player,"Rocks Mined: ${queryPlayer.getAttribute("$STATS_BASE:$STATS_ROCKS",0)}",i)
78 -> sendLine(player,"Fish Caught: ${queryPlayer.getAttribute("$STATS_BASE:$STATS_FISH",0)}",i) 78 -> sendLine(player,"Fish Caught: ${queryPlayer.getAttribute("$STATS_BASE:$STATS_FISH",0)}",i)
79 -> sendLine(player, "Essence Crafted: ${queryPlayer.getAttribute("$STATS_BASE:$STATS_RC",0)}", i) 79 -> sendLine(player, "Essence Crafted: ${queryPlayer.getAttribute("$STATS_BASE:$STATS_RC",0)}", i)
80 -> sendLine(player, "Food Cooked: ${queryPlayer.getAttribute("$STATS_BASE:$STATS_FOOD_COOKED",0)}", i)
81 -> sendLine(player, "Cats Raised: ${queryPlayer.getAttribute("$STATS_BASE:$STATS_CATS_RAISED",0)}", i)
//Boss KC //Boss KC
82 -> sendLine(player, "KBD KC: ${globalData.bossCounters.get(BossKillCounter.KING_BLACK_DRAGON.ordinal)}",i) 82 -> sendLine(player, "KBD KC: ${globalData.bossCounters.get(BossKillCounter.KING_BLACK_DRAGON.ordinal)}",i)