NPC - ScriptcommandsOverview
General commands- Name
Syntax: name="<Name of the NPC>" Use: Sets the name of the NPC Example: name="Augham" - Position
Syntax: position=<x>, <y>, <z> Use: Sets the position the NPC is standing in Example: position=-81,-151,0 - Gender
Syntax: sex=<gender> Use: Sets the gender of the NPC ( male, female ) Example: sex=male - Race
Syntax: race=<race> Use: Sets the race of a NPC ( human, dwarf, ... ) Example: race=human - direction
Syntax: direction=<Richtung> Use: Sets the direction the NPC is looking in ( north, east, ... ) Example: direction=west - Moving radius
Syntax: radius=<moving radius> Use: Sets the size of the radius the NPC is moving in Example: radius=4 - Cycled text
Syntax: cycletext("<german text>","<english text>") Use: Sets the text the NPC says from time to time on its own Example: cycletext("#me sieht sich um","#me looks around") - Quest ID
Syntax: questid=<Quest ID> Use: Sets the quest ID the NPC uses. ( Please ask a developer to get such a ID ) Example: questid=558 - comment
Syntax: --<comment text> Use: Adds a comment to the script Example: -- here starts a cool npc script

Conditions- Text triggers
Syntax: "<text>" Use: Sets the text that triggers an action of the NPC ( more then one is possible ) Example: "hello" - NPC state
Syntax: state <compare operator> <value> Use: Checks the NPC State for a setted value Example: state>=5 - Skill
Syntax: skill(<skillname>) <compare operator> <value> Use: Checks the skill of the player for the value Example: skill(slashing weapons)=<40 - Attributes
Syntax: attrib(<name of the attribut>) <compare operator> <value> Use: Checks the attribute of the player for the value Example: attrib(essence)<>10 - Runes
Syntax: rune(<mage class>, <number of the rune>) Use: Checks if the character has the rune in the mage class Example: rune(mage, 8) - Money
Syntax: money <compare operator> <value> Use: Checks if the character has enough money Example: money<8 - Race
Syntax: race = <name of the race> Use: Checks if the character is of the race Example: race=human - Queststatus
Syntax: queststatus <compare operator> <value> Use: Checks the value of the queststatus ( works only of Quest ID is setted ) Example: queststatus>20 - Items
Syntax: item( <Item ID>, <position of the item> ) <compare operator> <value> Use: Checks if the character has the amount of Items Example: item(4,belt)=10 - Player language
Syntax: <name of the language> Use: Checks what language the player speaks Example: german - Random value generator
Syntax: chance( <value> ) Use: Causes a random try that succeeds with a <value>% chance Example: chance(40) - character gender
Syntax: <name of the gender> Use: Checks the gender of a character Example: male - Character talkingstate
Syntax: <name of the talking state> Use: Checks if the character speaks with another character or not. ( works only for radius above 0 ) Example: idle - NPC guild state
Syntax: fraction( <name of the guild> ) <compare operator> <value> Use: Checks the value of the character at a NPC Guild Example: fraction(albar)=9 - Player said value
Syntax: %NUMBER <compare operator> <value> Use: Checks the number the character said to the npc Example: %NUMBER<>9

Consequences- Text answer
Syntax: "<text>" Use: Makes the NPC say a text. ( more than one is possible, in that case the spoken one is chosen randomly ) Example: "Greetings" - NPC state
Syntax: state <calculation operator> <value> Use: Sets the NPC state to a value Example: state+9 - Skill
Syntax: skill( <name of the skillgroup>, <name of the skill> ) <calculation operator> <value> Use: Sets a skill of the player to the value Example: skill(language,common language)-40 - Attributs
Syntax: attrib( <name of the attribut> ) <calculation operator> <value> Use: Sets the attribut to the value Example: attrib(strength)=2 - Runes
Syntax: rune( <name of the magic class>, <value of the rune> ) Use: Teaches the player a rune at the magic class Example: rune(druid,3) - Money
Syntax: money <calculation operator> <value> Use: Hands or takes money to or from the player ( in copper coins ) Example: money+300 - Delete items
Syntax: deleteitem( <ID of the item>, <amount> ) Use: Deletes the amount of items from the player inventory Example: deleteitem(20,10) - Create items
Syntax: item( <Id of the item>, <amount>, <quality>, <datavalue> ) Use: Creates the set amount of items. Example: item(20,10,333,0) - Quest state
Syntax: queststatus <calculation operator> <value> Use: Sets the quest status to the value ( works only in case the Quest ID is setted ) Example: queststatus-30 - NPC guilds
Syntax: fraction( <name of the guild> ) <calculation operator> <value> Use: Sets the value of a player at an NPC guild to the value Example: fraction(salkamar)+90 - NPC talking state
Syntax: <name of the talking state> Use: Makes the character start or stop a conversation. ( works only in case radius is above 0 ) Example: begin

Additional- %NUMBER
%NUMBER can be written in text triggers, in answers and in consequences and conditions with number values ( but Item IDs and rune numbers ). %NUMBER in text triggers makes the NPC wait for a number at this position in the trigger. %NUMBER in all other conditions and consequences is replaced with the number the player said. - Expressions
expr( expression ) offers the possibility to do calculations. It can be used everywhere where %NUMBER can be used as well, but in texts. In the expressions %NUMBER can be used as well.
|