diff --git a/conf/battle/drops.conf b/conf/battle/drops.conf index 5c9ae10ed6..313bbe9c44 100644 --- a/conf/battle/drops.conf +++ b/conf/battle/drops.conf @@ -107,6 +107,13 @@ item_logarithmic_drops: no // Default: no (as in official servers). drop_rate0item: no +// Increase item drop rate +0.01%? (Note 1) +// On official servers it is possible to get 0.00% drop chance so all items are increased by 0.01%. +// NOTE: This is viewed as a bug to rAthena. +// NOTE2: This only applies if RENEWAL_DROP (src/config/renewal.h) is disabled. +// Default: no +drop_rateincrease: no + // Makes your LUK value affect drop rates on an absolute basis. // Setting to 100 means each luk adds 0.01% chance to find items // (regardless of item's base drop rate). diff --git a/conf/battle/gm.conf b/conf/battle/gm.conf index f390a90fbc..95affcd1c7 100644 --- a/conf/battle/gm.conf +++ b/conf/battle/gm.conf @@ -26,7 +26,7 @@ atcommand_max_stat_bypass: no // Duration of the ban, in minutes (default: 5). To disable the ban, set 0. ban_hack_trade: 5 -// requires RENEWAL_EXP or RENEWAL_DROP to be enabled (src/map/config/renewal.h) +// requires RENEWAL_EXP or RENEWAL_DROP to be enabled (src/config/renewal.h) // modifies @mobinfo to display the users' real drop rate as per renewal_drop formula // modifies @iteminfo to not display the minimum item drop rate (since it can't tell the mob level) // modifies @whodrops to display the users' real drop rate as per renewal_drop formula diff --git a/src/map/battle.c b/src/map/battle.c index eeb2fabc3d..b791044aac 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -5188,6 +5188,9 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list * RE MDEF Reduction * Damage = Magic Attack * (1000+eMDEF)/(1000+eMDEF) - sMDEF **/ + if (mdef < -100) + mdef = -99; // Avoid divide by 0 + ad.damage = ad.damage * (1000 + mdef) / (1000 + mdef * 10) - mdef2; #else if(battle_config.magic_defense_type) @@ -7063,6 +7066,7 @@ static const struct _battle_data { { "item_enabled_npc", &battle_config.item_enabled_npc, 1, 0, 1, }, { "item_flooritem_check", &battle_config.item_onfloor, 1, 0, 1, }, { "bowling_bash_area", &battle_config.bowling_bash_area, 0, 0, 20, }, + { "drop_rateincrease", &battle_config.drop_rateincrease, 0, 0, 1, }, }; #ifndef STATS_OPT_OUT /** diff --git a/src/map/battle.h b/src/map/battle.h index f9d62b4d31..f31f90fcec 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -494,6 +494,7 @@ extern struct Battle_Config int item_enabled_npc; int item_onfloor; // Whether to drop an undroppable item on the map or destroy it if inventory is full. int bowling_bash_area; + int drop_rateincrease; } battle_config; diff --git a/src/map/homunculus.c b/src/map/homunculus.c index fabf684ee8..8027a9c9fd 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -265,7 +265,7 @@ int merc_hom_calc_skilltree(struct homun_data *hd, int flag_evolve) int merc_hom_checkskill(struct homun_data *hd,uint16 skill_id) { int i = skill_id - HM_SKILLBASE; - if(!hd) + if(!hd || !&hd->homunculus) return 0; if(hd->homunculus.hskill[i].id == skill_id) diff --git a/src/map/mob.c b/src/map/mob.c index de2455795f..4e28789dfb 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -3805,6 +3805,10 @@ static bool mob_parse_dbrow(char** str) id = itemdb_search(db->dropitem[i].nameid); type = id->type; rate = atoi(str[k+1]); + #ifndef RENEWAL_DROP + if (battle_config.drop_rateincrease) + if (rate < 5000) rate++; + #endif if( (class_ >= 1324 && class_ <= 1363) || (class_ >= 1938 && class_ <= 1946) ) { //Treasure box drop rates [Skotlex] rate_adjust = battle_config.item_rate_treasure; diff --git a/src/map/npc.c b/src/map/npc.c index a9d9fb49e8..cf0ea92ec6 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -3830,8 +3830,6 @@ int npc_reload(void) { //Re-read the NPC Script Events cache. npc_read_event_script(); - do_reload_instance(); - /* refresh guild castle flags on both woe setups */ npc_event_doall("OnAgitInit"); npc_event_doall("OnAgitInit2"); @@ -3839,6 +3837,8 @@ int npc_reload(void) { //Execute the OnInit event for freshly loaded npcs. [Skotlex] ShowStatus("Event '"CL_WHITE"OnInit"CL_RESET"' executed with '"CL_WHITE"%d"CL_RESET"' NPCs.\n",npc_event_doall("OnInit")); + do_reload_instance(); + // Execute rest of the startup events if connected to char-server. [Lance] if(!CheckForCharServer()){ ShowStatus("Event '"CL_WHITE"OnInterIfInit"CL_RESET"' executed with '"CL_WHITE"%d"CL_RESET"' NPCs.\n", npc_event_doall("OnInterIfInit"));