Lots of bugs fixed

This commit is contained in:
Ceikry
2021-03-14 14:31:13 -05:00
parent b83dd22f2e
commit 3e3835b4f5
16 changed files with 144 additions and 96 deletions
@@ -44,7 +44,7 @@ public final class AvasDevicePlugin implements Plugin<Object> {
break;
}
}
if(player.hasActiveState("avadevice")) player.states.get("avadevice").getPulse().stop();
if(player.hasActiveState("avadevice")) player.clearState("avadevice");
break;
}
return true;
@@ -14,6 +14,7 @@ import core.net.packet.PacketRepository;
import core.net.packet.context.PlayerContext;
import core.net.packet.out.ClearMinimapFlag;
import kotlin.jvm.functions.Function1;
import rs09.game.system.SystemLogger;
import java.util.Deque;
@@ -225,6 +226,12 @@ public abstract class MovementPulse extends Pulse {
if (mover instanceof NPC && mover.asNpc().isNeverWalks()) {
return;
}
if(destination.getLocation() == null){
SystemLogger.logAlert(destination.getId() + " < ID");
SystemLogger.logAlert(destination.getName() + " < NAME");
SystemLogger.logAlert("ASDAD");
return;
}
boolean inside = isInsideEntity(mover.getLocation());
if (last != null && last.equals(destination.getLocation()) && !inside) {
return;
@@ -1354,9 +1354,7 @@ public class Player extends Entity {
}
public State registerState(String key){
State state = StateRepository.forKey(key,this);
if(state != null) return state;
return null;
return StateRepository.forKey(key, this);
}
public void clearState(String key){
@@ -1,49 +0,0 @@
package core.game.node.entity.skill.construction.decoration.chapel;
import core.cache.def.impl.ObjectDefinition;
import core.game.interaction.OptionHandler;
import core.game.node.Node;
import core.game.node.entity.player.Player;
import core.game.node.item.Item;
import core.game.node.object.GameObject;
import core.game.node.object.ObjectBuilder;
import core.game.world.update.flag.context.Animation;
import core.plugin.Initializable;
import core.plugin.Plugin;
import core.tools.RandomFunction;
/**
* Handles the lighting of the torches of the Chapel.
* @author Splinter
*/
@Initializable
public class TorchLightPlugin extends OptionHandler {
@Override
public Plugin<Object> newInstance(Object arg) throws Throwable {
for (int i = 13202; i < 13214; i++) {
ObjectDefinition.forId(i).getHandlers().put("option:light", this);
}
return this;
}
@Override
public boolean handle(Player player, Node node, String option) {
if (player.getIronmanManager().checkRestriction() && !player.getHouseManager().isInHouse(player)) {
return true;
}
if (!player.getInventory().containsItem(new Item(590)) || !player.getInventory().containsItem(new Item(251))) {
player.getDialogueInterpreter().sendDialogue("You'll need a tinderbox and a clean marrentill herb in order to", "light the burner.");
return true;
}
if (player.getInventory().remove(new Item(251))) {
player.lock(1);
player.animate(Animation.create(3687));
player.sendMessage("You burn some marrentill in the incense burner.");
ObjectBuilder.replace(node.asObject(), new GameObject(node.asObject().getId() + 1, node.getLocation()), RandomFunction.random(100, 175));
}
return true;
}
}
@@ -186,7 +186,7 @@ public final class InteractionPacket implements IncomingPacket {
player.debug("spawn=" + npc.getProperties().getSpawnLocation() + ".");
player.debug("Varp ID= " + npc.getDefinition().getConfigId() + " Offset=" + npc.getDefinition().getVarbitOffset() + " Size=" + npc.getDefinition().getVarbitSize());
handleAIPLegion(player, 0, optionIndex, index);
if(Listeners.run(shown.getId(),2, option.getName(),player,shown)){
if(Listeners.run(npc.getId(),2, option.getName(),player,npc)){
return;
}
if(PluginInteractionManager.handle(player,shown,option)){