Skip to content

Commit

Permalink
Converted mob_item_ratio to YAML (rathena#6021)
Browse files Browse the repository at this point in the history
* Converted mob_item_ratio to YAML
* Includes CSV2YAML converter.
* Added the possibility to remove an item from monster drop using this feature

Co-authored-by: Aleos <[email protected]>
Co-authored-by: Lemongrass3110 <[email protected]>

Thanks to @idk-whoami !
  • Loading branch information
Atemo authored Aug 11, 2021
1 parent 9d48c5a commit 99eed0c
Show file tree
Hide file tree
Showing 11 changed files with 291 additions and 115 deletions.
30 changes: 0 additions & 30 deletions db/import-tmpl/mob_item_ratio.txt

This file was deleted.

33 changes: 33 additions & 0 deletions db/import-tmpl/mob_item_ratio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Specific Item Drop Ratio Database
# This file is a part of rAthena.
# Copyright(C) 2021 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/>.
#
###########################################################################
# Mob Item Ratio Database
###########################################################################
#
# Mob Item Ratio Settings
#
###########################################################################
# - Item AegisName of item to adjust.
# Ratio Drop rate.
# List: List of monster(s) affected (format <Aegis monster name>: true/false). (Defaulted to all monsters)
###########################################################################

Header:
Type: MOB_ITEM_RATIO_DB
Version: 1
30 changes: 0 additions & 30 deletions db/mob_item_ratio.txt

This file was deleted.

37 changes: 37 additions & 0 deletions db/mob_item_ratio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Specific Item Drop Ratio Database
# This file is a part of rAthena.
# Copyright(C) 2021 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/>.
#
###########################################################################
# Mob Item Ratio Database
###########################################################################
#
# Mob Item Ratio Settings
#
###########################################################################
# - Item AegisName of item to adjust.
# Ratio Drop rate.
# List: List of monster(s) affected (format <Aegis monster name>: true/false). (Defaulted to all monsters)
###########################################################################

Header:
Type: MOB_ITEM_RATIO_DB
Version: 1

Footer:
Imports:
- Path: db/import/mob_item_ratio.yml
43 changes: 43 additions & 0 deletions doc/mob_item_ratio.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//===== rAthena Documentation ================================
//= Mob Item Ratio Database Structure
//===== By: ==================================================
//= rAthena Dev Team
//===== Last Updated: ========================================
//= 20210624
//===== Description: =========================================
//= Explanation of the mob_item_ratio.yml file and structure.
//============================================================

Item base drop rates defined in mob_db.yml will not get multiplied by global item_rate* values (aka drop rates) from
conf/battle/drops.conf and instead, Ratio will be used (100 = 1x).
If no Mob is specified, all monsters will be affected, otherwise only the ones listed.

Examples:
Jellopies from monsters will drop with 1x drop rate regardless of global drop rate
Body:
- Item: Jellopy
Ratio: 100

Jellopies from monsters will drop with 10x drop rate regardless of global drop rate
Body:
- Item: Jellopy
Ratio: 1000

Removes Jellopies from monsters drop
Body:
- Item: Jellopy
Ratio: 0

Jellopies from Porings will drop with 1x drop rate. Other monsters that drop Jellopies are unaffected (use global drop rate).
Body:
- Item: Jellopy
Ratio: 100
List:
PORING: true

Notes:
- Does not override item_drop_*_min/max settings.
- Does not affect card/item-granted drops. To adjust card/item-granted drops, edit them in item_db.
- Does affect MVP prizes and Treasure Boxes.
- You can add only ONE Ratio per Item. If you need various ratios for different monsters, override drop rate with Ratio=100 and edit base drop rates in mob_db.
- This file is reloaded by @reloadmobdb.
29 changes: 29 additions & 0 deletions doc/yaml/db/mob_item_ratio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Specific Item Drop Ratio Database
# This file is a part of rAthena.
# Copyright(C) 2021 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/>.
#
###########################################################################
# Mob Item Ratio Database
###########################################################################
#
# Mob Item Ratio Settings
#
###########################################################################
# - Item AegisName of item to adjust.
# Ratio Drop rate.
# List: List of monster(s) affected (format <Aegis monster name>: true/false). (Defaulted to all monsters)
###########################################################################
2 changes: 1 addition & 1 deletion src/map/map-server.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\mob_summon.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\mob_summon.yml')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\mob_chat_db.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\mob_chat_db.yml')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\mob_db.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\mob_db.yml')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\mob_item_ratio.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\mob_item_ratio.txt')" />
<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\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')" />
Expand Down
Loading

0 comments on commit 99eed0c

Please sign in to comment.