summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/atcommands.txt26
-rw-r--r--doc/item_db.txt128
-rw-r--r--doc/md5_hashcheck.txt46
-rw-r--r--doc/permissions.txt3
-rw-r--r--doc/sample/bank_test.txt103
-rw-r--r--doc/sample/basejob_baseclass_upper.txt6
-rw-r--r--doc/sample/checkoption.txt12
-rw-r--r--doc/sample/delitem2.txt28
-rw-r--r--doc/sample/getequipcardid.txt15
-rw-r--r--doc/sample/getequipid.txt10
-rw-r--r--doc/sample/getiteminfo.txt8
-rw-r--r--doc/sample/getmonsterinfo.txt8
-rw-r--r--doc/sample/gstorage_test.txt46
-rw-r--r--doc/sample/localized_npc.txt87
-rw-r--r--doc/sample/npc_dynamic_shop.txt78
-rw-r--r--doc/sample/npc_extend_shop.txt369
-rw-r--r--doc/sample/npc_live_dialogues.txt31
-rw-r--r--doc/sample/npc_shop_test.txt40
-rw-r--r--doc/sample/npc_test_array.txt48
-rw-r--r--doc/sample/npc_test_chat.txt2
-rw-r--r--doc/sample/npc_test_checkweight.txt214
-rw-r--r--doc/sample/npc_test_duplicate.txt10
-rw-r--r--doc/sample/npc_test_func.txt12
-rw-r--r--doc/sample/npc_test_npctimer.txt8
-rw-r--r--doc/sample/npc_test_npctimer2.txt8
-rw-r--r--doc/sample/npc_test_pcre.txt8
-rw-r--r--doc/sample/npc_test_quest.txt22
-rw-r--r--doc/sample/npc_test_setitemx.txt75
-rw-r--r--doc/sample/npc_test_setmapflag.txt20
-rw-r--r--doc/sample/npc_test_skill.txt12
-rw-r--r--doc/sample/npc_test_time.txt2
-rw-r--r--doc/sample/npc_trader_sample.txt58
-rw-r--r--doc/script_commands.txt485
33 files changed, 1418 insertions, 610 deletions
diff --git a/doc/atcommands.txt b/doc/atcommands.txt
index 42b085cd6..4519cfb49 100644
--- a/doc/atcommands.txt
+++ b/doc/atcommands.txt
@@ -337,6 +337,16 @@ By default, 10 items can be autolooted at one time.
---------------------------------------
+@autoloottype <+/-><type name>
+@autoloottype reset
+
+Starts or stops autolooting a specified item type.
+Type List: healing, usable, etc, weapon, armor, card, petegg, petarmor, ammo.
+Typing "reset" will clear the autoloot item list.
+
+---------------------------------------
+
+
@mobsearch <monster name>
Locates and displays the position of a certain mob on the current map.
@@ -626,6 +636,22 @@ identify_flag: 0 = unidentified, 1 = identified
attribute: 0 = not broken, 1 = broken
---------------------------------------
+
+@itembound <item name/ID> <amount> <bound_type>
+
+Creates the specified item and bounds it to the account.
+bound_type: 1 = Account, 2 = Guild, 3 = Party, 4 = Character
+
+---------------------------------------
+
+@itembound2 <item name/ID> <quantity> <identify_flag> <refine> <attribute> <card1> <card2> <card3> <card4> <bound_type>
+
+Creates an item with the given parameters (the 'cards' can be any item) and bounds it to the account.
+identify_flag: 0 = unidentified, 1 = identified
+attribute: 0 = not broken, 1 = broken
+bound_type: 1 = Account, 2 = Guild, 3 = Party, 4 = Character
+
+---------------------------------------
@produce <equip name/ID> <element> <# of Very's>
diff --git a/doc/item_db.txt b/doc/item_db.txt
index 1cf92977c..30aa845f3 100644
--- a/doc/item_db.txt
+++ b/doc/item_db.txt
@@ -5,17 +5,57 @@
//===== Current Version: =====================================
//= 20120904
//===== Description: =========================================
-//= Explanation of the item_db.txt file and structure.
+//= Explanation of the item_db.conf file and structure.
//============================================================
-ID: Item id
+item_db: (
+{
+ // =================== Mandatory fields ===============================
+ Id: ID (int)
+ AegisName: "Aegis_Name" (string, optional if Inherit: true)
+ Name: "Item Name" (string, optional if Inherit: true)
+ // =================== Optional fields ================================
+ Type: Item Type (int, defaults to 3 = etc item)
+ Buy: Buy Price (int, defaults to Sell * 2)
+ Sell: Sell Price (int, defaults to Buy / 2)
+ Weight: Item Weight (int, defaults to 0)
+ Atk: Attack (int, defaults to 0)
+ Matk: Magical Attack (int, defaults to 0, ignored in pre-re)
+ Def: Defense (int, defaults to 0)
+ Range: Attack Range (int, defaults to 0)
+ Slots: Slots (int, defaults to 0)
+ Job: Job mask (int, defaults to all jobs = 0xFFFFFFFF)
+ Upper: Upper mask (int, defaults to any = 0x3f)
+ Gender: Gender (int, defaults to both = 2)
+ Loc: Equip location (int, required value for equipment)
+ WeaponLv: Weapon Level (int, defaults to 0)
+ EquipLv: Equip required level (int, defaults to 0)
+ EquipLv: [min, max] (alternative syntax with min / max level)
+ Refine: Refineable (boolean, defaults to true)
+ View: View ID (int, defaults to 0)
+ BindOnEquip: true/false (boolean, defaults to false)
+ Script: <"
+ Script
+ (it can be multi-line)
+ ">
+ OnEquipScript: <" OnEquip Script (can also be multi-line) ">
+ OnUnequipScript: <" OnUnequip Script (can also be multi-line) ">
+ // =================== Optional fields (item_db2 only) ================
+ Inherit: true/false (boolean, if true, inherit the values
+ that weren't specified, from item_db.conf,
+ else override it and use default values)
+},
+...
+)
+
+Id: Item id
AegisName: Server name to reference the item in scripts and lookups,
should use no spaces.
Name: Name in English for displaying as output for @ and script commands.
-Type:
+Type:
0 Healing item.
2 Usable item.
3 Etc item
@@ -34,15 +74,18 @@ Buy: Default buying price. When not specified, becomes double the sell price.
Sell: Default selling price. When not specified, becomes half the buy price.
-Weight: Item's weight. Each 10 is 1 weight.
+Weight: Item's weight. Each 10 is 1 weight. When not specified, becomes 0.
-ATK: Weapon's attack
+Atk: Weapon's attack. When not specified, becomes 0.
-DEF: Armor's defense
+Matk: Weapon's magical attack (only used in renewal mode, ignored in
+ pre-renewal). When not specified, becomes 0.
-Range: Weapon's attack range
+Def: Armor's defense. When not specified, becomes 0.
-Slots: Amount of slots the item possesses.
+Range: Weapon's attack range. When not specified, becomes 0.
+
+Slots: Amount of slots the item possesses. When not specified, becomes 0.
Job: Equippable jobs. Uses the following bitmask table:
@@ -77,20 +120,28 @@ Job: Equippable jobs. Uses the following bitmask table:
Dark Collector (2^28): 0x10000000
Kagerou/Oboro (2^29): 0x20000000
Rebellion (2^30): 0x40000000
+ Some other commonly used values:
+ All except novice: 0xFFFFFFFE
+ All (default value): 0xFFFFFFFF
Upper: Equippable upper-types. Uses the following bitmasks:
- 1: Normal jobs
- 2: Upper jobs
- 4: Baby jobs
- 8: Third jobs
- 16: Upper Third jobs
- 32: Baby Third jobs
-Under pre-re mode third classes are considered upper, making use of the 8 and above masks is therefore not necessary unless in renewal mode.
-
-Gender: Gender restriction. 0 is female, 1 is male, 2 for both.
-
-Loc: Equipment's placement. Values are:
-
+ Normal jobs: 0x01 (1)
+ Upper jobs: 0x02 (2)
+ Baby jobs: 0x04 (4)
+ Third jobs: 0x08 (8)
+ Upper Third jobs: 0x10 (16)
+ Baby Third jobs: 0x20 (32)
+
+ Under pre-re mode third classes are considered upper, making use of
+ the 8 and above masks is therefore not necessary unless in renewal
+ mode. When no value is specified, all classes (mask 0x3f) are able to
+ equip the item.
+
+Gender: Gender restriction. 0 is female, 1 is male, 2 for both (default value).
+
+Loc: Equipment's placement. A value needs to be specified if the item is an
+ equipment piece. Values are:
+
2^0 001 = Lower Headgear
2^1 002 = Weapon
2^2 004 = Garment
@@ -105,12 +156,26 @@ Loc: Equipment's placement. Values are:
2^11 2048 = Costume Mid Headgear
2^12 4096 = Costume Low Headgear
2^13 8192 = Costume Garment/Robe
+ 2^16 65536 = Shadow Armor
+ 2^17 131072 = Shadow Weapon
+ 2^18 262144 = Shadow Shield
+ 2^18 524288 = Shadow Shoes
+ 2^20 1048576 = Shadow Accessory 2
+ 2^21 2097152 = Shadow Accessory 1
-wLV: Weapon level.
+WeaponLv: Weapon level. Becomes 0 when not specified.
-eLV: Base level required to be able to equip.
+EquipLv: Base level required to be able to equip. It is possible to specify
+ two values, if an item has a maximum level, by using the following
+ syntax:
-Refineable: 1 if the item can be refined, 0 otherwise.
+ EquipLv: [minLv, maxLv]
+
+ If only one value is specified, maxLv becomes the current server's
+ MAX_LEVEL. If no values are specified, minLv becomes 0.
+
+Refineable: true if the item can be refined, false otherwise. If no value is
+ specified, it defaults to true.
View: For normal items, defines a replacement view-sprite for the item (eg:
Making apples look like apple juice). The special case are weapons
@@ -152,10 +217,19 @@ View: For normal items, defines a replacement view-sprite for the item (eg:
8: Cannonballs
9: Throwable Items (Sling Item)
+BindOnEquip: Whether the item will automatically bind to the character when it
+ is equipped for the first time. An item that has this field set,
+ will display a confirmation dialog the first time it is equipped,
+ and, if accepted, the item will become character-bound.
+
Script: Script to execute when the item is used/equipped.
-OnEquip_Script: Script to execute when the item is equipped.
- Warning, not all item bonuses will work here as expected.
+OnEquipScript: Script to execute when the item is equipped.
+ Warning, not all item bonuses will work here as expected.
+
+OnUnequipScript: Script to execute when the item is unequipped.
+ Warning, not all item bonuses will work here as expected.
-OnUnequip_Script: Script to execute when the item is unequipped.
- Warning, not all item bonuses will work here as expected.
+Inherit: This can be used only in item_db2.conf, and if set to true, and the
+ item already exists in item_db.conf, all the missing fields will be
+ inherited from there rather than using their default values.
diff --git a/doc/md5_hashcheck.txt b/doc/md5_hashcheck.txt
index 779785638..d9064b1ab 100644
--- a/doc/md5_hashcheck.txt
+++ b/doc/md5_hashcheck.txt
@@ -3,7 +3,7 @@
//===== By: ==================================================
//= Hercules Dev Team
//===== Current Version: =====================================
-//= 20120921
+//= 20140208
//===== Description: =========================================
//= This file outlines the login server's MD5 hash check.
//============================================================
@@ -13,26 +13,46 @@ This will ensure that a user has not tampered with the client and that
the client is the one specific to your server.
The client can only send the correct MD5 hash to the server on certain
-server types, so a client diff is required to ensure the hash is sent.
-A link containing the required WeeDiffGen plugin can be found at:
-http://rathena.org/board/topic/70841-r16771-client-md5-hash-check/
+server types, so a client diff may be required to ensure the hash is
+sent.
+Please refer to your client diff tool manual for the appropriate patch
+(i.e. in NEMO it's called "Force Send Client Hash Packet", in other
+tools or diffs it may have similar names.)
-The settings for the hash check are located in conf\login.conf:
+The serverside settings for the hash check are located in
+conf/login.conf:
// Client MD5 hash check
// If turned on, the login server will check if the client's hash matches
// the value below, and will not connect tampered clients.
-// Note: see doc\md5_hashcheck.txt for more details.
+// Note: see doc/md5_hashcheck.txt for more details.
client_hash_check: off
// Client MD5 hashes
-// A player can login with a client hash at or below the account group_id.
+// The client with the specified hash can be used to log in by players with
+// a group_id equal to or greater than the given value.
+// If you specify 'disabled' as hash, players with a group_id greater than or
+// equal to the given value will be able to log in regardless of hash (and even
+// if their client does not send a hash at all.)
// Format: group_id, hash
+// Note: see doc/md5_hashcheck.txt for more details.
client_hash: 0, 113e195e6c051bb1cfb12a644bb084c5
-client_hash: 99, cb1ea78023d337c38e8ba5124e2338ae
+client_hash: 10, cb1ea78023d337c38e8ba5124e2338ae
+client_hash: 99, disabled
-To enable MD5 hash checks, set 'client_hash_check' to 'on'.
-The 'client_hash' group_id can be any of the groups in conf\groups.conf,
-and is particularly useful if you wanted to allow GMs a different client
-than normal players; for example, a GM client could be hexed differently
-with dual-clienting enabled and chat flood disabled.
+To enable MD5 hash checks, set 'client_hash_check' to 'on' and add one
+'client_hash' entry for each client you want to use.
+The group_id can be any of the groups in conf/groups.conf, and it is
+useful in case if you want to allow GMs to use a different client
+than normal players; for example, a GM client could be hexed
+differently, perhaps with dual-clienting enabled and chat flood
+disabled.
+You will need to replace the example MD5 hashes with the actual hash of
+your client.
+You can use any MD5 hash tools to generate it, e.g.:
+- md5sum (command line) on linux
+- WinMD5 on Windows
+- md5 (command line) on Mac OS X
+- If you hexed your client with NEMO (version 2.0 and above), you
+ can find the MD5 hash of the generated client automatically saved to
+ client_filename.exe.secure.txt
diff --git a/doc/permissions.txt b/doc/permissions.txt
index 9760f716c..7280395dc 100644
--- a/doc/permissions.txt
+++ b/doc/permissions.txt
@@ -3,7 +3,7 @@
//===== By: ==================================================
//= Hercules Dev Team
//===== Current Version: =====================================
-//= 20130528
+//= 20131031
//===== Description: =========================================
//= Player group permissions, configured in /conf/groups.conf.
//============================================================
@@ -31,4 +31,5 @@ show_bossmobs : Ability to see boss mobs with @showmobs.
disable_pvm : Ability to disable Player vs. Monster.
disable_pvp : Ability to disable Player vs. Player.
disable_commands_when_dead : Ability to disable @command usage when dead.
+can_trade_bound: Ability to trade or otherwise distribute bound items (drop, storage, vending etc...).
hchsys_admin : Hercules Chat System Admin (Ability to modify channel settings regardless of ownership and join password-protected channels without requiring a password.)
diff --git a/doc/sample/bank_test.txt b/doc/sample/bank_test.txt
index 8b29abd93..5cdf319ca 100644
--- a/doc/sample/bank_test.txt
+++ b/doc/sample/bank_test.txt
@@ -3,12 +3,12 @@
//===== By: ==================================================
//= Hercules Dev Team
//===== Current Version: =====================================
-//= 20070315
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= Contains commands needed for a basic bank.
//============================================================
-prontera,162,188,1 script Bank Test 112,{
+prontera,162,188,1 script Bank Test 4_F_KAFRA6,{
cutin "kafra_06",2;
mes "[Bank Test]";
@@ -16,51 +16,64 @@ prontera,162,188,1 script Bank Test 112,{
mes "You can only deposit a minimal of";
mes "1000z. What do you want to do?";
next;
- menu "Deposit",BANK_IN,"Withdraw",BANK_OUT,"Exit",B_EXIT2;
-BANK_IN:
- mes "[Bank Test]";
- mes "You must deposit the same of less";
- mes "amount of zeny that you carry.";
- mes "How much do you want to deposit?";
- next;
- input @kafrabank;
-
- if(@kafrabank<1000) goto B_EXIT2;
- set @kafrabank2,@kafrabank*1/100;
- if(@kafrabank+@kafrabank2>Zeny) goto BANK_F;
- set Zeny,Zeny-@kafrabank-@kafrabank2;
- set #kafrabank,#kafrabank+@kafrabank;
- mes "You now have: ^135445" + @kafrabank2 + "z^000000";
+ switch (select("Deposit","Withdraw","Exit")) {
+ case 1:
+ mes "[Bank Test]";
+ mes "How much do you want to deposit?";
+ next;
+ input .@kafrabank;
- goto B_EXIT;
-BANK_OUT:
- if(#kafrabank==0) goto BANK_F2;
- mes "[Bank Test]";
- mes "You can only withdraw equally or below this quantity:";
- mes "^135445" + #kafrabank + "^000000z";
- mes "How much do you want to withdraw?";
- next;
- input @kafrabank;
+ if (.@kafrabank < 1000) {
+ mes "[Bank Test]";
+ mes "The minimum deposit is 1000z";
+ next;
+ break;
+ }
+ if (.@kafrabank > Zeny) {
+ mes "[Bank Test]";
+ mes "You don't have enough money.";
+ next;
+ break;
+ }
+ Zeny -= .@kafrabank;
+ #kafrabank += .@kafrabank;
+ mes "[Bank Test]";
+ mes "You now have ^135445" + Zeny + "z^000000";
+ mes "and your bank account ^135445" + #kafrabank + "z^000000";
+ next;
+ break;
+ case 2:
+ if (#kafrabank == 0) {
+ mes "[Bank Test]";
+ mes "Your bank account is currently empty, you can't withdraw.";
+ next;
+ break;
+ }
+ mes "[Bank Test]";
+ mes "Current balance: ^135445" + #kafrabank + "^000000z";
+ mes "How much do you want to withdraw?";
+ next;
+ input .@kafrabank;
- if(@kafrabank<1) goto B_EXIT2;
- if(@kafrabank>#kafrabank) goto BANK_F;
- set #kafrabank,#kafrabank-@kafrabank;
- set Zeny,Zeny+@kafrabank;
-
- goto B_EXIT;
-
-BANK_F:
- mes "[Bank Test]";
- mes "You can't withdraw more than ^135445"+ #kafrabank + "^000000z.";
- goto B_EXIT2;
-BANK_F2:
- mes "[Bank Test]";
- mes "Your account is empty, you may not withdraw at this time.";
- goto B_EXIT2;
+ if (.@kafrabank < 1)
+ break;
+ if (.@kafrabank > #kafrabank) {
+ mes "[Bank Test]";
+ mes "You can't withdraw more than ^135445"+ #kafrabank + "^000000z.";
+ next;
+ break;
+ }
+ #kafrabank -= .@kafrabank;
+ Zeny += .@kafrabank;
+ mes "[Bank Test]";
+ mes "You now have ^135445" + Zeny + "z^000000";
+ mes "and your bank account ^135445" + #kafrabank + "z^000000";
+ next;
+ break;
+ case 3:
+ break;
+ }
-B_EXIT:
- mes "Thanks for using depositing";
-B_EXIT2:
mes "Good bye!";
cutin "kafra_06",255;
close;
diff --git a/doc/sample/basejob_baseclass_upper.txt b/doc/sample/basejob_baseclass_upper.txt
index 8e2501e09..80cc23fc7 100644
--- a/doc/sample/basejob_baseclass_upper.txt
+++ b/doc/sample/basejob_baseclass_upper.txt
@@ -3,12 +3,12 @@
//===== By: ==================================================
//= Hercules Dev Team
//===== Current Version: =====================================
-//= 20110123
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= Outputs the values of class constants.
//============================================================
-prontera,155,177,1 script Tell Me 725,{
+prontera,155,177,1 script Tell Me 4_F_JOB_ASSASSIN,{
mes "[Tell Me]";
mes "Class: " + Class;
mes "BaseClass: " + BaseClass;
diff --git a/doc/sample/checkoption.txt b/doc/sample/checkoption.txt
index 8f0f96d9f..77c0a3105 100644
--- a/doc/sample/checkoption.txt
+++ b/doc/sample/checkoption.txt
@@ -3,15 +3,17 @@
//===== By: ==================================================
//= Hercules Dev Team
//===== Current Version: =====================================
-//= 20070315
+//= 20131225
//===== Description: =========================================
//= Demonstrates the 'checkoption' command.
//============================================================
-prontera,156,89,6 script test_checkoption 117,{
+prontera,156,89,6 script test_checkoption 4_F_KAFRA1,{
mes "Please enter a value of type!";
- input @value;
- if(checkoption(@value) == 1) mes "True!";
- else if(checkoption(@value) == 0) mes "False!";
+ input .@value;
+ if(checkoption(.@value) == 1)
+ mes "True!";
+ else if(checkoption(.@value) == 0)
+ mes "False!";
close;
}
diff --git a/doc/sample/delitem2.txt b/doc/sample/delitem2.txt
index 9e74d76e7..46e3e42c7 100644
--- a/doc/sample/delitem2.txt
+++ b/doc/sample/delitem2.txt
@@ -3,37 +3,37 @@
//===== By: ==================================================
//= Hercules Dev Team
//===== Current Version: =====================================
-//= 20070315
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= Demonstrates the 'delitem2' command.
//============================================================
-prontera,160,182,5 script Delitem2 51,{
+prontera,160,182,5 script Delitem2 1_M_BARD,{
mes "Item ID?";
next;
- input @nameid;
+ input .@nameid;
mes "Amount?";
next;
- input @amount;
+ input .@amount;
mes "Identified? (0:no, 1:yes)";
next;
- input @iden;
+ input .@iden;
mes "Refined how many times?";
next;
- input @ref;
+ input .@ref;
mes "Attribute? (0:normal, 1:broken)";
next;
- input @attr;
+ input .@attr;
mes "4 cards (one after another)...";
next;
- input @c1;
- input @c2;
- input @c3;
- input @c4;
+ input .@c1;
+ input .@c2;
+ input .@c3;
+ input .@c4;
mes "Your command is:";
- mes "delitem2 "+@nameid+","+@amount+","+@iden+","+@ref+","+@attr+","+@c1+","+@c2+","+@c3+","+@c4;
+ mes "delitem2 "+.@nameid+","+.@amount+","+.@iden+","+.@ref+","+.@attr+","+.@c1+","+.@c2+","+.@c3+","+.@c4;
next;
- delitem2 @nameid,@amount,@iden,@ref,@attr,@c1,@c2,@c3,@c4;
+ delitem2 .@nameid,.@amount,.@iden,.@ref,.@attr,.@c1,.@c2,.@c3,.@c4;
mes "And here is the moment when your item should disappear! :P";
close;
}
diff --git a/doc/sample/getequipcardid.txt b/doc/sample/getequipcardid.txt
index 6b435f41f..8f7d7f27d 100644
--- a/doc/sample/getequipcardid.txt
+++ b/doc/sample/getequipcardid.txt
@@ -3,18 +3,19 @@
//===== By: ==================================================
//= Lupus
//===== Current Version: =====================================
-//= 20121003
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= Demonstrates the 'getequipcardid' command.
//============================================================
-prontera,155,177,4 script Check My Hat 810,{
+prontera,155,177,4 script Check My Hat 1_M_SIGNROGUE,{
mes "Checking your head...";
if (getequipisequiped(1)) {
- set @id,getequipid(1);
- set @ref,getequiprefinerycnt(1);
- mes "Your hat is... "+getitemname(@id)+"...";
- if(@ref) mes "It has been refined "+@ref+" times.";
+ .@id = getequipid(1);
+ .@ref = getequiprefinerycnt(1);
+ mes "Your hat is... "+getitemname(.@id)+"...";
+ if(.@ref)
+ mes "It has been refined "+.@ref+" times.";
mes "Card Slot 0:"+getequipcardid(1,0)+" 1:"+getequipcardid(1,1);
mes "Card Slot 2:"+getequipcardid(1,2)+" 3:"+getequipcardid(1,3);
close;
diff --git a/doc/sample/getequipid.txt b/doc/sample/getequipid.txt
index 6a2ef342f..6543d7932 100644
--- a/doc/sample/getequipid.txt
+++ b/doc/sample/getequipid.txt
@@ -3,14 +3,14 @@
//===== By: ==================================================
//= Hercules Dev Team
//===== Current Version: =====================================
-//= 20121003
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= Demonstrates the 'getequipid' command.
//============================================================
-prontera,161,181,6 script GetEquipID Sample 105,{
+prontera,161,181,6 script getequipid Sample 8W_SOLDIER,{
mes "[GetEquipID Sample]";
- for(set .@i,1; .@i<11; set .@i,.@i+1)
- mes "GetEquipID(" + .@i + ") : " + getequipid(1);
+ for (.@i = 1; .@i < 11; ++.@i)
+ mes "getequipid(" + .@i + ") : " + getequipid(1);
close;
}
diff --git a/doc/sample/getiteminfo.txt b/doc/sample/getiteminfo.txt
index 632999f3b..89f9a66b5 100644
--- a/doc/sample/getiteminfo.txt
+++ b/doc/sample/getiteminfo.txt
@@ -3,12 +3,12 @@
//===== By: ==================================================
//= Lupus
//===== Current Version: =====================================
-//= 20121003
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= Demonstrates the 'getiteminfo' command.
//============================================================
-prontera,156,179,6 script test_getiteminfo 117,{
+prontera,156,179,6 script test_getiteminfo 4_F_KAFRA1,{
mes "Please enter an item ID.";
input .@value;
@@ -17,7 +17,7 @@ prontera,156,179,6 script test_getiteminfo 117,{
mes "Item ID: "+.@value+" ^nItemID^"+.@value;
mes "Current item info:";
- for(set .@id,0; .@id<14; set .@id,.@id+1)
+ for (.@id = 0; .@id < 14; ++.@id)
mes " getiteminfo("+.@value+","+.@id+") = "+getiteminfo(.@value,.@id);
close;
}
diff --git a/doc/sample/getmonsterinfo.txt b/doc/sample/getmonsterinfo.txt
index 471af9e5c..064f1fc71 100644
--- a/doc/sample/getmonsterinfo.txt
+++ b/doc/sample/getmonsterinfo.txt
@@ -3,12 +3,12 @@
//===== By: ==================================================
//= Lupus
//===== Current Version: =====================================
-//= 20121003
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= Demonstrates the 'getmonsterinfo' command.
//============================================================
-prontera,156,179,6 script test_getmonsterinfo 117,{
+prontera,156,179,6 script test_getmonsterinfo 4_F_KAFRA1,{
mes "Please enter a monster ID.";
input .@value;
if(getmonsterinfo(.@value,MOB_LV)<0 || getmonsterinfo(.@value,MOB_NAME)=="Dummy") {
@@ -17,7 +17,7 @@ prontera,156,179,6 script test_getmonsterinfo 117,{
}
mes "Monster ID: "+.@value+" '"+getmonsterinfo(.@value,MOB_NAME)+"'";
mes "Current Monster info:";
- for(set .@id,0; .@id<23; set .@id,.@id+1)
+ for (.@id = 0; .@id < 23; ++.@id)
mes " getmonsterinfo("+.@value+","+@id+") = "+getmonsterinfo(.@value,@id);
close;
}
diff --git a/doc/sample/gstorage_test.txt b/doc/sample/gstorage_test.txt
index b8f9fe2c4..8b1a1c0e6 100644
--- a/doc/sample/gstorage_test.txt
+++ b/doc/sample/gstorage_test.txt
@@ -3,42 +3,34 @@
//===== By: ==================================================
//= Hercules Dev Team
//===== Current Version: =====================================
-//= 20070315
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= Contains commands needed for a guild warehouse NPC.
//============================================================
-prontera,165,188,4 script Guild Warehouse 112,{
+prontera,165,188,4 script Guild Warehouse 4_F_KAFRA6,{
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;
- menu "Access Guild Warehouse", GS_OPEN, "Exit", GS_EXIT3;
+ if (select("Access Guild Warehouse","Exit") != 1) {
+ mes "[Guild Warehouser]";
+ mes "Come back whenever you want.";
+ cutin "kafra_06", 255;
+ close;
+ }
-GS_OPEN:
- set @flag,guildopenstorage(0);
- if(@flag == 1) goto GS_EXIT1;
- if(@flag == 2) goto GS_EXIT2;
- goto GS_EXIT4;
-
-GS_EXIT1:
- mes "[Guild Warehouse]";
- mes "The guild warehouse is being used right now.";
- mes "Please wait a while, then come back.";
- goto GS_EXIT4;
-
-GS_EXIT2:
- mes "[Guild Warehouse]";
- mes "You can't use this service if you're not in a guild!";
- goto GS_EXIT4;
-
-GS_EXIT3:
- mes "[Guild Warehouser]";
- mes "Come back whenever you want.";
-
-GS_EXIT4:
+ .@flag = guildopenstorage;
+ if (.@flag == 1) {
+ mes "[Guild Warehouse]";
+ mes "The guild warehouse is being used right now.";
+ mes "Please wait a while, then come back.";
+ } else if(.@flag == 2) {
+ mes "[Guild Warehouse]";
+ mes "You can't use this service if you're not in a guild!";
+ }
cutin "kafra_06",255;
close;
}
diff --git a/doc/sample/localized_npc.txt b/doc/sample/localized_npc.txt
index 91bf46062..82a08fa35 100644
--- a/doc/sample/localized_npc.txt
+++ b/doc/sample/localized_npc.txt
@@ -1,23 +1,23 @@
-//===== Hercules Script =======================================
+//===== Hercules Script ======================================
//= Sample localized NPC
-//===== By: ==================================================
+//===== By: ==================================================
//= Hercules Dev Team
-//===== Current Version: =====================================
-//= v1.0
-//===== Description: =========================================
+//===== Current Version: =====================================
+//= v1.1
+//===== 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,16 +28,16 @@
//= - 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.
/// @param langid Languange identifier (0 for default)
function script setlang {
- set ##_langid_, getarg(0);
+ ##_langid_ = getarg(0);
return;
}
@@ -54,15 +54,15 @@ function script getlang {
/// @param langid Language identifier (0 for default)
/// @param text Text message
function script setmes2 {
- set $@mes2_name$, getarg(0);
- set $@mes2_langid, getarg(1);
- set $@mes2_text$, getarg(2);
- set $@mes2_var$, "$@__"+ $@mes2_name$ +"_"+ $@mes2_langid +"$";
+ .@mes2_name$ = getarg(0);
+ .@mes2_langid = getarg(1);
+ .@mes2_text$ = getarg(2);
+ .@mes2_var$ = "$@__"+ .@mes2_name$ +"_"+ .@mes2_langid +"$";
- //debugmes "setmes2 \""+ $@mes2_var$ +"\", \""+ $@mes2_text$ +"\";";
+ //debugmes "setmes2 \""+ .@mes2_var$ +"\", \""+ .@mes2_text$ +"\";";
// set the localized text
- setd $@mes2_var$, $@mes2_text$;
+ setd .@mes2_var$, .@mes2_text$;
return;
}
@@ -73,14 +73,14 @@ function script setmes2 {
/// @param langid Language identifier (0 for default)
/// @return Text message
function script getmes2 {
- set $@mes2_name$, getarg(0);
- set $@mes2_langid, getarg(1);
- set $@mes2_var$, "$@__"+ $@mes2_name$ +"_"+ $@mes2_langid +"$";
- set $@mes2_text$, getd($@mes2_var$);
+ .@mes2_name$ = getarg(0);
+ .@mes2_langid = getarg(1);
+ .@mes2_var$ = "$@__"+ .@mes2_name$ +"_"+ .@mes2_langid +"$";
+ .@mes2_text$ = getd(.@mes2_var$);
- //debugmes "getmes2(\""+ $@mes2_var$ +"\")=\""+ $@mes2_text$ +"\"";
+ //debugmes "getmes2(\""+ .@mes2_var$ +"\")=\""+ .@mes2_text$ +"\"";
- return $@mes2_text$;
+ return .@mes2_text$;
}
//////////////////////////////////////////////////////////////
@@ -89,32 +89,31 @@ function script getmes2 {
/// that are valis as a variable name
/// @param index Message identifier
function script mes2 {
- set @mes2_index$, getarg(0);
+ .@mes2_index$ = getarg(0);
- if( getstrlen(@mes2_index$) == 0 )
+ if( getstrlen(.@mes2_index$) == 0 )
return; // invalid index
// print localized text
- set @mes2_text$, callfunc("getmes2",@mes2_index$,##_langid_);
- if( getstrlen(@mes2_text$) == 0 )
- {
- if( ##_langid_ != 0 )
- {// revert to default language
- set @mes2_text$, callfunc("getmes2",@mes2_index$,0);
- if( getstrlen(@mes2_text$) != 0 )
- mes @mes2_text$; // default text
+ .@mes2_text$ = callfunc("getmes2",.@mes2_index$,##_langid_);
+ if( getstrlen(.@mes2_text$) == 0 ) {
+ if( ##_langid_ != 0 ) {
+ // revert to default language
+ .@mes2_text$ = callfunc("getmes2",.@mes2_index$,0);
+ if( getstrlen(.@mes2_text$) != 0 )
+ mes .@mes2_text$; // default text
}
} else
- mes @mes2_text$; // localized text
+ mes .@mes2_text$; // localized text
return;
}
//////////////////////////////////////////////////////////////
/// Sample localized NPC
-prontera,155,183,4 script LocalizedNPC 705,{
+prontera,155,183,4 script LocalizedNPC 4_M_GEF_SOLDIER,{
// Get text for specific languages
- set @menu1$, callfunc("getmes2","LNPC_lang",0);
- set @menu2$, callfunc("getmes2","LNPC_lang",1);
+ .@menu1$ = callfunc("getmes2","LNPC_lang",0);
+ .@menu2$ = callfunc("getmes2","LNPC_lang",1);
do {
// get text that fallbacks to language 0
callfunc "mes2", "LNPC_name";
@@ -123,7 +122,7 @@ prontera,155,183,4 script LocalizedNPC 705,{
callfunc "mes2", "LNPC_text";
next;
- switch(select(@menu1$,@menu2$,"Cancel"))
+ switch(select(.@menu1$,.@menu2$,"Cancel"))
{
case 1:
case 2:
@@ -144,6 +143,6 @@ OnInterIfInitOnce:
callfunc "setmes2", "LNPC_lang", 0, "EN";
callfunc "setmes2", "LNPC_lang", 1, "PT";
callfunc "setmes2", "LNPC_text", 0, "Something in english";
- callfunc "setmes2", "LNPC_text", 1, "Algo em portugu�s";
+ callfunc "setmes2", "LNPC_text", 1, "Algo em português";
end;
}
diff --git a/doc/sample/npc_dynamic_shop.txt b/doc/sample/npc_dynamic_shop.txt
index c3bc78293..1e4ac77e4 100644
--- a/doc/sample/npc_dynamic_shop.txt
+++ b/doc/sample/npc_dynamic_shop.txt
@@ -1,39 +1,37 @@
-//===== rAthena Script =======================================
+//===== Hercules Script ======================================
//= Sample: Dynamic Shop
//===== By: ==================================================
-//= rAthena Dev Team
+//= Hercules Dev Team
//===== Current Version: =====================================
-//= 20101219
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= Contains commands needed for a dynamic shop.
//============================================================
// Dummy shop to insert items into:
- shop dyn_shop1 -1,501:50.
-prontera,181,200,4 script Dynamic Shop 123,{
+prontera,181,200,4 script Dynamic Shop 2_F_MAGICMASTER,{
callshop "dyn_shop1",0;
npcshopattach "dyn_shop1";
end;
OnSellItem:
- for(set @i, 0; @i < getarraysize(@sold_nameid); set @i, @i + 1){
- if(countitem(@sold_nameid[@i]) < @sold_quantity[@i] || @sold_quantity[@i] <= 0){
+ for (.@i = 0; .@i < getarraysize(@sold_nameid); ++.@i) {
+ if(countitem(@sold_nameid[.@i]) < @sold_quantity[.@i] || @sold_quantity[.@i] <= 0) {
mes "omgh4x!";
close;
- } else if(@sold_nameid[@i] == 501){
- delitem 501, @sold_quantity[@i];
- set $@rpotsleft, $@rpotsleft + @sold_quantity[@i];
- set Zeny, Zeny + @sold_quantity[@i]*20;
+ } else if (@sold_nameid[.@i] == Red_Potion) {
+ delitem Red_Potion, @sold_quantity[.@i];
+ $@rpotsleft += @sold_quantity[.@i];
+ Zeny += @sold_quantity[.@i]*20;
+ } else if (@sold_nameid[.@i] == Orange_Potion){
+ delitem Orange_Potion, @sold_quantity[.@i];
+ $@opotsleft += @sold_quantity[.@i];
+ Zeny += @sold_quantity[.@i]*100;
} else {
- if(@sold_nameid[@i] == 502){
- delitem 502, @sold_quantity[@i];
- set $@opotsleft, $@opotsleft + @sold_quantity[@i];
- set Zeny, Zeny + @sold_quantity[@i]*100;
- } else {
- mes "Sorry, I don't need your items.";
- close;
- }
+ mes "Sorry, I don't need your items.";
+ close;
}
}
deletearray @sold_quantity, getarraysize(@sold_quantity);
@@ -42,40 +40,40 @@ OnSellItem:
close;
OnBuyItem:
- for(set @i, 0; @i < getarraysize(@bought_nameid); set @i, @i + 1){
- if(@bought_quantity[@i] <= 0){
+ for (.@i = 0; .@i < getarraysize(@bought_nameid); ++.@i) {
+ if (@bought_quantity[.@i] <= 0) {
mes "omgh4x!";
close;
- } else if(@bought_nameid[@i] == 501){
- if(@bought_quantity[@i] > $@rpotsleft){
- if($@rpotsleft > 0){
- set @bought_quantity[@i], $@rpotsleft;
+ } else if (@bought_nameid[.@i] == Red_Potion) {
+ if (@bought_quantity[.@i] > $@rpotsleft) {
+ if($@rpotsleft > 0) {
+ @bought_quantity[.@i] = $@rpotsleft;
} else {
mes "We are out of red potions!";
close;
}
}
- if(Zeny >= 40*@bought_quantity[@i]){
- set Zeny, Zeny - 40*@bought_quantity[@i];
- getitem 501, @bought_quantity[@i];
- set $@rpotsleft, $@rpotsleft - @bought_quantity[@i];
+ if(Zeny >= 40*@bought_quantity[.@i]) {
+ Zeny -= 40*@bought_quantity[.@i];
+ getitem Red_Potion, @bought_quantity[.@i];
+ $@rpotsleft -= @bought_quantity[.@i];
} else {
mes "You have insufficient cash.";
close;
}
- } else {
- if(@bought_quantity[@i] > $@opotsleft){
- if($@opotsleft > 0){
- set @bought_quantity[@i], $@opotsleft;
+ } else /*if (@bought_nameid[.@i] == Orange_Potion)*/ {
+ if(@bought_quantity[.@i] > $@opotsleft) {
+ if($@opotsleft > 0) {
+ @bought_quantity[.@i] = $@opotsleft;
} else {
mes "We are out of orange potions!";
close;
}
}
- if(Zeny >= 200*@bought_quantity[@i]){
- set Zeny, Zeny - 200*@bought_quantity[@i];
- getitem 502, @bought_quantity[@i];
- set $@opotsleft, $@opotsleft - @bought_quantity[@i];
+ if(Zeny >= 200*@bought_quantity[.@i]) {
+ Zeny -= 200*@bought_quantity[.@i];
+ getitem Orange_Potion, @bought_quantity[.@i];
+ $@opotsleft -= @bought_quantity[.@i];
} else {
mes "You have insufficient cash.";
close;
@@ -88,8 +86,8 @@ OnBuyItem:
close;
OnInit:
- npcshopitem "dyn_shop1", 501,40,502,200;
- set $@rpotsleft, 10;
- set $@opotsleft, 10;
+ npcshopitem "dyn_shop1", Red_Potion, 40, Orange_Potion, 200;
+ $@rpotsleft = 10;
+ $@opotsleft = 10;
end;
}
diff --git a/doc/sample/npc_extend_shop.txt b/doc/sample/npc_extend_shop.txt
index 1ca4ed7b8..31ed0af43 100644
--- a/doc/sample/npc_extend_shop.txt
+++ b/doc/sample/npc_extend_shop.txt
@@ -1,30 +1,351 @@
-//===== rAthena Script =======================================
+//===== Hercules Script ======================================
//= Sample: Extended Shops
//===== By: ==================================================
-//= rAthena Dev Team
+//= Hercules Dev Team
//===== Current Version: =====================================
-//= 20121003
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= An example of shop NPCs.
//============================================================
-prontera,182,213,3 shop Super Novice Shop 716,1243:-1,2112:-1,2340:-1,2352:-1,2414:-1,2510:-1,2628:-1,5055:-1
-prontera,149,139,5 shop Whips Merchant 58,1951:-1,1953:-1,1955:-1,1957:-1,1959:-1,1961:-1,1962:-1,1963:-1,1964:-1
-prontera,162,175,3 shop Headgears Merchant 1 73,2209:-1,2210:-1,2211:-1,2221:-1,2223:-1,2217:-1,2227:-1,2231:-1,2225:-1,2229:-1
-prontera,162,172,3 shop Headgears Merchant 2 73,2203:-1,2212:-1,2218:-1,2239:-1,2241:-1,2242:-1,2243:-1,2263:-1,2265:-1,2276:-1,2288:-1,2291:-1,2297:-1
-prontera,162,169,3 shop Armours Merchant 73,2311:-1,2313:-1,2315:-1,2317:-1,2318:-1,2320:-1,2322:-1,2324:-1,2326:-1,2327:-1,2329:-1,2331:-1,2334:-1,2336:-1,2337:-1,2342:-1
-prontera,162,166,3 shop Shields Merchant 73,2102:-1,2104:-1,2106:-1,2108:-1,2109:-1,2110:-1,2111:-1
-prontera,162,163,3 shop Boots Merchant 73,2402:-1,2404:-1,2406:-1,2407:-1,2412:-1,2413:-1
-prontera,162,160,3 shop Robes Merchant 73,2502:-1,2504:-1,2506:-1,2507:-1,2508:-1,2509:-1
-prontera,162,157,3 shop Accessory Merchant 73,2601:-1,2602:-1,2603:-1,2604:-1,2605:-1,2607:-1,2608:-1,2615:-1,2616:-1,2618:-1,2619:-1
-prontera,162,154,3 shop Arrows Merchant 73,1750:-1,1751:-1,1752:-1,1753:-1,1754:-1,1755:-1,1756:-1,1757:-1,1758:-1,1759:-1,1760:-1,1761:-1,1762:-1,1763:-1,1764:-1,1765:-1,1766:-1,1767:-1,1768:-1,1769:-1
-prontera,162,151,3 shop Alchemist Shop 73.7127:-1,7128:-1,7129:-1,7130:-1,7131:-1,7132:-1,7133:-1,7144:-1,7134:-1,1093:-1
-prontera,162,148,3 shop Taming Merchant 73,619:-1,620:-1,621:-1,623:-1,624:-1,625:-1,626:-1,627:-1,628:-1,629:-1,630:-1,631:-1,632:-1,633:-1,634:-1,635:-1,636:-1,637:-1,638:-1,639:-1,640:-1,641:-1,642:-1,659:-1
-prontera,162,145,3 shop Pet Equipment 73,10001:-1,10002:-1,10003:-1,10004:-1,10005:-1,10006:-1,10007:-1,10008:-1,10009:-1,10010:-1,10011:-1,10012:-1,10013:-1,10014:-1,10015:-1,10016:-1,10017:-1,10018:-1,10019:-1,10020:-1
-prontera,148,234,5 shop Weapon Card Merchant 80,4004:100000,4018:100000,4025:100000,4026:100000,4019:100000,4029:100000,4043:100000,4017:100000,4020:100000,4024:100000,4037:100000,4055:100000,4057:100000,4076:100000,4096:100000,4104:100000,4030:100000,4049:100000,4062:100000,4069:100000,4085:100000,4007:100000,4060:100000,4063:100000,4068:100000,4080:100000,4094:100000,4111:100000,4118:100000,4082:20700,4092:100000,4126:100000,4072:100000,4115:100000,4035:100000,4086:100000,4106:100000,4117:100000,4125:100000
-prontera,148,231,5 shop Headgear Card Merchant 80,4010:100000,4039:100000,4046:100000,4052:100000,4087:100000,4110:100000,4112:100000,4122:100000,4127:100000
-prontera,146,229,5 shop Armor Card Merchant 80,4003:100000,4008:100000,4011:100000,4014:100000,4016:100000,4021:100000,4023:100000,4031:100000,4078:100000,4089:100000,4098:100000,4099:100000,4101:100000,4114:100000,4119:100000,4141:100000,4061:100000,4105:100000
-prontera,144,227,5 shop Shield Card Merchant 80,4013:100000,4032:100000,4058:100000,4059:100000,4066:100000,4074:100000,4083:100000,4120:100000,4124:100000,4136:100000,4138:100000,4045:100000,4067:100000,4075:100000,4090:100000
-prontera,142,225,5 shop Robe Card Merchant 80,4056:100000,4071:100000,4081:100000,4095:100000,4108:100000,4109:100000,4113:100000,4116:100000,4133:100000,4015:100000,4088:100000,4102:100000,4129:100000
-prontera,140,223,5 shop Shoes Card Merchant 80,4009:100000,4038:100000,4050:100000,4070:100000,4097:100000,4100:100000,4107:100000
-prontera,138,221,5 shop Accessory Card Merchant 80,4022:100500,4027:100500,4028:100500,4034:100500,4051:100500,4064:100500,4091:100500,4079:100500,4033:100500,4040:100500,4044:100500,4048:100500,4053:100500,4073:100500,4077:100500,4084:100500,4093:100500,4103:100500,4139:100500
+prontera,182,213,3 trader Super Novice Shop 4_M_KID2,{
+OnInit:
+ sellitem Novice_Knife;
+ sellitem Novice_Guard;
+ sellitem Novice_Breast;
+ sellitem Novice_Plate;
+ sellitem Novice_Boots;
+ sellitem Novice_Hood;
+ sellitem Novice_Armlet;
+ sellitem Novice_Egg_Cap;
+}
+prontera,149,139,5 trader Whips Merchant 1_M_MERCHANT,{
+OnInit:
+ sellitem Rope_;
+ sellitem Line_;
+ sellitem Wire_;
+ sellitem Rante_;
+ sellitem Tail_;
+ sellitem Whip_;
+ sellitem Lariat;
+ sellitem Rapture_Rose;
+ sellitem Chemeti;
+}
+prontera,162,175,3 trader Headgears Merchant 1 1_F_MERCHANT_01,{
+OnInit:
+ sellitem Ribbon_;
+ sellitem Hair_Band;
+ sellitem Bandana;
+ sellitem Hat_;
+ sellitem Turban_;
+ sellitem Biretta_;
+ sellitem Cap_;
+ sellitem Gemmed_Sallet_;
+ sellitem Goggle_;
+ sellitem Helm_;
+}
+prontera,162,172,3 trader Headgears Merchant 2 1_F_MERCHANT_01,{
+OnInit:
+ sellitem Glasses;
+ sellitem Eye_Bandage;
+ sellitem Flu_Mask;
+ sellitem One_Eyed_Glass;
+ sellitem Granpa_Beard;
+ sellitem Luxury_Sunglasses;
+ sellitem Spinning_Eyes;
+ sellitem Gangster_Patch;
+ sellitem Ganster_Mask;
+ sellitem Eagle_Eyes;
+ sellitem Mr_Scream;
+ sellitem Masquerade;
+ sellitem Goblini_Mask;
+}
+prontera,162,169,3 trader Armours Merchant 1_F_MERCHANT_01,{
+OnInit:
+ sellitem Mink_Coat;
+ sellitem Padded_Armor_;
+ sellitem Chain_Mail_;
+ sellitem Plate_Armor_;
+ sellitem Clothes_Of_The_Lord;
+ sellitem Formal_Suit;
+ sellitem Silk_Robe_;
+ sellitem Scapulare_;
+ sellitem Saint_Robe_;
+ sellitem Holy_Robe;
+ sellitem Wooden_Mail_;
+ sellitem Tights_;
+ sellitem Mage_Coat;
+ sellitem Thief_Clothes_;
+ sellitem Ninja_Suit;
+ sellitem Full_Plate_Armor_;
+}
+prontera,162,166,3 trader Shields Merchant 1_F_MERCHANT_01,{
+OnInit:
+ sellitem Guard_;
+ sellitem Buckler_;
+ sellitem Shield_;
+ sellitem Mirror_Shield_;
+ sellitem Memorize_Book;
+ sellitem Holy_Guard;
+ sellitem Herald_Of_GOD;
+}
+prontera,162,163,3 trader Boots Merchant 1_F_MERCHANT_01,{
+OnInit:
+ sellitem Sandals_;
+ sellitem Shoes_;
+ sellitem Boots_;
+ sellitem Chrystal_Pumps;
+ sellitem Grave_;
+ sellitem Safty_Boots;
+}
+prontera,162,160,3 trader Robes Merchant 1_F_MERCHANT_01,{
+OnInit:
+ sellitem Hood_;
+ sellitem Muffler_;
+ sellitem Manteau_;
+ sellitem Cape_Of_Ancient_Lord;
+ sellitem Ragamuffin_Cape;
+ sellitem Clack_Of_Servival;
+}
+prontera,162,157,3 trader Accessory Merchant 1_F_MERCHANT_01,{
+OnInit:
+ sellitem Ring;
+ sellitem Earring;
+ sellitem Necklace;
+ sellitem Glove;
+ sellitem Brooch;
+ sellitem Clip;
+ sellitem Rosary;
+ sellitem Safety_Ring;
+ sellitem Critical_Ring;
+ sellitem Matyr's_Flea_Guard;
+ sellitem Thimble_Of_Archer;
+}
+prontera,162,154,3 trader Arrows Merchant 1_F_MERCHANT_01,{
+OnInit:
+ sellitem Arrow;
+ sellitem Silver_Arrow;
+ sellitem Fire_Arrow;
+ sellitem Steel_Arrow;
+ sellitem Crystal_Arrow;
+ sellitem Arrow_Of_Wind;
+ sellitem Stone_Arrow;
+ sellitem Immatrial_Arrow;
+ sellitem Stun_Arrow;
+ sellitem Freezing_Arrow;
+ sellitem Flash_Arrow;
+ sellitem Curse_Arrow;
+ sellitem Rusty_Arrow;
+ sellitem Poison_Arrow;
+ sellitem Incisive_Arrow;
+ sellitem Oridecon_Arrow;
+ sellitem Arrow_Of_Counter_Evil;
+ sellitem Arrow_Of_Shadow;
+ sellitem Sleep_Arrow;
+ sellitem Silence_Arrow;
+}
+prontera,162,151,3 trader Alchemist Shop 1_F_MERCHANT_01,{
+OnInit:
+ sellitem Alcol_Create_Book;
+ sellitem FireBottle_Create_Book;
+ sellitem Acid_Create_Book;
+ sellitem Plant_Create_Book;
+ sellitem Mine_Create_Book;
+ sellitem Coating_Create_Book;
+ sellitem Slim_Potion_Create_Book;
+ sellitem Normal_Potion_Book;
+ sellitem Medicine_Bowl;
+ sellitem Empty_Potion;
+}
+prontera,162,148,3 trader Taming Merchant 1_F_MERCHANT_01,{
+OnInit:
+ sellitem Unripe_Apple;
+ sellitem Orange_Juice;
+ sellitem Bitter_Herb;
+ sellitem Rainbow_Carrot;
+ sellitem Earthworm_The_Dude;
+ sellitem Rotten_Fish;
+ sellitem Lusty_Iron;
+ sellitem Monster_Juice;
+ sellitem Sweet_Milk;
+ sellitem Well_Dried_Bone;
+ sellitem Singing_Flower;
+ sellitem Dew_Laden_Moss;
+ sellitem Deadly_Noxious_Herb;
+ sellitem Fatty_Chubby_Earthworm;
+ sellitem Baked_Yam;
+ sellitem Tropical_Banana;
+ sellitem Horror_Of_Tribe;
+ sellitem No_Recipient;
+ sellitem Old_Broom;
+ sellitem Silver_Knife_Of_Chaste;
+ sellitem Armlet_Of_Obedience;
+ sellitem Shining_Stone;
+ sellitem Contracts_In_Shadow;
+ sellitem Book_Of_Devil;
+ sellitem Heart_Of_Her;
+}
+prontera,162,145,3 trader Pet Equipment 1_F_MERCHANT_01,{
+OnInit:
+ sellitem Skull_Helm;
+ sellitem Monster_Oxygen_Mask;
+ sellitem Transparent_Headgear;
+ sellitem Pacifier;
+ sellitem Wig;
+ sellitem Queen's_Hair_Ornament;
+ sellitem Silk_Ribbon;
+ sellitem Punisher;
+ sellitem Wild_Flower;
+ sellitem Battered_Pot;
+ sellitem Stellar_Hairpin;
+ sellitem Tiny_Egg_Shell;
+ sellitem Backpack;
+ sellitem Rocker_Glasses;
+ sellitem Green_Lace;
+ sellitem Golden_Bell;
+ sellitem Bark_Shorts;
+ sellitem Monkey_Circlet;
+ sellitem Red_Muffler;
+ sellitem Sword_Of_Grave_Keeper;
+}
+prontera,148,234,5 trader Weapon Card Merchant 1_F_PUBGIRL,{
+OnInit:
+ sellitem Drops_Card, 100000;
+ sellitem Andre_Larva_Card, 100000;
+ sellitem Skeleton_Card, 100000;
+ sellitem Thief_Bug_Female_Card, 100000;
+ sellitem Hornet_Card, 100000;
+ sellitem Wolf_Card, 100000;
+ sellitem Andre_Card, 100000;
+ sellitem Savage_Babe_Card, 100000;
+ sellitem Farmiliar_Card, 100000;
+ sellitem Plankton_Card, 100000;
+ sellitem Snake_Card, 100000;
+ sellitem Marina_Card, 100000;
+ sellitem Metaller_Card, 100000;
+ sellitem Magnolia_Card, 100000;
+ sellitem Zenorc_Card, 100000;
+ sellitem Requiem_Card, 100000;
+ sellitem Mandragora_Card, 100000;
+ sellitem Vadon_Card, 100000;
+ sellitem Anacondaq_Card, 100000;
+ sellitem Drainliar_Card, 100000;
+ sellitem Orc_Skeleton_Card, 100000;
+ sellitem Pecopeco_Egg_Card, 100000;
+ sellitem Goblin_Card, 100000;
+ sellitem Caramel_Card, 100000;
+ sellitem Scorpion_Card, 100000;
+ sellitem Flora_Card, 100000;
+ sellitem Archer_Skeleton_Card, 100000;
+ sellitem Strouf_Card, 100000;
+ sellitem Petit_Card, 100000;
+ sellitem Desert_Wolf_Card, 20700;
+ sellitem Skel_Worker_Card, 100000;
+ sellitem Minorous_Card, 100000;
+ sellitem Golem_Card, 100000;
+ sellitem Hunter_Fly_Card, 100000;
+ sellitem Hydra_Card, 100000;
+ sellitem Soldier_Skeleton_Card, 100000;
+ sellitem Mummy_Card, 100000;
+ sellitem Side_Winder_Card, 100000;
+ sellitem Deviace_Card, 100000;
+}
+prontera,148,231,5 trader Headgear Card Merchant 1_F_PUBGIRL,{
+OnInit:
+ sellitem Wilow_Card, 100000;
+ sellitem Stainer_Card, 100000;
+ sellitem Martin_Card, 100000;
+ sellitem Elder_Wilow_Card, 100000;
+ sellitem Giearth_Card, 100000;
+ sellitem Ghoul_Card, 100000;
+ sellitem Marduk_Card, 100000;
+ sellitem Deviruchi_Card, 100000;
+ sellitem Nightmare_Card, 100000;
+}
+prontera,146,229,5 trader Armor Card Merchant 1_F_PUBGIRL,{
+OnInit:
+ sellitem Pupa_Card, 100000;
+ sellitem Picky_Card, 100000;
+ sellitem Picky__Card, 100000;
+ sellitem Roda_Frog_Card, 100000;
+ sellitem Thief_Bug_Card, 100000;
+ sellitem Rocker_Card, 100000;
+ sellitem Desert_Wolf_Babe_Card, 100000;
+ sellitem Pecopeco_Card, 100000;
+ sellitem Savage_Card, 100000;
+ sellitem Sword_Fish_Card, 100000;
+ sellitem Dokebi_Card, 100000;
+ sellitem Pasana_Card, 100000;
+ sellitem Sand_Man_Card, 100000;
+ sellitem Argiope_Card, 100000;
+ sellitem Bathory_Card, 100000;
+ sellitem Evil_Druid_Card, 100000;
+ sellitem Cornutus_Card, 100000;
+ sellitem Marc_Card, 100000;
+}
+prontera,144,227,5 trader Shield Card Merchant 1_F_PUBGIRL,{
+OnInit:
+ sellitem Andre_Egg_Card, 100000;
+ sellitem Ambernite_Card, 100000;
+ sellitem Thara_Frog_Card, 100000;
+ sellitem Soldier_Andre_Card, 100000;
+ sellitem Orc_Warrior_Card, 100000;
+ sellitem BigFoot_Card, 100000;
+ sellitem Rafflesia_Card, 100000;
+ sellitem Petit__Card, 100000;
+ sellitem Medusa_Card, 100000;
+ sellitem Khalitzburg_Card, 100000;
+ sellitem Anubis_Card, 100000;
+ sellitem Horn_Card, 100000;
+ sellitem Megalodon_Card, 100000;
+ sellitem Argos_Card, 100000;
+ sellitem Munak_Card, 100000;
+}
+prontera,142,225,5 trader Robe Card Merchant 1_F_PUBGIRL,{
+OnInit:
+ sellitem Dustiness_Card, 100000;
+ sellitem Orc_Zombie_Card, 100000;
+ sellitem Hode_Card, 100000;
+ sellitem Marse_Card, 100000;
+ sellitem Myst_Card, 100000;
+ sellitem Jakk_Card, 100000;
+ sellitem Marionette_Card, 100000;
+ sellitem Isis_Card, 100000;
+ sellitem Daydric_Card, 100000;
+ sellitem Condor_Card, 100000;
+ sellitem Frilldora_Card, 100000;
+ sellitem Whisper_Card, 100000;
+ sellitem Baphomet__Card, 100000;
+}
+prontera,140,223,5 trader Shoes Card Merchant 1_F_PUBGIRL,{
+OnInit:
+ sellitem Chonchon_Card, 100000;
+ sellitem Zombie_Card, 100000;
+ sellitem Thief_Bug_Male_Card, 100000;
+ sellitem Eggyra_Card, 100000;
+ sellitem Matyr_Card, 100000;
+ sellitem Sohee_Card, 100000;
+ sellitem Verit_Card, 100000;
+}
+prontera,138,221,5 trader Accessory Card Merchant 1_F_PUBGIRL,{
+OnInit:
+ sellitem Spore_Card, 100500;
+ sellitem Kukre_Card, 100500;
+ sellitem Tarou_Card, 100500;
+ sellitem Worm_Tail_Card, 100500;
+ sellitem Yoyo_Card, 100500;
+ sellitem Zerom_Card, 100500;
+ sellitem Kobold_Card, 100500;
+ sellitem Mantis_Card, 100500;
+ sellitem Poporing_Card, 100500;
+ sellitem Creamy_Card, 100500;
+ sellitem Smokie_Card, 100500;
+ sellitem Poison_Spore_Card, 100500;
+ sellitem Vitata_Card, 100500;
+ sellitem Pirate_Skel_Card, 100500;
+ sellitem Phen_Card, 100500;
+ sellitem Marine_Sphere_Card, 100500;
+ sellitem Obeaune_Card, 100500;
+ sellitem Horong_Card, 100500;
+ sellitem Joker_Card, 100500;
+}
diff --git a/doc/sample/npc_live_dialogues.txt b/doc/sample/npc_live_dialogues.txt
index 8778f6c50..9ce628c30 100644
--- a/doc/sample/npc_live_dialogues.txt
+++ b/doc/sample/npc_live_dialogues.txt
@@ -3,13 +3,13 @@
//===== By: ==================================================
//= Lupus
//===== Current Version: =====================================
-//= 20070320
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= An example of an NPC with live dialogue.
//= Note: This relies on Global_Functions.txt to run.
//============================================================
-prontera,167,177,5 script Luppy 1107,{
+prontera,167,177,5 script Luppy DESERT_WOLF_B,{
mes "[Luppy]";
// Say a random greeting from Global_Functions.txt
@@ -20,35 +20,34 @@ prontera,167,177,5 script Luppy 1107,{
mes callfunc("F_Sex","What a beautiful lady!","What a handsome man!");
// Add some random greeting and goodbye into the menu
- menu callfunc("F_Hi"),-, callfunc("F_Bye"),M_BYE;
+ if (select(callfunc("F_Hi"), callfunc("F_Bye")) != 1) {
+ mes "[Luppy]";
+ // Add some random goodbye from Global_Functions.txt
+ mes callfunc("F_Bye");
+ close;
+ }
mes "[Luppy]";
// Give a random prize from set list of items
- if(@gotstuff){
+ if (@gotstuff) {
// Again, say stuff according to player's gender
mes "I like "+callfunc("F_Sex","smiling ladies!","bloody pirates!");
// Show one of 3 emotion from the list (we added ,1 to show emotion over PLAYER's head)
- emotion callfunc("F_RandMes",3,e_scissors,e_kis,e_pat),1;
+ emotion callfunc("F_RandMes", 3, e_scissors, e_kis, e_pat), 1;
close;
}
// We set a temp var to give present just once. Player can get more by relogging.
- set @gotstuff,1;
+ @gotstuff = 1;
// Get item ID from the list of presents: Apple, Mastela Fruit, Yggdrasil Seed or Orange Juice
- set @itemIDfromList, callfunc("F_RandMes",4,512,522,608,620);
+ .@itemIDfromList = callfunc("F_RandMes", 4, Apple, Fruit_Of_Mastela, Seed_Of_Yggdrasil, Orange_Juice);
// Again, say stuff according to player's gender
- mes "Hey, "+callfunc("F_Sex","sister!","brother!")+" I have "+getitemname(@itemIDfromList)+" for you!";
+ mes "Hey, "+callfunc("F_Sex","sister!","brother!")+" I have "+getitemname(.@itemIDfromList)+" for you!";
// Get the item from the list
- getitem @itemIDfromList,1;
- close;
-
-M_BYE:
- mes "[Luppy]";
- // Add some random goodbye from Global_Functions.txt
- mes callfunc("F_Bye");
+ getitem .@itemIDfromList, 1;
close;
}
diff --git a/doc/sample/npc_shop_test.txt b/doc/sample/npc_shop_test.txt
deleted file mode 100644
index 5e492b257..000000000
--- a/doc/sample/npc_shop_test.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-//===== Hercules Script =======================================
-//= Sample: Shops
-//===== By: ==================================================
-//= Hercules Dev Team
-//===== Current Version: =====================================
-//= 20090206
-//===== Description: =========================================
-//= An example of shop NPCs.
-//============================================================
-
-// Near fountain in Prontera
-prontera,156,192,3 shop Card Shop1 95,4001:100,4002:100,4003:100,4004:100,4005:100,4006:100,4007:100,4008:100,4009:100,4010:100,4011:100,4012:100,4013:100,4014:100,4015:100,4016:100,4017:100,4018:100,4019:100,4020:100,4021:100,4022:100,4023:100,4024:100,4025:100,4026:100,4027:100,4028:100,4029:100,4030:100,4031:100,4032:100,4033:100,4034:100,4035:100,4036:100,4037:100,4038:100,4039:100,4040:100,4041:100,4042:100,4043:100,4044:100,4045:100,4046:100,4047:100,4048:100,4049:100,4050:100
-prontera,154,192,1 shop Card Shop2 123,4051:100,4052:100,4053:100,4054:100,4055:100,4056:100,4057:100,4058:100,4059:100,4060:100,4061:100,4062:100,4063:100,4064:100,4065:100,4066:100,4067:100,4068:100,4069:100,4070:100,4071:100,4072:100,4073:100,4074:100,4075:100,4076:100,4077:100,4078:100,4079:100,4080:100,4081:100,4082:100,4083:100,4084:100,4085:100,4086:100,4087:100,4088:100,4089:100,4090:100,4091:100,4092:100,4093:100,4094:100,4095:100,4096:100,4097:100,4098:100,4099:100,4100:100
-prontera,158,192,1 shop Card Shop3 67,4101:100,4102:100,4103:100,4104:100,4105:100,4106:100,4107:100,4108:100,4109:100,4110:100,4111:100,4112:100,4113:100,4114:100,4115:100,4116:100,4117:100,4118:100,4119:100,4120:100,4121:100,4122:100,4123:100,4124:100,4125:100,4126:100,4127:100,4128:100,4129:100,4130:100,4131:100,4132:100,4133:100,4134:100,4135:100,4136:100,4137:100,4138:100,4139:100,4140:100,4141:100,4142:100,4143:100,4144:100,4145:100,4146:100,4147:100,4148:100
-prontera,144,205,1 shop Headgear Shop1 71,2201:100,2202:100,2203:100,2204:100,2205:100,2206:100,2207:100,2208:100,2209:100,2210:100,2211:100,2212:100,2213:100,2214:100,2215:100,2216:100,2217:100,2218:100,2219:100,2220:100,2221:100,2222:100,2223:100,2224:100,2225:100,2226:100,2227:100,2228:100,2229:100,2230:100,2231:100,2232:100,2233:100,2234:100,2235:100,2236:100,2237:100,2239:100,2240:100,2241:100,2242:100,2243:100,2244:100,2245:100,2246:100,2247:100,2248:100,2249:100,2250:100
-prontera,144,203,3 shop Headgear Shop2 101,2251:100,2252:100,2253:100,2254:100,2255:100,2256:100,2257:100,2258:100,2259:100,2260:100,2261:100,2262:100,2263:100,2264:100,2265:100,2266:100,2267:100,2268:100,2269:100,2270:100,2271:100,2272:100,2273:100,2274:100,2275:100,2276:100,2277:100,2278:100,2279:100,2280:100,2281:100,2282:100,2283:100,2284:100,2285:100,2286:100,2287:100,2288:100,2289:100,2290:100,2291:100,2292:100,2293:100,2294:100,2295:100,2296:100,2297:100,2298:100,2299:100
-prontera,144,201,3 shop Headgear Shop3 69,5001:100,5002:100,5003:100,5004:100,5005:100,5006:100,5007:100,5008:100,5009:100,5010:100,5011:100,5012:100,5013:100,5014:100,5015:100,5016:100,5017:100,5018:100,5019:100
-prontera,167,202,5 shop Accessories Shop 102,2601:100,2602:100,2603:100,2604:100,2605:100,2607:100,2608:100,2609:100,2610:100,2611:100,2612:100,2613:100,2614:100,2615:100,2616:100,2617:100,2618:100,2619:100,2620:100,2621:100,2622:100,2623:100,2624:100,2625:100,2626:100,2627:100,2628:100
-prontera,167,204,6 shop General Store 96,501:100,502:100,503:100,504:100,505:100,506:100,507:100,508:100,509:100,510:100,511:100,512:100,513:100,514:100,515:100,516:100,517:100,518:100,519:100,520:100,521:100,522:100,523:100,525:100,526:100,528:100,529:100,530:100,531:100,532:100,533:100,534:100,535:100,536:100,537:100,538:100,539:100,601:100,602:100,603:100,604:100,605:100,606:100,607:100,608:100,609:100,610:100
-prontera,167,206,6 shop Blacksmith Shop 90,714:100,715:100,716:100,717:100,718:100,719:100,720:100,721:100,722:100,723:100,724:100,725:100,726:100,727:100,728:100,729:100,730:100,731:100,732:100,733:100,756:100,757:100,984:100,985:100,990:100,991:100,992:100,993:100,994:100,995:100,996:100,997:100,1010:100,1011:100,998:100,999:100,1000:100,1001:100,1002:100,1003:100,913:100,920:100,718:100,958:100,957:100,922:100,963:100,923:100,968:100,1005:100,612:100,615:100,989:100
-prontera,164,204,5 shop Japan Store Limited 81,542:100,543:100,1766:100
-
-// South-central Prontera
-prontera,141,175,5 shop Bow man 102,1705:100,1711:100,1716:100,1719:100,1720:100,1750:1,1751:1,1752:1,1753:1,1754:1,1755:1,1756:1,1766:1,1065:1
-prontera,141,173,5 shop Sword shop 102,1117:100,1125:100,1155:100,1162:100,1130:100,1131:100,1132:100,1133:100,1134:100,1135:100,1136:100,1137:100,1138:100,1139:100,1140:100,1141:100,1161:100,1162:100,1163:100,1164:100,1165:100,1166:100,1167:100,1168:100,1169:100,1170:100
-prontera,141,171,5 shop Spear man 102,1408:100,1461:100,1464:100,1413:100,1414:100,1415:100,1416:100,1466:100,1467:100,1468:100,1469:100,1470:100,1471:100
-prontera,141,169,5 shop Axe man 102,1352:100,1355:100,1361:100,1363:100,1364:100,1365:100,1366:100,1367:100,1368:100,1369:100
-prontera,141,167,5 shop Dagger man 102,1208:100,1220:100,1223:100,1224:100,1225:100,1226:100,1227:100,1228:100,1229:100,1230:100,1231:100,1232:100,1233:100,1234:100,1235:100,1236:100,1237:100
-prontera,141,165,5 shop Mace shop 102,1505:100,1520:100,1514:100,1517:100,1522:100,1523:100,1524:100,1525:100,1526:100,1527:100,1528:100
-prontera,141,163,5 shop Katar shop 102,1251:100,1253:100,1255:100,1256:100,1257:100,1258:100,1259:100,1260:100,1261:100
-prontera,141,161,5 shop Rod man 102,1602:100,1608:100,1611:100,1613:100,1614:100,1615:100
-prontera,141,159,5 shop Bookstore 102,1550:100,1551:100,1552:100,1553:100,1554:100,1555:100,1556:100,1557:100,1558:100
-prontera,141,177,5 shop Armor shop 102,2306:100,2339:100,2311:100,2331:100,2336:100,2337:100,2326:100,2327:100,2315:100,2317:100,2102:100,2104:100,2106:100,2108:100,2402:100,2404:100,2406:100,2407:100,2408:100,2409:100,2502:100,2504:100,2506:100,2507:100,2508:100
-
-// Pet Groomer Merchant
-prontera,218,211,4 shop Pet Groomer 125,537:2500,643:3000,10013:1500,10014:2000
-izlude,164,138,4 shop Pet Groomer 124,537:2500,643:3000,10013:1500,10014:2000
-morocc,269,167,4 shop Pet Groomer 125,537:2500,643:3000,10013:1500,10014:2000
-geffen,193,152,4 shop Pet Groomer 124,537:2500,643:3000,10013:1500,10014:2000
-payon,142,104,4 shop Pet Groomer 124,537:2500,643:3000,10013:1500,10014:2000
diff --git a/doc/sample/npc_test_array.txt b/doc/sample/npc_test_array.txt
index 36b54a3fe..a429ffb93 100644
--- a/doc/sample/npc_test_array.txt
+++ b/doc/sample/npc_test_array.txt
@@ -3,41 +3,41 @@
//===== By: ==================================================
//= Hercules Dev Team
//===== Current Version: =====================================
-//= 20090206
+//= 20131225
//===== Description: =========================================
//= Demonstrates array commands.
//============================================================
-prontera,164,190,1 script Array Test 112,{
- set @hoge[0],1;
- set @hoge[1],5;
+prontera,164,190,1 script Array Test 4_F_KAFRA6,{
+ .@hoge[0] = 1;
+ .@hoge[1] = 5;
mes "Please enter a value for hoge[2].";
next;
- input @hoge[2];
- mes "hoge => " + @hoge;
- mes "hoge[0]=> " + @hoge[0];
- mes "hoge[1]=> " + @hoge[1];
- mes "hoge[2]=> " + @hoge[2];
+ input .@hoge[2];
+ mes "hoge => " + .@hoge;
+ mes "hoge[0]=> " + .@hoge[0];
+ mes "hoge[1]=> " + .@hoge[1];
+ mes "hoge[2]=> " + .@hoge[2];
next;
- setarray @hoge[1],2,3,4,5;
+ setarray .@hoge[1],2,3,4,5;
mes "true: 5,1,2,3,4";
- mes "hoge size = "+ getarraysize(@hoge);
- mes "hoge[0]=> " + @hoge[0];
- mes "hoge[1]=> " + @hoge[1];
- mes "hoge[2]=> " + @hoge[2];
- mes "hoge[3]=> " + @hoge[3];
+ mes "hoge size = "+ getarraysize(.@hoge);
+ mes "hoge[0]=> " + .@hoge[0];
+ mes "hoge[1]=> " + .@hoge[1];
+ mes "hoge[2]=> " + .@hoge[2];
+ mes "hoge[3]=> " + .@hoge[3];
next;
- copyarray @fuga[0],@hoge[2],2;
+ copyarray .@fuga[0],.@hoge[2],2;
mes "true: 3,4,0";
- mes "fuga[0]=> " + @fuga[0];
- mes "fuga[1]=> " + @fuga[1];
- mes "fuga[2]=> " + @fuga[2];
+ mes "fuga[0]=> " + .@fuga[0];
+ mes "fuga[1]=> " + .@fuga[1];
+ mes "fuga[2]=> " + .@fuga[2];
next;
- deletearray @hoge[1],2;
+ deletearray .@hoge[1],2;
mes "true: 1,4,5,0";
- mes "hoge[0]=> " + @hoge[0];
- mes "hoge[1]=> " + @hoge[1];
- mes "hoge[2]=> " + @hoge[2];
- mes "hoge[3]=> " + @hoge[3];
+ mes "hoge[0]=> " + .@hoge[0];
+ mes "hoge[1]=> " + .@hoge[1];
+ mes "hoge[2]=> " + .@hoge[2];
+ mes "hoge[3]=> " + .@hoge[3];
close;
}
diff --git a/doc/sample/npc_test_chat.txt b/doc/sample/npc_test_chat.txt
index ca81840ea..adc53c763 100644
--- a/doc/sample/npc_test_chat.txt
+++ b/doc/sample/npc_test_chat.txt
@@ -8,7 +8,7 @@
//= Demonstrates waitingroom commands.
//============================================================
-prontera,158,182,0 script Chat Test::test0001 116,{
+prontera,158,182,0 script Chat Test::test0001 4_F_KAFRA2,{
mes "Trigger Number: " + getwaitingroomstate(2);
mes "Trigger State: " + getwaitingroomstate(3);
switch(select("Enable:Disable:Delete:Create")) {
diff --git a/doc/sample/npc_test_checkweight.txt b/doc/sample/npc_test_checkweight.txt
index e2560cedf..0f383ffe4 100644
--- a/doc/sample/npc_test_checkweight.txt
+++ b/doc/sample/npc_test_checkweight.txt
@@ -3,147 +3,141 @@
//===== By: ==================================================
//= Hercules Dev Team
//===== Current Version: =====================================
-//= 20121113
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= Demonstrates 'checkweight' command.
//============================================================
-prontera,161,181,6 script ChkSpace 763,{
+prontera,161,181,6 script ChkSpace 4_M_JPN,{
+ function ChkResult;
+ function FinalReport;
-function ChkResult;
-function FinalReport;
-
-L_RESET:
+ // Reset
resetlvl(1);
- getinventorylist;
- for(set .@i,0; .@i < @inventorylist_count; set .@i,.@i+1){
- delitem(@inventorylist_id[.@i],@inventorylist_amount[.@i]); //clear inventory
+ getinventorylist;
+ for (.@i = 0; .@i < @inventorylist_count; ++.@i) {
+ delitem(@inventorylist_id[.@i], @inventorylist_amount[.@i]); //clear inventory
}
-
-L_TEST1: //basic backward chk
+ //basic backward chk
.@testid = 0;
.@succes = 0;
- .@ret = checkweight(512,10);
- set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be success
- .@ret = checkweight("Apple",10);
- set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be success
- .@ret = checkweight(6320,33000);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure too many item amount item weight=0
- .@ret = checkweight("Premium_Reset_Stone",33000);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure too many item amount
- .@ret = checkweight(717,500);
- set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be success weight based on max weight=2030
- .@ret = checkweight(717,1000);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure weight based on max weight=2030
- .@ret = checkweight(2794,100);
- set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be success
- .@ret = checkweight(2794,101);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure (with MAX_INVENTORY = 100)
- .@ret = checkweight(-1,1);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure invalide item id
- .@ret = checkweight(512,0);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure invalide amount
+ .@ret = checkweight(Apple, 10);
+ .@succes += ChkResult(.@testid++, 1, .@ret); //should be success
+ .@ret = checkweight("Apple", 10);
+ .@succes += ChkResult(.@testid++, 1, .@ret); //should be success
+ .@ret = checkweight(Premium_Reset_Stone, 33000);
+ .@succes += ChkResult(.@testid++, 0, .@ret); //should be failure too many item amount item weight=0
+ .@ret = checkweight("Premium_Reset_Stone", 33000);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure too many item amount
+ .@ret = checkweight(Blue_Gemstone, 500);
+ .@success += ChkResult(.@testid++, 1, .@ret); //should be success weight based on max weight=2030
+ .@ret = checkweight(Blue_Gemstone, 1000);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure weight based on max weight=2030
+ .@ret = checkweight(Magic_Stone_Ring, 100);
+ .@success += ChkResult(.@testid++, 1, .@ret); //should be success
+ .@ret = checkweight(Magic_Stone_Ring, 101);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure (with MAX_INVENTORY = 100)
+ .@ret = checkweight(-1, 1);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure invalid item id
+ .@ret = checkweight(Apple, 0);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure invalid amount
debugmes "End backward test";
- FinalReport(.@testid,.@succes);
-
+ FinalReport(.@testid, .@succes);
-L_TEST2: //update using list test
+ //update using list test
.@testid = 0;
.@succes = 0;
- .@ret = checkweight(512,10,513,10);
- set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be success
- .@ret = checkweight("Apple",10,"Banana",10);
- set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be success
- .@ret = checkweight(512,80,513,33000);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure
- .@ret = checkweight("Apple",80,"Banana",33000);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure too many item amount
- .@ret = checkweight("Apple",10,"Banana",21,512);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure invalid nb of args
- .@ret = checkweight(717,500,716,100);
- set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be succes weight 1800/2030
- .@ret = checkweight(717,500,716,500);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure weight 3000/2030
- .@ret = checkweight(2794,95,2795,5);
- set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be success
- .@ret = checkweight(2794,95,2795,10);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure (with MAX_INVENTORY = 100)
- .@ret = checkweight(512,1,-1,1);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure invalide item id
- .@ret = checkweight(512,1,513,0);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure invalide amount
- .@ret = checkweight(6320,31000,6320,2000);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure overamount inventory
- .@ret = checkweight(512,1,513,1,514,1,515,1);
- set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be sucess
-
+ .@ret = checkweight(Apple, 10, Banana, 10);
+ .@success += ChkResult(.@testid++, 1, .@ret); //should be success
+ .@ret = checkweight("Apple", 10, "Banana", 10);
+ .@success += ChkResult(.@testid++, 1, .@ret); //should be success
+ .@ret = checkweight(Apple, 80, Banana, 33000);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure
+ .@ret = checkweight("Apple", 80, "Banana", 33000);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure too many item amount
+ .@ret = checkweight("Apple", 10, "Banana", 21, Apple);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure invalid nb of args
+ .@ret = checkweight(Blue_Gemstone, 500, Red_Gemstone, 100);
+ .@success += ChkResult(.@testid++, 1, .@ret); //should be succes weight 1800/2030
+ .@ret = checkweight(Blue_Gemstone, 500, Red_Gemstone, 500);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure weight 3000/2030
+ .@ret = checkweight(Magic_Stone_Ring, 95, Green_Apple_Ring, 5);
+ .@success += ChkResult(.@testid++, 1, .@ret); //should be success
+ .@ret = checkweight(Magic_Stone_Ring, 95, Green_Apple_Ring, 10);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure (with MAX_INVENTORY = 100)
+ .@ret = checkweight(Apple, 1, -1, 1);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure invalid item id
+ .@ret = checkweight(Apple, 1, Banana, 0);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure invalid amount
+ .@ret = checkweight(Premium_Reset_Stone, 31000, Premium_Reset_Stone, 2000);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure overamount inventory
+ .@ret = checkweight(Apple, 1, Banana, 1, Grape, 1, Carrot, 1);
+ .@success += ChkResult(.@testid++, 1, .@ret); //should be sucess
+
debugmes "End update by list tests";
- FinalReport(.@testid,.@succes);
+ FinalReport(.@testid, .@succes);
-L_TEST3: //update using array tests
+ //update using array tests
.@testid = 0;
.@succes = 0;
- setarray .@item[0], 512,513,514,515;
- setarray .@count[0], 1,5,9,12;
- .@ret = checkweight2(.@item,.@count);
- set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be sucess
- cleararray .@item[0], 0, 4;
+ setarray .@item[0], Apple, Banana, Grape, Carrot;
+ setarray .@count[0], 1, 5, 9, 12;
+ .@ret = checkweight2(.@item, .@count);
+ .@success += ChkResult(.@testid++, 1, .@ret); //should be sucess
+ cleararray .@item[0], 0, 4;
cleararray .@count[0], 0, 4;
- setarray .@item[0], 512,513,514,515;
- setarray .@count[0], 1,5,-1,12;
- .@ret = checkweight2(.@item,.@count);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure, invalide amout
- cleararray .@item[0], 0, 4;
+ setarray .@item[0], Apple, Banana, Grape, Carrot;
+ setarray .@count[0], 1, 5, -1, 12;
+ .@ret = checkweight2(.@item, .@count);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure, invalid amout
+ cleararray .@item[0], 0, 4;
cleararray .@count[0], 0, 4;
- setarray .@item[0], 512,513,514,-1;
- setarray .@count[0], 1,5,15,12;
- .@ret = checkweight2(.@item,.@count);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure, invalide id
- cleararray .@item[0], 0, 4;
+ setarray .@item[0], Apple, Banana, Grape, -1;
+ setarray .@count[0], 1, 5, 15, 12;
+ .@ret = checkweight2(.@item, .@count);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure, invalid id
+ cleararray .@item[0], 0, 4;
cleararray .@count[0], 0, 4;
- setarray .@item[0], 717,715,716,714;
- setarray .@count[0], 300,300,300,300;
- .@ret = checkweight2(.@item,.@count);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure, total by weight
- cleararray .@item[0], 0, 4;
+ setarray .@item[0], Blue_Gemstone, Yellow_Gemstone, Red_Gemstone, Emperium;
+ setarray .@count[0], 300, 300, 300, 300;
+ .@ret = checkweight2(.@item, .@count);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure, total by weight
+ cleararray .@item[0], 0, 4;
cleararray .@count[0], 0, 4;
- setarray .@item[0], 6320,6320;
- setarray .@count[0], 31000,2000;
- .@ret = checkweight2(.@item,.@count);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure, total by weight
- cleararray .@item[0], 0, 2;
+ setarray .@item[0], Premium_Reset_Stone, Premium_Reset_Stone;
+ setarray .@count[0], 31000, 2000;
+ .@ret = checkweight2(.@item, .@count);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure, total by weight
+ cleararray .@item[0], 0, 2;
cleararray .@count[0], 0, 2;
- setarray .@item[0], 2794,2795;
- setarray .@count[0], 95,5;
- .@ret = checkweight2(.@item,.@count);
- set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be success
- setarray .@count[0], 95,10;
- .@ret = checkweight2(.@item,.@count);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure overamount item
- cleararray .@item[0], 0, 2;
+ setarray .@item[0], Magic_Stone_Ring, Green_Apple_Ring;
+ setarray .@count[0], 95, 5;
+ .@ret = checkweight2(.@item, .@count);
+ .@success += ChkResult(.@testid++, 1, .@ret); //should be success
+ setarray .@count[0], 95, 10;
+ .@ret = checkweight2(.@item, .@count);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure overamount item
+ cleararray .@item[0], 0, 2;
cleararray .@count[0], 0, 2;
- setarray .@item[0], 6320,6320,512;
- setarray .@count[0], 1,3;
- .@ret = checkweight2(.@item,.@count);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure, size mistmatch
- cleararray .@item[0], 0, 3;
+ setarray .@item[0], Premium_Reset_Stone, Premium_Reset_Stone, Apple;
+ setarray .@count[0], 1, 3;
+ .@ret = checkweight2(.@item, .@count);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure, size mistmatch
+ cleararray .@item[0], 0, 3;
cleararray .@count[0], 0, 2;
- setarray .@item[0], 6320,6320;
- setarray .@count[0], 1,3,5;
- .@ret = checkweight2(.@item,.@count);
- set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure, size mistmatch
-
+ setarray .@item[0], Premium_Reset_Stone, Premium_Reset_Stone;
+ setarray .@count[0], 1, 3, 5;
+ .@ret = checkweight2(.@item, .@count);
+ .@success += ChkResult(.@testid++, 0, .@ret); //should be failure, size mistmatch
debugmes "End update by array tests";
- FinalReport(.@testid,.@succes);
+ FinalReport(.@testid, .@succes);
-L_FINAL:
end;
-
function ChkResult {
.@tid = getarg(0);
diff --git a/doc/sample/npc_test_duplicate.txt b/doc/sample/npc_test_duplicate.txt
index d052e1cee..7f2855a49 100644
--- a/doc/sample/npc_test_duplicate.txt
+++ b/doc/sample/npc_test_duplicate.txt
@@ -3,8 +3,8 @@
//===== By: ==================================================
//= Hercules Dev Team
//===== Current Version: =====================================
-//= 20070915
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= An example of how duplicate NPCs are handled:
//= NPC variables are shared between all duplicates.
//= Each duplicate knows its own map coordinates.
@@ -27,6 +27,6 @@ OnTouch:
end;
}
-prontera,150,175,4 duplicate(Test Script) Test1 909
-prontera,155,175,4 duplicate(Test Script) Test2 909,2,2
-prontera,160,175,4 duplicate(Test Script) Test3 909,3,3
+prontera,150,175,4 duplicate(Test Script) Test1 4_PORING
+prontera,155,175,4 duplicate(Test Script) Test2 4_PORING,2,2
+prontera,160,175,4 duplicate(Test Script) Test3 4_PORING,3,3
diff --git a/doc/sample/npc_test_func.txt b/doc/sample/npc_test_func.txt
index fbde70cd1..a57b6cfb1 100644
--- a/doc/sample/npc_test_func.txt
+++ b/doc/sample/npc_test_func.txt
@@ -3,8 +3,8 @@
//===== By: ==================================================
//= Hercules Dev Team
//===== Current Version: =====================================
-//= 20120901
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= Demonstrates use of functions.
//============================================================
@@ -21,11 +21,11 @@ function script func002 {
}
// Uses 3 different methods of displaying dialogue from both internal and external sources.
-prontera,168,189,1 script Functions 112,{
- callfunc "func001"; // Calls func001 and displays "Hello there!"
- mes callfunc("func002"); // Calls func002 and displays "I'm a function"
+prontera,168,189,1 script Functions 4_F_KAFRA6,{
+ callfunc "func001"; // Calls func001 and displays "Hello there!"
+ mes callfunc("func002"); // Calls func002 and displays "I'm a function"
next;
- callsub L_SUB001; // Calls the label L_SUB001 and displays "I'm a label"
+ callsub L_SUB001; // Calls the label L_SUB001 and displays "I'm a label"
close;
end;
diff --git a/doc/sample/npc_test_npctimer.txt b/doc/sample/npc_test_npctimer.txt
index 7dc625785..6c9b85a0e 100644
--- a/doc/sample/npc_test_npctimer.txt
+++ b/doc/sample/npc_test_npctimer.txt
@@ -1,14 +1,14 @@
-//===== Hercules Script =======================================
+//===== Hercules Script ======================================
//= Sample: NPC Timers
//===== By: ==================================================
//= Hercules Dev Team
//===== Current Version: =====================================
-//= 20121003
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= Demonstrates NPC timer commands.
//============================================================
-prontera,156,183,0 script NPCtimerTest::npctimerX0000 116,{
+prontera,156,183,0 script NPCtimerTest::npctimerX0000 4_F_KAFRA2,{
mes "Timer value" + getnpctimer(0);
mes "State timer" + getnpctimer(1,"npctimerX0000");
mes "Number of events" + getnpctimer(2);
diff --git a/doc/sample/npc_test_npctimer2.txt b/doc/sample/npc_test_npctimer2.txt
index 1bb856b13..b325c0c90 100644
--- a/doc/sample/npc_test_npctimer2.txt
+++ b/doc/sample/npc_test_npctimer2.txt
@@ -1,14 +1,14 @@
-//===== Hercules Script =======================================
+//===== Hercules Script ======================================
//= Sample: Attached NPC Timers
//===== By: ==================================================
//= Hercules Dev Team
//===== Current Version: =====================================
-//= 20121003
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= Demonstrates attached NPC timer commands.
//============================================================
-prontera,156,183,0 script NPCtimerTest::npctimerX0000 116,{
+prontera,156,183,0 script NPCtimerTest::npctimerX0000 4_F_KAFRA2,{
mes "What would you like to know?";
select("Tell me my level.");
mes "I need time to think...";
diff --git a/doc/sample/npc_test_pcre.txt b/doc/sample/npc_test_pcre.txt
index 09f65e607..1306d1798 100644
--- a/doc/sample/npc_test_pcre.txt
+++ b/doc/sample/npc_test_pcre.txt
@@ -1,14 +1,14 @@
//===== Hercules Script =======================================
//= Sample: PCRE
//===== By: ==================================================
-//= rAthena Dev Team
+//= Hercules Dev Team
//===== Current Version: =====================================
-//= 20100108
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= Demonstrates PCRE commands.
//============================================================
-prontera,152,181,5 script MouseJstr 763,{
+prontera,152,181,5 script MouseJstr 4_M_JPN,{
// hello
Lquote0:
diff --git a/doc/sample/npc_test_quest.txt b/doc/sample/npc_test_quest.txt
index 821c83739..fcf6b2a80 100644
--- a/doc/sample/npc_test_quest.txt
+++ b/doc/sample/npc_test_quest.txt
@@ -1,10 +1,10 @@
-//===== Hercules Script =======================================
+//===== Hercules Script ======================================
//= Sample: Quest Test
//===== By: ==================================================
//= Hercules Dev Team
//===== Current Version: =====================================
-//= 20121227
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= Demonstrates quest commands.
//============================================================
@@ -12,8 +12,9 @@
// need to add the quest to /db/quest_db.txt - e.g:
// 70000,0,1002,3,0,0,0,0,"3 Splats Please!"
-prontera,90,95,1 script Jelly 123,{
- if(checkquest(70000) == -1) { // Quest not yet started.
+prontera,90,95,1 script Jelly 2_F_MAGICMASTER,{
+ if(checkquest(70000) == -1) {
+ // Quest not yet started.
mes "[Jelly]";
mes "Hey there! Would you help me?";
next;
@@ -29,18 +30,21 @@ prontera,90,95,1 script Jelly 123,{
setquest 70000; // Adds the quest to your Quest Window.
close;
}
- } else if(checkquest(70000,HUNTING) == 2) { // All monsters killed.
+ } else if(checkquest(70000,HUNTING) == 2) {
+ // All monsters killed.
mes "[Jelly]";
mes "Awesome! Thank you!";
getexp 10000,0;
dispbottom "You have been rewarded with 10,000 Base Exp.";
- completequest 70000; // Sets quest status to "complete".
+ completequest 70000; // Sets quest status to "complete".
close;
- } else if(checkquest(70000) == 1) { // Quest is active.
+ } else if(checkquest(70000) == 1) {
+ // Quest is active.
mes "[Jelly]";
mes "Keep going, almost there!";
close;
- } else if(checkquest(70000) == 2) { // Quest finished.
+ } else if(checkquest(70000) == 2) {
+ // Quest finished.
mes "[Jelly]";
mes "Thanks again for doing that for me!";
close;
diff --git a/doc/sample/npc_test_setitemx.txt b/doc/sample/npc_test_setitemx.txt
index 10d8daaaa..a06f0dc9f 100644
--- a/doc/sample/npc_test_setitemx.txt
+++ b/doc/sample/npc_test_setitemx.txt
@@ -1,49 +1,44 @@
-//===== Hercules Script =======================================
+//===== Hercules Script ======================================
//= Sample: Setiteminfo & Setitemscript
//===== By: ==================================================
//= Lupus
//===== Current Version: =====================================
-//= 20121003
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= Demonstrates 'setiteminfo' and 'setitemscript' commands.
//============================================================
-prontera,164,161,5 script Lupus 1013,{
- menu
- "Make Knife[3] Edible",M_1,
- "Make Apple Equippable",M_2,
- "Edible Knife = Full SP",M_3,
- "Knife = Weapon + 3 Notes",M_4;
- close;
-
-M_1:
- mes "Ok. We made Knife[3] edible.";
- setiteminfo(1201,2,0); //type = 0 : potion
- setitemscript(1201,"{dispbottom \"* You used Knife[3]\";}");
- close;
-
-M_2:
- mes "Ok. We made Apple equippable.";
- setiteminfo(512,2,5); //item type -> headgear (type = 5)
- setiteminfo(512,5,512); //where to equip to (equip = 512)
- setiteminfo(512,11,256); //set as headgear location (loc = 256)
- setiteminfo(512,14,85); //set Headgear Sprite ID (view id = 85)
- setitemscript(512,"{dispbottom \"* Other item's changed\";}",0);
- setitemscript(512,"{dispbottom \"* Equipped\";}",1);
- setitemscript(512,"{dispbottom \"* Unequipped\";}",2);
- close;
-
-M_3:
- mes "Ok. Now edible Knife[3] restores your SP.";
- setitemscript(1201,2,0);
- setitemscript(1201,"{dispbottom \"* You ate Knife[3] + Full SP\"; percentheal 0,100;}");
- close;
-
-M_4:
- mes "Ok. We made Knife a weapon, but added 3 notes.";
- setiteminfo(1201,2,4); //type = 4 : weapon again
- setitemscript(1201,"{dispbottom \"* 1 Used\";}",0);
- setitemscript(1201,"{dispbottom \"* 2 Equipped\";}",1);
- setitemscript(1201,"{dispbottom \"* 3 Unequipped\";}",2);
+prontera,164,161,5 script Lupus WOLF,{
+ mes "Please choose an option:";
+ next;
+ switch (select("Make Knife[3] Edible", "Make Apple Equippable", "Edible Knife = Full SP", "Knife = Weapon + 3 Notes")) {
+ case 1:
+ mes "Ok. We made Knife[3] edible.";
+ setiteminfo(Knife, 2, IT_HEALING); //type = 0 : potion
+ setitemscript(Knife, "{dispbottom \"* You used Knife[3]\";}");
+ break;
+ case 2:
+ mes "Ok. We made Apple equippable.";
+ setiteminfo(Apple, 2, IT_ARMOR); //item type -> headgear (type = 5 -> IT_ARMOR)
+ setiteminfo(Apple, 5, 512); //where to equip to (equip = 512)
+ setiteminfo(Apple, 11, 256); //set as headgear location (loc = 256)
+ setiteminfo(Apple, 14, 85); //set Headgear Sprite ID (view id = 85)
+ setitemscript(Apple, "{dispbottom \"* Other item's changed\";}", 0);
+ setitemscript(Apple, "{dispbottom \"* Equipped\";}", 1);
+ setitemscript(Apple, "{dispbottom \"* Unequipped\";}", 2);
+ break;
+ case 3:
+ mes "Ok. Now edible Knife[3] restores your SP.";
+ setitemscript(Knife, 2, 0);
+ setitemscript(Knife, "{dispbottom \"* You ate Knife[3] + Full SP\"; percentheal 0,100;}");
+ break;
+ case 4:
+ mes "Ok. We made Knife a weapon, but added 3 notes.";
+ setiteminfo(Knife, 2, IT_WEAPON); //type = 4 -> IT_WEAPON
+ setitemscript(Knife, "{dispbottom \"* 1 Used\";}", 0);
+ setitemscript(Knife, "{dispbottom \"* 2 Equipped\";}", 1);
+ setitemscript(Knife, "{dispbottom \"* 3 Unequipped\";}", 2);
+ break;
+ }
close;
}
diff --git a/doc/sample/npc_test_setmapflag.txt b/doc/sample/npc_test_setmapflag.txt
index 681fbc43a..44137bef0 100644
--- a/doc/sample/npc_test_setmapflag.txt
+++ b/doc/sample/npc_test_setmapflag.txt
@@ -1,32 +1,32 @@
-//===== Hercules Script =======================================
+//===== Hercules Script ======================================
//= Sample: Mapflag Test
//===== By: ==================================================
//= Jbain
//===== Current Version: =====================================
-//= 20121003
-//===== Description: =========================================
+//= 20131225
+//===== Description: =========================================
//= Demonstrates mapflag commands.
//============================================================
-prontera,165,145,0 script EXPflagtest 123,{
+prontera,165,145,0 script EXPflagtest 2_F_MAGICMASTER,{
mes "[EXPflagtest]";
mes "Set up the map rates:";
switch(select("Job EXP:Base EXP:PVP on:Reset all flags")) {
case 1:
input .@rate;
- setmapflag "prontera",MF_JEXP,.@rate;
+ setmapflag "prontera",mf_jexp,.@rate;
close;
case 2:
input .@rate;
- setmapflag "prontera",MF_BEXP,.@rate;
+ setmapflag "prontera",mf_bexp,.@rate;
close;
case 3:
- setmapflag "prontera",MF_PVP;
+ setmapflag "prontera",mf_pvp;
close;
case 4:
- removemapflag "prontera",MF_BEXP;
- removemapflag "prontera",MF_JEXP;
- removemapflag "prontera",MF_PVP;
+ removemapflag "prontera",mf_bexp;
+ removemapflag "prontera",mf_jexp;
+ removemapflag "prontera",mf_pvp;
close;
}
}
diff --git a/doc/sample/npc_test_skill.txt b/doc/sample/npc_test_skill.txt
index cc6de3bbc..c26ed1b62 100644
--- a/doc/sample/npc_test_skill.txt
+++ b/doc/sample/npc_test_skill.txt
@@ -3,7 +3,7 @@
//===== By: ==================================================
//= Hercules Dev Team
//===== Current Version: =====================================
-//= 20130426
+//= 20131225
//===== Description: =========================================
//= Demonstrates the 'skill' command.
//============================================================
@@ -16,20 +16,20 @@
// If flag is undefined, it defaults to 1
// View db/(pre-)re/skill_db.txt for skill IDs
-prontera,157,182,0 script Skills 116,{
+prontera,157,182,0 script Skills 4_F_KAFRA2,{
mes "What skill would you like?";
switch(select("First Aid:Play Dead:Heal:Sight:None")) {
case 1:
- skill 142,1,0; // Permanently gives player level 1 First Aid
+ skill NV_FIRSTAID,1,0; // Permanently gives player level 1 First Aid
close;
case 2:
- skill 143,1,0; // Permanently gives player level 1 Play Dead
+ skill NV_TRICKDEAD,1,0; // Permanently gives player level 1 Play Dead
close;
case 3:
- skill 28,3,1; // Temporarily gives player level 3 Heal
+ skill AL_HEAL,3,1; // Temporarily gives player level 3 Heal
close;
case 4:
- skill 10,1,3; // Permanently gives player level 1 Sight, even after skill resets/job changes
+ skill MG_SIGHT,1,3; // Permanently gives player level 1 Sight, even after skill resets/job changes
close;
case 5:
close;
diff --git a/doc/sample/npc_test_time.txt b/doc/sample/npc_test_time.txt
index ffa6a5ca2..2af1dadd8 100644
--- a/doc/sample/npc_test_time.txt
+++ b/doc/sample/npc_test_time.txt
@@ -8,7 +8,7 @@
//= Demonstrates time commands.
//============================================================
-prontera,157,181,6 script Time Sample 105,{
+prontera,157,181,6 script Time Sample 8W_SOLDIER,{
mes "[Time Sample]";
mes "System Tick : " + gettimetick(0);
mes " Time Tick : " + gettimetick(1);
diff --git a/doc/sample/npc_trader_sample.txt b/doc/sample/npc_trader_sample.txt
new file mode 100644
index 000000000..0d50af8c5
--- /dev/null
+++ b/doc/sample/npc_trader_sample.txt
@@ -0,0 +1,58 @@
+//===== Hercules Script =======================================
+//= Sample: NPC Trader
+//===== By: ==================================================
+//= Hercules Dev Team
+//===== Current Version: =====================================
+//= 20131225
+//===== Description: =========================================
+//= Demonstrates NPC Trader.
+//============================================================
+
+/* ordinary zeny trader */
+prontera,152,151,1 trader TestTrader 4_F_EDEN_OFFICER,{
+ OnInit:
+ sellitem Valkyrja's_Shield;
+ end;
+}
+/* ordinary cash trader */
+prontera,152,152,1 trader TestTraderCash 4_F_EDEN_OFFICER,{
+ OnInit:
+ tradertype(NST_CASH);
+ sellitem Valkyrja's_Shield;
+ end;
+}
+/* custom npc trader */
+prontera,153,152,1 trader TestCustom2 4_F_EDEN_OFFICER,{
+ OnInit:
+ tradertype(NST_CUSTOM);
+ sellitem Red_Potion,2;
+ end;
+
+/* allows currency to be item 501 and 502 */
+OnCountFunds:
+ setcurrency(countitem(Red_Potion),countitem(Orange_Potion));
+ end;
+
+/* receives @price (total cost) and @points (the secondary input field for cash windows) */
+OnPayFunds:
+ dispbottom "Hi: price="+@price+" and points="+@points;
+ if( countitem(Orange_Potion) < @points || countitem(Red_Potion) < @price-@points )
+ end;
+ delitem Orange_Potion,@points;
+ delitem Red_Potion,@price-@points;
+ purchaseok();
+ end;
+}
+/* demonstrates Market Trader */
+prontera,150,160,6 trader HaiMarket 4_F_EDEN_OFFICER,{
+OnInit:
+ tradertype(NST_MARKET);
+ sellitem Red_Potion,-1,49;
+ end;
+
+OnClock0000://resupplies red potions on midnight
+OnMyResupply:
+ if( shopcount(Red_Potion) < 20 )
+ sellitem Red_Potion,-1,49;
+ end;
+}
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index c0fc8ce40..a4d079d5d 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -207,7 +207,7 @@ Ex: if your NPC is named 'Hunter#hunter1', it will be displayed as 'Hunter'
** Define a warp point
-<from map name>,<fromX>,<fromY>,<facing>%TAB%warp%TAB%<warp name>%TAB%<spanx>,<spany>,<to map name>,<toX>,<toY>
+<from map name>,<fromX>,<fromY>{,<facing>}%TAB%warp%TAB%<warp name>%TAB%<spanx>,<spany>,<to map name>,<toX>,<toY>
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.
@@ -299,7 +299,7 @@ items here. The layout used to define sale items still count, and
** Define an warp/shop/cashshop/NPC duplicate.
-warp: <map name>,<x>,<y>,<facing>%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<spanx>,<spany>
+warp: <map name>,<x>,<y>{,<facing>}%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<spanx>,<spany>
shop/cashshop/npc: -%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id>
shop/cashshop/npc: <map name>,<x>,<y>,<facing>%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id>
npc: -%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id>,<triggerX>,<triggerY>
@@ -414,7 +414,10 @@ Variables
The meat of every programming language is variables - places where you
store data.
-In Hercules scripting language, variable names are not case sensitive.
+In Hercules scripting language, variable names are case sensitive. Even though
+at the current time the script engine accepts them even with the incorrect
+case, it is not advised to rely on this behavior, as it may change at any
+time.
Variables are divided into and uniquely identified by the combination of:
prefix - determines the scope and extent (or lifetime) of the variable
@@ -575,6 +578,29 @@ Operators section described below. All operators listed there may be
placed in-front of the '=' sign when modifying variables to perform the
action as required.
+Increment and decrement operators are also provided, for your convenience.
+Pre-increment and pre-decrement operators:
+
+ ++@x; // same as @x = @x + 1
+ --@x; // same as @x = @x - 1
+
+Post-increment and post-decrement operators:
+
+ @x++; // similar to @x = @x + 1
+ @x--; // similar to @x = @x - 1
+
+The difference between pre- and post- increment/decrement operators is that,
+when used in an expression, the pre- ones will be executed before evaluating
+the expression, while the post- ones will be executed after. For example:
+
+ @x = 1;
+ @y = ++@x; // After this line is executed, both @y and @x will be 2
+ @x = 1;
+ @y = @x++; // After this line is executed, @y will be 1, @x will be 2
+
+Note: The pre-increment/pre-decrement operators are, by design, faster (or at
+least not slower) than their respective post- equivalent.
+
Note:
!! Currently the scripting engine does not support directly copying array
@@ -611,8 +637,8 @@ even a value from an another array) to get at an array value:
This will make @arrayofnumbers[100] equal to 10.
-Notice that index numbering always starts with 0. Arrays cannot hold more
-than 128 variables (so the last one can't have a number higher than 127).
+Notice that index numbering always starts with 0. Arrays can hold over
+2 billion variables.
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
@@ -851,6 +877,74 @@ and are the following:
mentioning that ?: has low priority and has to be enclosed with
parenthesis in most (if not all) cases.
+Operator Precedence and Associativity
+
+Operator precedence and associativity work more or less like they do in
+mathematics. The rules can be summarized with the following table:
+
+Precedence | Description | Associativity
+---------------------------------------------------------------------------
+1 (highest) | [] Array subscripting | None
+---------------------------------------------------------------------------
+2 | ++ Increment | None
+ | -- Decrement |
+---------------------------------------------------------------------------
+2 | - Unary minus | Right to left
+ | ! Logical NOT |
+ | ~ Bitwise NOT (One's Complement) |
+---------------------------------------------------------------------------
+3 | * Multiplication | Left to right
+ | / Division |
+ | % Modulo (remainder) |
+---------------------------------------------------------------------------
+4 | + Addition | Left to right
+ | - Subtraction |
+---------------------------------------------------------------------------
+5 | << Bitwise left shift | Left to right
+ | >> Bitwise right shift |
+---------------------------------------------------------------------------
+6 | < Less than | Left to right
+ | <= Less than or equal to |
+ | > Greater than |
+ | >= Greater than or equal to |
+---------------------------------------------------------------------------
+7 | == Equal to | Left to right
+ | != Not equal to |
+---------------------------------------------------------------------------
+8 | & Bitwise AND | Left to right
+---------------------------------------------------------------------------
+9 | ^ Bitwise XOR (exclusive or) | Left to right
+---------------------------------------------------------------------------
+10 | | Bitwise OR (inclusive or) | Left to right
+---------------------------------------------------------------------------
+11 | && Logical AND | Left to right
+---------------------------------------------------------------------------
+12 | || Logical OR | Left to right
+---------------------------------------------------------------------------
+13 | ?: Ternary conditional | Right to left
+---------------------------------------------------------------------------
+14 | = Direct assignment | Right to left
+(lowest) | += Assignment by sum |
+ | -= Assignment by difference |
+ | *= Assignment by product |
+ | /= Assignment by quotient |
+ | %= Assignment by remainder |
+ | <<= Assignment by bitwise left shift |
+ | >>= Assignment by bitwise right shift |
+ | &= Assignment by bitwise AND |
+ | ^= Assignment by bitwise XOR |
+ | |= Assignment by bitwise OR |
+
+Operator precedence means some operators are evaluated before others. For
+example, in 2 + 4 * 5 , the multiplication has higher precedence so 4 * 5 is
+evaluated first yielding 2 + 20 == 22 and not 6 * 5 == 30 .
+
+Operator associativity defines what happens if a sequence of the same
+operators is used one after another: whether the evaluator will evaluate the
+left operations first or the right. For example, in 8 - 4 - 2 , subtraction is
+left associative so the expression is evaluated left to right. 8 - 4 is
+evaluated first making the expression 4 - 2 == 2 and not 8 - 2 == 6 .
+
Labels
------
@@ -1006,6 +1100,10 @@ multiple commands on one line if you properly terminate them with a ';',
but it's better if you don't, since it is not certain just whether the
scripting engine will behave nicely if you do.
+Please note that command and function names are case sensitive. Even though at
+the current time the script engine accepts them with the incorrect case, it is
+not advised to rely on this behavior, as it may change at any time.
+
-------------------------
@@ -1022,6 +1120,7 @@ From here on, we will have the commands sorted as follow:
9.- Battleground commands.
10.- Mercenary commands.
11.- Queue commands.
+12.- NPC Trader commands
=====================
@@ -2550,6 +2649,13 @@ EQI_HEAD_LOW (10) - Lower Headgear (beards, some masks)
EQI_COSTUME_HEAD_LOW (11) - Lower Costume Headgear
EQI_COSTUME_HEAD_MID (12) - Middle Costume Headgear
EQI_COSTUME_HEAD_TOP (13) - Upper Costume Headgear
+EQI_COSTUME_GARMENT (14) - Costume Garment
+EQI_SHADOW_ARMOR (15) - Shadow Armor
+EQI_SHADOW_WEAPON (16) - Shadow Weapon
+EQI_SHADOW_SHIELD (17) - Shadow Shield
+EQI_SHADOW_SHOES (18) - Shadow Shoes
+EQI_SHADOW_ACC_R (19) - Shadow Accessory 2
+EQI_SHADOW_ACC_L (20) - Shadow Accessory 1
Notice that a few items occupy several equipment slots, and if the
character is wearing such an item, 'getequipid' will return it's ID number
@@ -2781,6 +2887,7 @@ recreate these items perfectly if they are destroyed. Here's what you get:
@inventorylist_expire[] - expire time (Unix time stamp). 0 means never
expires.
@inventorylist_count - the number of items in these lists.
+@inventorylist_bound - whether it is an account bounded item or not.
This could be handy to save/restore a character's inventory, since no
other command returns such a complete set of data, and could also be the
@@ -3320,6 +3427,39 @@ Check sample in doc/sample/getmonsterinfo.txt
---------------------------------------
+*addmonsterdrop(<mob id or name>, <item id>, <rate>)
+
+This command will temporarily add a drop to an existing monster. If the
+monster already drops the specified item, its drop rate will be updated to the
+given value.
+
+Both the monster and the item must be valid. Acceptable values for the drop
+rate are in the range [1:10000].
+
+Return value will be 1 in case of success (the item was added or its drop rate
+was updated), and 0 otherwise (there were no free item drop slots).
+
+Example:
+ // Add Poring Doll (741) to the Poring's (1002) drops, with 1% (100) rate
+ addmonsterdrop(1002, 741, 100);
+
+---------------------------------------
+
+*delmonsterdrop(<mob id or name>, <item id>)
+
+This command will temporarily remove a drop from an existing monster.
+
+Both the monster and the item must be valid.
+
+Return value will be 1 in case of success (the item was removed), and 0
+otherwise (the monster didn't have the specified item in its drop list).
+
+Example:
+ // Remove Jellopy (909) from the Poring's (1002) drops
+ delmonsterdrop(1002, 909);
+
+---------------------------------------
+
*getmobdrops(<mob id>)
This command will find all drops of the specified mob and return the item
@@ -4416,6 +4556,51 @@ two eggs, and may hatch from either, although, I'm not sure what kind of a
mess will this really cause.
---------------------------------------
+*getitembound <item id>,<amount>,<bound type>{,<account ID>};
+*getitembound "<item name>",<amount>,<bound type>{,<account ID>};
+
+This command behaves identically to 'getitem', but the items created will be
+bound to the target character as specified by the bound type. All items created
+in this manner cannot be dropped, sold, vended, auctioned, or mailed, and in
+some cases cannot be traded or stored.
+
+Valid bound types are:
+ 1 - Account Bound
+ 2 - Guild Bound
+ 3 - Party Bound
+ 4 - Character Bound
+
+---------------------------------------
+
+*getitembound2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<bound type>;
+*getitembound2 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<bound type>;
+
+This command behaves identically to 'getitem2', but the items created will be
+bound to the target character as specified by the bound type. All items created
+in this manner cannot be dropped, sold, vended, auctioned, or mailed, and in
+some cases cannot be traded or stored.
+
+For a list of bound types see 'getitembound'.
+
+---------------------------------------
+
+*countbound({<bound type>})
+
+This function will return the number of bounded items in the character's
+inventory, and sets an array @bound_items[] containing all item IDs of the
+counted items. If a bound type is specified, only those items will be counted.
+
+For a list of bound types see 'getitembound'.
+
+Example:
+ mes "You currently have "+countbound()+" bounded items.";
+ next;
+ mes "The list of bounded items include:";
+ for(set .@i,0; .@i<getarraysize(@bound_items); set .@i,.@i+1)
+ mes getitemname(@bound_items[.@i]);
+ close;
+
+---------------------------------------
*getnameditem <item id>,<character name|character ID>;
*getnameditem "<item name>",<character name|character ID>;
@@ -4754,21 +4939,17 @@ the command will end silently.
---------------------------------------
-*successrefitem <equipment slot>;
+*successrefitem <equipment slot>{,<upgrade_count>};
This command will refine an item in the specified equipment slot of the
-invoking character by +1. For a list of equipment slots see 'getequipid'.
-This command will not only add the +1, but also display a 'refine success'
+invoking character by +1 (unless <upgrade_count> is specified).
+For a list of equipment slots see 'getequipid'.
+This command will also display a 'refine success'
effect on the character and put appropriate messages into their chat
window. It will also give the character fame points if a weapon reached
+10 this way, even though these will only take effect for blacksmith who
will later forge a weapon.
-The official scripts seems to use the 'successrefitem' command as a
-function instead: 'successrefitem(<number>)' but it returns nothing on the
-stack. This is since jAthena, so probably nobody knows for sure why is it
-so.
-
---------------------------------------
*failedrefitem <equipment slot>;
@@ -4816,7 +4997,7 @@ like storage or cart.
---------------------------------------
*equip <item id>;
-*autoEquip <item id>,<option>;
+*autoequip <item id>,<option>;
These commands are to equip a equipment on the attached character.
The equip function will equip the item ID given when the player has this
@@ -5655,20 +5836,46 @@ above 91000 intimacy with its owner.
---------------------------------------
+*gethominfo(<type>)
+
+This function works as a direct counterpart of 'getpetinfo':
+ 0 - Homunculus unique ID
+ 1 - Homunculus Class
+ 2 - Name
+ 3 - Friendly level (intimacy score). 100000 is full loyalty.
+ 4 - Hungry level. 100 is completely full.
+ 5 - Rename flag. 0 means this homunculus has not been named yet.
+ 6 - Homunculus level
+
+---------------------------------------
+
+*morphembryo;
+
+This command will try to put the invoking player's Homunculus in an
+uncallable state, required for mutation into a Homunculus S. The player
+will also receive a Strange Embryo (ID 6415) in their inventory if
+successful, which is deleted upon mutation.
+
+The command will fail if the invoking player does not have an evolved
+Homunculus at level 99 or above. The /swt emotion is shown upon failure.
+
+Returns 1 upon success and 0 for all failures.
+
+---------------------------------------
+
*hommutate {<ID>};
-This command will try to mutate the invoking player's Homunculus into a
-Homunculus S. The Strange Embryo (ID 6415) is deleted upon success.
+This command will try to mutate the invoking player's Homunculus into
+a Homunculus S. The Strange Embryo (ID 6415) is deleted upon success.
-The command will fail if the invoking player does not have an evolved
-Homunculus at level 99 or above, if it is not in the embryo state (from
-the 'morphembryo' command), or if the invoking player does not possess a
-Strange Embryo. The /swt emotion is shown upon failure.
+The command will fail if the invoking player does not have an evolved
+Homunculus at level 99 or above, if it is not in the embryo state
+(from the 'morphembryo' command), or if the invoking player does not
+possess a Strange Embryo. The /swt emotion is shown upon failure.
-If the optional parameter <ID> is set, the invoking player's Homunculus
-will change into the specified Homunculus ID. Otherwise, a random
-Homunculus S will be chosen. See 'db/homunculus_db.txt' for a full list of
-IDs.
+If the optional parameter <ID> is set, the invoking player's Homunculus
+will change into the specified Homunculus ID. Otherwise, a random Homunculus S
+will be chosen. See 'db/homunculus_db.txt' for a full list of IDs.
Returns 1 upon success and 0 for all failures.
@@ -5685,19 +5892,6 @@ and will return the following values:
---------------------------------------
-*gethominfo(<type>)
-
-This function works as a direct counterpart of 'getpetinfo':
- 0 - Homunculus unique ID
- 1 - Homunculus Class
- 2 - Name
- 3 - Friendly level (intimacy score). 100000 is full loyalty.
- 4 - Hungry level. 100 is completely full.
- 5 - Rename flag. 0 means this homunculus has not been named yet.
- 6 - Homunculus level
-
----------------------------------------
-
*unitwalk <GID>,<x>,<y>;
*unitwalk <GID>,<mapid>;
@@ -6658,10 +6852,11 @@ Example:
This command will send the message to the server console (map-server
window). It will not be displayed anywhere else.
-
+//
// Displays "NAME has clicked me!" in the map-server window.
debugmes strcharinfo(0)+" has clicked me!";
-
+
+ // debugmes "\033[38D\033[K ==Message== \n"; // enable colour code.
---------------------------------------
*logmes "<message>";
@@ -6843,8 +7038,8 @@ You can add your own effects this way, naturally.
---------------------------------------
-*playBGM "<BGM filename>";
-*playBGMall "<BGM filename>"{,"<map name>"{,<x0>,<y0>,<x1>,<y1>}};
+*playbgm "<BGM filename>";
+*playbgmall "<BGM filename>"{,"<map name>"{,<x0>,<y0>,<x1>,<y1>}};
These two commands will play a Background Music to either the invoking
character only ('playBGM') or multiple characters ('playBGMall').
@@ -7161,20 +7356,31 @@ setitemscript 2637,"";
---------------------------------------
-*atoi ("<string>")
-*axtoi ("<string>")
+*atoi("<string>")
+*axtoi("<string>")
+*strtol("string", base)
These commands are used to convert strings to numbers. 'atoi' will
interpret given string as a decimal number (base 10), while 'axtoi'
-interprets strings as hexadecimal numbers (base 16).
+interprets strings as hexadecimal numbers (base 16). 'strtol' lets
+the user specify a base (valid range is between 2 and 36 inclusive,
+or the special value0, which means auto-detection).
-Hexadecimal number set: {0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}
+The atoi and strtol functions conform to the C functions with the same
+names, and axtoi is the same as strtol, with a base of 16. Results are
+clamped to signed 32 bit int range (INT_MIN ~ INT_MAX)
Example:
-set @var, atoi("11"); // Sets @var to 11
-set @var, axtoi("FF"); // Sets @var to 255
-mes axtoi("11"); // Displays 17 (1 = 1, 10 = 16)
+.@var = atoi("11"); // Sets .@var to 11
+.@var = axtoi("FF"); // Sets .@var to 255
+mes axtoi("11"); // Displays 17 (1 = 1, 10 = 16)
+.@var = strtol("11", 10); // Sets .@var to 11 (11 base 10)
+.@var = strtol("11", 16); // Sets .@var to 17 (11 base 16)
+.@var = strtol("11", 0); // Sets .@var to 11 (11 base 10, auto-detected)
+.@var = strtol("0x11", 0); // Sets .@var to 17 (11 base 16, auto-detected because of the "0x" prefix)
+.@var = strtol("011", 0); // Sets .@var to 9 (11 base 8, auto-detected because of the "0" prefix)
+.@var = strtol("11", 2); // Sets .@var to 3 (binary 11)
---------------------------------------
@@ -7380,7 +7586,7 @@ in the count parameter.
Example:
replacestr("testing tester", "test", "dash"); //returns "dashing dasher"
replacestr("Donkey", "don", "mon", 0); //returns "monkey"
- replacestr("test test test test test", "yay", 0, 3); //returns "yay yay yay test test"
+ replacestr("test test test test test", "test", "yay", 0, 3); //returns "yay yay yay test test"
---------------------------------------
@@ -7762,6 +7968,14 @@ Returns name of the instanced map on success, otherwise an empty string.
---------------------------------------
+*has_instance2("<map name>");
+
+Same as has_instance, with exception it returns the instance id of the map,
+as long as the user is assigned to a instance containing that map.
+It will return -1 upon failure, valid instance ids are >= 0.
+
+---------------------------------------
+
*instance_id();
Retrieves the instance id of the script it is being run on.
@@ -7814,16 +8028,82 @@ if (instance_check_party(getcharid(1),2,2,149)) {
}
---------------------------------------
+*instance_set_respawn(<map_name>,<x>,<y>{,<instance_id>});
+
+Updates the 'reload spawn' position of a instance,
+that is where players in the instance are sent to upon @reloadscript,
+uses the npc instance (if any) when instance_id is not provided,
+handy to update a instance's progress so that when/if @reloadscript happens
+the damage to the players progress is reduced.
+It is most effective when used with instance variables (which are @reloadscript persistent)
+
+If a player warps into a instance before this command has been used,
+it will use the player's warp destination as the initial respawn point,
+it can of course be modified by using this script command at any point.
+
+---------------------------------------
+*instance_mapname("<map name>"{,<instance id>})
+
+Returns the unique name of the instanced map. If no instance ID is specified,
+the instance the script is attached to is used. If the script is not attached to
+an instance, the instance of the currently attached player's party is used. If
+that fails, the command returns an empty string instead.
=========================
|8.- Quest Log commands.|
=========================
---------------------------------------
+*questinfo <Quest ID>, <Icon> {, <Map Mark Color>{, <Job Class>}};
+
+This is esentially a combination of checkquest and showevent. Use this only
+in an OnInit label. For the Quest ID, specify the quest ID that you want
+checked if it has been started yet.
+
+For Icon, use one of the following:
+
+No Icon : QTYPE_NONE
+! Quest Icon : QTYPE_QUEST
+? Quest Icon : QTYPE_QUEST2
+! Job Icon : QTYPE_JOB
+? Job Icon : QTYPE_JOB2
+! Event Icon : QTYPE_EVENT
+? Event Icon : QTYPE_EVENT2
+Warg : QTYPE_WARG
+Warg Face : QTYPE_WARG2 (Only for packetver >= 20120410)
+
+Map Mark Color, when used, creates a mark in the user's mini map on the position of the NPC,
+the available color values are:
+
+0 - No Marker
+1 - Yellow Marker
+2 - Green Marker
+3 - Purple Marker
+
+When a user shows up on a map, each NPC is checked for questinfo that has been set.
+If questinfo is present, it will check if the quest has been started, if it has not, the bubble will appear.
+
+Optionally, you can also specify a Job Class if the quest bubble should only appear for a certain class.
+
+Example
+izlude,100,100,4 script Test 844,{
+ mes "[Test]";
+ mes "Hello World.";
+ close;
+
+ OnInit:
+ questinfo 1001, QTYPE_QUEST, 0, Job_Novice;
+ end;
+}
+
+---------------------------------------
+
*setquest <ID>;
Place quest of <ID> in the users quest log, the state of which is "active".
+If *questinfo is set, and the same ID is specified here, the icon will be cleared when the quest is set.
+
---------------------------------------
*completequest <ID>;
@@ -7871,27 +8151,30 @@ If parameter "HUNTING" is supplied:
---------------------------------------
-*showevent <state>, <color>;
+*showevent <icon>{,<mark color>}
+
+Show an emotion on top of a NPC, and optionally,
+a colored mark in the mini-map like "viewpoint".
+This is used to indicate that a NPC has a quest or an event to
+a certain player.
-Show a colored mark in the mini-map like "viewpoint" and an emotion on top
-of a NPC. This is used to indicate that a NPC has a quest or an event to
-certain player/s.
+Available Icons:
-state can be:
- 0 = disable ( Used to disable and remove the mark and the emotion from
- the NPC. )
- 1 = exclamation emotion ( Used to show an important quest event to
- certain player. )
- 2 = interrogation emotion ( Used to show an non-important quest event
- to certain player. )
-Other value may cause client crashes.
+Remove Icon : QTYPE_NONE
+! Quest Icon : QTYPE_QUEST
+? Quest Icon : QTYPE_QUEST2
+! Job Icon : QTYPE_JOB
+? Job Icon : QTYPE_JOB2
+! Event Icon : QTYPE_EVENT
+? Event Icon : QTYPE_EVENT2
+Warg : QTYPE_WARG
+Warg Face : QTYPE_WARG2 (Only for packetver >= 20120410)
-color can be:
- 0 = yellow "Quest"
- 1 = orange "Job"
- 2 = green "Event"
- 3 = an MVP flag
-Other values show a transparent mark in the mini-map.
+Mark Color:
+0 - No Mark
+1 - Yellow Mark
+2 - Green Mark
+3 - Purple Mark
----------------------------------------
@@ -8205,3 +8488,71 @@ Deletes a queue iterator from memory and returns 1 when it fails,
otherwise 0 is returned.
---------------------------------------
+
+======================
+|12.- NPC Trader Commands.|
+======================
+---------------------------------------
+Commands that control NPC Trader Shops
+See /doc/sample/npc_trader_sample.txt
+
+---------------------------------------
+
+*openshop({NPC_Name});
+
+opens the trader shop from the currently-attached npc unless,
+when the optional NPC_Name param is used.
+
+---------------------------------------
+
+*sellitem <Item_ID>{,<price>{,<qty>}};
+
+adds (or modifies) <Item_ID> data to the shop,
+when <price> is not provided (or when it is -1) itemdb default is used.
+qty is only necessary for NST_MARKET trader types.
+
+when <Item_ID> is already in the shop,
+the previous data (price/qty), is overwritten with the new.
+
+---------------------------------------
+
+*stopselling <Item_ID>;
+
+attempts to remove <Item_ID> from the current shop list.
+
+---------------------------------------
+
+*setcurrency <Val1>{,<Val2>};
+
+updates the currently attached player shop funds,
+to be used within a "OnCountFunds" event of a NST_CUSTOM trader type.
+
+<Val1> is the value used in the *Cash* Points field
+<Val2> is the value used in the Kafra Points field
+
+---------------------------------------
+
+*tradertype(<Type>);
+
+Modifies the npc trader type, item list is cleared upon modifiying the value.
+By default, all npcs staart with tradertype(NST_ZENY);
+
+- NST_ZENY (0) Normal Zeny Shop
+- NST_CASH (1) Normal Cash Shop
+- NST_MARKET (2) Normal NPC Market Shop (where items have limited availability and need to be refurbished)
+- NST_CUSTOM (3) Custom Shop (any currency, item/var/etca, check sample)
+
+---------------------------------------
+
+*purchaseok();
+
+Signs that the transaction (on a NST_CUSTOM trader) has been successful,
+to be used within a "OnPayFunds" event of a NST_CUSTOM trader.
+
+---------------------------------------
+
+*shopcount(<Item_ID>);
+
+Returns the amount of still-available <Item_ID> in the shop (on a NST_MARKET trader).
+
+---------------------------------------