Compare commits

...

7 Commits

Author SHA1 Message Date
aleos
1ab4ebe576 Resolve some compile errors and warnings 2024-05-03 13:06:40 -04:00
Aleos
69635631c0
Merge branch 'master' into refactor/produce 2024-05-03 10:36:48 -04:00
Atemo
348803193c Extends the second roll Make/Amount 2023-06-18 17:47:17 +02:00
Atemo
62b0b12274
Apply suggestions from code review
Co-authored-by: Aleos <aleos89@users.noreply.github.com>
2023-06-17 17:41:14 +02:00
Atemo
4a7d2b45b5
Apply suggestions from code review
Co-authored-by: Vincent Stumpf <vincents.995@gmail.com>
2023-06-13 17:27:06 +02:00
Atemo
86fcc98081 Corrections from code review 2023-06-13 17:21:23 +02:00
Atemo
480cf26283 Converted produce_db and skill_changematerial_db into YAML 2023-05-17 21:35:33 +02:00
15 changed files with 7497 additions and 486 deletions

View File

@ -0,0 +1,45 @@
# This file is a part of rAthena.
# Copyright(C) 2023 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/>.
#
###########################################################################
# Item Produce Database
###########################################################################
#
# Item Produce Settings
#
###########################################################################
# - ItemLevel Number which determines what kind of a crafting window will pop-up.
# Recipe:
# - Product AegisName of the produced item.
# SkillName Skill name required. (Default: null)
# SkillLevel Skill level required. (Default: 1)
# Consumed: List of items consumed to produce the Product.
# - Item AegisName of the consumed item.
# Amount Amount required.
# Clear Remove the item with the given AegisName from Consumed. (Optional)
# NotConsumed: List of items not consumed to produce the Product. (Default: null)
# - Item AegisName of the unconsumed item.
# Clear Remove the item with the given AegisName from NotConsumed. (Optional)
# BaseRate Base rate (in n/10%) for Change Material (ItemLevel: 26). (Default: 1000)
# Make: List of item amounts with their individual rate produced by Change Material (ItemLevel: 26). (Default: null)
# - Amount Amount of item created (unique to the list) for Change Material (ItemLevel: 26).
# Rate Rate to create the Amount (in n/10%) for Change Material (ItemLevel: 26). (Default: 1000. 0 to remove on import)
###########################################################################
Header:
Type: PRODUCE_DB
Version: 1

View File

@ -1,11 +0,0 @@
// Change Material Database
//
// Structure of Database:
// ID,ProductID,BaseRate,MakeAmount1,MakeAmountRate1...,MakeAmount5,MakeAmountRate5
//
// NOTE:
// - ID is used to identify item order that will be used for overwriting on db/import.
// Value is started from 0 until 74 (MAX_SKILL_CHANGEMATERIAL_DB-1). Use same ID on import file to overwrite original result & requirements
// - Up to 5 ID/Amount pairs can be specified.
// - Rate = n/10%

49
db/pre-re/produce_db.yml Normal file
View File

@ -0,0 +1,49 @@
# This file is a part of rAthena.
# Copyright(C) 2023 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/>.
#
###########################################################################
# Item Produce Database
###########################################################################
#
# Item Produce Settings
#
###########################################################################
# - ItemLevel Number which determines what kind of a crafting window will pop-up.
# Recipe:
# - Product AegisName of the produced item.
# SkillName Skill name required. (Default: null)
# SkillLevel Skill level required. (Default: 1)
# Consumed: List of items consumed to produce the Product.
# - Item AegisName of the consumed item.
# Amount Amount required.
# Clear Remove the item with the given AegisName from Consumed. (Optional)
# NotConsumed: List of items not consumed to produce the Product. (Default: null)
# - Item AegisName of the unconsumed item.
# Clear Remove the item with the given AegisName from NotConsumed. (Optional)
# BaseRate Base rate (in n/10%) for Change Material (ItemLevel: 26). (Default: 1000)
# Make: List of item amounts with their individual rate produced by Change Material (ItemLevel: 26). (Default: null)
# - Amount Amount of item created (unique to the list) for Change Material (ItemLevel: 26).
# Rate Rate to create the Amount (in n/10%) for Change Material (ItemLevel: 26). (Default: 1000. 0 to remove on import)
###########################################################################
Header:
Type: PRODUCE_DB
Version: 1
Footer:
Imports:
- Path: db/pre-re/skill_produce_db.yml

File diff suppressed because it is too large Load Diff

53
db/produce_db.yml Normal file
View File

@ -0,0 +1,53 @@
# This file is a part of rAthena.
# Copyright(C) 2023 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/>.
#
###########################################################################
# Item Produce Database
###########################################################################
#
# Item Produce Settings
#
###########################################################################
# - ItemLevel Number which determines what kind of a crafting window will pop-up.
# Recipe:
# - Product AegisName of the produced item.
# SkillName Skill name required. (Default: null)
# SkillLevel Skill level required. (Default: 1)
# Consumed: List of items consumed to produce the Product.
# - Item AegisName of the consumed item.
# Amount Amount required.
# Clear Remove the item with the given AegisName from Consumed. (Optional)
# NotConsumed: List of items not consumed to produce the Product. (Default: null)
# - Item AegisName of the unconsumed item.
# Clear Remove the item with the given AegisName from NotConsumed. (Optional)
# BaseRate Base rate (in n/10%) for Change Material (ItemLevel: 26). (Default: 1000)
# Make: List of item amounts with their individual rate produced by Change Material (ItemLevel: 26). (Default: null)
# - Amount Amount of item created (unique to the list) for Change Material (ItemLevel: 26).
# Rate Rate to create the Amount (in n/10%) for Change Material (ItemLevel: 26). (Default: 1000. 0 to remove on import)
###########################################################################
Header:
Type: PRODUCE_DB
Version: 1
Footer:
Imports:
- Path: db/pre-re/produce_db.yml
Mode: Prerenewal
- Path: db/re/produce_db.yml
Mode: Renewal
- Path: db/import/produce_db.yml

50
db/re/produce_db.yml Normal file
View File

