StendhalAPI: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>AntumDeluge
DressedEntity, NPC, PassiveNPC, SpeakerNPC, & SilentNPC classes
imported>AntumDeluge
SpeakerNPC: add public methods
Line 420: Line 420:
* Class: {{StendhalFile|master|src/games/stendhal/server/entity/npc/SpeakerNPC.java|games.stendhal.server.entity.npc.SpeakerNPC}}
* Class: {{StendhalFile|master|src/games/stendhal/server/entity/npc/SpeakerNPC.java|games.stendhal.server.entity.npc.SpeakerNPC}}
* Inherits: [[StendhalAPI#PassiveNPC|PassiveNPC]]
* Inherits: [[StendhalAPI#PassiveNPC|PassiveNPC]]

'''Public Methods:'''

{{PublicMethod | SpeakerNPC | params=name | desc=Constructor. | ret= | rettype= | paramlist=
{{MethodParam | name | type=String | desc=Name of the new entity.}} }}

{{PublicMethod | add | params=state, trigger, condition, nextState, reply, action | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | add | params=state, trigger, condition, nextState, reply, action, label | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | add | params=state, triggerStrings, condition, nextState, reply, action,label | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | add | params=state, triggerStrings, condition, nextState, reply, action | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | add | params=state, triggerStrings, condition, secondary, nextState, reply, action | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | add | params=states, trigger, condition, nextState, reply, action | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | add | params=states, triggerStrings, condition, nextState, reply, action | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | add | params=state, triggerStrings, nextState, reply, action | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | add | params=state, triggerStrings, nextState, reply, action, label | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | addEmotion | params=triggerStrings, npcAction | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | addEmotion | params=trigger, npcAction | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | addEmotionReply | params=playerAction, npcAction | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | addGoodbye | params= | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | addGoodbye | params=text | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | addGreeting | params= | desc=Add default greeting. | ret= | rettype= | paramlist= }}

{{PublicMethod | addGreeting | params=text | desc=Add greeting text. | ret= | rettype= | paramlist=
{{MethodParam | text | type=String | desc=Message to be displayed.}} }}

{{PublicMethod | addGreeting | params=text, action | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | addHelp | params=helpDescription | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | addInitChatMessage | params=condition, action | desc= | ret= | rettype= | paramlist=
{{MethodParam | condition | type=[[StendhalAPI#ChatCondition|ChatCondition]] | desc=}}
{{MethodParam | action | type=[[StendhalAPI#ChatAction|ChatAction]] | desc=}} }}

{{PublicMethod | addJob | params=jobDescription | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | addMatching | params=state, trigger, matcher, condition, nextState, reply, action | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | addOffer | params=offerDescription | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | addQuest | params=text | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | addReply | params=trigger, text | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | addReply | params=triggerStrings, text | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | addReply | params=trigger, text, action | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | addReply | params=triggerStrings, text, action | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | addReplyOnEmotion | params=playerAction, reply | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | addWaitMessage | params= | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | addWaitMessage | params=text, action | desc=Message when attending another player. | ret= | rettype= | paramlist=
{{MethodParam | text | type=String | desc=Message to be shown.}}
{{MethodParam | action | type=[[StendhalAPI#ChatAction|ChatAction]] | desc=}} }}

{{PublicMethod | del | params=label | desc=Delete transitions that match label. | ret= | rettype=boolean | paramlist=
{{MethodParam | label | type=String | desc=}} }}

{{PublicMethod | endConversation | params= | desc=Ends interaction with player & sets to not attending. | ret= | rettype= | paramlist= }}

{{PublicMethod | getAlternativeImage | params= | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | getAttending | params= | desc=Retrieves the entity currently talking to the NPC, or null if not attending anyone. | ret=Entity attended to. | rettype=[[StendhalAPI#RPEntity|RPEntity]] | paramlist= }}

{{PublicMethod | getEngine | params= | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | getJob | params= | desc=TODO | ret= | rettype=String | paramlist= }}

{{PublicMethod | getReply | params=trigger | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | getReply | params=trigger, state, expressionType | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | getTransitions | params= | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | inConversationRange | params= | desc=Checks if an entity is within range to interact. | ret= | rettype=boolean | paramlist= }}

{{PublicMethod | isAllowedToActAlone | params= | desc= | ret= | rettype=boolean | paramlist= }}

{{PublicMethod | isTalking | params= | desc= | ret= | rettype=boolean | paramlist= }}

{{PublicMethod | listenTo | params=player, text | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | onRejectedAttackStart | params=attacker | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | preLogic | params= | desc= | ret= | rettype= | paramlist= }}

{{PublicMethod | setAllowToActAlone | params=allow | desc=Allow or disallow the NPC to act without players in its zone. | ret= | rettype= | paramlist=
{{MethodParam | allow | type=boolean }} }}

{{PublicMethod | setAlternativeImage | params=alternativeImage | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | setAttending | params=rpendity | desc=Sets the entity to whom the NPC is currently listening. | ret= | rettype= | paramlist=
{{MethodParam | rpentity | type=[[StendhalAPI#RPEntity|RPEntity]] | desc=The entity with whom the NPC should be interacting}} }}

{{PublicMethod | setCurrentState | params=state | desc=TODO | ret= | rettype= | paramlist= }}

{{PublicMethod | setIdleDirection | params=dir | desc=Sets the direction the entity will face while not interacting with a player. | ret= | rettype= | paramlist=
{{MethodParam | dir | type=[[StendhalAPI#Direction|Direction]] | desc=Direction to face.}} }}

{{PublicMethod | setPlayerChatTimeout | params=playerChatTimeout | desc=Sets the time a conversation can be paused before it will be terminated by the NPC. | ret= | rettype= | paramlist=
{{MethodParam | playerChatTimeout | type=long | desc=Time in seconds.}} }}


== SilentNPC ==
== SilentNPC ==