Response Operation: Difference between revisions

From PSwiki
Jump to navigation Jump to search
Magodra (talk | contribs)
Magodra (talk | contribs)
No edit summary
 
(22 intermediate revisions by the same user not shown)
Line 2: Line 2:
= Response Operations =
= Response Operations =


Response operations are used to script response scripts as part of [[NPC Dialogues]]. They are also build internally in the server from the Quest system through [[Quest Script Operations]].
== Action ==
== Action ==


This response operations .  
This response operations cause an action by the NPC.  


{|
{|
Line 27: Line 28:




   Ex:  <action ... />
   Ex:  <action anim="The anim" text="The action" />


== Action My ==
== Action My ==
Line 160: Line 161:
!Description
!Description
|-
|-
|quest_id
|Mandatory
|string
|
|
|The name of the quest.
|-
|error_msg
|Optional
|string
|
|
|
|Error message.
|
|
|}
|}




   Ex:  <complete ... />
   Ex:  <complete quest_id="The Quest" error_msg="The Quest Complete error message" />


== Do Admin Command ==
== Do Admin Command ==


This response operations .  
This response operations run an admin command. In the command string the key words "targetchar" and "sourcenpc" is replaced with target and the NPC talking.


{|
{|
Line 181: Line 188:
!Description
!Description
|-
|-
|command
|Mandatory
|string
|
|
|
|The admin command to run.
|
|
|
|}
|}




   Ex:  <doadmincmd ... />
   Ex:  <doadmincmd command="/debugnpc sourcenpc 5" />


== Faction ==
== Faction ==
Line 202: Line 209:
!Description
!Description
|-
|-
|name
|Mandatory
|string
|
|
|Name of the faction.
|-
|value
|Mandatory
|integer
|
|
|
|The faction value.
|
|
|}
|}




   Ex:  <faction ... />
   Ex:  <faction name="My Faction" value="5" />


== Give Item ==
== Give Item ==
Line 223: Line 236:
!Description
!Description
|-
|-
|item
|Mandatory
|string or integer
|
|
|
|The name of the item stat or the id of the item stat.
|
|-
|
|count
|
|Optional
|integer
|1
|The number of items to give.
|-
|quality
|Optional
|integer
|0
|The quality of the new item.
|}
|}




   Ex:  <give ... />
   Ex:  <give item="The Item" count="2" quality="50" />


== Guild Award ==
== Guild Award ==


This response operations .  
This response operations award a guild Karma Points.  


{|
{|
Line 244: Line 269:
!Description
!Description
|-
|-
|karma
|Mandatory
|integer
|
|
|
|Number of Karma Points to award guild.
|
|
|
|}
|}




   Ex:  <guild_award ... />
   Ex:  <guild_award karma="10" />


== Introduce ==
== Introduce ==
Line 265: Line 290:
!Description
!Description
|-
|-
|
|name
|
|Optional
|
|string
|
|Me
|
|The character to introduce to the NPC.
|}
|}




   Ex:  <introduce ... />
   Ex:  <introduce name="The Player" />


== Money ==
== Money ==


This response operations .  
This response operations give money to the player.  


{|
{|
Line 286: Line 311:
!Description
!Description
|-
|-
|value
|Mandatory
|int,int,int,int or int
|
|
|
|The money to give. Either "Circles, octas, hexas, trias" or just "trias".
|
|
|
|}
|}




   Ex:  <money ... />
   Ex:  <money value="1,2,3,4" />
      <money value="42" />
 
== Narrate ==
== Narrate ==


Line 339: Line 366:
== NPC Cmd ==
== NPC Cmd ==