@ -0,0 +1,50 @@
# This file is a part of rAthena.
# Copyright(C) 2023 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/>.
#
###########################################################################
# Item Produce Database
###########################################################################
#
# Item Produce Settings
#
###########################################################################
# - ItemLevel Number which determines what kind of a crafting window will pop-up.
# Recipe:
# - Product AegisName of the produced item.
# SkillName Skill name required. (Default: null)
# SkillLevel Skill level required. (Default: 1)
# Consumed: List of items consumed to produce the Product.
# - Item AegisName of the consumed item.
# Amount Amount required.
# Clear Remove the item with the given AegisName from Consumed. (Optional)
# NotConsumed: List of items not consumed to produce the Product. (Default: null)
# - Item AegisName of the unconsumed item.
# Clear Remove the item with the given AegisName from NotConsumed. (Optional)
# BaseRate Base rate (in n/10%) for Change Material (ItemLevel: 26). (Default: 1000)
# Make: List of item amounts with their individual rate produced by Change Material (ItemLevel: 26). (Default: null)
# - Amount Amount of item created (unique to the list) for Change Material (ItemLevel: 26).
# Rate Rate to create the Amount (in n/10%) for Change Material (ItemLevel: 26). (Default: 1000. 0 to remove on import)
###########################################################################
Header:
Type: PRODUCE_DB
Version: 1
Footer:
Imports:
- Path: db/re/skill_produce_db.yml
- Path: db/re/skill_changematerial_db.yml

View File

