Index: 0. General description of NPC 1. Conditions 2. Consequences 3. All The Rest 4. Examples 0. General description of NPC (at the start of the file) name="" The name of the NPC. position=,, The coordinates of that NPC. sex= The gender of that NPC. race=human The race of that NPC. Valid races are: human, dwarf, halbling, elf, orc, lizard, gnome, fairy, goblin direction= The direction this NPC shold face to. Valid are: north, south, west, east. radius= This is an optional parameter of a NPC. If it is set, the NPC will move around within that radius. Also, if radius is present, this means that the "begin" and "end" statement and the "busy" and "idle" commands can be used in the NPC-file. Example: name="Garry Someone" position=-100,-100,0 sex=male race=dwarf direction=north radius=5 1. Conditions (everything before -> is a condition): "" means that '' has to be spoken by the character. Note that the capitalization does not matter. Spaces mean that there can be any words inbetween ("you name" can also mean "What is your dumb name, sir?"). There can be several such conditions in a line which means that one of them has to be fulfilled. "hello", "hi", "greetings" -> "Be greeted!" means: If someone says either "hello" or "hi" or "greetings". german english specifies which language the player of that character speaks. Comes in handy when giving answers to words that appear in both languages ("Tol Vanima"). This condition may only appear once per action (line)! female male Specifies which gender the speaking character has. money = money < ... means that the character has exactly/less than/... money (in copper) with him. This condition may only appear once per action (line)! item(, ) = item(, ) < ... means that the character has exactly/less than/... items with the item-id at with him. (position can be: all, belt, bag, body) skill() = skill() < ... means that the character's skill in is exactly/less than/... . attrib() = ... means that the character's attribute in is exactly/less than/... . race= means that the character's race is (human, dwarf, elf, halfling, lizard, ...). This condition may only appear once per action (line)! state = state < ... means that the NPC talking status is exactly/less than/... . This condition may only appear once per action (line)! queststatus = queststatus < ... means that the character's queststatus for the current quest is equal to/less than/... . Note that an npc has only access to one quest-id, however different NPCs can access the same quest-id. This condition may only appear once per action (line)! Advanced not: You can set the Quest-ID by stating questid=. chance(

) Means that something happens with a probability of

