Made the various signposts like cow and church sign authentic and persistent

This commit is contained in:
ceikry
2021-07-26 19:36:36 -05:00
parent 3d9a119071
commit 838edacba5
7 changed files with 100 additions and 11 deletions
@@ -1,5 +1,6 @@
package core.game.interaction.city.lumbridge;
import api.ContentAPI;
import core.cache.def.impl.SceneryDefinition;
import core.game.content.dialogue.DialoguePlugin;
import core.game.interaction.OptionHandler;
@@ -7,6 +8,7 @@ import core.game.node.Node;
import core.game.node.entity.player.Player;
import core.plugin.Initializable;
import core.plugin.Plugin;
import rs09.GlobalStats;
/**
* Cow field sign manager
@@ -40,7 +42,12 @@ public class CowFieldSign extends OptionHandler {
public DialoguePlugin newInstance(Player player){return new SignDialogue(player);}
@Override
public boolean open(Object... args){
interpreter.sendPlainMessage(false,"Wandering adventurers have killed " + CowPenZone.CowDeaths + " cows in this field.", "Local farmers call it an epidemic.");
int dailyCowDeaths = GlobalStats.getDailyCowDeaths();
if(dailyCowDeaths > 0) {
ContentAPI.sendDialogue(player, "Local cowherders have reported that " + dailyCowDeaths + " cows have been slain in this field today by passing adventurers. Farmers throughout the land fear this may be an epidemic.");
} else {
ContentAPI.sendDialogue(player, "The Lumbridge cow population has been thriving today, without a single cow death to worry about!" );
}
return true;
}
@@ -8,6 +8,7 @@ import core.game.world.map.zone.ZoneBorders;
import core.game.world.map.zone.ZoneBuilder;
import core.plugin.Initializable;
import core.plugin.Plugin;
import rs09.GlobalStats;
/**
* Zone for the lumbridge cow pen
@@ -40,7 +41,7 @@ public class CowPenZone extends MapZone implements Plugin<Object> {
@Override
public boolean death(Entity e, Entity killer) {
if (killer instanceof Player && e instanceof NPC) {
CowDeaths++;
GlobalStats.incrementDailyCowDeaths();
}
return false;
}
@@ -72,6 +72,7 @@ import core.tools.StringUtils;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import org.rs09.consts.Items;
import rs09.GlobalStats;
import rs09.ServerConstants;
import rs09.game.VarpManager;
import rs09.game.content.ame.RandomEventManager;
@@ -582,6 +583,7 @@ public class Player extends Entity {
@Override
public void finalizeDeath(Entity killer) {
GlobalStats.incrementDeathCount();
settings.setSpecialEnergy(100);
settings.updateRunEnergy(settings.getRunEnergy() - 100);
Player k = killer instanceof Player ? (Player) killer : this;