· 8 years ago · Feb 28, 2018, 08:18 PM
1f//===== Athena Doc ========================================
2//= SeAthena 腳本指令列表
3//===== Description =======================================
4//= 腳本指令列表
5//===== Version ===========================================
6//= 1.0.20090807
7//=========================================================
8//= 1.0 - 標準化文檔,整åˆSeA [Inkfish]
9//=========================================================
10
11目錄:
12
130.- 基礎知è˜
141.- 基本指令.
152.- ä¿¡æ¯ç²å–類指令.
163.- 檢查類指令.
174.- 玩家相關之類.
185.- é”物相關指令.
196.- 其他指令. (已漢化)
207.- 副本系統指令.
218.- 任務系統指令. (已漢化)
229.- æˆ°å ´æŒ‡ä»¤
2310.- å‚兵指令.
2411.- SeA指令. (已漢化)
25
26=====================
27|0.- 基 礎 知 è˜.|
28=====================
29
30è…³æœ¬åŠ è¼‰
31------------------------
32
33將腳本路徑è¨ç½®åœ¨ 'conf/map_athena.conf' 以被地圖æœå‹™å™¨åŠ è¼‰ï¼Œæˆ–ä»»ä½•è¢«å…¶åŠ è¼‰çš„.conf
34文件,如 'npc/scripts_main.conf'.
35æ ¼å¼å¦‚下:
36
37npc: <path to a filename>
38
39Any line like this, invoked, ultimately, by 'map_athena.conf' will load up the
40script contained in this file, which will make the script available. No file
41will get loaded twice, to prevent possible errors.
42
43Another configuration file option of relevance is:
44
45delnpc: <path to a filename>
46
47This will unload a specified script filename from memory, which, while
48seemingly useless, may sometimes be required.
49
50Whenever '//' is encountered in a line upon reading, everything beyond this on
51that line is considered to be a comment and is ignored. This works wherever you
52place it.
53
54Upon loading all the files, the server will execute all the top-level commands
55in them. No variables exist yet at this point, no commands can be called other
56than those given in this section. These commands set up the basic server script
57structure - create NPC objects, spawn monster objects, set map flags, etc. No
58code is actually executed at this point except them. The top-level commands the
59scripting are pretty confusing, since they aren't structured like you would
60expect commands, command name first, but rather, normally start with a map name.
61
62What's more confusing about the top-level commands is that most of them use a
63tab symbol to divide their arguments.
64
65To prevent problems and confusion, the tab symbols are written as '%TAB%'
66throughout this document, even though this makes the text a bit less readable.
67Using an invisible symbol to denote arguments is one of the bad things about
68this language, but we're stuck with it for now. :)
69
70é ‚ç´šæŒ‡ä»¤åˆ—è¡¨:
71
72** è¨ç½®åœ°åœ–標籤:
73
74<map name>%TAB%mapflag%TAB%<flag>
75
76This will, upon loading, set a specified map flag on a map you like. These are
77normally in files inside 'conf/mapflag' and are loaded first, so by the time the
78server's up, all the maps have the flags they should have. Map flags determine
79the behavior of the map regarding various common problems, for a better
80explanation, see 'setmapflag'.
81
82** 創建å¯é‡ç”Ÿé”物:
83
84<地圖å>,<x>,<y>,<xs>,<ys>%TAB%monster%TAB%<é”物åå—>{,<é”物ç‰ç´š>}%TAB%<é”物ID>,<數é‡>,<å»¶é²1>,<å»¶é²2>,<事件>{,<大å°>,<é”物ai>}
85
86Map name is the name of the map the monsters will spawn on. x,y are the
87coordinates where the mob should spawn. If xs and ys are non-zero, they
88specify the diameters of a spawn-rectangle area who's center is x,y.
89Putting zeros instead of these coordinates will spawn the monsters randomly.
90Note this is only the initial spawn zone, as mobs random-walk, they are free
91to move away from their specified spawn region.
92
93Monster name is the name the monsters will have on screen, and has no relation
94whatsoever to their names anywhere else. It's the mob id that counts, which
95identifies monster record in 'mob_db.txt' database of monsters. If the mob name
96is given as "--ja--", the 'japanese name' field from the monster database is
97used, (which, in eAthena, actually contains an english name) if it's "--en--",
98it's the 'english name' from the monster database (which contains an uppercase
99name used to summon the monster with a GM command).
100
101If you add 20000 to the monster ID, the monster will be spawned in a 'big
102version', (monster size class will increase) and if you add 10000, the 'tiny
103version' of the monster will be created. However, this method is deprecated
104and not recommended, as the values to add can change at a later time (20000
105and 10000 actually stand for 2*MAX_MOB_DB and MAX_MOB_DB respectively, which
106is defined on mob.h, and can change in the future as more mobs are created).
107The recommended way to change a mob's size is to use the event-field (see
108below).
109
110Amount is the amount of monsters that will be spawned when this command is
111executed, it is affected by spawn rates in 'battle_athena.conf'.
112
113Delay1 and delay2 are the monster respawn delays - the first one counts the time
114since a monster defined in this spawn was last respawned and the second one
115counts the time since the monster of this spawn was last killed. Whichever turns
116out to be higher will be used. If the resulting number is smaller than a random
117value between 5 and 10 seconds, this value will be used instead. (Which is
118normally the case if both delay values are zero.) The times are given in
1191/1000ths of a second.
120
121You can specify a custom level to use for the mob different from the one of
122the database by adjoining the level after the name with a comma. eg:
123"Poring,50" for a name will spawn a monster with name Poring and level 50.
124
125Event is a script event to be executed when the mob is killed. The event must
126be in the form "NPCName::OnEventName" to execute, and the event name label
127should start with "On". As with all events, if the NPC is an on-touch NPC, the
128player who triggers the script must be within 'trigger' range for the event to
129work.
130
131The Event field can be used alternatively to specify other mob properties. Use
1322 to specify that the mob should be small, 4 for big monsters, and 8 for
133special ai mobs (which by default attack other monsters instead of players).
134You can add these, so using 10 will spawn small monsters that attack other
135mobs (if you specify both 2 and 4, the small version takes priority).
136
137** NPCåå—
138
139/!\ WARNING: this applies to warps, NPCs, duplicates and shops /!\
140
141NPC names are kinda special and are formatted this way:
142
143<Display name>{::<Unique name>}
144
145All NPCs need to have a unique name that is used for identification purposes.
146When you have to identify a NPC by it's name, you should use <Unique name>.
147If <Unique name> is not provided, use <Display name> instead.
148
149The client has a special feature when displaying names:
150if the display name contains a '#' character, it hides that part of the name.
151ex: if your NPC is named 'Hunter#hunter1', it will be displayed as 'Hunter'
152
153<Display name> must be at most 24 characters in length.
154<Unique name> must be at most 24 characters in length.
155
156** 定義傳é€é»ž
157
158<from map name>,<fromX>,<fromY>,<facing>%TAB%warp%TAB%<warp name>%TAB%<spanx>,<spany>,<to map name>,<toX>,<toY>
159
160This will define a warp NPC that will warp a player between maps, and while most
161arguments of that are obvious, some deserve special mention.
162
163SpanX and SpanY will make the warp sensitive to a character who didn't step
164directly on it, but walked into a zone which is centered on the warp from
165coordinates and is SpanX in each direction across the X axis and SpanY in each
166direction across the Y axis.
167
168Warp NPC objects also have a name, because you can use it to refer to them later
169with 'enablenpc'/'disablenpc'
170
171Facing of a warp object is irrelevant, it is not used in the code and all
172current scripts have a zero in there.
173
174** 創建NPC
175
176<map name>,<x>,<y>,<facing>%TAB%script%TAB%<NPC Name>%TAB%<sprite id>,{<code>}
177<map name>,<x>,<y>,<facing>%TAB%script%TAB%<NPC Name>%TAB%<sprite id>,<triggerX>,<triggerY>,{<code>}
178
179This will place an NPC object on a specified map at the specified location, and
180is a top-level command you will use the most in your custom scripting. The NPCs
181are triggered by clicking on them, and/or by walking in their trigger area, if
182defined, see that below.
183
184Facing is a direction the NPC sprite will face in. Not all NPC sprites have
185different images depending on the direction you look from, so for some facing
186will be meaningless. Facings are counted counterclockwise in increments of 45
187degrees, where 0 means facing towards the top of the map. (So to turn the sprite
188towards the bottom of the map, you use facing 4, and to make it look southeast
189it's facing 5.)
190
191Sprite id is the sprite number used to display this particular NPC. For a full
192list of sprite id numbers see http://kalen.s79.xrea.com/npc/npce.shtml You may
193also use a monster's ID number instead to display a monster sprite for this NPC.
194It is possible to use a job sprite as well, but you must first define it as a
195monster sprite in 'mob_avail.txt', a full description on how to do this is not
196in the scope of this manual.
197A '-1' sprite id will make the NPC invisible (and unclickable).
198A '111' sprite id will make an NPC which does not have a sprite, but is still
199clickable, which is useful if you want to make a clickable object of the 3D
200terrain.
201
202TriggerX and triggerY, if given, will define an area, centered on NPC and
203spanning triggerX cells in every direction across X and triggerY in every
204direction across Y. Walking into that area will trigger the NPC. If no
205'OnTouch:' special label is present in the NPC code, the execution will start
206from the beginning of the script, otherwise, it will start from the 'OnTouch:'
207label. Monsters can also trigger the NPC, though the label 'OnTouchNPC:' is
208used in this case.
209
210The code part is the script code that will execute whenever the NPC is
211triggered. It may contain commands and function calls, descriptions of which
212compose most of this document. It has to be in curly brackets, unlike elsewhere
213where we use curly brackets, these do NOT signify an optional parameter.
214
215** 創建浮動NPC
216
217-%TAB%script%TAB%<NPC Name>%TAB%-1,{<code>}
218
219This will define an NPC object not triggerable by normal means. This would
220normally mean it's pointless since it can't do anything, but there are
221exceptions, mostly related to running scripts at specified time, which is what
222these floating NPC objects are for. More on that below.
223
224** 創建商店
225
226-%TAB%shop%TAB%<NPC Name>%TAB%<sprite id>,<itemid>:<price>{,<itemid>:<price>...}
227<map name>,<x>,<y>,<facing>%TAB%shop%TAB%<NPC Name>%TAB%<sprite id>,<itemid>:<price>{,<itemid>:<price>...}
228
229This will define a shop NPC, which, when triggered (which can only be done by
230clicking) will cause a shop window to come up. No code whatsoever runs in shop
231NPCs and you can't change the prices otherwise than by editing the script
232itself. (No variables even exist at this point of scripting, so don't even
233bother trying to use them.)
234
235The item id is the number of item in the 'item_db.txt' database. If Price is set
236to -1, the 'buy price' given in the item database will be used. Otherwise, the
237price you gave will be used for this item, which is how you create differing
238prices for items in different shops.
239
240Since trunk r12264 you can alternatively use "cashshop" in place of "shop"
241to use the Cash Shop interface, allowing you to buy items with special points
242(Currently stored as account vars in global_reg #CASHPOINTS and #KAFRAPOINTS.)
243This type of shop will not allow you to sell items at it, you may only
244purchase items here. The layout used to define sale items still count, and
245"<price>" refers to how many points will be spent purchasing the them.
246
247** 複製NPC
248
249warp: <map name>,<x>,<y>,<facing>%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<spanx>,<spany>
250shop/cashshop/npc: -%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id>
251shop/cashshop/npc: <map name>,<x>,<y>,<facing>%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id>
252npc: -%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id>,<triggerX>,<triggerY>
253npc: <map name>,<x>,<y>,<facing>%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id>,<triggerX>,<triggerY>
254
255This will duplicate an warp/shop/cashshop/NPC referred to by 'label'.
256Warp duplicates inherit the target location.
257Shop/cashshop duplicates inherit the item list.
258NPC duplicates inherit the script code.
259The rest (name, location, facing, sprite ID, span/trigger area)
260is obtained from the definition of the duplicate (not inherited).
261
262** 定義函數
263
264function%TAB%script%TAB%<function name>%TAB%{<code>}
265
266This will define a function object, callable with the 'callfunc' command (see
267below). This object will load on every map server separately, so you can get at
268it from anywhere. It's not possible to call the code in this object by
269anything other than the 'callfunc' script command.
270
2711.9.24æ›´æ–°ç„¡é ˆä½¿ç”¨callfunc來調用。
272例如:
273function script F_Test { return getarg(0) }
274原來使用callfunc "F_Test",1;
275ç¾å¯ä½¿ç”¨F_Test(1);
276
277The code part is the script code that will execute whenever the function is
278called with 'callfunc'. It has to be in curly brackets, unlike elsewhere where
279we use curly brackets, these do NOT signify an optional parameter.
280
281
282Once an object is defined which has a 'code' field to it's definition, it
283contains script commands which can actually be triggered and executed.
284
285~ RID? GID? ~
286
287What a RID is and why do you need to know
288-----------------------------------------
289
290Most scripting commands and functions will want to request data about a
291character, store variables referenced to that character, send stuff to the
292client connected to that specific character. Whenever a script is invoked by a
293character, it is passed a so-called RID - this is the character ID number of a
294character that caused the code to execute by clicking on it, walking into it's
295OnTouch zone, or otherwise.
296
297If you are only writing common NPCs, you don't need to bother with it. However,
298if you use functions, if you use timers, if you use clock-based script
299activation, you need to be aware of all cases when a script execution can be
300triggered without a RID attached. This will make a lot of commands and functions
301unusable, since they want data from a specific character, want to send stuff to
302a specific client, want to store variables specific to that character, and they
303would not know what character to work on if there's no RID.
304
305Unless you use 'attachrid' to explicitly attach a character to the script first.
306
307Whenever we say 'invoking character', we mean 'the character who's RID is
308attached to the running script. The script function "playerattached" can be
309used to check which is the currently attached player to the script (it will
310return 0 if the there is no player attached or the attached player no longer
311is logged on to the map-server).
312
313But what about GID?
314--- ---- ----- ----
315
316GID stands for the Game ID of something, this can either be the GID obtained
317through mobspawn (mob control commands) or the account ID of a character.
318Another way would be to right click on a mob,
319NPC or char as GM sprited char to view the GID.
320
321This is mostly used for the new version of skill and the mob control commmands
322implemented (but NEVER documented by Lance. Shame on you...).
323
324Item and pet scripts
325--------------------
326
327Each item in the item database has three special fields - Script , OnEquip_Script
328and OnUnequip_Script. The first is script code run every time a character equips the item,
329with the RID of the equipping character. Every time they unequip an item, all
330temporary bonuses given by the script commands are cleared, and all the scripts
331are executed once again to rebuild them. This also happens in several other
332situations (like upon login) but the full list is currently unknown.
333
334OnEquip_Script is a piece of script code run whenever the item is used by a character
335by doubleclicking on it. OnUnequip_Script runs whenever the
336equipment is unequip by a character
337
338Not all script commands work properly in the item scripts. Where commands and
339functions are known to be meant specifically for use in item scripts, they are
340described as such.
341
342Every pet in the pet database has a PetScript field, which determines pet
343behavior. It is invoked wherever a pet of the specified type is spawned.
344(hatched from an egg, or loaded from the char server when a character who had
345that pet following them connects) This may occur in some other situations as
346well. Don't expect anything other than commands definitely marked as usable in
347pet scripts to work in there reliably.
348
349數å—
350-------
351
352Beside the common decimal numbers, which are nothing special whatsoever (though
353do not expect to use fractions, since ALL numbers are integer in this language),
354the script engine also handles hexadecimal numbers, which are otherwise
355identical. Writing a number like '0x<hex digits>' will make it recognized as a
356hexadecimal value. Notice that 0x10 is equal to 16. Also notice that if you try
357to 'mes 0x10' it will print '16'.
358
359This is not used much, but it pays to know about it.
360
361變é‡
362---------
363
364The meat of every programming language is variables - places where you store
365data.
366
367Variables are divided into and uniquely identified by the combination of:
368prefix - determines the scope and extent (or lifetime) of the variable
369name - an identifier consisting of '_' and alphanumeric characters
370postfix - determines the type of the variable: integer or string
371
372Scope can be:
373global - global to all servers
374local - local to the server
375account - attached to the account of the character identified by RID
376character - attached to the character identified by RID
377npc - attached to the NPC
378scope - attached to the scope of the instance
379
380Extent can be:
381permanent - They still exist when the server resets.
382temporary - They cease to exist when the server resets.
383
384Prefix: scope and extent
385nothing - A permanent variable attached to the character, the default variable
386 type. They are stored with all the account data in "save\athena.txt"
387 in TXT versions and in the SQL versions in the `global_reg_value`
388 table using type 3.
389"@" - A temporary variable attached to the character.
390 SVN versions before 2094 revision and RC5 version will also treat
391 'l' as a temporary variable prefix, so beware of having variable
392 names starting with 'l' if you want full backward compatibility.
393"$" - A global permanent variable.
394 They are stored in "save\mapreg.txt" or database table `mapreg`,
395 depending on server type.
396"$@" - A global temporary variable.
397 This is important for scripts which are called with no RID
398 attached, that is, not triggered by a specific character object.
399"." - A NPC variable.
400 They exist in the NPC and disappear when the server restarts or the
401 NPC is reloaded. Can be accessed from inside the NPC or by calling
402 'getvariableofnpc'.
403".@" - A scope variable.
404 They are unique to the instance and scope. Each instance has it's
405 own scope that ends when the script ends. Calling a function with
406 callsub/callfunc starts a new scope, returning from the function
407 ends it. When a scope ends, it's variables are converted to values
408 ('return .@var;' returns a value, not a reference).
409"#" - A permanent local account variable.
410 They are stored with all the account data in "save\accreg.txt" in
411 TXT versions and in the SQL versions in the 'global_reg_value'
412 table using type 2.
413"##" - A permanent global account variable stored by the login server.
414 They are stored in "save\account.txt" and in the SQL versions in the
415 'global_reg_value' table, using type 1. The only difference you will
416 note from normal # variables is when you have multiple char-servers
417 connected to the same login server. The # variables are unique to
418 each char-server, while the ## variables are shared by all these
419 char-servers.
420
421Postfix: integer or string
422nothing - integer variable, can store positive and negative numbers, but only
423 whole numbers (so don't expect to do any fractional math)
424'$' - string variable, can store text
425
426Examples:
427 name - permanent character integer variable
428 name$ - permanent character string variable
429 @name - temporary character integer variable
430 @name$ - temporary character string variable
431 $name - permanent global integer variable
432 $name$ - permanent global string variable
433$@name - temporary global integer variable
434$@name$ - temporary global string variable
435 .name - NPC integer variable
436 .name$ - NPC string variable
437.@name - scope integer variable
438.@name$ - scope string variable
439 #name - permanent local account integer variable
440 #name$ - permanent local account string variable
441##name - permanent global account integer variable
442##name$ - permanent global account string variable
443
444If a variable was never set, it is considered to equal zero for integer
445variables or an empty string ("", nothing between the quotes) for string
446variables. Once you set it to that, the variable is as good as forgotten
447forever, and no trace remains of it even if it was stored with character or
448account data.
449
450Some variables are special, that is, they are already defined for you by the
451scripting engine. You can see the full list somewhere in 'db/const.txt', which
452is a file you should read, since it also allows you to replace lots of numbered
453arguments for many commands with easier to read text. The special variables most
454commonly used are all permanent character-based variables:
455
456StatusPoint - Amount of status points remaining.
457BaseLevel - Current base level
458SkillPoint - Amount of skill points remaining
459Class - Current job
460Upper - 1 if the character is an advanced job class.
461Zeny - Current amount of Zeny
462Sex - Character's gender, 0 if female, 1 if male.
463Weight - The weight the character currently carries.
464MaxWeight - The maximum weight the character can carry.
465JobLevel - Character's job level
466BaseExp - The amount of base experience points the character has.
467 Notice that it's zero (or close) if the character just got a level.
468JobExp - Same for job levels
469NextBaseExp - Amount of experience points needed to reach the next base level.
470NextJobExp - Same for job levels.
471Hp - Current amount of hit points.
472MaxHp - Maximum amount of hit points.
473Sp - Current spell points.
474MaxSp - Maximum amount of spell points.
475BaseJob - This is sneaky, apparently meant for baby class support.
476 This will supposedly equal Job_Acolyte regardless of whether the
477 character is an acolyte or a baby acolyte, for example.
478Karma - The character's karma. Karma system is not fully functional, but
479 this doesn't mean this doesn't work at all. Not tested.
480Manner - The character's manner rating. Becomes negative if the player
481 utters words forbidden through the use of 'manner.txt' client-side
482 file.
483
484While these behave as variables, do not always expect to just set them - it is
485not certain whether this will work for all of them. Whenever there is a command
486or a function to set something, it's usually preferable to use that instead. The
487notable exception is Zeny, which you can and often will address directly -
488setting it will make the character own this number of Zeny.
489If you try to set Zeny to a negative number, the script will be terminated with an error.
490
491å—符串
492-------
493
494To include symbol '"' in a string you should use prefix '\"'
495
496
497數組
498------
499
500Arrays (in eAthena at least) are essentially a set of variables going under the
501same name. You can tell between the specific variables of an array with an
502'array index', a number of a variable in that array:
503
504<variable name>[<array index>]
505
506Variables stored in this way, inside an array, are also called 'array elements'.
507Arrays are specifically useful for storing a set of similar data (like several
508item IDs for example) and then looping through it. You can address any array
509variable as if it was a normal variable:
510
511 set @arrayofnumbers[0],1;
512
513You can also do sneaky things like using a variable (or an expression, or even a
514value from an another array) to get at an array value:
515
516 set @x,100;
517 set @arrayofnumbers[@x],10;
518
519This will make @arrayofnumbers[100] equal to 10.
520
521Notice that index numbering always starts with 0. Arrays cannot hold more than
522128 variables. (So the last one can't have a number higher than 127)
523
524And array indexes probably can't be negative. Nobody tested what happens when
525you try to get a negatively numbered variable from an array, but it's not going
526to be pretty. :)
527
528Arrays can naturally store strings:
529
530@menulines$[0] is the 0th element of the @menulines$ array of strings. Notice
531the '$', normally denoting a string variable, before the square brackets that
532denotes an array index.
533
534Resume of the allowed variable and array scopes
535------ -- --- ------- -------- --- ----- ------
536
537+==========+======+=======+
538|VarType | Norm | Array |
539+==========+======+=======+
540|$Str$ | OK! | OK! |
541+----------+------+-------+
542|$@Str$ | OK! | OK! |
543+----------+------+-------+
544|@Str$ | OK! | OK! |
545+----------+------+-------+
546|#Str$ | OK! | FAIL! |
547+----------+------+-------+
548|Str$ | OK! | FAIL! |
549+----------+------+-------+
550|$Int | OK! | OK! |
551+----------+------+-------+
552|$@Int | OK! | OK! |
553+----------+------+-------+
554|@Int | OK! | OK! |
555+----------+------+-------+
556|#Int | OK! | FAIL! |
557+----------+------+-------+
558|Int | OK! | FAIL! |
559+----------+------+-------+
560|.Str$ | OK! | OK! |
561+----------+------+-------+
562|.Int | OK! | OK! |
563+----------+------+-------+
564|.@Str$ | OK! | OK! |
565+----------+------+-------+
566|.@Int | OK! | OK! |
567+----------+------+-------+
568
569æ“作符
570---------
571
572Operators are things you can do to variables and numbers. They are either the
573common mathematical operations or conditional operators
574
575+ - will add two numbers. If you try to add two strings, the result will be a
576 string glued together at the +. You can add a number to a string, and the
577 result will be a string. No other math operators work with strings.
578- - will subtract two numbers.
579* - will multiply two numbers.
580/ - will divide two numbers. Note that this is an integer division, i.e.
581 7/2 is not equal 3.5, it's equal 3.
582% - will give you the remainder of the division. 7%2 is equal to 1.
583
584There are also conditional operators. This has to do with the conditional
585command 'if' and they are meant to return either 1 if the condition is satisfied
586and 0 if it isn't. (That's what they call 'boolean' variables. 0 means 'False'.
587Anything except the zero is 'True' Odd as it is, -1 and -5 and anything below
588zero will also be True.)
589
590You can compare numbers to each other and you compare strings to each other, but
591you can not compare numbers to strings.
592
593 == - Is true if both sides are equal. For strings, it means they are the same.
594 >= - True if the first value is equal to, or greater than, the second value.
595 <= - True if the first value is equal to, or less than, the second value
596 > - True if the first value greater than the second value
597 < - True if the first value is less than the second value
598 != - True if the first value IS NOT equal to the second one
599
600Examples:
601
602 1==1 is True.
603 1<2 is True while 1>2 is False.
604 @x>2 is True if @x is equal to 3. But it isn't true if @x is 2.
605
606Only '==' and '!=' have been tested for comparing strings. Since there's no way
607to code a seriously complex data structure in this language, trying to sort
608strings by alphabet would be pointless anyway.
609
610Comparisons can be stacked in the same condition:
611
612 && - Is True if and only if BOTH sides are true.
613 ('1==1 && 2==2' is true. '2==1 && 1==1' is false.)
614 || - Is True if either side of this expression is True.
615
616 1==1 && 2==2 is True.
617 1==1 && 2==1 is False.
618 1==1 || 2==1 is True.
619
620Logical bitwise operators work only on numbers, and they are the following:
621
622 << - Left shift.
623 >> - Right shift.
624 Left shift moves the binary 1(s) of a number n positions to the left,
625 which is the same as multiplying by 2, n times.
626 In the other hand, Right shift moves the binary 1(s) of a number n positions
627 to the right, which is the same as dividing by 2, n times.
628 Example:
629 set b,2;
630 set a, b << 3;
631 mes a;
632 set a, a >> 2;
633 mes a;
634 The first mes command would display 16, which is the same as 2 x (2 x 2 x 2) = 16.
635 The second mes command would display 4, which is the same as 16 / 2 = 8. 8 / 2 = 4.
636 & - And.
637 | - Or.
638 The bitwise operator AND (&) is used to test two values against each other,
639 and results in setting bits which are active in both arguments. This can
640 be used for a few things, but in eAthena this operator is usually used to
641 create bit-masks in scripts.
642
643 The bitwise operator OR (|)sets to 1 a binary position if the binary position
644 of one of the numbers is 1. This way a variable can hold several values we can check,
645 known as bit-mask. A variable currently can hold up to 32 bit-masks (from position 0
646 to position 1). This is a cheap(skate) and easy way to avoid using arrays to store several checks
647 that a player can have.
648
649 A bit-mask basically is (ab)using the variables bits to set various options in
650 one variable. With the current limit if variables it is possible to store 32
651 different options in one variable (by using the bits on position 0 to 31).
652
653 Example(s):
654 - Basic example of the & operator, bit example:
655 10 & 2 = 2
656 Why? :
657 10 = 2^1 + 2^3 (2 + 8), so in bits, it would be 1010
658 2 = 2^1 (2), so in bits (same size) it would be 0010
659 The & (AND) operator sets bits which are active (1) in both arguments, so in the
660 example 1010 & 0010, only the 2^1 bit is active (1) in both. Resulting in the bit
661 0010, which is 2.
662 - Basic example of creating and using a bit-mask:
663 set @options,2|4|16; //(note: this is the same as 2+4+16, or 22)
664 if (@options & 1) mes "Option 1 is activated";
665 if (@options & 2) mes "Option 2 is activated";
666 if (@options & 4) mes "Option 3 is activated";
667 if (@options & 8) mes "Option 4 is activated";
668 if (@options & 16) mes "Options 5 is activated";
669 This would return the messages about option 2, 3 and 5 being shown (since we've set
670 the 2,4 and 16 bit to 1).
671 ^ - Xor.
672 The bitwise operator XOR (eXclusive OR) sets a binary position to 0 if both
673 numbers have the same value in the said position. On the other hand, it
674 sets to 1 if they have different values in the said binary position.
675 This is another way of setting and unsetting bits in bit-masks.
676
677 Example:
678 - First let's set the quests that are currently in progress:
679 set inProgress,1|8|16; // quest 1,8 and 16 are in progress
680 - After playing for a bit, the player starts another quest:
681 if( inProgress&2 == 0 ){
682 // this will set the bit for quest 2 (inProgress has that bit set to 0)
683 set inProgress,inProgress^2;
684 mes "Quest 2: find a newbie and be helpful to him for an hour.";
685 close;
686 }
687 - After spending some time reading info on Xor's, the player finally completes quest 1:
688 if( inProgress&1 && isComplete ){
689 // this will unset the bit for quest 1 (inProgress has that bit set to 1)
690 set inProgress,inProgress^1;
691 mes "Quest 1 complete!! You unlocked the secrets of the Xor dynasty, use them wisely.";
692 close;
693 }
694
695Unary operators with only with a single number, which follows the operator, and
696are following:
697
698 - - Negation.
699 The sign of the number will be reversed. If the number was positive, it will
700 become negative and vice versa.
701
702 Example:
703 set .@myvar,10;
704 mes "Negative 10 is "+(-.@myvar);
705
706 ! - Logical Not.
707 Reverses the boolean result of an expression. True will become false and
708 false will become true.
709
710 Example:
711 if(!callfunc("F_dosomething"))
712 {
713 mes "Doing something failed.";
714 close;
715 }
716
717 ~ - Bitwise Not.
718 Reverses each bit in a number, also known as one's complement. Cleared bits
719 are set, and set bits are cleared.
720
721 Example:
722 - Ensure, that quest 2 is disabled, while keeping all other active, if they are.
723 set inProgress,inProgress&(~2); // same as set inProgress,inProgress&0xfffffffd
724
725Ternary operators take three expressions (numbers, strings or boolean), and are
726following:
727
728 ?: - Conditional operator
729 Very useful e.g. to replace
730
731 if(Sex) mes "..."; else mes "...";
732
733 clauses with simple
734
735 mes "Welcome, " + (Sex?"Mr.":"Mrs.") + " " + strcharinfo(0);
736
737 or to replace any other simple if-else clauses. It might be worth
738 mentioning that ?: has low priority and has to be enclosed with
739 parenthesis in most (if not all) cases.
740
741
742=====================
743|1.- Basic commands.|
744=====================
745---------------------------------------
746
747*mes <內容>;
748 作用: 把<內容>的內容顯示到消æ¯çª—å£ä¸ã€‚
749
750---------------------------------------
751
752*next;
753 作用: 在消æ¯çª—å£ä¸Šé¡¯ç¤ºnext按鈕並ç‰å¾…。
754
755---------------------------------------
756
757*close;
758 作用: 在消æ¯çª—å£ä¸Šé¡¯ç¤ºcloseæŒ‰éˆ•ä¸¦çµæŸè…³æœ¬ã€‚
759
760---------------------------------------
761
762*close2;
763 作用: 在消æ¯çª—å£ä¸Šé¡¯ç¤ºclose按鈕,但ä¸çµæŸè…³æœ¬ã€‚è¦çµæŸè…³æœ¬æ™‚請使用end命令。
764
765---------------------------------------
766
767*end;
768 作用: çµæŸè…³æœ¬
769
770---------------------------------------
771
772*set <變é‡å>,<è¦è¨ç½®çš„值>;
773
774 作用: 把值傳入<變é‡ã€‚值為å—符串類型時,ä¸è¦å¿˜è¨˜è®Šé‡åçš„$後綴。
775
776---------------------------------------
777
778*setd <變é‡å>,<è¦è¨ç½®çš„值>;
779
780 作用:è¨ç½®ä¸€å€‹è®Šé‡çš„值(主è¦ä½œç”¨æ˜¯å¯ä»¥å‹•態改變變é‡å)
781 舉例:
782 set $var$, "Poring";
783
784 setd "$var$", "Poporing";
785 mes $var$; // Will return Poporing
786
787 setd "$" + $var$ + "123$", "Poporing is cool";
788 mes $Poporing123$; // Will return Poporing is cool.
789
790---------------------------------------
791
792*getd("<變é‡å>")
793
794 作用:返回一個變é‡çš„引用(主è¦ä½œç”¨æ˜¯å¯ä»¥å‹•態改變變é‡å)
795 舉例:
796 set getd("$varRefence"), 1;
797 set @i, getd("$pikachu");
798
799---------------------------------------
800
801*getvariableofnpc(<變é‡>,"<NPCåå—>")
802 作用:返回指定NPC的變é‡
803 舉例:
804 //è¨ç½®.v變é‡çš„值為NPC:TargetNPC的變é‡.var
805 set .v,getvariableofnpc(.var,"TargetNPC");
806
807 //è¨ç½®NPC:TargetNPC的變é‡.var的值為1
808 set getvariableofnpc(.var,"TargetNPC"),1;
809
810---------------------------------------
811
812*goto <label>;
813
814This command will make the script jump to a label, usually used in conjunction
815with other command, such as "if", but often used on it's own.
816
817 ...
818 goto Label;
819 mes "This will not be seen";
820Label:
821 mes "This will be seen";
822
823Note by FlavioJS: goto's are "evil" and should be avoided if possible
824
825---------------------------------------
826
827*menu "<option_text>",<target_label>{,"<option_text>",<target_label>,...};
828
829This command will create a selectable menu for the invoking character. Only one
830menu can be on screen at the same time.
831
832Depending on what the player picks from the menu, the script execution will
833continue from the corresponding label. (it's string-label pairs, not label-
834string)
835
836Options can be grouped together, separated by the character ':'.
837
838 menu "A:B",L_Wrong,"C",L_Right;
839
840It also sets a special temporary character variable @menu, which contains the
841number of option the player picked. (Numbering of options starts at 1.)
842This number is consistent with empty options and grouped options.
843
844 menu "A::B",L_Wrong,"",L_Impossible,"C",L_Right;
845 L_Wrong:
846 // If they click "A" or "B" they will end up here
847 // @menu == 1 if "A"
848 // @menu == 2 will never happen because the option is empty
849 // @menu == 3 if "B"
850 L_Impossible:
851 // Empty options are not displayed and therefore can't be selected
852 // this label will never be reached from the menu command
853 L_Right:
854 // If they click "C" they will end up here
855 // @menu == 5
856
857If a label is '-', the script execution will continue right after the menu
858command if that option is selected, this can be used to save you time, and
859optimize big scripts.
860
861 menu "A::B:",-,"C",L_Right;
862 // If they click "A" or "B" they will end up here
863 // @menu == 1 if "A"
864 // @menu == 3 if "B"
865 L_Right:
866 // If they click "C" they will end up here
867 // @menu == 5
868
869Both these examples will perform the exact same task.
870
871If you give an empty string as a menu item, the item will not display. This
872can effectively be used to script dynamic menus by using empty string for
873entries that should be unavailable at that time.
874
875You can do it by using arrays, but watch carefully - this trick isn't high
876wizardry, but minor magic at least. You can't expect to easily duplicate it
877until you understand how it works.
878
879Create a temporary array of strings to contain your menu items, and populate it
880with the strings that should go into the menu at this execution, making sure not
881to leave any gaps. Normally, you do it with a loop and an extra counter, like
882this:
883
884 setarray @possiblemenuitems$[0],<list of potential menu items>;
885 set @j,0; // That's the menu lines counter.
886
887 // We loop through the list of possible menu items.
888 // @i is our loop counter.
889 for( set @i,0; @i<getarraysize(@possiblemenuitems$) ; set @i,@i+1 )
890 {
891 // That 'condition' is whatever condition that determines whether
892 // a menu item number @i actually goes into the menu or not.
893
894 if (<condition>)
895 {
896 // We record the option into the list of options actually available.
897
898 set @menulist$[@j],@possiblemenuitems$[@i];
899
900 // We just copied the string, we do need it's number for later
901 // though, so we record it as well.
902
903 set @menureference[@j],@i;
904
905 // Since we've just added a menu item into the list, we increment
906 // the menu lines counter.
907
908 set @j,@j+1;
909 }
910
911 // We go on to the next possible menu item.
912 }
913
914This will create you an array @menulist$ which contains the text of all items
915that should actually go into the menu based on your condition, and an array
916@menureference, which contains their numbers in the list of possible menu items.
917(Remember, arrays start with 0.) There's less of them than the possible menu
918items you've defined, but the menu command can handle the empty lines - only if
919they are last in the list, and if it's made this way, they are. Now comes a
920dirty trick:
921
922 // X is whatever the most menu items you expect to handle.
923 menu @menulist$[0],-,@menulist$[1],-,....@menulist$[<X>],-;
924
925This calls up a menu of all your items. Since you didn't copy some of the
926possible menu items into the list, it's end is empty and so no menu items will
927show up past the end. But this menu call doesn't jump anywhere, it just
928continues execution right after the menu command. (And it's a good thing it
929doesn't, cause you can only explicitly define labels to jump to, and how do you
930know which ones to define if you don't know beforehand which options will end up
931where in your menu?)
932But how do you figure out which option the user picked? Enter the @menu.
933
934@menu contains the number of option that the user selected from the list,
935starting with 1 for the first option. You know now which option the user picked
936and which number in your real list of possible menu items it translated to:
937
938 mes "You selected "+@possiblemenuitems$[@menureference[@menu-1]]+"!";
939
940@menu is the number of option the user picked.
941@menu-1 is the array index for the list of actually used menu items that we
942made.
943@menureference[@menu-1] is the number of the item in the array of possible menu
944items that we've saved just for this purpose.
945
946And @possiblemenuitems$[@menureference[@menu-1]] is the string that we used to
947display the menu line the user picked. (Yes, it's a handful, but it works.)
948
949You can set up a bunch of 'if (@menureference[@menu-1]==X) goto Y' statements to
950route your execution based on the line selected and still generate a different
951menu every time, which is handy when you want to, for example, make users select
952items in any specific order before proceeding, or make a randomly shuffled menu.
953
954Kafra code bundled with the standard distribution uses a similar array-based
955menu technique for teleport lists, but it's much simpler and doesn't use @menu,
956probably since that wasn't documented anywhere.
957
958See also 'select', which is probably better in this particular case. Instead of
959menu, you could use 'select' like this:
960
961 set @dummy,select(@menulist$[0],@menulist$[1],....@menulist$[<X>]);
962
963For the purposes of the technique described above these two statements are
964perfectly equivalent.
965
966---------------------------------------
967
968*select("<option>"{,"<option>",...})
969*prompt("<option>"{,"<option>",...})
970
971This function is a handy replacement for 'menu' for some specific cases where
972you don't want a complex label structure - like, for example, asking simple yes-
973no questions. It will return the number of menu option picked, starting with 1.
974Like 'menu', it will also set the variable @menu to contain the option the user
975picked.
976
977 if (select("Yes:No")==1) mes "You said yes, I know.";
978
979And like 'menu', the selected option is consistent with grouped options
980and empty options.
981
982prompt works almost the same as select, except that when a character clicks
983the Cancel button, this function will return 255 instead.
984
985---------------------------------------
986
987*input(<variable>{,<min>{,<max>}})
988
989This command will make an input box pop up on the client connected to the
990invoking character, to allow entering of a number or a string. This has many
991uses, one example would be a guessing game, also making use of the 'rand'
992function:
993
994 mes "[Woman]";
995 mes "Try and guess the number I am thinking of.";
996 mes "The number will be between 1 and 10.";
997 next;
998 set @number, rand(1,10);
999 input @guess;
1000 if(@guess==@number)
1001 {
1002 mes "[Woman]";
1003 mes "Well done that was the number I was thinking of";
1004 close;
1005 }
1006 else
1007 {
1008 mes "[Woman]";
1009 mes "Sorry, that wasn't the number I was thinking of.";
1010 close;
1011 }
1012
1013If you give the input command a string variable to put the input in, it will
1014allow the player to enter text. Otherwise, only numbers will be allowed.
1015
1016 mes "[Woman]";
1017 mes "Please say HELLO";
1018 next;
1019 input @var$;
1020 if(@var$=="HELLO")
1021 {
1022 mes "[Woman]";
1023 mes "Well done you typed it correctly";
1024 close;
1025 }
1026 else
1027 {
1028 mes "[Woman]";
1029 mes "Sorry you got it wrong";
1030 close;
1031 }
1032
1033Normally you may not input a negative number with this command.
1034This is done to prevent exploits in badly written scripts, which would
1035let people, for example, put negative amounts of zeny into a bank script and
1036receive free zeny as a result.
1037
1038Since trunk r12192 the command has two optional arguments and a return value.
1039The default value of 'min' and 'max' can be set with 'input_min_value' and
1040'input_max_value' in script_athena.conf.
1041For numeric inputs the value is capped to the range [min,max]. Returns 1 if
1042the value was higher than 'max', -1 if lower than 'min' and 0 otherwise.
1043For string inputs it returns 1 if the string was longer than 'max', -1 is
1044shorter than 'min' and 0 otherwise.
1045
1046---------------------------------------
1047
1048*callfunc "<function>"{,<argument>,...<argument>};
1049*callfunc("<function>"{,<argument>,...<argument>})
1050
1051This command lets you call up a function NPC. A function NPC can be called from
1052any script on any map server. Using the 'return' command it will come back to
1053the place that called it.
1054
1055 place,50,50,6%TAB%script%TAB%Woman%TAB%115,{
1056 mes "[Woman]"
1057 mes "Lets see if you win";
1058 callfunc "funcNPC";
1059 mes "Well done you have won";
1060 close;
1061 }
1062 function%TAB%script%TAB%funcNPC%TAB%{
1063 set @win, rand(2);
1064 if(@win==0) return;
1065 mes "Sorry you lost";
1066 end;
1067 }
1068
1069You can pass arguments to your function - values telling it what exactly to do -
1070which will be available there with getarg() (see 'getarg')
1071Notice that returning is not mandatory, you can end execution right there.
1072
1073If you want to return a real value from inside your function NPC, it is better
1074to write it in the function form, which will also work and will make the script
1075generally cleaner:
1076
1077 place,50,50,6%TAB%script%TAB%Man%TAB%115,{
1078 mes "[Man]"
1079 mes "Gimme a number!";
1080 next;
1081 input @number;
1082 if (callfunc("OddFunc",@number)) mes "It's Odd!";
1083 close;
1084 }
1085 function%TAB%script%TAB%OddFunc%TAB%{
1086 if (getarg(0)%2==0) return 0;// it's even
1087 return 1;// it's odd
1088 }
1089
1090---------------------------------------
1091
1092*callsub <label>{,<argument>,...<argument>};
1093
1094This command will go to a specified label within the current script (do NOT use
1095quotes around it) coming in as if it were a 'callfunc' call, and pass it
1096arguments given, if any, which can be recovered there with 'getarg'. When done
1097there, you should use the 'return' command to go back to the point from where
1098this label was called. This is used when there is a specific thing the script
1099will do over and over, this lets you use the same bit of code as many times as
1100you like, to save space and time, without creating extra NPC objects which are
1101needed with 'callfunc'. A label is not callable in this manner from another
1102script.
1103
1104 mes "[Woman]"
1105 mes "Lets see if you win";
1106 callsub Check;
1107 mes "Well done you have won";
1108 close;
1109 Check:
1110 set @win, rand(2);
1111 if(@win==0) return;
1112 mes "Sorry you lost";
1113 close;
1114
1115---------------------------------------
1116
1117*getarg(<index>{,<default_value>})
1118
1119This function is used when you use the 'callsub' or 'callfunc' commands. In the
1120call you can specify variables that will make that call different from another
1121one. This function will return an argument the function or subroutine was
1122called with, and is the normal way to get them.
1123This is another thing that can let you use the same code more than once.
1124
1125Argument numbering starts with 0, i.e. the first argument you gave is number 0.
1126If no such argument was given, a zero is returned.
1127
1128 place,50,50,6%TAB%script%TAB%Woman1%TAB%115,{
1129 mes "[Woman]";
1130 mes "Lets see if you win";
1131 callfunc "funcNPC",2;
1132 mes "Well done you have won";
1133
1134 ...
1135
1136 place,52,50,6%TAB%script%TAB%Woman2%TAB%115,{
1137 mes "[Woman]";
1138 mes "Lets see if you win";
1139 callfunc "funcNPC",5;
1140 mes "Well done you have won";
1141
1142 ...
1143
1144 function%TAB%script%TAB%funcNPC%TAB%{
1145 set @win, rand(getarg(0));
1146 if(@win==0) return;
1147 mes "Sorry you lost";
1148
1149"woman1" NPC object calls the funcNPC. The argument it gives in this call is
1150stated as 2, so when the random number is generated by the 'rand' function, it
1151can only be 0 or 1. Whereas "woman2" gives 5 as the argument number 0 when
1152calling the function, so the random number could be 0, 1, 2, 3 or 4, this makes
1153"woman2" less likely to say the player won.
1154
1155You can pass multiple arguments in a function call:
1156
1157 callfunc "funcNPC",5,4,3;
1158
1159getarg(0) would be 5, getarg(1) would be 4 and getarg(2) would be 3.
1160
1161Getarg has an optional argument since trunk r10773 and stable r10958.
1162If the target argument exists, it is returned.
1163Otherwise, if <default_value> is present it is returned instead,
1164if not the script terminates immediately.
1165
1166in the previous example getarg(2,-1) would be 3 and getarg(3,-1) would be -1
1167
1168---------------------------------------
1169
1170*getargcount()
1171
1172This function is used when you use the 'callsub' or 'callfunc' commands. In the
1173call you can specify arguments. This function will return the number of arguments
1174provided.
1175
1176Example:
1177 callfunc "funcNPC",5,4,3;
1178 ...
1179 function%TAB%script%TAB%funcNPC%TAB%{
1180 set .@count, getargcount(); // 3
1181 ...
1182 }
1183
1184---------------------------------------
1185*return {<value>};
1186
1187When you use callsub or callfunc, this command allows you to go back to the
1188calling script. You can optionally return with a value telling the calling
1189program what exactly happened.
1190
1191 callfunc "<your function>";// when nothing is returned
1192 set <variable>,callfunc("<your function>");// when a value is being returned
1193
1194---------------------------------------
1195
1196*function <function name>;
1197*<function name>;
1198*function <function name> {
1199<code>
1200}
1201
1202(Skotlex stop being so selfish and give us all the commands T~T! J/k lol :P)
1203
1204This works like callfunc, but doesn't support arguments like callfunc. It's used for cleaner
1205and fast script that doesn't require arguments for it to work. Also they must be inside a script.
1206They're not separated scripts and they work more like labels.
1207
1208Note it looks like the normal declaration
1209
1210Usage:
1211
1212You first Declare the function with function <function name>;.
1213
1214Put the rest of your code. You can use then <function name>; to call the function. If it returns a value is unsure,
1215test it if you want and give us some comments ;3
1216
1217And at least, but inside the script itself, put the function <function name> {<code>}.
1218
1219舉例:
1220
1221prontera,154,189,4 script Item seller 767,{
1222
1223function SF_Selling;
1224
1225mes "I'll open this now if you have more than 50z and you are level 50 or bigger";
1226next;
1227
1228if (Zeny > 50) && (BaseLevel > 50) {
1229 mes "Welcome";
1230 next;
1231 SF_Selling;
1232 close;
1233} else
1234
1235set @needed,50-BaseLevel;
1236mes "You either are Level "+BaseLevel+", thus you need "+@needed+" more levels";
1237mes "to be able to use this npc; or you don't have enough zeny, so get some please";
1238close;
1239
1240function SF_Selling {
1241
1242 mes "Would you like to buy a phracon for 50z?";
1243 switch(select("Yes","No, thanks")) {
1244
1245 case 1:
1246 mes "Ok, how many?";
1247 input @quantity;
1248 set @check,Zeny/50;
1249 if (@quantity > @check) {
1250 mes "Sorry but you can only have "+@check+" Phracons with "+Zeny;
1251 close;
1252 } else
1253 next;
1254 mes "here you have";
1255 set Zeny,Zeny-@quantity*50;
1256 getitem 1010,@quantity;
1257 close;
1258 case 2:
1259 mes "Good bye then";
1260 close;
1261 }
1262 }
1263 return;
1264}
1265
1266---------------------------------------
1267
1268*if (<condition>) <statement>;
1269
1270This is the basic conditional statement command, and just about the only one
1271available in this scripting language.
1272
1273The condition can be any expression. All expressions resulting in a non-zero
1274value will be considered True, including negative values. All expressions
1275resulting in a zero are false.
1276
1277If the expression results in True, the statement will be executed. If it isn't
1278true, nothing happens and we move on to the next line of the script.
1279
1280 if (1) mes "This will always print.";
1281 if (0) mes "And this will never print.";
1282 if (5) mes "This will also always print.";
1283 if (-1) mes "Funny as it is, this will also print just fine.";
1284
1285For more information on conditional operators see the operators section above.
1286Anything that is returned by a function can be used in a condition check without
1287bothering to store it in a specific variable:
1288
1289 if (strcharinfo(0)=="Daniel Jackson") mes "It is true, you are Daniel!";
1290
1291More examples of using the 'if' command in the real world:
1292
1293Example 1:
1294
1295 set @var1,1;
1296 input @var2;
1297 if(@var1==@var2) goto L_Same;
1298 mes "Sorry that is wrong";
1299 close;
1300 L_Same:
1301 close;
1302
1303Example 2:
1304
1305 set @var1,1;
1306 input @var2;
1307 if(@var1!=@var2) mes "Sorry that is wrong";
1308 close;
1309
1310(Notice examples 1 and 2 have the same effect.)
1311
1312Example 3:
1313
1314 set @var1,@var1+1;
1315 mes "[Forgetfull Man]";
1316 if (@var==1) mes "This is the first time you have talked to me";
1317 if (@var==2) mes "This is the second time you have talked to me";
1318 if (@var==3) mes "This is the third time you have talked to me";
1319 if (@var==4) mes "This is the forth time you have talked to me, but I think I am getting amnesia, I have forgoten about you";
1320 if (@var==4) set @var,0;
1321 close;
1322
1323Example 4:
1324
1325 mes "[Quest Person]";
1326 if(countitem(512)>=1) goto L_GiveApple;
1327 // The number 512 was found from item_db, it is the item number for the Apple.
1328 mes "Can you please bring me an apple?";
1329 close;
1330 L_GiveApple:
1331 mes "Oh an apple, I didnt want it, I just wanted to see one";
1332 close;
1333
1334Example 5:
1335
1336 mes "[Person Checker]";
1337 if($name$!=null) goto L_Check;
1338 mes "Please tell me someones name";
1339 next;
1340 input $name$;
1341 set $name2$,strcharinfo(0);
1342 mes "[Person Checker]";
1343 mes "Thank you";
1344 L_Check:
1345 if($name$==strcharinfo(0) ) goto L_SameName;
1346 mes "[Person Checker]";
1347 mes "You are not the person that " +$name2$+ " mentioned";
1348 L_End:
1349 set $name$,null;
1350 set $name2$,null;
1351 close;
1352 L_SameName:
1353 mes "[Person Checker]";
1354 mes "You are the person that " +$name2$+ " just mentioned";
1355 mes "nice to meet you";
1356 goto L_End;
1357
1358See 'strcharinfo' for explanation of what this function does.
1359
1360Example 6: Using complex conditions.
1361
1362 mes "[Multi Checker]";
1363 if( (@queststarted==1) && (countitem(512)>=5) ) goto L_MultiCheck;
1364 // Only if the quest has been started AND You have 5 apples will it goto "L_MultiCheck"
1365 mes "Please get me 5 apples";
1366 set @queststarted,1;
1367 close;
1368 L_MultiCheck:
1369 mes "[Multi Checker]";
1370 mes "Well done you have started the quest of got me 5 apples";
1371 mes "Thank you";
1372 set @queststarted,0;
1373 delitem 512,5;
1374 close;
1375
1376With the Advanced scripting engine, we got nested if's. That is:
1377
1378if (<condition>)
1379 dothis;
1380else
1381 dothat;
1382
1383If the condition doesn't meet, it'll do the action following the else.
1384We can also group several actions depending on a condition, the following way:
1385
1386if (<condition)
1387{
1388 dothis1;
1389 dothis2;
1390 dothis3;
1391} else {
1392 dothat1;
1393 dothat2;
1394 dothat3;
1395 dothat4;
1396}
1397
1398Remember that if you plan to do several actions upon the condition being false, and
1399you forget to use the curlies (the { } ), the second action will be executed regardless
1400the output of the condition, unless of course, you stop the execution of the script if the
1401condition is true (that is, in the first grouping using a return; , and end; or a close; )
1402
1403Also, you can have multiple conditions nested or chained, and don't worry about limits as to
1404how many nested if you can have, there is no spoon ;)
1405
1406...
1407if (<condition 1>)
1408 dothis;
1409else if (<condition 2>)
1410{
1411 dotheother;
1412 do that;
1413 end;
1414} else
1415 do this;
1416...
1417
1418---------------------------------------
1419
1420*jump_zero (<condition>),<label>;
1421
1422This command works kinda like an 'if'+'goto' combination in one go. (See 'if').
1423If the condition is false (equal to zero) this command will immediately jump to
1424the specified label like in 'goto'.
1425
1426While 'if' is more generally useful, for some cases this could be an
1427optimisation.
1428
1429---------------------------------------
1430*while (<condition>) <statement>;
1431
1432This is probably the simplest and most frequently used loop structure. The 'while'
1433statement can be interpreted as "while <condition> is true, perform <statement>".
1434It is a pretest loop, meaning the conditional expression is tested before any of the
1435statements in the body of the loop are performed. If the condition evaluates to
1436false, the statement(s) in the body of the loop is/are never executed. If the
1437condition evaluates to true, the statement(s) are executed, then control transfers
1438back to the conditional expression, which is reevaluated and the cycle continues.
1439
1440Multiple statements can be grouped with { }, curly braces, just like with the 'if' statement.
1441
1442Example 1:
1443 while (switch(select("Yes:No") == 2 ))
1444 mes "You picked no.";
1445
1446Example 2: multiple statements
1447 while (switch(select("Yes:No") == 2 )) {
1448 mes "Why did you pick no?";
1449 mes "You should pick yes instead!";
1450 }
1451
1452Example 3: counter-controlled loop
1453 set .@i, 1;
1454 while (.@i <= 5) {
1455 mes "This line will print 5 times.";
1456 set .@i, .@i +1;
1457 }
1458
1459Example 4: sentinel-controlled loop
1460 mes "Input 0 to stop";
1461 input .@num;
1462 while (.@num != 0) {
1463 mes "You entered " + .@num;
1464 input .@num;
1465 }
1466 close;
1467
1468---------------------------------------
1469
1470*for (<variable initialization>; <condition>; <variable update>) <statement>;
1471
1472Another pretest looping structure is the 'for' statement. It is considered a
1473specialized form of the 'while' statement, and is usually associated with counter-
1474controlled loops. Here are the steps of the 'for' statement: the initialize
1475statement is executed first and only once. The condition test is performed.
1476When the condition evaluates to false, the rest of the for statement is skipped.
1477When the condition evaluates to true, the body of the loop is executed, then the
1478update statement is executed (this usually involves incrementing a variable).
1479Then the condition is reevaluated and the cycle continues.
1480
1481Example 1:
1482 for( set .@i, 1; .@i <= 5; set .@i, .@i +1 )
1483 mes "This line will print 5 times.";
1484
1485Example 2:
1486 mes "This will print the numbers 1 - 5.";
1487 for( set .@i, 1; .@i <= 5; set .@i, .@i +1 )
1488 mes .@i;
1489
1490---------------------------------------
1491
1492*do { <statement>; } while (<condition>);
1493
1494The 'do...while' is the only posttest loop structure available in this script
1495language. With a posttest, the statements are executed once before the condition
1496is tested. When the condition is true, the statement(s) are repeated. When the
1497condition is false, control is transferred to the statement following the
1498'do...while' loop expression.
1499
1500Example 1: sentinel-controlled loop
1501 mes "This menu will keep appearing until you pick Cancel";
1502 do {
1503 set .@menu, select("One:Two:Three:Cancel");
1504 } while (.@menu != 4);
1505
1506Example 2: counter-controlled loop
1507 mes "This will countdown from 10 to 1.";
1508 set .@i, 10;
1509 do {
1510 mes .@i;
1511 set .@i, .@i - 1;
1512 } while (.@i > 0);
1513
1514---------------------------------------
1515
1516*setarray <array name>[<first value>],<value>{,<value>...<value>};
1517
1518This command will allow you to quickly fill up an array in one go. Check the
1519Kafra scripts in the distribution to see this used a lot.
1520
1521 setarray @array[0], 100, 200, 300, 400, 500, 600;
1522
1523First value is the index of the first element of the array to alter. For
1524舉例:
1525
1526 setarray @array[0],200,200,200;
1527 setarray @array[1],300,150;
1528
1529will produce:
1530
1531 @array[0]=200
1532 @array[1]=300
1533 @array[2]=150
1534
1535---------------------------------------
1536
1537*cleararray <array name>[<first value to alter>],<value>,<number of values to set>;
1538
1539This command will change many array values at the same time to the same value.
1540
1541 setarray @array[0], 100, 200, 300, 400, 500, 600;
1542 // This will make all 6 values 0
1543 cleararray @array[0],0,6;
1544 // This will make array element 0 change to 245
1545 cleararray @array[0],245,1;
1546 // This will make elements 1 and 2 change to 345
1547 cleararray @array[1],345,2;
1548
1549See 'setarray'.
1550
1551---------------------------------------
1552
1553*copyarray <destination array>[<first value>],<source array>[<first value>],<amount of data to copy>;
1554
1555This command lets you quickly shuffle a lot of data between arrays, which is in
1556some cases invaluable.
1557
1558 setarray @array[0], 100, 200, 300, 400, 500, 600;
1559 // So we have made @array[]
1560 copyarray @array2[0],@array[2],2;
1561
1562 // Now, @array2[0] will be equal to @array[2] (300) and
1563 // @array2[1] will be equal to @array[3].
1564
1565So using the examples above:
1566 @array[0] = 100
1567 @array[1] = 200
1568 @array[2] = 300
1569 @array[3] = 400
1570 @array[4] = 500
1571 @array[5] = 600
1572
1573New Array:
1574 @array2[0] = 300
1575 @array2[1] = 400
1576 @array2[2] = 0
1577 @array2[3] = 0
1578
1579Notice that @array[4] and @array[5] won't be copied to the second array, and it will return a
15800.
1581
1582---------------------------------------
1583
1584*deletearray <array name>[<first value>],<how much to delete>
1585
1586This command will delete a specified number of array elements totally from an
1587array, shifting all the elements beyond this towards the beginning.
1588
1589 // This will delete array element 0, and move all the other array elements
1590 // up one place.
1591 deletearray @array[0],1
1592
1593// This would delete array elements numbered 1, 2 and 3, leave element 0 in its
1594// place, and move the other elements ups, so there are no gaps.
1595
1596 deletearray @array[1],3
1597
1598---------------------------------------
1599
1600======================================
1601|2.- Information-retrieving commands.|
1602======================================
1603---------------------------------------
1604
1605*strcharinfo(<類型>)
1606
1607This function will return either the name, party name or guild name for the
1608invoking character. Whatever it returns is determined by type.
1609
1610 0 - Character's name.
1611 1 - The name of the party they're in if any.
1612 2 - The name of the guild they're in if any.
1613 3 - 讀å–é—œè¯è§’色的帳號當å‰åœ°åœ–å.
1614 4 - 讀å–é—œè¯è§’色的帳號當å‰IP地å€.
1615 5 - 讀å–é—œè¯è§’色的帳號註冊email地å€.
1616
1617If a character is not a member of any party or guild, an empty string will be
1618returned when requesting that information.
1619
1620---------------------------------------
1621
1622---------------------------------------
1623
1624*strnpcinfo(<類型>)
1625
1626This function will return the various parts of the name of the calling npc.
1627Whatever it returns is determined by type.
1628
1629 0 - The NPC's display name (visible#hidden)
1630 1 - The visible part of the NPC's display name
1631 2 - The hidden part of the NPC's display name
1632 3 - The NPC's unique name (::name)
1633 4 - NPC所在地圖å
1634
1635---------------------------------------
1636
1637*getarraysize(<array name>)
1638
1639This function returns the number of values that are contained inside the
1640specified array. Notice that zeros and empty strings at the end of this array
1641are not counted towards this number.
1642
1643For 舉例:
1644
1645 setarray @array[0], 100, 200, 300, 400, 500, 600;
1646 set @arraysize,getarraysize(@array);
1647
1648This will make @arraysize == 6. But if you try this:
1649
1650 setarray @array[0], 100, 200, 300, 400, 500, 600, 0;
1651 set @arraysize,getarraysize(@array);
1652
1653@arraysize will still equal 6, even though you've set 7 values.
1654
1655---------------------------------------
1656
1657*getelementofarray(<array name>,<index>)
1658
1659This function will return an array's element when given an index.
1660
1661 // This will find the 2nd array value
1662 getelementofarray(@array,1)
1663
1664Pretty pointless now when we have
1665
1666 @array[1]
1667
1668which has the same effect.
1669
1670---------------------------------------
1671
1672*readparam(<parameter number>)
1673
1674This function will return the basic stats of an invoking character, referred to
1675by the parameter number. Instead of a number, you can use a parameter name if it
1676is defined in "db/const.txt".
1677
1678For reference, in there these things are defined:
1679
1680StatusPoint, BaseLevel, SkillPoint, Class, Upper, Zeny, Sex, Weight, MaxWeight,
1681JobLevel, BaseExp, JobExp, NextBaseExp, NextJobExp, Hp, MaxHp, Sp, MaxSp,
1682BaseJob, Karma, Manner, bVit, bDex, bAgi, bStr, bInt, bLuk
1683
1684All of these also behave as variables, but don't expect to be able to just 'set'
1685all of them - some will not work for various internal reasons.
1686
1687 // This would return how many status points you haven't spent yet
1688 readparam(9)
1689
1690Using this particular information as a function call is not required. Just
1691putting
1692
1693 StatusPoint
1694
1695will give you the same result, and some of these parameters work just like
1696variables (i.e. you can 'set Zeny,100' to make the character have 100 zeny,
1697destroying whatever zeny they had before, or 'set Zeny,Zeny+100' to give them
1698100 zeny)
1699
1700You can also use this command to get stat values:
1701
1702 readparam(bVit)
1703 if(readparam(bVit)<=77) goto L_End;
1704 mes "Only people with over 77 Vit are reading this";
1705L_End:
1706 close;
1707
1708---------------------------------------
1709
1710*getcharid(<類型>{,"<character name>"})
1711
1712This function will return a unique ID number of the invoking character, or, if a
1713character name is specified, of that character.
1714
1715Type is the kind of associated ID number required:
1716
1717 0 - 角色 ID number.(CID)
1718 1 - éšŠä¼ ID number.
1719 2 - 公會 ID number.
1720 3 - 賬號 ID number.(AID)
1721 4 - æˆ°å ´ ID number.
1722
1723For most purposes other than printing it, a number is better to have than a name
1724(people do horrifying things to their character names).
1725
1726If the character is not in a party or not in a guild, the function will return 0
1727if guild or party number is requested. If a name is specified and the character
1728is not found, 0 is returned.
1729
1730If getcharid(0) returns a zero, the script got called not by a character and
1731doesn't have an attached RID. Note that this will cause the map server to
1732print "player not attached!" error messages, so it is preferred to use
1733"playerattached" to check for the character attached to the script.
1734
1735if( getcharid(2) == 0 ) mes "Only members of a guild are allowed here!";
1736
1737---------------------------------------
1738
1739*getchildid()
1740*getmotherid()
1741*getfatherid()
1742
1743These functions return the characters (child/mother/father) ID
1744
1745 if (getmotherid()) mes "Oh... I know your mother's ID:"+getmotherid();
1746
1747---------------------------------------
1748
1749*ispartneron()
1750
1751This function returns 1 if the invoking character's marriage partner is
1752currently online and 0 if they are not or if the character has no partner.
1753
1754---------------------------------------
1755
1756*getpartnerid()
1757
1758This function returns the character ID of the invoking character's marriage
1759partner, if any. If the invoking character is not married, it will return 0,
1760which is a quick way to see if they are married:
1761
1762 if (getpartnerid()) mes "I'm not going to be your girlfriend!";
1763 if (getpartnerid()) mes "You're married already!";
1764
1765---------------------------------------
1766
1767*getpartyname(<party id>)
1768
1769This function will return the name of a party that has the specified ID number.
1770If there is no such party ID, "null" will be returned.
1771
1772Lets say the ID of a party was saved as a global variable:
1773
1774 // This would return the name of the party from the ID stored in a variable
1775 mes "You're in the '"+getpartyname($@var)"' party, I know!";
1776
1777---------------------------------------
1778
1779*getpartymember <party id>{,<類型>};
1780
1781Thank you to HappyDenn for all this information.
1782
1783This command will find all members of a specified party and returns their names
1784(or character id or account id depending on the value of "type") into an array
1785of temporary global variables. There's actually quite a few commands like this
1786which will fill a special variable with data upon execution and not do anything
1787else.
1788
1789Upon executing this,
1790
1791$@partymembername$[] is a global temporary stringarray which contains all the
1792 names of these party members
1793 (only set when type is 0 or not specified)
1794
1795$@partymembercid[] is a global temporary number array which contains the
1796 character id of these party members.
1797 (only set when type is 1)
1798
1799$@partymemberaid[] is a global temporary number array which contains the
1800 account id of these party members.
1801 (only set when type is 2)
1802
1803$@partymembercount is the number of party members that were found.
1804
1805The party members will (apparently) be found regardless of whether they are
1806online or offline. Note that the names come in no particular order.
1807
1808Be sure to use $@partymembercount to go through this array, and not
1809'getarraysize', because it is not cleared between runs of 'getpartymember'. If
1810someone with 7 party members invokes this script, the array would have 7
1811elements. But if another person calls up the NPC, and he has a party of 5, the
1812server will not clear the array for you, overwriting the values instead. So in
1813addition to returning the 5 member names, the 6th and 7th elements from the last
1814call remain, and you will get 5+2 members, of which the last 2 don't belong to
1815the new guy's party. $@partymembercount will always contain the correct number,
1816(5) unlike 'getarraysize()' which will return 7 in this case.
1817
1818舉例:
1819
1820 // get the character's party ID
1821 getpartymember(getcharid(1));
1822
1823 // immediately copy $@partymembercount value to a new variable, since
1824 // you don't know when 'getpartymember' will get called again for someone
1825 // else's party, overwriting your global array.
1826 set @partymembercount,$@partymembercount;
1827
1828 // copy $@partymembername array to a new array
1829 copyarray @partymembername$[0],$@partymembername$[0],@partymembercount;
1830
1831 //list the party members in NPC dialog
1832 set @count,0;
1833 L_DisplayMember:
1834 if(@count == @partymembercount) goto L_DisplayMemberEnd;
1835 mes (@count + 1) + ". ^0000FF" + @partymembername$[@count] + "^000000";
1836 set @count,@count+1;
1837 goto L_DisplayMember;
1838 L_DisplayMemberEnd:
1839 close;
1840
1841---------------------------------------
1842
1843*getpartyleader(<party id>{,<類型>});
1844
1845This function returns some information about the given party-id's leader.
1846When type is ommitted, the default information retrieved is the leader's name.
1847Possible types are:
1848
1849 1: Leader account id
1850 2: Leader character id
1851 3: Leader's class
1852 4: Leader's current map name
1853 5: Leader's current level as stored on the party structure (may not be
1854 current level if leader leveled up recently).
1855
1856If retrieval fails (leader not found or party does not exist), this function
1857returns "null" instead of the character name, and -1 for the other types.
1858
1859---------------------------------------
1860
1861*getlook(<類型>)
1862
1863This function will return the number for the currentcharacter look value
1864specified by type. See 'setlook' for valid look types.
1865
1866This can be used to make a certain script behave differently for characters
1867dressed in black. :)
1868
1869---------------------------------------
1870
1871*getsavepoint(<information type>)
1872
1873This function will return information about the invoking character's save point.
1874You can use it to let a character swap between several recorded savepoints.
1875Available information types are:
1876
1877 0 - Map name (a string)
1878 1 - X coordinate
1879 2 - Y coordinate
1880
1881---------------------------------------
1882
1883*pushpc <æ–¹å‘>,<å–®å…ƒæ ¼>;
1884
1885該指令把當å‰é—œè¯è§’è‰²å‘æŒ‡å®šæ–¹å‘æŽ¨æŒ‡å®šå–®å…ƒæ ¼ã€‚æ–¹å‘å’ŒNPC定義時用的一樣,
1886也能用 DIR_* ç‰æ†é‡ä»£æ›¿ (db/const.txt).
1887
1888é€™ç¨®æ“Šé€€ä¸æ”¶é“具或地圖標籤é™åˆ¶, åªæœ‰éšœç¤™ç‰©æœ‰æ•ˆã€‚å¦‚æžœæ²’æœ‰è¶³å¤ ç©ºé–“è¢«æ“Šé€€
1889(例如有牆), 角色會被推至障礙物。
1890
1891 // 把角色從當å‰ä½ç½®å‘3é»žé˜æ–¹å‘推5æ ¼
1892 pushpc DIR_EAST, 5;
1893
1894---------------------------------------
1895
1896*searchstores <次數>,<效果>;
1897
1898打開商店æœç´¢çª—å£, 用來æœç´¢éœ²å¤©å•†åº—和採購商店。
1899數é‡è¡¨ç¤ºä¸€æ¬¡æœç´¢çš„æœ€å¤§å•†åº—é‡ã€‚
1900æ•ˆæžœè¡¨ç¤ºçµæžœä¸çš„é“具被雙擊時的效果,數值如下:
1901
1902 0 = 如果商店和玩家在åŒä¸€åœ°åœ–時,在å°åœ°åœ–顯示商店ä½ç½®ï¼Œä¸¦ä»¥é»ƒè‰²é«˜äº®é¡¯ç¤ºå•†åº—牌
1903 1 = 無視è·é›¢ç›´æŽ¥æ‰“開商店
1904
1905舉例:
1906
1907 // Item Universal_Catalog_Gold (æœç´¢10次, 效果: 直接打開)
1908 searchstores 10,1;
1909
1910---------------------------------------
1911\\
19122,2 Item-related commands
1913\\
1914---------------------------------------
1915
1916*getequipid(<equipment slot>)
1917
1918This function returns the item ID of the item equipped in the equipment slot
1919specified on the invoking character. If nothing is equpped there, it returns -1.
1920Valid equipment slots are:
1921
1922EQI_HEAD_TOP (1) - Upper head gear
1923EQI_ARMOR (2) - Armor (Where you keep your Jackets and Robes)
1924EQI_HAND_L (3) - What is in your Left hand.
1925EQI_HAND_R (4) - What is in your Right hand.
1926EQI_GARMENT (5) - The garment slot (Mufflers, Hoods, Manteaus)
1927EQI_SHOES (6) - What foot gear the player has on.
1928EQI_ACC_L (7) - Accessory 1.
1929EQI_ACC_R (8) - Accessory 2.
1930EQI_HEAD_MID (9) - Middle Headgear (masks and glasses)
1931EQI_HEAD_LOW (10) - Lower Headgear (beards, some masks)
1932EQI_COSTUME_TOP (11) - Upper Costume Headgear
1933EQI_COSTUME_MID (12) - Middle Costume Headgear
1934EQI_COSTUME_LOW (13) - Lower Costume Headgear
1935EQI_COSTUME_GARMENT (14) - Costume Garment
1936EQI_COSTUME_SHOES (15) - Costume Shoes
1937
1938Notice that a few items occupy several equipment slots, and if the character is
1939wearing such an item, 'getequipid' will return it's ID number for either slot.
1940
1941Can be used to check if you have something equiped, or if you haven't got
1942something equiped:
1943
1944 if(getequipid(EQI_HEAD_TOP)==2234) goto L_WearingTiara;
1945 mes "Come back when you have a Tiara on";
1946 close;
1947 L_WearingTiara:
1948 mes "What a lovely Tiara you have on";
1949 close;
1950
1951You can also use it to make sure people don't pass a point before removing an
1952item totally from them. Let's say you don't want people to wear Legion Plate
1953armor, but also don't want them to equip if after the check, you would do this:
1954
1955 if ((getequipid(EQI_ARMOR) == 2341) || (getequipid(EQI_ARMOR) == 2342) goto L_EquipedLegionPlate;
1956 // the || is used as an or argument, there is 2341 and 2342 cause there are
1957 // two different legion plate armors, one with a slot one without.
1958 if ((countitem(2341) > 0) || (countitem(2432) > 0) goto L_InventoryLegionPlate;
1959 mes "I will lets you pass";
1960 close2;
1961 warp "place",50,50;
1962 end;
1963 L_EquipedLegionPlate:
1964 mes "You are wearing some Legion Plate Armor, please drop that in your stash before continuing";
1965 close;
1966 L_InventoryLegionPlate:
1967 mes "You have some Legion Plate Armor in your inventory, please drop that in your stash before continuing";
1968 close;
1969
1970---------------------------------------
1971
1972*getequipname(<equpment slot>)
1973
1974Returns the jname of the item equipped in the specified equipment slot on the
1975invoking character, or an empty string if nothing is equipped in that position.
1976Does the same thing as getitemname(getequipid()). Useful for an NPC to state
1977what your are wearing, or maybe saving as a string variable.
1978See 'getequipid' for a full list of valid equipment slots.
1979
1980 if( getequipname(EQI_HEAD_TOP) != "" )
1981 mes "So you are wearing a "+getequipname(EQI_HEAD_TOP)+" on your head";
1982 else
1983 mes "You are not wearing any head gear";
1984
1985---------------------------------------
1986
1987*getitemname(<item id>)
1988
1989Given the database ID number of an item, this function will return the text
1990stored in the 'japanese name' field (which, in eAthena, stores an english name
1991the players would normally see on screen.)
1992
1993---------------------------------------
1994
1995*getbrokenid(<number>)
1996
1997This function will search the invoking character's inventory for any broken
1998items, and will return their item ID numbers. Since the character may have
1999several broken items, 1 given as an argument will return the first one found, 2
2000will return the second one, etc. Will return 0 if no such item is found.
2001
2002 // Let's see if they have anything broken:
2003 if (getbrokenid(1)==0) goto Skip;
2004 // They do, so let's print the name of the first broken item:
2005 mes "Oh, I see you have a broken "+getitemname(getbrokenid(1))+" here!";
2006 Skip:
2007 mes "You don't have anything broken, quit bothering me.";
2008
2009---------------------------------------
2010
2011*getequipisequiped(<equipment slot>)
2012
2013This functions will return 1 if there is an equipment placed on the specified
2014equipment slot and 0 otherwise. For a list of equipment slots
2015see 'getequipid'. Function originally used by the refining NPCs:
2016
2017 if (getequipisequiped(EQI_HEAD_TOP)) goto L_equipped;
2018 mes "[Refiner]";
2019 mes "Do you want me to refine your dumb head?";
2020 close;
2021 L_equipped:
2022 mes "[Refiner]";
2023 mes "That's a fine hat you are wearing there...";
2024 close;
2025
2026
2027---------------------------------------
2028
2029*getequipisenableref(<equipment slot>)
2030
2031Will return 1 if the item equipped on the invoking character in the specified
2032equipment slot is refinable, and 0 if it isn't. For a list of equipment slots
2033see 'getequipid'.
2034
2035 if (getequipisenableref(EQI_HEAD_TOP)) goto L_Refine;
2036 mes "[Refiner]";
2037 mes "I can't refine this hat!...";
2038 close;
2039 L_Refine:
2040 mes "[Refiner]";
2041 mes "Ok I can refine this";
2042 close;
2043
2044---------------------------------------
2045
2046*getequiprefinerycnt(<equipment slot>)
2047
2048Returns the current number of plusses for the item in the specified equipment
2049slot. For a list of equipment slots see 'getequipid'.
2050
2051Can be used to check if you have reached a maximum refine value, default for
2052this is +10:
2053
2054 if(getequiprefinerycnt(EQI_HEAD_TOP) < 10) goto L_Refine_HeadGear;
2055 mes "Sorry, it's not possible to refine hats better than +10";
2056 close;
2057 L_Refine_HeadGear:
2058 mes "I will now upgrade your "+getequipname(EQI_HEAD_TOP);
2059
2060---------------------------------------
2061
2062*getequipweaponlv(<equipment slot>)
2063
2064This function returns the weapon level for the weapon equipped in the specified
2065equipment slot on the invoking character. For a list of equipment slots see
2066'getequipid'.
2067
2068Only EQI_HAND_L and EQI_HAND_R normally make sense, since only weapons
2069have a weapon level. You can, however, probably, use this field for other
2070equippable custom items as a flag or something.
2071If no item is equipped in this slot, or if it doesn't have a weapon level
2072according to the database, 0 will be returned.
2073
2074 switch (getequipweaponlv(EQI_HAND_R)) {
2075 case 1: mes "You are holding a lvl 1 weapon"; break;
2076 case 2: mes "You are holding a lvl 2 weapon"; break;
2077 case 3: mes "You are holding a lvl 3 weapon"; break;
2078 case 4: mes "You are holding a lvl 4 weapon"; break;
2079 case 5: mes "You are holding a lvl 5 weapon, hm, must be a custom design"; break;
2080 default: mes "Seems you don't have a weapon on"; break;
2081 }
2082
2083Or for the left hand, cause it can hold a weapon or a shield:
2084
2085 if(getequipid(EQI_HAND_R)==0) goto L_NothingEquiped;
2086 switch (getequipweaponlv(EQI_HAND_L)) {
2087 case 0: mes "You are holding a shield, so it doesnt have a level"; break;
2088 case 1: mes "You are holding a lvl 1 weapon"; break;
2089 case 2: mes "You are holding a lvl 2 weapon"; break;
2090 case 3: mes "You are holding a lvl 3 weapon"; break;
2091 case 4: mes "You are holding a lvl 4 weapon"; break;
2092 case 5: mes "You are holding a lvl 5 weapon, hm, must be a custom design"; break;
2093 }
2094 close;
2095 L_NothingEquiped:
2096 mes "Seems you have nothing equiped";
2097 close;
2098
2099---------------------------------------
2100
2101*getequippercentrefinery(<equipment slot>)
2102
2103This function calculates and returns the percent value chance to successfully
2104refine the item found in the specified equipment slot of the invoking character
2105by +1. There is no actual formula, the sucess rate for a given weapon level of
2106a certain refine level is found in the db/refine_db.txt file. For a list of
2107equipment slots see 'getequipid'.
2108
2109These values can be displayed for the player to see, or used to calculate the
2110random change of a refine succeeding or failing and then going through with it
2111(which is what the official NPC refinery scripts use it for)
2112
2113// This will find a random number from 0 - 99 and if that is equal to or more
2114// than the value recoverd by this command it will go to L_Fail
2115 if (getequippercentrefinery(EQI_HAND_L)<=rand(100)) goto L_Fail;
2116
2117---------------------------------------
2118
2119*getareadropitem("<地圖å>",<x1>,<y1>,<x2>,<y2>,<item>)
2120
2121This function will count all the items with the specified ID number lying on the
2122ground on the specified map within the x1/y1-x2/y2 square on it and return that
2123number.
2124
2125This is the only function around where a parameter may be either a string or a
2126number! If it's a number, it means that only the items with that item ID number
2127will be counted. If it is a string, it is assumed to mean the 'english name'
2128field from the item database. If you give it an empty string, or something that
2129isn't found from the item database, it will count items number '512' (apples).
2130
2131---------------------------------------
2132
2133*getequipcardcnt(<equipment slot>)
2134
2135This function will return the number of cards that have been compounded onto a
2136specific equipped item for the invoking character. See 'getequipid' for a list
2137of possible equipment slots.
2138
2139---------------------------------------
2140
2141*getinventorylist;
2142*getcartlist;
2143
2144This command sets a bunch of arrays with a complete list of whatever the
2145invoking character has in their inventory, including all the data needed to
2146recreate these items perfectly if they are destroyed. Here's what you get:
2147
2148 @inventorylist_id[] - é“å…·id
2149 @inventorylist_amount[] - å°æ‡‰æ•¸é‡
2150 @inventorylist_equip[] - 是å¦å¯ä»¥è£å‚™
2151 @inventorylist_refine[] - 精煉值
2152 @inventorylist_identify[] - 是å¦é‘’定
2153 @inventorylist_attribute[] - æ˜¯å¦æå£ž
2154 @inventorylist_card1[] - å¡ç‰‡id
2155 @inventorylist_card2[]
2156 @inventorylist_card3[]
2157 @inventorylist_card4[]
2158 @inventorylist_expire[] - éŽæœŸæ™‚é–“
2159 @inventorylist_freeze[] - 冷凿ˆªæ¢æ™‚é–“
2160 @inventorylist_durability[]- è€ä¹…度
2161 @inventorylist_maxdur[] - 最大è€ä¹…度
2162 @inventorylist_count - ç‰©å“æ¬„ä¸ç‰©å“數
2163 *以上變é‡ä¸æŠŠinventory改為cartå³ç‚ºå°æ‡‰çš„getcartlist用法。
2164
2165This could be handy to save/restore a character's inventory, since no other
2166command returns such a complete set of data, and could also be the only way to
2167correctly handle an NPC trader for carded and named items who could resell them
2168- since NPC objects cannot own items, so they have to store item data in
2169variables and recreate the items.
2170
2171Notice that the variables this command generates are all temporary, attached to
2172the character, and integer.
2173
2174Be sure to use @inventorylist_count to go through these arrays, and not
2175'getarraysize', because the arrays are not automatically cleared between runs
2176of 'getinventorylist'.
2177
2178---------------------------------------
2179
2180*cardscnt()
2181
2182This function will return the number of cards inserted into the weapon currently
2183equipped on the invoking character.
2184While this function was meant for item scripts, it will work outside them:
2185
2186 if (cardscnt()==4) mes "So you've stuck four cards into that weapon, think you're cool now?";
2187
2188---------------------------------------
2189
2190*getrefine()
2191
2192This function will return the number of plusses the weapon currently equipped on
2193the invoking character has been refined for.
2194While this function was meant for item scripts, it will work outside them:
2195
2196 if (getrefine()==10) mes "Wow. That's a murder weapon.";
2197
2198---------------------------------------
2199
2200*getnameditem(<item id>,"<name to inscribe>");
2201*getnameditem("<item name>","<name to inscribe>");
2202
2203This function is equivalent to using 'getitem', however, it will not just give
2204the character an item object, but will also inscribe it with a specified
2205character's name. You may not inscribe items with arbitrary strings, only with
2206names of characters that actually exist. While this isn't said anywhere
2207specifically, apparently, named items may not have cards in them, slots or no -
2208these data slots are taken by the character ID who's name is inscribed. Only one
2209remains free and it's not quite clear if a card may be there.
2210
2211This function will return 1 if an item was successfully created and 0 if it
2212wasn't for whatever reason. Like 'getitem', this function will also accept an
2213'english name' from the item database as an item name and will return 0 if no
2214such item exists.
2215
2216---------------------------------------
2217
2218*getitemslots(<item ID>)
2219
2220This function will look up the item with the specified ID number in the database
2221and return the number of slots this kind of items has - 0 if they are not
2222slotted. It will also be 0 for all non-equippable items, naturally, unless
2223someone messed up the item database. It will return -1 if there is no such item.
2224
2225---------------------------------------
2226
2227*getiteminfo(<item ID>,<類型>)
2228
2229This function will look up the item with the specified ID number in the database
2230and return the info set by TYPE argument.
2231It will return -1 if there is no such item.
2232
2233Valid types are:
2234 0 - Buy Price; 1 - Sell Price; 2 - Item Type;
2235 3 - maxchance (Max drop chance of this item e.g. 1 = 0.01% , etc..
2236 if = 0, then monsters don't drop it at all (rare or a quest item)
2237 if = 10000, then this item is sold in NPC shops only
2238 4 - sex; 5 - equip; 6 - weight; 7 - atk; 8 - def; 9 - range;
2239 10 - slot; 11 - 外觀; 12 - è£å‚™å¿…è¦ç‰ç´š; 13 - è£å‚™ç‰ç´šä¸Šé™ 14 - æ¦å™¨ç‰ç´š;
2240 15 - view_id(item_availä¸çš„è¨å®š); 16 - mdef; 17 - matk
2241
2242Check sample in nps\sample\getiteminfo.txt
2243
2244---------------------------------------
2245
2246*getequipcardid (<equipment slot>,<card slot>);
2247
2248Returns value from equipped item slot in the indicated slot:
2249
2250getequipcardid(num,slot)
2251
2252where:
2253 num = equip position slot
2254 slot = 0,1,2,3 (Card Slot N)
2255
2256This func returns CARD ID, 255,254,-255 (for card 0, if the item is produced) it's useful
2257when you want to check item cards or if it's signed. Useful for such quests as
2258"Sign this refined item with players name" etc;
2259 Hat[0] +4 -> Player's Hat[0] +4
2260
2261--------------------------------------
2262
2263*getitemslots (<item id>);
2264
2265Returns the amount of slots the item has.
2266
2267Example(s):
2268
2269//@slots now has the amount of slots of the item with ID 1205.
2270 set @slots, getItemSlots(1205);
2271
2272--------------------------------------
2273//
22742,1.- End of item-related commands.
2275//
2276---------------------------------------
2277
2278*getmapxy("<variable for map name>",<variable for x>,<variable for y>,<類型>{,"<search string>"})
2279
2280This function will locate a character object, NPC object or pet's coordinates
2281and place their coordinates into the variables specified when calling it. It
2282will return 0 if the search was successful, and -1 if the parameters given were
2283not variables or the search was not successful.
2284
2285Type is the type of object to search for:
2286
2287 0 - Character object
2288 1 - NPC object
2289 2 - Pet object
2290 3 - Monster object.
2291
2292While 3 is meant to look for a monster object, no searching will be done if you
2293specify type 3, and the function will always return -1.
2294
2295The search string is optional. If it is not specified, the location of the
2296invoking character will always be returned for types 0 and 2, the location of
2297the NPC running this function for type 1.
2298If a search string is specified, for types 0 and 1, the character or NPC with
2299the specified name will be located. If type is 3, the search will locate the
2300current pet of the character who's name is given in the search string, it will
2301NOT locate a pet by name.
2302
2303What a mess. Example, a working and tested one now:
2304
2305 prontera,164,301,3%TAB%script%TAB%Meh%TAB%730,{
2306 mes "My name is Meh. I'm here so that Nyah can find me.";
2307 close;
2308 }
2309
2310 prontera,164,299,3%TAB%script%TAB%Nyah%TAB%730,{
2311 mes "My name is Nyah.";
2312 mes "I will now search for Meh all across the world!";
2313 if (getmapxy(@mapname$,@mapx,@mapy,1,"Meh")!=0) goto Notfound;
2314 mes "And I found him on map "+@mapname$+" at X:"+@mapx+" Y:"+@mapy+" !";
2315 close;
2316 Notfound:
2317 mes "I can't seem to find Meh anywhere!";
2318 close;
2319 }
2320
2321Notice that NPC objects disabled with 'disablenpc' will still be located.
2322
2323---------------------------------------
2324
2325*getgmlevel()
2326
2327This function will return the GM level of the account to which the invoking
2328character belongs. If this is somehow executed from a console command, 99 will
2329be returned, and 0 will be returned if the account has no GM level.
2330
2331This allows you to make NPC's only accessable for certain GM levels, or behave
2332specially when talked to by GMs.
2333
2334 if (getgmlevel()) mes "What is your command, your godhood?";
2335 if (getgmlevel()) goto Wherever;
2336
2337---------------------------------------
2338
2339*gettimetick(<tick type>)
2340
2341This function will return the system time in UNIX epoch time (if tick type is 2)
2342or the time since the start of the current day in seconds if tick type is 1.
2343Passing 0 will make it return the server's tick, which is a measurement in
2344milliseconds used by the server's timer system. The server's tick is an
2345unsigned int which loops every ~50 days.
2346
2347Just in case you don't know, UNIX epoch time is the number of seconds elapsed
2348since 1st of January 1970, and is useful to see, for example, for how long the
2349character has been online with OnPCLoginEvent and OnPCLogoutEvent, which could allow
2350you to make an 'online time counted for conviction only' jail script.
2351
2352---------------------------------------
2353
2354*gettime(<類型>)
2355
2356This function will return specified information about the current system time.
2357
23581 - Seconds (of a minute)
23592 - Minutes (of an hour)
23603 - Hour (of a day)
23614 - Week day (0 for Sunday, 6 is Saturday)
23625 - Day of the month.
23636 - Number of the month.
23647 - Year.
23658 - Day of the year.
2366
2367It will only return numbers.
2368
2369 if (gettime(4)==6) mes "It's a Saturday. I don't work on Saturdays.";
2370
2371---------------------------------------
2372
2373*gettimestr(<format string>,<max length>)
2374
2375This function will return a string containing time data as specified by the
2376format string.
2377
2378This uses the C function 'strfmtime', which obeys special format characters. For
2379a full description see, for example, the description of 'strfmtime' at
2380http://www.delorie.com/gnu/docs/glibc/libc_437.html
2381All the format characters given in there should properly work.
2382Max length is the maximum length of a time string to generate.
2383
2384The example given in eAthena sample scripts works like this:
2385
2386 mes gettimestr("%Y-%m/%d %H:%M:%S",21);
2387
2388This will print a full date and time like 'YYYY-MM/DD HH:MM:SS'.
2389
2390---------------------------------------
2391
2392*getusers(<類型>)
2393
2394This function will return a number of users on a map or the whole server. What
2395it returns is specified by Type.
2396
2397Type can be one of the following values, which control what will be returned:
2398
2399 0 - Count of all characters on the map of the invoking character.
2400 1 - Count of all characters in the entire server.
2401 8 - Count of all characters on the map of the NPC the script is
2402 running in.
2403
2404---------------------------------------
2405
2406*getmapusers("<地圖å>")
2407
2408This function will return the number of users currently located on the specified
2409map.
2410
2411Currently being used in the PVP scripts to check if a PVP room is full of not,
2412if the number returned it equal to the maximum allowed it will not let you
2413enter.
2414
2415---------------------------------------
2416
2417*getareausers("<地圖å>",<x1>,<y1>,<x2>,<y2>)
2418
2419This function will return the count of connected characters which are located
2420within the specified area - an x1/y1-x2/y2 square on the specified map.
2421
2422This is useful for maps that are split into many buildings, such as all the
2423"*_in" maps, due to all the shops and houses.
2424
2425---------------------------------------
2426
2427*getusersname;
2428
2429This command will give the invoking character a list of names of the connected
2430characters (including themselves) into an NPC script message window (see 'mes')
2431paging it by 10 names as if with the 'next' command.
2432
2433You need to put a 'close' after that yourself.
2434
2435---------------------------------------
2436\\
24372,2.- Guild-related commands
2438\\
2439---------------------------------------
2440*getguildname(<guild id>)
2441
2442This function returns a guild's name given an ID number. If there is no such
2443guild, "null" will be returned;
2444
2445 // Would print what ever guild 10007 is, in my case this would return "AlcoROhics"
2446 mes "The guild "+GetGuildName(10007)+" are all nice people.";
2447
2448 // This will do the same as above:
2449 set @var,10007;
2450 mes "We have some friends in "+GetGuildName(@var)+", you know.";
2451
2452This is used all over the WoE controlling scripts. You could also use it for a
2453guild-based event.
2454
2455---------------------------------------
2456
2457*getguildmaster(<guild id>)
2458
2459This function return the name of the master of the guild which has the specified
2460ID number. If there is no such guild, "null" will be returned.
2461
2462// Would return the guild master of guild 10007, whatever that might be.
2463// In this example it would return "MissDjax" cause she owns "AlcoROhics" (10007)
2464 mes getguildmaster(10007)+" runs "+getguildname(10007);
2465
2466Can be used to check if the character is the guildmaster of the specified guild.
2467
2468Maybe you want to make a room only guildmasters can enter:
2469
2470 set @GID,getcharid(2);
2471 if(@GID==0) goto L_NoGuild;
2472 if(strcharinfo(0)==getguildmaster(@GID)) goto L_GuildMaster;
2473 mes "Sorry you don't own the guild you are in";
2474 close;
2475 L_NoGuild:
2476 mes "Sorry you are not in a guild";
2477 close;
2478 L_GuildMaster:
2479 mes "Welcome guild master of "+GetGuildName(@GID);
2480 close;
2481
2482
2483---------------------------------------
2484
2485*getguildmasterid(<guild id>)
2486
2487This function will return the character ID number of the guildmaster of the
2488guild specified by the ID. 0 if the character is not a guildmaster of any guild.
2489
2490---------------------------------------
2491
2492*getcastlename("<地圖å>")
2493
2494This function returns the name of the castle when given the map name for that
2495castle. The data is read from 'db/castle_db.txt'.
2496
2497---------------------------------------
2498
2499*getcastledata("<地圖å>",<type of data>)
2500*setcastledata "<地圖å>",<type of data>,<value>;
2501
2502This function returns the castle ownership information for the castle referred
2503to by it's map name. Castle information stored in 'save\castle.txt' for the TXT
2504version of the server and in 'guild_castle' table for the SQL version.
2505
2506Valid types of data are:
2507
2508 0 - Will make the map server request the castle data from the char server, and
2509 always return 0. This, apparently, will also cause indirectly the execution
2510 of an 'OnAgitInit:' event mentioned at the beginning of this document.
2511 1 - Guild ID
2512 2 - Castle Economy score.
2513 3 - Castle Defence score.
2514 4 - Number of times the economy was invested in today.
2515 5 - Number of times the defence was invested in today.
2516 9 - Will return 1 if a Kafra was hired for this castle, 0 otherwise.
251710 - Is 1 if the 1st guardian is present (Soldier Guardian)
251811 - Is 1 if the 2nd guardian is present (Soldier Guardian)
251912 - Is 1 if the 3rd guardian is present (Soldier Guardian)
252013 - Is 1 if the 4th guardian is present (Archer Guardian)
252114 - Is 1 if the 5th guardian is present (Archer Guardian)
252215 - Is 1 if the 6th guardian is present (Knight Guardian)
252316 - Is 1 if the 7th guardian is present (Knight Guardian)
252417 - Is 1 if the 8th guardian is present (Knight Guardian)
252518 - ä½”æœ‰åŸŽå ¡çš„å…¬æœƒçš„å…¬æœƒå
2526
2527The 'setcastledata' command will behave identically, but instead of returning
2528values for the specified types of accessible data, it will alter them and cause
2529them to be sent to the char server for storage. Data type of 0 won't do
2530anything, obviously.
2531
2532---------------------------------------
2533
2534*getgdskilllv(<guild id>,<skill id>)
2535*getgdskilllv(<guild id>,"<skill name>")
2536
2537This function returns the level of the skill <skill id> of the guild <guild id>.
2538If the guild does not have that skill, 0 is returned.
2539If the guild does not exist, -1 is returned.
2540Refer to 'db/skill_db.txt' for the full list of skills. (GD_* are guild skills)
2541
2542---------------------------------------
2543
2544*requestguildinfo <guild id>,"<event label>";
2545
2546This command requests the guild data from the char server and merrily continues
2547with the execution. Whenever the guild information becomes available (which
2548happens instantly if the guild information is already in memory, or later, if it
2549isn't and the map server has to wait for the char server to reply) it will run
2550the specified event as in a 'doevent' call.
2551
2552---------------------------------------
2553
2554*getmapguildusers <mapname>,<guild id>;
2555
2556Returns the amount of persons from the given guild that are on the given map.
2557Example(s):
2558
2559//Will set the @persons variable to the amount of persons from the guild
2560//which ID's = 10 and are at prontera.
2561
2562 set @persons,getMapGuildUsers "prontera",10;
2563
2564---------------------------------------
2565//
25662,2.- End of guild-related commands
2567//
2568---------------------------------------
2569
2570*getskilllv(<skill id>)
2571*getskilllv("<skill name>")
2572
2573This function returns the level of the specified skill that the invoking
2574character has. If they don't have the skill, 0 will be returned. The full list
2575of character skills is available in 'db/skill_db.txt'.
2576
2577There are two main uses for this function, it can check whether the character
2578has a skill or not, and it can tell you if the level is high enough.
2579
2580Example 1:
2581
2582 f (getskilllv(152)) goto L_HasSkillThrowStone;
2583 mes "You don't have Throw Stone";
2584 close;
2585 L_HasSkillThrowStone:
2586 mes "You have got the skill Throw Stone";
2587 close;
2588
2589Example 2:
2590
2591 if (getskilllv(28) >= 5) goto L_HasSkillHeallvl5orMore;
2592 if (getskilllv(28) == 10) goto L_HasSkillHealMaxed;
2593 mes "You heal skill is below lvl 5";
2594 close;
2595 L_HasSkillHeallvl6orMore:
2596 mes "Your heal lvl is 5 or more";
2597 close;
2598 L_HasSkillHealMaxed:
2599 mes "Your heal lvl has been maxed";
2600 close;
2601
2602---------------------------------------
2603
2604*getskilllist;
2605
2606This command sets a bunch of arrays with a complete list of skills the
2607invoking character has. Here's what you get:
2608
2609@skilllist_id[] - skill ids.
2610@skilllist_lv[] - skill levels.
2611@skilllist_flag[] - see 'skill' for the meaning of skill flags.
2612@skilllist_count - number of skills in the above arrays.
2613
2614While 'getskillv' is probably more useful for most situations, this is the
2615easiest way to store all the skills and make the character something else for a
2616while. Advanced job for a day? :) This could also be useful to see how many
2617skills a character has.
2618
2619---------------------------------------
2620
2621*getpetinfo(<類型>)
2622
2623該功能返回關è¯è§’色的寵物信æ¯ï¼Œæœ‰æ•ˆçš„類型有:
2624
2625 0 - 寵物在角色æœå‹™å™¨ä¸å„²å˜çš„唯一ID。
2626 1 - 寵物在 'db/pet_db.txt' ä¸çš„類型 。
2627 2 - 寵物åå—。如果沒有寵物返回null
2628 3 - 寵物親密度。1000è¡¨ç¤ºå¿ èª
2629 4 - 寵物飢餓度。100表示åƒé£½
2630 5 - å¯µç‰©æ˜¯å¦æ”¹éŽåå—。0表示沒有
2631 6 - 寵物是å¦è£å‚™äº†è£å‚™ã€‚0表示沒有è£å‚™
2632 7 - 寵物ç‰ç´š
2633---------------------------------------
2634
2635*gethominfo(<類型>)
2636
2637This function works as a direct counterpart of 'getpetinfo':
2638 0 - Homunculus unique ID
2639 1 - Homunculus Class
2640 2 - Name
2641 3 - Friendly level (intimacy score). 100000 is full loyalty.
2642 4 - Hungry level. 100 is completely full.
2643 5 - Rename flag. 0 means this homunculus has not been named yet.
2644 6 - Homunculus level
2645---------------------------------------
2646
2647
2648*petstat(<標記>)
2649
2650Returns current pet status, all are integers except name.
2651Returns 0 or "" if the player doesn't have pets.
2652
2653Flags usable >>
2654PET_CLASS
2655PET_NAME
2656PET_LEVEL
2657PET_HUNGRY
2658PET_INTIMATE
2659
2660舉例:
2661set @i, petstat(PET_CLASS);
2662
2663
2664---------------------------------------
2665
2666*getmonsterinfo(<mob ID>,<類型>)
2667
2668This function will look up the monster with the specified ID number in the
2669mob database and return the info set by TYPE argument.
2670It will return -1 if there is no such monster (or the type value is invalid),
2671or "null" if you requested the monster's name.
2672
2673Valid types are listed in const.txt:
2674 MOB_NAME 0 MOB_LV 1
2675 MOB_MAXHP 2 MOB_BASEEXP 3
2676 MOB_JOBEXP 4 MOB_ATK1 5
2677 MOB_ATK2 6 MOB_DEF 7
2678 MOB_MDEF 8 MOB_STR 9
2679 MOB_AGI 10 MOB_VIT 11
2680 MOB_INT 12 JOB_DEX 13
2681 MOB_LUK 14 MOB_RANGE 15
2682 MOB_RANGE2 16 MOB_RANGE3 17
2683 MOB_SIZE 18 MOB_RACE 19
2684 MOB_ELEMENT 20 MOB_MODE 21
2685 MVP_EXP 22
2686
2687Check sample in nps\sample\getmonsterinfo.txt
2688
2689---------------------------------------
2690
2691*getmobdrops(<é”物 id>)
2692
2693This command will find all drops of the specified mob and return the item IDs
2694and drop percentages into arrays of temporary global variables.
2695'getmobdrops' returns 1 if successful and 0 if the mob ID doesn't exist.
2696
2697Upon executing this,
2698
2699$@MobDrop_item[] é”物掉è½çš„物å“id數列
2700
2701$@MobDrop_rate[] é”物掉è½çš„物å“的幾率數列 (1 = .01%)
2702
2703$@MobDrop_count é”物掉è½çš„ç‰©å“æ•¸é‡
2704
2705Be sure to use $@MobDrop_count to go through the arrays, and not
2706'getarraysize', because the temporary global arrays are not cleared between
2707runs of 'getmobdrops'. If a mob with 7 item drops is looked up, the arrays would
2708have 7 elements. But if another mob is looked up and it only has 5 item drops,
2709the server will not clear the arrays for you, overwriting the values instead. So
2710in addition to returning the 5 item drops, the 6th and 7th elements from the
2711last call remain, and you will get 5+2 item drops, of which the last 2 don't
2712belong to the new mob. $@MobDrop_count will always contain the correct number
2713(5), unlike 'getarraysize()' which would return 7 in this case.
2714
2715舉例:
2716
2717 // get a Mob ID from the user
2718 input .@mob_id;
2719
2720 if (getmobdrops(.@mob_id)) { // 'getmobdrops' returns 1 on success
2721 // immediately copy global temporary variables into scope variables,
2722 // since we don't know when 'getmobdrops' will get called again for
2723 // another mob, overwriting your global temporary variables
2724 set .@count, $@MobDrop_count;
2725 copyarray .@item[0],$@MobDrop_item[0],.@count;
2726 copyarray .@rate[0],$@MobDrop_rate[0],.@count;
2727
2728 mes getmonsterinfo(.@mob_id,MOB_NAME) + " - " + .@count + " drops found:";
2729 for( set .@i,0; .@i < .@count; set .@i,.@i +1 ) {
2730 mes .@item[.@i] + " (" + getitemname(.@item[.@i]) + ") " + .@rate[.@i]/100 + ((.@rate[.@i]%100 < 10) ? ".0":".") + .@rate[.@i]%100 + "%";
2731 }
2732 } else {
2733 mes "Unknown monster ID.";
2734 }
2735 close;
2736
2737---------------------------------------
2738
2739*getmapmobs("<地圖å>")
2740*getareamobs("<地圖å>",<x0>,<y0>,<x1>,<y1>)
2741
2742This function will return the total count of monsters currently located on the
2743specified map. If the map name is given as "this", the map the invoking
2744character is on will be used. If the map is not found, or the invoker is not a
2745character while the map is "this", it will return -1.
2746
2747---------------------------------------
2748
2749*getstrlen("<string>")
2750
2751This function will return the length of the string given as an argument. It is
2752useful to check if anything input by the player exceeds name length limits and
2753other length limits and asking them to try to input something else.
2754
2755---------------------------------------
2756
2757*skillpointcount;
2758
2759Returns the total amount of skill points a character posesses (SkillPoint+SP's used in skills)
2760This command can be used to check the currently attached characters total amount of skillpoints.
2761This means the skillpoints used in skill are counted, and added to SkillPoints (number of skill points not used).
2762
2763舉例:
2764
2765//This will set the temp character variable @skillPoints to the amount of skillpoints,
2766//and then tell the player the value.
2767 set @skillPoints, skillPointCount();
2768 mes "You have "+@skillPoints+" skillpoints in total!";
2769
2770//Self-explanatory... :P
2771 if (skillPointCount() > 20)
2772 mes "Wow, you have more then 20 Skill Points in total!";
2773
2774---------------------------------------
2775
2776*getscrate(<effect type>,<base rate>{,<target ID number>})
2777
2778This function will return the chance of a status effect affecting the invoking
2779character, in percent, modified by the their current defense against said
2780status. The 'base rate' is the base chance of the status effect being inflicted,
2781in percent.
2782
2783 if (rand(100) > getscrate(Eff_Blind, 50)) goto BlindHimNow;
2784
2785You can see the full list of available effect types you can possibly inflict in
2786'db/const.txt' under 'Eff_'.
2787
2788It is pretty certain that addressing the target by an ID number will not
2789currently work due to a bug.
2790
2791---------------------------------------
2792
2793========================
2794|3.- Checking commands.|
2795========================
2796-------------------------
2797
2798*playerattached;
2799*mobattached;
2800
2801返回關è¯ç•¶å‰è…³æœ¬çš„玩家AID/é”物GID. å¦‚æžœæ²’äººé—œè¯æœƒè¿”回0.
2802
2803-------------------------
2804
2805*isloggedin(<account id>{,<char id>});
2806
2807This function returns 1 if the specified account is logged in and 0 if they
2808aren't. You can also pass the char_id to check for both account and char id.
2809
2810會返回2,如果該玩家是離線掛店;返回3,如果玩家使用了@offline指令。
2811
2812---------------------------------------
2813
2814*checkweight(<item id>,<amount>)
2815*checkweight("<item name>",<amount>)
2816
2817This function will compute and return 1 if the total weight of a specified
2818number of specific items does not exceed the invoking character's carrying
2819capacity, and 0 otherwise. It is important to see if a player can carry the
2820items you expect to give them, failing to do that may open your script up to
2821abuse or create some very unfair errors.
2822
2823This function, in addition to checking to see if the player is capable of
2824holding a set amount of items, also ensures the player has room in their
2825inventory for the item(s) they will be receciving.
2826
2827Like 'getitem', this function will also accept an 'english name' from the
2828database as an argument.
2829
2830 checkweight(502,10) // 10 apples
2831
2832 if (checkweight(502,10) == 0 ) goto L_OverWeight;
2833 getitem 502,10;
2834 close;
2835 L_OverWeight:
2836 mes "Sorry you cannot hold this ammount of apples";
2837 close;
2838
2839Or to put this another way:
2840
2841 if (checkweight("APPLE",10)) goto L_Getapples;
2842 mes "Sorry you cannot hold this ammount of apples";
2843 close;
2844 L_Getapples:
2845 getitem 502,10;
2846 close;
2847
2848Both these examples have the same effect.
2849
2850---------------------------------------
2851
2852*basicskillcheck()
2853
2854This function will return the state of the configuration option
2855'basic_skill_check' in 'battle_athena.conf'. It returns 1 if the option is
2856enabled and 0 if it isn't. If the 'basic_skill_check' option is enabled, which
2857it is by default, characters must have a certain number of basic skill levels to
2858sit, request a trade, use emoticons, etc. Making your script behave differently
2859depending on whether the characters must actually have the skill to do all these
2860things might in some cases be required.
2861
2862---------------------------------------
2863
2864*checkoption(<option number>)
2865*checkoption1(<option number>)
2866*checkoption2(<option number>)
2867*setoption <option number>{,<標記>};
2868
2869The 'setoption' series of functions check for a so-called option that is set on
2870the invoking character. 'Options' are used to store status conditions and a lot
2871of other non-permanent character data of the yes-no kind. For most common cases,
2872it is better to use 'checkcart','checkfalcon','checkpeco' and other similar
2873functions, but there are some options which you cannot get at this way. They
2874return 1 if the option is set and 0 if the option is not set.
2875
2876Option numbers valid for the first (option) version of this command are:
2877
28780x1 - Sight in effect.
28790x2 - Hide in effect.
28800x4 - Cloaking in effect.
28810x8 - Cart number 1 present.
28820x10 - Falcon present.
28830x20 - Peco Peco present.
28840x40 - GM Perfect Hide in effect.
28850x80 - Cart number 2 present.
28860x100 - Cart number 3 present.
28870x200 - Cart number 4 present.
28880x400 - Cart number 5 present.
28890x800 - Orc head present.
28900x1000 - The character is wearing a wedding sprite.
28910x2000 - Ruwach is in effect.
28920x4000 - Chasewalk in effect.
28930x8000 - Flying or Xmas suit.
28940x10000 - Sighttrasher.
2895
2896Option numbers valid for the second version (opt1) of this command are:
2897
28981 - Petrified.
28992 - Frozen.
29003 - Stunned.
29014 - Sleeping.
29026 - Petrifying (the state where you can still walk)
2903
2904Option numbers valid for the third version (opt2) of this command are:
2905
29060x1 - Poisoned.
29070x2 - Cursed.
29080x4 - Silenced.
29090x8 - Signum Crucis (plays a howl-like sound effect, but otherwise no visible effects are displayed)
29100x10 - Blinded.
29110x80 - Deadly poisoned.
2912
2913Option numbers (except for opt1) are bitmasks - you can add them up to check
2914 for several states, but the functions will return true if at least one of them
2915 is in effect.
2916
2917'setoption' will set options on the invoking character. There are no second and
2918third versions of this command, so you can only change the values in the first
2919list (cloak, cart, ruwach, etc). if flag is 1 (default when omitted),
2920the option will be added to what the character currently has; if 0, the option is removed.
2921
2922This is definitely not a complete list of available option flag numbers. Ask a
2923core developer (or read the source: src/map/status.h) for the full list.
2924
2925---------------------------------------
2926
2927*setcart {<類型>};
2928*checkcart()
2929
2930If <類型> is 0 this command will remove the cart from the character.
2931Otherwise it gives the invoking character a cart. The cart given will be
2932cart number <類型> and will work regardless of whether the character is a
2933merchant class or not.
2934Note: the character needs to have the skill MC_PUSHCART to gain a cart
2935
2936The accompanying function will return 1 if the invoking character has a cart
2937(any kind of cart) and 0 if they don't.
2938
2939 if (checkcart()) mes "But you already have a cart!";
2940
2941---------------------------------------
2942
2943*setfalcon {<標記>};
2944*checkfalcon()
2945
2946If <標記> is 0 this command will remove the falcon from the character.
2947Otherwise it gives the invoking character a falcon. The falcon will be there
2948regardless of whether the character is a hunter or not. It will (probably) not
2949have any useful effects for non-hunters though.
2950Note: the character needs to have the skill HT_FALCON to gain a falcon
2951
2952The accompanying function will return 1 if the invoking character has a falcon
2953and 0 if they don't.
2954
2955 if (checkfalcon()) mes "But you already have a falcon!";
2956
2957---------------------------------------
2958
2959*setwarg {<標記>};
2960*checkwarg()
2961
2962If <標記> is 0 this command will remove the warg from the character.
2963Otherwise it gives the invoking character a warg. The warg will be there
2964regardless of whether the character is a ranger or not. It will (probably) not
2965have any useful effects for non-rangers though.
2966Note: the character needs to have the skill 狼訓練 to gain a warg
2967
2968The accompanying function will return 1 if the invoking character has a warg
2969and 0 if they don't.
2970
2971 if (checkwarg()) mes "But you already have a warg!";
2972
2973---------------------------------------
2974
2975*setriding {<標記>};
2976*checkriding()
2977
2978If <標記> is 0 this command will remove the mount from the character.
2979Otherwise it give the invoking character a PecoPeco (if they are a Knight
2980series class) or a GrandPeco (if they are a Crusader seriesclass). Unlike
2981'setfalcon' and 'setcart' this will not work at all if they aren't of a class
2982which can ride.
2983Note: the character needs to have the skill KN_RIDING to gain a mount
2984
2985The accompanying function will return 1 if the invoking character is riding a
2986bird and 0 if they don't.
2987
2988 if (checkriding()) mes "PLEASE leave your bird outside! No riding birds on the floor here!";
2989
2990---------------------------------------
2991
2992*checkvending ({"<player name>"})
2993*checkchatting ({"<Player Name>"})
2994
2995If the player's name is given, this command checks for that player
2996to be online and wether he/she is chatting or vending.
2997When no name is given, the attached player is used for checking.
2998Returns true or false (1 or 0) when the player is chatting/vending or not.
2999
3000Example(s):
3001if (checkVending("Aaron")) mes "Aaron is currently vending!";
3002 //This will check if Aaron is vending, and if so, put a message in front
3003 //of the attached player saying Aaron is vending.
3004
3005if (checkChatting()) mes "You are currently chatting!";
3006 //This will check if you're in a chat room or not
3007
3008---------------------------------------
3009
3010*agitcheck()
3011*agitcheck2()
3012*agitcheck3()
3013
3014This function will let you check whether the server is currently in WoE mode.
3015It will return 1 if the War of Emperium is on and 0 if it isn't.
3016
3017---------------------------------------
3018
3019*isnight()
3020*isday()
3021
3022These functions will return 1 or 0 depending on whether the server is in night
3023mode or day mode. 'isnight' returns 1 if it's night and 0 if it isn't, 'isday'
3024the other way around. They can be used interchangeably, pick the one you like
3025more:
3026
3027 // These two are equivalent:
3028 if (isday()) mes "I only prowl in the night.";
3029 if (isnight()!=1) mes "I only prowl in the night.";
3030
3031---------------------------------------
3032\\
30333,1.- Item-related commands
3034\\
3035---------------------------------------
3036*isequipped(<id>{,<id>{,<id>{,<id>}}})
3037
3038This function will return 1 if the invoking character has all of the item
3039IDs given equipped (if card IDs are passed, then it checks if the cards are
3040inserted into slots in the equipment they are currently wearing). Theorically
3041there is no limit to the number of items that may be tested for at the same time.
3042If even one of the items given is not equipped, 0 will be returned.
3043
3044 // (Poring,Santa Poring,Poporing,Marin)
3045 if (isequipped(4001,4005,4033,4196)) mes "Wow! You're wearing a full complement of possible poring cards!";
3046 // (Poring)
3047 if (isequipped(4001)) mes "A poring card is useful, don't you think?";
3048
3049The function was meant for item scripts to support the cards released by Gravity
3050in February 2005, but it will work just fine in normal NPC scripts.
3051
3052---------------------------------------
3053
3054*isequippedcnt(<card id>{,<card id>{,<card id>{,<card id>}}})
3055
3056This function is similar to 'isequipped', but instead of 1 or 0, it will return
3057the number of cards in the list given that were found on the invoking character.
3058
3059 if (isequippedcnt(4001,4005,4033,4196)=4) mes "Finally got all four poring cards?";
3060
3061---------------------------------------
3062
3063*checkequipedcard(<card id>)
3064
3065This function will return 1 if the card specified by it's item ID number is
3066inserted into any equipment they have in their inventory, currently equipped or
3067not.
3068
3069---------------------------------------
3070
3071*getequipisidentify(<equipment slot>)
3072
3073This function will return 1 if an item in the specified equipment slot is
3074identified and 0 if it isn't. Since you can't even equip unidentified equipment,
3075there's a question of whether it can actually end up there, and it will normally
3076return 1 all the time if there is an item in this equipment slot.
3077Which is kinda pointless.
3078For a list of equipment slots see 'getequipid'.
3079
3080---------------------------------------
3081//
30823,1.- End of item-related commands
3083//
3084---------------------------------------
3085
3086==============================
3087|4.- Player-related commands.|
3088==============================
3089-------------------------
3090
3091*attachrid(<account ID>)
3092*mobattachrid(<GID>) ä¸Šé¢æŒ‡ä»¤çš„é”物版本
3093*detachrid;
3094
3095A 'RID' is an ID of a character who caused the NPC script to run, as has been
3096explained above in the introduction section. Quite a bit of commands want a RID
3097to work, since they wouldn't know where to send information otherwise. And in
3098quite a few cases the script gets invoked with a RID of zero (like through
3099OnTime special labels). If an NPC script needs this, it can attach a specified
3100character's id to itself. by calling the 'attachrid' function.
3101
3102'attachrid' returns 1 if the character was found online and 0 if it wasn't.
3103
3104This could also be used, while running in a script invoked by a character
3105through talking to an NPC, to mess with other characters.
3106Detaching the RID will make the RID of the script zero.
3107
3108---------------------------------------
3109
3110*rid2name(<rid>)
3111
3112Converts rid to name. Note: The player/monster/NPC must be online/enabled.
3113Good for PCKillEvent where you can convert 'killedrid' to the name of the player.
3114
3115Note: rid2name may not produce correct character names since rid = account id.
3116 It will return the current online character of the account only.
3117
3118---------------------------------------
3119
3120*message "<character name>","<message>"{,"<類型或密語å>"};
3121
3122That command will send a message to the chat window of the character specified
3123by name. The text will also appear above the head of that character. It will not
3124be seen by anyone else.
3125
3126類型:
31270: å°è‡ªå·±é¡¯ç¤º
31281: 公共èŠå¤©
31292: 組隊èŠå¤©
31303: 公會èŠå¤©
3131指定密語åï¼Œå‰‡ç‚ºæ‚„æ‚„è©±ï¼Œå¯†èªžåæ”¯æŒé »é“å。
3132
3133---------------------------------------
3134
3135*dispbottom "<message>";
3136
3137This command will send the given message into the invoking character's chat
3138window.
3139
3140---------------------------------------
3141
3142*warp "<地圖å>",<x>,<y>;
3143
3144This command will take the invoking character to the specifed map, and if
3145wanted, specified coordinates too, but these can be random.
3146
3147 warp "place",50,55;
3148
3149This would take them to X 50 Y 55 on the map called "place". If your X and Y
3150coordinates land on an unwalkable map square, it will send the warped character
3151to a random place. Same will happen if they are both zero:
3152
3153 warp "place",0,0;
3154
3155Notice that while warping people to coordinates 0,0 will normally get them into
3156a random place, it's not certain to always be so. Darned if I know where this is
3157actually coded, it might be that this happens because square 0,0 is unwalkable
3158on all official maps. If you're using custom maps, beware.
3159
3160There are also three special 'map names' you can use.
3161
3162"Random" will warp the player randomly on the current map.
3163"Save" and "SavePoint" will warp the player back to their savepoint.
3164
3165---------------------------------------
3166
3167*areawarp "<from map name>",<x1>,<y1>,<x2>,<y2>,"<to map name>",<x3>,<y3>{,<x4>,<y4>};
3168
3169This command is similar to 'warp', however, it will not refer to the invoking
3170character, but instead, all characters within a specified area, defined by the
3171x1/y1-x2/y2 square, will be warped. Nobody outside the area will be affected,
3172including the activating character, if they are outside the area.
3173
3174 areawarp "place",10,10,120,120,"place2",150,150;
3175
3176Everyone that is in the area between X 10 Y 10 and X 120 Y 120, in a square
3177shape, on the map called "place", will be affected, and warped to "place2" X 150
3178Y 150
3179
3180 areawarp "place",10,10,120,120,"place2",0,0;
3181
3182By using ,0,0; as the destination coordinates it will take all the characters in
3183the affected area to a random set of co-ordinates on "place2".
3184
3185Like 'warp', areawarp will also explicitly warp characters randomly into the
3186current map if you give the 'to map name' as "Random".
3187
3188 如果有x4,y4,則傳é€å¥—x3,x4,y3,y4組æˆçš„å€åŸŸè£¡ã€‚
3189
3190See also 'warp'.
3191
3192---------------------------------------
3193
3194*warpparty "<to_mapname>",<x>,<y>,<party_id>,{"<from_mapname>"};
3195
3196Warps a party to specified map and coordinate given the party ID, which you can get with
3197getcharid(1). You can also request another party id given a member's name with getcharid(1,<player_name>).
3198
3199You can use the following "map names" for special warping behaviour:
3200Random: All party members are randomly warped in their current map (as if they
3201 all used a fly wing)
3202SavePointAll: All party members are warped to their respective save point.
3203SavePoint: All party members are warped to the save point of the currently
3204 attached player (will fail if there's no player attached).
3205Leader: All party members are warped to the leader's position. The leader must
3206 be online and in the current map-server for this to work.
3207
3208If you specify a from_mapname, warpparty will only affect those on that map.
3209
3210舉例:
3211mes "[Party Warper]";
3212mes "Here you go!";
3213close2;
3214set @id,getcharid(1);
3215warpparty "prontera",150,100,@id;
3216close;
3217
3218---------------------------------------
3219
3220*warpchar "<mapname>",<x>,<y>,<char_id>;
3221
3222Warps another player to specified map and coordinate given the char id, which you can get with
3223getcharid(0,<player_name>). Obviously this is useless if you want to warp the same player that
3224is executing this script, unless it's some kind of "chosen" script.
3225
3226舉例:
3227
3228warpchar "prontera",150,100,20000001;
3229
3230---------------------------------------
3231
3232*warpguild "<mapname>",<x>,<y>,<guild_id>;
3233
3234Warps a guild to specified map and coordinate given the guild id, which you can get with
3235getcharid(2). You can also request another guild id given the member's name with getcharid(2,<player_name>).
3236
3237舉例:
3238
3239warpguild "prontera",x,y,Guild_ID;
3240
3241---------------------------------------
3242
3243*warppartner("<地圖å>",<x>,<y>);
3244
3245This function will find the invoking character's marriage partner, if any, and
3246warp them to the map and coordinates given. Go kidnap that spouse. :) It will
3247return 1 upon success and 0 if the partner is not online, the character is not
3248married, or if there's no invoking character (no RID). 0,0 will, as usual,
3249normally translate to random coordinates.
3250
3251---------------------------------------
3252
3253*savepoint "<地圖å>",<x>,<y>;
3254*save "<地圖å>",<x>,<y>;
3255
3256This command saves where the invoking character will return to upon
3257'return to save point', if dead or in some other cases. The two versions are
3258equivalent. Map name, X coordinate and Y coordinate should be perfectly obvious.
3259This ignores any and all map flags, and can make a character respawn where no
3260teleportation is otherwise possible.
3261
3262 savepoint "place",350,75;
3263
3264---------------------------------------
3265
3266*heal <hp>,<sp>;
3267
3268This command will heal a set amount of HP and/or SP on the invoking character.
3269
3270 heal 30000,0; // This will heal 30,000 HP
3271 heal 0,30000; // This will heal 30,000 SP
3272 heal 300,300; // This will heal 300 HP and 300 SP
3273
3274This command just alters the hit points and spell points of the invoking
3275character and produces no other output whatsoever.
3276
3277---------------------------------------
3278
3279*itemheal <hp>,<sp>;
3280
3281This command works on the invoking character like 'heal', however, it is not
3282normally used in NPC scripts and will not work as expected there, but is used
3283all over in item scripts.
3284
3285Unlike 'heal', which just alters hp/sp and doesn't do anything else at all, this
3286command also shows healing animations for potions and other stuff, checks
3287whether the potion was made by a famous alchemist and alters the amount healed,
3288etc, etc. Since which kind of effect is shown depends on what item was used,
3289using it in an NPC script will not have a desired effect.
3290
3291There is also a nice example on using this with the 'rand' function, to give you
3292a random ammount of healing.
3293
3294 // This will heal anything thing from 100 to 150 HP and no SP
3295 itemheal rand(100,150),0;
3296
3297---------------------------------------
3298
3299*percentheal <hp>,<sp>;
3300
3301This command will heal the invoking character. It heals the character, but not
3302by a set value - it adds percent of their maximum HP/SP.
3303
3304 percentheal 100,0; // This will heal 100% HP
3305 percentheal 0,100; // This will heal 100% SP
3306 percentheal 50,50; // This will heal 50% HP and 50% SP
3307
3308So the amount that this will heal will depend on the total ammount of HP or SP
3309you have maximum. Like 'heal', this will not call up any animations or effects.
3310
3311---------------------------------------
3312
3313*recovery;
3314
3315This command will revive and restore full HP and SP to all characters currently
3316connected to the server.
3317
3318---------------------------------------
3319
3320*jobchange <job number>{,<upper flag>};
3321
3322This command will change the job class of the invoking character.
3323
3324 jobchange 1; // This would change your player into a Swordman
3325 jobchange 4002; // This would change your player into a Swordman High
3326
3327This command does work with numbers, but you can also use job names. The full
3328list of job names and the numbers they correspond to can be found in
3329'db/const.txt'.
3330
3331 // This would change your player into a Swordman
3332 jobchange Job_Swordman;
3333 // This would change your player into a Swordman High
3334 jobchange Job_Swordman_High;
3335
3336'upper flag' can alternatively be used to specify the type of job one changes
3337to. For example, jobchange Job_Swordman,1; will change the character to a high
3338swordsman. The upper values are:
3339-1 (or when omitted): preserves the current job type.
33400: Normal/standard classes
33411: High/Advanced classes
33422: Baby classes
3343
3344This command will also set a permanent character-based variable
3345'jobchange_level' which will contain the job level at the time right before
3346changing jobs, which can be checked for later in scripts.
3347
3348---------------------------------------
3349
3350*jobname (<job number>)
3351
3352This command retrieves the name of the given job using the msg_athena entries 550->650.
3353
3354 mes "[Kid]";
3355 mes "I never thought I'd met a "+jobname(Class)+" here of all places.";
3356 close;
3357
3358---------------------------------------
3359
3360*eaclass ({<job number>})
3361
3362This commands returns the "eA job-number" corresponding to the given class (if none is given, it returns uses
3363the invoking player's class as argument). The eA job-number is also a class number system, but it's one that
3364comes with constants which make it easy to convert among classes. The command will return -1 if you pass it a
3365job number which doesn't has a eA Job value equivalent.
3366
3367 set @eac, eaclass();
3368 if ((@eac&EAJ_BASEMASK) == EAJ_SWORDMAN)
3369 mes "You must be a swordman, knight, crusader, paladin, high swordman, lord knight, baby swordman,";
3370 mes "baby knight or baby crusader.";
3371 if (@eac&EAJL_UPPER)
3372 mes "You are a rebirth job.";
3373 if ((@eac&EAJ_UPPERMASK) == EAJ_SWORDMAN)
3374 mes "You must be a Swordman, Baby Swordman or High Swordman.";
3375
3376For more information on the eA Job System, see the docs/ea_job_system.txt file.
3377
3378---------------------------------------
3379*roclass <job number> {,<gender>}
3380
3381Does the opposite of eaclass. That is, given a eA Job class, it returns which is the corresponding RO class number.
3382A gender is required because both Bard and Dancers share the same eA Job value (EAJ_BARDDANCER), if it isn't given, the
3383gender of the executing player is taken (if there's no player running the script, male will be used by default).
3384The command returns -1 when there isn't a valid class to represent the required job (for example, if you try to get the
3385baby version of a Taekwon class).
3386
3387 set @eac, eaclass();
3388 //Check if class is already rebirth
3389 if (@eac&EAJL_UPPER) {
3390 mes "You look strong.";
3391 close;
3392 }
3393 set @eac, roclass(@eac|EAJL_UPPER);
3394 //Check if class has a rebirth version
3395 if (@eac != -1) {
3396 mes "Bet you can't wait to become a "+jobname(@eac)+"!";
3397 close;
3398 }
3399
3400---------------------------------------
3401
3402*changebase <job ID number>;
3403
3404This will change the appearance of the invoking character to that of a specified
3405job class. Nothing but appearance will change. This command is used in item
3406scripts for "Wedding Dress" and "Tuxedo" so the character like job 22, which is
3407the job number of the wedding sprites.
3408
3409It would be entered in the equip bonus section of an item
3410
34112338,Wedding_Dress,Wedding Dress,5,43000,,500,,0,,0,119529470,7,0,16,,0,1,0,{ bonus bMdef,15; changebase 22; }
3412
3413This command only works when inside item scripts.
3414
3415---------------------------------------
3416
3417*classchange <view id>,<類型>;
3418
3419This command is very ancient, it's origins are clouded in mystery.
3420It will send a 'display id change' packet to everyone in the immediate area of
3421the NPC object, which will supposedly make the NPC look like a different sprite,
3422an NPC sprite ID, or a monster ID. This effect is not stored anywhere and will
3423not persist (Which is odd, cause it would be relatively easy to make it do so)
3424and most importantly, will not work at all since this command was broken with
3425the introduction of advanced classes. The code is written with the assumption
3426that the lowest sprite IDs are the job sprites and the anything beyond them is
3427monster and NPC sprites, but since the advanced classes rolled in, they got the
3428ID numbers on the other end of the number pool where monster sprites float.
3429
3430As a result it is currently impossible to call this command with a valid view
3431id. It will do nothing whatsoever if the view ID is below 4047. Getting it to
3432run will actually just crash the client.
3433
3434It could be a real gem if it can be gotten to actually do what it's supposed to
3435do, but this will only happen in a later SVN revision.
3436
3437---------------------------------------
3438
3439*changesex;
3440
3441This command will change the gender for the attached character's account. If it
3442was male, it will become female, if it was female, it will become male. The
3443change will be written to the character server, the player will receive the
3444message: "Need disconnection to perform change-sex request..." and the player
3445will be immediately kicked to the login screen. When they log back in, they will
3446be the opposite sex.
3447
3448If there are any Dancer/Gypsy or Bard/Clown characters on the account,
3449they will also have their skills reset upon 'changesex'.
3450
3451---------------------------------------
3452
3453*getexp <base xp>,<job xp>;
3454
3455This command will give the invoking character a specified number of base and job
3456experience points. Can be used as a quest reward. Negative values won't work.
3457
3458 getexp 10000,5000;
3459
3460You can also use the "set" command with the constants defined in 'db/const.txt':
3461
3462 // These 2 combined has the same effect as the above command
3463 set BaseExp,BaseExp+10000;
3464 set JobExp,JobExp+5000;
3465
3466You can also reduce the ammount of experience points:
3467
3468 set BaseExp,BaseExp-10000;
3469
3470Note that 'getexp' is now subject to the 'quest_exp_rate' config option, which
3471adjusts the gained value. If you want to bypass this, use the 'set' method.
3472
3473---------------------------------------
3474
3475*setlook <look type>,<look value>;
3476*changelook <look type>,<look value>;
3477
3478'setlook' will alter the look data for the invoking character. It is used
3479mainly for changing the palette used on hair and clothes: you specify which look
3480type you want to change, then the palette you want to use. Make sure you specify
3481a palette number that exists/is usable by the client you use.
3482'changelook' works the same, but is only client side (it doesn't save the look value).
3483
3484 // This will change your hair(6), so that it uses palette 8, what ever your
3485 // palette 8 is, your hair will use that colour
3486
3487 setlook 6,8;
3488
3489 // This will change your clothes(7), so they are using palette 1, whatever
3490 // your palette 1 is, your clothes will then use that set of colours.
3491
3492 setlook 7,1;
3493
3494Here are the possible look types:
3495
3496 0 - è·æ¥
3497 1 - 髮型
3498 2 - æ¦å™¨
3499 3 - é 下
3500 4 - é 上
3501 5 - é ä¸
3502 6 - é é«®é¡è‰²
3503 7 - è¡£æœé¡è‰²
3504 8 - 盾
3505 9 - éž‹å
3506 12 - 披肩
3507 13 - è¡£æœ
3508
3509Whatever 'shoes' means is anybody's guess, ask Gravity - the client does nothing
3510with this value. It still wants it from the server though, so it is kept, but
3511normally doesn't do a thing.
3512
3513Only the look data for hairstyle, hair color and clothes color are saved to the
3514char server's database and will persist. The rest freely change as the character
3515puts on and removes equipment, changes maps, logs in and out and otherwise you
3516should not expect to set them. In fact, messing with them is generally
3517hazardous, do it at your own risk, it is not tested what will this actually do -
3518it won't cause database corruption and probably won't cause a server crash, but
3519it's easy to crash the client with just about anything unusual.
3520
3521However, it might be an easy way to quickly check for empty view IDs for
3522sprites, which is essential for making custom headgear.
3523
3524Since a lot of people have different palettes for hair and clothes, it's
3525impossible to tell you what all the colour numbers are. If you want a serious
3526example, there is a Stylist script inside the default eAthena installation that
3527you can look at, this may help you create a Stylist of your own:
3528'custom\dye.txt'
3529
3530---------------------------------------
3531\\
35324,1.- Item-related commands
3533\\
3534---------------------------------------
3535
3536*getitem <item id>,<amount>{,<account ID>};
3537*getitem "<item name>",<amount>{,<account ID>};
3538
3539This command will give a specific amount of specified items to the target
3540character. If the character is not online, nothing will happen.
3541If <character ID> is not specified, items will be created in the invoking
3542character inventory instead.
3543
3544In the first and most commonly used version of this command, items are
3545referred to by their database ID number found inside 'db/item_db.txt'.
3546
3547 getitem 502,10 // The person will receive 10 apples
3548 getitem 617,1 // The person will receive 1 Old Violet Box
3549
3550Giving an item ID of -1 will give a specified number of random items from the
3551list of those that fall out of Old Blue Box. Unlike in all other cases, these
3552will be unidentified, if they turn out to be equipment. This is exactly what's
3553written in the Old Blue Box's item script.
3554
3555Other negative IDs also correspond to other random item generating item tables:
3556
3557Giving an item ID of -2 will produce the effects of Old Violet Box.
3558Giving an item ID of -3 will produce the effects of Old Card Album.
3559Giving an item ID of -4 will produce the effects of Gift Box.
3560Giving an item ID of -5 will produce the effects of Worn Out Scroll, which, in
3561current SVN, drops only Jellopies anyway.
3562
3563This transaction is logged if the log script generated transactions option is
3564enabled.
3565
3566You may also create an item by it's name in the 'english name' field in the
3567item database:
3568
3569 getitem "RED_POTION",10;
3570
3571Which will do what you'd expect. If it can't find that name in the database,
3572apples will be created anyway. It is often a VERY GOOD IDEA to use it like this.
3573
3574This is used in pretty much all NPC scripts that have to do with items and
3575quite a few item scripts. For more examples check just about any official script.
3576
3577---------------------------------------
3578
3579*getitem2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
3580*getitem2 "<Item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
3581
3582This command will give an amount of specified items to the invoking character.
3583If an optional character ID is specified, and that character is currently
3584online, items will be created in their inventory instead. If they are not
3585online, nothing will happen. It works essentially the same as 'getitem' (it even
3586works for negative ID numbers the same way, which is kinda silly) but is a lot
3587more flexible, since it allows you to give the player an item altered with it's
3588specific properties.
3589
3590Those parameters that are different from 'getitem' are:
3591
3592identify - Whether you want the item to be identified or not, 0 unidentified,
3593 1 identified.
3594refine - For how many plusses will it be refined.
3595 It will not let you refine an item higher than +10, if you
3596 specify more it'll still be 10.
3597attribute - Whether the item is broken (1) or not (0) and NOT an elemental
3598 attribute.
3599card1,2,3,4 - If you want a card compound to it, place the card ID number into
3600 the specific card slot. Card ID numbers also found in
3601 'db/item_db.txt'
3602
3603Card1-card4 values are also used to store name information for named items, as
3604well as the elemental property of weapons and armor. You can create a named item
3605in this manner, however, if you just need a named piece of standard equipment,
3606it is much easier to the 'getnameditem' function instead.
3607
3608You will need to keep these values if you want to destroy and then perfectly
3609recreate a named item, for this see 'getinventorylist'.
3610
3611If you still want to try creating a named item with this command because
3612'getnameditem' won't do it for you cause it's too limited, you can do it like
3613this. Careful, minor magic ahead.
3614
3615 // First, let's get an ID of a character who's name will be on the item.
3616 // Only an existing character's name may be there.
3617 // Let's assume our character is 'Adam' and find his ID.
3618
3619 set @charid,getcharid(0,"Adam");
3620
3621 // Now we split the character ID number into two portions with a binary
3622 // shift operation. If you don't understand what this does, just copy it.
3623
3624 set @card3, @charid & 65535;
3625 set @card4, @charid >> 16;
3626
3627 // If you're inscribing non-equipment, @card1 must be 254.
3628 // Arrows are also not equipment. :)
3629 set @card1,254;
3630
3631 // For named equipment, card2 means the Star Crumbs and elemental
3632 // crystals used to make this equipment. For everything else, it's 0.
3633
3634 set @card2,0;
3635
3636 // Now, let's give the character who invoked the script some
3637 // Adam's Apples:
3638
3639 getitem2 512,1,1,0,0,@card1,@card2,@card3,@card4;
3640
3641This wasn't tested with all possible items, so I can't give any promises,
3642experiment first before relying on it.
3643
3644To create equipment, continue this example it like this:
3645
3646 // We've already have card3 and card4 loaded with correct
3647 // values so we'll just set up card1 and card2 with data
3648 // for an Ice Stiletto.
3649
3650 // If you're inscribing equipment, @card1 must be 255.
3651 set @card1,255;
3652
3653 // That's the number of star crumbs in a weapon.
3654 set @sc,2;
3655
3656 // That's the number of elemental property of the weapon.
3657 set @ele,1;
3658
3659 // And that's the wacky formula that makes them into
3660 // a single number.
3661 set @card2,@ele+((@sc*5)<<8);
3662
3663 // That will make us an Adam's +2 VVS Ice Stiletto:
3664
3665 getitem2 1216,1,1,2,0,@card1,@card2,@card3,@card4;
3666
3667Experiment with the number of star crumbs - I'm not certain just how much will
3668work most and what it depends on. The valid element numbers are:
3669
3670 1 - Ice, 2 - Earth 3 - Fire 4 - Wind.
3671
3672You can, apparently, even create duplicates of the same pet egg with this
3673command, creating a pet which is the same, but simultaneously exists in two
3674eggs, and may hatch from either, although, I'm not sure what kind of a mess will
3675this really cause.
3676
3677---------------------------------------
3678
3679* getnameditem <item name|item id>,<Character name|character ID>;
3680
3681-Note: there's a total of 4 possible combinations of this command.
3682E.g: item name and character name, or with character id, etc...
3683
3684Create a item signed with the given character's name.
3685This is the same as using the hard(ly) explained way with getitem2.
3686
3687The command returns 1 when the item is created succesfully, or 0 when failed.
3688Failure occurs when there is:
3689- no player attached
3690- Item name or ID is not valid
3691- The given character ID/name is offline.
3692
3693舉例:
3694
3695//This will give the currently attached player a Aaron's Apple (if Aaron is online).
3696 getnameditem "Apple","Aaron";
3697
3698//Self-explanatory (I hope).
3699 if (getnameitem("Apple,"Aaron")) {
3700 mes "You now have a Aaron's Apple!";
3701 }
3702
3703---------------------------------------
3704
3705*rentitem <item id>,<time>{,<會消耗>{,<數é‡>}};
3706*rentitem "<item name>",<time>{,<會消耗>{,<數é‡>}};
3707
3708Creates a rental item in the attached character's inventory. The item will expire
3709in <time> seconds and be automatically deleted. When receiving a rental item,
3710the character will receive a message in their chat window. The character will
3711also receive warning messages in their chat window before the item disappears.
3712
3713This command can not be used to rent stackable items. Rental items cannot be
3714removed from the character's inventory. (i.e. trade mask 123 in ../db/item_trade.txt)
3715Note: 'delitem' in an NPC script can still remove rental items.
3716
3717如果<會消耗>為1ï¼Œå‰‡ç§Ÿè³ƒçš„å¯æ¶ˆè€—物å“åœ¨ä½¿ç”¨å¾Œå³æ¶ˆå¤±ã€‚
3718<數é‡>å’Œ<會消耗>,僅å°å¯ç–ŠåŠ ç‰©å“æœ‰æ•ˆã€‚
3719
3720---------------------------------------
3721
3722*renttradableitem <é“å…·id>,<毫秒>;
3723*renttradableitem "<é“å…·å>",<毫秒>;
3724
3725åŒrentitem,ä¸åŒé»žåœ¨æ–¼ç§Ÿè³ƒçš„物å“å¯ä»¥äº¤æ˜“。
3726
3727---------------------------------------
3728
3729*makeitem <item id>,<amount>,"<地圖å>",<X>,<Y>{,<時間>};
3730*makeitem "<item name>",<amount>,"<地圖å>",<X>,<Y>{,<時間>};
3731
3732This command will create an item lying around on a specified map in the
3733specified location.
3734
3735 itemid - Found in 'db/item_db.txt'
3736 amount - Amount you want produced
3737 map name - The map name
3738 X - The X coordinate
3739 Y - The Y coordinate.
3740 時間 - éŽå¤šä¹…æœƒåœ¨åœ°é¢æ¸…é™¤ï¼Œå–®ä½æ¯«ç§’
3741
3742This item will still disappear just like any other dropped item. Like 'getitem',
3743it also accepts an 'english name' field from the database and creates apples if
3744the name isn't found.
3745If the map name is given as "this", the map the invoking character is on will be used.
3746
3747---------------------------------------
3748
3749*makeitem2 <item id>,<amount>,"<地圖å>",<X>,<Y>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<時間>};
3750*makeitem2 "<item name>",<amount>,"<地圖å>",<X>,<Y>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<時間>};
3751
3752This command will create an item lying around on a specified map in the
3753specified location.
3754
3755 itemid - Found in 'db/item_db.txt'
3756 amount - Amount you want produced
3757 map name - The map name
3758 X - The X coordinate
3759 Y - The Y coordinate.
3760 時間 - éŽå¤šä¹…æœƒåœ¨åœ°é¢æ¸…é™¤ï¼Œå–®ä½æ¯«ç§’
3761
3762This item will still disappear just like any other dropped item. Like 'getitem',
3763it also accepts an 'english name' field from the database and creates apples if
3764the name isn't found.
3765If the map name is given as "this", the map the invoking character is on will be used.
3766nameid為-X時,代表從Xé“具組隨機一個物å“。
3767
3768---------------------------------------
3769
3770*searchitem <array name>,"<item name>";
3771
3772This command will fill the given array with the ID of items whose name matches the given one. It returns the number of items found. For performance reasons, the results array is limited to 10 items.
3773
3774 mes "What item are you looking for?";
3775 input @name$;
3776 set @qty, searchitem(@matches[0],@name$);
3777 mes "I found "+@qty+" items:";
3778 for (set @i, 0; @i < @qty; set @i, @i+1)
3779 //Display name (eg: "Apple[0]")
3780 mes getitemname(@matches[@i])+"["+getitemslots(@matches[@i])+"]";
3781
3782---------------------------------------
3783
3784*delitem <item id>,<amount>{,<account ID>};
3785*delitem "<item name>",<amount>{,<account ID>};
3786*delcartitem <item id>,<amount>{,<account ID>};
3787*delcartitem "<item name>",<amount>{,<account ID>};
3788*delstorageitem <item id>,<amount>{,<account ID>};
3789*delstorageitem "<item name>",<amount>{,<account ID>};
3790
3791This command will take a specified amount of items from the invoking character.
3792As all the item commands, this one uses the ID of the item found inside
3793'db/item_db.txt'. The items are destroyed - there is no way an NPC can simply
3794own items and have an inventory of them, other as by destroying and recreating
3795them when needed.
3796
3797 delitem 502,10 // The person will lose 10 apples
3798 delitem 617,1 // The person will lose 1 Old Violet Box
3799
3800It is always a good idea to to check if the player actually has the item before
3801you take it from them, Otherwise, you could try to delete items which the
3802players don't actually have, which won't fail and won't give an error message,
3803but might open up ways to exploit your script.
3804
3805Like 'getitem' this command will also accept an 'english name' field from the
3806database. If the name is not found, nothing will be deleted.
3807
3808---------------------------------------
3809
3810*delitem2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
3811*delitem2 "<Item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
3812
3813This command will take a specified amount of items from the invoking character.
3814Check 'getitem2' to understand its expanded parameters.
3815
3816---------------------------------------
3817
3818*countitem(<item id>)
3819*countitem("<item name>")
3820*countcartitem(<item id>)
3821*countcartitem("<item name>")
3822*countstorageitem(<item id>)
3823*countstorageitem("<item name>")
3824
3825This function will return the number of items for the specified item ID that the
3826invoking character has in the inventory.
3827
3828 mes "[Item Checker]";
3829 mes "Hmmm, it seems you have "+countitem(502)+" apples";
3830 close;
3831
3832Like 'getitem', this function will also accept an 'english name' from the
3833database as an argument.
3834
3835If you want to state the number at the end of a sentence, you can do it by
3836adding up strings:
3837
3838 mes "[Item Checker]";
3839 mes "Hmmm, the total number of apples you are holding is "+countitem("APPLE");
3840 close;
3841
3842---------------------------------------
3843
3844*countitem2(<item id>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>)
3845*countitem2("<item name>",<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>)
3846
3847Expanded version of 'countitem' function, used for created/carded/forged items.
3848
3849This function will return the number of items for the specified item ID and
3850other parameters that the invoking character has in the inventory.
3851Check 'getitem2' to understand the arguments of the function.
3852
3853---------------------------------------
3854
3855*groupranditem <group id>;
3856
3857Returns the item_id of a random item picked from the group specified. The
3858different groups and their group number are specified in db/item_group_db.txt
3859
3860When used in conjunction with other functions, you can get a random item. For
3861example, for a random pet lure:
3862
3863getitem groupranditem(15),1;
3864
3865---------------------------------------
3866
3867*enable_items;
3868*disable_items;
3869
3870These commands enable item usage while an npc is running. When enable_items is
3871run, items can be used during scripts until disable_items is called.
3872To avoid possible exploits, when enable_items is invoked, it will only enable
3873item usage while running that script in particular. Note that if a different
3874script also calls enable_items, it will override the last call (so you may
3875want to call this command at the start of your script without assuming the
3876effect is still in effect).
3877
3878---------------------------------------
3879
3880*itemskill <skill id>,<skill level>;
3881*itemskill "<skill name>",<skill level>;
3882
3883This is a command meant for item scripts to replicate single-use skills. It will
3884not work properly in NPC scripts a lot of the time because casting a skill is
3885not allowed when there is a message window or menu on screen. If there isn't one
3886cause you've made sure to run this when they already closed it, it should work
3887just fine and even show a targeting pointer if this is a targeting skill.
3888
3889// When you use Anodyne, you will cast Endure(8) level 1,
3890// and "Endure" will appear above your head as you use it.
3891605,Anodyne,Anodyne,11,2000,0,100,,,,,10477567,2,,,,,{ itemskill 8,1; },{}
3892
3893
3894---------------------------------------
3895
3896*produce <item level>;
3897
3898This command will open a crafting window on the client connected to the invoking
3899character. The 'item level' is a number which determines what kind of a crafting
3900window will pop-up. You can see the full list of such item levels in
3901'db/produce_db.txt' which determines what can actually be produced.
3902The window will not be empty only if the invoking character can actually produce
3903the items of that type and has the appropriate raw materials in their inventory.
3904
3905Valid item levels are:
3906
3907 1 - Level 1 Weapons
3908 2 - Level 2 Weapons
3909 3 - Level 3 Weapons
3910 21 - Blacksmith's Stones and Metals
3911 22 - Alchemist's Potions, Holy Water, Assassin Cross's Deadly Poison
3912 23 - Elemental Converters
3913
3914---------------------------------------
3915
3916*cooking <dish level>;
3917
3918This command will open a produce window on the client connected to the invoking
3919character. The 'dish level' is the number which determines what kind of dish
3920level you can produce. You can see the full list of dishes that can be produced in
3921'db/produce_db.txt'.
3922
3923The window will be shown empty if the invoking character does not have enough of
3924the required incredients to cook a dish.
3925
3926Valid dish levels are:
3927
392811 - Level 1 Dish
392912 - Level 2 Dish
393013 - Level 3 Dish
393114 - Level 4 Dish
393215 - Level 5 Dish
393316 - Level 6 Dish
393417 - Level 7 Dish
393518 - Level 8 Dish
393619 - Level 9 Dish
393720 - Level 10 Dish
3938
3939Altough it's required to set a dish level, it doesn't matter if you set it to 1
3940and you want to cook a level 10 dish, as long as you got the required incredients
3941to cook the dish the command works.
3942
3943---------------------------------------
3944
3945*successremovecards <equipment slot>;
3946
3947This command will remove all cards from the item found in the specified
3948equipment slot of the invoking character, create new card items and give them to
3949the character. If any cards were removed in this manner, it will also show a
3950success effect.
3951
3952---------------------------------------
3953
3954*failedremovecards <equipment slot>,<類型>;
3955
3956This command will remove all cards from the item found in the specified
3957equipment slot of the invoking character. 'type' determines what happens to the
3958item and the cards:
3959
3960 0 - will destroy both the item and the cards.
3961 1 - will keep the item, but destroy the cards.
3962 2 - will keep the cards, but destroy the item.
3963
3964Whatever the type is, it will also show a failure effect on screen.
3965
3966---------------------------------------
3967
3968*repair <broken item number>;
3969
3970This command repairs a broken peice of equipment, using the same list of broken
3971items as available through 'getbrokenid'.
3972
3973The official scripts seem to use the repair command as a function instead:
3974'repair(<number>)' but it returns nothing on the stack. Probably only Valaris,
3975who made it, can answer why is it so.
3976
3977---------------------------------------
3978
3979*successrefitem <equipment slot>{, <å¢žåŠ ç²¾ç…‰å€¼>};
3980
3981This command will refine an item in the specified equipment slot of the invoking
3982character by +1. For a list of equipment slots see 'getequipid'. This command
3983will not only add the +1, but also display a 'refine success' effect on the
3984character and put appropriate messages into their chat window. It will also give
3985the character fame points if a weapon reached +10 this way, even though these
3986will only take effect for blacksmith who will later forge a weapon.
3987
3988The official scripts seem to use the 'successrefitem' command as a function
3989instead: 'successrefitem(<number>)' but it returns nothing on the stack.
3990This is since jAthena, so probably nobody knows for sure why is it so.
3991
3992<å¢žåŠ ç²¾ç…‰å€¼>默èªç‚º1ï¼›
3993
3994---------------------------------------
3995
3996*failedrefitem <equipment slot>;
3997
3998This command will fail to refine an item in the specified equipment slot of the
3999invoking character. The item will be destroyed. This will also display a 'refine
4000failure' effect on the character and put appropriate messages into their chat
4001window.
4002
4003The official scripts seem to use the 'failedrefitem' command as a function
4004instead: 'failedrefitem(<number>)' but it returns nothing on the stack. This is
4005since jAthena, so probably nobody knows for sure why is it so.
4006
4007---------------------------------------
4008
4009*failedrefitem2 <è£å‚™ä½ç½®>,<精煉值>;
4010
4011This command will fail to refine an item in the specified equipment slot of the
4012invoking character. é“å…·ç²¾ç…‰å€¼æœƒæ ¹æ“šæŒ‡å®šå€¼æ¸›å°‘. This will also display a 'refine
4013failure' effect on the character and put appropriate messages into their chat
4014window.
4015
4016---------------------------------------
4017
4018*unequip(<è£å‚™ä½ç½®>);
4019
4020This command will unequip whatever is currently equipped in the invoking
4021character's specified equipment slot. For a full list of possible equipment
4022slots see 'getequipid'.
4023
4024If an item occupies several equipment slots, it will get unequipped from all of
4025them. (Which is a good thing.)
4026
4027返回值å¯ç”¨ä»¥delinventoryç‰inventory系列指令。
4028
4029---------------------------------------
4030
4031*clearitem;
4032
4033This command will destroy all items the invoking character has in their
4034inventory. (that includes equipped items) It will not affect anything else, like
4035storage or cart.
4036
4037---------------------------------------
4038
4039*equip <item id>;
4040*autoEquip <item id>,<option>;
4041
4042These commands are to equip a equipment on the attached character.
4043The equip function will equip the item ID given when the player has
4044this item in his/her inventory, while the autoequip function will
4045equip the given item ID when this is looted. The option parameter of
4046the autoequip is 1 or 0, 1 to turn it on, and 0 to turn it off.
4047
4048Example(s):
4049
4050//This will equip a 1104 (falchion) on the character if this is in the inventory.
4051 equip 1104;
4052
4053//The invoked character will now automatically equip a falchion when it's looted.
4054 autoequip 1104,1;
4055
4056//The invoked character will no longer automatically equip a falchion.
4057 autoequip 1104,0;
4058
4059---------------------------------------
4060//
40614,1.- End of item-related commands
4062//
4063---------------------------------------
4064
4065*openstorage;
4066
4067This will open a character's Kafra storage window on the client connected to the
4068invoking character. It does not check wherever it is run from, so you can allow
4069any feasible NPC to open a kafra storage. (It's not certain whether this works
4070in item scripts, but if it does, it could be interesting.)
4071
4072The storage window might not open if a message box or a trade deal is present on
4073screen already, so you should at least make sure the message box is closed
4074before you open storage.
4075
4076 mes "I will now open your stash for you";
4077 close2;
4078 openstorage;
4079 end;
4080
4081---------------------------------------
4082
4083*openmail;
4084
4085This will open a character's Mail window on the client connected to the
4086invoking character.
4087
4088 mes "Close this window to open your mail inbox.";
4089 close2;
4090 openmail;
4091 end;
4092
4093---------------------------------------
4094
4095*openauction;
4096
4097This will open the Auction window on the client connected to the invoking character.
4098
4099 mes "Close this window to open the Auction window.";
4100 close2;
4101 openauction;
4102 end;
4103
4104---------------------------------------
4105\\
41064,2.- Guild-related commands
4107\\
4108---------------------------------------
4109
4110*guildopenstorage()
4111
4112This function works the same as 'openstorage' but will open a guild storage
4113window instead for the guild storage of the guild the invoking character belongs
4114to. This is a function because it returns a value - 0 if the guild storage was
4115opened successfully and 1 if it wasn't. (Notice, it's a ZERO upon success.)
4116Since guild storage is only accessible to one character at one time, it may fail
4117if another character is accessing the guild storage at the same time.
4118
4119This will also fail and return 2 if the character does not belong to any guild.
4120
4121---------------------------------------
4122
4123*guildchangegm(<guild id>,<new master's name>)
4124
4125This function will change the Guild Master of a guild. The ID is the guild's
4126id, and the new guildmaster's name must be passed.
4127
4128Returns 1 on success, 0 otherwise.
4129
4130---------------------------------------
4131
4132*guildgetexp <amount>;
4133
4134This will give the specified amount of guild experience points to the guild the
4135invoking character belongs to. It will silently fail if they do not belong to
4136any guild.
4137
4138---------------------------------------
4139
4140*guildskill <skill id>,<level>
4141*guildskill "<skill name>",<level>
4142
4143This command will bump up the specified guild skill by the specified number of
4144levels. This refers to the invoking character and will only work if the invoking
4145character is a member of a guild AND it's guildmaster, otherwise no failure
4146message will be given and no error will occur, but nothing will happen - same
4147about the guild skill trying to exceed the possible maximum. The full list of
4148guild skills is available in 'db/skill_db.txt', these are all the GD_ skills at
4149the end.
4150
4151The flag parameter is currently not functional and it's a mystery of what it
4152would actually do. (Though probably, like for character skills, it would allow
4153temporary bumping.) Using this command will bump the guild skill up permanently.
4154
4155// This would give your character's guild one level of Approval (GD_APPROVAL ID
4156// 10000). Notice that if you try to add two levels of Approval, or add
4157// Approval when the guild already has it, it will only have one level of
4158// Approval afterwards.
4159 guildskill 10000,1,0;
4160
4161You might want to make a quest for getting a certain guild skill, make it hard
4162enough that all the guild needs to help or something. Doing this for the Glory
4163of the Guild skill, which allows your guild to use an emblem, is a good idea for
4164a fun quest. (Wasting a level point on that is really annoying :D)
4165
4166---------------------------------------
4167//
41684,2 End of guild-related commands.
4169//
4170---------------------------------------
4171
4172*resetlvl <action type>;
4173
4174This is a character reset command, meant mostly for rebirth script supporting
4175Advanced jobs, which will reset the invoking character's stats and level
4176depending on the action type given. Valid action types are:
4177
4178 1 - Base level 1, Job level 1, 0 skill points, 0 base xp, 0 job xp, wipes the
4179 status effects (only the ones settable by 'setoption'), sets all stats to 1.
4180 If the new job is 'Novice High', give 100 status points, give First Aid and
4181 Play Dead skills.
4182 2 - Base level 1, Job level 1, 0 skill points, 0 base xp, 0 job xp.
4183 Skills and attribute values are not altered.
4184 3 - Base level 1, base xp 0. Nothing else is changed.
4185 4 - Job level 1, job xp 0. Nothing else is changed.
4186
4187In all cases it will also unequip everything the character has on.
4188
4189Even though it doesn't return a value, it is used as a function in the official
4190rebirth scripts. Ask AppleGirl why.
4191
4192---------------------------------------
4193
4194*resetstatus;
4195
4196This is a character reset command, which will reset the stats on the invoking
4197character and give back all the stat points used to raise them previously.
4198Nothing will happen to any other numbers about the character.
4199
4200Used in reset NPC's (duh!)
4201
4202---------------------------------------
4203
4204*resetskill;
4205
4206This command takes off all the skill points on the invoking character, so they
4207only have Basic Skill blanked out (lvl 0) left, and returns the points for them
4208to spend again. Nothing else will change but the skills. Quest skills will also
4209reset if 'quest_skill_reset' option is set to Yes in 'battle_athena.conf'. If
4210the 'quest_skill_learn' option is set in there, the points in the quest skills
4211will also count towards the total.
4212
4213Used in reset NPC's (duh!)
4214
4215---------------------------------------
4216
4217*sc_start <effect type>,<ticks>,<extra argument>{,<rate>{,<flag>{,<GID>}}};
4218*sc_start2 <effect type>,<ticks>,<extra argument>,<percent chance>{,<flag>{,<GID>}};
4219*sc_start4 <effect type>,<ticks>,<value 1>,<value 2>,<value 3>,<value 4>{,<rate>{,<flag>{,<GID>}}};
4220*sc_end <effect type>{,<target ID number>};
4221
4222 ï¼ï¼ç¦æ¢ç”¨åœ¨è£å‚™ä¸ï¼Œå¯ä»¥ç”¨åœ¨OnEquip OnUnequip欄裡。
4223These command bestow a status effect on the invoking character. This command is
4224used a lot in the item scripts.
4225
4226 // This would poison them for 10 min
4227 sc_start SC_Poison,600000,0;
4228
4229Effect type is a number of effect, 'db/const.txt' lists the common (mostly
4230negative) status effect types as constants, starting with 'SC_'. You can also
4231use this to give someone an effect of a player-cast spell:
4232
4233 // This will bless someone as if with Bless 10:
4234 sc_start 10,240000,10;
4235
4236Extra argument's meaning differs depending on the effect type, for most effects
4237caused by a player skill the extra argument means the level of the skill that
4238would have been used to create that effect, for others it might have no meaning
4239whatsoever. You can actually bless someone with a 0 bless spell level this way,
4240which is fun, but weird.
4241
4242The target ID number, if given, will cause the status effect to appear on a
4243specified character, instead of the one attached to the running script. This has
4244not been properly tested.
4245
4246'sc_start2' is perfectly equivalent, but unlike 'sc_start', a status change
4247effect will only occur with a specified percentage chance. 10000 given as the
4248chance is equivalent to a 100% chance, 0 is a zero.
4249
4250'sc_start4' is just like sc_start, however it takes four parameters for the
4251status change instead of one. What these values are depends on the status
4252change in question. For example, elemental armor defense takes the following
4253four values:
4254- val1 is the first element, val2 is the resistance to the element val1.
4255- val3 is the second element, val4 is the resistance to said element.
4256eg: sc_start4 SC_DefEle,60000,Ele_Fire,20,Ele_Water,-15;
4257
4258'sc_end' will remove a specified status effect. If SC_All is used (-1), it will
4259do a complete removal of all statuses (although permanent ones will re-apply).
4260
4261You can see the full list of status effects caused by skills in
4262'src/map/status.h' - they are currently not fully documented, but most of that
4263should be rather obvious.
4264
4265---------------------------------------
4266
4267*skilleffect <skill id>,<number>;
4268*skilleffect "<skill name>",<number>;
4269
4270This command will display the visual and sound effects of a specified skill (see
4271'db/skill_db.txt' for a full list of skills) on the invoking character's sprite.
4272Nothing but the special effects and animation will happen. If the skill's normal
4273effect displays a floating number, the number given will float up.
4274
4275 // This will heal the character with 2000 hp, buff with
4276 // Bless 10 and Increase AGI 5, and display appropriate
4277 // effects.
4278 mes "Blessed be!";
4279 skilleffect 28,2000;
4280 heal 2000,0;
4281 skilleffect 34,0;
4282 // That's bless 10.
4283 sc_start 10,240000,10;
4284 skilleffect 29,0;
4285 // That's agi 5
4286 sc_start 12,140000,5;
4287
4288---------------------------------------
4289
4290*npcskilleffect <skill id>,<number>,<x>,<y>;
4291*npcskilleffect "<skill name>",<number>,<x>,<y>;
4292
4293This command behaves identically to 'skilleffect', however, the effect will not
4294be centered on the invoking character's sprite, nor on the NPC sprite, if any,
4295but will be centered at map coordinates given on the same map as the invoking
4296character.
4297
4298---------------------------------------
4299
4300*specialeffect <效果編號>{,<發é€ç›®æ¨™>{,"<NPCå>"}};
4301
4302該指令會在指定NPCçš„åæ¨™ä¸Šé¡¯ç¤ºæŒ‡å®šç·¨è™Ÿçš„特殊效果。
4303編號列表請看'doc/effect_list.txt'。
4304有些效果編號在有些版本的客戶端裡無效。(å¯ä»¥çœ‹åˆ°ï¼Œä¸‹é›¨æ•ˆæžœå¾ž2005å¹´4月後的客戶端都沒有)
4305
4306<NPCå> 會在其他NPC上顯示 <效果編號>。如果指定NPCä¸å˜åœ¨ï¼Œæ”¯æŒä¸æœƒæœ‰ä»»ä½•效果。
4307如果指定了NPC,<發é€ç›®æ¨™>ä¹Ÿå¿…é ˆåŒæ™‚使用。å°<發é€ç›®æ¨™>使用AREA值會ä¿ç•™é»˜èªæ•ˆæžœã€‚
4308
4309 // this will make the NPC "John Doe#1"
4310 // show the effect "EF_HIT1" specified by
4311 // Jane Doe. I wonder what John did...
4312 mes "[Jane Doe]";
4313 mes "Well, I never!";
4314 specialeffect EF_HIT1,AREA,"John Doe#1";
4315 close;
4316
4317---------------------------------------
4318
4319*specialeffect2 <effect number>{,<send_target>{,"<Player Name>"}};
4320
4321This command behaves identically to the 'specialeffect', but the effect will be
4322centered on the invoking character's sprite.
4323
4324<Player name> parameter will display <effect number> on another Player than the
4325one currently attached to the script. Like with specialeffect, when specifying
4326a player, <send_target> must be supplied, specifying AREA will retain the default
4327behavior of the command.
4328
4329---------------------------------------
4330
4331*statusup <stat>;
4332
4333This command will bump a specified stat of the invoking character up by one
4334permanently. Stats are to be given as number, but you can use these constants to
4335replace them:
4336
4337bStr - Strength
4338bVit - Vitality
4339bInt - Intelligence
4340bAgi - Agility
4341bDex - Dexterity
4342bLuk - Luck
4343
4344---------------------------------------
4345
4346*statusup2 <stat>,<amount>;
4347
4348This command will bump a specified stat of the invoking character up by the
4349specified amount permanently. The amount can be negative. See 'statusup'.
4350
4351 // This will decrease a character's Vit forever.
4352 statusup bVit,-1;
4353
4354---------------------------------------
4355
4356*bonus <bonus type>,<val1>;
4357*bonus2 <bonus type>,<val1>,<val2>;
4358*bonus3 <bonus type>,<val1>,<val2>,<val3>;
4359*bonus4 <bonus type>,<val1>,<val2>,<val3>,<val4>;
4360*bonus5 <bonus type>,<val1>,<val2>,<val3>,<val4>,<val5>;
4361
4362These commands are meant to be used in item scripts. They will probably work
4363outside item scripts, but the bonus will not persist for long. They, as
4364expected, refer only to an invoking character.
4365
4366You can find the full list of possible bonuses and which command to use for each
4367kind in 'doc/item_bonus.txt'.
4368
4369---------------------------------------
4370
4371*autobonus "<çŽå‹µè…³æœ¬>",<rate>,<duration>{,<flag>,{"<激活腳本>"}};
4372*autobonus2 "<çŽå‹µè…³æœ¬>",<rate>,<duration>{,<flag>,{"<激活腳本>"}};
4373*autobonus3 "<çŽå‹µè…³æœ¬>",<rate>,<duration>,<skill id>,{"<激活腳本>"};
4374*autobonus3 "<çŽå‹µè…³æœ¬>",<rate>,<duration>,"<skill name>",{"<激活腳本>"};
4375
4376這些指令是è¨è¨ˆæˆåœ¨é“具腳本ä¸ä½¿ç”¨çš„,在其他腳本ä¸éƒ¨åˆ†æŒ‡ä»¤å¯èƒ½æœ‰æ•ˆã€‚
4377
4378What these commands do is 'attach' a script to the player which will get
4379executed on attack (or when attacked in the case of autobonus2).
4380
4381Rate是觸發幾率(1000 = 100%).
4382
4383Duration 是çŽå‹µè…³æœ¬çš„æŒçºŒæ™‚é–“
4384
4385The optional argument 'flag' is used to classify the type of attack where the script
4386can trigger (it shares the same flags as the bAutoSpell bonus script):
4387
4388Range criteria:
4389 BF_SHORT: Trigger on melee attack
4390 BF_LONG: Trigger on ranged attack
4391 Default: BF_SHORT+BF_LONG
4392Attack type criteria:
4393 BF_WEAPON: Trigger on weapon skills
4394 BF_MAGIC: Trigger on magic skills
4395 BF_MISC: Trigger on misc skills
4396 Default: BF_WEAPON
4397Skill criteria:
4398 BF_NORMAL: Trigger on normal attacks
4399 BF_SKILL: Trigger on skills
4400 default: If the attack type is BF_WEAPON (only) BF_NORMAL is used,
4401 otherwise BF_SKILL+BF_NORMAL is used.
4402
4403çŽå‹µè…³æœ¬å’Œæ¿€æ´»è…³æœ¬çš„å€åˆ¥æ˜¯ï¼Œæ¿€æ´»è…³æœ¬åªåœ¨é¦–次激活時觸發,而腳本腳本在
4404æ¯æ¬¡é‡æ–°è¨ˆç®—狀態時都會觸發,以ä¿è‰çŽå‹µæŒçºŒã€‚è…³æœ¬è…³æœ¬ä¸€èˆ¬åªæŽ¥å—bonus指令。
4405一般激活腳本åªç”¨ä¾†é¡¯ç¤ºè¦–覺效果。
4406
4407In all cases, when the script triggers, the attached player will be the one
4408who holds the bonus. There is currently no way of knowing within this script
4409who was the other character (the attacker in autobonus2, or the target in
4410autobonus and autobonus3).
4411
4412//Grants a 1% chance of starting the state "all stats +10" for 10 seconds when
4413//using weapon or misc attacks (both melee and ranged skills) and shows a special
4414//effect when the bonus is active.
4415 autobonus "{ bonus bAllStats,10; }",10,10000,BF_WEAPON|BF_MISC,"{ specialeffect2 EF_FIRESPLASHHIT; }";
4416
4417一個é“å…·å¯ä»¥æ“有多個autobonus,æ¯å€‹autobonus都有幾率激活,但æ¯å€‹é“å…·idåŒæ™‚åªèƒ½æ¿€æ´»ä¸€å€‹ã€‚
4418å¡ç‰‡ã€é™„é”ç‰æ“有相åŒä¾†æºé“å…·idçš„autobonus在è£å‚™ä¸è§¸ç™¼å¹¾çŽ‡ç–ŠåŠ ï¼Œå…¶ä»–ä¸è®Šï¼Œå…¶è£å‚™ä½ç½®åªè¨ˆç‚ºEQI較å°çš„那個。
4419
4420---------------------------------------
4421
4422*itembonus <æŒçºŒæ™‚é–“>,狀態編號(或{<腳本>}){,<組>{,<圖標>{,<值>}}}
4423
4424 ï¼ï¼ç¦æ¢ç”¨åœ¨è£å‚™ä¸ï¼Œå¯ä»¥ç”¨åœ¨OnEquip OnUnequip欄裡。
4425作用類似於autobonus,但僅é©ç”¨æ–¼æ¶ˆè€—類é“具。
44262個itembonusæ“æœ‰ç›¸åŒçµ„時,先使用者會被覆蓋。
4427
4428---------------------------------------
4429
4430*skill <skill id>,<level>{,<標記>};
4431*skill "<skill name>",<level>{,<標記>};
4432*addtoskill <skill id>,<level>{,<標記>};
4433*addtoskill "<skill name>",<level>{,<標記>};
4434
4435These commands will give the invoking character a specified skill. This is also
4436used for item scripts.
4437
4438Level is obvious. Skill id is the ID number of the skill in question as per
4439'db/skill_db.txt'. It is not known for certain whether this can be used to give
4440a character a monster's skill, but you're welcome to try with the numbers given
4441in 'db/mob_skill_db.txt'.
4442
4443Flag is 0 if the skill is given permanently (will get written with the character
4444data) or 1 if it is temporary (will be lost eventually, this is meant for card
4445item scripts usage.). The flag parameter is optional, and defaults to 1 in
4446'skill' and to 2 in 'addtoskill'.
4447
4448Flag 2 means that the level parameter is to be interpreted as a stackable
4449additional bonus to the skill level. If the character did not have that skill
4450previously, they will now at 0+the level given.
4451
4452// This will permanently give the character Stone Throw (TF_THROWSTONE,152), at
4453// level 1.
4454 skill 152,1,0;
4455
4456---------------------------------------
4457
4458*nude;
4459
4460This command will unequip anything equipped on the invoking character.
4461
4462It is not required to do this when changing jobs since 'jobchange' will unequip
4463everything not equippable by the new job class anyway.
4464
4465---------------------------------------
4466
4467*disguise <Monster ID>;
4468*undisguise;
4469
4470This command disguises the current player with a monster sprite.
4471The disguise lasts until 'undisguise' is issued or the player logs out.
4472
4473舉例:
4474
4475disquise 1002; //Yay! You're a Poring!!!
4476next;
4477undisguise; //Yay!!!! You're a human again!!
4478
4479---------------------------------------
4480
4481*montransform <é”物id>;
4482
4483This command disguises the current player with a monster sprite.
4484The disguise lasts until 'montransform 0' is issued or the player logs out.
4485
4486舉例:
4487
4488montransform 1002; //Yay! You're a Poring!!!
4489next;
4490montransform 0; //Yay!!!! You're a human again!!
4491
4492---------------------------------------
4493\\
44944,3 Marriage-related commands
4495\\
4496---------------------------------------
4497*marriage("<spouse name>");
4498
4499This function will marry two characters, the invoking character and the one
4500referred to by name given, together, setting them up as each other's marriage
4501partner. No second function call has to be issued (in current SVN at least) to
4502make sure the marriage works both ways. The function returns 1 upon success, or
45030 if the marriage could not be completed, either because the other character
4504wasn't found or because one of the two characters is already married.
4505
4506This will do nothing else for the marriage except setting up the spouse ID for
4507both of these characters. No rings will be given and no effects will be shown.
4508
4509---------------------------------------
4510
4511*wedding;
4512
4513This command will call up wedding effects - the music and confetti - centered on
4514the invoking character. Example can be found in the wedding script.
4515
4516---------------------------------------
4517
4518*divorce()
4519
4520This function will un-marry the invoking character from whoever they were
4521married to. Both will no longer be each other's marriage partner, (at least in
4522current SVN, which prevents the cases of multi-spouse problems). It will return
45231 upon success or 0 if the character was not married at all.
4524
4525This function will also destroy both wedding rings and send a message to both
4526players, telling them they are now divorced.
4527
4528---------------------------------------
4529
4530*adopt "<parent name>","<parent name>","<novice name>";
4531*adopt("<parent name>","<parent name>","<novice name>")
4532
4533This command will set up a novice as a baby of a married couple. All three are
4534referred to by character name. The correct variables are set on all three
4535characters in the same call. The command will unequip anything the novice has
4536equipped and make them a Job_Baby class, as well as send them a 'your job has
4537been changed' message.
4538
4539Beware of calling this from inside a 'callfunc' function, cause upon successful
4540adoption, this command returns a zero, as if it were a function. This is likely
4541to screw up execution of a 'return' command. You may try to call it as a
4542function instead, but it doesn't return anything upon an error, which may also
4543cause script execution to throw up errors.
4544
4545Nothing will happen (and nothing will be returned either) if either future
4546parent is below base level 70 and/or if any of the three characters is not found
4547online.
4548
4549---------------------------------------
4550//
45514,3.- End of marriage-related commands
4552//
4553---------------------------------------
4554
4555*pcfollow <id>,<target id>;
4556*pcstopfollow <id>;
4557
4558Makes a character follow or stop following someone. This command does the same as the @follow command.
4559The main difference is that @follow can use character names, and this commands needs the Account ID for the target.
4560
4561Example(s):
4562
4563//This will make Aaron follow Bullah, when both of these characters are online.
4564 PCFollow getCharID(3,"Aaron"),getCharID(3,"Bullah");
4565
4566//Makes Aaron stop following whoever he is following.
4567 PCStopFollow getCharID(3,"Aaron");
4568
4569---------------------------------------
4570
4571* pcblockmove <id>,<option>;
4572
4573Prevents the given ID from moving when the option != 0, 0 enables the ID to move again.
4574ID should be able to be GID of a monster/npc or AID from a character.
4575
4576Example(s):
4577
4578//prevents the current char from moving away;
4579 pcblockmove getcharid(3),1;
4580
4581//enables the current char to move again.
4582 pcblockmove getcharid(3),0;
4583
4584---------------------------------------
4585
4586==================================
4587|5.- Mob / NPC -related commands.|
4588==================================
4589---------------------------------------
4590
4591*monster "<地圖å>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"<event label>"};
4592*areamonster "<地圖å>",<x1>,<y1>,<x2>,<y2>,"<name to show>",<mob id>,<amount>{,"<event label>"};
4593
4594This command will spawn a monster on the specified coordinates on the specified
4595map. If the script is invoked by a character, a special map name, "this", will
4596be recognised to mean the name of the map the invoking character is located at.
4597This command works fine in the item scripts.
4598
4599The same command arguments mean the same things as described above in the
4600beginning of this document when talking about permanent monster spawns. Monsters
4601spawned in this manner will not respawn upon being killed.
4602
4603Unlike the permanent monster spawns, if the mob id is -1, a random monster will
4604be picked from the entire database according to the rules configured in the
4605server for dead branches. This will work for all other kinds of non-permanent
4606monster spawns.
4607
4608The only very special thing about this command is an event label, which is an
4609optional parameter. This label is written like '<NPC object name>::<label name>'
4610and upon the monster being killed, it will execute the script inside of the
4611specified NPC object starting from the label given. The RID of the player
4612attached at this execution will be the RID of the killing character.
4613
4614 monster "place",60,100,"Poring",1002,1,"NPCNAME::OnLabel";
4615
4616The coordinates of 0,0 will spawn the monster on a random place on the map.
4617
4618The 'areamonster' command works much like the 'monster' command and is not
4619significantly different, but spawns the monsters within a square defined by
4620x1/y1-x2/y2.
4621
4622Simple monster killing script:
4623
4624 <Normal NPC object definition. Let's assume you called him NPCNAME.>
4625 mes "[Summon Man]";
4626 mes "Want to start the kill?";
4627 next;
4628 menu "Yes",L_Yes,"No",-;
4629 mes "[Summon Man]";
4630 mes "Come back later";
4631 close;
4632 L_Yes:
4633 monster "prontera",0,0,"Quest Poring",1002,10,"NPCNAME::OnPoringKilled";
4634 // By using 0,0 it will spawn them in a random place.
4635 mes "[Summon Man]";
4636 mes "Now go and kill all the Poring I summoned";
4637 // He summoned ten.
4638 close;
4639 OnPoringKilled:
4640 set $PoringKilled,$PoringKilled+1;
4641 if ($PoringKilled==10) goto L_AllDead;
4642 end;
4643 L_AllDead:
4644 announce "Summon Man: Well done all the poring are dead",3;
4645 set $PoringKilled,0;
4646 end;
4647
4648For more good examples see just about any official 2-1 or 2-2 job quest script.
4649
4650---------------------------------------
4651
4652*areamobuseskill "<map name>",<x>,<y>,<range>,<mob id>,<skill id>,<skill level>,<cast time>,<cancelable>,<emotion>,<target type>;
4653*areamobuseskill "<map name>",<x>,<y>,<range>,<mob id>,"<skill name>",<skill level>,<cast time>,<cancelable>,<emotion>,<target type>;
4654
4655This command will make all monsters of the specified mob ID in the specified
4656area use the specified skill. Map name, x, and y define the center of the area,
4657which extending <range> cells in each direction (ex: a range of 3 would create
4658a 7x7 square). The skill can be specified by skill ID or name. <cast time> is in
4659milliseconds (1000 = 1 second), and the rest should be self-explanatory.
4660
4661<target type> can be:
4662 0 = self
4663 1 = the mob's current target
4664 2 = the mob's master
4665 3 = random target
4666
4667Example:
4668
4669 // spawn 1 Shining Plant in the 5x5 area centered on (155,188)
4670 areamonster "prontera",153,186,157,190,"Shining Plant",1083,1;
4671 // make the plant cast level 10 Cold Bolt on a random target
4672 areamobuseskill "prontera",155,188,2,1083,"MG_COLDBOLT",10,3000,1,e_gg,3;
4673
4674---------------------------------------
4675
4676* killmonster "<地圖>","<事件>"{,<標籤>};
4677* killmonsterall "<地圖>"{,<標籤>};
4678* areakillmonster "<地圖>",<x0>,<y0>,<x1>,<y1>,"<事件>"{,<標籤>};
4679* areakillmonsterall "<地圖>",<x0>,<y0>,<x1>,<y1>{,<標籤>};
4680 killmonsterall <mapname>,8;ç‚ºæ®ºæ»æ‰€æœ‰é”物,掉è½ç¶“驗和物å“。
4681 killmonsterall <mapname>,4;ç‚ºæ®ºæ»æ‰€æœ‰é”ç‰©ï¼Œä½†ä¸æ®ºæ»WoEé”物。
4682 killmonsterall <mapname>,2;ç‚ºæ®ºæ»æ‰€æœ‰é”ç‰©ï¼Œä½†ä¸æ®ºæ»çީ家å¬å–šé”物。
4683 killmonsterall <mapname>,1;ç‚ºæ®ºæ»æ‰€æœ‰é”物,觸發é”物æ»äº¡äº‹ä»¶ã€‚
4684 killmonsterall <mapname>;ç‚ºæ®ºæ»æ‰€æœ‰é”物。
4685 killmonster <mapname>,<eventlabel>;ç‚ºæ®ºæ»æœƒè§¸ç™¼<eventlabel>事件的é”物,且ä¸è§¸ç™¼è©²äº‹ä»¶ã€‚
4686 killmonster <mapname>,<eventlabel>,1;ç‚ºæ®ºæ»æœƒè§¸ç™¼<eventlabel>事件的é”物,並觸發該事件。
4687 killmonster <mapname>,<eventlabel>,2;ç‚ºæ®ºæ»æœƒè§¸ç™¼<eventlabel>事件的é”ç‰©ï¼Œä½†ä¸æ®ºæ»çީ家å¬å–šé”物,但ä¸è§¸ç™¼è©²äº‹ä»¶ã€‚
4688 killmonster <mapname>,<eventlabel>,3;ç‚ºæ®ºæ»æœƒè§¸ç™¼<eventlabel>事件的é”ç‰©ï¼Œä½†ä¸æ®ºæ»çީ家å¬å–šé”物,並觸發該事件。
4689 killmonster <mapname>,"All";ç‚ºæ®ºæ»æ‰€æœ‰ä¸æœƒé‡ç”Ÿé”物,並ä¸è§¸ç™¼ä»»ä½•事件。
4690 killmonster <mapname>,"All",1;ç‚ºæ®ºæ»æ‰€æœ‰ä¸æœƒé‡ç”Ÿé”物,並觸發æ»äº¡äº‹ä»¶ã€‚
4691 killmonster <mapname>,"All",2;ç‚ºæ®ºæ»æ‰€æœ‰ä¸æœƒé‡ç”Ÿé”ç‰©ï¼Œä½†ä¸æ®ºæ»çީ家å¬å–šé”物,並ä¸è§¸ç™¼ä»»ä½•事件。
4692 killmonster <mapname>,"All",3;ç‚ºæ®ºæ»æ‰€æœ‰ä¸æœƒé‡ç”Ÿé”ç‰©ï¼Œä½†ä¸æ®ºæ»çީ家å¬å–šé”物,且觸發æ»äº¡äº‹ä»¶ã€‚
4693
4694---------------------------------------
4695
4696*strmobinfo(<類型>,<monster id>);
4697
4698This function will return information about a monster record in the database, as
4699per 'db/mob_db.txt'. Type is the kind of information returned. Valid types are:
4700
4701 1 - 'english name' field in the database, a string.
4702 2 - 'japanese name' field in the database, a string.
4703 All other returned values are numbers:
4704 3 - Level.
4705 4 - Maximum HP.
4706 5 - Maximum SP.
4707 6 - Experience reward.
4708 7 - Job experience reward.
4709
4710---------------------------------------
4711
4712*mobcount("<地圖å>","<event label>")
4713*areamobcount("<地圖å>",<x0>,<y0>,<x1>,<y1>,"<event label>")
4714
4715This function will count all the monsters on the specified map that have a given
4716event label and return the number or 0 if it can't find any. Naturally, only
4717monsters spawned with 'monster' and 'areamonster' script commands can be like
4718this.
4719
4720However, apparently, if you pass this function an empty string for the event
4721label, it should return the total count of normal permanently respawning
4722monsters instead. With the current dynamic mobs system, where mobs are not kept
4723in memory for maps with no actual people playing on them, this will return a 0
4724for any such map.
4725
4726---------------------------------------
4727
4728*clone "<地圖å>",<x>,<y>,"<event>",<char id>{,<master_id>{,<mode>{,<標記>,<duration>}}}
4729
4730This command creates a monster which is a copy of another player. The first
4731four arguments serve the same purpose as in the monster script command, The
4732<char id> is the character id of the player to clone (player must be online).
4733If <master id> is given, the clone will be a 'slave/minion' of it. Master_id
4734must be a character id of another online player.
4735
4736The mode can be specified to determine the behaviour of the clone, it's
4737values are the same as the ones used for the mode field in the mob_db. The
4738default mode is aggressive, assists, can move, can attack.
4739
4740Flag can be either zero or one currently. If zero, the clone is a normal
4741monster that'll target players, if one, it is considered a summoned monster,
4742and as such, it'll target other monsters. Defaults to zero.
4743
4744The duration specifies how long the clone will live before it is auto-removed.
4745Specified in seconds, defaults to no limit (zero).
4746
4747Returned value is the monster ID of the spawned clone. If command fails,
4748returned value is zero.
4749
4750---------------------------------------
4751
4752*summon "Monster name",<monster id>{,<Time Out>{,"event label"}};
4753
4754This command will summon a monster. (see also 'monster') Unlike monsters spawned
4755with other commands, this one will set up the monster to fight to protect the
4756invoking character. Monster name and mob id obey the same rules as the one given
4757at the beginning of this document for permanent monster spawns with the
4758exceptions mentioned when describing 'monster' command.
4759
4760The effect for the skill 'Call Homonuculus' will be displayed centered on the
4761invoking character.
4762
4763Timeout is the time in milliseconds the summon lives, and is set default
4764to 60000 (1 minute). Note that also the value 0 will set the timer to default,
4765and it is not possible to create a spawn that lastst forever.
4766If an event label is given, upon the monster being killed, the event label will
4767run as if by 'donpcevent'.
4768
4769// Will summon a dead branch-style monster to fight for the character.
4770summon "--ja--",-1;
4771
4772---------------------------------------
4773
4774*homevolution;
4775
4776This command will try to evolve the current player's homunculus.
4777If it doesn't work, the /swt emoticon is shown.
4778
4779To evolve a homunculus, the invoking player must have a homunculus,
4780the homunculus must not be the last evolution and
4781the homunculus must be on at least 91000/100000 intimacy with it's owner.
4782
4783---------------------------------------
4784------------------------------------------------
4785//===========================================\\
4786|| Mob Control Suit Commands ||
4787\\===========================================//
4788------------------------------------------------
4789
4790---------------------------------------
4791
4792* mobspawn (<monster name>,<monster ID>,<mapname>,<x>,<y>)
4793* mobRemove <GID>;
4794
4795This is used to spawn a monster and return it's Game ID, to be used
4796in the unit/mobcontrol commands.
4797
4798Note, I will use the stuff here in the examples for the unitcontrol.
4799
4800Example(s):
4801
4802//Spawns a poring named poi poi and put's it's GID in .GID.
4803 set .GID,mobspawn("Poi Poi",1002,"prontera",160,180);
4804//would kill our poring.
4805 mobRemove .GID;
4806
4807---------------------------------------
4808
4809* getmobdata(<GID>,<arrayname>)
4810* setmobdata <GID>,<parameter>,<new value>;
4811
4812This is used to get and set special data related to the monster.
4813With getmobdata, the array given will be filled with the current data. In setmobdata
4814the indexes in the array would be used to set that data on the monster.
4815Parameters (indexes) are: (getmobdata僅支æŒåˆ°47)
4816
48170 = é”物ID 7 = y 14 = 髮型 21 = æ¦å™¨
48181 = ç‰ç´š 8 = 移動速度 15 = 髮色 22 = 攻擊速度
48192 = HP 9 = mode (see doc/mob_db_mode_list.txt) 16 = é 下 23 = 颿œæ–¹å‘
48203 = max HP 10 = special AI state 17 = é ä¸ 24 = killer state (1 or 0)
48214 = 主人 ID (aid of the master, summon) 11 = SC option 18 = é 上 25 = callback flag
48225 = 地圖編號 12 = 性別 19 = è¡£æœé¡è‰² 26 = ç¦æ¢éš¨æ©Ÿç§»å‹• (1 or 0)
48236 = x 13 = 外觀ID (é”物 ID, Job ID) 20 = 盾
4824
482527 = 陣營 28 = ç›®çš„åæ¨™x 29 = ç›®çš„åæ¨™y 30 = 射程
482631 = atk1 32 = atk2 33 = amotion 34 = adelay
482735 = dmotion 36 = def 37 = mdef
482838 = str 39 = agi 40 = vit
482941 = int 42 = dex 43 = luk 44 = 體型
483045 = ç¨®æ— 46 = 屬性 47 = 屬性ç‰ç´š 48 = 顯示å (å—符串)
4831
4832Example(s):
4833
4834//this will set all the mobdata in the @array variable. (@array[1] being level, @array[13] class etc)
4835 getmobdata .GID,@array;
4836
4837//set the max hp of our poring to 1000.
4838 setmobdata .GID,3,1000;
4839
4840getmobdata()指令返回值為0時,說明該é”物已經æ»äº¡ã€‚
4841
4842---------------------------------------
4843
4844* mobassist <GID>,<target id>;
4845This will make the monster assist the Target ID as if it was a summon of it.
4846Example(s):
4847
4848/this will make our poring assist the current attached player! >:3
4849 mobassist .GID,getcharid(3);
4850
4851---------------------------------------
4852
4853* mobattach <GID>{,"<NPC Name>"};
4854
4855GID is the GID of a monster, NPC or account id. The NPC running or
4856he NPC name given is used to attach the monster.
4857
4858By attaching a monster, the NPC to which it is attached is ran on special actions by the monster.
4859The system will set specific data in the .ai_action variable array on the NPC invoked.
4860The special AI actions types are set in the .ai_action at place AI_ACTION_TAR_TYPE
4861
4862More AI_ vars are set in const.txt, and you can also look at sample/monstercontroller.cpp:
4863
4864---------------------------------------
4865
4866* unitwalk <GID>,<x>,<y>{,<flag>};
4867* unitwalk <GID>,<mapid>;
4868
4869This is one command, but can be used in two ways. If only the first argument is given,
4870the unit whose GID is given will start walking towards the map with the given mapid
4871(we believe these are the mapindexes found in db/map_index.txt).
4872
4873flag值若å˜åœ¨åªèƒ½ç‚º2,å³å¼·åˆ¶èµ°å‹•。é”物或者玩家在ä¸èƒ½è¡Œèµ°çš„狀態下,例如暈眩ã€pcblockmoveç‰ç‹€æ…‹ï¼Œå¯ä»¥ä½¿ç”¨è©²å‘½ä»¤è¡Œèµ°ã€‚
4874GID為é”物GID,或者玩家AID。
4875該命令主è¦ç”¨æ–¼éŠæˆ²è…³æœ¬ï¼Œå³çީ家ä¸èƒ½æŽ§åˆ¶èµ°å‹•,而系統å¯ä»¥æŽ§åˆ¶å…¶è¡Œèµ°ã€‚
4876
4877When 2 arguments are passed, the given unit will walk to the given x,y coordinates on
4878the map where the unit currently is.
4879
4880Example(s):
4881
4882//Will move/walk the poring we made to the coordinates 150,150
4883 unitwalk .GID,150,150;
4884
4885//Will move the poring towards alberta (if my assumed mapindexes are correct).
4886 unitwalk .GID,3;
4887
4888---------------------------------------
4889
4890* unitkill <GID>;
4891* unitwarp <GID>,<Mapname>,<x>,<y>;
4892* unitattack <GID>,<Target ID>;
4893* unitstop <GID>;
4894* unittalk <GID>,<Text>;
4895* unitemote <GID>,<Emote>;
4896
4897Okay, these commands should be fairly self explaining.
4898For the emotions, you can look in db/const.txt for prefixes with e_
4899
4900GID為0表示腳本關è¯çš„å°è±¡ã€‚
4901
4902---------------------------------------
4903
4904------------------------------------------------
4905//===========================================\\
4906|| End of Mob Control Suit Commands ||
4907\\===========================================//
4908------------------------------------------------
4909---------------------------------------
4910
4911*disablenpc "<NPC object name>";
4912*enablenpc "<NPC object name>";
4913*hideonnpc "<NPC object name>";
4914*hideoffnpc "<NPC object name>";
4915
4916These two commands will disable and enable, respectively, an NPC object
4917specified by name. The disabled NPC will disappear from sight and will no longer
4918be triggerable in the normal way. It is not clear whether it will still be
4919accessible through 'donpcevent' and other triggering commands, but it probably
4920will be. You can disable even warp NPCs if you know their object names, which is
4921an easy way to make a map only accessible through walking half the time. Then
4922you 'enablenpc' them back.
4923
4924You can also use these commands to create the illusion of an NPC switching
4925between several locations, which is often better than actually moving the NPC -
4926create one NPC object with a visible and a hidden part to their name, make a few
4927copies, and then disable all except one.
4928
4929hideonnpcå’Œdisablenpcä¸€æ¨£éƒ½ä¸æœƒè§¸ç™¼disablenpc䏿œƒè§¸ç™¼çš„è…³æœ¬ï¼Œåªæ˜¯å®¢æˆ¶ç«¯æ•ˆæžœä¸åŒï¼Œhide有一個隱匿效果。
4930
4931---------------------------------------
4932
4933*hideonnpc2 "<NPC object name>";
4934*hideoffnpc2 "<NPC object name>";
4935
4936These commands will make the NPC object specified display as hidden/visible,
4937even though not actually disabled per se. Hidden as in thief Hide skill, but
4938unfortunately, not detectable by Ruwach or Sight.
4939
4940As they are now, these commands are pointless, it is suggested to use
4941'disablenpc'/'enablenpc', because these two commands actually unload the NPC
4942sprite location and other accompanying data from memory when it is not used.
4943However, you can use these for some quest ideas (such as cloaking npcs talking
4944while hidden then revealing.... you can wonder around =P
4945
4946---------------------------------------
4947
4948*doevent "<NPC object name>::<event label>";
4949
4950This command will start a new execution thread in a specified NPC object at the
4951specified label. The execution of the script running this command will not stop.
4952No parameters may be passed with a doevent call.
4953
4954The script of the NPC object invoked in this manner will run as if it's been
4955invoked by the RID that was active in the script that issued a 'doevent'.
4956
4957 place,100,100,1%TAB%script%TAB%NPC%TAB%53,{
4958 mes "This is what you will see when you click me";
4959 close;
4960 Label:
4961 mes "This is what you will see if the doevent is activated";
4962 close;
4963 }
4964
4965 ....
4966
4967 doevent "NPC::Label";
4968
4969---------------------------------------
4970
4971*donpcevent "{NPC NAME}::<event label>";
4972
4973This command is kinda confusing cause it performs in two completely different
4974ways.
4975
4976If the event label is phrased like "::<label name>", all NPC objects that have a
4977specified label in them will be invoked as if by a 'doevent', but no RID
4978whatsoever will be attached while they execute.
4979
4980Otherwise, if the label is given as "<NPC name>::<label name>", a label within
4981the NPC object that runs this command will be called, but as if it was running
4982inside another, specified NPC object. No RID will be attached to it in this case
4983either.
4984
4985This can be used for making another NPC react to an action that you have done
4986with the NPC that has this command in it, i.e. show an emotion, or say
4987something.
4988
4989 place,100,100,1%TAB%script%TAB%NPC%TAB%53,{
4990 mes "Hey NPC2 copy what I do";
4991 close2;
4992 set @emo, rand(1,30);
4993 donpcevent "NPC2::Emo";
4994 Emo:
4995 emotion @emo;
4996 end;
4997 }
4998
4999 place,102,100,1%TAB%script%TAB%NPC2%TAB%53,{
5000 mes "Hey NPC copy what I do";
5001 close2;
5002 set @emo, rand(1,30);
5003 donpcevent "NPC::Emo";
5004 Emo:
5005 emotion @emo;
5006 end;
5007 }
5008
5009This will make both NPC perform the same random emotion from 1 to 30, and the
5010emotion will appear above each of their heads.
5011
5012---------------------------------------
5013
5014*cmdothernpc "<npc name>","<command>";
5015
5016This is simply "donpcevent <npc name>::OnCommand<command>".
5017It is an approximation of official server script language's 'cmdothernpc'.
5018
5019---------------------------------------
5020
5021*npctalk "<message>"{,"<npcå>"};
5022
5023This command will display a message to the surrounding area as if the NPC object
5024running it was a player talking - that is, above their head and in the chat
5025window. The display name of the NPC will get appended in front of the message to
5026complete the effect.
5027
5028 // This will make everyone in the area see the NPC greet the character
5029 // who just invoked it.
5030 npctalk "Hello "+strcharinfo(0)+" how are you";
5031
5032---------------------------------------
5033
5034*setnpcdisplay("<npc name>", "<display name>", <class id>, <size>)
5035*setnpcdisplay("<npc name>", "<display name>", <class id>)
5036*setnpcdisplay("<npc name>", "<display name>")
5037*setnpcdisplay("<npc name>", <class id>)
5038
5039Changes the display name and/or display class of the target npc.
5040Returns 0 is successful, 1 if the npc does not exist.
5041Size is 0 = norma 1 = small 2 = big.
5042
5043Since trunk r11779
5044
5045---------------------------------------
5046\\
50475,1.- Time-related commands
5048\\
5049---------------------------------------
5050*addtimer <ticks>,"<NPC object name>::<label>";
5051*deltimer "<NPC object name>::<event label>";
5052*addtimercount <ticks>,"<NPC object name>::<event label>";
5053
5054These commands will create and manage a player-based timer: 'addtimer' to
5055create, 'deltimer' to destroy and 'addtimercount' to delay it by the specified
5056number of ticks. For all three cases, the event label given is the identifier of
5057that timer. A player can have multiple timers running at the same time, and
5058there can even be multiple timers referencing the same label.
5059
5060When this timer runs out, a new execution thread will start in the specified NPC
5061object at the specified label, and the script will run attached to that player.
5062If the specified label is not found, the map server will happily print an error.
5063
5064The ticks are given in 1/1000ths of a second.
5065
5066One more thing. These timers are stored as part of player data. If the player
5067logs out, all of these get immediately deleted, without executing the script.
5068If this behavior is undesirable, use some other timer mechanism (like 'sleep').
5069
5070Example 1:
5071<NPC Header> {
5072 dispbottom "Starting a 5 second timer...";
5073 addtimer 5000, strnpcinfo(3)+"::On5secs";
5074 end;
5075On5secs:
5076 dispbottom "5 seconds have passed!";
5077 end;
5078}
5079
5080
5081---------------------------------------
5082
5083*initnpctimer{ "<NPC name>" {, <Attach Flag>} } |
5084 { "<NPC name>" | <Attach Flag> };
5085*stopnpctimer{ "<NPC name>" {, <Detach Flag>} } |
5086 { "<NPC name>" | <Detach Flag> };
5087*startnpctimer{ "<NPC name>" {, <Attach Flag>} } |
5088 { "<NPC name>" | <Attach Flag> };
5089*setnpctimer <tick>{,"<NPC name>"};
5090*getnpctimer(<type of information>{,"<NPC name>"});
5091*attachnpctimer {"<character name>"};
5092*detachnpctimer {"<NPC name>"};
5093
5094This set of commands and functions will create and manage an NPC-based timer.
5095The NPC name may be omitted, in which case the calling NPC is used as target.
5096
5097Contrary to addtimer/deltimer commands which let you have many different timers
5098referencing different labels in the same NPC, each with their own countdown,
5099'initnpctimer' can only have one per NPC object. But it can trigger many labels
5100and let you know how many were triggered already and how many still remain.
5101
5102This timer is counting up from 0 in ticks of 1/1000ths of a second each. Upon
5103creating this timer, the execution will not stop, but will happily continue
5104onward. The timer will then invoke new execution threads at labels
5105"OnTimer<time>:" in the NPC object it is attached to.
5106
5107To create the timer, use the 'initnpctimer', which will start it running.
5108'stopnpctimer' will pause the timer, without clearing the current tick, while
5109'startnpctimer' will let the paused timer continue.
5110
5111By default timers do not have a RID attached, which lets them continue even
5112if the player that started them logs off. To attach a RID to a timer, you can
5113either use the optional "attach flag" when using 'initnpctimer/startnpctimer',
5114or do it manually by using 'attachnpctimer'. Likewise, the optional flag of
5115stopnpctimer lets you detach any RID after stopping the timer, and by using
5116'detachnpctimer' you can detach a RID at any time.
5117
5118Normally there is only a single timer per NPC, but as an exception, as long as
5119you attach a player to the timer, you can have multiple timers running at once,
5120because these will get stored on the players instead of the NPC.
5121NOTE: You need to attach the RID before the timer _before_ you start it to
5122get a player-attached timer. Otherwise it'll stay a NPC timer (no effect).
5123
5124If the player that is attached to the npctimer logs out, the "OnTimerQuit:"
5125event label of that npc will be triggered, so you can do the appropiate
5126cleanup (the player is still attached when this event is triggered).
5127
5128The 'setnpctimer' command will explicitly set the timer to a given tick.
5129'getnpctimer' provides timer information. Its parameter defines what type:
5130
5131 0 - Will return the current tick count of the timer.
5132 1 - Will return 1 if there are remaining "OnTimer<ticks>:" labels in the
5133 specified NPC waiting for execution.
5134 2 - Will return the number of times the timer has triggered and will trigger
5135 an "OnTimer<tick>:" label in the specified NPC.
5136
5137Example 1:
5138
5139 <NPC Header> {
5140 initnpctimer;
5141 npctalk "I cant talk right now, give me 10 seconds";
5142 end;
5143 OnTimer5000:
5144 npctalk "Ok 5 seconds more";
5145 end;
5146 OnTimer6000:
5147 npctalk "4";
5148 end;
5149 OnTimer7000:
5150 npctalk "3";
5151 end;
5152 OnTimer8000:
5153 npctalk "2";
5154 end;
5155 OnTimer9000:
5156 npctalk "1";
5157 end;
5158 OnTimer10000:
5159 stopnpctimer;
5160 mes "[Man]";
5161 mes "Ok we can talk now";
5162 }
5163
5164Example 2:
5165
5166 OnTimer15000:
5167 npctalk "Another 15 seconds have passed.";
5168 setnpctimer 0;
5169 end;
5170
5171 // This OnInit label will run when the script is loaded, so that the timer
5172 // is initialised immediately as the server starts. It is dropped back to 0
5173 // every time the NPC says something, so it will cycle continiously.
5174 OnInit:
5175 initnpctimer;
5176 end;
5177
5178Example 3:
5179
5180 mes "[Man]";
5181 mes "I have been waiting "+(getnpctimer(0)/1000)+" seconds for you";
5182 // we divide the timer returned by 1000 cause it will be displayed in
5183 // milliseconds otherwise
5184 close;
5185
5186Example 4:
5187
5188 mes "[Man]";
5189 mes "Ok I will let you have 30 sec more";
5190 close2;
5191 setnpctimer (getnpctimer(0)-30000);
5192 // Notice the 'close2'. If there were a 'next' there the timer would be
5193 // changed only after the player pressed the 'next' button.
5194 end;
5195
5196---------------------------------------
5197
5198*sleep {<milliseconds>};
5199*sleep2 {<milliseconds>};
5200*awake "<NPC name>";
5201
5202These commands are used to control the pause of a NPC.
5203sleep and sleep2 will pause the script for the given amount of milliseconds.
5204Awake is used to cancel a sleep. When awake is callen on a NPC it will run as
5205if the sleep timer ran out, and thus making the script continue. Sleep and sleep2
5206basically do the same, but the main difference is that sleep will not keep the rid,
5207while sleep2 does.
5208
5209Examples:
5210 sleep 10000; //pause the script for 10 seconds and ditch the RID (so no player is attached anymore)
5211 sleep2 5000; //pause the script for 5 seconds, and continue with the RID attached.
5212 awake "NPC"; //Cancels any running sleep timers on the NPC 'NPC'.
5213
5214---------------------------------------
5215//
52165,1.- End of time-related commands
5217//
5218
5219*announce "<text>",<flag>{,<fontColor>{,<fontType>{,<fontSize>{,<fontAlign>{,<fontY>}}}}}};
5220
5221This command will broadcast a message to all or most players, similar to
5222@kami/@kamib GM commands.
5223
5224 announce "This will be shown to everyone at all in yellow.",0;
5225
5226The region the broadcast is heard in (target), source of the broadcast
5227and the color the message will come up as is determined by the flags.
5228
5229The flag values are coded as constants in db/const.txt to make them easier to use.
5230
5231Target flags:
5232- bc_all: Broadcast message is sent server-wide (default).
5233- bc_map: Message is sent to everyone in the same map as the source of the broadcast (see below).
5234- bc_area: Message is sent to players in the vecinity of the source.
5235- bc_self: Message is sent only to current player.
5236You cannot use more than one target flag.
5237
5238Source flags:
5239- bc_pc: Broadcast source is the attached player (default).
5240- bc_npc: Broadcast source is the NPC, not the player attached to the script
5241 (useful when a player is not attached or the message should be sent to those
5242 nearby the npc).
5243You cannot use more than one source flag.
5244
5245Special flags:
5246- bc_yellow: Broadcast will be displayed in yellow color (default).
5247- bc_blue: Broadcast will be displayed in blue color.
5248- bc_woe: Indicates that this broadcast is 'WoE Information' that can be disabled client-side.
5249Due to the way client handles broadcasts, it is impossible to set both bc_blue and bc_woe.
5250
5251The optional parameters allow usage of broadcasts in custom colors, font-weights, sizes etc.
5252If any of the optional parameters is used, special flag is ignored.
5253Optional parameters may not work well (or at all) depending on a game client used.
5254
5255The color parameter is a single number which can be in hexadecimal notation.
5256For example:
5257 announce "This will be shown to everyone at all in green.",bc_all,0x00FF00;
5258Will display a global announce in green. The color format is in RGB (0xRRGGBB).
5259
5260In official scripts only two font-weights (types) are used:
5261 - normal (FW_NORMAL = 400, default),
5262 - bold (FW_BOLD = 700).
5263
5264Default font size is 12.
5265
5266Using this for private messages to players is probably not that good an idea,
5267but it can be used instead in NPCs to "preview" an announce.
5268
5269 // This will be a private message to the player using the NPC that made the
5270 // announcement
5271 announce "This is my message just for you",bc_blue|bc_self;
5272
5273 // This will be shown on everyones screen that is in sight of the NPC.
5274 announce "This is my message just for you people here",bc_npc|bc_area;
5275
5276---------------------------------------
5277
5278*mapannounce "<map name>","<text>",<flag>{,<fontColor>{,<fontType>{,<fontSize>{,<fontAlign>{,<fontY>}}}}}};
5279
5280This command will work like 'announce' but will only broadcast to characters
5281currently residing on the specified map. The flag and optional paramaters
5282parameters are the same as in 'announce', but target and source flags are ignored.
5283
5284---------------------------------------
5285
5286*areaannounce "<map name>",<x1>,<y1>,<x2>,<y2>,"<text>",<flag>{,<fontColor>{,<fontType>{,<fontSize>{,<fontAlign>{,<fontY>}}}}}};
5287
5288This command works like 'announce' but will only broadcast to characters
5289residing in the specified x1/y1-x2/y2 rectangle on the map given. The flags and
5290optional parameters are the same as in 'announce', but target and source flags are ignored.
5291
5292 areaannounce "prt_church",0,0,350,350,"God's in his heaven, all right with the world",0;
5293
5294---------------------------------------
5295
5296*callshop "<name>",<option>;
5297
5298These are a series of commands used to create dynamic shops.
5299The callshop function calls a invisible shop (view -1) as if the player clicked on it.
5300
5301For the options on callShop:
5302 0 = The normal window (buy, sell and cancel)
5303 1 = The buy window
5304 2 = The sell window
5305
5306Example(s):
5307
5308callshop "DaShop",1; //Will call the shop named DaShop and opens the buy menu.
5309
5310The shop which is called by callshop (as long as an npcshop* command is executed
5311from that NPC (see note 1)) will trigger the labels OnBuyItem and OnSellitem. These
5312labels can take over handling for relatively the buying of items from the shop
5313and selling the items to a shop. Via these labels you can customize the way an item
5314is bought or sold by a player.
5315
5316In the OnBuyItem, two arrays are set (@bought_nameid and @bough_quantity), which
5317hold information about the name id (item id) sold and the amount sold of it. Same
5318goes for the OnSellItem label, only the variables are named different
5319(@sold_nameid and @sold_quantity). An example on a shop comes with eAthena, and
5320can be found in the npc/sample/npc_dynamic_shop.txt file.
5321
5322This example shows how to use the labels and their set variables to create a dynamic shop.
5323
5324Note 1: These labels will only be triggered if a npcshop* command is executed, this is
5325because these commands set a special data on the shop npc,named master_nd in the source.
5326The OnSellItem and OnBuyItem are triggered in the NPC whose master_nd is given in the shop.
5327This was found out thanks to 'Hondacrx', noticing the OnBuyItem wasn't triggered unless
5328npcshopitem was used. After rechecking the source, I found what caused this.
5329
5330---------------------------------------
5331
5332*npcshopitem "<name>",<item id>,<price>{,<item id>,<price>{,<item id>,<price>{,...}}}
5333
5334This command lets you override the contents of an existing npc shop. The
5335current sell list will be wiped, and only the items specified with the price
5336specified will be for sale.
5337
5338The function returns 1 if shop was updated successfully, or 0 if not found.
5339
5340Note that you cannot use -1 to specify default selling price!
5341
5342---------------------------------------
5343
5344*npcshopadditem "<name>",<item id>,<price>{,<item id>,<price>{,<item id>,<price>{,...}}}
5345
5346This command will add more items at the end of the selling list for the
5347specified npc shop. If you specify an item already for sell, that item will
5348appear twice on the sell list.
5349
5350The function returns 1 if shop was updated successfully, or 0 if not found.
5351
5352Note that you cannot use -1 to specify default selling price!
5353
5354---------------------------------------
5355
5356*npcshopdelitem "<name>",<item id>{,<item id>{,<item id>{,...}}}
5357
5358This command will remove items from the specified npc shop.
5359If the item to remove exists more than once on the shop, all instances will be
5360removed.
5361
5362Note that the function returns 1 even if no items were removed. The return
5363value is only to confirm that the shop was indeed found.
5364
5365---------------------------------------
5366
5367*npcshopattach "<name>"{,<標記>}
5368
5369This command will attach the current script to the given npc shop.
5370When a script is attached to a shop, the events "OnBuyItem" and "OnSellItem"
5371of your script will be executed whenever a player buys/sells from the shop.
5372Additionally, the arrays @bought_nameid[], @bought_quantity[] or @sold_nameid[]
5373and @sold_quantity[] will be filled up with the items and quantities
5374bought/sold.
5375
5376The optional parameter specifies whether to attach ("1") or detach ("0") from
5377the shop (the default is to attach). Note that detaching will detach any npc
5378attached to the shop, even if it's from anOnActive Script, while attaching will
5379override any OnActive Script that may be already attached.
5380
5381The function returns 0 if the shop was not found, 1 otherwise.
5382
5383---------------------------------------
5384
5385*waitingroom "<chatroom name>",<limit>{,<event label>,<trigger>,<required zeny>,<min lvl>,<max lvl>};
5386
5387This command will create a chat room, owned by the NPC object running this
5388script and displayed above the NPC sprite.
5389The maximum length of a chatroom name is 60 letters.
5390
5391The limit is the maximum number of people allowed to enter the chat room. If the
5392optional event and trigger parameters are given, the event label
5393("<NPC object name>::<label name>") will be invoked as if with a 'doevent' upon
5394the number of people in the chat room reaching the given triggering amount.
5395
5396// The NPC will just show a box above its head that says "Hello World", clicking
5397// it will do nothing, since the limit is zero.
5398 waitingroom "Hello World",0;
5399
5400// The NPC will have a box above its head, it will say "Disco - Waiting Room"
5401// and will have 8 waiting slots. Clicking this will enter the chat room, where
5402// the player will be able to wait until 8 people accumulate. Once this happens,
5403// it will cause the NPC "Bouncer" run the label "OnStart"
5404
5405 waitingroom "Disco - Waiting Room",8,"Bouncer::OnStart",8;
5406
5407// The NPC will have a box above its head, it will say "Party - Waiting Room"
5408// and will have 8 waiting slots. Clicking this will allow a player who has
5409// 5000 zeny and lvl 50~99 to enter the chat room, where the player will be
5410// able to wait until 8 people accumulate. Once this happens, it will cause
5411// the NPC "Bouncer" run the label "OnStart"
5412
5413 waitingroom "Party - Waiting Room",5,"Bouncer::OnStart",8,5000,50,99;
5414
5415Creating a waiting room does not stop the execution of the script and it will
5416continue to the next line.
5417
5418For more examples see the 2-1 and 2-2 job quest scripts which make extensive use
5419of waiting rooms.
5420
5421---------------------------------------
5422
5423*delwaitingroom {"<NPC object name"};
5424
5425This command will delete a waiting room. If no parameter is given, it will
5426delete a waiting room attached to the NPC object running this command, if it is,
5427it will delete a waiting room owned by another NPC object. This is the only way
5428to get rid of a waiting room, nothing else will cause it to disappear.
5429
5430It's not clear what happens to a waiting room if the NPC is disabled with
5431'disablenpc', by the way.
5432
5433---------------------------------------
5434
5435*enablewaitingroomevent {"<NPC object name>"};
5436*disablewaitingroomevent {"<NPC object name>"};
5437*enablearena;
5438*disablearena;
5439
5440This will enable and disable triggering the waiting room event (see
5441'waitingroom') respectively. Optionally giving an NPC object name will do that
5442for a specified NPC object. The chat room will not disappear when triggering is
5443disabled and enabled in this manner and players will not be kicked out of it.
5444Enabling a chat room event will also cause it to immediately check whether the
5445number of users in it exceeded the trigger amount and trigger the event
5446accordingly.
5447
5448Normally, whenever a waiting room was created to make sure that only one
5449character is, for example, trying to pass a job quest trial, and no other
5450characters are present in the room to mess up the script.
5451
5452The 'enablearena'/'disablearena' commands are just aliases with no parameter.
5453These are supposedly left here for compatibility with official server scripts,
5454but no eathena script uses these at the moment.
5455
5456---------------------------------------
5457
5458*getwaitingroomstate(<information type>{,"<NPC object name>"})
5459
5460This function will return information about the wating room state for the
5461attached waiting room or for a waiting room attached to the specified NPC if
5462any.
5463
5464The valid information types are:
5465
5466 0 - Number of users currently chatting.
5467 1 - Maximum number of users allowed.
5468 2 - Will return 1 if the waiting room has a trigger set.
5469 0 otherwise.
5470 3 - Will return 1 if the waiting room is currently disabled.
5471 0 otherwise.
5472 4 - The Title of the waiting room (string)
5473 5 - Password of the waiting room, if any. Pointless, since there is no way to
5474 set a password on a waiting room right now.
5475 16 - Event name of the waiting room (string)
5476 32 - Whether or not the waiting room is full.
5477 33 - Whether the amount of users in the waiting room is higher than the trigger
5478 number.
5479
5480---------------------------------------
5481
5482*getwaitingroommember "<NPC object name>"
5483
5484該指令返回一個包å«èŠå¤©å®¤æˆå“¡AID的數組$@waitingroommemberaid[]和一個èŠå¤©å®¤æˆå“¡æ•¸
5485的變é‡$@waitingroommembercount
5486
5487---------------------------------------
5488
5489*warpwaitingpc "<地圖å>",<x>,<y>{,<number of people>};
5490
5491This command will warp the amount of characters equal to the trigger number of
5492the waiting room chat attached to the NPC object running this command to the
5493specified map and coordinates, kicking them out of the chat. Those waiting the
5494longest will get warped first. It can also do a random warp on the same map
5495("Random" instead of map name) and warp to the save point ("SavePoint").
5496
5497The list of characters to warp is taken from the list of the chat room members.
5498Those not in the chat room will not be considered even if they are talking to
5499the NPC in question. If the number of people is given, exactly this much people
5500will be warped.
5501
5502This command can also keep track of who just got warped. It does this by setting
5503special variables:
5504
5505$@warpwaitingpc[] is an array containing the character id numbers of the
5506 characters who were just warped.
5507$@warpwaitingpcnum contains the number of the character it just warped.
5508
5509See also 'getpartymember' for advice on what to do with those variables.
5510
5511The obvious way of using this effectively would be to set up a waiting room for
5512two characters to be warped onto a random PVP map for a one-on-one duel, for
5513example.
5514
5515---------------------------------------
5516
5517*kickwaitingroomall {"<NPC object name>"};
5518
5519This command would kick everybody out of a specified waiting room chat. IF it
5520was properly linked into the script interpreter which it isn't, even though the
5521code for it is in place. Expect this to become available in upcoming SVN
5522releases.
5523
5524---------------------------------------
5525
5526*kickwaitingroom {"<AID>"};
5527
5528該指令會把腳本關è¯çš„玩家從èŠå¤©å®¤ä¸è¸¢å‡ºï¼ˆå¦‚果指定AID則是該指定玩家)。
5529踢出æˆåŠŸè¿”å›ž0。返回-1或1éƒ½æ˜¯ä¸æˆåŠŸã€‚
5530
5531---------------------------------------
5532
5533*setmapflagnosave "<地圖å>","<alternate map name>",<x>,<y>;
5534
5535This command sets the 'nosave' flag for the specified map and also gives an
5536alternate respawn-upon-relogin point.
5537
5538It does not make a map impossible to make a savepoint on as you would normally
5539think, 'savepoint' will still work. It will, however, make the specified map
5540kick the reconnecting players off to the alternate map given to the coordinates
5541 specified.
5542
5543---------------------------------------
5544
5545*setmapflag "<地圖å>",<標記>;
5546
5547This command marks a specified map with a map flag given. Map flags alter the
5548behavior of the map, you can see the list of the available ones in
5549'db/const.txt' under 'mf_'.
5550
5551The map flags alter the behavior of the map regarding teleporting (mf_nomemo,
5552mf_noteleport, mf_nowarp, mf_nogo), storing location when disconnected
5553(mf_nosave), dead branch usage (mf_nobranch), penalties upon death
5554(mf_nopenalty, mf_nozenypenalty), PVP behavior (mf_pvp, mf_pvp_noparty,
5555mf_pvp_noguild), WoE behavior (mf_gvg,mf_gvg_noparty), ability to use
5556skills or open up trade deals (mf_notrade, mf_novending, mf_noskill, mf_noicewall),
5557current weather effects (mf_snow, mf_fog, mf_sakura, mf_leaves, mf_rain, mf_clouds,
5558mf_fireworks) and whether night will be in effect on this map (mf_nightenabled).
5559
5560---------------------------------------
5561
5562*removemapflag "<map name>",<flag>;
5563
5564This command removes a mapflag from a specified map.
5565See 'setmapflag' for a list of mapflags.
5566
5567---------------------------------------
5568
5569*getmapflag("<map name>",<flag>)
5570
5571This command checks the status of a given mapflag and returns the mapflag's state.
55720 means OFF, and 1 means ON. See 'setmapflag' for a list of mapflags.
5573
5574---------------------------------------
5575
5576*setbattleflag "<battle flag>",<value>;
5577*getbattleflag("<battle flag>")
5578
5579Sets or gets the value of the given battle flag.
5580Battle flags are the flags found in the battle/*.conf files and is also used in Lupus' variable rates script.
5581
5582Example(s):
5583
5584//will set the base experience rate to 20x (2000%)
5585 setBattleFlag "base_exp_rate",2000;
5586
5587//will return the value of the base experience rate (when used after the above example, it would return 2000).
5588 getBattleFlag "base_exp_rate";
5589
5590---------------------------------------
5591
5592*removemapflag "<地圖å>",<標記>;
5593
5594This command removes a mapflag from a specified map. See 'setmapflag'.
5595
5596---------------------------------------
5597
5598*warpportal <x>,<y>,"<mapname>",<x>,<y>;
5599
5600Creates a warp Portal as if a acolyte class character did it.
5601The first x and y is the place of the warp portal on the map where the NPC is on
5602The mapname and second x and y is the target area of the warp portal.
5603
5604Example(s):
5605
5606//Will create a warp portal on the NPC's map at 150,150 leading to prontera, coords 150,180.
5607 warpPortal 150,150,"prontera",150,180;
5608
5609---------------------------------------
5610
5611*mapwarp "<from map>","<to map>",<x>,<y>;
5612
5613This command will collect all characters located on the From map and warp them
5614wholesale to the same point on the To map, or randomly distribute them there if
5615the coordinates are zero. "Random" is understood as a special To map name and
5616will mean randomly shuffling everyone on the same map.
5617
5618---------------------------------------
5619\\
56205,2.- Guild-related Commands
5621\\
5622---------------------------------------
5623
5624*maprespawnguildid "<地圖å>",<guild id>,<標記>;
5625
5626This command goes through the specified map and for each player and monster
5627found there does stuff.
5628
5629Flag is a bitmask (add up numbers to get effects you want)
5630 1 - warp all guild members to their savepoints.
5631 2 - warp all non-guild members to their savepoints.
5632 4 - remove all monsters which are not guardian or emperium.
5633
5634Flag 7 will, therefore, mean 'wipe all mobs but guardians and the emperium and
5635kick all characters out', which is what the official scripts do upon castle
5636surrender. Upon start of WoE, the scripts do 2 (warp all intruiders out).
5637
5638Characters not belonging to any guild will warp out regardless of the flag setting.
5639
5640For examples, check the WoE scripts in the distribution.
5641
5642---------------------------------------
5643
5644*agitstart;
5645*agitend;
5646*agitstart2;
5647*agitend2;
5648*agitstart3;
5649*agitend3;
5650
5651These two commands will start and end War of Emperium.
5652
5653This is a bit more complex than it sounds, since the commands themselves won't
5654actually do anything interesting, except causing all 'OnAgitStart:' and
5655'OnAgitEnd:' events to run everywhere, respectively. They are used as
5656simple triggers to run a lot of complex scripts all across the server, and they,
5657in turn, are triggered by clock with an 'OnClock<time>:' time-triggering label.
5658
5659---------------------------------------
5660
5661*gvgon "<地圖å>";
5662*gvgoff "<地圖å>";
5663
5664These commands will turn GVG mode for the specified maps on and off, setting up
5665appropriate map flags. In GVG mode, maps behave as if during the time of WoE,
5666even though WoE itself may or may not actually be in effect.
5667
5668---------------------------------------
5669
5670*flagemblem <guild id>;
5671
5672This command only works when run by the NPC objects which have sprite id 722,
5673which is a 3D guild flag sprite. If it isn't, the data will change, but nothing
5674will be seen by anyone. If it is invoked in that manner, the emblem of the
5675specified guild will appear on the flag, though, if any players are watching it
5676at this moment, they will not see the emblem change until they move out of sight
5677of the flag and return.
5678
5679This is commonly used in official guildwar scripts with a function call which
5680returns a guild id:
5681
5682// This will change the emblem on the flag to that of the guild that owns
5683// "guildcastle"
5684
5685 flagemblem GetCastleData("guildcastle",1);
5686
5687---------------------------------------
5688
5689*guardian("<地圖å>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"<event label>"}{,<guardian index>})
5690
5691This command is roughly equivalent to 'monster', but is meant to be used with
5692castle guardian monsters and will only work with them. It will set the guardian
5693characteristics up according to the castle's investment values and otherwise
5694set the things up that only castle guardians need.
5695
5696Since trunk r12524:
5697Returns the id of the mob or 0 if an error occurred.
5698When 'guardian index' isn't supplied it produces a temporary guardian.
5699Temporary guardians are not saved with the castle and can't be accessed by guardianinfo.
5700
5701---------------------------------------
5702
5703*guardianinfo("<地圖å>", <guardian number>, <類型>)
5704
5705This function will return various info about the specified guardian, or -1
5706if it fails for some reason. It is primarily used in the castle manager npc.
5707
5708Map name and guardian number (value between 0 and 7) define the target.
5709Type indicates what information to return:
5710 0 - visibility (whether the guardian is installed or not)
5711 1 - max. hp
5712 2 - current hp
5713
5714---------------------------------------
5715//
57165,2.- End of guild-related commands
5717//
5718---------------------------------------
5719
5720*npcspeed <速度值>;
5721*npcwalkto <x>,<y>;
5722*npcstop;
5723
5724These commands will make the NPC object in question move around the map. As they
5725currently are, they are a bit buggy and are not useful for much more than making
5726an NPC move randomly around the map. (see 'npc/custom/devnpc.txt' for an example
5727of such usage)
5728
5729'npcspeed' will set the NPCs walking speed to a specified value. As in the
5730@speed GM command, 200 is the slowest possible speed while 0 is the fastest
5731possible (instant motion). 100 is the default character walking speed.
5732'npcwalkto' will start the NPC sprite moving towards the specified coordinates
5733on the same map as it is currently on.
5734'npcstop' will stop the motion.
5735
5736While in transit, the NPC will be clickable, but invoking it will cause it to
5737stop motion, which will make it's coordinates different from what the client
5738computed based on the speed and motion coordinates. The effect is rather
5739unnerving.
5740
5741Only a few NPC sprites have walking animations, and those that do, do not get
5742the animation invoked when moving the NPC, due to the problem in the npc walking
5743code, which looks a bit silly. You might have better success by defining a job-
5744sprite based sprite id in 'db/mob-avail.txt' with this.
5745
5746---------------------------------------
5747
5748*movenpc <NPCå>,x,y{,dir};
5749 作用:移動NPCåˆ°æŒ‡å®šåæ¨™(x,y)
5750 舉例:
5751 moveNPC "Bugga",100,20;
5752
5753---------------------------------------
5754
5755=====================
5756|6.- 其他命令. |
5757=====================
5758---------------------------------------
5759
5760*debugmes "<ä¿¡æ¯>";
5761
5762該命令會發é€ä¿¡æ¯è‡³æœå‹™å™¨æŽ§åˆ¶å° (地圖æœå‹™å™¨çª—å£). 除æ¤ä¹‹å¤–沒有地方會顯示.
5763
5764 debugmes strcharinfo(0)+" åšäº†xxx";
5765 // ä½ å¯ä»¥åœ¨åœ°åœ–æœå‹™å™¨çª—å£è£¡çœ‹åˆ° "NAME åšäº†xxx"
5766
5767---------------------------------------
5768
5769*logmes "<ä¿¡æ¯>";
5770
5771該命令會把信æ¯å¯«å…¥åœ°åœ–æœå‹™å™¨çš„記錄文件(在'conf/log_athena.conf'è¨ç½®çš„).
5772在TXT版本ä¸, 默èªè¨˜éŒ„文件是 'log/npclog.log'.
5773在SQL版本ä¸, 如果記錄功能打開, ä¿¡æ¯æœƒå˜å…¥npclog表, å¦å‰‡åŒTXT.
5774
5775如果記錄功能沒有打開, å‰‡ä»€éº¼éƒ½ä¸æœƒç™¼ç”Ÿ.
5776
5777---------------------------------------
5778
5779*globalmes "<ä¿¡æ¯>"{,"<NPCå>"};
5780
5781該命令會發é€ä¿¡æ¯è‡³æ‰€æœ‰é€£æŽ¥çŽ©å®¶çš„èŠå¤©çª—å£.
5782
5783如果指定了NPCåå—, ä¿¡æ¯å°±æœƒåƒæ˜¯NPC說的話那樣顯示.
5784
5785---------------------------------------
5786
5787*rand(<數å—>{,<數å—>});
5788
5789å¦‚æžœä½ åªæŒ‡å®šäº†ä¸€å€‹æ•¸,該命令會返回0 - ä½ æŒ‡å®šæ•¸ä¹‹é–“çš„ä¸€å€‹éš¨æ©Ÿæ•¸.
5790å¦‚æžœä½ æŒ‡å®š2個數,å‰‡è¿”å›žä½ æŒ‡å®š2個數之間的一個隨機數.
5791
5792rand(10) çš„çµæžœæœƒæ˜¯ 0,1,2,3,4,5,6,7,8 or 9
5793
5794rand(2,10) çš„çµæžœæœƒæ˜¯ 2,3,4,5,6,7,8,9 or 10
5795
5796---------------------------------------
5797
5798*mapviewpoint "地圖å",<動作>,<x>,<y>,<點數é‡>,<é¡è‰²>;
5799*viewpoint <動作>,<x>,<y>,<點數é‡>,<é¡è‰²>;
5800
5801該地圖會在連接的玩家的客戶端的å°åœ°åœ–ä¸Šåšæ¨™è¨˜ã€‚它是用地圖上的xã€y忍™ã€‚
5802é¡è‰²æœ‰åå…é€²åˆ¶æ•¸å—æ±ºå®š, å’Œmes命令用的一樣。
5803(çœ‹ä¸ŠåŽ»åƒ 0x<6使•¸å—>.)
5804
5805å‹•ä½œæ˜¯ä½ è¦å°é»žé€²è¡Œçš„æ“ä½œ, 1是è¨ç½®, 2是清除。多個點在åŒä¸€å標å¯ä»¥ç”¨ä¾†å‰µå»ºé–ƒå…‰é»žã€‚
5806
5807 // è©²å‘½ä»¤æœƒåœ¨åæ¨™ X 30 Y 40 忍™è¨˜,
5808 // 並且是紅色的.
5809
5810 viewpoint 1,30,40,1,0xFF0000;
5811
5812這會創建3個點:
5813
5814 viewpoint 1,30,40,1,0xFF0000;
5815 viewpoint 1,35,45,2,0xFF0000;
5816 viewpoint 1,40,50,3,0xFF0000;
5817
5818這是如何清除他們:
5819
5820 viewpoint 2,30,40,1,0xFF0000;
5821 viewpoint 2,35,45,2,0xFF0000;
5822 viewpoint 2,40,50,3,0xFF0000;
5823
5824å®¢æˆ¶ç«¯å„²å˜æ‰€æœ‰ä¿¡æ¯ï¼Œè€Œæœå‹™å™¨ç«¯ä¸æœƒã€‚
5825
5826---------------------------------------
5827
5828*mapcutin "地圖å","<文件å>",<ä½ç½®>;
5829*cutin "<文件å>",<ä½ç½®>;
5830
5831該命令會顯示GRF文件ä¸å„²å˜çš„圖片。
5832
5833文件å–自文件夾 '\data\texture\è Ÿæ·ç‰¢ç£å…¶æ’ˆè† \illust' . 而且似乎å¡ç‰‡å¤§åœ– \cardbmp
5834也能æ£å¸¸å·¥ä½œã€‚åªæœ‰ä½åœ–能顯示。.bmp後綴ä¸ä¸€å®šéœ€è¦ã€‚
5835
5836客戶端å°é¡¯ç¤º4096x4096的圖片時沒有å•題的,但通常情æ³ä¸‹åªé¡¯ç¤º500x500. é¡è‰² FF00FF
5837ç•¶ä½œé€æ˜Žè‰²ã€‚
5838
5839ä½ç½®è¡¨ç¤ºåœ¨å±å¹•上顯示圖片的ä½ç½®:
5840 0 - 左下角
5841 1 - 下ä¸
5842 2 - å³ä¸‹è§’
5843 3 - 有標題欄,å¯ç§»å‹•,居ä¸
5844 4 - 沒有標題欄,å¯ç§»å‹•,居ä¸
5845 255 - 去除所有圖片
5846
5847文件å留空而ä½ç½®255將移除所有圖片。其他ä½ç½®æ•¸å—䏿œƒä½¿è…³æœ¬å‡ºéŒ¯ï¼Œä½†æœƒä½¿å®¢æˆ¶ç«¯å‡ºéŒ¯ã€‚
5848一個å±å¹•åªèƒ½é¡¯ç¤ºä¸€å¼µåœ–片。
5849
5850 // é€™å€‹æœƒé¡¯ç¤ºç¬¬ä¸ƒå€‹å¡æ™®æ‹‰
5851 // æ©™è‰²è¿·ä½ è£™çš„é‚£å€‹
5852 cutin "kafra_7",2;
5853
5854 // 去除顯示的圖片
5855 cutin "Kafra_7",255;
5856
5857 // 去除所有顯示的圖片
5858 cutin "",255;
5859
5860---------------------------------------
5861
5862*pet <寵物>;
5863
5864æ•æ‰å¯µç‰©ç”¨ï¼Œå¯ä»¥åœ¨é“具腳本外使用。
5865
5866坿•æ‰å¯µç‰©ID見 'db/pet_db.txt'
5867
5868---------------------------------------
5869
5870*emotion <表情數å—>{,<目標>{,"<目標åå—>"}};
5871
5872顯示表情. 表情數å—見 'db/const.txt' 以 'e_' é–‹é çš„.
5873
5874目標為0或çœç•¥å‰‡è¡¨æƒ…顯示在NPCé 上,目標為1則顯示在腳本關è¯çš„å°è±¡é 上
5875
5876<目標åå—> å¯ä»¥åœ¨å…¶ä»–沒有事件標籤的NPC/PCèº«ä¸ŠåŸ·è¡Œæ¤æŒ‡ä»¤ã€‚如果沒有
5877發ç¾åå—å‰‡ä»€éº¼éƒ½ä¸æœƒåšã€‚
5878
5879---------------------------------------
5880
5881*misceffect <效果編號>;
5882
5883如果é‹è¡Œè©²å‘½ä»¤çš„NPC有顯示,則效果會顯示在該NPCé 上. å¦å‰‡å‰‡æœƒé¡¯ç¤ºåœ¨é—œè¯çŽ©å®¶èº«ä¸Š.
5884如果是é“具腳本則會顯示在玩家é 上。
5885
5886詳細效果見 'doc/effect_list.txt'.
5887
5888---------------------------------------
5889
5890*soundeffect "<文件å>",<類型>
5891*soundeffectall "<文件å>",<類型>{,"<地圖å>"}{,<x0>,<y0>,<x1>,<y1>}
5892
5893在關è¯çŽ©å®¶å®¢æˆ¶ç«¯æ’æ”¾éŸ³æ¨‚ ('soundeffect') 或在指定å€åŸŸçš„çŽ©å®¶å®¢æˆ¶ç«¯æ’æ”¾éŸ³æ¨‚
5894 ('soundeffectall'). 如果沒有指定å€åŸŸï¼Œå‰‡æœƒåœ¨é—œè¯çŽ©å®¶èº«ä¸Šæ’æ”¾ï¼Œå¦‚果沒有關è¯
5895玩家,則關è¯NPC。
5896
5897類型0æ’æ”¾éŸ³æ•ˆä¸€æ¬¡ã€‚
5898類型1æ˜¯ç”¨ä¾†å¾ªç’°æ’æ”¾çš„,後é¢è·Ÿæ¯«ç§’間隔。
5899類型2ç”¨ä¾†åœæ¢ç•¶å‰æ’放的音樂。
5900類型1ã€2ç•¶å‰æ‰€æœ‰å·²çŸ¥å®¢æˆ¶ç«¯éƒ½ä¸æ”¯æŒï¼Œæ‰€ä»¥æœå‹™ç«¯ä¸æ”¯æŒã€‚
5901å¯ä»¥ä½¿ç”¨ä¸‹é¢æŒ‡ä»¤ä¾†æ¸¬è©¦å®¢æˆ¶ç«¯æ˜¯å¦æ”¯æŒ
5902@send 0x1d3 S"complete.wav" B0 L0 L20000000(ä½ çš„aid)
5903@send 0x1d3 S"complete.wav" B1 L1000 L20000000
5904@send 0x1d3 S"complete.wav" B2 L0 L20000000
5905
5906---------------------------------------
5907
5908*playBGM "<背景音樂文件å>"
5909*playBGMall "<背景音樂文件å>",{,"<地圖å>"}{,<x0>,<y0>,<x1>,<y1>}
5910
5911é€™å…©æ¢æŒ‡ä»¤æœƒå°é—œè¯è§’色('playBGM')或多個角色('playBGMall')æ’æ”¾èƒŒæ™¯éŸ³æ¨‚。
5912如果由浮動NPCé‹è¡Œæ¤æŒ‡ä»¤æˆ–è€…ä¸æ˜¯ç”±NPC(é“具腳本)é‹è¡Œæ¤æŒ‡ä»¤ï¼Œè²éŸ³æœƒå¾žé—œè¯
5913腳本的角色(如果有的話)為ä¸å¿ƒç™¼å‡ºã€‚除æ¤ä¹‹å¤–,都會以NPC為ä¸å¿ƒç™¼å‡ºã€‚
5914
5915èƒŒæ™¯éŸ³æ¨‚æ–‡ä»¶åæ˜¯åœ¨/BGM/文件夾ä¸çš„æ–‡ä»¶å. å¿…é ˆä»¥.mp3為擴展å。
5916
5917腳本無需指定擴展å。
5918å¦‚æžœåæ¨™è¢«çœç•¥ï¼Œå‰‡å…¨åœ°åœ–æ’æ”¾ã€‚
5919
5920通常情æ³ä¸‹ï¼Œä½ å¯ä»¥é€™æ¨£è‡ªå®šç¾©èƒŒæ™¯éŸ³æ¨‚。
5921
5922---------------------------------------
5923
5924*pvpon "<地圖å>";
5925*pvpoff "<地圖å>";
5926
5927為指定地圖打開PVP模å¼ã€‚效果åŒ@pvpon。
5928
5929---------------------------------------
5930
5931*atcommand "<command line>",<標記>;
5932
5933這æ¢å‘½ä»¤æœƒé‹è¡Œåˆ¶å®šå‘½ä»¤ï¼Œå°±å¥½åƒæ˜¯99ç´šçš„GM在éµç›¤ä¸Šè¼¸å…¥ä¸€æ¨£ã€‚
5934
5935 // ç„¡æ¢ä»¶æ®ºæ»è©²çީ家
5936 input @player$;
5937 atcommand "@nuke "+@player$;
5938
5939使用標記後,將使用éœé»˜é»˜ç¤ºï¼Œä¸æœƒé¡¯ç¤ºå¹³æ™‚使用指令時的信æ¯ã€‚
5940
5941 //將䏿œƒçµ¦çŽ©å®¶é¡¯ç¤º"人物光環已顯示。"
5942 atcommand "@aura 675",1;
5943
5944---------------------------------------
5945
5946*charcommand <command>,<標記>;
5947
5948æ ¹æ“šLance所說該命令無需玩家關è¯ã€‚
5949
5950舉例:
5951 charCommand "#option 0 0 0 Roy";
5952
5953---------------------------------------
5954
5955*unitskilluseid <GID>,<技能id>,<技能ç‰ç´š>{,<目標id>{,<è© å”±æ™‚é–“>{,<是å¦å¯è¢«æ‰“æ–·>}}};
5956*unitskillusepos <GID>,<技能id>,<技能ç‰ç´š>,<x>,<y>{,<è© å”±æ™‚é–“>{,<是å¦å¯è¢«æ‰“æ–·>}}};
5957
5958這是用來代替舊命令的, GID和unit系列命令用的一樣。
5959
5960x,yæ˜¯åœ°åœ–åæ¨™ã€‚
5961è© å”±æ™‚é–“ç‚ºæ¯«ç§’ã€‚
5962
5963---------------------------------------
5964
5965*day;
5966*night;
5967
5968é€™å…©å¤©å‘½ä»¤å°‡å¯¦ç¾æœå‹™å™¨çš„æ™å¤œäº¤æ›¿ã€‚
5969è¨ç½®ä¸åŒæœƒæœ‰ä¸åŒçš„客戶端效果。如果æœå‹™å™¨è¨ç½®æˆäº†æ™å¤œäº¤æ›¿ï¼Œæœ€çµ‚會返回那個輪迴。
5970
5971這個例å講把早上3點è¨ç½®æˆæ™šä¸Šè€Œ8點天亮, 而如果自動黑夜白æ™åˆ‡æ›åœ¨è¨ç½®ä¸é—œé–‰ï¼Œ
5972æœå‹™å™¨åœ¨é»‘夜期間é‡å•Ÿï¼Œå‰‡é»‘夜效果將æŒçºŒã€‚自己ç†è§£å§ï¼š
5973
5974-%TAB%script%TAB%DayNight%TAB%-1,{
5975
5976 end;
5977
5978OnClock0300:
5979
5980OnClock0800:
5981
5982OnInit:
5983
5984 set $@minutesfrommidnight, gettime(3)*60+gettime(2);
5985
5986 set $@night_start, 180; // 03:00
5987 set $@night_end, 480; // 08:00
5988
5989 if ($@minutesfrommidnight>=$@night_start && $@minutesfrommidnight<$@night_end) goto StartNight;
5990
5991 goto StartDay;
5992 StartNight:
5993 night;
5994 end;
5995 StartDay:
5996 day;
5997 end; }
5998
5999---------------------------------------
6000
6001*defpattern <è¨ç½®ç·¨è™Ÿ>,"<常è¦è¡¨é”模æ¿>","<事件標籤>";
6002*activatepset <è¨ç½®ç·¨è™Ÿ>;
6003*deactivatepset <è¨ç½®ç·¨è™Ÿ>;
6004*deletepset <è¨ç½®ç·¨è™Ÿ>;
6005
6006這套命令僅在æœå‹™å™¨æ”¯æŒå¸¸è¦è¡¨é”庫時有效. ä¸å¹¸çš„æ˜¯, 默èªç·¨è¯æ˜¯ä¸æ”¯æŒçš„, 但這些
6007隨便使用困難, 但效果很奇特.
6008
6009NPC會監è½çŽ©å®¶çš„å…¬é–‹å°è©±, 如果符åˆå¸¸è¦è¡¨é”模æ¿, 就會觸發事件.
6010
6011æ¨¡æ¿æŒ‰è¨ç½®ç·¨è™Ÿåˆ†é¡ž. å¯ä»¥è¨ç½®ä¸¦æ¿€æ´»å¤šå€‹æ¨¡æ¿. 模æ¿ç·¨è™Ÿå¾ž1é–‹å§‹.
6012
6013'defpattern' 會關è¯è¡¨é”å¼å’Œäº‹ä»¶. å¦‚æžœæ¨¡æ¿æ¿€æ´»è€ŒåˆçŽ©å®¶èªªçš„è©±ç¬¦åˆæ¨¡æ¿å…§å®¹, 則事
6014件就會觸發.
6015
6016'activatepset' å¯ä»¥æ¿€æ´»æŒ‡å®šç·¨è™Ÿçš„æ¨¡æ¿. 激活的模æ¿å¯ä»¥é€šéŽ 'defpattern' 觸發事
6017ä»¶, 模æ¿é»˜èªä¸æ¿€æ´».
6018'deactivatepset' å¯ä»¥å–消激活指定編號的模æ¿. 如果指定模æ¿ç·¨è™Ÿç‚º -1,則所有模æ¿
6019éƒ½å–æ¶ˆæ¿€æ´».
6020
6021'deletepset' 會從內å˜ä¸åˆªé™¤æŒ‡å®šç·¨è™Ÿçš„æ¨¡æ¿, ä½ å¯ä»¥é‡æ–°è¨ç½®è©²ç·¨è™Ÿçš„æ¨¡æ¿.
6022
6023使用常è¦è¡¨é”弿œƒæœ‰å¾ˆä¸å¯æ€è°çš„æ•ˆæžœ. 而這ä¸å¯æ€è°çš„æ•ˆæžœåŒæ¨£ä¼´éš¨è‘—å…¶ç¨ç‰¹çš„æ–‡æœ¬
6024控制能力. è¦æ›´å¤šå¸¸è¦è¡¨é”å¼çš„解釋, è«‹åƒé–±:
6025
6026http://www.regular-expressions.info/
6027http://www.weitz.de/regex-coach/
6028
6029使用舉例, 見 'npc\sample\npc_pcre.txt'.
6030
6031通éŽé€™äº›ä½ å¯ä»¥å°ç•¶çœ¾ä¹žè¨Žçš„玩家進行懲罰,或者åéŽä¾†,ä½ ä¹Ÿå¯ä»¥ç›´æŽ¥çµ¦ä»–錢.
6032
6033---------------------------------------
6034
6035*pow(<數å—>,<冪>)
6036
6037è¿”å›žè¨ˆç®—çµæžœ
6038
6039舉例:
6040set @i, pow(2,3); // @i 是 8
6041
6042---------------------------------------
6043
6044*sqrt(<數å—>)
6045
6046返回開方值
6047
6048舉例:
6049set @i, sqrt(25); // @i 是 5
6050
6051---------------------------------------
6052
6053*distance(<x0>,<y0>,<x1>,<y1>)
6054
6055返回兩點間的è·é›¢
6056
6057舉例:
6058set @i, distance(100,200,101,202);
6059
6060---------------------------------------
6061
6062*md5("<string>")
6063
6064Returns the md5 checksum of a number or string.
6065
6066Example:
6067 mes md5(12345);
6068 mes md5("12345"); // Will both display 827ccb0eea8a706c4c34a16891f84e7b
6069 mes md5("qwerty"); // Will display d8578edf8458ce06fbc5bb76a58c5ca4
6070
6071---------------------------------------
6072
6073*query_sql "MySQL語å¥", <數列å>{,<數列å>{;
6074
6075最大返回 127 個值至數列.
6076
6077舉例:
6078set @nb, query_sql("select name,fame from `char` ORDER BY fame DESC LIMIT 5", @name$, @fame);
6079mes "åè½å¤§å»³: å‰äº”";
6080mes "1."+@name$[0]+"("+@fame[0]+")"; // 返回åè½æœ€å¤§å€¼çš„人
6081mes "2."+@name$[1]+"("+@fame[1]+")";
6082mes "3."+@name$[2]+"("+@fame[2]+")";
6083mes "4."+@name$[3]+"("+@fame[3]+")";
6084mes "5."+@name$[4]+"("+@fame[4]+")";
6085
6086注æ„: TXT版本無效,並將返回-1.
6087注æ„: 使用 $ 作為å‰ç¶´ä¾†ç²å¾—å—符數據.
6088
6089---------------------------------------
6090
6091*escape_sql("<string>")
6092
6093Escapes special characters in the string, so that it is safe to use in query_sql(),
6094and returns the escaped form of the given string.
6095
6096Example 1:
6097 set .@str$, "John's Laptop";
6098 set .@esc_str$, escape_sql(.@name$); // Escaped string: John\'s Laptop
6099
6100---------------------------------------
6101
6102*setiteminfo(<item id>,<type>,<value>)
6103
6104This function will set some value of an item.
6105Returns the new value on success, or -1 on fail (item_id not found or invalid type).
6106
6107Valid types are:
6108 0 - Buy Price; 1 - Sell Price; 2 - Item Type;
6109 3 - maxchance (Max drop chance of this item e.g. 1 = 0.01% , etc..
6110 if = 0, then monsters don't drop it at all (rare or a quest item)
6111 if = 10000, then this item is sold in NPC shops only
6112 4 - sex; 5 - equip; 6 - weight; 7 - atk; 8 - def; 9 - range;
6113 10 - slot; 11 - look; 12 - elv; 13 - wlv; 14 - view id
6114
6115Example:
6116
6117setiteminfo 7049,6,999; // Stone now weighs 999
6118
6119---------------------------------------
6120
6121*setitemscript(<é“å…·ID>,<"{ æ–°é“具腳本 }">{,<類型>});
6122
6123為é“å…·è¨ç½®æ–°çš„腳力語å¥. å°éŠæˆ²æ´»å‹•很有用.
6124å¯ä»¥é€šéŽç•™ç©ºä¾†å޻除é“具效果.
6125Type can optionally be used indicates which script to set (default is 0):
6126 0 - Script
6127 1 - OnEquip_Script
6128 2 - OnUnequip_Script
6129
6130舉例:
6131
6132setitemscript 2637,"{ if(isequipped(2236)==0)end; if(getskilllv(26)){skill 40,1;}else{skill 26,1+isequipped(2636);} }";
6133setitemscript 2637,"";
6134
6135---------------------------------------
6136
6137*runitemscript(<é“å…·ID>{,<類型>});
6138*runitemscript("<é“å…·å>"{,<類型>});
6139
6140執行é“å…·çš„è…³æœ¬ï¼Œè€Œä¸æ¶ˆè€—/è£å‚™é“具。
6141
6142Type can optionally be used indicates which script to set (default is 0):
6143 0 - Script
6144 1 - OnEquip_Script
6145 2 - OnUnequip_Script
6146
6147---------------------------------------
6148
6149*atoi ("<å—符串>")
6150*axtoi ("<å—符串>")
6151
6152æ¤é¡žå‘½ä»¤ç”¨ä¾†è½‰æ›å—符串為數å—
6153atoi 轉æ›å進制數å—而 axtoi 轉æ›åå…進制.
6154
6155舉例:
6156
6157 mes atoi("11"); // 將顯示 11
6158 set @var, axtoi("FF"); // 將把 @var è¨ç½®ç‚º 255
6159 mes axtoi("11"); // 將顯示 17 (1 = 1, 10 = 16,
6160 // åå…進制: {0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F})
6161
6162---------------------------------------
6163
6164*compare (<å—符串>,<åå—符串>)
6165
6166如果åå—符串包å«åœ¨å—符串ä¸,該函數返回1,å¦å‰‡è¿”回0.
6167該命令ä¸å€åˆ†å¤§å°å¯«.
6168
6169舉例:
6170
6171//dothis; will be executed ('Bloody Murderer' contains 'Blood').
6172 if (compare("Bloody Murderer","Blood"))
6173 dothis;
6174//dothat; will not be executed ('Blood butterfly' does not contain 'Bloody').
6175 if (compare("Blood Butterfly","Bloody"))
6176 dothat;
6177
6178---------------------------------------
6179
6180*charisalpha("<å—符串>",<ä½ç½®>)
6181
6182如果å—符串的指定ä½ç½®æ˜¯å—æ¯, 該函數會返回 1 , å¦‚æžœæ˜¯æ•¸å—æˆ–ç©ºæ ¼æœƒè¿”å›ž0.
6183
6184---------------------------------------
6185
6186*charat("<å—符串>",<ä½ç½®>)
6187
6188返回å—符串ä¸ç‰¹å®šä½ç½®çš„å—符. 如果ä½ç½®è¶…出範åœï¼Œå‰‡è¿”回空å—符串.
6189
6190例如:
6191
6192 charat("This is a string", 10); //返回 "s"
6193
6194---------------------------------------
6195
6196*setchar("<å—符串>","<å—æ¯>",<ä½ç½®>)
6197
6198å°å·²æœ‰å—ç¬¦ä¸²ä¸æŸä½ç½®è¨ç½®å—æ¯ã€‚如果ä½ç½®è¶…出範åœï¼Œå‰‡è¿”回原å—符串。
6199å¦‚æžœå—æ¯ä¸åªæœ‰ä¸€å€‹å—ç¬¦ï¼Œåªæœ‰ç¬¬ä¸€å€‹å—æ¯æœƒè¢«ä½¿ç”¨ã€‚
6200
6201例如:
6202
6203 setchar("Cat", "B", 0); //returns "Bat"
6204
6205---------------------------------------
6206
6207*insertchar("<å—符串>","<å—æ¯>",<ä½ç½®>)
6208
6209å°å·²æœ‰å—ç¬¦ä¸²ä¸æŸä½ç½®æ’入嗿¯ã€‚如果ä½ç½®è¶…出範åœï¼Œå‰‡è¿”回原å—符串。
6210å¦‚æžœå—æ¯ä¸åªæœ‰ä¸€å€‹å—ç¬¦ï¼Œåªæœ‰ç¬¬ä¸€å€‹å—æ¯æœƒè¢«ä½¿ç”¨ã€‚
6211
6212例如:
6213
6214 insertchar("laughter", "s", 0); //returns "slaughter"
6215
6216---------------------------------------
6217
6218*delchar("<å—符串>",<ä½ç½®>)
6219
6220刪除å—符串ä¸ç‰¹å®šä½ç½®çš„å—符. 如果ä½ç½®è¶…出範åœï¼Œå‰‡è¿”回原å—符串.
6221
6222例如:
6223
6224 delchar("Diet", 3); //returns "Die"
6225
6226---------------------------------------
6227
6228*strtoupper("<å—符串>")
6229*strtolower("<å—符串>")
6230
6231返回å—符串的大寫/å°å¯«å½¢å¼ï¼Œæ‰€æœ‰éžå—æ¯å°‡è¢«ä¿ç•™
6232
6233例如:
6234
6235 strtoupper("The duck is blue!!"); //returns "THE DUCK IS BLUE!!"
6236
6237---------------------------------------
6238
6239*charisupper("<å—符串>",<ä½ç½®>)
6240*charislower("<å—符串>",<ä½ç½®>)
6241
6242如果å—符串是大寫/å°å¯«å‰‡è¿”回1,å¦å‰‡0ï¼›éžå—æ¯è¿”回0ï¼›
6243
6244例如:
6245
6246 charisupper("SeAr", 1); //returns 0
6247
6248---------------------------------------
6249
6250*substr("<å—符串>",<èµ·å§‹ä½ç½®>,<çµæŸä½ç½®>)
6251
6252返回å—符串指定ä½ç½®ä¹‹é–“çš„åå—符串. 如果ä½ç½®è¶…éŽç¯„åœæˆ–,起始ä½ç½®å¤§æ–¼çµæŸä½ç½®å‰‡è¿”回空å—符串.
6253
6254例如:
6255
6256 substr("foobar", 3, 5); //returns "bar"
6257
6258---------------------------------------
6259
6260*explode(<目標數組>,"<å—符串>","<標示符>")
6261
6262基於標示符把å—符串分解為åå—符串。åå—符串將儲å˜åœ¨æŒ‡å®šæ•¸çµ„裡。
6263如果標示符有多個å—ç¬¦ï¼Œå‰‡åªæœ‰ç¬¬ä¸€å€‹è¢«ä½¿ç”¨ã€‚
6264如果沒有標示符,å—符串將按原樣放進數組。
6265
6266Example:
6267
6268 explode(.@my_array$, "Explode:Test:1965:red:PIE", ":");
6269 //.@my_array$ contents will be...
6270 //.@my_array$[0]: "Explode"
6271 //.@my_array$[1]: "Test"
6272 //.@my_array$[2]: "1965"
6273 //.@my_array$[3]: "red"
6274 //.@my_array$[4]: "PIE"
6275
6276---------------------------------------
6277
6278*implode("å—符串"{,<粘åˆç¬¦>})
6279
6280把åå—ç¬¦ä¸²ç²˜åˆæˆä¸€å€‹å—符串。
6281如果指定粘åˆç¬¦ï¼Œé‚£éº¼ç²˜åˆç¬¦å°‡å˜åœ¨æ–¼æ¯å€‹åå—符串之間。
6282
6283Example:
6284 setarray .@my_array$[0], "This", "is", "a", "test";
6285 implode(.@my_array$, " "); //returns "This is a test"
6286
6287---------------------------------------
6288
6289*sprintf(<æ ¼å¼>[,åƒæ•¸[,åƒæ•¸[,...]]]) [Mirei]
6290
6291C style sprintf.
6292The resulting string is returned same as in PHP.
6293除了 %n 以外的C符號都支æŒ.
6294More info: sprintf @ www.cplusplus.com.
6295åƒæ•¸æ•¸é‡å—陿–¼è…³æœ¬å¼•擎
6296
6297Example:
6298 .@format$ = 'The %s contains %d monkeys';
6299 dispbottom(sprintf(.@format$, "zoo", 5)); //prints "The zoo contains 5 monkeys"
6300 dispbottom(sprintf(.@format$, "barrel", 82)); //prints "The barrel contains 82 monkeys"
6301
6302---------------------------------------
6303
6304*sscanf(<string>,<format>[,param[,param[,...]]]) [Mirei]
6305
6306C style sscanf.
6307所有Cæ ¼å¼çš„æŒ‡ç¤ºç¬¦éƒ½æ”¯æŒ.
6308More info: sscanf @ www.cplusplus.com.
6309åƒæ•¸æ•¸é‡å—陿–¼è…³æœ¬å¼•擎
6310
6311Example:
6312 sscanf("This is a test: 42 foobar", "This is a test: %d %s", .@num, .@str$);
6313 dispbottom(.@num + " " + .@str$); //prints "42 foobar"
6314
6315---------------------------------------
6316
6317*strpos("<å—符串>", "<åå—符串>"{,<åºè™Ÿ>})
6318
6319PHP style strpos.
6320在å—ç¬¦ä¸²ä¸æœç´¢åå—符串,並返回其起始ä½ç½®.
6321åºè™Ÿæ¨™ç¤ºè¦è¿”回第幾個找到的目標。
6322如果沒有找到則返回-1.
6323å€åˆ†å¤§å°å¯«
6324
6325Example:
6326 strpos("foobar", "bar", 0); //returns 3
6327 strpos("foobarfoo", "foo", 0); //returns 0
6328 strpos("foobarfoo", "foo", 1); //returns 6
6329
6330---------------------------------------
6331
6332*replacestr("<å—符串>", "<åå—符串1>", "<åå—符串2>"{, <大å°å¯«>{, <數é‡>}})
6333
6334在å—ç¬¦ä¸²ä¸æœç´¢åå—符串1並替æ›ç‚ºå—符串2.
6335除éžå¤§å°å¯«è¨å®šç‚º0,å¦å‰‡é»˜èªå€åˆ†å¤§å°å¯«ã€‚
6336é™¤éžæŒ‡å®šæ•¸é‡æ™‚æŒ‰é †åºæ›¿æ›æŒ‡å®šå€‹æ•¸ï¼Œå¦å‰‡å°‡å…¨éƒ¨æ›¿æ›åå—符串1。
6337返回替æ›çµæžœã€‚
6338
6339Example:
6340 replacestr("testing tester", "test", "dash"); //returns "dashing dasher"
6341 replacestr("Donkey", "don", "mon", 0); //returns "monkey"
6342 replacestr("test test test test test", "yay", 0, 3); //returns "yay yay yay test test"
6343
6344---------------------------------------
6345
6346*countstr("<å—符串>", "<åå—符串>"{, <大å°å¯«>})
6347
6348計算å—符串ä¸åŒ…å«çš„åå—符串. 除éžå¤§å°å¯«è¨å®šç‚º0,å¦å‰‡é»˜èªå€åˆ†å¤§å°å¯«ã€‚
6349
6350Example:
6351 countstr("test test test Test", "test"); //returns 3
6352 countstr("cake Cake", "Cake", 0); //returns 2
6353
6354---------------------------------------
6355
6356*wedding_effect;
6357çµå©šæˆåŠŸæ˜¯æ’æ”¾çµå©šæ•ˆæžœ (音樂ç‰)
6358çµå©šè…³æœ¬ä¸æœ‰å¯¦ä¾‹.
6359
6360---------------------------------------
6361
6362*setfont <å—é«”>
6363This command sets the current RO client interface font to one of the
6364fonts stored in data\*.eot by using an ID of the font. When the ID
6365of the currently used font is used, default interface font is used again.
6366 0 - Default
6367 1 - RixLoveangel
6368 2 - RixSquirrel
6369 3 - NHCgogo
6370 4 - RixDiary
6371 5 - RixMiniHeart
6372 6 - RixFreshman
6373 7 - RixKid
6374 8 - RixMagic
6375 9 - RixJJangu
6376
6377--------------------------------------
6378
6379* 寵物AI命令
6380
6381這些命令僅在關è¯äººç‰©æœ‰å¯µç‰©çš„æƒ…æ³ä¸‹æ‰èƒ½å·¥ä½œï¼Œä¸¦ä¸”ç†è«–ä¸Šåªæœ‰åœ¨å¯µç‰©è…³æœ¬è£¡æ‰æœ‰æ•ˆã€‚
6382這些命令會改變關è¯äººç‰©çš„寵物AIï¼Œè€Œä»–å€‘è‡ªå·±æ˜¯ä¸æœƒç¨ç«‹å·¥ä½œçš„ï¼Œé€™ä¹Ÿæ˜¯ç‚ºä»€éº¼åªæœ‰
6383一æ¢å‘½ä»¤æœ‰æ•ˆã€‚一個寵物å¯ä»¥åŒæ™‚有'petloot', 'petskillbonus', 'petskillattack' 或
6384'petpetskillattack2' å’Œ 'petskillsupport' 或 'petheal'。 'petheal' 在默èªå¯µç‰©è…³
6385本裡ä¸å†ä½¿ç”¨ã€‚
6386
6387*petskillbonus <çŽå‹µé¡žåž‹>,<值>,<æŒçºŒæ™‚é–“>,<延時>;
6388
6389讓寵物給主人屬性點çŽå‹µ (çŽå‹µé¡žåž‹ - bInt,bVit,bDex,bAgi,bLuk,bStr,bSpeedRate -
6390詳見'db/const.txt'çš„bé–‹é 部分)
6391
6392*petrecovery <屬性類型>,<延時>;
6393
6394è®“å¯µç‰©æ²»ç™’æŒ‡å®šçš„ç‹€æ…‹ã€‚æ²»ç™’æ•ˆæžœæœƒåœ¨æ¯æ¬¡å»¶æ™‚的間隔時間內發生。
6395詳見'db/const.txt'çš„SC_é–‹é 部分
6396
6397*petloot <最大數é‡>;
6398
6399該命令會開啟寵物的拾å–功能。
6400寵物會在最大數é‡åˆ°é”的時候或在表ç¾ç‹€æ…‹çš„æ™‚候把儲å˜çš„ç‰©å“æ”¾å‡ºã€‚
6401
6402*petskillsupport <技能id>,<技能ç‰ç´š>,<延時>,<hp百分比>,<sp百分比>;
6403*petskillsupport "<技能å>",<技能ç‰ç´š>,<延時>,<hp百分比>,<sp百分比>;
6404
6405è©²å‘½åæœƒä½¿å¯µç‰©åœ¨ä¸»äººçš„hp或spåœ¨æŒ‡å®šçš„ç™¾åˆ†æ¯”ä»¥ä¸‹æ™‚ï¼Œæ ¹æ“šæŒ‡å®šå»¶æ™‚ï¼Œå°ä¸»äººä½¿ç”¨æ”¯æŒæŠ€èƒ½ã€‚
6406技能id見'db/skill_db.txt'.
6407
6408*petskillattack <技能id>,<技能ç‰ç´š>,<幾率>,<çŽå‹µå¹¾çއ>;
6409*petskillattack "<技能å>",<技能ç‰ç´š>,<幾率>,<çŽå‹µå¹¾çއ>;
6410*petskillattack2 <技能id>,<傷害>,<攻擊次數>,<幾率>,<çŽå‹µå¹¾çއ>;
6411*petskillattack2 "<技能å>",<傷害>,<攻擊次數>,<幾率>,<çŽå‹µå¹¾çއ>;
6412
6413這兩æ¢å‘½ä»¤æœƒè®“寵物å°ä¸»äººç•¶å‰æ”»æ“Šçš„æ•µäººè© 唱攻擊技能。技能idå’Œç‰ç´šèˆ‡'petskillsupport'
6414相åŒã€‚'petskillattack2'會讓寵物使用的技能使用修æ£çš„傷害值和指定的攻擊次數。
6415
6416幾率是發動效果的百分率。 'bonusrate'是當寵物親密度é”到最大值時,在普通幾率上增長的
6417幾率。
6418
6419ä¸Šè¿°æ•ˆæžœåªæœ‰åœ¨å¯µç‰©è¶³å¤ 親密,並且在'battle_athena.conf'ä¸é€²è¡Œäº†æ£ç¢ºè¨ç½®å¾Œæ‰æœ‰æ•ˆã€‚
6420
6421寵物腳本在寵物åµåŒ–的時候就會é‹è¡Œã€‚itemè…³æœ¬è£¡çš„å‘½ä»¤åœ¨æ¤æ™‚也能é‹è¡Œã€‚顯然,寵物命令在
6422npcè…³æœ¬è£¡ä¹Ÿæœ‰æ•ˆï¼Œç›´åˆ°å¯µç‰©è¢«å†æ¬¡åµåŒ–(人物上下線後也會失效)。NPC腳本生效的寵物AIçš„
6423æŒçºŒæ™‚é–“å°šä¸æ¸…楚,但至少,這å¯ä»¥ç”¨ä¾†è£½ä½œç‚ºå°å¯µç‰©é€²è¡ŒBUFFçš„é“具。
6424
6425--------------------------------------
6426
6427*bpet;
6428
6429在當å‰äººç‰©çš„客戶端內打開寵物åµåŒ–窗å£ã€‚
6430å¯ä»¥åœ¨é“具腳本外使用。
6431
6432---------------------------------------
6433
6434*makepet <pet id>;
6435
6436æ¤å‘½ä»¤æœƒå‰µå»ºä¸€å€‹å¯µç‰©è›‹æ”¾åœ¨é—œè¯äººç‰©çš„é“具欄內。寵物類型由'db/pet_db.txt'內的寵物
6437ID決定。創建寵物蛋和玩家æˆåŠŸæ•æ‰é”物的方å¼ä¸€æ¨¡ä¸€æ¨£ã€‚
6438
6439 // çµ¦ä½ ä¸€å€‹æ³¢åˆ©:
6440 makepet 1002;
6441
6442注æ„ä½ ä¸éœ€ç”¨æ¤æ–¹æ³•å‰µå»ºå¯µç‰©è›‹ã€‚å¦‚æžœä½ ç”¨getitemä¾†å‰µå»ºå¯µç‰©è›‹ï¼Œé‚£éº¼å¯µç‰©è›‹æ•¸æ“šä¸æœƒå‚³
6443éžçµ¦äººç‰©æœå‹™å™¨ï¼Œè€ŒçŽ©å®¶åœ¨åµåŒ–寵物的時候,蛋就會直接消失。(Inkfish: 貌似ç¾åœ¨ä¸æœƒæ¶ˆå¤±)
6444
6445---------------------------------------
6446
6447*openmail;
6448
6449打開關è¯äººç‰©çš„郵箱窗å£ã€‚
6450
6451 mes "關閉æ¤çª—å£ä¾†æ‰“開郵箱窗å£ã€‚";
6452 close2;
6453 openmail;
6454 end;
6455
6456---------------------------------------
6457
6458*homshuffle;
6459
6460按照生命體當å‰ç‰ç´šé‡æ–°è¨ˆç®—ç•¶å‰é—œè¯äººç‰©çš„生命體屬性。
6461
6462---------------------------------------
6463
6464*hommutate <id>;
6465
6466ç”Ÿå‘½é«”è®Šç•°ã€‚ä¿æŒå±¬æ€§å’ŒæŠ€èƒ½ã€‚åªæœ‰åœ¨ä½¿ç”¨éŽmorphembryo後æ‰èƒ½ä½¿ç”¨ï¼Œä¸¦å°‡åˆªé™¤6415é“具。
6467
6468---------------------------------------
6469
6470*morphembryo;
6471
6472This command will try to put the invoking player's Homunculus in an
6473uncallable state, required for mutation into a Homunculus S. The player
6474will also receive a Strange Embryo (ID 6415) in their inventory if
6475successful, which is deleted upon mutation.
6476
6477The command will fail if the invoking player does not have an evolved
6478Homunculus at level 99 or above. The /swt emotion is shown upon failure.
6479
6480Returns 1 upon success and 0 for all failures.
6481
6482---------------------------------------
6483
6484*checkhomcall()
6485
6486This function checks if the attached player's Homunculus is active,
6487and will return the following values:
6488 -1: The player has no Homunculus.
6489 0: The player's Homunculus is active.
6490 1: The player's Homunculus is vaporized.
6491 2: The player's Homunculus is in morph state.
6492
6493---------------------------------------
6494
6495*setcell "<地圖å>",<x1>,<y1>,<x2>,<y2>,<類型>,<標記>;
6496
6497æ¯å€‹åœ°åœ–çš„å–®å…ƒæ ¼éƒ½æœ‰å¾ˆå¤šæŒ‡å®šå…¶å–®å…ƒæ ¼å±¬æ€§çš„ã€Œæ¨™è¨˜ã€ã€‚
6498包括地形屬性 (能å¦è¡Œèµ°, èƒ½å¦æ”»æ“Š, 是å¦å˜åœ¨æ°´),
6499技能 (ç¥žè–æ®¿å ‚, åœ°å±¬æ€§é ˜åŸŸ, ...) 和其他 (npc附近, ç¦æ¢äº¤æ˜“, ...).
6500æ¯ç¨®é¡žåž‹éƒ½èƒ½æ‰“é–‹æˆ–é—œé–‰ã€‚ä»–å€‘å…±åŒæ±ºå®šäº†æ¤å–®å…ƒæ ¼çš„表ç¾ã€‚
6501
6502è©²å‘½ä»¤èƒ½è®“ä½ è½‰æ›æŒ‡å®šå標範åœå…§(x1,y1)-(x2,y2)çš„æ‰€æœ‰åœ°åœ–å–®å…ƒæ ¼çš„æ¨™è¨˜ç‹€æ…‹ã€‚
6503標記å¯ä»¥æ˜¯0或1 (0:清除標記, 1:è¨ç½®æ¨™è¨˜).
6504é¡žåž‹å®šç¾©äº†è¦æ¨™è¨˜çš„內容。有效類型包括:cell_walkable,
6505cell_shootable, cell_basilica. 詳見const.txt.
6506
6507舉例:
6508
6509 setcell "arena",0,0,300,300,cell_basilica,1;
6510 setcell "arena",140,140,160,160,cell_basilica,0;
6511 setcell "arena",135,135,165,165,cell_walkable,0;
6512 setcell "arena",140,140,160,160,cell_walkable,1;
6513
6514這會在地圖ä¸å¤®å‰µå»ºä¸€å€‹åœ“。圓外有一個5æ ¼å¯¬çš„åœ“ç’°ï¼Œé˜²æ¢èˆ‡å¤–界交æµã€‚地圖的其餘
6515éƒ¨åˆ†è¢«æ¨™è¨˜ç‚ºã€Œç¥žè–æ®¿å ‚ã€ï¼Œç¦æ¢ä»»ä½•äººçš„æ”»æ“Šã€‚å®¢æˆ¶ç«¯ä¸æœƒé¡¯ç¤ºåœ“環為牆,但å»ä¸èƒ½ç§»å‹•
6516
6517å†èˆ‰ä¾‹:
6518
6519OnBarricadeDeploy:
6520 setcell "schg_cas05",114,51,125,51,cell_walkable,0;
6521 end;
6522OnBarricadeBreak:
6523 setcell "schg_cas05",114,51,125,51,cell_walkable,1;
6524 end;
6525
6526這是WoE:SE的一部分腳本, 攻擊者在路障被清除å‰ç„¡æ³•繼續å‰é€²ã€‚這æ¢å‘½ä»¤æœƒå‰µå»ºä¸€æ¢ä¸
6527èƒ½è¡Œèµ°çš„å–®å…ƒæ ¼ï¼Œä¸¦åœ¨è·¯éšœè¢«æ¸…é™¤å¾Œå–æ¶ˆã€‚
6528
6529---------------------------------------
6530
6531*checkcell ("<地圖å>",<x>,<y>,<類型>);
6532
6533該命令會返回 1 或 0, å–æ±ºæ–¼æŒ‡å®šå–®å…ƒæ ¼æ˜¯å¦è¨ç½®äº†æŒ‡å®šã€Œé¡žåž‹ã€ã€‚有很多類型å¯ä»¥
6534檢測, 所有類型åƒè¦‹db/const.txt。
6535
6536有些類型容易混淆, 下é¢ä½œä¸€ä¸‹è§£é‡‹:
6537 - cell_chkwall/water/cliff
6538 é€™äº›ç›´æŽ¥å°æŒ‡å®šå–®å…ƒæ ¼çš„「地形ã€ä½œæª¢æŸ¥
6539 - cell_chkpass/reach/nopass/noreach
6540 passable = 䏿˜¯ç‰†ä¹Ÿä¸æ˜¯æ–·é è·¯, reachable = å¯é€šéŽä½†ä¸èƒ½é‡ç–Š
6541 - cell_chknpc/basilica/landprotector/novending/nochat
6542 他們的åå—å°±ä¼¼ä¹Žä»–å€‘çš„æ„æ€ï¼ˆnpcã€ç¥žè–æ®¿å ‚ã€åœ°å±¬æ€§é ˜åŸŸã€ä¸èƒ½é–‹å•†åº—ã€ä¸èƒ½é–‹èŠå¤©å®¤ï¼‰
6543
6544舉例:
6545
6546 mes "挑一個目標地圖";
6547 input .@map$;
6548 mes "好,å†çµ¦æˆ‘忍™";
6549 input .@x;
6550 input .@y;
6551 if( !checkcell(.@map$,.@x,.@y,cell_chkpass) )
6552 {
6553 mes "抱æ‰ï¼Œä¸èƒ½æŠŠä½ 傳é€éŽåŽ»!";
6554 close;
6555 }
6556 else
6557 {
6558 mes "好å§ï¼Œæº–備好了...";
6559 close2;
6560 warp .@map$, .@x, .@y;
6561 end;
6562 }
6563
6564---------------------------------------
6565*setwall "<地圖å>",<x>,<y>,<大å°>,<æ–¹å‘>,<å¯é 程攻擊>,"<å稱>";
6566*delwall "<å稱>";
6567
6568å‰µå»ºä¸€å€‹ç„¡å½¢çš„ç‰†ï¼Œå¾žæŒ‡å®šåæ¨™ã€åœ¨æŒ‡å®šæ–¹å‘建立一排指定大å°çš„單元。與setcellçš„ä¸
6569åŒé»žåœ¨æ–¼ï¼Œæ¤å‘½ä»¤åŒæ™‚更新客戶端部分,以防出錯。
6570
6571---------------------------------------
6572
6573*progressbar "<é¡è‰²>",<時間>;
6574
6575時間為秒,é¡è‰²æš«ç„¡æ„義。
6576
6577在人物é 上顯示進度æ¢ã€‚
6578
6579例如:
6580 progressbar 0x000000,10;
6581 mes "ä½ å¥½";
6582 close;
6583客戶端將顯示一個10秒的進度æ¢ï¼Œç„¶å¾Œé¡¯ç¤ºã€Œä½ 好ã€ã€‚
6584進度æ¢é€²è¡Œä¸æ™‚ï¼Œç„¡æ³•ä½¿ç”¨æŠ€èƒ½ï¼›ç§»å‹•å°‡å–æ¶ˆé€²åº¦æ¢ï¼Œçµ‚çµè…³æœ¬ã€‚
6585
6586---------------------------------------
6587
6588*questnotify <類型1>, <類型2>;
6589*showevent <類型1>, <類型2>;
6590
6591顯示NPC忍™åœ¨å°åœ°åœ–ä¸ï¼Œä¸¦åœ¨NPCé 上顯示表情。
6592
6593類型1: (請使用常é‡ï¼Œæºç¢¼å…§ç½®è½‰æ›å…¼å®¹120410å‰å¾Œå®¢æˆ¶ç«¯)
6594 QTYPE_NONE å–æ¶ˆè¡¨æƒ…和標記
6595 QTYPE_QUEST 感æŽè™Ÿä»»å‹™(quest)表情
6596 QTYPE_QUEST2 å•號任務(quest)表情
6597 QTYPE_JOB 感æŽè™Ÿè·æ¥ä»»å‹™(job)表情
6598 QTYPE_JOB2 å•è™Ÿè·æ¥ä»»å‹™(job)表情
6599 QTYPE_EVENT 感æŽè™Ÿæ´»å‹•(event)表情
6600 QTYPE_EVENT2 å•號活動(event)表情
6601 QTYPE_WARG 狼
6602 QTYPE_WARG2 狼(20120410之後)
6603
6604類型2:
6605 0 = 無標記
6606 1 = 黃色標記
6607 2 = ç¶ è‰²æ¨™è¨˜
6608 3 = è—色標記
6609
6610----------------------------------------
6611
6612*questinfo <任務id>,<類型1>, <類型2>{,<è·æ¥id>};
6613
6614顯示NPC忍™åœ¨å°åœ°åœ–ä¸ï¼Œä¸¦åœ¨NPCé 上顯示表情。
6615
6616類型1: (請使用常é‡ï¼Œæºç¢¼å…§ç½®è½‰æ›å…¼å®¹120410å‰å¾Œå®¢æˆ¶ç«¯)
6617 QTYPE_NONE å–æ¶ˆè¡¨æƒ…和標記
6618 QTYPE_QUEST 感æŽè™Ÿä»»å‹™(quest)表情
6619 QTYPE_QUEST2 å•號任務(quest)表情
6620 QTYPE_JOB 感æŽè™Ÿè·æ¥ä»»å‹™(job)表情
6621 QTYPE_JOB2 å•è™Ÿè·æ¥ä»»å‹™(job)表情
6622 QTYPE_EVENT 感æŽè™Ÿæ´»å‹•(event)表情
6623 QTYPE_EVENT2 å•號活動(event)表情
6624 QTYPE_WARG 狼
6625 QTYPE_WARG2 狼(20120410之後)
6626
6627類型2:
6628 0 = 無標記
6629 1 = 黃色標記
6630 2 = ç¶ è‰²æ¨™è¨˜
6631 3 = è—色標記
6632
6633在OnInit標籤ä¸ä½¿ç”¨ã€‚ç•¶çŽ©å®¶åŠ è¼‰å®Œåœ°åœ–å¾Œï¼Œå¦‚æžœNPCé‹è¡ŒéŽquestinfoï¼Œå°±æœƒæª¢æŸ¥æ˜¯å¦æœ‰
6634該任務,如果沒有,則會在NPCé ä¸Šå‡ºç¾æ°£æ³¡æç¤ºã€‚
6635
6636也å¯ä»¥æŒ‡å®šè·æ¥IDä¾†æª¢æ¸¬æ˜¯å¦æœ‰ç‰¹å®šè·æ¥çš„任務å˜åœ¨ã€‚
6637
6638舉例:
6639izlude,100,100,4 script Test 844,{
6640 mes "[Test]";
6641 mes "Hello World.";
6642 close;
6643
6644
6645 OnInit:
6646 questinfo 1001, QTYPE_QUEST, 0, Job_Novice;
6647 end;
6648}
6649
6650----------------------------------------
6651
6652
6653========================
6654|7.- 副本系統指令.|
6655========================
6656---------------------------------------
6657
6658*instance_create("<副本å>");
6659
6660為關è¯çŽ©å®¶çš„éšŠä¼å‰µå»ºå‰¯æœ¬. 副本å,和其他相關副本數據,都是從 'db/instance_db.txt'
6661讀å–。如果æˆåŠŸï¼Œæœƒè¿”å›žä¸€å€‹å”¯ä¸€çš„å‰¯æœ¬ID,並複製所有地圖和NPC,è¨ç½®æœ‰æ•ˆæ™‚間,並觸發
6662å‰¯æœ¬ä¸æ‰€æœ‰NPC裡的"OnInstanceInit" 標籤下的腳本。
6663
6664如果æˆåŠŸè¿”å›žå‰¯æœ¬ID, 如果失敗則返回:
6665 -1: 無效類型.
6666 -2: 未找到組隊.
6667 -3: 副本已å˜åœ¨.
6668 -4: 沒有空餘的副本.
6669
6670---------------------------------------
6671
6672*instance_destroy {<副本ID>};
6673
6674銷毀指定ID的副本. 如果沒有指定ID則銷毀關è¯è…³æœ¬çš„副本。如果腳本沒有關è¯å‰¯æœ¬ï¼Œè…³æœ¬
6675é—œè¯çŽ©å®¶çš„é—œè¯å‰¯æœ¬è¢«éŠ·æ¯€ï¼Œå¦‚æžœé€™ä¹Ÿå¤±æ•—ï¼Œè…³æœ¬çµ‚æ¢ã€‚
6676
6677---------------------------------------
6678
6679*instance_enter("<副本å>");
6680
6681è…³æœ¬çµæŸå¾Œå‚³é€é—œè¯çŽ©å®¶åˆ°å‰¯æœ¬ä¸.
6682åœ°åœ–å’Œåæ¨™åœ¨ 'db/instance_db.txt'ä¸å®šç¾©.
6683
6684æˆåŠŸè¿”å›ž0, 失敗返回:
6685 1: 未找到組隊.
6686 2: 組隊沒有副本.
6687 3: 其他錯誤 (無效副本å, 副本和組隊ä¸åŒ¹é…ç‰).
6688
6689---------------------------------------
6690
6691*instance_npcname("<NPCåå—>"{,<副本id>});
6692
6693返回副本化腳本的唯一npcå. 如果沒有指定ID則銷毀關è¯è…³æœ¬çš„副本。如果腳本沒有關è¯å‰¯æœ¬ï¼Œè…³æœ¬
6694é—œè¯çŽ©å®¶çš„é—œè¯å‰¯æœ¬è¢«éŠ·æ¯€ï¼Œå¦‚æžœé€™ä¹Ÿå¤±æ•—ï¼Œè…³æœ¬çµ‚æ¢ã€‚
6695
6696---------------------------------------
6697
6698*instance_mapname("<地圖å>"{,<副本id>});
6699
6700返回副本化腳本的唯一地圖å. 如果沒有指定ID則銷毀關è¯è…³æœ¬çš„副本。如果腳本沒有關è¯å‰¯æœ¬ï¼Œè…³æœ¬
6701é—œè¯çŽ©å®¶çš„é—œè¯å‰¯æœ¬è¢«éŠ·æ¯€ï¼Œå¦‚æžœé€™ä¹Ÿå¤±æ•—ï¼Œè¿”å›žç©ºå—符串。
6702
6703---------------------------------------
6704
6705*instance_id();
6706
6707返回腳本的副本id。如果腳本沒有關è¯å‰¯æœ¬ï¼Œè…³æœ¬
6708é—œè¯çŽ©å®¶çš„é—œè¯å‰¯æœ¬è¢«éŠ·æ¯€ï¼Œå¦‚æžœé€™ä¹Ÿå¤±æ•—ï¼Œè¿”å›ž0。
6709
6710---------------------------------------
6711
6712*instance_warpall "<地圖å>",<x>,<y>{,<副本id>};
6713
6714傳逿Œ‡å®šå‰¯æœ¬idä¸çš„玩家去指定地圖åçš„æŒ‡å®šåæ¨™ã€‚ 如果沒有指定ID則銷毀關è¯è…³æœ¬çš„副本。
6715如果腳本沒有關è¯å‰¯æœ¬ï¼Œè…³æœ¬é—œè¯çŽ©å®¶çš„é—œè¯å‰¯æœ¬è¢«éŠ·æ¯€ï¼Œå¦‚æžœé€™ä¹Ÿå¤±æ•—ï¼Œè…³æœ¬çµ‚æ¢ã€‚
6716
6717---------------------------------------
6718
6719*instance_check_party(<組隊id>{,<數é‡>{,<最å°>{,<最大>}}});
6720
6721該函數檢查組隊是å¦ç¬¦åˆç‰¹å®šæ¢ä»¶, 返回1如果所有æ¢ä»¶ç¬¦åˆï¼Œå¦å‰‡å‰‡è¿”回0ã€‚åªæœƒæª¢æŸ¥åœ¨ç·šçŽ©å®¶ã€‚
6722
6723æ•¸é‡ - åœ¨ç·šéšŠä¼æˆå“¡æ•¸é‡ (é»˜èª 1).
6724æœ€å° - 組隊æˆå“¡ä¸çš„æœ€å°ç‰ç´š (é»˜èª 1).
6725最大 - 組隊æˆå“¡ä¸çš„æœ€å¤§ç‰ç´š (默èªç‚º conf ä¸çš„æœ€å¤§ç‰ç´š).
6726
6727舉例:
6728
6729if (instance_check_party(getcharid(1),2,2,149)) {
6730 mes "Your party meets the Memorial Dungeon requirements.",
6731 mes "All online members are between levels 1-150 and at least two are online.";
6732 close;
6733} else {
6734 mes "Sorry, your party does not meet requirements.";
6735 close;
6736}
6737
6738---------------------------------------
6739
6740========================
6741|8.- Quest Log commands.|
6742========================
6743---------------------------------------
6744
6745*setquest <ID>;
6746
6747ç²å–任務DBä¸å°æ‡‰<ID>的任務到玩家任務記錄ä¸,狀態為激活.
6748
6749---------------------------------------
6750
6751*completequest <ID>;
6752
6753完æˆä»»å‹™DBä¸å°æ‡‰<ID>的任務,並玩家任務記錄ä¸åˆªé™¤.
6754
6755---------------------------------------
6756
6757*erasequest <ID>;
6758
6759刪除任務DBä¸å°æ‡‰<ID>的任務
6760
6761---------------------------------------
6762
6763*changequest <ID>,<ID2>;
6764
6765刪除任務DBä¸å°æ‡‰<ID>的任務
6766ç²å–任務DBä¸å°æ‡‰<ID2>的任務到玩家任務記錄ä¸,狀態為激活.
6767
6768---------------------------------------
6769
6770checkquest(<ID>{,PLAYTIME|HUNTING});
6771
6772æ²’æœ‰é™„åŠ åƒæ•¸æ™‚:
6773 -1 = 未ç²å¾—任務
6774 0 = 任務未激活
6775 1 = 任務激活
6776 2 = 任務完æˆ
6777
6778åƒæ•¸PLAYTIME:
6779 -1 = 未ç²å¾—任務
6780 0 = æ™‚é™æœªåˆ°
6781 1 = æ™‚é™æœªåˆ°ä¸”任務已經完æˆ
6782 2 = 時é™å·²åˆ°
6783
6784åƒæ•¸HUNTING:
6785 -1 = 未ç²å¾—任務
6786 0 = 未殺完é”物但時間未到
6787 1 = 未殺完é”物但時間已到
6788 2 = 殺完é”物
6789
6790---------------------------------------
6791
6792===========================
6793|9.- æˆ°å ´æŒ‡ä»¤.|
6794===========================
6795---------------------------------------
6796
6797*waitingroom2bg_single(<battle group>,"<mapname>",<x>,<y>,"<npc name>");
6798
6799Adds the first waiting player from the chat room of given NPC to an
6800existing battleground group and warps it to specified coordinates on
6801given map.
6802
6803---------------------------------------
6804
6805*waitingroom2bg("<mapname>",<x>,<y>,"<On Quit Event>","<On Death Event>"{,"<npc name>"});
6806
6807<Mapname> and X Y coordinates refer to where the "respawn" base is, where the player group will respawn when they die.
6808<On Quit Event> refers to an NPC label that attaches to the character and is run when they relog.
6809<On Death Event> refers to an NPC label that attaches to the character and is run when they die. Can be "" for empty.
6810
6811Unlike the prior command, the latter will attach a GROUP in a waiting room to the battleground, and
6812sets the array $@arenamembers[0] where 0 holds the IDs of the first group, and 1 holds the IDs of the second.
6813
6814If the option parameter is left out, the waiting room of the current NPC is used.
6815
6816Example:
6817 // Battle Group will be referred to as $@KvM01BG_id1, and when they die, respawn at bat_c01,52,129.
6818 set $@KvM01BG_id1, waitingroom2bg("bat_c01",52,129,"KvM01_BG::OnGuillaumeQuit","KvM01_BG::OnGuillaumeDie");
6819 end;
6820
6821----------------------------------------
6822
6823*bg_team_setxy <Battle Group ID>,<x>,<y>;
6824
6825Update the respawn point of the given battle group to x, y on the same map. The <Battle Group ID> can be retrieved using getcharid(4)
6826
6827Example:
6828 bg_team_setxy getcharid(4),56,212;
6829 mapannounce "bat_a01", "Group [1] has taken the work shop, and will now respawn there.",bc_map,"0xFFCE00";
6830 end;
6831
6832----------------------------------------
6833
6834*bg_warp <Battle Group>,"<Mapname>",<x>,<y>;
6835
6836Similar to warp command.
6837Place all members of <Battle Group> at <mapname> at x y.
6838
6839Example:
6840 //place the battle group one for Tierra Gorge at starting position.
6841 bg_warp $@TierraBG1_id1,"bat_a01",352,342;
6842 end;
6843
6844----------------------------------------
6845
6846*bg_monster <Battle Group>,"<map name>",<x>,<y>,"<name to show>",<mob id>,"<event label>";
6847*bg_monster(<Battle Group>,"<map name>",<x>,<y>,"<name to show>",<mob id>,"<event label>");
6848
6849Similar to monster script command.
6850Spawn a monster with allegiance to the given battle group.
6851Does not allow for the summoning of multiple monsters.
6852Monsters are similar to that in War of Emperium, in that the specified Battle group is considered friendly.
6853
6854Example:
6855 // It can be used in two different ways.
6856 bg_monster $@TierraBG1_id2,"bat_a01",167,50,"Food Depot",1910,"Feed Depot#1::OnMyMobDead";
6857 end;
6858
6859 // Alternatively, you can set an ID for the monster using "set".
6860 // This becomes useful when used with the command below.
6861 set $@Guardian_3, bg_monster($@TierraBG1_id2,"bat_a01",268,204,"Guardian",1949,"NPCNAME::OnMyMobDead");
6862 end;
6863
6864----------------------------------------
6865
6866*bg_monster_set_team <GID>,<Battle Group>;
6867
6868This command will change the allegiance if a monster in a battle ground.
6869GID can be set when spawning the monster via the bg_monster command.
6870
6871Example:
6872
6873 end;
6874
6875OnEnable:
6876 mapannounce "A guardian has been summoned for Battle Group 2!",bc_map,"0xFFCE00";
6877 set $@Guardian, bg_monster($@BG_2,"bat_a01",268,204,"Guardian",1949,"NPCNAME::OnMyMobDead");
6878 initnpctimer;
6879 end;
6880
6881OnTimer1000:
6882 stopnpctimer;
6883 mapannounce "Erm, sorry about that! This monster was meant for Battle Group 1.",bc_map,"0xFFCE00";
6884 bg_monster_set_team $@Guardian, $@BG_1;
6885 end;
6886
6887----------------------------------------
6888
6889*bg_leave;
6890
6891Removes attached player from their Battle Group.
6892
6893----------------------------------------
6894
6895*bg_destroy <Batte Group>;
6896
6897As the name says, destroys the battle group created for that battle ground.
6898
6899----------------------------------------
6900
6901*areapercentheal "<mapname>",<x1>,<y1>,<x2>,<y2>,<hp>,<sp>;
6902
6903Not exactly limited to battleground use, this will restore HP/SP in a defined area at a percentage.
6904
6905Example:
6906 areapercentheal "bat_a01",52,208,61,217,100,100;
6907 end;
6908
6909----------------------------------------
6910
6911*bg_get_data(<Battle Group>,<type>);
6912
6913Retrieves data related to given battle group. Type can be one of the following:
6914
6915 0 - Amount of players currently belonging to the group.
6916
6917----------------------------------------
6918
6919*bg_getareausers(<battle group>,<map name>,<x0>,<y0>,<x1>,<y1>);
6920
6921Retrieves amount of players belonging to given battle group on given
6922map within an specified rectangular area.
6923
6924----------------------------------------
6925
6926*bg_updatescore "<mapname>",<Guillaume Score>,<Croix Score>;
6927
6928Only usable when the map is defined as type:
6929mapflag <mapname> battleground 2
6930This command will force the update of the displayed scoreboard.
6931
6932----------------------------------------
6933
6934bg_kickall <battleground ID>;
6935
6936----------------------------------------
6937
6938getbgusers <battleground ID>;
6939
6940----------------------------------------
6941
6942setbgid <battleground ID> {, <player name> };
6943
6944----------------------------------------
6945
6946createbgid <battleground ID>, <respawn map>, <respawn x>, <respawn y>, <On Quit event>, <On Death event>;
6947
6948----------------------------------------
6949
6950==========================
6951|10.- Mercenary commands.|
6952==========================
6953---------------------------------------
6954
6955*mercenary_create <class>,<contract time>;
6956
6957This command summons a mercenary of given class, for given amount of
6958time in milliseconds. Typically used in item scripts of mercenary
6959scrolls.
6960
6961----------------------------------------
6962
6963*mercenary_heal <hp>,<sp>;
6964
6965This command works like 'heal', but affects the mercenary of the
6966currently attached character.
6967
6968----------------------------------------
6969
6970*mercenary_sc_start <type>,<tick>,<val1>;
6971
6972This command works like 'sc_start', but affects the mercenary of the
6973currently attached character.
6974
6975----------------------------------------
6976
6977*mercenary_get_calls(<guild>);
6978*mercenary_set_calls <guild>,<value>;
6979
6980Sets or gets the mercenary calls value for given guild for currently
6981attached character. Guild can be one or the following constants:
6982
6983 ARCH_MERC_GUILD
6984 SPEAR_MERC_GUILD
6985 SWORD_MERC_GUILD
6986
6987----------------------------------------
6988
6989*mercenary_get_faith(<guild>);
6990*mercenary_set_faith <guild>,<value>;
6991
6992Sets or gets the mercenary faith value for given guild for currently
6993attached character. Guild can be one or the following constants:
6994
6995 ARCH_MERC_GUILD
6996 SPEAR_MERC_GUILD
6997 SWORD_MERC_GUILD
6998
6999---------------------------------------
7000
7001========================
7002|11.- SeA 指令|
7003========================
7004---------------------------------------
7005
7006*getnpcdata("類型"{,<NPCID>/"NPCå"});
7007*setnpcdata <類型>,"值"{,<NPCID>/"NPCå"};
7008 類型: 1: NPC å,2: NPC大å°(0,1,2),3: NPCæ–¹å‘(0~7)
7009 10:形象ID,11:é 上飾å“, 12:é ä¸é£¾å“, 13:é 下飾å“
7010 14:性別, 15:髮型, 16:髮色, 17:衣æœè‰²
7011 特殊類型:0: 僅å°getnpcdata有作用,返回NPCID
7012 20:僅å°setnpcdata有作用,複製指定CID的人物形象給npc。
7013 舉例:
7014 getnpcdata(1); //返回npcå
7015 setnpcdata 20,getcharid(0); //複製自己的形象給npc
7016 註: 僅Xray客戶端支æŒNPC使用玩家形象。
7017
7018---------------------------------------
7019
7020*dupnpc "åƒæ•¸1","åƒæ•¸2","åƒæ•¸3","åƒæ•¸4";
7021 作用: 複製NPC。
7022 舉例:
7023 腳本:
7024 prontera,146,99,2 script PVPæœå‹™::PVP 917,{
7025 end;
7026 }
7027
7028 通常複製語å¥:
7029 prontera,156,99,2 duplicate(PVP) PVPæœå‹™#1 917
7030
7031 該命令語法:
7032 dupnpc "prontera,156,99,2","duplicate(PVP)","PVPæœå‹™#1","917";
7033
7034 å³ï¼Œæ‰€æœ‰<%TAB>用逗號代替,æ¯å€‹åƒæ•¸ä¹‹é–“åŠ å¼•è™Ÿã€‚
7035
7036---------------------------------------
7037
7038*mobuseskill <GID>,"技能å"/<技能id>,<技能ç‰ç´š>,<è© å”±æ™‚é–“>,<å¯å¦ä¸æ–·è© å”±>,<表情>,<目標類型>;
7039 作用: 指定é”ç‰©ä½¿ç”¨æŸæŠ€èƒ½ã€‚
7040 目標類型: 0:自己
7041 1:攻擊å°åƒ
7042 2:主人
7043 其他值:隨機。
7044
7045---------------------------------------
7046
7047*enhance <è£å‚™ä½ç½®>, <類型>, <數值>;
7048 作用: å¢žåŠ æˆ–æ¸›å°‘æˆ–æŸ¥è©¢æŸä½ç½®è£å‚™çš„è€ä¹…度。
7049 è£å‚™ä¸å˜åœ¨æ™‚返回-1,å¦å‰‡è¿”回物å“çš„è€ä¹…度。
7050 <類型>為0時調整當å‰è€ä¹…度,<類型>為1時調整最大è€ä¹…度。
7051 <數值>為0æ™‚å³æŸ¥è©¢è€ä¹…度。
7052
7053---------------------------------------
7054
7055*getdurequip <é“å…·id或é“å…·å>,<精煉值>,<å¡ç‰‡1>,<å¡ç‰‡2>,<å¡ç‰‡3>,<å¡ç‰‡4>,<最大è€ä¹…度>{,<角色ID>};
7056 作用: 得到有è€ä¹…度的指定é“具。
7057 例如: getdurequip 2424,10,0,0,0,0,200; 玩家將得到200è€ä¹…度的+10輕便鞋。
7058
7059---------------------------------------
7060
7061*getnpcid({"<npcname>"});
7062 作用: 返回npc id,ä¸è¼¸å…¥åå—則返回當å‰npc idï¼›å¦å‰‡å‰‡è¿”回輸入åå—之npc id。
7063 npc有唯一å(::Name)則輸入唯一åï¼›å¦å‰‡ï¼Œå¦‚果有隱è—å則輸入顯示å+éš±è—å,
7064 沒有隱è—å則輸入顯示å。
7065
7066---------------------------------------
7067
7068*delinventory <ä½ç½®åºè™Ÿ>,<數é‡>;
7069 作用: 刪除é“å…·æ¬„ä¸æŸä½ç½®çš„物å“,ä½ç½®åºè™Ÿé€šéŽgetinventoryinfo比å°ç¢ºèªã€‚
7070
7071---------------------------------------
7072
7073*equipinventory <ä½ç½®åºè™Ÿ>;
7074 作用: è£å‚™é“å…·æ¬„ä¸æŸä½ç½®çš„物å“,ä½ç½®åºè™Ÿé€šéŽgetinventoryinfo比å°ç¢ºèªã€‚
7075
7076---------------------------------------
7077
7078*getinventoryinfo(<ä½ç½®åºè™Ÿ>, <類型>);
7079 作用: æ ¹æ“šç‰©å“æ¬„ä½ç½®ç·¨è™ŸæŸ¥è©¢ç‰©å“ä¿¡æ¯ã€‚
7080 返回-1,如果物å“ä¸å˜åœ¨æˆ–é¡žåž‹ä¸æ£ç¢ºã€‚
7081 類型:
7082 0: id
7083 1: 數é‡
7084 2: 是å¦è£å‚™
7085 3: 精煉值
7086 4: 是å¦é‘’定
7087 5: æ˜¯å¦æå£ž
7088 6: å¡ç‰‡1
7089 7: å¡ç‰‡2
7090 8: å¡ç‰‡3
7091 9: å¡ç‰‡4
7092 10: 租賃到期時間
7093 11: è€ä¹…度修復後å¯ä»¥ä½¿ç”¨çš„æ™‚é–“
7094 12: ç•¶å‰è€ä¹…度
7095 13: è€ä¹…度最大值
7096 14: è£å‚™åºåˆ—號(å¯ç–ŠåŠ ç‰©å“æ…Žç”¨)
7097
7098---------------------------------------
7099
7100*existitem(<id>);
7101*existitem(<"name">);
7102 作用: 檢測是å¦å˜åœ¨è©²ç‰©å“。
7103 返回0,如果ä¸å˜åœ¨ã€‚
7104 返回<é“å…·id>,如果物å“å˜åœ¨ï¼Œä¸”å¯ä»¥ç–ŠåŠ ã€‚
7105 返回 - <é“å…·id>,如果物å“å˜åœ¨ï¼Œä¸”ä¸èƒ½ç–ŠåŠ ã€‚
7106 舉例: existitem("太陽眼é¡") == -2201
7107
7108---------------------------------------
7109
7110*readbook <書id>,<é 碼>;
7111 作用: 通éŽè…³æœ¬æ‰“開書並跳轉到æŸé 。
7112
7113---------------------------------------
7114
7115*query_sql2("<SQL語å¥>",<變é‡1>,<變é‡2>,……)
7116 作用: 採用角色æœå‹™å™¨é€²è¡Œæ•¸æ“šåº«æ“作,防æ¢å°å¤§åž‹æ•¸æ“šåº«çš„æ“ä½œä½¿åœ°åœ–æœå‹™å™¨åœæ¢éŸ¿æ‡‰ã€‚
7117 返回數據採用變é‡å+數å—å½¢å¼ï¼Œå–消128行é™åˆ¶ï¼Œå–消ä¸èƒ½ä½¿ç”¨è§’色永久變é‡å’Œ
7118 帳號變é‡é™åˆ¶ã€‚
7119 函數將返回-1,如果角色æœå‹™å™¨ä¸åœ¨ç·šï¼›å¦å‰‡è¿”å›žè®Šé‡æ•¸ã€‚
7120 舉例:
7121 set .@j,query_sql2("SELECT * FROM inventory i",$@myvar1,$@myvar2,$@myvar3,$@myvar4,$@myvar5,$@myvar6,$@myvar7,$@myvar8,$@myvar9,$@myvar10,$@myvar11,$@myvar12,$@myvar13);
7122 mes "數據庫æ“ä½œçµæŸï¼Œå¾—到"+.@j+"行,所有數據已經ä¿å˜åœ¨å…§å˜ä¸";
7123 mes "下é¢å°‡é€šéŽmes顯示所有數據,æ¤éŽç¨‹æœƒä½¿å®¢æˆ¶ç«¯lag";
7124 next;
7125 for (set .@i,0; .@i<.@j; set .@i,.@i+1)
7126 {
7127 mes getd("$@myvar1"+.@i)+"|"+getd("$@myvar2"+.@i)+"|"+getd("$@myvar3"+.@i)+"|"+getd("$@myvar4"+.@i)+"|"+getd("$@myvar5"+.@i)+"|"+getd("$@myvar6"+.@i)+"|"+getd("$@myvar7"+.@i)+"|"+getd("$@myvar8"+.@i)+"|"+getd("$@myvar9"+.@i)+"|"+getd("$@myvar10"+.@i)+"|"+getd("$@myvar11"+.@i)+"|"+getd("$@myvar12"+.@i)+"|"+getd("$@myvar13"+.@i)+"|";
7128 sleep2 1;
7129 }
7130 close;
7131
7132---------------------------------------
7133
7134*countpoints(<類型>);
7135 作用: 顯示當å‰è§’è‰²çš„å¡æ™®æ‹‰é»žæ•¸æˆ–金錢點數。未知類型返回-1。
7136 類型: 1 - 塿™®æ‹‰é»žæ•¸ï¼›
7137 2 - 金錢點數。
7138
7139---------------------------------------
7140
7141*sendmail "<收件人姓å>","<標題>","<æ£æ–‡>",<zeny數é‡>,<物å“id>,<數é‡>,<鑒定>,<精煉>,<æå£ž>,<å¡ç‰‡1>,<å¡ç‰‡2>,<å¡ç‰‡3>,<å¡ç‰‡4>{,"<發件人姓å>"};
7142 作用: å¯ä»¥ç™¼åŒ¿åéƒµä»¶ï¼Œç³»çµ±ä¸æœƒæª¢æ¸¬ç™¼ä»¶äººå§“å。常用於給ä¸åœ¨ç·šçŽ©å®¶ç™¼é€ç‰©å“。
7143 收件人姓åå¿…é ˆçœŸå¯¦ï¼›
7144 發件人姓åå¯éš¨æ„å¡«å¯«ï¼›
7145 發件人姓åä¸å¡«å¯«ï¼Œå‰‡å¿…é ˆå˜åœ¨çŽ©å®¶è…³æœ¬é—œè¯ã€‚
7146
7147---------------------------------------
7148
7149*resume <è£å‚™ä½ç½®>, <時間>;
7150 作用: 續租æŸä½ç½®è£å‚™ï¼Œæ™‚é–“å–®ä½ç‚ºç§’。
7151 è£å‚™ä¸å˜åœ¨æ™‚返回-1,éžç§Ÿè³ƒç‰©å“返回0,租賃è£å‚™è¿”回續租後剩餘租賃時間。
7152 時間å¯ä»¥ç‚ºè² 數以縮çŸç§Ÿè³ƒæ™‚間。
7153
7154---------------------------------------
7155
7156*battleignore{ <標記>};
7157 作用: æ€ªç‰©ä¸æœƒæ”»æ“Šä½ ,標記為0æ™‚ç‚ºå–æ¶ˆï¼Œå…¶ä»–則進入該狀態。
7158
7159---------------------------------------
7160
7161*warpignore{ <標記>};
7162 作用: 䏿œƒè¢«å‚³é€ï¼Œæ¨™è¨˜ç‚º0æ™‚ç‚ºå–æ¶ˆï¼Œå…¶ä»–則進入該狀態。
7163
7164---------------------------------------
7165
7166*setoption1 <編號>;
7167 作用: 是å°åƒé€²å…¥æŒ‡å®šç‹€æ…‹ã€‚下表沒有的編號,則默èªç‚º0
7168 類型列表:
7169 1 - 完全石化
7170 2 - 冰å‡
7171 3 - 暈眩
7172 4 - ç¡çœ
7173 6 - 石化ä¸
7174
7175---------------------------------------
7176
7177*setoption2 <編號>{,<標記>};
7178 作用: 標記ä¸ç‚º0或沒有標記,則使å°åƒé€²å…¥æŒ‡å®šç‹€æ…‹ï¼Œæ¨™è¨˜ç‚º0則喿¶ˆç‹€æ…‹ã€‚
7179 類型列表:
7180 1 - 䏿¯’
7181 2 - 詛咒
7182 4 - 沉默
7183 8 - 未知
7184 16 - 黑暗
7185 32 - è‡´å‘½ä¸æ¯’
7186
7187---------------------------------------
7188
7189*campon "<地圖å>"{,<標籤>};
7190 campoff "<地圖å>";
7191 作用: 打開或關閉無需按shift就能攻擊的功能,åªèƒ½æ”»æ“Šä¸åŒé™£ç‡Ÿçš„å°è±¡ã€‚
7192 類型: 標籤為2時,地圖顯示傷害,å¦å‰‡å‰‡ä¸é¡¯ç¤ºã€‚
7193
7194---------------------------------------
7195
7196*isrestricted <é“å…·id>;
7197 作用: 如果物å“在db\item_trade.txtè¨å®šç‚ºé™åˆ¶ç‰©å“,則返回其é™åˆ¶å…§å®¹ï¼›
7198 é™åˆ¶å…§å®¹ç”±1ã€2ã€8ã€16ã€32ã€64表示(具體é™åˆ¶å°æ‡‰åƒè¦‹db\item_trade.txt)
7199 å¦å‰‡ï¼Œå‰‡è¿”回0。如果物å“ä¸å˜åœ¨ï¼Œå‰‡è¿”回-1。
7200
7201---------------------------------------
7202
7203*islocked <é“å…·id>;
7204 作用: 檢查該玩家是å¦éŽ–å®šè©²ç‰©å“。
7205 是則返回1,å¦å‰‡ï¼Œå‰‡è¿”回0。
7206 注æ„: 如果身上有一件ç¨ç«‹ç¶å®šçš„é“具,該指令也會å°è©²ç¨®é¡žé“具返回1ï¼›
7207
7208---------------------------------------
7209
7210*isrental <è£å‚™ä½ç½®>;
7211 作用: 如果物å“為租賃物å“,則返回其剩餘時間(秒)
7212 å¦å‰‡ï¼Œå‰‡è¿”回0;如果指定è£å‚™ä½ç½®ä¸æ£ç¢ºï¼Œå‰‡è¿”回-1。
7213
7214---------------------------------------
7215
7216*rentequip <é“å…·id或é“å…·å>,<精煉值>,<å¡ç‰‡1>,<å¡ç‰‡2>,<å¡ç‰‡3>,<å¡ç‰‡4>,<N秒後到期>{,<角色ID>{,<是å¦å¯äº¤æ˜“>}};
7217 作用: 租賃指定的é“具,任何è£å‚™éƒ½èƒ½é€šéŽæ¤ç›´æŽ¥ç§Ÿè³ƒ.
7218 租賃物å“自動æˆç‚ºç„¡æ³•äº¤æ˜“ï¼Œä½†å¯æ”¾æ‰‹æŽ¨è»Šå’Œå€‹äººå€‰åº«ï¼Œé€¾æœŸæœƒè‡ªå‹•刪除。å¯ä»¥ç²¾ç…‰ï¼Œæ’å¡ã€‚
7219 例如: rentequip 2424,10,0,0,0,0,3600; 將租+10輕便鞋給玩家1å°æ™‚。
7220
7221---------------------------------------
7222
7223*strcut(<文本>, <ä½ç½®>{, <長度>})
7224 作用: å°"<文本>"截å–在"<ä½ç½®>"å‰çš„æ‰€æœ‰å—符。
7225 <ä½ç½®>最å°ç‚º0ï¼›<長度>最å°ç‚º1ï¼›å¦‚æžœä¸æŒ‡å®šé•·åº¦ï¼Œé»˜èªç‚º1。(兼容jA, CEA)
7226 如果指定「ä½ç½®ã€ä¸åœ¨æ–‡æœ¬é•·åº¦å…§ï¼Œå‰‡è‡ªå‹•調整為最近的文本長度範åœå…§çš„值。
7227 如果指定「長度ã€è¶…éŽäº†æ–‡æœ¬é•·åº¦ï¼Œå‰‡è‡ªå‹•調整為剩餘文本長度。
7228 例如: strcut(strcharinfo(4),6,3), 截å–玩家ip的第7ä½ï¼ˆå«ç¬¬7ä½ï¼‰ä¹‹å¾Œçš„3個å—符。
7229 å³ï¼šå¦‚æžœip為10.16.218.24,則返回218。
7230
7231---------------------------------------
7232
7233*campmob("<map name>",<spawn x>,<spawn y>,<target x>,<target y>,<monster name>,<monster id>,<monster camp>{,"<event>"})
7234 作用: 在指定地圖指定ä½ç½®å‰µé€ 一個é”物,並且能為該é”物指定陣營ã€è¡Œèµ°ç›®æ¨™å標以åŠè§¸ç™¼äº‹ä»¶ã€‚
7235 é”ç‰©çš„å‡ºç”Ÿåæ¨™å¯ä»¥ç‚º0,å³éš¨å³ä½ç½®ç”Ÿæˆã€‚é”ç‰©çš„ç›®çš„åæ¨™å¯ä»¥ç‚º0,å³éš¨å³èµ°å‹•。é”ç‰©çš„å‡ºç”Ÿåæ¨™èˆ‡ç›®çš„忍™ç›¸åŒï¼Œå³éš¨å³èµ°å‹•。
7236 如果é”物陣營為0ï¼Œå³æ™®é€šæ€ªç‰©ã€‚如果é”物陣營ä¸ç‚º0,則其會主動攻擊有陣營且陣營ä¸åŒçš„玩家(é”ç‰©ç‹€æ…‹å¿…é ˆæ˜¯Aggressive)。
7237 該腳本會返回é”物GID,å¯ç”¨æ–¼mobattaché”ç‰©æ“æŽ§ã€‚å¦‚æžœé”物與npcé—œè¯ï¼Œå‰‡æœ€å¾Œçš„è§¸ç™¼äº‹ä»¶ä¸æœƒå•Ÿå‹•ï¼Œå¿…é ˆä½¿ç”¨Callback觸發。
7238 該部分內容請見doc\script_command.txt,Mob Control Suitç« ç¯€ã€‚
7239
7240 r13D84新增內容:路點系統。
7241 <target x> 為 -1 時使用路點系統,<target y> 表示路點idï¼Œè·¯é»žæ ¼å¼åƒç…§waypoint.txt
7242
7243---------------------------------------
7244
7245*getguildmember <guild id>,{<type>};
7246 作用: 該命令會得到如下信æ¯çš„æ•¸åˆ—:
7247 $@guildmembername$[] 所有工會æˆå“¡çš„åå—(如果typeä¸ç‚º1ã€2ã€3)。
7248 $@guildmembercid[] 所有工會æˆå“¡çš„CID(角色id)(如果type為1)。
7249 $@guildmemberaid[] 所有工會æˆå“¡çš„AID(賬號id)(如果type為2)。
7250 $@guildiplist$[] 所有在線工會æˆå“¡çš„ip(如果type為3)。
7251 $@guildipcount 工會在線ip數é‡ï¼ˆå¦‚æžœtype為3)。
7252 $@guildonlinecount 工會在線æˆå“¡æ•¸é‡ï¼ˆå¦‚æžœtype為3)。
7253 $@guildmembercount 工會æˆå“¡æ•¸é‡ï¼ˆåŒ…括ä¸åœ¨ç·šï¼‰ã€‚
7254
7255---------------------------------------
7256
7257*getguildallies <guild id>;
7258 作用: 該命令會得到如下信æ¯çš„æ•¸åˆ—:
7259 $@guildidallies[] 所有åŒç›Ÿå…¬æœƒçš„公會id。
7260 $@guildalliescount åŒç›Ÿå…¬æœƒæ•¸é‡ã€‚
7261
7262---------------------------------------
7263
7264*buildbarricade, killbarricade
7265 buildbarricade("<地圖å>",<忍™x>,<忍™y>,"<顯示å>",<size>,<dir>,<killable>,<walkable>,<shootable>,<odd>,"<事件標籤>")
7266 dir從æ£åŒ—ï¼ˆä¸Šï¼‰é–‹å§‹é€†æ™‚é‡æ–¹å‘分別為0~7,sizeè¡¨ç¤ºè·¯éšœåœ¨æ‰€çµ¦åæ¨™çš„æŸæ–¹å‘ä¸Šæ“´å±•å¤šå°‘æ ¼ï¼Œodd如果為1è¡¨ç¤ºåœ¨å¥‡æ•¸æ ¼å內顯示路障,如果為0ï¼Œå‰‡è¡¨ç¤ºåœ¨å¶æ•¸æ ¼å…§é¡¯ç¤ºè·¯éšœã€‚
7267 killable表示是å¦èƒ½è¢«æ”»æ“Šï¼Œwalkable表示是å¦èƒ½è¡Œèµ°ç©¿éŽï¼Œshootable表示是å¦èƒ½ç©¿éŽè·¯éšœæ”»æ“Šæˆ–飛èºã€‚他們的值皆為0或1。
7268
7269---------------------------------------
7270
7271*getbattlestatus <id>,<類型>
7272
7273 ID為GID,å³çŽ©å®¶æ™‚ç‚ºAID。
7274
7275 類型:
7276 1:str總值 2:agi總值 3:vit總值 4:int總值 5:dex總值
7277 6:luk總值 7:hp 8:maxhp 9:sp 10:maxsp
7278 11:左atk 12:左matk 13:å³matk 14:移動速度 15:amotion
7279 16:adelay 17:dmotion 18:hit 19:flee 20:cri
7280 21:flee2 22:屬性def 23:屬性mdef 24:攻擊速度å€çއ25:屬性
7281 26:屬性ç‰ç´š 27:è£å‚™def 28:è£å‚™mdef 29ï¼šå³æ‰‹æ¦å™¨atk 30ï¼šå³æ‰‹ç²¾ç…‰atk
7282 31ï¼šå³æ‰‹æ¦å™¨å±¬æ€§32ï¼šå³æ‰‹æ¦å™¨è·é›¢33:左手æ¦å™¨atk 34:左å³ç²¾ç…‰atk 35ï¼šå·¦å³æ¦å™¨å±¬æ€§
7283 36:左手æ¦å™¨è·é›¢37:å¡ç‰‡atk 38:è£å‚™matk
7284
7285 id或類型錯誤時,返回-1。
7286
7287---------------------------------------
7288
7289*sc_check <type>{,<gid>}
7290
7291 返回-1:找ä¸åˆ°è©²è§’色。
7292 返回0:沒有該狀態。
7293 返回1:有該狀態,並賦予下列變é‡å€¼ï¼Œè®Šé‡æ„義自我解釋,時間為-1表示無é™ã€‚
7294 @sc_val1, @sc_val2, @sc_val3, @sc_val4, @sc_tickleft
7295
7296---------------------------------------
7297
7298*script4each "<腳本>",<類型>{,...}
7299
7300 類型0:全æœï¼šscript4each "<腳本>",0;
7301 類型1:全地圖:script4each "<腳本>",1,"地圖å";
7302 類型2:全å€åŸŸï¼šscript4each "<腳本>",2,"地圖å",忍™x,忍™y,範åœ;
7303 類型3:全組隊:script4each "<腳本>",3,玩家cid;
7304 類型4:全公會:script4each "<腳本>",4,玩家cid;
7305 類型5:全陣營:script4each "<腳本>",5,玩家cid;
7306 類型6:全å€åŸŸï¼šscript4each "<腳本>",6,"地圖å",忍™x0,忍™y0,忍™x1,忍™y1;
7307 類型7:全組隊:script4each "<腳本>",7,隊ä¼id;
7308 類型8:全公會:script4each "<腳本>",8,公會id;
7309 類型9:全陣營:script4each "<腳本>",9,陣營id;
7310
7311---------------------------------------
7312
7313*script4eachmob "<腳本>",<類型>{,...}
7314
7315 該命令僅支æŒsetmobdata指令,setmobdata指令ä¸çš„é”物GID請用變é‡ã€Œ$@4eachmobgidã€ä»£æ›¿ã€‚
7316
7317 類型0:全æœï¼šscript4eachmob "<腳本>",0;
7318 類型1:全地圖:script4eachmob "<腳本>",1,"地圖å";
7319 類型2:全å€åŸŸï¼šscript4eachmob "<腳本>",2,"地圖å",忍™x0,忍™y0,忍™x1,忍™y1;
7320 類型5:全陣營:script4eachmob "<腳本>",3,陣營編號;
7321
7322---------------------------------------
7323
7324*noovercharge <id>{,<標è˜>}
7325*nodiscount <id>{,<標è˜>}
7326
7327 標è˜0:關閉
7328 標è˜1:打開
7329 未指定默èª1。
7330
7331---------------------------------------
7332
7333*checkalliance <公會id>
7334
7335 返回1: 與æ¤å…¬æœƒåŒç›Ÿ
7336 返回0: 與æ¤å…¬æœƒç„¡é—œ
7337 返回-1: 其他錯誤
7338
7339---------------------------------------
7340
7341*status_calc
7342
7343舉例: {
7344OnPCSCEndEvent:
7345OnPCSCStartEvent:
7346 status_calc();
7347 end;
7348OnPCStatCalcEvent:
7349 if(sc_check(SC_EDP))
7350 {
7351 bonus2 bSkillAtk,"GC_CROSSIMPACT",200;
7352 bonus2 bSkillAtk,"GC_COUNTERSLASH",200;
7353 bonus2 bSkillAtk,"AS_SONICBLOW",200;
7354 bonus2 bSkillAtk,"ASC_BREAKER",200;
7355 }
7356}
7357
7358ä½œç”¨ï¼šè‡´å‘½åæ¯’å°ä¸Šè¿°æŠ€èƒ½å‚·å®³ç¿»å€ã€‚
7359---------------------------------------
7360
7361*setaura <id>{,<週期>{,<id2>}{,<id3>}}
7362
7363作用:è¨ç½®å…‰ç’°æ•ˆæžœã€‚
7364id在effect_list.txt䏿Ÿ¥çœ‹ã€‚
7365週期毫秒記。0為ä¸é‡è¤‡ã€‚
7366所有id共享åŒä¸€é€±æœŸã€‚
7367
7368---------------------------------------
7369
7370*setnoks <gid>,<type>
7371
7372 gid: é”物id
7373 type: 0 - 關閉。1 - 自己。2 - 組隊。 3 - 公會。
7374
7375作用:@noks的腳本指令版。è¨ç½®ä¸èƒ½è¢«æ¶æ€ªã€‚
7376
7377---------------------------------------
7378
7379*processhalt;
7380
7381作用: 在On*Event事件ä¸çµ‚æ¢å¾ŒçºŒé‹è¡Œã€‚
7382 支æŒä»¥ä¸‹äº‹ä»¶:
7383 OnPCUseSkillEvent
7384 OnNPCDropItemEvent
7385 OnPCUseItemEvent
7386 OnPCEquipItemEvent
7387 OnPCUnequipItemEvent
7388---------------------------------------
7389
7390*viewequip <Aid>{,<flag>};
7391
7392作用: 查看賬號id為Aid的角色的è£å‚™ã€‚
7393 flagä¸ç‚º0時強制觀看,å¦å‰‡è¦ç¬¦åˆçŽ©å®¶çš„æ„願或為GM。
7394
7395---------------------------------------
7396
7397*usecard <ä½ç½®>
7398
7399作用:彈出å¡ç‰‡æ’å…¥æ™‚é¸æ“‡è£å‚™çš„æ¡†ã€‚ä½ç½®æ˜¯å¡ç‰‡åœ¨ç‰©å“欄裡的ä½ç½®ã€‚
7400
7401---------------------------------------
7402
7403*create_player "å§“å", è·æ¥ID, 性別, "地圖å", x忍™, y忍™, 髮型, 髮色, è¡£æœé¡è‰²;
7404
7405作用: å‰µé€ çŽ©å®¶ã€‚è¿”å›žAID。
7406
7407---------------------------------------
7408
7409*create_vender AID, "招牌";
7410
7411作用: 將給於AIDçš„è§’è‰²æ ¹æ“šæŽ›æ©Ÿé‡è¼‰çš„å…§å®¹å‰µé€ éœ²å¤©å•†åº—ã€‚
7412
7413---------------------------------------
7414
7415*cartgetitem2 "<Item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
7416
7417作用: 在手推車ä¸å¾—到物å“,基本åŒgetitem2.
7418
7419---------------------------------------
7420
7421*return2egg();
7422
7423作用: 把寵物收起變æˆè›‹ã€‚返回0,失敗;返回1,æˆåŠŸã€‚
7424
7425---------------------------------------
7426
7427*addshopentry("<NPCå>",<ä½ç½®>,<id>,<åƒ¹æ ¼>);
7428
7429作用: å°å•†åº—或金錢商店的npcï¼Œæ·»åŠ è²©è³£é“具。
7430說明: ä½ç½®å¾ž0開始。
7431
7432---------------------------------------
7433
7434*removeshopentry("<NPCå>",<id>);
7435
7436作用: å°å•†åº—或金錢商店的npc,刪除idé“具的販賣。
7437
7438---------------------------------------
7439
7440*setshopentry("<NPCå>",<id>,<price>);
7441
7442作用: å°å•†åº—或金錢商店的npc,è¨ç½®idé“å…·çš„åƒ¹æ ¼ã€‚
7443
7444---------------------------------------
7445
7446*setcashpoints("<NPCå>","<變é‡å>");
7447*setfreepoints("<NPCå>","<變é‡å>");
7448
7449作用: 使指定npc使用指定變é‡ç‚ºcashshop變é‡ã€‚
7450
7451也å¯ä»¥ä½¿ç”¨cashshop(變é‡å)來定義cashshop
7452例如:
7453 - cashshop(#賬號變é‡) Inkfish -1,501:1;
7454
7455---------------------------------------
7456
7457*setmobdrop é”物id,掉è½åºè™Ÿ,掉率{,é“å…·id};
7458
7459作用: 指定é”物指定åºè™Ÿçš„æŽ‰è½ç‰©å“åŠå…¶æŽ‰è½çŽ‡ï¼Œçµ•å°å€¼ï¼Œä¸ä¹˜ä»¥æœå‹™å™¨å€çŽ‡ï¼Œä½†æ˜¯æœƒä¹˜ç‰ç´šåŠ æˆ(若開啟)。
7460
7461---------------------------------------
7462
7463*checkidle({<AID>});
7464
7465作用: 返回當å‰è§’色或指定AID角色是å¦ç‚ºå‘†æ»¯ç‹€æ…‹ã€‚需è¨ç½®party.confä¸çš„idle_no_share。
7466
7467çµæžœï¼š 1:呆滯。0:活èºã€‚-1:角色ä¸å˜åœ¨ã€‚
7468
7469---------------------------------------
7470
7471*set_hotkey <ä½ç½®>,<類型>,<ID>,<ç‰ç´š>;
7472
7473作用: è¨ç½®å¿«æ·éµã€‚ä½ç½®ï¼šå¾ž0-37。類型:0表示é“具,1表示技能。IDï¼šè¡¨ç¤ºç‰©å“æˆ–技能ID。ç‰ç´šï¼šè¡¨ç¤ºæŠ€èƒ½ç‰ç´šã€‚
7474 *å¿«æ·éµåªæœ‰é‡æ–°ç™»éŒ„æ‰æœƒé¡¯ç¤ºã€‚
7475
7476---------------------------------------
7477
7478*get_hotkey <ä½ç½®>,<種類>;
7479
7480作用: 返回"ä½ç½®"的快æ·éµã€‚種類:0表示類型,1表示ID,2表示ç‰ç´šã€‚
7481 類型見set_hotkey;
7482
7483---------------------------------------
7484
7485*lock_hotkey <ä½ç½®>,<0/1>;
7486
7487作用: 鎖定指定ä½ç½®çš„å¿«æ·éµã€‚
7488 *å®¢æˆ¶ç«¯é¡¯ç¤ºç„¡æ³•éŽ–å®šï¼Œä½†å¯¦éš›æ•ˆæžœéŽ–å®šï¼Œé‡æ–°ç™»éŒ„會復原。
7489
7490---------------------------------------
7491
7492*npcskill <技能id>,<技能ç‰ç´š>,<屬性點>,<基本ç‰ç´š>;
7493*npcskill "<技能å>",<技能ç‰ç´š>,<屬性點>,<基本ç‰ç´š>;
7494
7495作用: 讓npcå°é—œè¯çŽ©å®¶ä½¿ç”¨æŠ€èƒ½ï¼Œå¦‚æžœæ˜¯åœ°é¢æŠ€èƒ½å‰‡æœ€çŽ©å®¶ä½ç½®ä½¿ç”¨ã€‚
7496 npc6個屬性點將被賦予相åŒçš„值。
7497
7498---------------------------------------
7499
7500*freeloop <標記>
7501
7502作用: 標記為0則解除,其他則無視script_athena.confä¸è¨ç½®çš„check_cmdcountå’Œcheck_gotocount
7503
7504---------------------------------------
7505
7506*party_create("<party name>"{,<character id>{,<item share>,<item share type>}});
7507
7508Organizes a party with the attached or specified character as leader. If
7509successful, the command returns 1 and sets the global temporary variable
7510"$@party_create_id" to the ID of the party created.
7511注æ„,$@party_create_id「ä¸ã€åœ¨éšŠä¼å‰µå»ºä¹‹å¾Œç«‹å³ç”Ÿæˆï¼Œç”Ÿæˆé€Ÿåº¦å–決於地圖
7512æœå‹™å™¨èˆ‡è§’色æœå‹™å™¨å°è©±é€Ÿåº¦ã€‚
7513
7514Additionally, item sharing options can be provided:
7515 - Item Share: 0-Each Take (default), 1-Party Share
7516 - Item Share Type: 0-Each Take (default), 1-Even Share
7517
7518These values are returned upon failure:
7519 0: Unknown error.
7520-1: Player not found.
7521-2: Player already has a party.
7522-3: Party name exists.
7523
7524---------------------------------------
7525
7526*party_destroy(<party id>);
7527
7528Disbands a party. The command returns 1 upon success and 0 upon failure.
7529
7530---------------------------------------
7531
7532*party_addmember(<party id>,<character id>);
7533
7534Adds a player to an existing party.
7535
7536The command returns 1 upon success, and these values upon failure:
7537 0: Unknown error.
7538-1: Player not found.
7539-2: Player already has a party.
7540-3: Party not found.
7541-4: Party is full.
7542
7543---------------------------------------
7544
7545*party_delmember({<character id>,<party id>});
7546
7547Removes a player from his/her party. If no player is specified, the command
7548will run for the invoking player. If that player is the only party member
7549remaining, the party will be disbanded.
7550
7551The command returns 1 upon success, and these values upon failure:
7552 0: Unknown error.
7553-1: Player not found.
7554-2: Party not found.
7555-3: Player is not in the party.
7556
7557---------------------------------------
7558
7559*party_changeleader(<party id>,<character id>);
7560
7561Transfers leadership of a party to the specified character.
7562
7563The command returns 1 upon success, and these values upon failure:
7564 0: Unknown error.
7565-1: Party not found.
7566-2: Player not found.
7567-3: Player is not in the party.
7568-4: Player is already party leader.
7569
7570---------------------------------------
7571
7572*party_changeoption(<party id>,<option>,<flag>);
7573
7574Changes a party option.
7575
7576Valid options are:
7577 0 - Exp Share (flags: 0-Each Take, 1-Even Share)
7578 1 - Item Share (flags: 0-Each Take, 1-Party Share)
7579 2 - Item Share Type (flags: 0-Each Take, 1-Even Share)
7580
7581The command returns 1 upon success, and these values upon failure:
7582 0: Invalid option.
7583-1: Party not found.
7584
7585---------------------------------------
7586
7587*getfamename(類型,排å)
7588*getfame(類型,排å)
7589
7590類型:0:éµåŒ ,1:煉金,2:跆拳
7591排å:0-9表示1~10å
7592
7593getfamename顯示åå—,getfameé¡¯ç¤ºè²æœ›å€¼
7594
7595---------------------------------------
7596
7597*nochangeemblem 類型
7598
7599類型:0:å…¨æœå¯ä»¥æ›´æ›å…¬æœƒåœ–標
7600類型:1:å…¨æœä¸å¯ä»¥æ›´æ›å…¬æœƒåœ–標
7601
7602---------------------------------------
7603
7604*bind_next_getitem 類型
7605
7606類型:0關閉,1打開
7607打開後,下一個得到的物å“å°‡ç¶å®šï¼Œä¸è«–是通éŽgetitem,getitem2,還是拾å–的物å“都會ç¶å®šã€‚
7608僅下一次有效。得到ç¶å®šç‰©å“後å³é—œé–‰ã€‚
7609
7610---------------------------------------
7611
7612*clearflooritem <GID>
7613
7614清楚地é¢GIDçš„é“具。
7615
7616---------------------------------------
7617
7618*showscript "消æ¯"{,<GID>}
7619
7620在指定å°åƒé 上顯示消æ¯ï¼Œä¸åŒ…å«å°åƒåå—。
7621
7622GID如果未指定或指定å°åƒä¸å˜åœ¨ï¼Œå‰‡åœ¨è…³æœ¬é—œè¯å°åƒé 上顯示,如果腳本未關è¯å°è±¡ï¼Œå‰‡é¡¯ç¤ºåœ¨
7623NPCé 上。
7624
7625---------------------------------------
7626
7627bg_queue_enter "æˆ°å ´å","地圖å",隊ä¼1忍™x,隊ä¼1忍™y,"隊ä¼1登出事件","隊ä¼1æ»äº¡äº‹ä»¶",隊ä¼2忍™x,隊ä¼2忍™y,"隊ä¼2登出事件","隊ä¼2æ»äº¡äº‹ä»¶";
7628
7629è©²èªžå¥æ”¾åœ¨createbgqueue的事件ä¸ï¼Œå°‡çµ¦éšŠåˆ—ä¸çš„çŽ©å®¶å‰µå»ºæˆ°å ´ã€‚
7630æˆ°å ´åå¿…é ˆèˆ‡å®¢æˆ¶ç«¯é¡¯ç¤ºçš„å®Œå…¨ä¸€è‡´ï¼Œé€™æ˜¯æ•´å€‹ç³»çµ±çš„å”¯ä¸€æ¨™ç±¤ã€‚
7631戰隊1çš„æˆ°å ´id將會ä¿å˜åœ¨$@arenabgid1變é‡ä¸;
7632戰隊2çš„æˆ°å ´id將會ä¿å˜åœ¨$@arenabgid2變é‡ä¸;
7633
7634---------------------------------------
7635
7636createbgqueue "æˆ°å ´å",人數,最å°ç‰ç´š,最大ç‰ç´š,"事件";
7637
7638å‰µå»ºæˆ°å ´éšŠåˆ—ï¼Œä¸€èˆ¬åœ¨OnInitä¸ä½¿ç”¨ã€‚
7639æˆ°å ´åå¿…é ˆèˆ‡å®¢æˆ¶ç«¯é¡¯ç¤ºçš„å®Œå…¨ä¸€è‡´ï¼Œé€™æ˜¯æ•´å€‹ç³»çµ±çš„å”¯ä¸€æ¨™ç±¤ã€‚
7640事件為隊列滿足è¨å®šäººæ•¸æ¢ä»¶å¾Œé‹è¡Œçš„事件。
7641
7642---------------------------------------
7643
7644resetbgqueue "æˆ°å ´å";
7645
7646釿–°å…許隊列進入å…è¨±æŽ’éšŠç‹€æ…‹ï¼Œæˆ°å ´çµæŸæ™‚使用。
7647
7648---------------------------------------
7649
7650statuschangemapchange;
7651
7652åœ°åœ–è½‰æ›æ™‚釿–°è¨ˆç®—人物è£å‚™å±¬æ€§ï¼Œä¸€èˆ¬ç”¨ä¾†åˆ·æ–°æœ‰åœ°åœ–é™åˆ¶çš„è£å‚™ç‰¹æ•ˆã€‚
7653
7654---------------------------------------
7655
7656*getmobposition(<GID>,"<地圖å變é‡>",<x忍™>,<y忍™>)
7657
7658This function will locate é”物 coordinates
7659and place their coordinates into the variables specified when calling it. It
7660will return 0 if the search was successful, and -1 if the parameters given were
7661not variables or the search was not successful.
7662
7663---------------------------------------
7664
7665*next_autocast_check_condition{ <åƒæ•¸>};
7666
7667在itemdb使用該指令後,下一個autospellçš„bonus將在發動時檢查氣彈,物å“需求ç‰ç‹€æ…‹ã€‚僅一次有效。
7668䏿Œ‡å®šåƒæ•¸å‰‡é»˜èª1
7669åƒæ•¸ï¼š
7670 1:檢查消耗物å“
7671 2: 檢查最大å¯ç”¨æ•¸é‡
7672 4: 檢查狀態(skill_require_dbä¸çš„æ‰‹æŽ¨è»Šï¼Œè€é·¹ç‰çš„æ¬„ä½ï¼‰
7673 8: 檢查skill_nocast_dbä¸çš„é …ç›®ã€‚(åŒ…æ‹¬å†·å»æ™‚é–“)
7674 16: 䏿ª¢æŸ¥åœ°é¢æŠ€èƒ½çš„UF_NOREITERATION。
7675
7676---------------------------------------
7677
7678* openDressroom;
7679 closeDressroom;
7680
7681打開關閉試衣間。
7682
7683---------------------------------------
7684
7685* showeffect <SI>,<值>,<開關>;
7686
7687顯示/關閉é 飾效果。
7688
7689---------------------------------------
7690
7691* getattachment;
7692
7693ç²å–é—œè¯çŽ©å®¶çš„æ‰€æœ‰éƒµä»¶ä¸çš„é“å…·å’Œzeny。
7694
7695返回:
7696 0:全部æˆåŠŸ
7697 1: 其䏿œ‰ä¸€å€‹éƒµä»¶çš„zenyè¶…éŽé™é¡ã€‚
7698 2: 其䏿œ‰ä¸€å€‹éƒµä»¶çš„é“å…·ä¸å˜åœ¨ã€‚
7699 3: 身上沒有空ä½ã€‚
7700 4: èº«ä¸Šæ²’æœ‰è¶³å¤ è² é‡ã€‚
7701
7702---------------------------------------
7703
7704* clearcooldown{ <技能id>};
7705
7706技能ä¸è¨ï¼Œå‰‡æ¸…空所有。注æ„,是ä¸è¨ï¼Œä¸æ˜¯ç‚º0。
7707
7708---------------------------------------
7709
7710* gettimetick_date(<年>,<月>,<日>,<時>,<分>,<秒>);
7711
7712ç²å–指定日期的timetick。
7713例:
7714 rentitem 2115,gettimetick_date(2017,7,21,15,0,0)-gettimetick(2);
7715 ç²å–å·´åŸºåŠ›ç›¾ï¼ŒéŽæœŸæ™‚間為2017å¹´7月21æ—¥15點。
7716
7717---------------------------------------
7718
7719* gettimetick_nextday(<日>,<時>);
7720
7721ç²å–éŽå¹¾å¤©çš„幾點時刻的timetick。
7722例:
7723 rentitem 2115,gettimetick_nextday(2,21)-gettimetick(2);
7724 ç²å–å·´åŸºåŠ›ç›¾ï¼ŒéŽæœŸæ™‚間為兩天後的晚上9點。
7725
7726---------------------------------------
7727
7728* gettimetick_nextweek(<幾次>,<周幾>,<時>);
7729
7730ç²å–éŽä»Šå¤©ä¹‹å¾Œç¬¬å¹¾å€‹çš„æ˜ŸæœŸå¹¾çš„幾點時刻的timetick。
7731例:
7732 rentitem 2115,gettimetick_nextweek(1,1,0)-gettimetick(2);
7733 ç²å–å·´åŸºåŠ›ç›¾ï¼ŒéŽæœŸæ™‚間為第一個星期一凌晨0點。
7734
7735---------------------------------------
7736
7737* channel_create("<åå—>","<密碼>",<é¡è‰²>,<å»¶é²>)
7738
7739創建åå—為"åå—"çš„é »é“,創建之後,å¯ä»¥åœ¨å¯†èªžæ¡†è£¡è¼¸å…¥ã€Œ#åå—ã€ä»¥åœ¨é »é“ä¸ç™¼è¨€ã€‚
7740é¡è‰²ï¼šï¼ˆä¸‹é¢æ˜¯èˆ‰ä¾‹ï¼Œè«‹ç”¨16進制數å—,ä¸è¦ç”¨æ–‡å—)
7741 白色: "0xffffff"
7742 紅色: "0xff0000"
7743 æ·±è—: "0x83cfe9"
7744 橙色: "0xe57c00"
7745 天è—: "0x00b89d"
7746 黃色: "0xffff90"
7747 å¢¨ç¶ : "0x28bf00"
7748 ç¶ è‰²: "0x00ff00"
7749å»¶é²ï¼šç‚ºæ¯å¥è©±ä¹‹é–“的間隔。
7750
7751返回1創建æˆåŠŸï¼Œè¿”å›ž0創建失敗,返回2å·²å˜åœ¨ã€‚
7752
7753---------------------------------------
7754
7755* channel_destroy("<åå—>")
7756
7757é—œé–‰é »é“。
7758
7759---------------------------------------
7760
7761* channel_join("<åå—>","密碼")
7762
7763åŠ å…¥é »é“
7764
7765---------------------------------------
7766
7767* channel_leave("<åå—>")
7768
7769é›¢é–‹é »é“
7770
7771---------------------------------------
7772
7773* channel_bind()
7774
7775ç¶å®šé »é“,ä¸ç”¨åœ¨å¯†èªžæ¡†è¼¸å…¥é »é“åå—å°±å¯ä»¥åœ¨è©²é »é“發言。
7776
7777---------------------------------------
7778
7779* channel_unbind("<åå—>")
7780
7781解除ç¶å®šé »é“
7782
7783---------------------------------------
7784
7785* channel_bindname("<åå—1>","<åå—2>")
7786
7787ç¶å®šé »é“å,ç¶å®šå¾Œå¯ä»¥åœ¨å¯†èŠæ¡†ä½¿ç”¨åå—1,在åå—2çš„é »é“發言。
7788åå—1是玩家ç¨ç«‹ï¼Œè€Œåå—2是æœå‹™å™¨ç¨ç«‹ã€‚
7789å› æ¤ï¼Œä¸åŒçީ家å¯ä»¥ä½¿ç”¨åŒæ¨£çš„åå—1,而在ä¸åŒçš„é »é“發言。
7790
7791---------------------------------------
7792
7793* identify {<類型>};
7794
7795å°å·²é‘’定物å“進行強制æ“作。該指令會在雙擊列表ä¸ç‰©å“後,觸發OnPCIdentifyEventäº‹ä»¶ï¼Œè€Œä¸æœƒçœŸçš„鑒定物å“。
7796類型是item_db裡的物å“類型,è¨ç½®å¾Œåªæœ‰è©²é¡žåž‹çš„ç‰©å“æœƒé¡¯ç¤ºåœ¨åˆ—表裡。
7797
7798---------------------------------------
7799
7800* rndopt_next_getitem <ä½ç½®>,<類型>{,<åƒæ•¸>},<值1>,<值2>
7801
7802å°getitem, rentitem, makeitem, getitem2, rentequip, makeitem2有效
7803ä½ç½®æ˜¯0-4(å³1-5個隨機槽)
7804類型為bonus類型。
7805客戶端支æŒå€¼1最大32767,值2最大255。
7806
7807舉例1:
7808 rndopt_next_getitem 0,bMaxHp,10,0;
7809 rndopt_next_getitem 1,bSubEle,Ele_Ghost,10,0;
7810 客戶端è¨ç½®ç¬¬1æ¢ç‚ºMaxHp +%d
7811 客戶端è¨ç½®ç¬¬33æ¢ç‚ºå°å¿µå±¬æ€§æ”»æ“Šå‚·å®³æ¸›å°‘ %d
7812 item_random_option.txtè¨ç½®1,bMaxHp
7813 item_random_option.txtè¨ç½®33,bSubEle,Ele_Ghost
7814 效果ç‰åŒæ–¼{ bonus bMaxHp,10; bonus2 bSubEle,Ele_Ghost,10; }客戶端也會æ£å¸¸é¡¯ç¤º
7815 如果item_rndopt_id.txt沒有è¨ç½®bMaxHp或bSubEle,Ele_Ghostå°æ‡‰çš„客戶端æ¢ç›®ä½ç½®ï¼Œå‰‡ç›¸æ‡‰çš„è…³æœ¬ä¸æœƒç”Ÿæ•ˆã€‚
7816
7817舉例2:
7818 rndopt_next_getitem 0,bGetZenyNum,100,1;
7819 在item_random_optionè¨ç½®ç‚ºx,bGetZenyNum時(x為任æ„id,是å¦å¯ä»¥é¡¯ç¤ºä¸å†æ¤æ¬¡è¨Žè«–範åœ)å°‡é‹è¡Œï¼š
7820 bonus2 bGetZenyNum,100,1;
7821
7822舉例3:
7823 rndopt_next_getitem 0,bSubEle,Ele_Earth,20,BF_LONG;
7824 在item_random_optionè¨ç½®ç‚ºx,bSubEle,Ele_Earth時(x為任æ„id,是å¦å¯ä»¥é¡¯ç¤ºä¸å†æ¤æ¬¡è¨Žè«–範åœ)å°‡é‹è¡Œï¼š
7825 bonus3 bSubEle,Ele_Earth,20,BF_LONG;
7826
7827
7828---------------------------------------
7829
7830* getguildalliance <公會ID1>, <公會ID2>;
7831
7832敵å°è¿”回2,åŒç›Ÿè¿”回1,å¦å‰‡è¿”回0.
7833
7834---------------------------------------
7835
7836* jobcanentermap "<地圖å>"{, <è·æ¥ID>};
7837
7838æ‰€çµ¦çš„è·æ¥ID能å¦é€²å…¥åœ°åœ–。ä¸çµ¦è·æ¥ID則是關è¯çŽ©å®¶ã€‚
7839返回1å¯ä»¥ï¼Œ0ä¸å¯ä»¥ã€‚
7840
7841---------------------------------------
7842
7843*getmercinfo(<type>{,<char id>});
7844
7845Retrieves information about mercenary of the currently attached
7846character. If char id is given, the information of that character is
7847retrieved instead. Type specifies what information to retrieve and
7848can be one of the following:
7849
7850 0 - Mercenary ID
7851 1 - Mercenary Class
7852 2 - Mercenary Name
7853 3 - Mercenary faith value for this mercenary's guild, if any
7854 4 - Mercenary calls value for this mercenary's guild, if any
7855 5 - Mercenary kill count
7856 6 - Mercenary remaining life time in msec
7857 7 - Mercenary level
7858
7859If the character does not have a mercenary, the command returns ""
7860for name and 0 for all other types.
7861
7862---------------------------------------
7863
7864* npc_disabled("NPCå");
7865
7866返回 &1: ç¦ç”¨ï¼Œ &2 GM隱身效果, &4 隱匿效果。
7867
7868---------------------------------------
7869
7870* isequippable(é“å…·ID, è·æ¥ID)
7871
7872返回1å¯ä»¥è£å‚™ï¼Œ0無法è£å‚™
7873
7874---------------------------------------
7875
7876çµæŸã€‚