@ -0,0 +1,911 @@
# This file is a part of rAthena.
# Copyright(C) 2023 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/>.
#
###########################################################################
# Item Produce Database
###########################################################################
#
# Item Produce Settings
#
###########################################################################
# - ItemLevel Number which determines what kind of a crafting window will pop-up.
# Recipe:
# - Product AegisName of the produced item.
# Skill: Skill requirement. (Default: null)
# Name Skill name required.
# Level Skill level required.
# Consumed: List of items consumed to produce the Product.
# - Item AegisName of the consumed item.
# Amount Amount required.
# Clear Remove the item with the given AegisName from Consumed. (Optional)
# NotConsumed: List of items not consumed to produce the Product. (Default: null)
# - Item AegisName of the unconsumed item.
# Clear Remove the item with the given AegisName from NotConsumed. (Optional)
# BaseRate Base rate (in n/10%) for Change Material (ItemLevel: 26). (Default: 1000)
# Make: List of item amounts with their individual rate produced by Change Material (ItemLevel: 26). (Default: null)
# - Amount Amount of item created (unique to the list) for Change Material (ItemLevel: 26).
# Rate Rate to create the Amount (in n/10%) for Change Material (ItemLevel: 26). (Default: 1000. 0 to remove on import)
###########################################################################
Header:
Type: PRODUCE_DB
Version: 1
Body:
- ItemLevel: 26
Recipe:
- Product: Sacred_Masque
BaseRate: 800
Make:
- Amount: 8
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Grasshopper's_Leg
Amount: 45
- Item: Yoyo_Tail
Amount: 35
- Product: Long_Hair
Make:
- Amount: 4
Rate: 800
- Amount: 6
Rate: 200
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Pencil_Case
Amount: 40
- Item: Tiger's_Skin
Amount: 5
- Product: Phracon
BaseRate: 800
Make:
- Amount: 8
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Glass_Bead
Amount: 40
- Item: Spawn
Amount: 45
- Product: Lantern
BaseRate: 800
Make:
- Amount: 3
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Blossom_Of_Maneater
Amount: 20
- Item: Solid_Shell
Amount: 10
- Product: Acorn
BaseRate: 800
Make:
- Amount: 4
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Cactus_Needle
Amount: 30
- Item: Snail's_Shell
Amount: 10
- Product: Frozen_Heart
BaseRate: 800
Make:
- Amount: 6
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Moth_Dust
Amount: 35
- Item: Raccoondog_Doll
Amount: 25
- Product: Horrendous_Mouth
BaseRate: 800
Make:
- Amount: 9
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Dragon_Scale
Amount: 45
- Item: Stem
Amount: 45
- Product: Detrimindexta
BaseRate: 800
Make:
- Amount: 5
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Chrysalis
Amount: 40
- Item: Flesh_Of_Clam
Amount: 10
- Product: Detonator
BaseRate: 800
Make:
- Amount: 7
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Feather_Of_Birds
Amount: 25
- Item: Nose_Ring
Amount: 45
- Product: Tweezer
BaseRate: 800
Make:
- Amount: 4
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Monkey_Doll
Amount: 5
- Item: Worm_Peelings
Amount: 40
- Product: Petite_DiablOfs_Horn
Make:
- Amount: 1
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Resin
Amount: 10
- Item: Stone_Heart
Amount: 5
- Product: Root_Of_Maneater
Make:
- Amount: 4
Rate: 800
- Amount: 6
Rate: 200
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Talon
Amount: 25
- Item: Tooth_Of_
Amount: 20
- Product: Conch
BaseRate: 800
Make:
- Amount: 3
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Gill
Amount: 5
- Item: Immortal_Heart
Amount: 25
- Product: Rotten_Scale
BaseRate: 800
Make:
- Amount: 7
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Shell
Amount: 20
- Item: Thin_N'_Long_Tongue
Amount: 50
- Product: Elder_Pixie's_Beard
Make:
- Amount: 8
Rate: 800
- Amount: 12
Rate: 200
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Bee_Sting
Amount: 35
- Item: Petite_DiablOfs_Wing
Amount: 45
- Product: Lizard_Scruff
BaseRate: 800
Make:
- Amount: 3
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Karvodailnirol
Amount: 15
- Item: Scale_Of_Snakes
Amount: 20
- Product: Emveretarcon
BaseRate: 800
Make:
- Amount: 4
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Grasshopper_Doll
Amount: 40
- Item: Heart_Of_Mermaid
Amount: 5
- Product: Chinese_Ink
BaseRate: 800
Make:
- Amount: 4
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Bear's_Foot
Amount: 20
- Item: Black_Ladle
Amount: 25
- Product: Spiderweb
BaseRate: 800
Make:
- Amount: 8
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Fin
Amount: 50
- Item: Slender_Snake
Amount: 35
- Product: Reins
BaseRate: 800
Make:
- Amount: 8
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Chonchon_Doll
Amount: 30
- Item: Stuffed_Doll
Amount: 50
- Product: Wooden_Block
BaseRate: 800
Make:
- Amount: 2
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Rotten_Bandage
Amount: 10
- Item: Single_Cell
Amount: 10
- Product: Tentacle
Make:
- Amount: 4
Rate: 800
- Amount: 6
Rate: 200
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Decayed_Nail
Amount: 40
- Item: Wild_Boar's_Mane
Amount: 5
- Product: Mixture
Make:
- Amount: 4
Rate: 800
- Amount: 6
Rate: 200
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Posionous_Canine
Amount: 15
- Item: Powder_Of_Butterfly
Amount: 30
- Product: Colorful_Shell
Make:
- Amount: 9
Rate: 800
- Amount: 13
Rate: 200
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Horn
Amount: 50
- Item: Zargon
Amount: 45
- Product: Wing_Of_Moth
BaseRate: 800
Make:
- Amount: 5
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Frozen_Rose
Amount: 20
- Item: Reptile_Tongue
Amount: 30
- Product: Nipper
Make:
- Amount: 6
Rate: 800
- Amount: 9
Rate: 200
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Earthworm_Peeling
Amount: 40
- Item: Sticky_Mucus
Amount: 25
- Product: Turtle_Shell
BaseRate: 800
Make:
- Amount: 4
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Fluff
Amount: 5
- Item: Poring_Doll
Amount: 40
- Product: Nail_Of_Orc
BaseRate: 800
Make:
- Amount: 6
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Garlet
Amount: 10
- Item: Raccoon_Leaf
Amount: 50
- Product: Dragon_Canine
Make:
- Amount: 8
Rate: 800
- Amount: 12
Rate: 200
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Osiris_Doll
Amount: 50
- Item: Sticky_Webfoot
Amount: 35
- Product: Skirt_Of_Virgin
BaseRate: 800
Make:
- Amount: 6
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Head_Of_Medusa
Amount: 35
- Item: Scales_Shell
Amount: 30
- Product: Dragon_Train
BaseRate: 800
Make:
- Amount: 6
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Sharpened_Cuspid
Amount: 35
- Item: Tooth_Of_Bat
Amount: 25
- Product: Dokkaebi_Horn
BaseRate: 800
Make:
- Amount: 4
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Lip_Of_Ancient_Fish
Amount: 25
- Item: Shining_Scales
Amount: 15
- Product: Grit
BaseRate: 800
Make:
- Amount: 8
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Crystal_Mirror
Amount: 35
- Item: Limb_Of_Mantis
Amount: 50
- Product: Sharp_Scale
BaseRate: 800
Make:
- Amount: 3
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Clam_Shell
Amount: 20
- Item: Horseshoe
Amount: 10
- Product: Short_Leg
BaseRate: 800
Make:
- Amount: 6
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Claw_Of_Wolves
Amount: 20
- Item: Scell
Amount: 45
- Product: Starsand_Of_Witch
BaseRate: 800
Make:
- Amount: 2
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Blue_Porcelain
Amount: 15
- Item: Insect_Feeler
Amount: 10
- Product: Fox_Tail
Make:
- Amount: 2
Rate: 800
- Amount: 3
Rate: 200
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Animal's_Skin
Amount: 10
- Item: Rouge
Amount: 15
- Product: Cobold_Hair
Make:
- Amount: 6
Rate: 800
- Amount: 9
Rate: 200
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Jellopy
Amount: 45
- Item: Wedding_Bouquet
Amount: 20
- Product: Jaws_Of_Ant
Make:
- Amount: 4
Rate: 800
- Amount: 6
Rate: 200
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Spore_Doll
Amount: 20
- Item: Witherless_Rose
Amount: 20
- Product: Voucher_Of_Orcish_Hero
BaseRate: 800
Make:
- Amount: 5
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Nail_Of_Mole
Amount: 45
- Item: Tree_Root
Amount: 5
- Product: Sacred_Marks
BaseRate: 800
Make:
- Amount: 4
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Pumpkin_Head
Amount: 30
- Item: Scorpion's_Tail
Amount: 10
- Product: Alchol
BaseRate: 800
Make:
- Amount: 9
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Orcish_Voucher
Amount: 50
- Item: Skel_Bone
Amount: 40
- Product: Crap_Shell
BaseRate: 800
Make:
- Amount: 8
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Baphomet_Doll
Amount: 50
- Item: Fish_Tail
Amount: 30
- Product: Tendon
BaseRate: 800
Make:
- Amount: 3
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Feather
Amount: 5
- Item: Orcish_Cuspid
Amount: 25
- Product: Tiger_Footskin
BaseRate: 800
Make:
- Amount: 2
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Pointed_Scale
Amount: 5
- Item: White_Platter
Amount: 20
- Product: Hinalle
Make:
- Amount: 2
Rate: 200
- Amount: 4
Rate: 800
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Bunch_Of_Flowers
Amount: 45
- Item: Moustache_Of_Mole
Amount: 40
- Product: Counteragent
BaseRate: 800
Make:
- Amount: 4
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Evil_Horn
Amount: 15
- Item: Mementos
Amount: 30
- Product: Tooth_Of_Ancient_Fish
Make:
- Amount: 6
Rate: 800
- Amount: 9
Rate: 200
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Bill_Of_Birds
Amount: 35
- Item: Transparent_Cloth
Amount: 30
- Product: Rat_Tail
Make:
- Amount: 7
Rate: 800
- Amount: 10
Rate: 200
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Golden_Hair
Amount: 40
- Item: Mushroom_Spore
Amount: 35
- Product: Coal
BaseRate: 500
Make:
- Amount: 1
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Guard
Amount: 1
- Product: Steel
Make:
- Amount: 10
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Tsurugi
Amount: 1
- Product: Cigar
Make:
- Amount: 1
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Orcish_Axe
Amount: 1
- Product: Bone_Wand
BaseRate: 200
Make:
- Amount: 1
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Broken_Farming_Utensil
Amount: 100
- Item: Clattering_Skull
Amount: 100
- Product: Cigar
Make:
- Amount: 1
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Orcish_Axe
Amount: 1
- Item: Orcish_Voucher
Amount: 100
- Product: Starsand_Of_Witch
BaseRate: 800
Make:
- Amount: 2
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Moth_Dust
Amount: 100
- Item: Scell
Amount: 100
- Product: Soft_Feather
Make:
- Amount: 1
Rate: 200
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Feather
Amount: 30
- Item: Feather_Of_Birds
Amount: 30
- Product: Wind_Of_Verdure
Make:
- Amount: 1
Rate: 500
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Ice_Piece
Amount: 100
- Product: Crystal_Blue
Make:
- Amount: 1
Rate: 500
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Claw_Of_Wolves
Amount: 100
- Product: Soft_Silk_Cloth
Make:
- Amount: 2
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Transparent_Cloth
Amount: 10
- Product: Transparent_Cloth
Make:
- Amount: 5
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Soft_Silk_Cloth
Amount: 2
- Product: Boost500_To_Throw
Make:
- Amount: 1
Rate: 100
- Amount: 2
Rate: 250
- Amount: 5
Rate: 500
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Boost500
Amount: 10
- Item: Empty_Potion
Amount: 10
- Item: Flexible_String
Amount: 10
- Product: Full_SwingK_To_Throw
Make:
- Amount: 1
Rate: 100
- Amount: 2
Rate: 250
- Amount: 5
Rate: 500
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Empty_Potion
Amount: 10
- Item: Flexible_String
Amount: 10
- Item: Full_SwingK
Amount: 10
- Product: Mana_Plus_To_Throw
Make:
- Amount: 1
Rate: 100
- Amount: 2
Rate: 250
- Amount: 5
Rate: 500
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Empty_Potion
Amount: 10
- Item: Flexible_String
Amount: 10
- Item: Mana_Plus
Amount: 10
- Product: Cure_Free_To_Throw
Make:
- Amount: 1
Rate: 100
- Amount: 2
Rate: 250
- Amount: 5
Rate: 500
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Cure_Free
Amount: 10
- Item: Empty_Potion
Amount: 10
- Item: Flexible_String
Amount: 10
- Product: Stamina_Up_M_To_Throw
Make:
- Amount: 1
Rate: 100
- Amount: 2
Rate: 250
- Amount: 5
Rate: 500
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Empty_Potion
Amount: 10
- Item: Flexible_String
Amount: 10
- Item: Stamina_Up_M
Amount: 10
- Product: Digestive_F_To_Throw
Make:
- Amount: 1
Rate: 100
- Amount: 2
Rate: 250
- Amount: 5
Rate: 500
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Digestive_F
Amount: 10
- Item: Empty_Potion
Amount: 10
- Item: Flexible_String
Amount: 10
- Product: HP_Inc_PotS_To_Throw
Make:
- Amount: 10
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Bottle_To_Throw
Amount: 10
- Item: HP_Increase_PotionS
Amount: 10
- Product: HP_Inc_PotM_To_Throw
Make:
- Amount: 10
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Bottle_To_Throw
Amount: 10
- Item: HP_Increase_PotionM
Amount: 10
- Product: HP_Inc_PotL_To_Throw
Make:
- Amount: 10
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Bottle_To_Throw
Amount: 10
- Item: HP_Increase_PotionL
Amount: 10
- Product: SP_Inc_PotS_To_Throw
Make:
- Amount: 10
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Bottle_To_Throw
Amount: 10
- Item: SP_Increase_PotionS
Amount: 10
- Product: SP_Inc_PotM_To_Throw
Make:
- Amount: 10
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Bottle_To_Throw
Amount: 10
- Item: SP_Increase_PotionM
Amount: 10
- Product: SP_Inc_PotL_To_Throw
Make:
- Amount: 10
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Bottle_To_Throw
Amount: 10
- Item: SP_Increase_PotionL
Amount: 10
- Product: En_White_PotZ_To_Throw
Make:
- Amount: 10
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Bottle_To_Throw
Amount: 10
- Item: Enrich_White_PotionZ
Amount: 10
- Product: Vitata500_To_Throw
Make:
- Amount: 10
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Bottle_To_Throw
Amount: 10
- Item: Vitata500
Amount: 10
- Product: En_Cel_Juice_To_Throw
Make:
- Amount: 10
SkillName: GN_CHANGEMATERIAL
SkillLevel: 1
Consumed:
- Item: Bottle_To_Throw
Amount: 10
- Item: Enrich_Celermine_Juice
Amount: 10

