Class TeleporterBehaviour
java.lang.Object
games.stendhal.server.entity.npc.behaviour.impl.TeleporterBehaviour
- All Implemented Interfaces:
TurnListener
- Direct Known Subclasses:
ItemDroppingTeleporterBehaviour
teleports the SpeakerNPC to a random location on the outside world and causes
it to walk a random path
- Author:
- hendrik
-
Constructor Summary
ConstructorDescriptionTeleporterBehaviour(SpeakerNPC speakerNPC, List<String> setZones, String zoneStartsWithLimiter, String repeatedText)
Creates a new TeleporterBehaviour.TeleporterBehaviour(SpeakerNPC speakerNPC, List<String> setZones, String zoneStartsWithLimiter, String repeatedText, boolean useHighProbabilityZones)
Creates a new TeleporterBehaviour. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
onTurnReached(int currentTurn)
This method is called when the turn number is reached.void
setExitsConversation(boolean exits)
Sets the behavior of the NPC when teleport turn is reached.void
setTarryDuration(Integer duration)
Sets the amount of time (in seconds) the NPC will spend on a map before teleporting.void
setTeleportWarning(String phrase)
Sets the message that NPC will say when failing to teleport if engaged in conversation.
-
Constructor Details
-
TeleporterBehaviour
public TeleporterBehaviour(SpeakerNPC speakerNPC, List<String> setZones, String zoneStartsWithLimiter, String repeatedText)Creates a new TeleporterBehaviour.- Parameters:
speakerNPC
- SpeakerNPCrepeatedText
- text to repeat
-
TeleporterBehaviour
public TeleporterBehaviour(SpeakerNPC speakerNPC, List<String> setZones, String zoneStartsWithLimiter, String repeatedText, boolean useHighProbabilityZones)Creates a new TeleporterBehaviour.- Parameters:
speakerNPC
- SpeakerNPCrepeatedText
- text to repeatuseHighProbabilityZones
- 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 interfaceTurnListener
- Parameters:
currentTurn
- current turn number
-
setExitsConversation
public void setExitsConversation(boolean exits)Sets the behavior of the NPC when teleport turn is reached.- Parameters:
exits
- Iffalse
, NPC will not teleport if engaged in conversation when turn reached for teleport. Otherwise, will end conversation & teleport.
-
setTarryDuration
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
Sets the message that NPC will say when failing to teleport if engaged in conversation.- Parameters:
phrase
- Message to say.
-