Updates map_drops.yml (#7676)
* adjusted the rate in map_drops.yml to 1/100000 instead of 1/10000 Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
@@ -2904,8 +2904,10 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
|
||||
if( mapdrops != nullptr ){
|
||||
// Process map wide drops
|
||||
for( const auto& it : mapdrops->globals ){
|
||||
if( rnd_chance( it.second->rate, 10000 ) ){
|
||||
mob_item_drop( md, dlist, mob_setdropitem( it.second.get(), 1, md->mob_id ), 0, it.second->rate, homkillonly || merckillonly );
|
||||
if( rnd_chance( it.second->rate, 100000u ) ){
|
||||
// 'Cheat' for autoloot command: rate is changed from n/100000 to n/10000
|
||||
int32 map_drops_rate = max(1, (it.second->rate / 10));
|
||||
mob_item_drop( md, dlist, mob_setdropitem( it.second.get(), 1, md->mob_id ), 0, map_drops_rate, (homkillonly || merckillonly) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2914,8 +2916,10 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
|
||||
|
||||
if( specific != mapdrops->specific.end() ){
|
||||
for( const auto& it : specific->second ){
|
||||
if( rnd_chance( it.second->rate, 10000 ) ){
|
||||
mob_item_drop( md, dlist, mob_setdropitem( it.second.get(), 1, md->mob_id ), 0, it.second->rate, homkillonly || merckillonly );
|
||||
if( rnd_chance( it.second->rate, 100000u ) ){
|
||||
// 'Cheat' for autoloot command: rate is changed from n/100000 to n/10000
|
||||
int32 map_drops_rate = max(1, (it.second->rate / 10));
|
||||
mob_item_drop( md, dlist, mob_setdropitem( it.second.get(), 1, md->mob_id ), 0, map_drops_rate, (homkillonly || merckillonly) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6501,9 +6505,9 @@ bool MapDropDatabase::parseDrop( const ryml::NodeRef& node, std::unordered_map<u
|
||||
}
|
||||
|
||||
if( this->nodeExists( node, "Rate" ) ){
|
||||
uint16 rate;
|
||||
uint32 rate;
|
||||
|
||||
if( !this->asUInt16Rate( node, "Rate", rate ) ){
|
||||
if( !this->asUInt32Rate( node, "Rate", rate, 100000 ) ){
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -6512,11 +6516,11 @@ bool MapDropDatabase::parseDrop( const ryml::NodeRef& node, std::unordered_map<u
|
||||
drops.erase( index );
|
||||
return true;
|
||||
}else{
|
||||
this->invalidWarning( node["Rate"], "Rate %" PRIu16 " is below minimum of 1.\n", rate );
|
||||
this->invalidWarning( node["Rate"], "Rate %" PRIu32 " is below minimum of 1.\n", rate );
|
||||
return false;
|
||||
}
|
||||
}else if( rate > 10000 ){
|
||||
this->invalidWarning( node["Rate"], "Rate %" PRIu16 " exceeds maximum of 10000.\n", rate );
|
||||
}else if( rate > 100000 ){
|
||||
this->invalidWarning( node["Rate"], "Rate %" PRIu32 " exceeds maximum of 100000.\n", rate );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user