2531
db/re/skill_produce_db.yml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
###########################################################################
# Item Produce Database
###########################################################################
#
# Item Produce Settings
#
###########################################################################
# - ItemLevel Number which determines what kind of a crafting window will pop-up.
# Recipe:
# - Product AegisName of the produced item.
# SkillName Skill name required. (Default: null)
# SkillLevel Skill level required. (Default: 1)
# Consumed: List of items consumed to produce the Product.
# - Item AegisName of the consumed item.
# Amount Amount required.
# Clear Remove the item with the given AegisName from Consumed. (Optional)
# NotConsumed: List of items not consumed to produce the Product. (Default: null)
# - Item AegisName of the unconsumed item.
# Clear Remove the item with the given AegisName from NotConsumed. (Optional)
# BaseRate Base rate (in n/10%) for Change Material (ItemLevel: 26). (Default: 1000)
# Make: List of item amounts with their individual rate produced by Change Material (ItemLevel: 26). (Default: null)
# - Amount Amount of item created (unique to the list) for Change Material (ItemLevel: 26).
# Rate Rate to create the Amount (in n/10%) for Change Material (ItemLevel: 26). (Default: 1000. 0 to remove on import)
###########################################################################

View File

@ -6375,37 +6375,32 @@ void clif_skill_estimation(map_session_data *sd,struct block_list *dst)
void clif_skill_produce_mix_list( map_session_data *sd, int skill_id, int trigger ){ void clif_skill_produce_mix_list( map_session_data *sd, int skill_id, int trigger ){
nullpo_retv(sd); nullpo_retv(sd);
int fd = sd->fd;
if( !session_isActive( fd ) ){
return;
}
if (sd->menuskill_id == skill_id) if (sd->menuskill_id == skill_id)
return; //Avoid resending the menu twice or more times... return; //Avoid resending the menu twice or more times...
if (skill_id == GC_CREATENEWPOISON) if (skill_id == GC_CREATENEWPOISON)
skill_id = GC_RESEARCHNEWPOISON; skill_id = GC_RESEARCHNEWPOISON;
WFIFOHEAD( fd, sizeof( struct PACKET_ZC_MAKABLEITEMLIST ) + MAX_SKILL_PRODUCE_DB * sizeof( struct PACKET_ZC_MAKABLEITEMLIST_sub ) ); struct PACKET_ZC_MAKABLEITEMLIST *p = (struct PACKET_ZC_MAKABLEITEMLIST *)packet_buffer;
struct PACKET_ZC_MAKABLEITEMLIST *p = (struct PACKET_ZC_MAKABLEITEMLIST *)WFIFOP( fd, 0 );
p->packetType = 0x18d; p->packetType = 0x18d;
int count = 0; int count = 0;
for( int i = 0; i < MAX_SKILL_PRODUCE_DB; i++ ){ for (const auto &itemlvit : skill_produce_db) {
if (skill_can_produce_mix(sd,skill_produce_db[i].nameid, trigger, 1) && for (const auto &datait : itemlvit.second->data) {
(skill_id <= 0 || skill_produce_db[i].req_skill == skill_id) if (skill_can_produce_mix(sd, datait.second->nameid, trigger, 1) != nullptr &&
) (skill_id <= 0 || (skill_id > 0 && datait.second->req_skill == skill_id))
{ )
p->items[count].itemId = client_nameid( skill_produce_db[i].nameid ); {
p->items[count].material[0] = 0; p->items[count].itemId = client_nameid( datait.second->nameid );
p->items[count].material[1] = 0; p->items[count].material[0] = 0;
p->items[count].material[2] = 0; p->items[count].material[1] = 0;
count++; p->items[count].material[2] = 0;
count++;
}
} }
} }
p->packetLength = static_cast<decltype(p->packetLength)>( sizeof( struct PACKET_ZC_MAKABLEITEMLIST ) + count * sizeof( struct PACKET_ZC_MAKABLEITEMLIST_sub ) ); p->packetLength = static_cast<decltype(p->packetLength)>( sizeof( struct PACKET_ZC_MAKABLEITEMLIST ) + count * sizeof( struct PACKET_ZC_MAKABLEITEMLIST_sub ) );
WFIFOSET( fd, p->packetLength ); clif_send( p, p->packetLength, &sd->bl, SELF );
if( count > 0 ){ if( count > 0 ){
sd->menuskill_id = skill_id; sd->menuskill_id = skill_id;
@ -6434,31 +6429,26 @@ void clif_cooking_list( map_session_data *sd, int trigger, uint16 skill_id, int
return; return;
} }
int fd = sd->fd; struct PACKET_ZC_MAKINGITEM_LIST *p = (struct PACKET_ZC_MAKINGITEM_LIST *)packet_buffer;
if( !session_isActive( fd ) ){
return;
}
WFIFOHEAD( fd, sizeof( struct PACKET_ZC_MAKINGITEM_LIST ) + MAX_SKILL_PRODUCE_DB * sizeof( struct PACKET_ZC_MAKINGITEM_LIST_sub ) );
struct PACKET_ZC_MAKINGITEM_LIST *p = (struct PACKET_ZC_MAKINGITEM_LIST *)WFIFOP( fd, 0 );
p->packetType = 0x25a; p->packetType = 0x25a;
p->makeItem = list_type; // list type p->makeItem = list_type; // list type
int count = 0; int count = 0;
for( int i = 0; i < MAX_SKILL_PRODUCE_DB; i++ ){ for (const auto &itemlvit : skill_produce_db) {
if( !skill_can_produce_mix( sd, skill_produce_db[i].nameid, trigger, qty ) ){ for (const auto &datait : itemlvit.second->data) {
continue; if( skill_can_produce_mix( sd, datait.second->nameid, trigger, qty ) == nullptr ){
} continue;
}
p->items[count].itemId = client_nameid( skill_produce_db[i].nameid ); p->items[count].itemId = client_nameid( datait.second->nameid );
count++; count++;
}
} }
if( count > 0 || skill_id == AM_PHARMACY ){ if( count > 0 || skill_id == AM_PHARMACY ){
p->packetLength = static_cast<decltype(p->packetLength)>( sizeof( struct PACKET_ZC_MAKINGITEM_LIST ) + count * sizeof( struct PACKET_ZC_MAKINGITEM_LIST_sub ) ); p->packetLength = static_cast<decltype(p->packetLength)>( sizeof( struct PACKET_ZC_MAKINGITEM_LIST ) + count * sizeof( struct PACKET_ZC_MAKINGITEM_LIST_sub ) );
WFIFOSET( fd, p->packetLength ); clif_send( p, p->packetLength, &sd->bl, SELF );
sd->menuskill_id = skill_id; sd->menuskill_id = skill_id;
sd->menuskill_val = trigger; sd->menuskill_val = trigger;
@ -6469,7 +6459,7 @@ void clif_cooking_list( map_session_data *sd, int trigger, uint16 skill_id, int
clif_msg_skill( sd, skill_id, INVENTORY_SPACE_FULL ); clif_msg_skill( sd, skill_id, INVENTORY_SPACE_FULL );
#else #else
p->packetLength = static_cast<decltype(p->packetLength)>( sizeof( struct PACKET_ZC_MAKINGITEM_LIST ) + count * sizeof( struct PACKET_ZC_MAKINGITEM_LIST_sub ) ); p->packetLength = static_cast<decltype(p->packetLength)>( sizeof( struct PACKET_ZC_MAKINGITEM_LIST ) + count * sizeof( struct PACKET_ZC_MAKINGITEM_LIST_sub ) );
WFIFOSET( fd, p->packetLength ); clif_send( p, p->packetLength, &sd->bl, SELF );
#endif #endif
} }
} }
@ -13236,10 +13226,10 @@ void clif_parse_ProduceMix(int fd,map_session_data *sd){
return; return;
} }
int produce_idx; std::shared_ptr<s_skill_produce_db_entry> produce = skill_can_produce_mix(sd,p->itemId,sd->menuskill_val, 1);
if( (produce_idx = skill_can_produce_mix(sd,p->itemId,sd->menuskill_val, 1)) ) if( produce != nullptr )
skill_produce_mix(sd,0,p->itemId,p->material[0],p->material[1],p->material[2],1,produce_idx-1); skill_produce_mix(sd,0,p->itemId,p->material[0],p->material[1],p->material[2],1,produce);
clif_menuskill_clear(sd); clif_menuskill_clear(sd);
} }
@ -13263,7 +13253,6 @@ void clif_parse_Cooking(int fd,map_session_data *sd) {
const struct PACKET_CZ_REQ_MAKINGITEM *p = (struct PACKET_CZ_REQ_MAKINGITEM *)RFIFOP( fd, 0 ); const struct PACKET_CZ_REQ_MAKINGITEM *p = (struct PACKET_CZ_REQ_MAKINGITEM *)RFIFOP( fd, 0 );
int amount = sd->menuskill_val2 ? sd->menuskill_val2 : 1; int amount = sd->menuskill_val2 ? sd->menuskill_val2 : 1;
short food_idx = -1;
if( p->type == 6 && sd->menuskill_id != GN_MIX_COOKING && sd->menuskill_id != GN_S_PHARMACY ) if( p->type == 6 && sd->menuskill_id != GN_MIX_COOKING && sd->menuskill_id != GN_S_PHARMACY )
return; return;
@ -13274,8 +13263,11 @@ void clif_parse_Cooking(int fd,map_session_data *sd) {
clif_menuskill_clear(sd); clif_menuskill_clear(sd);
return; return;
} }
if( (food_idx = skill_can_produce_mix(sd,p->itemId,sd->menuskill_val, amount)) )
skill_produce_mix(sd,(p->type>1?sd->menuskill_id:0),p->itemId,0,0,0,amount,food_idx-1); std::shared_ptr<s_skill_produce_db_entry> produce = skill_can_produce_mix(sd,p->itemId,sd->menuskill_val, amount);
if( produce != nullptr )
skill_produce_mix(sd,(p->type>1?sd->menuskill_id:0),p->itemId,0,0,0,amount,produce);
clif_menuskill_clear(sd); clif_menuskill_clear(sd);
} }
@ -13479,7 +13471,7 @@ void clif_parse_SelectArrow(int fd,map_session_data *sd) {
skill_arrow_create(sd,p->itemId); skill_arrow_create(sd,p->itemId);
break; break;
case SA_CREATECON: case SA_CREATECON:
skill_produce_mix(sd,SA_CREATECON,p->itemId,0,0,0,1,-1); skill_produce_mix(sd,SA_CREATECON,p->itemId,0,0,0,1, nullptr);
break; break;
case GC_POISONINGWEAPON: case GC_POISONINGWEAPON:
skill_poisoningweapon(*sd,p->itemId); skill_poisoningweapon(*sd,p->itemId);
@ -19575,11 +19567,13 @@ void clif_elementalconverter_list( map_session_data *sd ){
p->packetLength = sizeof( *p ); p->packetLength = sizeof( *p );
int count = 0; int count = 0;
for( int i = 0; i < MAX_SKILL_PRODUCE_DB; i++ ){ for (const auto &itemlvit : skill_produce_db) {
if( skill_can_produce_mix( sd, skill_produce_db[i].nameid, 23, 1 ) ){ for (const auto &datait : itemlvit.second->data) {
p->items[count].itemId = client_nameid( skill_produce_db[i].nameid ); if( skill_can_produce_mix( sd, datait.second->nameid, 23, 1 ) ){
p->packetLength += sizeof( p->items[0] ); p->items[count].itemId = client_nameid( datait.second->nameid );
count++; p->packetLength += sizeof( p->items[0] );
count++;
}
} }
} }

View File

@ -366,12 +366,11 @@
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\mob_item_ratio.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\mob_item_ratio.yml')" /> <Copy SourceFiles="$(SolutionDir)db\import-tmpl\mob_item_ratio.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\mob_item_ratio.yml')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\mob_skill_db.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\mob_skill_db.txt')" /> <Copy SourceFiles="$(SolutionDir)db\import-tmpl\mob_skill_db.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\mob_skill_db.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\pet_db.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\pet_db.yml')" /> <Copy SourceFiles="$(SolutionDir)db\import-tmpl\pet_db.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\pet_db.yml')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\produce_db.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\produce_db.txt')" /> <Copy SourceFiles="$(SolutionDir)db\import-tmpl\produce_db.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\produce_db.yml')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\quest_db.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\quest_db.yml')" /> <Copy SourceFiles="$(SolutionDir)db\import-tmpl\quest_db.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\quest_db.yml')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\refine.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\refine.yml')" /> <Copy SourceFiles="$(SolutionDir)db\import-tmpl\refine.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\refine.yml')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\reputation.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\reputation.yml')" /> <Copy SourceFiles="$(SolutionDir)db\import-tmpl\reputation.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\reputation.yml')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\size_fix.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\size_fix.yml')" /> <Copy SourceFiles="$(SolutionDir)db\import-tmpl\size_fix.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\size_fix.yml')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\skill_changematerial_db.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\skill_changematerial_db.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\skill_damage_db.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\skill_damage_db.txt')" /> <Copy SourceFiles="$(SolutionDir)db\import-tmpl\skill_damage_db.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\skill_damage_db.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\skill_db.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\skill_db.yml')" /> <Copy SourceFiles="$(SolutionDir)db\import-tmpl\skill_db.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\skill_db.yml')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\skill_nocast_db.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\skill_nocast_db.txt')" /> <Copy SourceFiles="$(SolutionDir)db\import-tmpl\skill_nocast_db.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\skill_nocast_db.txt')" />