This response operations send a command to the NPC Client. The command will trigger NPC responses.  
This response operations send a command to the NPC Client. The command will trigger NPC responses. See [[Behaviors_and_Reactions#NPC_Cmd_Perception|NPC Cmd Perception]].


{|
{|
Line 361: Line 388:
== Offer Reward ==
== Offer Reward ==


This response operations .  
This response operations offer items to the player. Either defined by ID or name. If ID is defined that will take precedence over name.


{|
{|
Line 370: Line 397:
!Description
!Description
|-
|-
|id
|Optional
|integer
|
|
|The ID of the item stat of the item to offer. If id not defined name must be defined.
|-
|name
|Optional
|string
|
|
|
|The name of the item stat of the item to offer. If name not defined id must be defined.
|
|
|}
|}




   Ex:  <offer ... />
   Ex:  <offer>
        <item id="10" />
        <item name="My Item State" />
      </offer>


== Respond ==
== Respond ==
Line 401: Line 437:
   Ex:  <respond text="Hello" />
   Ex:  <respond text="Hello" />


== Run ==
== Run Script ==


This response operations run a script.  
This response operations run a script.  
Line 412: Line 448:
!Description
!Description
|-
|-
|script
|Mandatory
|string
|
|
|The script
|-
|with
|Optional
|string
|
|
|
|Binding text.
|
|
|}
|}




   Ex:  <run ... />
   Ex:  <run script="My Script" with="My Binding?" />


== Respond Public ==
== Respond Public ==


This response operations .  
This response operations respond with a text to the player. This is the same as the [[#Respond|Respond operation]] but the respond is public.


{|
{|
Line 433: Line 475:
!Description
!Description
|-
|-
|text
|Mandatory
|string
|
|
|
|The chat message to respond with.
|
|
|
|}
|}




   Ex:  <respondpublic ... />
   Ex:  <respondpublic text="Chat message going public" />


== Say ==
== Say ==
Line 464: Line 506:
== Set Variable ==
== Set Variable ==


This response operations .  
This response operations set a character variable. Character variables are typically used from scripts.


{|
{|
Line 473: Line 515:
!Description
!Description
|-
|-
|name
|Mandatory
|string
|
|
|The name of the variable
|-
|value
|Mandatory
|string
|
|
|
|The value of the variable.
|
|
|}
|}




   Ex:  <setvariable ... />
   Ex:  <setvariable name="My Variable" value="My Value" />


== Train ==
== Train ==


This response operations train the player.  
This response operations start training for the player. A confirmation dialog is displayed at the client.  


{|
{|
Line 494: Line 542:
!Description
!Description
|-
|-
|skill
|Mandatory
|string
|
|
|
|Skill name
|
|
|
|}
|}




   Ex:  <train ... />
   Ex:  <train skill="My Skill" />


== Uncomplete Quest ==
== Uncomplete Quest ==
Line 517: Line 565:
|quest_id
|quest_id
|Mandatory
|Mandatory
|String
|string
|
|
|The name of the quest.
|The name of the quest.
|-
|error_msg
|Optional
|string
|
|Error message.
|}
|}


Line 536: Line 590:
!Description
!Description
|-
|-
|name
|Mandatory
|string
|
|
|
|The name of the variable.
|
|
|
|}
|}




   Ex:  <unsetvariable ... />
   Ex:  <unsetvariable name="My Variable" />


== Verify Quest Assigned ==
== Verify Quest Assigned ==

Latest revision as of 20:53, 4 January 2014

Response Operations

Response operations are used to script response scripts as part of NPC Dialogues. They are also build internally in the server from the Quest system through Quest Script Operations.

Action

This response operations cause an action by the NPC.

Attribute Required Values/Type Default Description
anim Mandatory string Name of animation
text Optional string Action command.


 Ex:  <action anim="The anim" text="The action" />

Action My

This response operations .

Attribute Required Values/Type Default Description


 Ex:  <actionmy ... />

Action My Public

This response operations .

Attribute Required Values/Type Default Description


 Ex:  <actionmypublic ... />

Action Public

This response operations .

Attribute Required Values/Type Default Description


 Ex:  <actionpublic ... />

Assign Quest

This response operations assign a new quest to the player.

Attribute Required Values/Type Default Description
q1 Mandatory string Name of the quest
q2 Optional string Name of the quest
q2 Optional string Name of the quest
q3 Optional string Name of the quest
q4 Optional string Name of the quest
q5 Optional string Name of the quest
timeout_msg Optional string The timeout message.


 Ex:  <assign q1="The Quest" q2="The Other Quest" timeout_msg="The Quest timeout message" />

Complete Quest

This response operations complete a quest.

Attribute Required Values/Type Default Description
quest_id Mandatory string The name of the quest.
error_msg Optional string Error message.


 Ex:  <complete quest_id="The Quest" error_msg="The Quest Complete error message" />

Do Admin Command

This response operations run an admin command. In the command string the key words "targetchar" and "sourcenpc" is replaced with target and the NPC talking.

Attribute Required Values/Type Default Description
command Mandatory string The admin command to run.


 Ex:  <doadmincmd command="/debugnpc sourcenpc 5" />

Faction

This response operations adjust the faction.

Attribute Required Values/Type Default Description
name Mandatory string Name of the faction.
value Mandatory integer The faction value.


 Ex:  <faction name="My Faction" value="5" />

Give Item

This response operations give items to the player.

