summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/atcommands.txt17
-rw-r--r--doc/constants.md162
-rw-r--r--doc/mob_skill_db.md224
-rw-r--r--doc/pet_db.txt196
-rw-r--r--doc/script_commands.txt334
5 files changed, 815 insertions, 118 deletions
diff --git a/doc/atcommands.txt b/doc/atcommands.txt
index 0cddc1680..65c3bb091 100644
--- a/doc/atcommands.txt
+++ b/doc/atcommands.txt
@@ -968,10 +968,19 @@ If no position is given, the command defaults to headgear.
---------------------------------------
-@fakename {<text string>}
-
-Temporarily changes name to the specified string.
-If no string is given, the character's real name will be re-applied.
+@fakename {<options>} {<fake_name>}
+
+Temporarily changes the character's name to <fake_name>.
+If no parameter is passed, the character's real name will be re-applied.
+The <options> parameter is used, to modify which names will be displayed.
+The fake name will always be displayed, regardless of <options>.
+Valid <options> flags (combinable):
+ 0 - Only the fake name is displayed. (Default value.)
+ 1 - Display party name.
+ 2 - Display guild name.
+ 4 - Display guild position.
+ 8 - Display clan position.
+ 16 - Display title.
---------------------------------------
diff --git a/doc/constants.md b/doc/constants.md
index 577517a2a..18b7e9185 100644
--- a/doc/constants.md
+++ b/doc/constants.md
@@ -364,6 +364,7 @@
- `mf_pairship_endable`: 58
- `mf_nostorage`: 59
- `mf_nogstorage`: 60
+- `mf_nopet`: 61
### Cell Properties
@@ -375,9 +376,13 @@
- `cell_landprotector`: 5
- `cell_novending`: 6
- `cell_nochat`: 7
+- `cell_icewall`: 8
+- `cell_noicewall`: 9
+- `cell_noskill`: 10
### Cell checks
+- `cell_gettype`: 0
- `cell_chkwall`: 1
- `cell_chkwater`: 2
- `cell_chkcliff`: 3
@@ -385,11 +390,15 @@
- `cell_chkreach`: 5
- `cell_chknopass`: 6
- `cell_chknoreach`: 7
+- `cell_chkstack`: 8
- `cell_chknpc`: 9
- `cell_chkbasilica`: 10
- `cell_chklandprotector`: 11
- `cell_chknovending`: 12
- `cell_chknochat`: 13
+- `cell_chkicewall`: 14
+- `cell_chknoicewall`: 15
+- `cell_chknoskill`: 16
### Bonuses / Parameter IDs
@@ -1339,6 +1348,13 @@
- `SC_RESIST_PROPERTY_WIND`: 667
- `SC_CLIENT_ONLY_EQUIP_ARROW`: 668
- `SC_MADOGEAR`: 669
+- `SC_POPECOOKIE`: 670
+- `SC_VITALIZE_POTION`: 671
+- `SC_SKF_MATK`: 672
+- `SC_SKF_ATK`: 673
+- `SC_SKF_ASPD`: 674
+- `SC_SKF_CAST`: 675
+- `SC_ALMIGHTY`: 676
### Emotes
@@ -4650,23 +4666,23 @@
### Server defines
-- `PACKETVER`: 20141022
+- `PACKETVER`: 20190530
- `MAX_LEVEL`: 175
- `MAX_STORAGE`: 600
- `MAX_GUILD_STORAGE`: 600
- `MAX_CART`: 100
-- `MAX_INVENTORY`: 100
+- `MAX_INVENTORY`: 200
- `FIXED_INVENTORY_SIZE`: 100
- `MAX_ZENY`: 2147483647
- `MAX_BANK_ZENY`: 2147483647
- `MAX_BG_MEMBERS`: 30
- `MAX_CHAT_USERS`: 20
- `MAX_REFINE`: 20
-- `MAX_ITEM_ID`: 65535
+- `MAX_ITEM_ID`: 2147483647
- `MAX_MENU_OPTIONS`: 255
- `MAX_MENU_LENGTH`: 2048
-- `MOB_CLONE_START`: 4001
-- `MOB_CLONE_END`: 5000
+- `MOB_CLONE_START`: 21001
+- `MOB_CLONE_END`: 22000
- `MAX_NPC_PER_MAP`: 512
### status options
@@ -4990,6 +5006,9 @@
- `ITEMINFO_ITEM_USAGE_FLAG`: 38
- `ITEMINFO_ITEM_USAGE_OVERRIDE`: 39
- `ITEMINFO_GM_LV_TRADE_OVERRIDE`: 40
+- `ITEMINFO_ID`: 41
+- `ITEMINFO_AEGISNAME`: 42
+- `ITEMINFO_NAME`: 43
### getmercinfo options
@@ -5019,6 +5038,25 @@
- `PETINFO_EVO_EGGID`: 11
- `PETINFO_AUTOFEED`: 12
+### Pet hunger levels
+
+- `PET_HUNGER_STARVING`: 0
+- `PET_HUNGER_VERY_HUNGRY`: 10
+- `PET_HUNGER_HUNGRY`: 25
+- `PET_HUNGER_NEUTRAL`: 75
+- `PET_HUNGER_SATISFIED`: 90
+- `PET_HUNGER_STUFFED`: 100
+
+### Pet intimacy levels
+
+- `PET_INTIMACY_NONE`: 0
+- `PET_INTIMACY_AWKWARD`: 1
+- `PET_INTIMACY_SHY`: 100
+- `PET_INTIMACY_NEUTRAL`: 250
+- `PET_INTIMACY_CORDIAL`: 750
+- `PET_INTIMACY_LOYAL`: 900
+- `PET_INTIMACY_MAX`: 1000
+
### monster skill states
- `MSS_ANY`: -1
@@ -5058,6 +5096,7 @@
- `MSC_MASTERATTACKED`: 20
- `MSC_ALCHEMIST`: 21
- `MSC_SPAWN`: 22
+- `MSC_MAGICATTACKED`: 23
### monster skill targets
@@ -5076,6 +5115,12 @@
- `MST_AROUND4`: 12
- `MST_AROUND`: 12
+### Monster group constants
+
+- `ALL_MOBS_NONBOSS`: -1
+- `ALL_MOBS_BOSS`: -2
+- `ALL_MOBS`: -3
+
### pc block constants, use with *setpcblock* and *checkpcblock*
- `PCBLOCK_NONE`: 0
@@ -5089,6 +5134,18 @@
- `PCBLOCK_COMMANDS`: 128
- `PCBLOCK_NPC`: 256
+### NPC item action constants
+
+- `ITEMENABLEDNPC_NONE`: 0
+- `ITEMENABLEDNPC_EQUIP`: 1
+- `ITEMENABLEDNPC_CONSUME`: 2
+
+### NPC allowed skill use constants
+
+- `SKILLENABLEDNPC_NONE`: 0
+- `SKILLENABLEDNPC_SELF`: 1
+- `SKILLENABLEDNPC_ALL`: 2
+
### private airship responds
- `P_AIRSHIP_NONE`: 0
@@ -5098,6 +5155,12 @@
- `P_AIRSHIP_ITEM_NOT_ENOUGH`: 2
- `P_AIRSHIP_ITEM_INVALID`: 5
+### player allowed actions when dead
+
+- `PCALLOWACTION_NONE`: 0
+- `PCALLOWACTION_TRADE`: 1
+- `PCALLOWACTION_CHAT`: 2
+
### questinfo types
- `QINFO_JOB`: 0
@@ -5252,10 +5315,18 @@
### itemskill option flags
- `ISF_NONE`: 0
-- `ISF_IGNORECONDITIONS`: 1
+- `ISF_CHECKCONDITIONS`: 1
- `ISF_INSTANTCAST`: 2
- `ISF_CASTONSELF`: 4
+### Item Bound Types
+
+- `IBT_ANY`: 0
+- `IBT_ACCOUNT`: 1
+- `IBT_GUILD`: 2
+- `IBT_PARTY`: 3
+- `IBT_CHARACTER`: 4
+
### Renewal
- `RENEWAL`: 1
@@ -8150,17 +8221,48 @@
- `FATAL_DAYS`: 2958
- `TORTUROUS_REDEEMER`: 2959
- `E_TORTUROUS_REDEEMER`: 2961
+- `WOODIE`: 2963
+- `XM_TEDDY_BEAR`: 2995
- `XM_CELINE_KIMI`: 2996
- `GRIM_REAPER_ANKOU`: 3029
- `TIMEHOLDER`: 3074
+- `ELEPHANT`: 3162
+- `GORILLA`: 3163
+- `LION`: 3164
+- `RHINO`: 3165
- `J_REB_SHECIL1`: 3169
- `J_REB_SHECIL2`: 3170
- `E1_FELOCK`: 3181
- `MM_SARAH`: 3190
- `ORGANIC_JAKK`: 3202
- `INORGANIC_JAKK`: 3203
+- `BLUE_UNICORN`: 3261
+- `PAD_TAMADORA`: 3306
+- `PAD_RUBYLIT`: 3317
+- `PAD_SAPPHILIT`: 3318
+- `PAD_EMELIT`: 3319
+- `PAD_TOPALIT`: 3320
+- `PAD_AMELIT`: 3321
+- `PAD_MYTHLIT`: 3349
- `DARK_SOUL`: 3381
- `WANDERING_SOUL`: 3382
+- `DR_EGGRING`: 3495
+- `DR_LUNATIC`: 3496
+- `LITTLE_ISIS`: 3636
+- `DIABOLIC2`: 3669
+- `DELETER_2`: 3670
+- `SCATLETON`: 3731
+- `SWEETS_DROPS`: 3790
+- `SKELION`: 3971
+- `NIGHTMARE_TERROR_H`: 20373
+- `WANDER_MAN_H`: 20420
+- `BACSOJIN2`: 20423
+- `MOONLIGHT2`: 20424
+- `PHREEONI2`: 20425
+- `ORK_HERO2`: 20571
+- `GLOOMUNDERNIGHT2`: 20619
+- `EP17_2_CHILD_ADMIN1`: 20696
+- `EP17_2_CHILD_ADMIN2`: 20697
## Items (db/re/item_db.conf)
- `Red_Potion`: 501
@@ -12689,6 +12791,8 @@
- `Memory_Of_Jack`: 6657
- `Halloween_Coin`: 6658
- `RWC_Inicializer`: 6665
+- `Emerald_Leaf`: 6669
+- `Log_`: 6670
- `Geffen_Magic_Coin`: 6671
- `Gray_Shard`: 6672
- `Bossnia_Pass`: 6673
@@ -12700,6 +12804,10 @@
- `Steel_Article`: 6746
- `Steel_Article_`: 6747
- `Corrupted_Charm`: 6755
+- `Banana_Can`: 6762
+- `Spicy_Rice_Cake`: 6763
+- `Hot_Dog`: 6764
+- `Ferris_Wheel_Biscuit`: 6765
- `ORGANIC_PUMPKIN`: 6804
- `INORGANIC_PUMPKIN`: 6805
- `Solo_Troops_Badge`: 6821
@@ -13713,9 +13821,22 @@
- `Brownie_Egg`: 9060
- `Marin_Egg`: 9061
- `Novice_Poring_Egg`: 9062
+- `Woodie_Egg`: 9063
+- `Elephant_Egg`: 9064
+- `Gorilla_Egg`: 9065
+- `Lion_Egg`: 9066
+- `Rhino_Egg`: 9067
+- `Blue_Unicorn_Egg`: 9068
- `Mastering_Egg`: 9069
- `Savage_Egg`: 9070
- `Grand_Peco_Peco_Egg`: 9071
+- `Rubylit_Egg`: 9074
+- `Sapphilit_Egg`: 9075
+- `Emelit_Egg`: 9076
+- `Topalit_Egg`: 9077
+- `Amelit_Egg`: 9078
+- `Mythlit_Egg`: 9079
+- `Tamadora_Egg`: 9080
- `High_Orc_Egg`: 9087
- `Angeling_Egg`: 9088
- `Am_Mut_Egg`: 9089
@@ -13742,6 +13863,16 @@
- `Phreeoni_Egg`: 9111
- `Moonlight_Flower_Egg`: 9112
- `Skelion_Egg`: 9113
+- `Bacsojin2_Egg_`: 9115
+- `Rigid_Nightmare_Terror_Egg`: 9116
+- `Contaminated_Wanderer_Egg`: 9117
+- `Aliot_Egg`: 9118
+- `Alicel_Egg`: 9119
+- `Aliza_Egg`: 9120
+- `Orc_Hero_Egg_`: 9121
+- `Gloom_Under_Night_Egg`: 9122
+- `Child_Admin_Beta_Egg`: 9123
+- `Child_Admin_Alpha_Egg`: 9124
- `Ein_Ddbox`: 9514
- `Metal_Rifine_Ticket`: 9523
- `Ein_Ddbox2`: 9529
@@ -13786,7 +13917,10 @@
- `Black_Butterfly_Mask`: 10037
- `Horn_Protector`: 10038
- `Tw_Backpack`: 10039
+- `Red_Bell_Necklace`: 10040
- `Dark_Mane`: 10042
+- `Little_Headdress_Beta`: 10043
+- `Little_Headdress_Alpha`: 10044
- `Prontera_Book_01`: 11000
- `Adventure_Story01`: 11001
- `Great_Chef_Orleans01`: 11002
@@ -13910,6 +14044,7 @@
- `Trance_Candy_Y`: 11594
- `Trance_Candy_G`: 11595
- `Catnip_Fruit`: 11602
+- `Cookie_Bat`: 11605
- `Crepe`: 11607
- `Chocolate_Egg`: 11608
- `Yummy_Cookie_Egg`: 11609
@@ -13917,6 +14052,7 @@
- `Aromatic_Pop_Corn`: 11612
- `Fresh_Milk`: 11614
- `Sweet_Potato_`: 11615
+- `Yummy_Meat`: 11616
- `Bearopy`: 11620
- `Aromatic_Pop_Corn_`: 11625
- `Girl_Bunch_Of_Flower`: 11701
@@ -14763,6 +14899,7 @@
- `Elf_Tear_Curse`: 12880
- `Elf_Tear_Silence`: 12881
- `Elf_Tear_Blind`: 12882
+- `Almighty`: 12883
- `C_Center_Potion`: 12884
- `C_Awakening_Potion`: 12885
- `C_Berserk_Potion`: 12886
@@ -16631,6 +16768,7 @@
- `Tw_Red_Scroll`: 17210
- `Tw_Orange_Scroll`: 17211
- `Tw_Yellow_Scroll`: 17212
+- `Almighty_Box`: 17224
- `C_Center_Potion_Box`: 17226
- `C_Awakening_Potion_Box`: 17227
- `C_Berserk_Potion_Box`: 17228
@@ -18131,6 +18269,9 @@
- `Integer_Time`: 22837
- `Something_Candy_Holder`: 22838
- `Old_Money_Pocket`: 22876
+- `Sap_Jelly`: 23187
+- `Unprocessed_Parts`: 23188
+- `SmallDoll_Needle`: 23189
- `Fried_Chicken`: 23242
- `Fried_Chicken_1`: 23243
- `Elixir_Bandage`: 23256
@@ -18784,6 +18925,9 @@
- `S_Genesis_Pendant`: 24582
- `S_Genesis_Earing`: 24583
- `Slug_Bullet`: 25187
+- `Suspicious_Bottle`: 25231
+- `Cheap_Lubricant`: 25232
+- `Cotton_Tufts`: 25233
- `BrokenArrow`: 25258
- `Shining_Spore`: 25265
- `Dried_Leaf_Of_Ygg`: 25266
@@ -18793,6 +18937,7 @@
- `Happiness_Clover`: 25295
- `Golden_Corn`: 25340
- `Mightysoul_Essence`: 25375
+- `Luxurious_Pet_Food`: 25377
- `Captured_Savage`: 25390
- `Goodly_Bough`: 25391
- `Free_Pass_Ticket`: 25392
@@ -18944,6 +19089,8 @@
- `Ein_1HWHIP`: 26215
- `Faceworm_Queen_Card`: 27164
- `Captain_Felock_Card`: 27182
+- `Rigid_Nightmare_Terror_Card`: 27352
+- `Contaminated_Wanderer_Card`: 27361
- `Thanos_Katar`: 28000
- `Katar_Of_Evil_Slayer`: 28001
- `Half_BF_Katar2`: 28002
@@ -19091,6 +19238,7 @@
- `GH_Cursed_Crystal_`: 29590
- `Cursed_Emerald`: 29591
- `Shinee_Opal`: 29592
+- `Abandoned_Teddy_Bear_Card`: 31022
- `Roast_Memory`: 31172
- `C_Black_Cat`: 31186
- `Choco_Minihat`: 31195
@@ -19274,6 +19422,7 @@
- `Imperial_Trip_Suit`: 450074
- `ILL_Piece_B`: 100004
- `Imperial_Firerain_Suit`: 450075
+- `Cloud_Cotton`: 1000227
- `Imperial_Crimson_Robe`: 450076
- `Imperial_Frost_Robe`: 450077
- `Imperial_Psychic_Robe`: 450078
@@ -19396,6 +19545,7 @@
- `Boost_Gatling`: 830000
- `Abyss_Ddbox3`: 100144
- `Abyss_Ddbox4`: 100145
+- `Barmil_Ticket`: 1000103
> End of list
diff --git a/doc/mob_skill_db.md b/doc/mob_skill_db.md
new file mode 100644
index 000000000..8198446d3
--- /dev/null
+++ b/doc/mob_skill_db.md
@@ -0,0 +1,224 @@
+# Monster skill database
+
+<!--
+## Copyright
+> This file is part of Hercules.
+> http://herc.ws - http://github.com/HerculesWS/Hercules
+>
+> Copyright (C) 2020 Hercules Dev Team
+> Copyright (C) Zarbony
+> Copyright (C) Kenpachi
+>
+> Hercules is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+>
+> This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+> See the GNU General Public License for more details.
+>
+> You should have received a copy of the GNU General Public License along with this program.
+> If not, see <http://www.gnu.org/licenses/>.
+-->
+
+## Description
+This file is a documentation for the monster skill database files.
+ * [db/mob_skill_db2.conf](../db/mob_skill_db2.conf)
+ * [db/pre-re/mob_skill_db.conf](../db/pre-re/mob_skill_db.conf)
+ * [db/re/mob_skill_db.conf](../db/re/mob_skill_db.conf)
+
+--------------------------------------------------------------
+
+## Entry structure
+```
+ <Monster_Constant>: {
+ <Skill_Constant>: {
+ ClearSkills:
+ SkillLevel:
+ SkillState:
+ SkillTarget:
+ Rate:
+ CastTime:
+ Delay:
+ Cancelable:
+ CastCondition:
+ ConditionData:
+ val0:
+ val1:
+ val2:
+ val3:
+ val4:
+ Emotion:
+ ChatMsgID:
+ }
+ }
+```
+
+--------------------------------------------------------------
+
+## Field list
+
+Name | Data type | Default value
+:--------------- | :-------- | :------------
+Monster_Constant | constant | No default value
+Skill_Constant | constant | No default value
+ClearSkills | boolean | false
+SkillLevel | int | 1
+SkillState | string | "MSS_ANY"
+SkillTarget | string | "MST_TARGET"
+Rate | int | 1
+CastTime | int | 0
+Delay | int | 0
+Cancelable | boolean | false
+CastCondition | string | "MSC_ALWAYS"
+ConditionData | int | 0
+val0 | int | 0
+val1 | int | 0
+val2 | int | 0
+val3 | int | 0
+val4 | int | 0
+Emotion | int | -1
+ChatMsgID | int | 0
+
+--------------------------------------------------------------
+
+## Field explanation
+
+### Monster_Constant
+The monster's name constant, found in [mob_db.conf](../db/re/mob_db.conf) as *SpriteName*.
+There are 3 special constants for global skill assignment:
+* `ALL_MOBS`: Add skills to all monsters.
+* `ALL_MOBS_BOSS`: Add skills to all boss monsters.
+* `ALL_MOBS_NONBOSS`: Add skills to all non-boss monsters.
+
+### Skill_Constant
+The skill's name constant, found in [skill_db.conf](../db/re/skill_db.conf) as *Name*.
+Note: You can add multiple Skill_Constant blocks.
+
+### ClearSkills
+If set to `true`, all previously defined skills for this monster will be removed.
+
+### SkillLevel
+The skill level which should be used.
+Minimum value is `1`. Maximum value is `mob_max_skilllvl` from [conf/map/battle/skill.conf](../conf/map/battle/skill.conf#L318).
+
+### SkillState
+Defines in which state the monster is able to cast the skill.
+State | Description
+:------------ | :----------
+MSS_ANY | Monster is in any state except `MSS_DEAD`.
+MSS_IDLE | Monster has no target and isn't walking.
+MSS_WALK | Monster is walking.
+MSS_LOOT | Monster is looting or walking to loot.
+MSS_DEAD | Monster is dying.
+MSS_BERSERK | Monster is attacking after starting the battle.
+MSS_ANGRY | Monster is attacking after being attacked.
+MSS_RUSH | Monster is following an enemy after being attacked.
+MSS_FOLLOW | Monster is following an enemy without being attacked.
+MSS_ANYTARGET | Same as `MSS_ANY` but monster must have a target.
+
+### SkillTarget
+Defines the skill's target.
+Target | Description
+:---------- | :----------
+MST_TARGET | The monster's current target.
+MST_RANDOM | A random enemy within skill range.
+MST_SELF | The monster itself.
+MST_FRIEND | A random friend within skill range. If no friend was found, `MST_SELF` is used.
+MST_MASTER | The monster's master. If no master was found, `MST_FRIEND` is used.
+MST_AROUND1 | Random cell within a range of `1`. (Affects ground skills only.)
+MST_AROUND2 | Random cell within a range of `2`. (Affects ground skills only.)
+MST_AROUND3 | Random cell within a range of `3`. (Affects ground skills only.)
+MST_AROUND4 | Random cell within a range of `4`. (Affects ground skills only.)
+MST_AROUND5 | Same as `MST_AROUND1`, but the monster's current target must be in skill range.
+MST_AROUND6 | Same as `MST_AROUND2`, but the monster's current target must be in skill range.
+MST_AROUND7 | Same as `MST_AROUND3`, but the monster's current target must be in skill range.
+MST_AROUND8 | Same as `MST_AROUND4`, but the monster's current target must be in skill range.
+MST_AROUND | Same as `MST_AROUND4`.
+
+### Rate
+The chance of successfully casting the skill if the condition is fulfilled. (10000 = 100%)
+Minimum value is `1`. Maximum value is `10000`.
+
+### CastTime
+The skill's cast time in milliseconds.
+Minimum value is `0`. Maximum value is `MOB_MAX_CASTTIME` from [src/map/mob.c](../src/map/mob.c#L81).
+
+### Delay
+The time in milliseconds before attempting to cast the same skill again.
+Minimum value is `0`. Maximum value is `MOB_MAX_DELAY` from [src/map/mob.c](../src/map/mob.c#L82).
+
+### Cancelable
+Defines whether the skill is cancelable or not.
+
+### CastCondition
+Defines the condition to successfully cast the skill.
+Condition | Description
+:-------------------- | :----------
+MSC_ALWAYS | No condition.
+MSC_MYHPLTMAXRATE | Monster's HP in percent is less than or equal to `ConditionData`.
+MSC_MYHPINRATE | Monster's HP in percent is greater than or equal to `ConditionData` and less than or equal to `val0`.
+MSC_FRIENDHPLTMAXRATE | Friend's HP in percent is less than or equal to `ConditionData`.
+MSC_FRIENDHPINRATE | Friend's HP in percent is greater than or equal to `ConditionData` and less than or equal to `val0`.
+MSC_MYSTATUSON | Monster has status change `ConditionData` enabled. (See [doc/constants.md](./constants.md#Status-Changes) for a list of available status changes.)
+MSC_MYSTATUSOFF | Monster has status change `ConditionData` disabled. (See [doc/constants.md](./constants.md#Status-Changes) for a list of available status changes.)
+MSC_FRIENDSTATUSON | Friend has status change `ConditionData` enabled. (See [doc/constants.md](./constants.md#Status-Changes) for a list of available status changes.)
+MSC_FRIENDSTATUSOFF | Friend has status change `ConditionData` disabled. (See [doc/constants.md](./constants.md#Status-Changes) for a list of available status changes.)
+MSC_ATTACKPCGT | Monster is attacked by more than `ConditionData` units.
+MSC_ATTACKPCGE | Monster is attacked by `ConditionData` or more units.
+MSC_SLAVELT | Monster has less than `ConditionData` slaves.
+MSC_SLAVELE | Monster has `ConditionData` or less active slaves.
+MSC_CLOSEDATTACKED | Monster is melee attacked.
+MSC_LONGRANGEATTACKED | Monster is range attacked.
+MSC_AFTERSKILL | Monster has used skill `ConditionData`. (If `ConditionData` is `0`, all skills are triggered.)
+MSC_SKILLUSED | Skill `ConditionData` was used on the monster. (If `ConditionData` is `0`, all skills are triggered.)
+MSC_CASTTARGETED | A skill is being cast on the monster.
+MSC_RUDEATTACKED | Monster was rude attacked `RUDE_ATTACKED_COUNT` times. ([src/map/mob.c#L84](../src/map/mob.c))
+MSC_MASTERHPLTMAXRATE | The monster master's HP in percent is less than `ConditionData`.
+MSC_MASTERATTACKED | The monster's master is attacked.
+MSC_ALCHEMIST | The monster was summoned by an Alchemist class character.
+MSC_SPAWN | The monster spawns.
+MSC_MAGICATTACKED | The monster has received magic damage.
+
+### ConditionData
+Additional cast condition data. Meaning depends on the situation. See `CastCondition` table.
+
+### val0
+Additional data. Meaning depends on the situation.
+ * `MSC_MYHPINRATE`/`MSC_FRIENDHPINRATE`: See `CastCondition` table.
+ * `NPC_SUMMONMONSTER`: Slave monster ID.
+ * `NPC_SUMMONSLAVE`: Slave monster ID.
+ * `NPC_METAMORPHOSIS`: Transform monster ID.
+ * `NPC_EMOTION`: Emotion ID. (See [doc/constants.md](./constants.md#emotes) for a list of available emotions.)
+ * `NPC_EMOTION_ON`: Emotion ID. (See [doc/constants.md](./constants.md#emotes) for a list of available emotions.)
+
+### val1
+Additional data. Meaning depends on the situation.
+ * `NPC_SUMMONMONSTER`: Slave monster ID.
+ * `NPC_SUMMONSLAVE`: Slave monster ID.
+ * `NPC_METAMORPHOSIS`: Transform monster ID.
+ * `NPC_EMOTION`: Monster's mode is changed to specified value.
+ * `NPC_EMOTION_ON`: Monster's mode is changed to specified value.
+
+### val2
+Additional data. Meaning depends on the situation.
+ * `NPC_SUMMONMONSTER`: Slave monster ID.
+ * `NPC_SUMMONSLAVE`: Slave monster ID.
+ * `NPC_METAMORPHOSIS`: Transform monster ID.
+
+### val3
+Additional data. Meaning depends on the situation.
+ * `NPC_SUMMONMONSTER`: Slave monster ID.
+ * `NPC_SUMMONSLAVE`: Slave monster ID.
+ * `NPC_METAMORPHOSIS`: Transform monster ID.
+
+### val4
+Additional data. Meaning depends on the situation.
+ * `NPC_SUMMONMONSTER`: Slave monster ID.
+ * `NPC_SUMMONSLAVE`: Slave monster ID.
+ * `NPC_METAMORPHOSIS`: Transform monster ID.
+
+### Emotion
+The ID of the emotion the monster will use when casting the skill.
+(See [doc/constants.md](./constants.md#emotes) for a list of available emotions.)
+
+### ChatMsgID
+The ID of the message the monster will say when casting the skill.
+(See [db/mob_chat_db.txt](../db/mob_chat_db.txt) for a list of available messages.)
diff --git a/doc/pet_db.txt b/doc/pet_db.txt
new file mode 100644
index 000000000..140a8309d
--- /dev/null
+++ b/doc/pet_db.txt
@@ -0,0 +1,196 @@
+//===== Hercules Documentation ===============================
+//= Pet Database
+//===== By: ==================================================
+//= Hercules Dev Team
+//===== Current Version: =====================================
+//= 20200102
+//===== Description: =========================================
+//= Explanation of the pet_db.conf file and structure.
+//============================================================
+
+pet_db: (
+{
+ // ================ Mandatory fields ==============================
+ Id: ID (int)
+ Name: "Pet Name" (string)
+ EggItem: "Egg Item Constant" (string)
+ // ================ Optional fields ===============================
+ TamingItem: "Taming Item Constant" (string, defaults to 0)
+ FoodItem: "Food Item Constant" (string, defaults to 537 ("Pet_Food"))
+ AccessoryItem: "Equipment Item Constant" (string, defaults to 0)
+ FoodEffectiveness: hunger points (int, defaults to 80)
+ HungerDelay: hunger time (int, defaults to 60)
+ HungerDecrement: hunger points (int, defaults to 1)
+ Intimacy: {
+ Initial: start intimacy (int, defaults to 250)
+ FeedIncrement: feeding intimacy (int, defaults to 10)
+ OverFeedDecrement: overfeeding intimacy (int, defaults to 100)
+ OwnerDeathDecrement: owner die intimacy (int, defaults to 20)
+ StarvingDelay: starving time (int, defaults to 20)
+ StarvingDecrement: starving intimacy (int, defaults to 20)
+ }
+ CaptureRate: capture rate (int, defaults to 1000)
+ Speed: speed (int, defaults to 150)
+ SpecialPerformance: true/false (boolean, defaults to false)
+ TalkWithEmotes: convert talk (boolean, defaults to false)
+ AttackRate: attack rate (int, defaults to 300)
+ DefendRate: Defence attack (int, defaults to 300)
+ ChangeTargetRate: change target (int, defaults to 800)
+ AutoFeed: true/false (boolean, defaults to false)
+ PetScript: <" Pet Script (can also be multi-line) ">
+ EquipScript: <" Equip Script (can also be multi-line) ">
+ Evolve: {
+ EggID: { (string, Evolved Pet EggID)
+ Name: Amount (items required to perform evolution)
+ ...
+ }
+ }
+},
+...
+)
+
+ * Id:
+ The ID of the monster that should be tamed. See mob_db.conf.
+ * Name:
+ The pet's default name.
+ * EggItem:
+ The name of the pet's egg item. See item_db.conf AegisName field.
+ * TamingItem:
+ The name of the item, which is used to tame the pet.
+ See item_db.conf AegisName field.
+ This field is optional and defaults to 0.
+ * FoodItem:
+ The name of the item, which is used to feed the pet.
+ See item_db.conf AegisName field.
+ This field is optional and defaults to Pet_Food (ID=537).
+ * AccessoryItem:
+ The name of the pet's accesssory item.
+ See item_db.conf AegisName field.
+ This field is optional and defaults to 0.
+ * FoodEffectiveness:
+ This field defines how many hunger points
+ are restored, when feeding the pet.
+ This field is optional and defaults to 80.
+ Minimum value is 1, maximum value is 100.
+ * HungerDelay:
+ This is the interval for consuming hunger points.
+ Every <HungerDelay> seconds, the pet will consume
+ <HungerDecrement> hunger points.
+ In official servers it's 60 seconds for every pet.
+ This field is optional and defaults to 60.
+ Minimum value is 0, maximum value is 2147483.
+ If set to 0, the pet won't consume hunger points.
+ * HungerDecrement:
+ How many hunger points will be consumed every <HungerDelay> seconds.
+ This field is optional and defaults to 1.
+ Minimum value is 0, maximum value is 99.
+ If set to 0, <HungerDelay> is automatically set to 0, too,
+ regardless of what value was defined.
+ * Intimacy: {
+ The <Intimacy> block contains all settings,
+ which affect the pet's intimacy value.
+ * Initial:
+ The amount of intimacy points, the pet will have when tamed.
+ This field is optional and defaults to 250.
+ Minimum value is 1, maximum value is 1000.
+ * FeedIncrement:
+ The amount of intimacy points, gained when feeding the pet.
+ Note: This value is used as base value.
+ The actual added amount depends on the pet's current hunger.
+ This field is optional and defaults to 10.
+ Minimum value is 1, maximum value is 1000.
+ * OverFeedDecrement:
+ The amount of intimacy points, lost when feeding the pet
+ if it isn't hungry.
+ Note: This value is used as base value.
+ The actual removed amount depends on the pet's current hunger.
+ This field is optional and defaults to 100.
+ Minimum value is 0, maximum value is 1000.
+ * OwnerDeathDecrement:
+ The amount of intimacy points, lost when its master dies.
+ This field is optional and defaults to 20.
+ Minimum value is 0, maximum value is 1000.
+ * StarvingDelay:
+ This is the interval for loosing intimacy points,
+ when the pet is starving.
+ The pet is starving, if it has no hunger points left.
+ Every <StarvingDelay> seconds, the pet will lose
+ <StarvingDecrement> intimacy points.
+ In official servers it's 20 seconds for all pets.
+ If <HungerDelay> is set to 0, <StarvingDelay> is set to 0, too,
+ regardless of what value was defined.
+ This field is optional and defaults to 20.
+ Minimum value is 0, maximum value is <HungerDelay>.
+ If set to 0, the pet won't lose intimacy points while starving.
+ * StarvingDecrement:
+ How many intimacy points will be lost every <StarvingDelay> seconds,
+ when the pet is starving.
+ This field is optional and defaults to 20.
+ Minimum value is 0, maximum value is 1000.
+ If set to 0, <StarvingDelay> is automatically set to 0, too,
+ regardless of what value was defined.
+ }
+ * CaptureRate:
+ The chance of success when taming the pet.
+ 10000 equals 100%.
+ This field is optional and defaults to 1000.
+ Minimum value is 1, maximum value is 10000.
+ * Speed:
+ The pet's moving speed.
+ Note: The lower the value, the higher the speed.
+ This field is optional and defaults to 150.
+ Minimum value is 20, maximum value is 1000.
+ * SpecialPerformance:
+ If 'true', the pet is allowed to do its special performance.
+ This field is optional and defaults to 'false'.
+ * TalkWithEmotes:
+ If 'true', the pet is allowed to talk by using emotes.
+ This field is optional and defaults to 'false'.
+ * AttackRate:
+ Chance for supporting when the master attacks a monster.
+ 10000 equals 100%.
+ This field is optional and defaults to 300.
+ Minimum value is 0, maximum value is 10000.
+ * DefendRate:
+ Chance for supporting when the master receives damage from a monster.
+ 10000 equals 100%.
+ This field is optional and defaults to 300.
+ Minimum value is 0, maximum value is 10000.
+ * ChangeTargetRate:
+ Chance for the pet changes its target when supporting.
+ 10000 equals 100%.
+ This field is optional and defaults to 800.
+ Minimum value is 0, maximum value is 10000.
+ * AutoFeed:
+ If 'true', the pet is fed automatically.
+ This field is optional and defaults to 'false'.
+ * PetScript: <"
+ This field is used for pet AI commands. See doc/script_commands.txt.
+ It will be executed every time, the pet's data gets initialized.
+ Everything you can do in a NPC script should work here, too,
+ but using the <EquipScript> field is recommended, when executing
+ other commands than the pet AI ones.
+ This field is optional and has no default value.
+ ">
+ * EquipScript: <"
+ This field is commonly used to apply bonuses to the the pet's master.
+ See doc/item_bonus.md.
+ It will be executed every time, the pet master's status is calculated.
+ Everything you can do in a NPC script should work here, too.
+ This field is optional and has no default value.
+ ">
+ * Evolve: {
+ The <Evolve> block is used to define which pet(s) can be eveolved
+ from the current pet.
+ This block is optional and has no default value.
+ * Evolved_Egg_Item_Name: {
+ The name of the egg item, which will be created when evolving.
+ You can add multiple <Evolved_Egg_Item_Name> blocks.
+ See item_db.conf AegisName field.
+ * Evolve_Item_Name: Amount
+ This is a pair of an item name and the corresponding amount which is
+ required to evolve the pet into <Evolved_Egg_Item_Name>.
+ You can add multiple <Evolve_Item_Name: Amount> pairs.
+ See item_db.conf AegisName field for item names.
+ }
+ }
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 8308f4771..9bbb65c1c 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -434,17 +434,39 @@ marked as usable in pet scripts to work in there reliably.
Numbers
-------
+The Hercules scripting engine supports 4 types of number literals:
+
+type base syntax
+----------------------------------------------
+decimal 10 255
+hexadecimal 16 0xFF
+octal 8 0o377
+binary 2 0b11111111
+
Beside the common decimal numbers, which are nothing special whatsoever
(though do not expect to use fractions, since ALL numbers are integer in
this language), the script engine also handles hexadecimal numbers, which
are otherwise identical. Writing a number like '0x<hex digits>' will make
it recognized as a hexadecimal value. Notice that 0x10 is equal to 16.
-Also notice that if you try to 'mes 0x10' it will print '16'.
+Also notice that if you try to 'mes 0x10' it will print '16'. If you wish
+to make calculations in base 8, you can also use the octal notation like
+'0o<octal digits>'. To make calculations in base 2 (binary), you can use
+the binary notation like '0b<binary digits>'.
+
+The following are all equivalent:
+ 255 == 0xFF == 0o377 == 0b11111111
Number values can't exceed the limits of an integer variable: Any number
greater than INT_MAX (2147483647) or smaller than INT_MIN (-2147483648) will
be capped to those values and will cause a warning to be reported.
+Underscores can also be used as visual separators for digit grouping purposes:
+ 2_147_483_647
+ 0x7FFF_FFFF
+
+Keep in mind that number literals cannot start or end with a separator and no
+more than one separator can be used in a row (so 12_3___456 is illegal).
+
Variables
---------
@@ -536,7 +558,9 @@ variables or an empty string ("", nothing between the quotes) for string
variables. Once you set it to that, the variable is as good as forgotten
forever, and no trace remains of it even if it was stored with character
or account data. The maximum length of variable name including prefix and
-suffix is 32.
+suffix is 32. Permanent string variables (name$, $name$, #name$, ##name$)
+can store text with a maximum length of 255 characters. All other string
+type variables have no such limitation.
Some variables are special, that is, they are already defined for you by
the scripting engine. You can see the full list somewhere in
@@ -1710,7 +1734,8 @@ The default value of 'min' and 'max' can be set with 'input_min_value' and
For numeric inputs the value is capped to the range [min, max]. Returns 1
if the value was higher than 'max', -1 if lower than 'min' and 0 otherwise.
For string inputs it returns 1 if the string was longer than 'max', -1 is
-shorter than 'min' and 0 otherwise.
+shorter than 'min' and 0 otherwise. Note that an input string has a maximum
+length of 70 characters.
---------------------------------------
@@ -1942,58 +1967,64 @@ will result in error and termination of the script.
---------------------------------------
-*function <function name>;
-*<function name>{(<argument>, ...<argument>)};
-*function <function name> {
+{public | private} *function <function name>;
+{public | private} *function <function name> {
<code>
}
-This works like callfunc(), and is used for cleaner and faster scripting.
-The function must be defined and used within a script, and works like a
-label with arguments.
-Note that the name may only contain alphanumeric characters and underscore.
+In its first form, this syntax declares a local function so it can later be
+defined. In its second form, the syntax both declares and defines a local
+function. Local functions must be defined before being used. Note that the name
+may only contain alphanumeric characters and underscore. Once defined, they can
+be called from the current script as if they were regular built-in commands, and
+can also be called from other scripts if they are marked as public. Local
+functions may be marked as public by simply adding "public" prior to the
+function definition. Functions not marked as public are private by default and
+cannot be called from another script.
Usage:
1. Declare the function.
function <function name>;
2. Call the function anywhere within the script.
- It can also return a value when used with parentheses.
- <function name>;
- 3. Define the function within the script.
+ <function name>();
+ 3. Define the function by adding its script.
<function name> {<code>}
+ Step 1 is optional if the function is defined prior to being called.
+
Example:
-prontera,154,189,4 script Item Seller 767,{
/* Function declaration */
- function SF_Selling;
+ function MyFunction;
- if (Zeny > 50) {
- mes("Welcome!");
- /* Function call */
- SF_Selling();
- } else {
- mes("You need 50z, sorry!");
- }
- close();
+ /* Function call */
+ MyFunction();
/* Function definition */
- function SF_Selling {
- mes("Would you like to buy a phracon for 50z?");
- next();
- if (select("Yes", "No, thanks") == 1) {
- Zeny -= 50;
- getitem(Phracon, 1);
- mes("Thank you!");
- }
+ function MyFunction {
+ // (do something)
return;
}
-}
+
+
+Example with public functions:
+
+ /* Function declaration + definition */
+ public function myFunction {
+ /* notice the "public" before the "function" keyword */
+ return;
+ }
+
+ /* Local call */
+ myFunction();
+
+ /* Call from another script */
+ "npc name"::myFunction();
+
Example with parameters and return value:
-prontera,150,150,0 script TestNPC 123,{
/* Function declaration */
function MyAdd;
@@ -2002,18 +2033,35 @@ prontera,150,150,0 script TestNPC 123,{
input(.@a);
input(.@b);
/* Function call */
- mes(.@a+" + "+.@b+" = "+MyAdd(.@a, .@b));
+ mesf("%i + %i = %i", .@a, .@b, MyAdd(.@a, .@b));
close();
/* Function definition */
function MyAdd {
- return(getarg(0)+getarg(1));
+ return (getarg(0) + getarg(1));
}
-}
---------------------------------------
+*<function name>({<arg>...})
+*"<npc name>"::<function name>({<arg>...})
+*callfunctionofnpc("<function name>", "<npc name>"{, <arg>...});
+
+In its first form, calls a previously defined local function. In its second
+form, calls a previously defined public local function of another NPC. If the
+name of the target NPC or the name of the local function is not known
+beforehand, callfunctionofnpc() can be used instead of the second form.
+See function() above for more details.
+
+Example:
+
+ MyFunction(arg1, arg2, arg3);
+ "MyNPC"::MyFunction(arg1, arg2, arg3);
+ callfunctionofnpc("MyNPC", "MyFunction", arg1, arg2, arg3);
+
+---------------------------------------
+
*is_function("<function name>")
This command checks whether or not a function exists and returns its type.
@@ -3147,23 +3195,24 @@ This command sets a bunch of arrays with a complete list of whatever the
invoking character has in its inventory, including all the data needed to
recreate these items perfectly if they are destroyed. Here's what you get:
-@inventorylist_id[] - array of item ids.
-@inventorylist_idx[] - array of item inventory index.
-@inventorylist_amount[] - their corresponding item amounts.
-@inventorylist_equip[] - will return the slot the item is equipped on, if at all.
-@inventorylist_refine[] - for how much it is refined.
-@inventorylist_identify[] - whether it is identified.
-@inventorylist_attribute[] - whether it is broken.
-@inventorylist_card1[] - These four arrays contain card data for the
-@inventorylist_card2[] items. These data slots are also used to store
-@inventorylist_card3[] names inscribed on the items, so you can
-@inventorylist_card4[] explicitly check if the character owns an item
- made by a specific craftsman.
-@inventorylist_expire[] - expire time (Unix time stamp). 0 means never
- expires.
-@inventorylist_bound[] - whether it is an account bounded item or not.
-@inventorylist_favorite[] - whether it is favorite (inside favorite tab) or not.
-@inventorylist_count - the number of items in these lists.
+@inventorylist_id[] - array of item ids.
+@inventorylist_idx[] - array of item inventory index.
+@inventorylist_amount[] - their corresponding item amounts.
+@inventorylist_equip[] - will return the slot the item is equipped on, if at all.
+@inventorylist_refine[] - for how much it is refined.
+@inventorylist_identify[] - whether it is identified.
+@inventorylist_attribute[] - whether it is broken.
+@inventorylist_card1[] - These four arrays contain card data for the items.
+@inventorylist_card2[] These data slots are also used to store names inscribed
+@inventorylist_card3[] on the items, so you can explicitly check if the character
+@inventorylist_card4[] owns an item made by a specific craftsman.
+@inventorylist_expire[] - expire time (Unix time stamp). 0 means never expires.
+@inventorylist_bound[] - whether it is an account bounded item or not.
+@inventorylist_favorite[] - whether it is favorite (inside favorite tab) or not.
+@inventorylist_opt_id1~5[] - array of random option id.
+@inventorylist_opt_val1~5[] - array of random option val.
+@inventorylist_opt_param1~5[] - array of random option param.
+@inventorylist_count - the number of items in these lists.
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
@@ -3191,14 +3240,15 @@ recreate these items perfectly if they are destroyed. Here's what you get:
@cartinventorylist_refine[] - for how much it is refined.
@cartinventorylist_identify[] - whether it is identified.
@cartinventorylist_attribute[] - whether it is broken.
-@cartinventorylist_card1[] - These four arrays contain card data for the
-@cartinventorylist_card2[] items. These data slots are also used to store
-@cartinventorylist_card3[] names inscribed on the items, so you can
-@cartinventorylist_card4[] explicitly check if the character owns an item
- made by a specific craftsman.
-@cartinventorylist_expire[] - expire time (Unix time stamp). 0 means never
- expires.
+@cartinventorylist_card1[] - These four arrays contain card data for the items.
+@cartinventorylist_card2[] These data slots are also used to store names inscribed on the items,
+@cartinventorylist_card3[] so you can explicitly check if the character owns an item
+@cartinventorylist_card4[] made by a specific craftsman.
+@cartinventorylist_expire[] - expire time (Unix time stamp). 0 means never expires.
@cartinventorylist_bound - whether it is an account bound item or not.
+@inventorylist_opt_id1~5[] - array of random option id.
+@inventorylist_opt_val1~5[] - array of random option val.
+@inventorylist_opt_param1~5[] - array of random option param.
@cartinventorylist_count - the number of items in these lists.
This could be handy to save/restore a character's cart_inventory, since no
@@ -3277,6 +3327,7 @@ Example:
---------------------------------------
*getiteminfo(<item ID>, <type>)
+*getiteminfo("<item name>", <type>)
*setiteminfo(<item ID>, <type>, <value>)
This function will look up the item with the specified ID number in the
@@ -3285,6 +3336,9 @@ It will return -1 if there is no such item.
Valid types are:
+ ITEMINFO_ID - Item ID (getiteminfo() only!)
+ ITEMINFO_AEGISNAME - Unique name to reference the item (getiteminfo() only!)
+ ITEMINFO_NAME - Display name (getiteminfo() only!)
ITEMINFO_BUYPRICE - Buy Price
ITEMINFO_SELLPRICE - Sell Price
ITEMINFO_TYPE - Item Type
@@ -3574,7 +3628,7 @@ If the player is not found, returns -1.
*gettimetick(<type>)
Valid types are :
- 0 - server's tick (milleseconds), unsigned int, loops every ~50 days
+ 0 - server's tick (milleseconds), unsigned int, loops every ~25 days
1 - time since the start of the current day in seconds
2 - UNIX epoch time (number of seconds elapsed since 1st of January 1970)
@@ -5273,11 +5327,11 @@ 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
+Valid item bound types are:
+ 1 - IBT_ACCOUNT - Account Bound
+ 2 - IBT_GUILD - Guild Bound
+ 3 - IBT_PARTY - Party Bound
+ 4 - IBT_CHARACTER - Character Bound
---------------------------------------
@@ -5318,12 +5372,12 @@ If a bound type is not specified or a bound type of 0 is used, it will search th
of any type, so long as the other parameters match. In all cases, this command will return the bound type of the
item found, or 0 if the specified item was not found.
-Valid bound types are:
- 0 - All Bound types.
- 1 - Account Bound
- 2 - Guild Bound
- 3 - Party Bound
- 4 - Character Bound
+Valid item bound types are:
+ 0 - IBT_ANY - Any Bound
+ 1 - IBT_ACCOUNT - Account Bound
+ 2 - IBT_GUILD - Guild Bound
+ 3 - IBT_PARTY - Party Bound
+ 4 - IBT_CHARACTER - Character Bound
Optional Parameters:
bound_type - checks to see if the item has the specified bound type.
@@ -5341,7 +5395,7 @@ Example:
close();
// This will also check if you have a bound (any type) 1205 (Cutter).
- if (checkbound(Cutter, 0)) {
+ if (checkbound(Cutter, IBT_ANY)) {
mes("You have a bound Cutter");
} else {
mes("You do not have a bound Cutter");
@@ -5356,8 +5410,8 @@ Example:
}
close();
- // This will check if the item found, has a bound type of 2 (guild_bound)
- if (checkbound(Cutter) == 2) {
+ // This will check if the item found, has a bound type of IBT_GUILD
+ if (checkbound(Cutter) == IBT_GUILD) {
mes("You have a guild_bound Cutter");
} else {
mes("You do not have a guild_bound Cutter.");
@@ -5365,7 +5419,7 @@ Example:
close();
// This will check if you have a 'guild_bound' +7 1205 (Cutter).
- if (checkbound(Cutter, 2, 7)) {
+ if (checkbound(Cutter, IBT_GUILD, 7)) {
mes("You have a +7 guild_bound Cutter.");
} else {
mes("You don't have the required item.");
@@ -5633,21 +5687,32 @@ Example:
---------------------------------------
-*enable_items()
-*disable_items()
+*enable_items({<flag>})
+*enableitemuse({<flag>})
+*disable_items({<flag>})
+*disableitemuse({<flag>})
+
+These commands enable/disable item actions while interacting with a NPC.
+When disable_items() is invoked, item actions defined by <flag> are disabled
+during scripts until enable_items() is called or the script has terminated.
+To avoid possible exploits, when disable_items() is invoked, it will only
+disable item actions while running that script in particular.
+Note that if a different script also invokes disable_items(), it will override
+the last call so you may want to call this command at the start of your
+script without assuming the effect is still in effect.
+If <flag> is omitted all item actions will be disabled.
+The enable_items() command enables item actions defined by <flag> during
+scripts until disable_items() is invoked or the script has terminated.
+If <flag> is omitted it defaults to 'item_enabled_npc' battle flag.
+For a list of supported flags have a look at the description of
+'item_enabled_npc' battle flag in 'conf/map/battle/items.conf'.
+Unless disable_items() or enable_items() is invoked the script will use
+'item_enabled_npc' battle flag by default.
+
+Example:
-These commands enable/disable changing of equipments while an NPC is
-running. When disable_items() is run, equipments cannot be changed
-during scripts until enable_items() is called or the script has
-terminated. To avoid possible exploits, when disable_items() is invoked,
-it will only disable changing equips while running that script in
-particular. Note that if a different script also calls disable_items(),
-it will override the last call (so you may want to call this command at
-the start of your script without assuming the effect is still in
-effect).
-If 'item_enabled_npc' option is set to true in 'conf/map/battle/items.conf' all
-NPC are allowing changing of equipment by default except for those have been
-set with 'disable_items'.
+ // This will disable changing equipment during this script.
+ disable_items(ITEMENABLEDNPC_EQUIP);
---------------------------------------
@@ -5659,18 +5724,20 @@ usable items. It will not work properly if there is a visible dialog
window or menu.
If the skill is self or auto-targeting, it will be used immediately.
Otherwise, a target cursor is shown.
-Optional value <flag> is a bitmask to manipulate how the skill is casted.
+By default, all skill requirements are ignored.
+Optional argument <flag> is a bitmask to manipulate how the skill is cast.
Since <flag> is a bitmask, the flags can be summed up.
Possible flags are:
- - 0x00 - ISF_NONE - Skill is casted as if has been used from skill tree.
+ - 0x00 - ISF_NONE - Skill is cast as if it has been used from skill tree.
(Same like <flag> was omitted.)
- - 0x01 - ISF_IGNORECONDITIONS - Skill requirements are ignored and not consumed
- - 0x02 - ISF_INSTANTCAST - Skill is casted instantaneously.
- - 0x04 - ISF_CASTONSELF - Skill is forcefully casted on invoking character,
+ - 0x01 - ISF_CHECKCONDITIONS - Skill requirements are checked and consumed.
+ (SP are never checked/consumed.)
+ - 0x02 - ISF_INSTANTCAST - Skill is cast instantaneously.
+ - 0x04 - ISF_CASTONSELF - Skill is forcefully cast on invoking character,
without showing the target selection cursor.
Important: Items which use itemskill() should be of type IT_USABLE.
- If the item type is IT_DELAYCONSUME and ISF_IGNORECONDITIONS is set,
+ If the item type is IT_DELAYCONSUME and ISF_CHECKCONDITIONS isn't set,
the item won't be consumed when using the item!
// When Anodyne is used, it will cast Endure, Level 1, as if the actual skill
@@ -5678,8 +5745,8 @@ Important: Items which use itemskill() should be of type IT_USABLE.
itemskill(SM_ENDURE, 1);
// Instantaneously cast Level 10 Increase Agility on invoking character,
-// without checking/consuming skill requirements.
- itemskill(AL_INCAGI, 10, ISF_IGNORECONDITIONS | ISF_INSTANTCAST | ISF_CASTONSELF);
+// with checking/consuming skill requirements (15 HP).
+ itemskill(AL_INCAGI, 10, ISF_CHECKCONDITIONS | ISF_INSTANTCAST | ISF_CASTONSELF);
// Instaed of using the constants, one could also do it like this:
itemskill(AL_INCAGI, 10, 7);
@@ -6569,17 +6636,22 @@ Examples:
---------------------------------------
-*setpcblock(<type>,<option>)
-*checkpcblock()
+*setpcblock(<type>, <option>{, <account id>})
+*checkpcblock({<account id>})
-Prevents the player from doing the following action.
+Prevents a character from doing the following action.
For setpcblock, when the <option> is true(1) will block them, and false(0)
will allow those actions again.
+The setpcblock command returns 1 on success or 0 if no character was attached.
+
The checkpcblock command returned value is a bit mask of the currently
enabled block flags (or PCBLOCK_NONE when none is set).
+Parameter <account id> is optional for both commands.
+If omitted, the currently attached character is used.
+
The <type> listed are a bit mask of the following:
PCBLOCK_NONE (only used by checkpcblock)
PCBLOCK_MOVE
@@ -6987,6 +7059,37 @@ Examples:
---------------------------------------
+*unitiswalking({<GID>})
+
+This command checks, if a unit is walking or not.
+If <GID> is omitted, the currently attached character is used.
+Returns 1 if the unit is walking, 0 if the unit is not walking and -1 on error.
+
+Note: There's no differentiation between script and client initiated walking.
+
+Example:
+
+prontera,155,185,5 script Check Walking 1_F_MARIA,{
+ mes("Enter character name.");
+ mes("");
+ input(.@name$);
+ .@GID = getcharid(CHAR_ID_ACCOUNT, .@name$);
+ if (.@GID != 0) {
+ .@iswalking = unitiswalking(.@GID);
+ if (.@iswalking == 1)
+ mesf("%s is walking.", .@name$);
+ else if (.@iswalking == 0)
+ mesf("%s is not walking.", .@name$);
+ else
+ mesf("Can't get %s's walking state.", .@name$);
+ } else {
+ mesf("%s not found!", .@name$);
+ }
+ close();
+}
+
+---------------------------------------
+
*unitkill(<GID>)
*unitwarp(<GID>, <Mapname>, <x>, <y>)
*unitattack(<GID>, <Target ID>)
@@ -7426,6 +7529,16 @@ if GID is not given use the attached player.
//=====================================
---------------------------------------
+*loudhailer("<message>"{, "<color>"})
+
+Announces a colored text in '<char_name> Shouts : <message>' format.
+<color> must be a string in "RRGGBB" format. If <color> is omitted,
+white ("FFFFFF") will be used.
+This command is specially created for the Megaphone_ item (12221),
+but will work in NPCs, too.
+
+---------------------------------------
+
*announce("<text>", <flag>{, <fontColor>{, <fontType>{, <fontSize>{, <fontAlign>{, <fontY>}}}}})
This command will broadcast a message to all or most players, similar to
@@ -7545,7 +7658,8 @@ In the OnBuyItem, two arrays are filled (@bought_nameid and
and the amount sold of it. Same goes for the OnSellItem label, only the
variables are named different (@sold_nameid, @sold_quantity, @sold_refine,
@sold_attribute, @sold_identify, @sold_card1, @sold_card2, @sold_card3,
-@sold_card4). An example on a shop comes with Hercules, and can be found
+@sold_card4, @sold_opt_id1~5, @sold_opt_val1~5, @sold_opt_param1~5).
+An example on a shop comes with Hercules, and can be found
in the doc/sample/npc_dynamic_shop.txt file.
This example shows how to use the labels and their set variables to create
@@ -9553,13 +9667,19 @@ For examples of usage, see /doc/sample/npc_rodex.txt
//=====================================
---------------------------------------
-*instance_create("<instance name>", <owner id>{, <optional owner_type>})
+*instance_create("<instance_name>", <owner_id>{, <owner_type>})
-Create an instance using the name "<instance name>" for the <owner_id> of
-owner_type (when not provided, defaults to IOT_PARTY). Most instance_*
+Creates an instance using the name "<instance_name>" for the <owner_id> of
+<owner_type> (when not provided, defaults to IOT_PARTY). Most instance_*
commands are used in conjunction with this command and depend on the
ID this command returns.
+Valid <owner_type> values:
+- IOT_NONE (0) - <owner_id> can be any arbitrary number.
+- IOT_CHAR (1) - <owner_id> is account ID.
+- IOT_PARTY (2) - <owner_id> is party ID.
+- IOT_GUILD (3) - <owner_id> is guild ID.
+
Example:
// Store the Party ID of the invoking character.
.@party_id = getcharid(CHAR_ID_PARTY);
@@ -9570,11 +9690,9 @@ Example:
// ...
} else if (.@id == -2) { // Invalid Party ID
// ...
- } else if (.@id == -3) { // No free instances (MAX_INSTANCE exceeded)
- // ...
} else if (.@id == -4) { // Already exists
// ...
- } else (.@id < 0) { // Unspecified error while queuing instance.
+ } else if (.@id < 0) { // Unspecified error while queuing instance.
// ...
}