Unverified Commit ac558d7c authored by Jittapan P's avatar Jittapan P Committed by GitHub

Initial implementation of pet evolution system + Pet DB conversion to YAML (#3544)

* Implemented official pet evolution system
* Added evolved pets to pet database
* Corrected various pet system mechanics
* Migrated pet database to YAML format and the converter from CSV format

Thanks to @Lemongrass3110 @aleos89 and @Atemo for their suggestions and additional fixes
parent e4b41ef7
* text=auto
*.c diff=cpp
*.cpp diff=cpp
*.yml diff
*.sln merge=union
*.vcproj merge=union
*.vcxproj merge=union
......
......@@ -71,6 +71,18 @@ feature.achievement: on
// Requires: 2017-02-08bRagexeRE or later
feature.equipswitch: on
// Pet evolution (Note 1)
// Requires: 2014-10-08aRagexe or later
feature.petevolution: on
// Automatic Pet Feeding (Note 1)
// Requires: 2014-10-08aRagexe or later
feature.petautofeed: on
// At which hunger rate should pet autofeeding trigger? (Note 2)
// Default: 89
feature.pet_autofeed_rate: 89
// Homunculues Autofeeding (Note 1)
// Requires: 2017-09-20bRagexeRE or later
feature.homunculus_autofeed: on
......
......@@ -21,10 +21,6 @@ pet_friendly_rate: 100
// The rate at which a pet will become hungry. (Note 2)
pet_hungry_delay_rate: 100
// If your pet is hungry by how much will the friendlyness decrease by. (Default is 5)
// Note: The friendlyness is 0-1000 total, at 0 the pet runs away.
pet_hungry_friendly_decrease: 5
// Does the pet need its equipment before it does its skill? (Note 1)
pet_equip_required: yes
......@@ -39,9 +35,6 @@ pet_damage_support: no
// At max (1000) support rate is 150%.
pet_support_min_friendly: 900
// Same as above, but this is to use the pet_script field with official pet abilities.
pet_equip_min_friendly: 900
// Whether or not the pet's will use skills. (Note 1)
// Note: Offensive pet skills need at least pet_attack_support or
// pet_damage_support to work (they trigger while the pet is attacking).
......@@ -81,3 +74,7 @@ pet_ignore_infinite_def: yes
// Whether or not the pet will continue to attack when the master is dead. (Note 1)
pet_master_dead: no
// Send auto-feed notice even if the client setting is OFF (Note 1)
// Official: yes
pet_autofeed_always: yes
......@@ -458,8 +458,7 @@
// Homunculus messages
450: You already have a homunculus
// Return pet to egg message
451: You can't return your pet because your inventory is full.
//451 free
// Message System
460: Please enter a valid language (usage: @langtype <language>).
......
......@@ -441,8 +441,7 @@
// Homunculus messages
450: 你已經擁有一個人工生命體了
// Return pet to egg message
451: 你無法收回寵物,因為你身上沒有空間了
//451 free
// Message System
460: 請輸入合法的語言 (usage: @langtype <language>).
......
......@@ -449,8 +449,7 @@
// Homunculus messages
450: Vous possédez déjà un homunculus
// Return pet to egg message
451: Vous ne pouvez pas remettre votre pet dans son oeuf car votre inventaire est plein.
//451 free
// Message System
460: Entrez une langue (usage: @langtype <langue>).
......
......@@ -459,8 +459,7 @@
// Pesan-pesan untuk Homunculus
450: Kamu sudah memiliki homunculus
// Pesan tentang mengembalikan peliharaan ke telur
451: Kamu tidak dapat mengembalikan peliharaan kamu karena inventory penuh.
//451 free
// Sistem Pesan
460: Harap masukkan tipe bahasa yang valid. (Penggunaan: @langtype <bahasa>).
......
......@@ -468,8 +468,7 @@
// Mensagens de homunculus
450: Você já possui um homunculus
// Mensagem de retorno do pet ao ovo
451: Você não pode retornar o seu bichinho de estimação para o ovo pois o seu inventário está lotado.
//451 free
// Sistema de Mensagens
460: Digite um idioma válido (uso: @langtype <idioma>).
......
......@@ -449,8 +449,7 @@
// @makehomun
450:
//
451: , .
//451 free
// @langtype
460: (: @langtype <>).
......
......@@ -458,8 +458,7 @@
// Mensajes de homúnculos
450: Ya tienes un homúnculo.
// Mensaje al devolver la mascota al huevo
451: No puedes devolver tu mascota al huevo porque tu inventario está lleno.
//451 free
// Sistema de mensajería
460: Introduce un idioma válido (instrucciones: @langtype <idioma>)
......
......@@ -447,8 +447,7 @@
// Homunculus messages
450: س Homunculus .
// Return pet to egg message
451: سöѵ§Ъͧ红ͧ㹵Ф.
//451 free
// Message System
460: ô͡ҷͧ (Ը: @langtype <>).
......
// Pet Additional Database
//
// Structure of Database:
// MobID,Name,JName,LureID,EggID,EquipID,FoodID,Fullness,HungryDelay,R_Hungry,R_Full,Intimate,Die,Capture,Speed,S_Performance,talk_convert_class,attack_rate,defence_attack_rate,change_target_rate,pet_script,loyal_script
//
// 01. MobID Monster ID of the pet.
// 02. Name Name of the monster as defined in the database.
// 03. JName The display name of the monster when hatched.
// 04. LureID Pet Tame Item ID.
// 05. EggID Pet Egg ID.
// 06. EquipID Pet Accessory ID.
// 07. FoodID Pet Food ID.
// 08. Fullness The amount Hunger is decreased every [HungryDelay] seconds.
// 09. HungryDelay The amount of time it takes for hunger to decrease after feeding. (Default: 60 seconds)
// 10. R_Hungry Amount of Intimacy that is increased when fed.
// 11. R_Full Amount of Intimacy that is decreased when over-fed.
// 12. Intimate Amount of Intimacy the pet starts with.
// 13. Die Amount of Intimacy that is decreased when the pet owner dies.
// 14. Capture Capture succes rate (10000 = 100%)
// 15. Speed Pet's walk speed. (Defaul: 150)
// 16. S_Performance Special Performance. (Yes = 1, No = 0)
// 17. talk_convert_class Disables pet talk (instead of talking they emote with /!.)
// 18. attack_rate Rate of which the pet will attack (requires at least pet_support_min_friendly intimacy).
// 19. defence_attack_rate Rate of which the pet will retaliate when master is being attacked (requires at least pet_support_min_friendly intimacy).
// 20. change_target_rate Rate of which the pet will change its attack target.
// 21. pet_script Script to execute when the pet is hatched.
// 22. loyal_script Script to execute when the pet is hatched (requires at least pet_equip_min_friendly intimacy, independent of pet_script).
//NOTE: The max value (100%) of attack_rate, defense_rate & change_target_rate is 10000.
//In theory you can use any valid script, but it is run only once upon pet
//loading, so it is recommended you use the specific pet scripts:
//petskillattack skillid, skilllv, rate, bonusrate
//Skill attack that triggers while the pet is attacking. Rate is the base
//chance of execution per attack. Bonusrate is an additional success rate when
//intimacy reaches max.
//petskillattack2 skillid, damage, hits, rate, bonusrate
//Same as petskillattack, but the damage and number of hits is fixed
//the damage specified is total, not per hit.
//petskillsupport skillid, skilllv, delay, hp%, sp%
//Casts a support skill when the health levels are below the specified hp% and
//sp%. Delay is the minimum time in seconds before the skill can be cast again
//petheal amount, delay, hp%, sp%
//Similar to petskillsupport, but the skill is fixed to heal (28) and the
//heal-amount is fixed to the value given.
//petrecovery type, delay: Cures the "type" status effect after "delay" seconds
//petskillbonus type, value, duration, delay
//Gives bonus stats. Type is the stat to increase (bStr, bLuk), value is the
//amount by which it is increased, duration signals how long the bonus lasts
//delay is the time elapsed after the bonus ends and before it starts again.
//A single pet can have petloot, petskillbonus, petskillattack (or
//petskillattack2) and petskillsupport (or petheal) at the same time,
//but only one of each.
This diff is collapsed.
# This file is a part of rAthena.
# Copyright(C) 2019 rAthena Development Team
# https://rathena.org - https://github.com/rathena
#
# This program 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/>.
#
###########################################################################
# Pet Database
###########################################################################
#
# Pet Settings
#
###########################################################################
# - Mob Monster that can be used as pet
# TameItem Pet Tame Item.
# EggItem Pet Egg Item.
# EquipItem Pet Accessory Item. (Default: 0)
# FoodItem Pet Food Item. (Default: 0)
# Fullness The amount of hunger is decreased every [HungryDelay] seconds.
# HungryDelay The amount of time in seconds it takes for hunger to decrease after feeding. (Default: 60)
# HungerIncrease The amount of hunger that is increased every time the pet is fed (Default: 20)
# IntimacyStart Amount of Intimacy the pet starts with. (Default: 250)
# IntimacyFed Amount of Intimacy that is increased when fed. (Default: 50)
# IntimacyOverfed Amount of Intimacy that is increased when over-fed. (Default: -100)
# IntimacyHungry Amount of Intimacy that is increased when the pet is hungry. (Default: -5)
# IntimacyOwnerDie Amount of Intimacy that is increased when the pet owner dies. (Default: -20)
# CaptureRate Capture success rate. (10000 = 100%)
# SpecialPerformance If a pet has a Special Performance. (Default: true)
# AttackRate Rate of which the pet will attack [requires at least pet_support_min_friendly intimacy]. (10000 = 100%)
# RetaliateRate Rate of which the pet will retaliate when master is being attacked [requires at least pet_support_min_friendly intimacy]. (10000 = 100%)
# ChangeTargetRate Rate of which the pet will change its attack target. (10000 = 100%)
# AllowAutoFeed Allows turning automatic pet feeding on. (Default: false)
# Script Bonus script to execute when the pet is alive. (Default: null)
# SupportScript Bonus script to execute when pet_status_support is enabled. (Default: null)
# Evolution: Pet evolution settings. (Optional) (Default: null)
# - Target Mob this pet can evolve to.
# ItemRequirements: Item requirements for evolving this pet.
# - Item Self-explanatory
# Amount
###########################################################################
Header:
Type: PET_DB
Version: 1
Footer:
Imports:
- Path: db/pre-re/pet_db.yml
Mode: Prerenewal
- Path: db/re/pet_db.yml
Mode: Renewal
- Path: db/import/pet_db.yml
This diff is collapsed.
This diff is collapsed.
......@@ -5999,11 +5999,54 @@
9060,Brownie_Egg,Brownie Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9061,Marin_Egg,Marin Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9062,Novice_Poring_Egg,Novice Poring Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9063,Woodie_Egg,Woodie Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9064,Elephant_Egg,Elephant Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9065,Gorilla_Egg,Gorilla Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9066,Lion_Egg,Lion Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9067,Rhino_Egg,Rhino Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9068,Blue_Unicorn_Egg,Blue Unicorn Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9069,Mastering_Egg,Mastering Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9070,Savage_Egg,Savage Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9071,Grand_Peco_Peco_Egg,Grand Peco Peco Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9072,Orc_Hero_Egg,Orc Hero Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9073,Orc_Lord_Egg,Orc Lord Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9074,Rubylit_Egg,Rubylit Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9075,Sapphilit_Egg,Sapphilit Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9076,Emelit_Egg,Emelit Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9077,Topalit_Egg,Topalit Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9078,Amelit_Egg,Amelit Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9079,Mythlit_Egg,Mythlit Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9080,Tamadora_Egg,Tamadora Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9087,High_Orc_Egg,High Orc Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9088,Angeling_Egg,Angeling Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9089,Am_Mut_Egg,Am Mut Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9090,Little_Isis_Egg,Little Isis Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9091,Choco_Egg,Choco Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9092,Eggring_Egg,Eggring Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9093,Hyegun_Egg,Hyegun Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9094,Dr_Lunatic_Egg,Leaf Lunatic Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9095,Nine_Tail_Egg,Nine Tail Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9096,Cat_o_Nine_Tail_Egg,Cat o Nine Tail Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9097,Diabolic_2_Egg,Diabolic Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9098,Fire_Deleter_Egg,Fire Deleter Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9099,Teddy_Bear_Egg,Teddy Bear Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9100,Gremlin_Egg,Gremlin Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9101,Scatleton_Egg,Scatleton Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9102,Mummy_Egg,Mummy Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9103,Willow_Egg,Willow Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9104,Roween_Egg,Roween Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9105,Hodremlin_Egg,Hodremlin Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9106,Metaller_Egg,Metaller Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9107,Ancient_Mummy_Egg,Ancient Mummy Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9108,Xm_Teddy_Bear_Egg,Xmas Teddy Bear Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9109,Sweet_Drops_Egg,Sweet Drops Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9111,Phreeoni_Egg,Phreeoni Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9112,Moonlight_Egg,Moonlight Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9113,Skelion_Egg,Skelion Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9114,Pouring_Egg,Pouring Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
9115,Bacsojin2_Egg_,Bacsojin Egg,7,20,,0,,,,,,,,,,,,,{},{},{}
//===================================================================
// Pet Accessories
//===================================================================
......@@ -6046,6 +6089,9 @@
10037,Black_Butterfly_Mask,Black Butterfly Mask,8,20,,0,,,,,,,,,,,,,{},{},{}
10038,Horn_Protector,Horn Barrier,8,20,,0,,,,,,,,,,,,,{},{},{}
10039,Tw_Backpack,Tw Backpack,8,20,,0,,,,,,,,,,,,,{},{},{}
10040,Red_Bell_Necklace,Red Bell Necklace,8,20,,0,,,,,,,,,,,,,{},{},{}
10041,Shiny_Star_Button,Shiny Star Button,8,20,,0,,,,,,,,,,,,,{},{},{}
10042,Dark_Mane,Dark Mane,8,20,,0,,,,,,,,,,,,,{},{},{}
//===================================================================
// Misc "Etc" Books
//===================================================================
......@@ -11335,6 +11381,9 @@
23126,Bullet_Case_Poison,Poison Bullet Cartridge,2,10,,250,,,,,0xFFFFFFFF,63,2,,,,,,{ getitem 13231,500; },{},{}
23127,Bullet_Case_Blind,Blind Bullet Cartridge,2,10,,250,,,,,0xFFFFFFFF,63,2,,,,,,{ getitem 13232,500; },{},{}
23177,Kafra_Card_,Kafra Card,2,2,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ callfunc "F_CashStore"; },{},{}
23188,Unprocessed_Parts,Unprocessed Parts,2,10,,0,,,,,0xFFFFFFFF,63,2,,,,,,{ pet 1632; },{},{}
23189,Small_Needle_Kit,Small Needle Kit,2,10,,0,,,,,0xFFFFFFFF,63,2,,,,,,{ pet 1622; },{},{}
23187,Sap_Liquid,Sap Liquid,2,10,,0,,,,,0xFFFFFFFF,63,2,,,,,,{ pet 1180; },{},{}
23191,Varetyr_Spear_Scroll_1_5,Level 5 Varetyr Spear,11,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ itemskill "SO_VARETYR_SPEAR",5; },{},{}
23192,Diamond_Dust_Scroll_1_5,Level 5 Diamond Dust,11,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ itemskill "SO_DIAMONDDUST",5; },{},{}
23193,Crimson_Rock_Scroll_1_5,Level 5 Crimson Rock,11,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ itemskill "WL_CRIMSONROCK",5; },{},{}
......@@ -11343,6 +11392,7 @@
//
23228,Hazy_Mooncake,Hazy Mooncake,0,768,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ /* unknown */ },{},{}
//
23256,Elixir_Bandages,Elixir Bandages,2,10,,0,,,,,0xFFFFFFFF,63,2,,,,,,{ pet 1041; },{},{}
23277,Mado_Box,Emergency Magic Gear,2,10000,,3000,,,,,0x00000400,56,2,,,100,,,{ setmadogear 1; },{},{}
23280,N_Fly_Wing_,Novice Fly Wing,11,10,,0,,,,,0xFFFFFFFF,63,2,,,1:98,,,{ itemskill "AL_TELEPORT",1; },{},{}
23288,Compressed_Wing_Of_Fly,Compressed Fly Wing,11,1000,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ itemskill "AL_TELEPORT",1; },{},{}
......@@ -11661,6 +11711,9 @@
25185,Locket_Pendant,Locket Pendant,3,0,,0,,,,,,,,,,,,,{},{},{}
25187,Slug_Bullet,Slug Bullet,3,1200,,1200,,,,,,,,,,,,,{},{},{}
25223,Para_Team_Coin,Eden Group Coin,3,0,,0,,,,,,,,,,,,,{},{},{}
25231,Suspicious_Bottle,Suspicious Bottle,3,0,,10,,,,,,,,,,,,,{},{},{}
25232,Cheap_Lubricant,Cheap Lubricant,3,0,,10,,,,,,,,,,,,,{},{},{}
25233,Cotton_Tufts,Cotton Tufts,3,0,,10,,,,,,,,,,,,,{},{},{}
25238,New_Normal_Lubricant,New Normal Lubricant,3,0,,0,,,,,,,,,,,,,{},{},{}
25239,New_Advanced_Lubricant,New Advanced Lubricant,3,0,,0,,,,,,,,,,,,,{},{},{}
25246,Juice_Mix_Package,Juice Mix Package,3,0,,0,,,,,,,,,,,,,{},{},{}
......@@ -11684,6 +11737,9 @@
25283,Brown_Muffler,Brown Muffler,3,420,,10,,,,,,,,,,,,,{},{},{}
25284,Swamp_Bug_Shell,Swamp Bug Shell,3,0,,10,,,,,,,,,,,,,{},{},{}
25285,Brown_Rat_Tail,Brown Rat Tail,3,0,,10,,,,,,,,,,,,,{},{},{}
25290,Sweets_Festival_Coin,Sweets Festival Coin,3,0,,0,,,,,,,,,,,,,{},{},{}
25375,Powerful_Soul_Essence,Powerful Soul Essence,3,0,,0,,,,,,,,,,,,,{},{},{}
25377,Luxurious_Pet_Food,Luxurious Pet Food,3,0,,10,,,,,,,,,,,,,{},{},{}
//
25464,World_Moving_Rights,World Moving Rights,3,20,,0,,,,,,,,,,,,,{},{},{}
//
......@@ -2796,7 +2796,7 @@
//3633,EP16_2_VENOM_KIMERA
//3634,MYSTCASE_GIANT
//3635,EVENT_KOBOLD
//3636,LITTLE_ISIS
3636,LITTLE_ISIS,Little Isis,Little Isis,59,2092,1,531,597,1,192,229,83,5,58,43,22,5,39,15,10,12,2,6,27,0x2003095,200,1384,768,336,0,0,0,0,0,0,0,936,5335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
//3637,MD_SKELETON_60
//3638,MD_SKELETON_80
//3639,MD_SKELETON_100
......@@ -2829,8 +2829,8 @@
//3666,MD_DRAINLIAR_100
//3667,MD_DRAINLIAR_160
//3668,B_KIEL_
//3669,DIABOLIC2
//3670,DELETER_2
3669,DIABOLIC2,Diabolic2,Diabolic2,104,10572,1,2172,1629,1,544,644,68,61,103,80,53,65,78,25,10,12,0,6,47,0x2003885,150,1080,780,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
3670,DELETER_2,Deleter 2,Deleter 2,105,10000,1,2099,1574,1,510,621,114,53,98,65,49,72,57,73,10,12,1,9,43,0x308D,175,1024,624,336,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
//3671,JP_MAZEMOB_01
//3672,JP_MAZEMOB_02
//3673,JP_MAZEMOB_03
......@@ -2950,7 +2950,7 @@
3787,RR_ARCLOUSE,Rr Arclouse,Swamp Arclouze,106,1120,1,864,900,1,316,126,76,36,41,73,23,29,122,15,10,12,1,4,42,0x2003885,100,768,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27177,1
3788,RR_CRAMP,Rr Cramp,Brown Rat,101,988,1,681,720,1,185,74,68,42,38,43,17,15,97,30,10,12,0,2,45,0x3885,100,768,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27176,1
//3789,ESCAPED_LETTER
//3790,SWEETS_DROPS
3790,SWEETS_DROPS,Sweets Drops,Sweets Drops,2,45,1,27,20,1,12,13,16,0,8,1,1,0,6,2,10,12,1,3,23,0x83,400,1372,672,480,0,0,0,0,0,0,0,909,7500,1602,80,938,500,512,1100,713,1700,512,800,620,20,0,0,0,0,0,0
//3791,JP_E_MONSTER_73
//3792,ILL_GAZETI
//3793,ILL_SNOWIER
......
This diff is collapsed.
This diff is collapsed.
......@@ -1361,7 +1361,7 @@ Affected files:
-- battleconf: battle_athena.conf, battle_conf.txt
-- instancedb: instance_db.txt
-- itemdb: item_db.txt, item_group_db.txt, item_trade.txt, item_noequip.txt, item_nouse.txt, item_combo_db.txt, item_avail.txt, item_stack.txt, item_delay.txt, item_buyingstore.txt, item_flag.txt
-- mobdb: mob_db.txt, mob_item_ratio.txt, mob_chat_db.txt, mob_avail.txt, mob_race2_db.txt, mob_branch.txt, mob_poring.txt, mob_boss.txt, mob_pouch.txt, mob_classchange.txt, pet_db.txt, homunculus_db.txt, homun_skill_tree.txt, exp_homun.txt, mercenary_db.txt, mercenary_skill_db.txt, elemental_db.txt, elemental_skill_db.txt
-- mobdb: mob_db.txt, mob_item_ratio.txt, mob_chat_db.txt, mob_avail.txt, mob_race2_db.txt, mob_branch.txt, mob_poring.txt, mob_boss.txt, mob_pouch.txt, mob_classchange.txt, pet_db.yml, homunculus_db.txt, homun_skill_tree.txt, exp_homun.txt, mercenary_db.txt, mercenary_skill_db.txt, elemental_db.txt, elemental_skill_db.txt
-- motd: motd.txt
-- msgconf: atcommand_athena.conf
-- pcdb: statpoint.txt, job_exp.txt, skill_tree.txt, attr_fix.txt, job_db1.txt, job_db2.txt, job_basehpsp_db.txt, job_maxhpsp_db.txt, job_param_db.txt, level_penalty.txt
......
......@@ -9380,7 +9380,7 @@ monster as long as it is in the pet database and the targeted monster requires t
item used.
See 'doc/mob_db_mode_list.txt' for more information about monster modes.
A full list of pet IDs can be found inside 'db/(pre-)re/pet_db.txt'.
A full list of pet IDs can be found inside 'db/(pre-)re/pet_db.yml'.
---------------------------------------
......@@ -9388,7 +9388,7 @@ A full list of pet IDs can be found inside 'db/(pre-)re/pet_db.txt'.
This command will create a pet egg and put it in the invoking character's
inventory. The kind of pet is specified by pet ID numbers listed in
'db/(pre-)re/pet_db.txt'. The egg is created exactly as if the character just successfully
'db/(pre-)re/pet_db.yml'. The egg is created exactly as if the character just successfully
caught a pet in the normal way.
// This will make you a poring:
......@@ -9406,16 +9406,40 @@ This function will return pet information for the pet the invoking character
currently has active. Valid types are:
PETINFO_ID - Pet ID
PETINFO_CLASS - Pet class number as per 'db/(pre-)re/pet_db.txt' - will tell you what kind of a pet it
is.
PETINFO_CLASS - Pet class number as per 'db/(pre-)re/pet_db.yml' - will tell you what kind of a pet it is.
PETINFO_NAME - Pet name. Will return "null" if there's no pet.
PETINFO_INTIMATE - Pet friendly level (intimacy score). 1000 is full loyalty.
PETINFO_HUNGRY - Pet hungry level. 100 is completely full.
PETINFO_HUNGRY - Pet hungry level. 100 is full hunger.
PETINFO_RENAMED - Pet rename flag. 0 means this pet has not been named yet.
PETINFO_LEVEL - Pet level
PETINFO_BLOCKID - Pet Game ID
PETINFO_EGGID - Pet egg item id
PETINFO_FOODID - Pet food item id
PETINFO_EGGID - Pet egg item ID
PETINFO_FOODID - Pet food item ID
PETINFO_INTIMATE can be used with the following constants for checking values:
PET_INTIMATE_NONE = 0
PET_INTIMATE_AWKWARD = 1 ~ 99
PET_INTIMATE_SHY = 100 ~ 249
PET_INTIMATE_NEUTRAL = 250 ~ 749
PET_INTIMATE_CORDIAL = 750 ~ 909
PET_INTIMATE_LOYAL = 910 ~ 1000
PETINFO_HUNGRY can be used with the following constants for checking values:
PET_HUNGRY_NONE = 0
PET_HUNGRY_VERY_HUNGRY = 1 ~ 10
PET_HUNGRY_HUNGRY = 11 ~ 25
PET_HUNGRY_NEUTRAL = 26 ~ 75
PET_HUNGRY_SATISFIED = 76 ~ 90
PET_HUNGRY_STUFFED = 91 ~ 100
Example:
mes "[Vet]";
mes "Your pet + " getpetinfo(PETINFO_NAME);
if (getpetinfo(PETINFO_INTIMATE) < PET_INTIMATE_LOYAL)
mes "has some growing to do on you!";
else
mes "seems to love you very much!";
close;
---------------------------------------
......
......@@ -967,6 +967,7 @@ CREATE TABLE IF NOT EXISTS `pet` (
`hungry` smallint(9) unsigned NOT NULL default '0',
`rename_flag` tinyint(4) unsigned NOT NULL default '0',
`incubate` int(11) unsigned NOT NULL default '0',
`autofeed` tinyint(2) NOT NULL default '0',
PRIMARY KEY (`pet_id`)
) ENGINE=MyISAM;
......
ALTER TABLE `pet`
ADD COLUMN `autofeed` tinyint(2) NOT NULL default '0' AFTER `incubate`;
......@@ -23,7 +23,7 @@ int mapif_load_pet(int fd, uint32 account_id, uint32 char_id, int pet_id);
//---------------------------------------------------------
int inter_pet_tosql(int pet_id, struct s_pet* p)
{
//`pet` (`pet_id`, `class`,`name`,`account_id`,`char_id`,`level`,`egg_id`,`equip`,`intimate`,`hungry`,`rename_flag`,`incubate`)
//`pet` (`pet_id`, `class`,`name`,`account_id`,`char_id`,`level`,`egg_id`,`equip`,`intimate`,`hungry`,`rename_flag`,`incubate`,`autofeed`)
char esc_name[NAME_LENGTH*2+1];// escaped pet name
Sql_EscapeStringLen(sql_handle, esc_name, p->name, strnlen(p->name, NAME_LENGTH));
......@@ -33,10 +33,10 @@ int inter_pet_tosql(int pet_id, struct s_pet* p)
if( pet_id == -1 )
{// New pet.
if( SQL_ERROR == Sql_Query(sql_handle, "INSERT INTO `%s` "
"(`class`,`name`,`account_id`,`char_id`,`level`,`egg_id`,`equip`,`intimate`,`hungry`,`rename_flag`,`incubate`) "
"VALUES ('%d', '%s', '%d', '%d', '%d', '%hu', '%hu', '%d', '%d', '%d', '%d')",
"(`class`,`name`,`account_id`,`char_id`,`level`,`egg_id`,`equip`,`intimate`,`hungry`,`rename_flag`,`incubate`,`autofeed`) "
"VALUES ('%d', '%s', '%d', '%d', '%d', '%hu', '%hu', '%d', '%d', '%d', '%d', '%d')",
schema_config.pet_db, p->class_, esc_name, p->account_id, p->char_id, p->level, p->egg_id,
p->equip, p->intimate, p->hungry, p->rename_flag, p->incubate) )
p->equip, p->intimate, p->hungry, p->rename_flag, p->incubate, p->autofeed) )
{
Sql_ShowDebug(sql_handle);
return 0;
......@@ -45,9 +45,9 @@ int inter_pet_tosql(int pet_id, struct s_pet* p)
}
else
{// Update pet.
if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `class`='%d',`name`='%s',`account_id`='%d',`char_id`='%d',`level`='%d',`egg_id`='%hu',`equip`='%hu',`intimate`='%d',`hungry`='%d',`rename_flag`='%d',`incubate`='%d' WHERE `pet_id`='%d'",
if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `class`='%d',`name`='%s',`account_id`='%d',`char_id`='%d',`level`='%d',`egg_id`='%hu',`equip`='%hu',`intimate`='%d',`hungry`='%d',`rename_flag`='%d',`incubate`='%d',`autofeed`='%d' WHERE `pet_id`='%d'",
schema_config.pet_db, p->class_, esc_name, p->account_id, p->char_id, p->level, p->egg_id,
p->equip, p->intimate, p->hungry, p->rename_flag, p->incubate, p->pet_id) )
p->equip, p->intimate, p->hungry, p->rename_flag, p->incubate, p->autofeed, p->pet_id) )
{
Sql_ShowDebug(sql_handle);
return 0;
......@@ -69,9 +69,9 @@ int inter_pet_fromsql(int pet_id, struct s_pet* p)
#endif
memset(p, 0, sizeof(struct s_pet));
//`pet` (`pet_id`, `class`,`name`,`account_id`,`char_id`,`level`,`egg_id`,`equip`,`intimate`,`hungry`,`rename_flag`,`incubate`)
//`pet` (`pet_id`, `class`,`name`,`account_id`,`char_id`,`level`,`egg_id`,`equip`,`intimate`,`hungry`,`rename_flag`,`incubate`,`autofeed`)
if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `pet_id`, `class`,`name`,`account_id`,`char_id`,`level`,`egg_id`,`equip`,`intimate`,`hungry`,`rename_flag`,`incubate` FROM `%s` WHERE `pet_id`='%d'", schema_config.pet_db, pet_id) )
if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `pet_id`, `class`,`name`,`account_id`,`char_id`,`level`,`egg_id`,`equip`,`intimate`,`hungry`,`rename_flag`,`incubate`,`autofeed` FROM `%s` WHERE `pet_id`='%d'", schema_config.pet_db, pet_id) )
{
Sql_ShowDebug(sql_handle);
return 0;
......@@ -91,6 +91,7 @@ int inter_pet_fromsql(int pet_id, struct s_pet* p)
Sql_GetData(sql_handle, 9, &data, NULL); p->hungry = atoi(data);
Sql_GetData(sql_handle, 10, &data, NULL); p->rename_flag = atoi(data);
Sql_GetData(sql_handle, 11, &data, NULL); p->incubate = atoi(data);
Sql_GetData(sql_handle, 12, &data, NULL); p->autofeed = atoi(data) != 0;
Sql_FreeResult(sql_handle);
......@@ -201,6 +202,7 @@ int mapif_create_pet(int fd, uint32 account_id, uint32 char_id, short pet_class,
pet_pt->hungry = hungry;
pet_pt->rename_flag = rename_flag;
pet_pt->incubate = incubate;
pet_pt->autofeed = 0;
if(pet_pt->hungry < 0)
pet_pt->hungry = 0;
......
......@@ -20,6 +20,24 @@ bool YamlDatabase::nodeExists( const YAML::Node& node, const std::string& name )
}
}
bool YamlDatabase::nodesExist( const YAML::Node& node, std::initializer_list<const std::string> names ){
bool missing = false;
for( const std::string& name : names ){
if( !this->nodeExists( node, name ) ){
ShowError( "Missing mandatory node \"%s\".\n", name.c_str() );
missing = true;
}
}
if( missing ){
this->invalidWarning( node, "At least one mandatory node did not exist.\n" );
return false;
}
return true;
}
bool YamlDatabase::verifyCompatibility( const YAML::Node& rootNode ){
if( !this->nodeExists( rootNode, "Header" ) ){
ShowError( "No database \"Header\" was found.\n" );
......@@ -67,6 +85,12 @@ bool YamlDatabase::load(){
return this->load( this->getDefaultLocation() );
}
bool YamlDatabase::reload(){
this->clear();
return this->load();
}
bool YamlDatabase::load(const std::string& path) {
YAML::Node rootNode;
......
......@@ -31,6 +31,7 @@ private:
protected:
// Helper functions
bool nodeExists( const YAML::Node& node, const std::string& name );
bool nodesExist( const YAML::Node& node, std::initializer_list<const std::string> names );
void invalidWarning( const YAML::Node &node, const char* fmt, ... );
std::string getCurrentFile();
......@@ -58,6 +59,7 @@ public:
}
bool load();
bool reload();
// Functions that need to be implemented for each type
virtual void clear() = 0;
......
......@@ -407,6 +407,7 @@ struct s_pet {
char name[NAME_LENGTH];
char rename_flag;
char incubate;
bool autofeed;
};
struct s_homunculus { //[orn]
......
......@@ -2742,7 +2742,6 @@ ACMD_FUNC(guildlevelup) {
ACMD_FUNC(makeegg) {
struct item_data *item_data;
int id;
struct s_pet_db* pet;
nullpo_retr(-1, sd);
......@@ -2759,12 +2758,18 @@ ACMD_FUNC(makeegg) {
else
id = atoi(message);
pet = pet_db(id);
if (!pet)
std::shared_ptr<s_pet_db> pet = pet_db.find(id);
if( pet == nullptr ){
pet = pet_db_search(id, PET_EGG);
}
if (pet != nullptr) {
sd->catch_target_class = pet->class_;
intif_create_pet(sd->status.account_id, sd->status.char_id, pet->class_, mob_db(pet->class_)->lv, pet->EggID, 0, pet->intimate, 100, 0, 1, pet->jname);
struct mob_db* mdb = mob_db(pet->class_);
intif_create_pet(sd->status.account_id, sd->status.char_id, pet->class_, mdb->lv, pet->EggID, 0, pet->intimate, 100, 0, 1, mdb->jname);
} else {
clif_displaymessage(fd, msg_txt(sd,180)); // The monster/egg name/id doesn't exist.
return -1;
......@@ -3819,7 +3824,7 @@ ACMD_FUNC(reload) {
clif_displaymessage(fd, msg_txt(sd,97)); // Item database has been reloaded.
} else if (strstr(command, "mobdb") || strncmp(message, "mobdb", 3) == 0) {
mob_reload();
read_petdb();
pet_db.reload();
hom_reload();
mercenary_readdb();
mercenary_read_skilldb();
......@@ -4488,7 +4493,7 @@ ACMD_FUNC(repairall)
count = 0;
for (i = 0; i < MAX_INVENTORY; i++) {
if (sd->inventory.u.items_inventory[i].nameid && sd->inventory.u.items_inventory[i].attribute == 1) {
if (sd->inventory.u.items_inventory[i].nameid && sd->inventory.u.items_inventory[i].card[0] != CARD0_PET && sd->inventory.u.items_inventory[i].attribute == 1) {
sd->inventory.u.items_inventory[i].attribute = 0;
clif_produceeffect(sd, 0, sd->inventory.u.items_inventory[i].nameid);
count++;
......
......@@ -8506,6 +8506,10 @@ static const struct _battle_data {
{ "allow_bound_sell", &battle_config.allow_bound_sell, 0, 0, 0xF, },
{ "event_refine_chance", &battle_config.event_refine_chance, 0, 0, 1, },
{ "autoloot_adjust", &battle_config.autoloot_adjust, 0, 0, 1, },
{ "feature.petevolution", &battle_config.feature_petevolution, 1, 0, 1, },
{ "feature.petautofeed", &battle_config.feature_pet_autofeed, 1, 0, 1, },
{ "feature.pet_autofeed_rate", &battle_config.feature_pet_autofeed_rate, 89, 0, 100, },
{ "pet_autofeed_always", &battle_config.pet_autofeed_always, 1, 0, 1, },
{ "broadcast_hide_name", &battle_config.broadcast_hide_name, 2, 0, NAME_LENGTH, },
{ "skill_drop_items_full", &battle_config.skill_drop_items_full, 0, 0, 1, },
{ "switch_remove_edp", &battle_config.switch_remove_edp, 2, 0, 3, },
......@@ -8649,6 +8653,17 @@ void battle_adjust_conf()
}
#endif
#if PACKETVER < 20141008
if (battle_config.feature_petevolution) {
ShowWarning("conf/battle/feature.conf petevolution is enabled but it requires PACKETVER 2014-10-08 or newer, disabling...\n");
battle_config.feature_petevolution = 0;
}
if (battle_config.feature_pet_auto_feed) {
ShowWarning("conf/battle/feature.conf pet auto feed is enabled but it requires PACKETVER 2014-10-08 or newer, disabling...\n");
battle_config.feature_pet_auto_feed = 0;
}
#endif
#if PACKETVER < 20170208
if (battle_config.feature_equipswitch) {
ShowWarning("conf/battle/feature.conf equip switch is enabled but it requires PACKETVER 2017-02-08 or newer, disabling...\n");
......
......@@ -641,6 +641,10 @@ struct Battle_Config
int allow_bound_sell;
int event_refine_chance;
int autoloot_adjust;
int feature_petevolution;
int feature_pet_autofeed;
int feature_pet_autofeed_rate;
int pet_autofeed_always;
int broadcast_hide_name;
int skill_drop_items_full;
int switch_remove_edp;
......
......@@ -7970,25 +7970,13 @@ void clif_send_petstatus(struct map_session_data *sd)
void clif_pet_emotion(struct pet_data *pd,int param)
{
unsigned char buf[16];
s_pet_db *pet_db_ptr;
nullpo_retv(pd);
pet_db_ptr = pd->get_pet_db();
memset(buf,0,packet_len(0x1aa));
WBUFW(buf,0)=0x1aa;
WBUFL(buf,2)=pd->bl.id;
if(param >= 100 && pet_db_ptr->talk_convert_class) {
if(pet_db_ptr->talk_convert_class < 0)
return;
else if(pet_db_ptr->talk_convert_class > 0) {
// replace mob_id component of talk/act data
param -= (pd->pet.class_ - 100)*100;
param += (pet_db_ptr->talk_convert_class - 100)*100;
}
}