Skip to content

Commit 0e4015c

Browse files
authored
Merge pull request #3393 from MrKeiKun/refactor-level_penalty
Refactor level_penalty and migrate it to libconfig.
2 parents 64ad853 + c918680 commit 0e4015c

5 files changed

Lines changed: 504 additions & 94 deletions

File tree

db/re/level_penalty.conf

Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,254 @@
1+
//================= Hercules Database =====================================
2+
//= _ _ _
3+
//= | | | | | |
4+
//= | |_| | ___ _ __ ___ _ _| | ___ ___
5+
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
6+
//= | | | | __/ | | (__| |_| | | __/\__ \
7+
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
8+
//================= License ===============================================
9+
//= This file is part of Hercules.
10+
//= http://herc.ws - http://github.com/HerculesWS/Hercules
11+
//=
12+
//= Copyright (C) 2015-2025 Hercules Dev Team
13+
//=
14+
//= Hercules is free software: you can redistribute it and/or modify
15+
//= it under the terms of the GNU General Public License as published by
16+
//= the Free Software Foundation, either version 3 of the License, or
17+
//= (at your option) any later version.
18+
//=
19+
//= This program is distributed in the hope that it will be useful,
20+
//= but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
//= GNU General Public License for more details.
23+
//=
24+
//= You should have received a copy of the GNU General Public License
25+
//= along with this program. If not, see <http://www.gnu.org/licenses/>.
26+
//=========================================================================
27+
//= Level penalty configuration file
28+
//= Used in RENEWAL ONLY to determine experience and item drop penalties
29+
//= based on the level difference between the player and the monster.
30+
//=========================================================================
31+
32+
level_penalty_db: (
33+
/**************************************************************************
34+
************* Entry structure ********************************************
35+
**************************************************************************
36+
{
37+
// Level of the defending element (by default, may be Lv1 up to Lv4)
38+
type: <EXP_PENALTY_RATE or ITEM_DROP_PENALTY_RATE>,
39+
race: <RC_* constant>,
40+
diff: <level difference>,
41+
rate: <penalty rate, where 100 means 100% (base rate, no additions/reductions)>
42+
},
43+
**************************************************************************/
44+
{
45+
type: EXP_PENALTY_RATE,
46+
race: RC_NONBOSS,
47+
diff: 16,
48+
rate: 40
49+
},
50+
{
51+
type: EXP_PENALTY_RATE,
52+
race: RC_NONBOSS,
53+
diff: 15,
54+
rate: 115
55+
},
56+
{
57+
type: EXP_PENALTY_RATE,
58+
race: RC_NONBOSS,
59+
diff: 14,
60+
rate: 120
61+
},
62+
{
63+
type: EXP_PENALTY_RATE,
64+
race: RC_NONBOSS,
65+
diff: 13,
66+
rate: 125
67+
},
68+
{
69+
type: EXP_PENALTY_RATE,
70+
race: RC_NONBOSS,
71+
diff: 12,
72+
rate: 130
73+
},
74+
{
75+
type: EXP_PENALTY_RATE,
76+
race: RC_NONBOSS,
77+
diff: 11,
78+
rate: 135
79+
},
80+
{
81+
type: EXP_PENALTY_RATE,
82+
race: RC_NONBOSS,
83+
diff: 10,
84+
rate: 140
85+
},
86+
{
87+
type: EXP_PENALTY_RATE,
88+
race: RC_NONBOSS,
89+
diff: 9,
90+
rate: 135
91+
},
92+
{
93+
type: EXP_PENALTY_RATE,
94+
race: RC_NONBOSS,
95+
diff: 8,
96+
rate: 130
97+
},
98+
{
99+
type: EXP_PENALTY_RATE,
100+
race: RC_NONBOSS,
101+
diff: 7,
102+
rate: 125
103+
},
104+
{
105+
type: EXP_PENALTY_RATE,
106+
race: RC_NONBOSS,
107+
diff: 6,
108+
rate: 120
109+
},
110+
{
111+
type: EXP_PENALTY_RATE,
112+
race: RC_NONBOSS,
113+
diff: 5,
114+
rate: 115
115+
},
116+
{
117+
type: EXP_PENALTY_RATE,
118+
race: RC_NONBOSS,
119+
diff: 4,
120+
rate: 110
121+
},
122+
{
123+
type: EXP_PENALTY_RATE,
124+
race: RC_NONBOSS,
125+
diff: 3,
126+
rate: 105
127+
},
128+
{
129+
type: EXP_PENALTY_RATE,
130+
race: RC_NONBOSS,
131+
diff: 0,
132+
rate: 100
133+
},
134+
{
135+
type: EXP_PENALTY_RATE,
136+
race: RC_NONBOSS,
137+
diff: -1,
138+
rate: 100
139+
},
140+
{
141+
type: EXP_PENALTY_RATE,
142+
race: RC_NONBOSS,
143+
diff: -6,
144+
rate: 95
145+
},
146+
{
147+
type: EXP_PENALTY_RATE,
148+
race: RC_NONBOSS,
149+
diff: -11,
150+
rate: 90
151+
},
152+
{
153+
type: EXP_PENALTY_RATE,
154+
race: RC_NONBOSS,
155+
diff: -16,
156+
rate: 85
157+
},
158+
{
159+
type: EXP_PENALTY_RATE,
160+
race: RC_NONBOSS,
161+
diff: -21,
162+
rate: 60
163+
},
164+
{
165+
type: EXP_PENALTY_RATE,
166+
race: RC_NONBOSS,
167+
diff: -26,
168+
rate: 35
169+
},
170+
{
171+
type: EXP_PENALTY_RATE,
172+
race: RC_NONBOSS,
173+
diff: -31,
174+
rate: 10
175+
},
176+
{
177+
type: EXP_PENALTY_RATE,
178+
race: RC_BOSS,
179+
diff: 0,
180+
rate: 100
181+
},
182+
{
183+
type: ITEM_DROP_PENALTY_RATE,
184+
race: RC_NONBOSS,
185+
diff: 16,
186+
rate: 50
187+
},
188+
{
189+
type: ITEM_DROP_PENALTY_RATE,
190+
race: RC_NONBOSS,
191+
diff: 13,
192+
rate: 60
193+
},
194+
{
195+
type: ITEM_DROP_PENALTY_RATE,
196+
race: RC_NONBOSS,
197+
diff: 10,
198+
rate: 70
199+
},
200+
{
201+
type: ITEM_DROP_PENALTY_RATE,
202+
race: RC_NONBOSS,
203+
diff: 7,
204+
rate: 80
205+
},
206+
{
207+
type: ITEM_DROP_PENALTY_RATE,
208+
race: RC_NONBOSS,
209+
diff: 4,
210+
rate: 90
211+
},
212+
{
213+
type: ITEM_DROP_PENALTY_RATE,
214+
race: RC_NONBOSS,
215+
diff: 0,
216+
rate: 100
217+
},
218+
{
219+
type: ITEM_DROP_PENALTY_RATE,
220+
race: RC_NONBOSS,
221+
diff: -4,
222+
rate: 90
223+
},
224+
{
225+
type: ITEM_DROP_PENALTY_RATE,
226+
race: RC_NONBOSS,
227+
diff: -7,
228+
rate: 80
229+
},
230+
{
231+
type: ITEM_DROP_PENALTY_RATE,
232+
race: RC_NONBOSS,
233+
diff: -10,
234+
rate: 70
235+
},
236+
{
237+
type: ITEM_DROP_PENALTY_RATE,
238+
race: RC_NONBOSS,
239+
diff: -13,
240+
rate: 60
241+
},
242+
{
243+
type: ITEM_DROP_PENALTY_RATE,
244+
race: RC_NONBOSS,
245+
diff: -16,
246+
rate: 50
247+
},
248+
{
249+
type: ITEM_DROP_PENALTY_RATE,
250+
race: RC_BOSS,
251+
diff: 0,
252+
rate: 100
253+
}
254+
)

db/re/level_penalty.txt

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)