%. rune(,) Checks whether the character has rune of the (which can be mage, druid, priest or bard). fraction() = fraction() < ... means that the character's fraction value for the fraction (albar, gynk, salkamar, thiefs, explorer) equals/is less than/... . busy Means that this is only valid if the NPC is talking to a character. This can only be used if radius is set to a value > 0. idle Means that this is only valid if the NPC is not talking to any character at the moment (and thus walking around). This can only be used if radius is set to a value > 0. fraction() = fraction() < ... Means that the character's fraction status in the guild (albar, gynk, salkamar, thiefs, explorer) is equal/less than/... . fraction(albar)>10 would mean that the characters status in the albar guild is higher than 10. %NUMBER = %NUMBER < ... Means that there has to be a %NUMBER within the conditional text (that has to be spoken by the character) and %NUMBER then contains the number that was said. "buy %NUMBER potions" -> item(331,%NUMBER,333,0) will create %NUMBER potions in the character's inventory when he says "I want to buy 10 potions" or something like that. Note that %NUMBER can also be used within the condition! "have %NUMBER coins", money<%NUMBER -> "You are a liar! You don't have so many coins! You said %NUMBER but you only got less!" 2. Consequences (everything after -> is a consequence) "" The NPC speaks this text. If there are more than just one textes as a consequence, the NPC will choose a random one of them. money+ money- The character gets money (or money is taken from the character). This consequence may only appear once per action (line)! item(,,,) items with item-ID , quality and data are created in the characters inventory. Note that in doubt, quality=333 and data=0. deleteitem(,) items with item-ID are deleted from the characters inventory. skill(,)+ skill(,)- skill(,)= The skill in the skillgroup (language, crafts, magic, other, fighting, druid, priest, bard) is increased by/decreased by/set to . attrib()+ attrib()- attrib()= Increase/decrease/set attribute by/to . Attribute names also include hitpoints and mana (along with strength, constitution and so on). state= Set the state of talking (for this NPC) to . Note that eventually queststatus is the better choice. This consequence may only appear once per action (line)! queststatus= queststatus+ queststatus- Set the queststatus to /Add to/Subtract from queststatus. This consequence may only appear once per action (line)! rune(,) Hands out a rune for the (which can be mage, druid, priest or bard). fraction() = fraction() + fraction() - Means that either the character's fraction value for the fraction (albar, gynk, salkamar, thiefs, explorer) will be set to or that will be added/subtracted from this fraction value. begin The character now starts talking to the character and is busy (see conditions) therefore. This only works if radius was set to a value greater then 0. end The character stops speaking to the character and is idle afterwards (see conditions). This only works if radius was set to a value greater than 0. 3. All The Rest %NPCNAME %CHARNAME The NPC's/player characters name will be inserted automatically. This is only valid on the consequence-side of an action and can appear in spoken texts only! cycletext "","" The NPC repeats these texts from time to time (like "#me pokes his nose"). It uses a random statement of those given. -- This is a comment line which means that it will be ignored by the script. Use it to make notes or similar things. 4. Examples: name="Mizi Holmich" position=120,211,-3 sex=female race=human direction=north -- radius not set, therefore the NPC won't walk around. "Hello", female -> "Hello, lady %CHARNAME. My Name is %NPCNAME, what can I do for you?" "Hello", male -> "Hello, sir %CHARNAME. My Name is %NPCNAME, what can I do for you?" "name", german -> "Mein Name ist %NPCNAME." "name", english -> "My name is %NPCNAME." "take money", money>10 -> "Okay, I take some money!", money-10 "give items" -> "Good, I give you some items", item(1,1,333,0), item(2,1,333,0) "sword", item(1, body) -> "Yes, you have a sword in your hands. I better take it.", deleteitem(1, 1) "sword", item(1,all) -> "You have a sword with you, but not in your hands. You can keep it." "carpentry", skill(carpentry)>80 -> "You are an excellent carpenter, indeed!" "carpentry", skill(carpentry)>50 -> "You are a good carpenter!" "carpentry", skill(carpentry)>10 -> "You are an average carpenter!" "carpentry" -> "You are a weak carpenter! I will help you a little.", skill(crafts, carpentry)+10 "gold", race=dwarf -> "Yeah. I knew that you'd ask. Little dwarfie..." "gold" -> "Are you a dwarf or what?" "dogs", chance(30) -> "I love dogs!", queststatus=1 "dogs", chance(50), queststatus<>1 -> "I hate dogs!", queststatus=2 "dogs" -> "Dogs? Should I love or hate them?", queststatus=3 "give rune", rune(mage, 3) -> "You already have that rune!" "give rune" -> "Here you are", rune(mage, 3) "heal", attrib(hitpoints)<1000 -> "Oh, you look wounded.", attrib(hitpoints)+5000 "heal" -> "You don't look like you'd be dead anytime soon." "albar", fraction(albar)>1000 -> "You're a friend of mine and a friend of Albar!", fraction(albar)+5 "albar" -> "You're probably not a friend fo Albar." cycletext "#me schüttelt den Kopf", "#me shakes his head" 5. Common Mistakes and hints: * Please don't use " inside of a text, like "Say "hi" to me". Instead, use ' ("Say 'hi' t me"). * Check/ask whether QuestID was set for your NPC if it doesn't work on the server! * Don't use tabs. Use spaces instead! * Please strictly use the syntax given! * Note that state will be saved for every NPC for every character until the next full reload or server restart! * The script will search for the first condition matching a spoken text and stop searching then. So, if you put "hi" in front of "hilfe" and someone says "hilfe", it will react with the consequence part of "hi". Therefore, place the trigger for "hi" BELOW the one of "hilfe" and so on. * "A B" will match "Asssss boring" and "aaalong bern" and "a b". It will neither match "ab" nor "ba"! * If not mentioned otherwise, conditions/consequences may appear more than one time within an action (for example checking for several different items or setting several skills). * You can check your script here: http://illarion.org/development/de_scripts.php If red lines appear, it is likely that you made a mistake there! * "Action" refers to "condition1, condition2, ... -> consequence1, consequence2, ...". An action must always be written in a line. * comments start with --