doc/script_commands.txt | 1620 ++++++++++++++++++++++++----------------------- 1 file changed, 825 insertions(+), 795 deletions(-) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 767aa54..7eaaa71 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -28,30 +28,57 @@ help. A little learning never caused anyone's head to explode. -Structure ---------- - -The commands and functions are listed in no particular order: - -*Name of the command and how to call it. - -Descriptive text - - Small example if possible. Will usually be incomplete, it's there just - to give you an idea of how it works in practice. -To find a specific command, use Ctrl+F, (or whatever keys call up a search -function in whatever you're reading this with) put an * followed by the -command name, and it should find the command description for you. +Structure and Table of Contents +------------------------------- +(*TableContents) + +The structure of the document is below. Also, a unique code has been put +in each section so that you can easily find it with Ctrl+F (or whatever +keys call up a search function in whatever you're reading this with). +There will be only 2 coincidences when using these codes: this very Table +of Contents and that section in particular, so the search function should +find whatever you want right away. Only section without search code is the +headers and introduction above. + +Search codes are preceded by an asterisk (*). + +If you find anything omitted througout all the document, please tell us. + +Table of Contents: + +1. Headers and introduction ( - ) +2. Structure and Table of Contents (*TableContents) +3. Understanding this document (*UnderstandThis) +4. Script loading structure (*LoadingScripts) +5. Top level commands (*TopLevel) + 1. Warning about NPC names (*NPCNameWarning) + 2. Setting map flags (*TopMapflag) + 3. Creating a permanent monster spawn (*TopMonster) + (*TopBossMonster) + 4. Defining a warp point (*TopWarp) + 5. Defining NPC objects (scripts) (*TopScript) + 6. Placing shops or cashshops (*TopShop) + (*TopCashShop) + 7. Adding duplicates (*TopDuplicate) + 1. Adding warp duplicates (*TopDuplicateWarp) + 2. Adding script duplicates (*TopDuplicateScript) + 3. Adding shop or cashshop duplicates (*TopDuplicateShop) + (*TopDuplicateCashShop) + 8. Defining function objects (*TopFunction) -If you find anything omitted, please tell us. :) + + + -Syntax ------- + +Understanding this document +--------------------------- +(*UnderstandThis) Throughout this document, wherever a command wants an argument, it is given in . This doesn't mean you should type the angle -brackets. :) If an argument of a command is optional, it is given in +brackets. If an argument of a command is optional, it is given in {curly brackets}. You've doubtlessly seen this convention somewhere, if you didn't, get used to it, that's how big boys do it. If a command can optionally take an unspecified number of arguments, you'll see a list like @@ -67,24 +94,41 @@ expression, like a bunch of functions or operators returning a value, in (round brackets) instead of most numbers. Round brackets will not always be required, but they're often a good idea. -Wherever you refer to a map, use 'mapname' instead of 'mapname.gat'. +The top level commands need the use of tabulation spaces so, for +preventing problems and confusion, the tab symbols are written as '%TAB%' +or '' throughout this document, even though this makes the text a bit +less readable. Using an invisible symbol to denote arguments is one of the +bad things about this language, but we're stuck with it for now. +Wherever you refer to a map, use 'mapname' instead of 'mapname.gat'. +However, old scripts that keep the .gat will still work. Script loading structure ------------------------ +(*LoadingScripts) + +As an exception to the just above section, the only parameter these +instructions take is a string that shouldn't be enclosed between quotes. + +Map server automatically loads any available scripts that are referenced +in the 'npc/re/scripts_main.conf' file for Renewal enabled servers or in +the 'npc/pre-re/scripts_main.conf' file for Pre-Renewal servers. This file +itself contains references to other files, just like this: -Scripts are loaded by the map server as referenced in the -'conf/map-server.conf' configuration file, but in the default -configuration, it doesn't load any script files itself. Instead, it loads -the file 'npc/scripts_main.conf' which itself contains references to other -files. The actual scripts are loaded from txt files, which are linked up -like this: +import: + +This will make the map server look on the specified filename for more file +references or npc loading sentences, which are covered next. Nothing nice +happens when you try to import the same file recursively or in a loop. + +The actual scripts are loaded from text files, which are linked up like +this: npc: -Any line like this, invoked, ultimately, by 'map-server.conf' will load up -the script contained in this file, which will make the script available. -No file will get loaded twice, to prevent possible errors. +Any line like this will load up the script contained in this file, which +will make the script available. No file will get loaded twice, to prevent +possible errors. Another configuration file option of relevance is: @@ -93,241 +137,569 @@ delnpc: This will unload a specified script filename from memory, which, while seemingly useless, may sometimes be required. -Whenever '//' is encountered in a line upon reading, everything beyond -this on that line is considered to be a comment and is ignored. This works -wherever you place it. - -// This line will be ignored when processing the script. +File extensions don't matter when messing with these ones as long as you +provide the correct file extension the files have themselves. This means +you can save your scripts in .c extension if you want, so that you'll have +some C syntax highlighting (which is quite similar to the scripts we have +here) if you use some adequate text editors. Saving them in .txt is just +a convention we follow. -Block comments can also be used, where you can place /* and */ between any -text you wish Hercules to ignore. - -Example: -/* This text, - * no matter which new line you start - * is ignored, until the following - * symbol is encountered: */ - -The asterisks (*) in front of each line is a personal preference, and is -not required. +Top Level Commands +------------------ +(*TopLevel) Upon loading all the files, the server will execute all the top-level commands in them. No variables exist yet at this point, no commands can be called other than those given in this section. These commands set up the basic server script structure - create NPC objects, spawn monster objects, set map flags, etc. No code is actually executed at this point except -them. The top-level commands the scripting are pretty confusing, since +them. + +The top-level commands the scripting are pretty confusing, since they aren't structured like you would expect commands, command name first, but rather, normally start with a map name. What's more confusing about the top-level commands is that most of them -use a tab symbol to divide their arguments. - -To prevent problems and confusion, the tab symbols are written as '%TAB%' -or '' throughout this document, even though this makes the text a bit -less readable. Using an invisible symbol to denote arguments is one of the -bad things about this language, but we're stuck with it for now. :) +use a tab symbol to divide their arguments. Remember that the tab symbols +are written as '%TAB%' or '' throughout this document. Here is a list of valid top-level commands: +* mapflag +* monster +* boss_monster +* warp +* script +* shop +* cashshop +* duplicate +* function -** Set a map flag: - -%TAB%mapflag%TAB% +They'll be explained like this: -This will, upon loading, set a specified map flag on a map you like. These -are normally in files inside 'npc/mapflag' and are loaded first, so by the -time the server's up, all the maps have the flags they should have. Map -flags determine the behavior of the map regarding various common problems, -for a better explanation, see 'setmapflag'. +Top level command and how to call it, with full list of parameters. -** Create a permanent monster spawn: +-> Description: + Short descriptive text about what it does. +-> Parameters: + Any required or optional parameters it needs for working. Some + parameters will be explained together since it'll make for a better + explanation like this. +-> Notes: + Notes about it. It'll be only present if needed. +-> Examples: + Small example(s) so that you can get familiar with it. -,,,,%TAB%monster%TAB%%TAB%,,,,{,,} -Map name is the name of the map the monsters will spawn on. X,Y are the -coordinates where the mob should spawn. If X's and Y's are non-zero, they -specify the 'radius' of a spawn-rectangle area centered at x,y. Putting -zeros instead of these coordinates will spawn the monsters randomly. Note -this is only the initial spawn zone, as mobs random-walk, they are free to -move away from their specified spawn region. +But let's start with a warning about NPC names first: -Monster name is the name the monsters will have on screen, and has no -relation whatsoever to their names anywhere else. It's the mob id that -counts, which identifies monster record in 'mob_db.txt' database of -monsters. If the mob name is given as "--ja--", the 'japanese name' field -from the monster database is used, (which, in Hercules, actually contains -an English name) if it's "--en--", it's the 'english name' from the -monster database (which contains an uppercase name used to summon the -monster with a GM command). +### Warning about NPC names ### +(*NPCNameWarning) -Amount is the amount of monsters that will be spawned when this command is -executed, it is affected by spawn rates in 'battle.conf'. - -Delay1 and delay2 control monster respawn delays - the first one is the -fixed base respawn time, and the second is random variance on top of the -base time. Both values are given in milliseconds (1000 = 1 second). Note -that the server also enforces a minimum respawn delay of 5 seconds. - -You can specify a custom level to use for the mob different from the one -of the database by adjoining the level after the name with a comma. eg: -"Poring,50" for a name will spawn a monster with name Poring and level 50. - -Event is a script event to be executed when the mob is killed. The event -must be in the form "NPCName::OnEventName" to execute, and the event name -label should start with "On". As with all events, if the NPC is an -on-touch NPC, the player who triggers the script must be within 'trigger' -range for the event to work. - -There are two optional fields for monster size and AI. Size can be 0 -(medium), 1 (small), or 2 (big). AI can be 0 (default), 1 -(attack/friendly), 2 (sphere), 3 (flora), or 4 (zanzou). - -Alternately, a monster spawned using 'boss_monster' instead of 'monster' is able to be -detected on the map with the SC_CASH_BOSS_ALARM status (used by Convex Mirror, item ID# 12214). - -** NPC names - -/!\ WARNING: this applies to warps, NPCs, duplicates and shops /!\ - -NPC names are kinda special and are formatted this way: +This applies to warps, NPCs, duplicates and shops, since they are the only +scripts with a name. Their names are kinda special and are formatted this +way: {::} -All NPCs need to have a unique name that is used for identification -purposes. When you have to identify a NPC by it's name, you should use -. If is not provided, use -instead. - -The client has a special feature when displaying names: if the display -name contains a '#' character, it hides that part of the name. -Ex: if your NPC is named 'Hunter#hunter1', it will be displayed as 'Hunter' +All of them need to have a name that should be unique for identification +purposes. The NPC name used for identification is its or, if +it isn't provided, they are identified by their instead. +Remember: must be at most 24 characters in length. must be at most 24 characters in length. -** Define a warp point +Any name too long for a NPC will just be truncated. + +Also, the client has a special feature when displaying names: if the +display name contains a '#' character, it hides the rest of the name, +starting from that '#'. Keep in mind that character also counts +towards the limit. + +Examples with NPC names: + +Original NPC name | Displayed name | NPC identification name +---------------------------------------------------------------------------- +MyNPCName | MyNPCName | MyNPCname +---------------------------------------------------------------------------- +Hunter#hunter1 | Hunter | Hunter#hunter1 +---------------------------------------------------------------------------- +ThisNameIsTooLongForANPC | ThisNameisTooLongForANP | ThisNameisTooLongForANP +---------------------------------------------------------------------------- +#hiddenName | (no displayed name) | #hiddenName +---------------------------------------------------------------------------- +NPCName#91::MyUniqueName | NPCName | MyUniqueName +---------------------------------------------------------------------------- + +And one last thing about it: avoid putting the same identification names +to NPCs (and truncated NPC names if applicable). Map server will warn you +and automatically set or change their unique name in this fashion: + +___ + +For more details about this, please refer to the particular sections of +the respective top level commands. + +### Setting map flags ### +(*TopMapflag) + +%TAB%mapflag%TAB%{%TAB} + +-> Description: + When loaded, this will set the specified map flag on the selected map, + which will change the behavior of the map depending on the mapflag you + set. They're normally in files inside 'npc/mapflag', but you can also + see them on the same file as other scripts too. +-> Parameters: + * map name: The name of the map you'll use to load the mapflag; + * mapflag: Keep it as is, this is the top level command; + * flag: the mapflag you'll load on the specified map. You can see a + list of the available map flags in 'db/const.txt' with the 'mf_' + prefix. You must __NOT__ copy the 'mf_' prefix as it's required + on the 'setmapflag' script command. + * optional parameter: For most map flags you can send them 'off' to + disable them. Some others may require this parameter (or even + more than one parameter separated with commas as it's the case of + the mf_nightmaredrop map flag). The type of optional parameter + also depends on the nature of the map flag you're setting. +-> Notes: Not all map flags can be deactivated with the 'off' optional + parameter. Also some mapflags may not work if you don't provide them + the mapflag they require. You can also set map flags inside a script + by using the 'setmapflag' script command. +-> Examples: + * Setting Prontera as PvP map: + prontera%TAB%mapflag%TAB%pvp + * Removing the GvG mapflag from guild_vs2: + guild_vs2%TAB%mapflag%TAB%gvg%TAB%off + * Changing the base exp you get on pay_fild04 to 2.50x (250): + pay_fild02%TAB%mapflag%TAB%bexp%TAB%250 + * Making aldeg_cas01 castle have a random nightmare drop of + equipment of 70%: + aldeg_cas01%TAB%mapflag%TAB%nightmaredrop%TAB%random,equip,7000 + + +### Creating a permanent monster spawn ### +(*TopMonster) +(*TopBossMonster) + +,,{,{,}}%TAB%monster%TAB%{,}%TAB%,{,{,{,{,,{}}}}} +,,{,{,}}%TAB%boss_monster%TAB%{,}%TAB%,{,{,{,{,{,}}}}} + +-> Description: + When parsed, this will make a permanent mob spawn (until server reboot + or script reload) with the specified characteristics. +-> Parameters: + * map name: The map name in which the monster(s) will be spawned. + * x,y: They are the x and y coordinates on the specified map, in + which the monsters will be spawned or the center of the spawn + rectangle if xs or ys are greater than 0. If both x and y are 0, + the monsters will be spawned on a random position of the map. Be + warned that mobs walk around randomly, so that they may eventually + walk over the entire map as long as there's a walkable path! + * xs,ys: They are the horizontal and vertical span (ie, width and + height) of a spawn rectangle centered in x,y. Think of this as the + amount of squares you'd like to have your monster(s) spawned from + the center to both sides. For example, if xs is 6 and ys is 1, the + result would be a 6+1+6 width by 1+1+1 height spawn rectangle: + ------------- + | C | + ------------- + where that C is the center of that spawn rectangle. Even if both + of them are optional, you'd better set them together + * monster: __Mutually excluyent with boss_monster__. Specifies the + parser to spawn regular monsters with no special treatment. + * boss_monster: __Mutually excluyent with monster__. Specifies the + parser to spawn special monsters (usually MvPs) which can be + detected by the SC_CASH_BOSS_ALARM status (Convex Mirror). Please + note this will __not__ mark the mob as boss-type. + * monster name: The name the monsters will use, at your choice, + with a max of 24 characters by default. You could use some special + names as "--ja--", which will use the 'japanese name' of its + record in the monster database (that is, in fact, an English name) + or "--en--", which will use its 'english name' (that is that same + name in uppercase). + * mob level: If specified, spawned monsters will forcely be this + level, but they won't get any status changed other than this one. + * mob id: The actual mob id of the monsters you'll be spawning from + the mob db. + * amount: The amount of monsters you want to spawn. It's affected by + the mob_count_rate configuration in conf/battle/monster.conf + * delay 1: Minimum time, in milliseconds (1000 = 1 second) that, + after killing a monster from this respawn, the server will take to + spawn that monster again. This is known as base respawn time. + * delay 2: Random time, from 0 to this value (in milliseconds), that + will be added on top of the base respawn time to respawn a dead + monster from this respawn. Server always enforces a minimum of a + total 5000 milliseconds before respawning a mob. + * event: An NPC name and event to be executed on every death of any + of the spawned monsters (and, if an user has killed that mob, the + event will be executed attached to that user). The event must be + in the form "NPCName::OnEventName" for being executed, and the + event name label should start with "On". If you don't want to + execute any event, just set this value to 0 or 1. For more + information about labels, please see the 'Labels' section. + * mob size: This optional parameter will determine the size of the + summoned monsters on the spawn. Set it to 0 if you don't want to + alter the monster's size, 1 if you want them to be small and 2 if + you want to make the monsters big. Formerly, a summoned monster + with altered size had its stats, drop rates and experience doubled + on size = 2, or halved if size = 1, but now it's disabled by + default. You can enable this feature if you want by changing the + mob_size_influence configuration in conf/battle/monster.conf + * mob ai: The special AI the mob will have. It's not like the one + you set in the mob db, but a special extra behavior you may want + to set. 0 means no special behavior; 1 means the spawned monsters + will attack other monsters; 2 makes their behavior as if summoned + by Alchemist's Marine Sphere skill; 3 makes them behave as if + summoned by Alchemist's Summon Flora and 4 makes them behave as if + summoned as from Kagerou/Oboro's Zanzou skill. +-> Notes: + Please note that by using this you'll make a __permanent__ monster + spawn, there's no way of unloading them from the server unless you + reboot or issue @reloadscript. If you want to make a mob spawn for + once or limited times, please refer to the 'monster' and 'areamonster' + script commands. Also note that if you want to put an optional + parameter and there are some others before, you'll have to fill the + ones before (mostly with zeros). +-> Examples: + * Spawn a shining plant (ID# 1083) with its default name on prontera, + x=150, y=170 that will respawn every 5s (minimum default): + prontera,150,170%TAB%monster%TAB%--ja--%TAB%1083,1 + * Spawn 10 boss level 99 porings (ID# 1002) named Satan Morroc at a + random place on prontera, which will respawn around 1~1:30 hours + after being killed (from 3600000 to 5400000 ms): + prontera,0,0%TAB%monster%TAB%Satan Morroc,99%TAB%1002,10,3600000,1800000 + * Spawn 4 big Poporing on a 3x4 square around prontera,150,170, + which will attack other mobs and trigger the 'OnMyPopoDie' label + from 'MyNPCName' when killed (default respawn time): + prontera,150,170,3,4%TAB%monster%TAB%Poporing%TAB%1031,4,0,0,"MyNPCName::OnMyPopoDie",2,1 + + +### Defining a warp point ### +(*TopWarp) ,,{,}%TAB%warp%TAB%%TAB%,,,, -This will define a warp NPC that will warp a player between maps, and -while most arguments of that are obvious, some deserve special mention. - -SpanX and SpanY will make the warp sensitive to a character who didn't -step directly on it, but walked into a zone which is centered on the warp -from coordinates and is SpanX in each direction across the X axis and -SpanY in each direction across the Y axis. - -Warp NPC objects also have a name, because you can use it to refer to them -later with 'enablenpc'/'disablenpc'. - -Facing of a warp object is irrelevant, it is not used in the code and all -current scripts have a zero in there. - -** Define an NPC object. - +-> Description: + When parsed, this will make a warp NPC with its respective sprite, + that will warp users when they enter on their area of effect. They're + mostly used to connect all of the maps throughout Hercules. +-> Parameters: + * from map name: The map name the warp npc will appear in. + * fromX,fromY: The x,y coordinates in which the warp NPC will be + placed. + * facing: Just an optional and useless parameter. All current warps + have a 0 in there, since warp NPCs have no orientations. + * warp: This tells the parser to parse a warp. Mandatory. + * warp name: The name of the warp so that you can manipulate it via + scripting for example with 'enablenpc', 'disablenpc' or 'movenpc' + script commands. + * spanx, spany: They are, respectively, the horizontal and vertical + span of the area of effect the warp will have. Their typical + values are 1, so that the warp area of effect will span througout + all of the NPC sprite (9 squares total). + * to map name: The destination map name the warp will send users to. + * toX, toY: The map coordinates the users will be sent to. +-> Notes: + You can unload these warps by kicking them using the GM context menu + ingame (right clicking them while having a GM sprite set by the + clientinfo file). +-> Examples: + * Current Hercules warp, from the south of Prontera to the fields: + prontera,156,22,0%TAB%warp%TAB%prt001%TAB%3,2,prt_fild08,170,375 + * Same version of that warp without the deprecated facing parameter: + prontera,156,22%TAB%warp%TAB%prt001%TAB%3,2,prt_fild08,170,375 + + +### Defining NPC objects (scripts) ### +(*TopScript) + +Three different ways: ,,,%TAB%script%TAB%%TAB%,{} ,,,%TAB%script%TAB%%TAB%,,,{} - -This will place an NPC object on a specified map at the specified -location, and is a top-level command you will use the most in your custom -scripting. The NPCs are triggered by clicking on them, and/or by walking -in their trigger area, if defined. See that below. - -Facing is a direction the NPC sprite will face in. Not all NPC sprites -have different images depending on the direction you look from, so for -some facing will be meaningless. Facings are counted counterclockwise in -increments of 45 degrees, where 0 means facing towards the top of the map. -(So to turn the sprite towards the bottom of the map, you use facing 4, -and to make it look southeast it's facing 5.) - -Sprite id is the sprite number used to display this particular NPC. For a -full list of sprite id numbers see http://kalen.s79.xrea.com/npc/npce.shtml -You may also use a monster's ID number instead to display a monster sprite -for this NPC. It is possible to use a job sprite as well, but you must -first define it as a monster sprite in 'mob_avail.txt', a full description -on how to do this is not in the scope of this manual. -A '-1' sprite id will make the NPC invisible (and unclickable). -A '111' sprite id will make an NPC which does not have a sprite, but is -still clickable, which is useful if you want to make a clickable object of -the 3D terrain. - -TriggerX and triggerY, if given, will define an area, centered on NPC and -spanning triggerX cells in every direction across X and triggerY in every -direction across Y. Walking into that area will trigger the NPC. If no -'OnTouch:' special label is present in the NPC code, the execution will -start from the beginning of the script, otherwise, it will start from the -'OnTouch:' label. Monsters can also trigger the NPC, though the label -'OnTouchNPC:' is used in this case. - -The code part is the script code that will execute whenever the NPC is -triggered. It may contain commands and function calls, descriptions of -which compose most of this document. It has to be in curly brackets, -unlike elsewhere where we use curly brackets, these do NOT signify an -optional parameter. - -** Define a 'floating' NPC object. - -%TAB%script%TAB%%TAB%-1,{} -This will define an NPC object not triggerable by normal means. This would -normally mean it's pointless since it can't do anything, but there are -exceptions, mostly related to running scripts at specified time, which is -what these floating NPC objects are for. More on that below. +IMPORTANT NOTE: We have decided to put all possibilities here instead of +just showing that triggerX and triggerY are optional parameters since, as +an exception to general notation rule on this document, __curly brackets +around the code are required for your NPC to work__. + +-> Description: + This will place a NPC object on the specified place (except the last + one, that will make a 'floating' NPC that won't be on any specific + map), which are usually triggered by being clicked, but you can make + them get triggered some other ways such as being whispered or at + certain times of a day. Once triggered, they'll run part or all of the + code that has been written on it, depending on how you triggered it. +-> Parameters: + * map name: The map name the NPC will be put in. Must be valid. + * x,y: The x and y coordinates to place the NPC at. You can safely + put the NPC on a non walkable cell if you want, as long as it's + inside of the map. + * facing: The direction the NPC will be facing in. Not all sprites + have an image for each of the directions, so this value can be + useless if you use sprites without different images for the + directions. Its range is between 0 and 7. 0 means the NPC is + looking north, then sum in incrementes of 45 degrees for each + number. For example: 2 means the NPC is facing west, 4 means it's + facing south and 5 means he's facing southeast. + * script: Required for this to be parsed as a script. + * NPC name: The name the NPC will have. Please take a look at the + previous name warning to prevent problems with them. + * sprite id: The sprite number used to display the NPC. You can also + use a monster ID as sprite ID to display a monster's sprite, or + even use a job sprite if you previously define it in the + 'db/mob_avail.txt' file. Interesting sprite IDs could be 45 (a + warp NPC sprite, for making warps via NPC scripts); 111, which is + an invisible yet clickable NPC sprite (you can use it to make + clickable objects on the map 3D land); and -1, which is an + invisible and unclickable NPC sprite, mostly to be used with + floating NPCs (they'll be further explained on the notes). + For an full and updated NPC list with IDs, please check this URL: + http://nn.nachtwolke.com/dev/npclist/ + Note that you can actually set other sprite than 1 for floating + NPCs, but that'll be an useless assignment since nobody will be + ever able to see them. + * triggerX,triggerY: They are the trigger span area of the NPC. If + set (they're optional), this defines the horizontal and vertical + squares (from both sides) in which you can 'touch' this NPC. This + will also trigger the 'OnTouch:' or 'OnTouch_:' labels from + the NPC if present (if the NPC doesn't have it, the script will + run from the start). You could also make part of the NPC to run + when 'touched' by monsters if you make use of the 'OnTouchNPC:' + label. Please refer to the 'Labels' section for more information. + * code: The script code which the NPC will actually run when + triggered. Most of this document is composed of these script + commands descriptions. Please remember that the curly brackets are + mandatory here. +-> Notes: + In case the NPC is 'touchable' and its code has both an 'OnTouch:' and + an 'OnTouch_:' label, only the 'OnTouch_:' label will be triggered; + You can make the NPC a 'floating' NPC if you put only a - (dash) as + the four first parameters. These NPCs can't be triggered by being + clicked or touched, but you may make them react to whispers or some + other events as if a player actually clicked it. Or you can even make + them work as an automated script, without the need of being activated + by someone. This will be explained later on, in more detail. +-> Examples (without any code, since you don't know yet): + * A NPC in prontera, 156,200 with the sprite from the priest inside + Prontera church (60), named 'Pater Nostrum', looking southeast: + prontera,156,200,5%TAB%script%TAB%Pater Nostrum%TAB%60,{} + * Same NPC, but this time looking east (to the right) and can be + triggered on touch on a rectangle up to 2 cells from left or right + and up to 3 cells from up or down: + prontera,156,200,6%TAB%script%TAB%Pater Nostrum%TAB%60,2,3,{} + * A floating NPC named MyHiddenNPC: + -%TAB%script%TAB%MyHiddenNPC%TAB%-1,{} + + +### Placing shops or cashshops ### +*TopShop +*TopCashShop ** Define a shop/cashshop NPC. --%TAB%shop%TAB%%TAB%,:{,:...} +Two different ways: ,,,%TAB%shop%TAB%%TAB%,:{,:...} - -This will define a shop NPC, which, when triggered (which can only be done -by clicking) will cause a shop window to come up. No code whatsoever runs -in shop NPCs and you can't change the prices otherwise than by editing the -script itself (no variables even exist at this point of scripting, so -don't even bother trying to use them). - -The item id is the number of item in the 'item_db.txt' database. If Price -is set to -1, the 'buy price' given in the item database will be used. -Otherwise, the price you gave will be used for this item, which is how you -create differing prices for items in different shops. - -You can alternatively use "cashshop" in place of "shop" to use the Cash -Shop interface, allowing you to buy items with special points (Currently -stored as account vars in global_reg #CASHPOINTS and #KAFRAPOINTS). This -type of shop will not allow you to sell items at it, you may only purchase -items here. The layout used to define sale items still count, and -"" refers to how many points will be spent purchasing the them. - -** Define an warp/shop/cashshop/NPC duplicate. - -warp: ,,{,}%TAB%duplicate(