File diff suppressed because it is too large Load Diff

View File

@ -28,8 +28,6 @@ struct s_skill_unit_group;
struct status_change_entry; struct status_change_entry;
class status_change; class status_change;
#define MAX_SKILL_PRODUCE_DB 300 /// Max Produce DB
#define MAX_PRODUCE_RESOURCE 12 /// Max Produce requirements
#define MAX_SKILL_LEVEL 13 /// Max Skill Level (for skill_db storage) #define MAX_SKILL_LEVEL 13 /// Max Skill Level (for skill_db storage)
#define MAX_MOBSKILL_LEVEL 100 /// Max monster skill level (on skill usage) #define MAX_MOBSKILL_LEVEL 100 /// Max monster skill level (on skill usage)
#define MAX_SKILL_CRIMSON_MARKER 3 /// Max Crimson Marker targets (RL_C_MARKER) #define MAX_SKILL_CRIMSON_MARKER 3 /// Max Crimson Marker targets (RL_C_MARKER)
@ -444,15 +442,39 @@ enum e_skill_blown {
}; };
/// Create Database item /// Create Database item
struct s_skill_produce_db { struct s_skill_produce_db_entry {
t_itemid nameid; /// Product ID t_itemid nameid; /// Product ID
unsigned short req_skill; /// Required Skill uint16 req_skill; /// Required Skill
unsigned char req_skill_lv, /// Required Skill Level uint16 req_skill_lv, /// Required Skill Level
itemlv; /// Item Level itemlv; /// Item Level
t_itemid mat_id[MAX_PRODUCE_RESOURCE]; /// Materials needed std::unordered_map<t_itemid, uint16> materials;
unsigned short mat_amount[MAX_PRODUCE_RESOURCE]; /// Amount of each materials
// additional rates/quantity data for skill_changematerial
uint16 baserate;
std::unordered_map<uint16, uint16> qty;
}; };
extern struct s_skill_produce_db skill_produce_db[MAX_SKILL_PRODUCE_DB];
struct s_skill_produce_db {
uint16 itemlv; /// Item Level
std::unordered_map<t_itemid, std::shared_ptr<s_skill_produce_db_entry>> data; /// item, entry
};
class SkillProduceDatabase : public TypesafeYamlDatabase<uint16, s_skill_produce_db> {
private:
uint16 total_id = 0;
public:
SkillProduceDatabase() : TypesafeYamlDatabase("PRODUCE_DB", 1) {
}
const std::string getDefaultLocation() override;
uint64 parseBodyNode(const ryml::NodeRef& node) override;
bool addItemConsumed(const ryml::NodeRef& node, std::shared_ptr<s_skill_produce_db_entry> &entry, bool isConsumed);
void loadingFinished() override;
};
extern SkillProduceDatabase skill_produce_db;
/// Creating database arrow /// Creating database arrow
struct s_skill_arrow_db { struct s_skill_arrow_db {
@ -628,8 +650,8 @@ bool skill_isNotOk_mercenary( uint16 skill_id, s_mercenary_data& md);
bool skill_isNotOk_npcRange(struct block_list *src, uint16 skill_id, uint16 skill_lv, int pos_x, int pos_y); bool skill_isNotOk_npcRange(struct block_list *src, uint16 skill_id, uint16 skill_lv, int pos_x, int pos_y);
// Item creation // Item creation
short skill_can_produce_mix( map_session_data *sd, t_itemid nameid, int trigger, int qty); std::shared_ptr<s_skill_produce_db_entry> skill_can_produce_mix(map_session_data *sd, t_itemid nameid, int trigger, int qty);
bool skill_produce_mix( map_session_data *sd, uint16 skill_id, t_itemid nameid, int slot1, int slot2, int slot3, int qty, short produce_idx ); bool skill_produce_mix( map_session_data *sd, uint16 skill_id, t_itemid nameid, int slot1, int slot2, int slot3, int qty, std::shared_ptr<s_skill_produce_db_entry> produce = nullptr );
bool skill_arrow_create( map_session_data *sd, t_itemid nameid); bool skill_arrow_create( map_session_data *sd, t_itemid nameid);

View File

@ -156,6 +156,16 @@ static void skilltree_txt_data(const std::string &modePath, const std::string &f
sv_readdb(modePath.c_str(), "skill_tree.txt", ',', 3 + MAX_PC_SKILL_REQUIRE * 2, 5 + MAX_PC_SKILL_REQUIRE * 2, -1, pc_readdb_skilltree, false); sv_readdb(modePath.c_str(), "skill_tree.txt", ',', 3 + MAX_PC_SKILL_REQUIRE * 2, 5 + MAX_PC_SKILL_REQUIRE * 2, -1, pc_readdb_skilltree, false);
} }
// Produce database data to memory
static void produce_txt_data(const std::string &modePath, const std::string &fixedPath) {
skill_produce.clear();
if (fileExists(modePath + "/produce_db.txt"))
sv_readdb(modePath.c_str(), "produce_db.txt", ',', 5, 5 + 2 * MAX_PRODUCE_RESOURCE, MAX_SKILL_PRODUCE_DB, skill_parse_row_producedb, false);
if (fileExists(fixedPath + "/skill_changematerial_db.txt"))
sv_readdb(fixedPath.c_str(), "skill_changematerial_db.txt", ',', 5, 5 + 2 * MAX_SKILL_CHANGEMATERIAL_SET, MAX_SKILL_CHANGEMATERIAL_DB, skill_parse_row_changematerialdb, false);
}
template<typename Func> template<typename Func>
bool process( const std::string& type, uint32 version, const std::vector<std::string>& paths, const std::string& name, Func lambda, const std::string& rename = "" ){ bool process( const std::string& type, uint32 version, const std::vector<std::string>& paths, const std::string& name, Func lambda, const std::string& rename = "" ){
for( const std::string& path : paths ){ for( const std::string& path : paths ){
@ -563,13 +573,28 @@ bool Csv2YamlTool::initialize( int argc, char* argv[] ){
})) { })) {
return 0; return 0;
} }
produce_txt_data(path_db_mode, path_db);
if (!process("PRODUCE_DB", 1, { path_db_mode }, "produce_db", [](const std::string &path, const std::string &name_ext) -> bool {
return skill_producedb_yaml();
})) {
return 0;
}
produce_txt_data(path_db_import, path_db_import);
if (!process("PRODUCE_DB", 1, { path_db_import }, "produce_db", [](const std::string &path, const std::string &name_ext) -> bool {
return skill_producedb_yaml();
})) {
return 0;
}
// TODO: add implementations ;-)
homunculus_txt_data(path_db_import, path_db_import); homunculus_txt_data(path_db_import, path_db_import);
if (!process("HOMUNCULUS_DB", 1, { path_db_import }, "homunculus_db", [](const std::string& path, const std::string& name_ext) -> bool { if (!process("HOMUNCULUS_DB", 1, { path_db_import }, "homunculus_db", [](const std::string& path, const std::string& name_ext) -> bool {
return sv_readdb(path.c_str(), name_ext.c_str(), ',', 50, 50, MAX_HOMUNCULUS_CLASS, read_homunculusdb, false); return sv_readdb(path.c_str(), name_ext.c_str(), ',', 50, 50, MAX_HOMUNCULUS_CLASS, read_homunculusdb, false);
})) { })) {
return 0; return 0;
} }
// TODO: add implementations ;-) // TODO: add implementations ;-)
@ -5271,6 +5296,169 @@ static bool read_homunculusdb( char* str[], size_t columns, size_t current ){
return true; return true;
} }
// Copied and adjusted from skill.cpp
static bool skill_parse_row_producedb(char* split[], size_t columns, size_t current) {
t_itemid nameid = static_cast<t_itemid>(strtoul(split[1], nullptr, 10));
if (nameid == 0) {
ShowError("skill_parse_row_producedb: Removing an item for this DB must be done manually. Skipping.\n");
return false;
}
std::string *item_name = util::umap_find(aegis_itemnames, nameid);
if (!item_name) {
ShowError("skill_parse_row_producedb: Invalid item %u.\n", nameid);
return false;
}
uint16 skill_id = static_cast<uint16>(strtoul(split[3], nullptr, 10));
std::string* skill_name = util::umap_find( aegis_skillnames, skill_id );
if (skill_id != 0 && skill_name == nullptr) {
ShowError( "Skill name for skill id %hu is not known.\n", skill_id );
return false;
}
s_skill_produce_db_csv entry = {};
uint32 skill_lv = strtoul(split[4], nullptr, 10);
uint32 itemlv = strtoul(split[2], nullptr, 10);
entry.produced_name = *item_name;
if (skill_name != nullptr) {
entry.req_skill_name = *skill_name;
entry.req_skill_lv = skill_lv;
}
for (size_t x = 5; x+1 < columns && split[x] && split[x+1]; x += 2) {
nameid = static_cast<t_itemid>(strtoul(split[x], nullptr, 10));
item_name = util::umap_find(aegis_itemnames, nameid);
if (!item_name) {
ShowError("skill_parse_row_producedb: Invalid item %u.\n", nameid);
return false;
}
uint32 amount = strtoul(split[x+1], nullptr, 10);
if (amount == 0)
entry.item_notconsumed.push_back(*item_name);
else
entry.item_consumed[ *item_name ] = amount;
}
const auto &exists = skill_produce.find(itemlv);
if (exists != skill_produce.end())
exists->second.push_back(entry);
else {
std::vector<s_skill_produce_db_csv> produce;
produce.push_back(entry);
skill_produce.insert({ itemlv, produce });
}
return true;
}
// Copied and adjusted from skill.cpp
static bool skill_parse_row_changematerialdb(char* split[], size_t columns, size_t current)
{
t_itemid nameid = static_cast<t_itemid>(strtoul(split[1], nullptr, 10));
// Import just for clearing/disabling from original data
// NOTE: If import for disabling, better disable list from produce_db instead of here, or creation just failed with deleting requirements.
if (nameid == 0) {
ShowError("skill_parse_row_changematerialdb: Removing an item for this DB must be done manually. Skipping.\n");
return false;
}
std::string *produced_name = util::umap_find(aegis_itemnames, nameid);
if (!produced_name) {
ShowError("skill_parse_row_changematerialdb: Invalid item %u.\n", nameid);
return false;
}
s_skill_changematerial_db_csv item = {};
item.baserate = static_cast<uint16>(strtoul(split[2], nullptr, 10));
for (size_t x = 3; x+1 < columns && split[x] && split[x+1]; x += 2) {
item.qty.insert({ static_cast<uint16>(strtoul(split[x], nullptr, 10)), static_cast<uint16>(strtoul(split[x+1], nullptr, 10)) });
}
skill_changematerial_db.insert({ *produced_name, item });
return true;
}
static bool skill_producedb_yaml(void) {
for (const auto &produceit : skill_produce) {
body << YAML::BeginMap;
body << YAML::Key << "ItemLevel" << YAML::Value << produceit.first;
body << YAML::Key << "Recipe";
body << YAML::BeginSeq;
for (const auto &it : produceit.second) {
body << YAML::BeginMap;
body << YAML::Key << "Product" << YAML::Value << it.produced_name;
// additional lines from skill_changematerial_db (which uses ItemLV 26)
if (produceit.first == 26) {
s_skill_changematerial_db_csv* changematerial = util::umap_find( skill_changematerial_db, it.produced_name );
if (changematerial != nullptr) {
if (changematerial->baserate != 1000)
body << YAML::Key << "BaseRate" << YAML::Value << changematerial->baserate;
if (!changematerial->qty.empty()) {
body << YAML::Key << "Make";
body << YAML::BeginSeq;
for (const auto &qit : changematerial->qty) {
body << YAML::BeginMap;
body << YAML::Key << "Amount" << YAML::Value << qit.first;
if (qit.second != 1000)
body << YAML::Key << "Rate" << YAML::Value << qit.second;
body << YAML::EndMap;
}
body << YAML::EndSeq;
}
}
}
if (it.req_skill_lv > 0) {
body << YAML::Key << "SkillName" << YAML::Value << it.req_skill_name;
body << YAML::Key << "SkillLevel" << YAML::Value << it.req_skill_lv;
}
if (!it.item_consumed.empty()) {
body << YAML::Key << "Consumed";
body << YAML::BeginSeq;
for (const auto &itemit : it.item_consumed) {
body << YAML::BeginMap;
body << YAML::Key << "Item" << YAML::Value << itemit.first;
body << YAML::Key << "Amount" << YAML::Value << itemit.second;
body << YAML::EndMap;
}
body << YAML::EndSeq;
}
if (!it.item_notconsumed.empty()) {
body << YAML::Key << "NotConsumed";
body << YAML::BeginSeq;
for (const auto &itemit : it.item_notconsumed) {
body << YAML::BeginMap;
body << YAML::Key << "Item" << YAML::Value << itemit;
body << YAML::EndMap;
}
body << YAML::EndSeq;
}
body << YAML::EndMap;
}
body << YAML::EndSeq;
body << YAML::EndMap;
}
return true;
}
int main( int argc, char *argv[] ){ int main( int argc, char *argv[] ){
return main_core<Csv2YamlTool>( argc, argv ); return main_core<Csv2YamlTool>( argc, argv );
} }

