Fix item-drop selection off-by-one and double/slow-drop config defaults
GetNewDrop's weighted item-index selection used a do-while that
increments before its first RunningTotal check, so index 0 (the first
item slot in every drop table) could never be selected -- for the 51
drop tables that only populate item slot 1 (all others zero), this
silently discarded every roll ("item at itemindex does not exist"),
so those mobs/maps never dropped an item at all. Switch to a pre-check
while loop so index 0 is reachable.
Also: battle.cpp's kill-drop loop runs GetDrop()/AddDrop() exactly
Stats->itemdroprate + Config.DROP_RATE times, not as a probability --
with the shipped drop_rate=2 every kill produced two independently
rolled drops (hence always-doubled Zuly boxes for characters with no
item-drop-rate gear). Default drop_rate to 1 so a kill yields one
roll by default; gear/GM commands that raise itemdroprate still grant
extra rolls as designed.
Also default dropdelay to 0: the killed-monster's loot became visible
to clients only after Config.DropDelay (1s) *plus* the next
VisualDelay tick (200ms), giving a ~1.2s lag before drops appeared.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
25c474d286
commit
46e028c3ec
3 files changed
+3
-4
No files matched your search
@@ -290,7 +290,7 @@ CREATE TABLE IF NOT EXISTS `list_config` (
|
||||
--
|
||||
|
||||
INSERT INTO `list_config` (`exp_rate`, `kill_on_fail`, `drop_rate`, `zuly_rate`, `blue_chance`, `slot_chance`, `stat_chance`, `refine_chance`, `rare_refine`, `conf`, `player_damage`, `monster_damage`, `player_acc`, `monster_acc`, `pvp_acc`, `skill_damage`, `maxlevel`, `spawntype`, `dropmultiple`, `massexport`, `attkmult`, `skillmult`, `dropdelay`, `basedroprate`, `ktpointrate`, `movespeedmod`, `greydrop`) VALUES
|
||||
(1, 0, 2, 3, 15, 5, 15, 5, 0, 'default', 100, 100, 100, 100, 100, 100, 255, 1, 5, 1, 160, 100, 1, 20, 2, 72, 0);
|
||||
(1, 0, 1, 3, 15, 5, 15, 5, 0, 'default', 100, 100, 100, 100, 100, 100, 255, 1, 5, 1, 160, 100, 0, 20, 2, 72, 0);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
|
||||
Reference in new issue
Block a user