Attribute Required Values/Type Default Description
item Mandatory string or integer The name of the item stat or the id of the item stat.
count Optional integer 1 The number of items to give.
quality Optional integer 0 The quality of the new item.


 Ex:  <give item="The Item" count="2" quality="50" />

Guild Award

This response operations award a guild Karma Points.

Attribute Required Values/Type Default Description
karma Mandatory integer Number of Karma Points to award guild.


 Ex:  <guild_award karma="10" />

Introduce

This response operations introduce the player with the NPC.

Attribute Required Values/Type Default Description
name Optional string Me The character to introduce to the NPC.


 Ex:  <introduce name="The Player" />

Money

This response operations give money to the player.

Attribute Required Values/Type Default Description
value Mandatory int,int,int,int or int The money to give. Either "Circles, octas, hexas, trias" or just "trias".


 Ex:  <money value="1,2,3,4" />
      <money value="42" />

Narrate

This response operations .

Attribute Required Values/Type Default Description


 Ex:  <narrate ... />

Narrate Public

This response operations .

Attribute Required Values/Type Default Description


 Ex:  <narratepublic ... />

NPC Cmd

This response operations send a command to the NPC Client. The command will trigger NPC responses. See NPC Cmd Perception.

Attribute Required Values/Type Default Description
cmd Mandatory string Use format npccmd:global:<your cmd text> or npccmd:self:<your cmd text>


 Ex:  <npccmd cmd="npccmd:global:start_riot" />
      <npccmd cmd="npccmd:self:open_cage" />

Offer Reward

This response operations offer items to the player. Either defined by ID or name. If ID is defined that will take precedence over name.

Attribute Required Values/Type Default Description
id Optional integer The ID of the item stat of the item to offer. If id not defined name must be defined.
name Optional string The name of the item stat of the item to offer. If name not defined id must be defined.


 Ex:  <offer>
        <item id="10" />
        <item name="My Item State" />
      </offer>

Respond

This response operations respond with a text to the player. This is the same as the Say operation.

Attribute Required Values/Type Default Description
text Mandatory string The chat message to respond with.


 Ex:  <respond text="Hello" />

Run Script

This response operations run a script.

Attribute Required Values/Type Default Description
script Mandatory string The script
with Optional string Binding text.


 Ex:  <run script="My Script" with="My Binding?" />

Respond Public

This response operations respond with a text to the player. This is the same as the Respond operation but the respond is public.

Attribute Required Values/Type Default Description
text Mandatory string The chat message to respond with.


 Ex:  <respondpublic text="Chat message going public" />

Say

This response operations respond with a text to the player. This is the same as the Respond operation.

Attribute Required Values/Type Default Description
text Mandatory string The chat message to respond with.
 Ex:  <say text="Hello" />

Set Variable

This response operations set a character variable. Character variables are typically used from scripts.

Attribute Required Values/Type Default Description
name Mandatory string The name of the variable
value Mandatory string The value of the variable.


 Ex:  <setvariable name="My Variable" value="My Value" />

Train

This response operations start training for the player. A confirmation dialog is displayed at the client.

Attribute Required Values/Type Default Description
skill Mandatory string Skill name


 Ex:  <train skill="My Skill" />

Uncomplete Quest

This response operations Un-complete a quest.

Attribute Required Values/Type Default Description
quest_id Mandatory string The name of the quest.
error_msg Optional string Error message.


 Ex:  <uncomplete quest_id="The Quest" error_msg="The Quest Uncomplete error message" />

Unset Variable

This response operations Un-set a variable.

Attribute Required Values/Type Default Description
name Mandatory string The name of the variable.


 Ex:  <unsetvariable name="My Variable" />

Verify Quest Assigned

This response operations verify if a quest is assigned.

Attribute Required Values/Type Default Description
quest Mandatory string Name of quest.
error_msg Optional string Error message.


 Ex:  <verifyquestassigned quest="The Quest" error_msg="The Quest is not assigned" />

Verify Quest Completed

This response operations verify if a quest is complete.

Attribute Required Values/Type Default Description
quest Mandatory string Name of quest.
error_msg Optional string Error message.


 Ex:  <verifyquestcompleted quest="The Quest" error_msg="The Quest is not completed" />

Verify Quest Not Assigned

This response operations verify that a quest is not assigned.

Attribute Required Values/Type Default Description
quest Mandatory string Name of quest.
error_msg Optional string Error message.


 Ex:  <verifyquestnotassigned quest="The Quest" error_msg="The Quest is assigned" />