View File

@ -42,6 +42,10 @@ namespace rathena{
///Maximum amount of items a combo may require ///Maximum amount of items a combo may require
#define MAX_ITEMS_PER_COMBO 6 #define MAX_ITEMS_PER_COMBO 6
#define MAX_HOM_SKILL_REQUIRE 5 #define MAX_HOM_SKILL_REQUIRE 5
#define MAX_SKILL_CHANGEMATERIAL_DB 75
#define MAX_SKILL_CHANGEMATERIAL_SET 3
#define MAX_SKILL_PRODUCE_DB 300 /// Max Produce DB
#define MAX_PRODUCE_RESOURCE 12 /// Max Produce requirements
struct s_skill_tree_entry_csv { struct s_skill_tree_entry_csv {
std::string skill_name; std::string skill_name;
@ -65,6 +69,23 @@ std::unordered_map<uint16, s_skill_db> skill_nearnpc;
std::unordered_map<int32, std::vector<s_homun_skill_tree_entry>> hom_skill_tree; std::unordered_map<int32, std::vector<s_homun_skill_tree_entry>> hom_skill_tree;
struct s_skill_produce_db_csv {
std::string produced_name,
req_skill_name;
uint32 req_skill_lv,
itemlv;
std::map<std::string, uint32> item_consumed;
std::vector<std::string> item_notconsumed;
};
std::map<uint32, std::vector<s_skill_produce_db_csv>> skill_produce;
struct s_skill_changematerial_db_csv {
uint16 baserate;
std::map<uint16, uint16> qty;
};
std::unordered_map<std::string, s_skill_changematerial_db_csv> skill_changematerial_db;
static unsigned int level_penalty[3][CLASS_MAX][MAX_LEVEL * 2 + 1]; static unsigned int level_penalty[3][CLASS_MAX][MAX_LEVEL * 2 + 1];
struct s_item_flag_csv2yaml { struct s_item_flag_csv2yaml {
@ -536,5 +557,9 @@ static bool itemdb_read_combos(const char* file);
static bool cashshop_parse_dbrow( char* fields[], size_t columns, size_t current ); static bool cashshop_parse_dbrow( char* fields[], size_t columns, size_t current );
static bool read_homunculus_skilldb( char* split[], size_t columns, size_t current ); static bool read_homunculus_skilldb( char* split[], size_t columns, size_t current );
static bool read_homunculusdb( char* str[], size_t columns, size_t current ); static bool read_homunculusdb( char* str[], size_t columns, size_t current );
static bool skill_parse_row_producedb(char* fields[], size_t columns, size_t current);
static bool skill_producedb_yaml();
static bool skill_parse_row_producedb(char *split[], size_t columns, size_t current);
static bool skill_parse_row_changematerialdb(char* fields[], size_t columns, size_t current);
#endif /* CSV2YAML_HPP */ #endif /* CSV2YAML_HPP */