diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/atcommands.txt | 17 | ||||
-rw-r--r-- | doc/constants.md | 124 | ||||
-rw-r--r-- | doc/mob_skill_db.md | 224 | ||||
-rw-r--r-- | doc/pet_db.txt | 196 | ||||
-rw-r--r-- | doc/script_commands.txt | 107 |
5 files changed, 624 insertions, 44 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 fb175ce83..5feb3736d 100644 --- a/doc/constants.md +++ b/doc/constants.md @@ -375,9 +375,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 +389,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 +1347,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 @@ -4665,8 +4680,8 @@ - `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 @@ -5022,6 +5037,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 @@ -5061,6 +5095,7 @@ - `MSC_MASTERATTACKED`: 20 - `MSC_ALCHEMIST`: 21 - `MSC_SPAWN`: 22 +- `MSC_MAGICATTACKED`: 23 ### monster skill targets @@ -5079,6 +5114,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 @@ -8161,17 +8202,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 @@ -12700,6 +12772,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 @@ -12711,6 +12785,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 @@ -13724,9 +13802,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 @@ -13753,6 +13844,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 @@ -13797,7 +13898,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 @@ -13921,6 +14025,7 @@ - `Trance_Candy_Y`: 11594 - `Trance_Candy_G`: 11595 - `Catnip_Fruit`: 11602 +- `Cookie_Bat`: 11605 - `Crepe`: 11607 - `Chocolate_Egg`: 11608 - `Yummy_Cookie_Egg`: 11609 @@ -13928,6 +14033,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 @@ -14774,6 +14880,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 @@ -16642,6 +16749,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 @@ -18142,6 +18250,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 @@ -18795,6 +18906,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 @@ -18804,6 +18918,7 @@ - `Happiness_Clover`: 25295 - `Golden_Corn`: 25340 - `Mightysoul_Essence`: 25375 +- `Luxurious_Pet_Food`: 25377 - `Captured_Savage`: 25390 - `Goodly_Bough`: 25391 - `Free_Pass_Ticket`: 25392 @@ -18955,6 +19070,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 @@ -19102,6 +19219,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 @@ -19285,6 +19403,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 @@ -19407,6 +19526,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 a15baf2c2..707aab9d6 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -558,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 @@ -1732,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. --------------------------------------- @@ -1964,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; @@ -2024,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. @@ -6597,17 +6623,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 |