diff --git a/doc/atcommands.txt b/doc/atcommands.txt index 789795ed62..8268a53970 100644 --- a/doc/atcommands.txt +++ b/doc/atcommands.txt @@ -55,7 +55,7 @@ Other Drop Rates: MvP 1.00x / Card-Based 1.00x / Treasure 1.00x @time Displays the local server time, along with day/night information. - + --------------------------------------- @uptime @@ -279,13 +279,13 @@ Map Name: prontera | Players In Map: 1 | NPCs In Map: 127 | Chats In Map: 0 ------ Map Flags ------ Town Map Autotrade Enabled -PvP Flags: -GvG Flags: -Teleport Flags: +PvP Flags: +GvG Flags: +Teleport Flags: No Exp Penalty: On | No Zeny Penalty: On -Weather Flags: Displays Night | -Other Flags: NoBranch | Reset | -Other Flags: +Weather Flags: Displays Night | +Other Flags: NoBranch | Reset | +Other Flags: --------------------------------------- @@ -293,7 +293,7 @@ Other Flags: Gives information about terrain/area (debug function). -Output Example: +Output Example: prontera (x= 165, y= 202) 00 00 00 00 00 prontera (x= 165, y= 201) 01 00 00 00 00 prontera (x= 165, y= 200) 01 00 00 00 00 @@ -327,7 +327,7 @@ DEF:2 MDEF:5 STR:6 AGI:1 VIT:1 INT:1 DEX:6 LUK:5 ATK:8~9 Range:1~10~12 Size:Medium Race:Plant Element:Water (Lv:1) Drops: - Jellopy 70.00% - Knife[4] 1.00% etc... - + --------------------------------------- @iteminfo @@ -347,7 +347,7 @@ NPC Buy:6z, Sell:3z | Weight: 1.0 @whodrops Displays a list of mobs which drop the specified item. -Only the highest drop rates are shown. +Only the highest drop rates are shown. --------------------------------------- @@ -582,7 +582,7 @@ Displays the text as a normal message with the format "*name *" instead @storage Opens your Kafra storage. - + --------------------------------------- @mail @@ -1295,7 +1295,7 @@ Blocks or unblocks a player from logging in indefinitely. @charban <+/- time> @charunban -Bans or unbans a player for a limited time. +Bans or unbans a player for a limited time. (Very similar to @ban and but for 1 character only) Time elements: y/a, m, d/j, h, mn, s @@ -1442,7 +1442,7 @@ Example: @party Organizes a new party, with the attached character as leader. - + --------------------------------------- @partyoption @@ -1519,7 +1519,7 @@ Changes guild level by the specified amount. @undisguiseguild Disguises or undisguises all online characters of a guild. - + --------------------------------------- @sizeguild @@ -1536,7 +1536,7 @@ Warps all online characters of a guild to your location. @guildspy -Allows you to spy on any guild's Guild Chat. +Allows you to spy on any guild's Guild Chat. At least one member of that guild must be online. NOTE: map server needs to be configured to enable spying to use this command (enable_spy: yes) diff --git a/doc/effect_list.txt b/doc/effect_list.txt index 27e9f6b0b1..1aa13c02d9 100644 --- a/doc/effect_list.txt +++ b/doc/effect_list.txt @@ -277,7 +277,7 @@ Number Description 258. Elemental Endow (Earth) 259. Map Light Pillar Animation 3 260. Map Light Pillar Animation 4 -261. Fury Cast Animation +261. Fury Cast Animation 262. Raging Quadruple Blow 263. Raging Quadruple Blow 2 264. (Nothing) diff --git a/doc/item_bonus.txt b/doc/item_bonus.txt index 24b4adf5a5..52e1d338fd 100644 --- a/doc/item_bonus.txt +++ b/doc/item_bonus.txt @@ -38,12 +38,12 @@ This list contains all available constants referenced in the 'bonus' commands. BF_SHORT = Trigger on melee attacks BF_LONG = Trigger on ranged attacks (Default: BF_SHORT+BF_LONG) - - BF_WEAPON = Trigger on weapon skills - BF_MAGIC = Trigger on magic skills + + BF_WEAPON = Trigger on weapon skills + BF_MAGIC = Trigger on magic skills BF_MISC = Trigger on misc skills (Default: BF_WEAPON) - + BF_NORMAL = Trigger on normal attacks BF_SKILL = Trigger on skills (Default: BF_SKILL if type is BF_MISC or BF_MAGIC, BF_NORMAL if type is BF_WEAPON) @@ -52,11 +52,11 @@ This list contains all available constants referenced in the 'bonus' commands. Effect target: (Default: Attacked target) ATF_SELF = Trigger effect on self ATF_TARGET = Trigger effect on target - + Attack range criteria: (Default: All attacks) ATF_SHORT = Trigger on melee attacks ATF_LONG = Trigger on ranged attacks - + Skill/attack type criteria: (Default: Physical/weapon) ATF_WEAPON = Trigger on weapon skill / physical attacks ATF_MAGIC = Trigger on magic skills @@ -99,7 +99,7 @@ bonus bAgiDexStr,n; STR + n, AGI + n, DEX + n HP/SP ----- bonus bMaxHP,n; MaxHP + n -bonus bMaxHPrate,n; MaxHP + n% +bonus bMaxHPrate,n; MaxHP + n% bonus bMaxSP,n; MaxSP + n bonus bMaxSPrate,n; MaxSP + n% diff --git a/doc/item_db.txt b/doc/item_db.txt index d79332efb8..4df2b123c4 100644 --- a/doc/item_db.txt +++ b/doc/item_db.txt @@ -23,7 +23,7 @@ Name: Name in English for displaying as output for @ and script commands. --------------------------------------- -Type: +Type: 0 Healing item. 2 Usable item. 3 Etc item diff --git a/doc/map_cache.txt b/doc/map_cache.txt index b7260a6aea..06d18c4428 100644 --- a/doc/map_cache.txt +++ b/doc/map_cache.txt @@ -5,7 +5,7 @@ //===== Last Updated: ======================================== //= 20070724 //===== Description: ========================================= -//= A complete manual for rAthena's map cache generator as +//= A complete manual for rAthena's map cache generator as //= well as a reference on the map cache format used. //============================================================ diff --git a/doc/mapflags.txt b/doc/mapflags.txt index 719ce79cab..125ddd6205 100644 --- a/doc/mapflags.txt +++ b/doc/mapflags.txt @@ -119,7 +119,7 @@ is disabled in '/conf/battle/items.conf'. Disables normal monsters and MVPs from dropping items on a map. Looted items will always drop. 'noloot' is the same as 'nomobloot' and 'nomvploot' combined. - + --------------------------------------- *noexp diff --git a/doc/mob_db_mode_list.txt b/doc/mob_db_mode_list.txt index 8681de00bc..e3203403e6 100644 --- a/doc/mob_db_mode_list.txt +++ b/doc/mob_db_mode_list.txt @@ -83,7 +83,7 @@ Change Target Melee: Enables a mob to switch targets when hit by a normal attack Change Target Chase: Enables a mob to switch targets when hit by any attack while chasing another character. -Target Weak: Allows aggressive monsters to only be aggressive against +Target Weak: Allows aggressive monsters to only be aggressive against characters that are five levels below it's own level. For example, a monster of level 104 will not pick fights with a level 99. @@ -162,7 +162,7 @@ Aegis/rA Aegis Attr Types ------------------------------------------------------------------------------- -The Aegis attr types are a bitmask just like the rA mode bits and can be +The Aegis attr types are a bitmask just like the rA mode bits and can be directly converted. Plant mode is a combination of various of these modes. Add the mode listed here to the resulting mode above. diff --git a/doc/mob_skill_db_powerskill.txt b/doc/mob_skill_db_powerskill.txt index f2fd6765a1..d814afdece 100644 --- a/doc/mob_skill_db_powerskill.txt +++ b/doc/mob_skill_db_powerskill.txt @@ -8,7 +8,7 @@ //= Reference for monster level 10 skills. //============================================================ -When a monster uses a level 10 skill on Aegis, it will be much stronger than the +When a monster uses a level 10 skill on Aegis, it will be much stronger than the normal player version. On rAthena we reflect this by giving the monster a skill level above the maximum player level. The following lists explains the skill specialities and the corresponding level diff --git a/doc/packet_interserv.txt b/doc/packet_interserv.txt index ed698e5f82..6ae58ce9da 100644 --- a/doc/packet_interserv.txt +++ b/doc/packet_interserv.txt @@ -142,7 +142,7 @@ Currently the max packet size is 0xFFFF (see 'WFIFOSET()' in 'src/common/socket. - u_group : - account_id : desc: - - + - 0x2721: Type: AH diff --git a/doc/permissions.txt b/doc/permissions.txt index 7350517d87..fa0b8d354b 100644 --- a/doc/permissions.txt +++ b/doc/permissions.txt @@ -110,7 +110,7 @@ Allows player to do normal item actions with bounded items (drop, sell, trade, etc.). --------------------------------------- - + *item_unconditional Allows player to consume any consumable item regardless the requirements diff --git a/doc/quest_variables.txt b/doc/quest_variables.txt index 3fed5643f3..06c50f35a0 100644 --- a/doc/quest_variables.txt +++ b/doc/quest_variables.txt @@ -5,8 +5,8 @@ //===== Last Updated: ======================================== //= 20120826 //===== Description: ========================================= -//= This file should help to understand and manage bit-wise -//= quest variables. You can store up to 31 boolean value into +//= This file should help to understand and manage bit-wise +//= quest variables. You can store up to 31 boolean value into //= a single variable. //============================================================ diff --git a/doc/sample/bank_test.txt b/doc/sample/bank_test.txt index 5ad56a29d5..cb72571b35 100644 --- a/doc/sample/bank_test.txt +++ b/doc/sample/bank_test.txt @@ -4,7 +4,7 @@ //= rAthena Dev Team //===== Last Updated: ======================================== //= 20140208 -//===== Description: ========================================= +//===== Description: ========================================= //= Contains commands needed for a basic bank. //============================================================ diff --git a/doc/sample/basejob_baseclass_upper.txt b/doc/sample/basejob_baseclass_upper.txt index a5d6ae5d1e..f3004a9539 100644 --- a/doc/sample/basejob_baseclass_upper.txt +++ b/doc/sample/basejob_baseclass_upper.txt @@ -4,7 +4,7 @@ //= rAthena Dev Team //===== Last Updated: ======================================== //= 20110123 -//===== Description: ========================================= +//===== Description: ========================================= //= Outputs the values of class constants. //============================================================ diff --git a/doc/sample/checkoption.txt b/doc/sample/checkoption.txt index a10a357373..206487759f 100644 --- a/doc/sample/checkoption.txt +++ b/doc/sample/checkoption.txt @@ -4,7 +4,7 @@ //= rAthena Dev Team //===== Last Updated: ======================================== //= 20140208 -//===== Description: ========================================= +//===== Description: ========================================= //= Demonstrates the 'checkoption' command. //============================================================ diff --git a/doc/sample/delitem2.txt b/doc/sample/delitem2.txt index e7ad7a3ebd..1002bf5ff6 100644 --- a/doc/sample/delitem2.txt +++ b/doc/sample/delitem2.txt @@ -4,7 +4,7 @@ //= rAthena Dev Team //===== Last Updated: ======================================== //= 20140208 -//===== Description: ========================================= +//===== Description: ========================================= //= Demonstrates the 'delitem2' command. //============================================================ diff --git a/doc/sample/getequipcardid.txt b/doc/sample/getequipcardid.txt index 77728090c2..5df6a0a8e1 100644 --- a/doc/sample/getequipcardid.txt +++ b/doc/sample/getequipcardid.txt @@ -4,7 +4,7 @@ //= Lupus //===== Last Updated: ======================================== //= 20140208 -//===== Description: ========================================= +//===== Description: ========================================= //= Demonstrates the 'getequipcardid' command. //============================================================ diff --git a/doc/sample/getequipid.txt b/doc/sample/getequipid.txt index d38183032c..c4333ac318 100644 --- a/doc/sample/getequipid.txt +++ b/doc/sample/getequipid.txt @@ -4,7 +4,7 @@ //= rAthena Dev Team //===== Last Updated: ======================================== //= 20140208 -//===== Description: ========================================= +//===== Description: ========================================= //= Demonstrates the 'getequipid' command. //============================================================ diff --git a/doc/sample/getiteminfo.txt b/doc/sample/getiteminfo.txt index ad8d841aa4..a88b8eaeb7 100644 --- a/doc/sample/getiteminfo.txt +++ b/doc/sample/getiteminfo.txt @@ -4,7 +4,7 @@ //= Lupus //===== Last Updated: ======================================== //= 20140208 -//===== Description: ========================================= +//===== Description: ========================================= //= Demonstrates the 'getiteminfo' command. //============================================================ diff --git a/doc/sample/getmonsterinfo.txt b/doc/sample/getmonsterinfo.txt index 9687a0d8fe..ebb7bb3676 100644 --- a/doc/sample/getmonsterinfo.txt +++ b/doc/sample/getmonsterinfo.txt @@ -4,7 +4,7 @@ //= Lupus //===== Last Updated: ======================================== //= 20140208 -//===== Description: ========================================= +//===== Description: ========================================= //= Demonstrates the 'getmonsterinfo' command. //============================================================ diff --git a/doc/sample/gstorage_test.txt b/doc/sample/gstorage_test.txt index 850ae0d9ac..979e8053c0 100644 --- a/doc/sample/gstorage_test.txt +++ b/doc/sample/gstorage_test.txt @@ -4,7 +4,7 @@ //= rAthena Dev Team //===== Last Updated: ======================================== //= 20140208 -//===== Description: ========================================= +//===== Description: ========================================= //= Contains commands needed for a guild warehouse NPC. //============================================================ @@ -12,7 +12,7 @@ prontera,165,188,4 script Guild Warehouse 112,{ cutin "kafra_06",2; mes "[Guild Warehouse Coupler]"; - mes "This is the guild warehouse coupler service."; + mes "This is the guild warehouse coupler service."; mes "You will not receive zeny for this is a test."; next; if (select("Access Guild Warehouse","Exit") != 1) { diff --git a/doc/sample/instancing.txt b/doc/sample/instancing.txt index 5e175d87ee..5f6292c0c4 100644 --- a/doc/sample/instancing.txt +++ b/doc/sample/instancing.txt @@ -4,7 +4,7 @@ //= Euphy //===== Last Updated: ======================================== //= 20140129 -//===== Description: ========================================= +//===== Description: ========================================= //= Contains elements of a basic instance script. //============================================================ diff --git a/doc/sample/localized_npc.txt b/doc/sample/localized_npc.txt index d223e06b33..bbcaef91e6 100644 --- a/doc/sample/localized_npc.txt +++ b/doc/sample/localized_npc.txt @@ -1,23 +1,23 @@ -//===== rAthena Script ======================================= +//===== rAthena Script ======================================= //= Sample: Localized NPC -//===== By: ================================================== +//===== By: ================================================== //= rAthena Dev Team //===== Last Updated: ======================================== //= 20140208 -//===== Description: ========================================= +//===== Description: ========================================= //= Example of a localized NPC. -//= +//= //= There are many ways to do it, this is just one option. -//= The player has a global account variable ##_langid_ that +//= The player has a global account variable ##_langid_ that //= identifies the it's language. -//= +//= //= The default language should always have langid 0. -//= When a message isn't found for the player's langid +//= When a message isn't found for the player's langid //= (strlen = 0), the message from langid 0 is used instead. -//= -//= Each message is identified by a string that must only +//= +//= Each message is identified by a string that must only //= contain valid variable name characters. -//= +//= //= void setlang(int langid) //= - sets the player's language //= int getlang(void) @@ -28,10 +28,10 @@ //= - returns the localized text of name //= void mes2(string name) //= - displays the localized text of name -//= -//===== Additional Comments: ================================= +//= +//===== Additional Comments: ================================= //= To use this globally, just put the functions in Global_Functions.txt -//============================================================ +//============================================================ ////////////////////////////////////////////////////////////// /// Sets the language of the player account. @@ -85,7 +85,7 @@ function script getmes2 { ////////////////////////////////////////////////////////////// /// mes for localized text. -/// index should be a unique string, made up only of characters +/// index should be a unique string, made up only of characters /// that are valis as a variable name /// @param index Message identifier function script mes2 { diff --git a/doc/sample/navigate.txt b/doc/sample/navigate.txt index c0e373fbb4..8c004e5fe4 100644 --- a/doc/sample/navigate.txt +++ b/doc/sample/navigate.txt @@ -4,7 +4,7 @@ //= rAthena Dev Team //===== Last Updated: ======================================== //= 20160306 -//===== Description: ========================================= +//===== Description: ========================================= //= Shows how to use the navigateto command. //= //= NOTE: diff --git a/doc/sample/npc_dynamic_shop.txt b/doc/sample/npc_dynamic_shop.txt index b746f91d04..5d047bc283 100644 --- a/doc/sample/npc_dynamic_shop.txt +++ b/doc/sample/npc_dynamic_shop.txt @@ -4,7 +4,7 @@ //= Lance //===== Last Updated: ======================================== //= 20140208 -//===== Description: ========================================= +//===== Description: ========================================= //= Contains commands needed for a dynamic shop. //============================================================ diff --git a/doc/sample/npc_extend_shop.txt b/doc/sample/npc_extend_shop.txt index cc441e1c66..a53a30a312 100644 --- a/doc/sample/npc_extend_shop.txt +++ b/doc/sample/npc_extend_shop.txt @@ -4,7 +4,7 @@ //= rAthena Dev Team //===== Last Updated: ======================================== //= 20121003 -//===== Description: ========================================= +//===== Description: ========================================= //= An example of shop NPCs. //============================================================ diff --git a/doc/sample/npc_live_dialogues.txt b/doc/sample/npc_live_dialogues.txt index 56941558f4..9b1563785e 100644 --- a/doc/sample/npc_live_dialogues.txt +++ b/doc/sample/npc_live_dialogues.txt @@ -4,7 +4,7 @@ //= Lupus //===== Last Updated: ======================================== //= 20140208 -//===== Description: ========================================= +//===== Description: ========================================= //= An example of an NPC with live dialogue. //= Note: This relies on Global_Functions.txt to run. //============================================================ diff --git a/doc/sample/npc_shop_test.txt b/doc/sample/npc_shop_test.txt index 6d2585e837..4bc8705c7d 100644 --- a/doc/sample/npc_shop_test.txt +++ b/doc/sample/npc_shop_test.txt @@ -4,7 +4,7 @@ //= rAthena Dev Team //===== Last Updated: ======================================== //= 20090206 -//===== Description: ========================================= +//===== Description: ========================================= //= An example of shop NPCs. //============================================================ diff --git a/doc/sample/npc_test_array.txt b/doc/sample/npc_test_array.txt index 68d216c06b..960413edbd 100644 --- a/doc/sample/npc_test_array.txt +++ b/doc/sample/npc_test_array.txt @@ -4,7 +4,7 @@ //= rAthena Dev Team //===== Last Updated: ======================================== //= 20090206 -//===== Description: ========================================= +//===== Description: ========================================= //= Demonstrates array commands. //============================================================ diff --git a/doc/sample/npc_test_chat.txt b/doc/sample/npc_test_chat.txt index 88e45e48c7..6324f6e986 100644 --- a/doc/sample/npc_test_chat.txt +++ b/doc/sample/npc_test_chat.txt @@ -4,7 +4,7 @@ //= rAthena Dev Team //===== Last Updated: ======================================== //= 20121003 -//===== Description: ========================================= +//===== Description: ========================================= //= Demonstrates waitingroom commands. //============================================================ diff --git a/doc/sample/npc_test_duplicate.txt b/doc/sample/npc_test_duplicate.txt index 983450430d..1faee88a96 100644 --- a/doc/sample/npc_test_duplicate.txt +++ b/doc/sample/npc_test_duplicate.txt @@ -4,7 +4,7 @@ //= rAthena Dev Team //===== Last Updated: ======================================== //= 20070915 -//===== Description: ========================================= +//===== Description: ========================================= //= An example of how duplicate NPCs are handled: //= NPC variables are shared between all duplicates. //= Each duplicate knows its own map coordinates. diff --git a/doc/sample/npc_test_func.txt b/doc/sample/npc_test_func.txt index a438e4650b..66d18d3ce3 100644 --- a/doc/sample/npc_test_func.txt +++ b/doc/sample/npc_test_func.txt @@ -4,7 +4,7 @@ //= rAthena Dev Team //===== Last Updated: ======================================== //= 20120901 -//===== Description: ========================================= +//===== Description: ========================================= //= Demonstrates use of functions. //============================================================ diff --git a/doc/sample/npc_test_npctimer.txt b/doc/sample/npc_test_npctimer.txt index 5db9271c32..7c126162ee 100644 --- a/doc/sample/npc_test_npctimer.txt +++ b/doc/sample/npc_test_npctimer.txt @@ -4,7 +4,7 @@ //= rAthena Dev Team //===== Last Updated: ======================================== //= 20121003 -//===== Description: ========================================= +//===== Description: ========================================= //= Demonstrates NPC timer commands. //============================================================ diff --git a/doc/sample/npc_test_npctimer2.txt b/doc/sample/npc_test_npctimer2.txt index a82fa74c0b..5b5c89ad44 100644 --- a/doc/sample/npc_test_npctimer2.txt +++ b/doc/sample/npc_test_npctimer2.txt @@ -4,7 +4,7 @@ //= rAthena Dev Team //===== Last Updated: ======================================== //= 20121003 -//===== Description: ========================================= +//===== Description: ========================================= //= Demonstrates attached NPC timer commands. //============================================================ diff --git a/doc/sample/npc_test_pcre.txt b/doc/sample/npc_test_pcre.txt index 247464c0f3..668c5dcb18 100644 --- a/doc/sample/npc_test_pcre.txt +++ b/doc/sample/npc_test_pcre.txt @@ -4,7 +4,7 @@ //= MouseJstr //===== Last Updated: ======================================== //= 20100108 -//===== Description: ========================================= +//===== Description: ========================================= //= Demonstrates PCRE commands. //============================================================ @@ -121,7 +121,7 @@ Lquote12: } end; -// I am glad +// I am glad Lquote13: switch(rand(3)) { case 0: npctalk "How have I helped you to be "+$@p2$+""; break; @@ -130,7 +130,7 @@ Lquote13: } end; -// I am sad +// I am sad Lquote14: switch(rand(2)) { case 0: npctalk "I am sorry to hear you are depressed"; break; @@ -161,7 +161,7 @@ Lquote17: } end; -// same +// same Lquote18: npctalk "What other connections do you see?"; end; @@ -219,7 +219,7 @@ Lquote24: } end; -// you are +// you are Lquote25: npctalk "What makes you think I am "+$@p2$+" ?"; end; @@ -233,7 +233,7 @@ Lquote26: } end; -// were you +// were you Lquote27: switch(rand(3)) { case 0: npctalk "Perhaps I was "+$@p2$+""; break; @@ -242,7 +242,7 @@ Lquote27: } end; -// I can't +// I can't Lquote28: switch(rand(2)) { case 0: npctalk "Maybe you could "+$@p3$+" now"; break; @@ -250,7 +250,7 @@ Lquote28: } end; -// I feel +// I feel Lquote29: npctalk "Do you often feel "+$@p2$+" ?"; end; @@ -265,7 +265,7 @@ Lquote31: npctalk "Perhaps in your fantasy we "+$@p3$+" each other?"; end; -// why don't you +// why don't you Lquote32: switch(rand(3)) { case 0: npctalk "Should you "+$@p3$+" yourself?"; break; @@ -274,7 +274,7 @@ Lquote32: } end; -// yes +// yes Lquote33: switch(rand(3)) { case 0: npctalk "You seem quite positive"; break; @@ -297,7 +297,7 @@ Lquote35: npctalk "Can you be more specific?"; end; -// everyone +// everyone Lquote36: switch(rand(4)) { case 0: npctalk "surely not everyone"; break; @@ -307,7 +307,7 @@ Lquote36: } end; -// always +// always Lquote37: switch(rand(4)) { case 0: npctalk "Can you think of a specific example?"; break; @@ -328,7 +328,7 @@ Lquote38: } end; -// perhaps +// perhaps Lquote39: npctalk "You do not seem quite certain"; end; diff --git a/doc/sample/npc_test_quest.txt b/doc/sample/npc_test_quest.txt index de91d4d805..eac17c5c5b 100644 --- a/doc/sample/npc_test_quest.txt +++ b/doc/sample/npc_test_quest.txt @@ -4,7 +4,7 @@ //= Akkarin //===== Last Updated: ======================================== //= 20121227 -//===== Description: ========================================= +//===== Description: ========================================= //= Demonstrates quest commands. //============================================================ diff --git a/doc/sample/npc_test_setitemx.txt b/doc/sample/npc_test_setitemx.txt index 4842aedf50..f10c36abcf 100644 --- a/doc/sample/npc_test_setitemx.txt +++ b/doc/sample/npc_test_setitemx.txt @@ -4,7 +4,7 @@ //= Lupus //===== Last Updated: ======================================== //= 20140208 -//===== Description: ========================================= +//===== Description: ========================================= //= Demonstrates 'setiteminfo' and 'setitemscript' commands. //============================================================ diff --git a/doc/sample/npc_test_setmapflag.txt b/doc/sample/npc_test_setmapflag.txt index 68778cb34a..88cf2f5502 100644 --- a/doc/sample/npc_test_setmapflag.txt +++ b/doc/sample/npc_test_setmapflag.txt @@ -4,7 +4,7 @@ //= Jbain //===== Last Updated: ======================================== //= 20140208 -//===== Description: ========================================= +//===== Description: ========================================= //= Demonstrates mapflag commands. //============================================================ diff --git a/doc/sample/npc_test_skill.txt b/doc/sample/npc_test_skill.txt index 142061901c..3ec85675ed 100644 --- a/doc/sample/npc_test_skill.txt +++ b/doc/sample/npc_test_skill.txt @@ -4,7 +4,7 @@ //= rAthena Dev Team //===== Last Updated: ======================================== //= 20140208 -//===== Description: ========================================= +//===== Description: ========================================= //= Demonstrates the 'skill' command. //============================================================ diff --git a/doc/sample/npc_test_time.txt b/doc/sample/npc_test_time.txt index 1c7ecff6d5..9a77827edc 100644 --- a/doc/sample/npc_test_time.txt +++ b/doc/sample/npc_test_time.txt @@ -4,7 +4,7 @@ //= rAthena Dev Team //===== Last Updated: ======================================== //= 20070315 -//===== Description: ========================================= +//===== Description: ========================================= //= Demonstrates time commands. //============================================================ diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 5a5732a87d..f99acd4837 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -9,21 +9,21 @@ //= Commands are sorted depending on their functionality. //============================================================ -This document is a reference manual for all the scripting commands and functions +This document is a reference manual for all the scripting commands and functions available in rAthena. It is not a simple tutorial. When people tell you to "Read The F***ing Manual", they mean this. -The information was mostly acquired through looking up how things actually work -in the source code of the server, which was written by many people over time, -and lots of them don't speak English and never left any notes - or are otherwise -not available for comments. As such, anything written in here might not be +The information was mostly acquired through looking up how things actually work +in the source code of the server, which was written by many people over time, +and lots of them don't speak English and never left any notes - or are otherwise +not available for comments. As such, anything written in here might not be correct, it is only correct to the best of our knowledge, which is limited. -This is not a place to teach you basic programming. This document will not teach -you basic programming by itself. It's more of a reference for those who have at -least a vague idea of what they want to do and want to know what tools they have -available to do it. We've tried to keep it as simple as feasible, but if you -don't understand it, getting a clear book on programming in general will help +This is not a place to teach you basic programming. This document will not teach +you basic programming by itself. It's more of a reference for those who have at +least a vague idea of what they want to do and want to know what tools they have +available to do it. We've tried to keep it as simple as feasible, but if you +don't understand it, getting a clear book on programming in general will help better than yelling around the forum for help. A little learning never caused anyone's head to explode. @@ -37,11 +37,11 @@ The commands and functions are listed in no particular order: Descriptive text - Small example if possible. Will usually be incomplete, it's there just to + Small example if possible. Will usually be incomplete, it's there just to give you an idea of how it works in practice. -To find a specific command, use Ctrl+F, (or whatever keys call up a search -function in whatever you're reading this with) put an * followed by the command +To find a specific command, use Ctrl+F, (or whatever keys call up a search +function in whatever you're reading this with) put an * followed by the command name, and it should find the command description for you. If you find anything omitted, please respond. :) @@ -49,80 +49,80 @@ If you find anything omitted, please respond. :) Syntax ------ -Throughout this document, wherever a command wants an argument, it is given in -. This doesn't mean you should type the angle brackets. :) If an -argument of a command is optional, it is given in {curly brackets}. You've -doubtlessly seen this convention somewhere, if you didn't, get used to it, -that's how big boys do it. If a command can optionally take an unspecified +Throughout this document, wherever a command wants an argument, it is given in +. This doesn't mean you should type the angle brackets. :) If an +argument of a command is optional, it is given in {curly brackets}. You've +doubtlessly seen this convention somewhere, if you didn't, get used to it, +that's how big boys do it. If a command can optionally take an unspecified number of arguments, you'll see a list like this: command {,...} This still means they will want to be separated by commas. -Where a command wants a string, it will be given in "quotes", if it's a number, -it will be given without them. Normally, you can put an expression, like a bunch -of functions or operators returning a value, in (round brackets) instead of most -numbers. Round brackets will not always be required, but they're often a good +Where a command wants a string, it will be given in "quotes", if it's a number, +it will be given without them. Normally, you can put an expression, like a bunch +of functions or operators returning a value, in (round brackets) instead of most +numbers. Round brackets will not always be required, but they're often a good idea. Wherever you refer to a map name, it's always 'map name' or 'map name.gat' -(although the .gat suffix is deprecated). +(although the .gat suffix is deprecated). Script loading structure ------------------------ -Scripts are loaded by the map server as referenced in the 'conf/map_athena.conf' -configuration file, but in the default configuration, it doesn't load any script -files itself. Instead, it loads the file 'npc/scripts_main.conf' which itself -contains references to other files. The actual scripts are loaded from txt +Scripts are loaded by the map server as referenced in the 'conf/map_athena.conf' +configuration file, but in the default configuration, it doesn't load any script +files itself. Instead, it loads the file 'npc/scripts_main.conf' which itself +contains references to other files. The actual scripts are loaded from txt files, which are linked up like this: npc: -Any line like this, invoked, ultimately, by 'map_athena.conf' will load up the -script contained in this file, which will make the script available. No file +Any line like this, invoked, ultimately, by 'map_athena.conf' will load up the +script contained in this file, which will make the script available. No file will get loaded twice, to prevent possible errors. Another configuration file option of relevance is: delnpc: -This will unload a specified script filename from memory, which, while +This will unload a specified script filename from memory, which, while seemingly useless, may sometimes be required. -Whenever '//' is encountered in a line upon reading, everything beyond this on -that line is considered to be a comment and is ignored. This works wherever you +Whenever '//' is encountered in a line upon reading, everything beyond this on +that line is considered to be a comment and is ignored. This works wherever you place it. // This line will be ignored when processing the script. -Block comments can also be used, where you can place /* and */ between any text you +Block comments can also be used, where you can place /* and */ between any text you wish rAthena to ignore. Example: /* This text, * no matter which new line you start - * is ignored, until the following + * is ignored, until the following * symbol is encountered: */ - + The asterisks (*) in front of each line is a personal preference, and is not required. -Upon loading all the files, the server will execute all the top-level commands -in them. No variables exist yet at this point, no commands can be called other -than those given in this section. These commands set up the basic server script -structure - create NPC objects, spawn monster objects, set map flags, etc. No -code is actually executed at this point except them. The top-level commands the -scripting are pretty confusing, since they aren't structured like you would +Upon loading all the files, the server will execute all the top-level commands +in them. No variables exist yet at this point, no commands can be called other +than those given in this section. These commands set up the basic server script +structure - create NPC objects, spawn monster objects, set map flags, etc. No +code is actually executed at this point except them. The top-level commands the +scripting are pretty confusing, since they aren't structured like you would expect commands, command name first, but rather, normally start with a map name. -What's more confusing about the top-level commands is that most of them use a +What's more confusing about the top-level commands is that most of them use a tab symbol to divide their arguments. -To prevent problems and confusion, the tab symbols are written as '%TAB%' -throughout this document, even though this makes the text a bit less readable. -Using an invisible symbol to denote arguments is one of the bad things about +To prevent problems and confusion, the tab symbols are written as '%TAB%' +throughout this document, even though this makes the text a bit less readable. +Using an invisible symbol to denote arguments is one of the bad things about this language, but we're stuck with it for now. :) Here is a list of valid top-level commands: @@ -131,9 +131,9 @@ Here is a list of valid top-level commands: %TAB%mapflag%TAB% -This will, upon loading, set a specified map flag on a map you like. These are -normally in files inside 'npc/mapflag' and are loaded first, so by the time the -server's up, all the maps have the flags they should have. Map flags determine +This will, upon loading, set a specified map flag on a map you like. These are +normally in files inside 'npc/mapflag' and are loaded first, so by the time the +server's up, all the maps have the flags they should have. Map flags determine the behavior of the map in various situations. For more details, see 'setmapflag' and 'doc/mapflags.txt'. @@ -148,15 +148,15 @@ Putting zeros instead of these coordinates will spawn the monsters randomly. Note this is only the initial spawn zone, as mobs random-walk, they are free to move away from their specified spawn region. -Monster name is the name the monsters will have on screen, and has no relation -whatsoever to their names anywhere else. It's the mob id that counts, which -identifies monster record in 'mob_db.txt' database of monsters. If the mob name -is given as "--ja--", the 'japanese name' field from the monster database is -used, (which, in rAthena, actually contains an English name) if it's "--en--", -it's the 'english name' from the monster database (which contains an uppercase +Monster name is the name the monsters will have on screen, and has no relation +whatsoever to their names anywhere else. It's the mob id that counts, which +identifies monster record in 'mob_db.txt' database of monsters. If the mob name +is given as "--ja--", the 'japanese name' field from the monster database is +used, (which, in rAthena, actually contains an English name) if it's "--en--", +it's the 'english name' from the monster database (which contains an uppercase name used to summon the monster with a GM command). -Amount is the amount of monsters that will be spawned when this command is +Amount is the amount of monsters that will be spawned when this command is executed, it is affected by spawn rates in 'battle_athena.conf'. Delay1 and delay2 control monster respawn delays - the first one is the fixed @@ -204,18 +204,18 @@ ex: if your NPC is named 'Hunter#hunter1', it will be displayed as 'Hunter' ,,,%TAB%warp%TAB%%TAB%,,,, -This will define a warp NPC that will warp a player between maps, and while most +This will define a warp NPC that will warp a player between maps, and while most arguments of that are obvious, some deserve special mention. -SpanX and SpanY will make the warp sensitive to a character who didn't step -directly on it, but walked into a zone which is centered on the warp from -coordinates and is SpanX in each direction across the X axis and SpanY in each +SpanX and SpanY will make the warp sensitive to a character who didn't step +directly on it, but walked into a zone which is centered on the warp from +coordinates and is SpanX in each direction across the X axis and SpanY in each direction across the Y axis. -Warp NPC objects also have a name, because you can use it to refer to them later -with 'enablenpc'/'disablenpc' +Warp NPC objects also have a name, because you can use it to refer to them later +with 'enablenpc'/'disablenpc' -Facing of a warp object is irrelevant, it is not used in the code and all +Facing of a warp object is irrelevant, it is not used in the code and all current scripts have a zero in there. ** Define an NPC object. @@ -223,49 +223,49 @@ current scripts have a zero in there. ,,,%TAB%script%TAB%%TAB%,{} ,,,%TAB%script%TAB%%TAB%,,,{} -This will place an NPC object on a specified map at the specified location, and -is a top-level command you will use the most in your custom scripting. The NPCs -are triggered by clicking on them, and/or by walking in their trigger area, if +This will place an NPC object on a specified map at the specified location, and +is a top-level command you will use the most in your custom scripting. The NPCs +are triggered by clicking on them, and/or by walking in their trigger area, if defined, see that below. -Facing is a direction the NPC sprite will face in. Not all NPC sprites have -different images depending on the direction you look from, so for some facing -will be meaningless. Facings are counted counterclockwise in increments of 45 -degrees, where 0 means facing towards the top of the map. (So to turn the sprite -towards the bottom of the map, you use facing 4, and to make it look southeast +Facing is a direction the NPC sprite will face in. Not all NPC sprites have +different images depending on the direction you look from, so for some facing +will be meaningless. Facings are counted counterclockwise in increments of 45 +degrees, where 0 means facing towards the top of the map. (So to turn the sprite +towards the bottom of the map, you use facing 4, and to make it look southeast it's facing 5.) -Sprite id is the sprite number used to display this particular NPC. For a full -list of sprite id numbers see http://kalen.s79.xrea.com/npc/npce.shtml You may -also use a monster's ID number instead to display a monster sprite for this NPC. -It is possible to use a job sprite as well, but you must first define it as a -monster sprite in 'mob_avail.txt', a full description on how to do this is not +Sprite id is the sprite number used to display this particular NPC. For a full +list of sprite id numbers see http://kalen.s79.xrea.com/npc/npce.shtml You may +also use a monster's ID number instead to display a monster sprite for this NPC. +It is possible to use a job sprite as well, but you must first define it as a +monster sprite in 'mob_avail.txt', a full description on how to do this is not in the scope of this manual. -A '-1' sprite id will make the NPC invisible (and unclickable). -A '111' sprite id will make an NPC which does not have a sprite, but is still -clickable, which is useful if you want to make a clickable object of the 3D +A '-1' sprite id will make the NPC invisible (and unclickable). +A '111' sprite id will make an NPC which does not have a sprite, but is still +clickable, which is useful if you want to make a clickable object of the 3D terrain. -TriggerX and triggerY, if given, will define an area, centered on NPC and -spanning triggerX cells in every direction across X and triggerY in every -direction across Y. Walking into that area will trigger the NPC. If no -'OnTouch:' special label is present in the NPC code, the execution will start -from the beginning of the script, otherwise, it will start from the 'OnTouch:' -label. Monsters can also trigger the NPC, though the label 'OnTouchNPC:' is +TriggerX and triggerY, if given, will define an area, centered on NPC and +spanning triggerX cells in every direction across X and triggerY in every +direction across Y. Walking into that area will trigger the NPC. If no +'OnTouch:' special label is present in the NPC code, the execution will start +from the beginning of the script, otherwise, it will start from the 'OnTouch:' +label. Monsters can also trigger the NPC, though the label 'OnTouchNPC:' is used in this case. -The code part is the script code that will execute whenever the NPC is -triggered. It may contain commands and function calls, descriptions of which -compose most of this document. It has to be in curly brackets, unlike elsewhere +The code part is the script code that will execute whenever the NPC is +triggered. It may contain commands and function calls, descriptions of which +compose most of this document. It has to be in curly brackets, unlike elsewhere where we use curly brackets, these do NOT signify an optional parameter. ** Define a 'floating' NPC object. -%TAB%script%TAB%%TAB%-1,{} -This will define an NPC object not triggerable by normal means. This would -normally mean it's pointless since it can't do anything, but there are -exceptions, mostly related to running scripts at specified time, which is what +This will define an NPC object not triggerable by normal means. This would +normally mean it's pointless since it can't do anything, but there are +exceptions, mostly related to running scripts at specified time, which is what these floating NPC objects are for. More on that below. ** Define a shop/cashshop/itemshop/pointshop NPC. @@ -284,15 +284,15 @@ these floating NPC objects are for. More on that below. ,,,%TAB%marketshop%TAB%%TAB%,::{,::...} -This will define a shop NPC, which, when triggered (which can only be done by -clicking) will cause a shop window to come up. No code whatsoever runs in shop -NPCs and you can't change the prices otherwise than by editing the script -itself. (No variables even exist at this point of scripting, so don't even +This will define a shop NPC, which, when triggered (which can only be done by +clicking) will cause a shop window to come up. No code whatsoever runs in shop +NPCs and you can't change the prices otherwise than by editing the script +itself. (No variables even exist at this point of scripting, so don't even bother trying to use them.) -The item id is the number of item in the 'item_db.txt' database. If Price is set -to -1, the 'buy price' given in the item database will be used. Otherwise, the -price you gave will be used for this item, which is how you create differing +The item id is the number of item in the 'item_db.txt' database. If Price is set +to -1, the 'buy price' given in the item database will be used. Otherwise, the +price you gave will be used for this item, which is how you create differing prices for items in different shops. Since trunk r12264 you can alternatively use "cashshop" in place of "shop" @@ -329,41 +329,41 @@ is obtained from the definition of the duplicate (not inherited). function%TAB%script%TAB%%TAB%{} -This will define a function object, callable with the 'callfunc' command (see -below). This object will load on every map server separately, so you can get at -it from anywhere. It's not possible to call the code in this object by +This will define a function object, callable with the 'callfunc' command (see +below). This object will load on every map server separately, so you can get at +it from anywhere. It's not possible to call the code in this object by anything other than the 'callfunc' script command. -The code part is the script code that will execute whenever the function is -called with 'callfunc'. It has to be in curly brackets, unlike elsewhere where +The code part is the script code that will execute whenever the function is +called with 'callfunc'. It has to be in curly brackets, unlike elsewhere where we use curly brackets, these do NOT signify an optional parameter. -Once an object is defined which has a 'code' field to its definition, it -contains script commands which can actually be triggered and executed. +Once an object is defined which has a 'code' field to its definition, it +contains script commands which can actually be triggered and executed. ~ RID? GID? ~ What a RID is and why do you need to know ----------------------------------------- -Most scripting commands and functions will want to request data about a -character, store variables referenced to that character, send stuff to the -client connected to that specific character. Whenever a script is invoked by a -character, it is passed a so-called RID - this is the account ID number of a -character that caused the code to execute by clicking on it, walking into its +Most scripting commands and functions will want to request data about a +character, store variables referenced to that character, send stuff to the +client connected to that specific character. Whenever a script is invoked by a +character, it is passed a so-called RID - this is the account ID number of a +character that caused the code to execute by clicking on it, walking into its OnTouch zone, or otherwise. -If you are only writing common NPCs, you don't need to bother with it. However, -if you use functions, if you use timers, if you use clock-based script -activation, you need to be aware of all cases when a script execution can be -triggered without a RID attached. This will make a lot of commands and functions -unusable, since they want data from a specific character, want to send stuff to -a specific client, want to store variables specific to that character, and they +If you are only writing common NPCs, you don't need to bother with it. However, +if you use functions, if you use timers, if you use clock-based script +activation, you need to be aware of all cases when a script execution can be +triggered without a RID attached. This will make a lot of commands and functions +unusable, since they want data from a specific character, want to send stuff to +a specific client, want to store variables specific to that character, and they would not know what character to work on if there's no RID. Unless you use 'attachrid' to explicitly attach a character to the script first. -Whenever we say 'invoking character', we mean 'the character who's RID is +Whenever we say 'invoking character', we mean 'the character who's RID is attached to the running script. The script function "playerattached" can be used to check which is the currently attached player to the script (it will return 0 if the there is no player attached or the attached player no longer @@ -386,35 +386,35 @@ Item and pet scripts -------------------- Each item in the item database has three special fields - Script , OnEquip_Script -and OnUnequip_Script. The first is script code run every time a character equips the item, -with the RID of the equipping character. Every time they unequip an item, all -temporary bonuses given by the script commands are cleared, and all the scripts -are executed once again to rebuild them. This also happens in several other +and OnUnequip_Script. The first is script code run every time a character equips the item, +with the RID of the equipping character. Every time they unequip an item, all +temporary bonuses given by the script commands are cleared, and all the scripts +are executed once again to rebuild them. This also happens in several other situations (like upon login) but the full list is currently unknown. -OnEquip_Script is a piece of script code run whenever the item is used by a character +OnEquip_Script is a piece of script code run whenever the item is used by a character by double-clicking on it. OnUnequip_Script runs whenever the equipment is unequip by a character -Not all script commands work properly in the item scripts. Where commands and -functions are known to be meant specifically for use in item scripts, they are +Not all script commands work properly in the item scripts. Where commands and +functions are known to be meant specifically for use in item scripts, they are described as such. -Every pet in the pet database has a PetScript field, which determines pet -behavior. It is invoked wherever a pet of the specified type is spawned. -(hatched from an egg, or loaded from the char server when a character who had -that pet following them connects) This may occur in some other situations as -well. Don't expect anything other than commands definitely marked as usable in +Every pet in the pet database has a PetScript field, which determines pet +behavior. It is invoked wherever a pet of the specified type is spawned. +(hatched from an egg, or loaded from the char server when a character who had +that pet following them connects) This may occur in some other situations as +well. Don't expect anything other than commands definitely marked as usable in pet scripts to work in there reliably. Numbers ------- -Beside the common decimal numbers, which are nothing special whatsoever (though -do not expect to use fractions, since ALL numbers are integer in this language), -the script engine also handles hexadecimal numbers, which are otherwise -identical. Writing a number like '0x' will make it recognized as a -hexadecimal value. Notice that 0x10 is equal to 16. Also notice that if you try +Beside the common decimal numbers, which are nothing special whatsoever (though +do not expect to use fractions, since ALL numbers are integer in this language), +the script engine also handles hexadecimal numbers, which are otherwise +identical. Writing a number like '0x' will make it recognized as a +hexadecimal value. Notice that 0x10 is equal to 16. Also notice that if you try to 'mes 0x10' it will print '16'. Number values can't exceed the limits of an integer variable: Any number @@ -424,7 +424,7 @@ be capped to those values and will cause a warning to be reported. Variables --------- -The meat of every programming language is variables - places where you store +The meat of every programming language is variables - places where you store data. In the rAthena scripting language, variable names are not case sensitive. @@ -460,19 +460,19 @@ nothing - A permanent variable attached to the character, the default variable This is important for scripts which are called with no RID attached, that is, not triggered by a specific character object. "." - A NPC variable. - They exist in the NPC and disappear when the server restarts or the - NPC is reloaded. Can be accessed from inside the NPC or by calling - 'getvariableofnpc'. Function objects can also have .variables which - are accessible from inside the function, however 'getvariableofnpc' + They exist in the NPC and disappear when the server restarts or the + NPC is reloaded. Can be accessed from inside the NPC or by calling + 'getvariableofnpc'. Function objects can also have .variables which + are accessible from inside the function, however 'getvariableofnpc' does NOT work on function objects. ".@" - A scope variable. - They are unique to the instance and scope. Each instance has its - own scope that ends when the script ends. Calling a function with - callsub/callfunc starts a new scope, returning from the function - ends it. When a scope ends, its variables are converted to values + They are unique to the instance and scope. Each instance has its + own scope that ends when the script ends. Calling a function with + callsub/callfunc starts a new scope, returning from the function + ends it. When a scope ends, its variables are converted to values ('return .@var;' returns a value, not a reference). "'" - An instance variable. - These are used with the instancing system and are unique to each + These are used with the instancing system and are unique to each instance type. "#" - A permanent local account variable. They are stored by char-server in the `acc_reg_num` table and @@ -486,7 +486,7 @@ nothing - A permanent variable attached to the character, the default variable are shared by all these char-servers. Postfix: integer or string -nothing - integer variable, can store positive and negative numbers, but only +nothing - integer variable, can store positive and negative numbers, but only whole numbers (so don't expect to do any fractional math) '$' - string variable, can store text @@ -510,16 +510,16 @@ $@name$ - temporary global string variable ##name - permanent global account integer variable ##name$ - permanent global account string variable -If a variable was never set, it is considered to equal zero for integer -variables or an empty string ("", nothing between the quotes) for string -variables. Once you set it to that, the variable is as good as forgotten -forever, and no trace remains of it even if it was stored with character or +If a variable was never set, it is considered to equal zero for integer +variables or an empty string ("", nothing between the quotes) for string +variables. Once you set it to that, the variable is as good as forgotten +forever, and no trace remains of it even if it was stored with character or account data. -Some variables are special, that is, they are already defined for you by the -scripting engine. You can see the full list in 'src/map/script_constants.h', which -is a file you should read, since it also allows you to replace lots of numbered -arguments for many commands with easier to read text. The special variables most +Some variables are special, that is, they are already defined for you by the +scripting engine. You can see the full list in 'src/map/script_constants.h', which +is a file you should read, since it also allows you to replace lots of numbered +arguments for many commands with easier to read text. The special variables most commonly used are all permanent character-based variables: Zeny - Amount of Zeny. @@ -547,15 +547,15 @@ BaseClass - The character's 1-1 'normal' job, regardless of Upper value. BaseJob - The character's 'normal' job, regardless of Upper value. For example, this will return Job_Acolyte for Acolyte, Baby Acolyte, and High Acolyte. -Karma - The character's karma. Karma system is not fully functional, but +Karma - The character's karma. Karma system is not fully functional, but this doesn't mean this doesn't work at all. Not tested. -Manner - The character's manner rating. Becomes negative if the player - utters words forbidden through the use of 'manner.txt' client-side +Manner - The character's manner rating. Becomes negative if the player + utters words forbidden through the use of 'manner.txt' client-side file. -While these behave as variables, do not always expect to just set them - it is -not certain whether this will work for all of them. Whenever there is a command -or a function to set something, it's usually preferable to use that instead. The +While these behave as variables, do not always expect to just set them - it is +not certain whether this will work for all of them. Whenever there is a command +or a function to set something, it's usually preferable to use that instead. The notable exception is Zeny, which you can and often will address directly - setting it will make the character own this number of Zeny. If you try to set Zeny to a negative number, the script will be terminated with an error. @@ -617,41 +617,41 @@ To include symbol '"' in a string you should use prefix '\"' Arrays ------ -Arrays (in rAthena at least) are essentially a set of variables going under the -same name. You can tell between the specific variables of an array with an +Arrays (in rAthena at least) are essentially a set of variables going under the +same name. You can tell between the specific variables of an array with an 'array index', a number of a variable in that array: [] All variable types can be used as arrays. -Variables stored in this way, inside an array, are also called 'array elements'. -Arrays are specifically useful for storing a set of similar data (like several -item IDs for example) and then looping through it. You can address any array +Variables stored in this way, inside an array, are also called 'array elements'. +Arrays are specifically useful for storing a set of similar data (like several +item IDs for example) and then looping through it. You can address any array variable as if it was a normal variable: set @arrayofnumbers[0],1; -You can also do sneaky things like using a variable (or an expression, or even a +You can also do sneaky things like using a variable (or an expression, or even a value from an another array) to get at an array value: set @x,100; set @arrayofnumbers[@x],10; - + This will make @arrayofnumbers[100] equal to 10. Index numbering always starts with 0 and arrays can hold over 2 billion variables. As such, the (guaranteed) allowed values for indices are in the range 0 ~ 2147483647. -And array indexes probably can't be negative. Nobody tested what happens when -you try to get a negatively numbered variable from an array, but it's not going +And array indexes probably can't be negative. Nobody tested what happens when +you try to get a negatively numbered variable from an array, but it's not going to be pretty. :) Arrays can naturally store strings: -@menulines$[0] is the 0th element of the @menulines$ array of strings. Notice -the '$', normally denoting a string variable, before the square brackets that +@menulines$[0] is the 0th element of the @menulines$ array of strings. Notice +the '$', normally denoting a string variable, before the square brackets that denotes an array index. Variable References @@ -664,25 +664,25 @@ Variable References Operators --------- -Operators are things you can do to variables and numbers. They are either the +Operators are things you can do to variables and numbers. They are either the common mathematical operations or conditional operators -+ - will add two numbers. If you try to add two strings, the result will be a ++ - will add two numbers. If you try to add two strings, the result will be a string glued together at the +. You can add a number to a string, and the result will be a string. No other math operators work with strings. -- - will subtract two numbers. +- - will subtract two numbers. * - will multiply two numbers. / - will divide two numbers. Note that this is an integer division, i.e. 7/2 is not equal 3.5, it's equal 3. % - will give you the remainder of the division. 7%2 is equal to 1. -There are also conditional operators. This has to do with the conditional -command 'if' and they are meant to return either 1 if the condition is satisfied -and 0 if it isn't. (That's what they call 'boolean' variables. 0 means 'False'. -Anything except the zero is 'True' Odd as it is, -1 and -5 and anything below +There are also conditional operators. This has to do with the conditional +command 'if' and they are meant to return either 1 if the condition is satisfied +and 0 if it isn't. (That's what they call 'boolean' variables. 0 means 'False'. +Anything except the zero is 'True' Odd as it is, -1 and -5 and anything below zero will also be True.) -You can compare numbers to each other and you compare strings to each other, but +You can compare numbers to each other and you compare strings to each other, but you can not compare numbers to strings. == - Is true if both sides are equal. For strings, it means they are the same. @@ -698,8 +698,8 @@ Examples: 1<2 is True while 1>2 is False. @x>2 is True if @x is equal to 3. But it isn't true if @x is 2. -Only '==' and '!=' have been tested for comparing strings. Since there's no way -to code a seriously complex data structure in this language, trying to sort +Only '==' and '!=' have been tested for comparing strings. Since there's no way +to code a seriously complex data structure in this language, trying to sort strings by alphabet would be pointless anyway. Comparisons can be stacked in the same condition: @@ -730,19 +730,19 @@ Logical bitwise operators work only on numbers, and they are the following: The second mes command would display 4, which is the same as 16 / 2 = 8. 8 / 2 = 4. & - And. | - Or. - The bitwise operator AND (&) is used to test two values against each other, + The bitwise operator AND (&) is used to test two values against each other, and results in setting bits which are active in both arguments. This can be used for a few things, but in rAthena this operator is usually used to - create bit-masks in scripts. - + create bit-masks in scripts. + The bitwise operator OR (|)sets to 1 a binary position if the binary position of one of the numbers is 1. This way a variable can hold several values we can check, known as bit-mask. A variable currently can hold up to 32 bit-masks (from position 0 to position 1). This is a cheap(skate) and easy way to avoid using arrays to store several checks that a player can have. - - A bit-mask basically is (ab)using the variables bits to set various options in - one variable. With the current limit if variables it is possible to store 32 + + A bit-mask basically is (ab)using the variables bits to set various options in + one variable. With the current limit if variables it is possible to store 32 different options in one variable (by using the bits on position 0 to 31). Example(s): @@ -764,8 +764,8 @@ Logical bitwise operators work only on numbers, and they are the following: This would return the messages about option 2, 3 and 5 being shown (since we've set the 2,4 and 16 bit to 1). ^ - Xor. - The bitwise operator XOR (eXclusive OR) sets a binary position to 0 if both - numbers have the same value in the said position. On the other hand, it + The bitwise operator XOR (eXclusive OR) sets a binary position to 0 if both + numbers have the same value in the said position. On the other hand, it sets to 1 if they have different values in the said binary position. This is another way of setting and unsetting bits in bit-masks. @@ -840,14 +840,14 @@ Within executable script code, some lines can be labels: