Class TeleporterBehaviour

java.lang.Object
games.stendhal.server.entity.npc.behaviour.impl.TeleporterBehaviour
All Implemented Interfaces:
TurnListener
Direct Known Subclasses:
ItemDroppingTeleporterBehaviour

public class TeleporterBehaviour extends Object implements TurnListener
teleports the SpeakerNPC to a random location on the outside world and causes it to walk a random path
Author:
hendrik
  • Constructor Details

    • TeleporterBehaviour

      public TeleporterBehaviour(SpeakerNPC speakerNPC, List<String> setZones, String zoneStartsWithLimiter, String repeatedText)
      Creates a new TeleporterBehaviour.
      Parameters:
      speakerNPC - SpeakerNPC
      repeatedText - text to repeat
    • TeleporterBehaviour

      public TeleporterBehaviour(SpeakerNPC speakerNPC, List<String> setZones, String zoneStartsWithLimiter, String repeatedText, boolean useHighProbabilityZones)
      Creates a new TeleporterBehaviour.
      Parameters:
      speakerNPC - SpeakerNPC
      repeatedText - text to repeat
      useHighProbabilityZones - true to make teleportation to a hand selected list of zones more likely
  • Method Details

    • doRegularBehaviour

      protected void doRegularBehaviour()
    • onTurnReached

      public void onTurnReached(int currentTurn)
      Description copied from interface: TurnListener
      This method is called when the turn number is reached.
      Specified by:
      onTurnReached in interface TurnListener
      Parameters:
      currentTurn - current turn number
    • setExitsConversation

      public void setExitsConversation(boolean exits)
      Sets the behavior of the NPC when teleport turn is reached.
      Parameters:
      exits - If false, NPC will not teleport if engaged in conversation when turn reached for teleport. Otherwise, will end conversation & teleport.
    • setTarryDuration

      public void setTarryDuration(Integer duration)
      Sets the amount of time (in seconds) the NPC will spend on a map before teleporting.
      Parameters:
      duration - Seconds the NPC will stay on map.
    • setTeleportWarning

      public void setTeleportWarning(String phrase)
      Sets the message that NPC will say when failing to teleport if engaged in conversation.
      Parameters:
      phrase - Message to say.