diff options
author | Haru <haru@dotalux.com> | 2017-04-08 23:06:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-08 23:06:08 +0200 |
commit | cc8262cc21a8fff9a6b2e9c61372c89f5fa2377e (patch) | |
tree | b74fab4a3eb5033c8515e4c8d1fc8c82c116572e | |
parent | 5f3d37c89c60ecc89186fa8d6cba333369a8f4cf (diff) | |
parent | 176b7f571307000a8a22cf133041a911127fac5b (diff) | |
download | hercules-cc8262cc21a8fff9a6b2e9c61372c89f5fa2377e.tar.gz hercules-cc8262cc21a8fff9a6b2e9c61372c89f5fa2377e.tar.bz2 hercules-cc8262cc21a8fff9a6b2e9c61372c89f5fa2377e.tar.xz hercules-cc8262cc21a8fff9a6b2e9c61372c89f5fa2377e.zip |
Merge pull request #1663 from Smokexyz/bow-unequip-fix
Unequip arrows when a bow is unequipped. (RE only)
-rw-r--r-- | conf/map/battle/items.conf | 4 | ||||
-rw-r--r-- | src/map/battle.c | 1 | ||||
-rw-r--r-- | src/map/battle.h | 2 | ||||
-rw-r--r-- | src/map/pc.c | 5 |
4 files changed, 12 insertions, 0 deletions
diff --git a/conf/map/battle/items.conf b/conf/map/battle/items.conf index 8ff2cbb3b..3c9ba71e9 100644 --- a/conf/map/battle/items.conf +++ b/conf/map/battle/items.conf @@ -114,3 +114,7 @@ item_enabled_npc: true // 2 : disabled equipments are nullify, disabled cards will caused the equipment to unequip // 3 : disabled equipments are unequip, disabled cards will caused the equipment to unequip (1+2) unequip_restricted_equipment: 0 + +// When unequip a bow with arrow equipped, it also unequip the arrow? +// Default: true (Official behavior, applies only in Renewal) +bow_unequip_arrow: true diff --git a/src/map/battle.c b/src/map/battle.c index 8b6ac2cc0..827042cce 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -7329,6 +7329,7 @@ static const struct battle_data { { "save_body_style", &battle_config.save_body_style, 0, 0, 1, }, { "player_warp_keep_direction", &battle_config.player_warp_keep_direction, 0, 0, 1, }, { "atcommand_levelup_events", &battle_config.atcommand_levelup_events, 0, 0, 1, }, + { "bow_unequip_arrow", &battle_config.bow_unequip_arrow, 1, 0, 1, }, { "max_summoner_parameter", &battle_config.max_summoner_parameter, 120, 10, 10000, }, { "mvp_exp_reward_message", &battle_config.mvp_exp_reward_message, 0, 0, 1, }, }; diff --git a/src/map/battle.h b/src/map/battle.h index b7bde1aa9..4665847ff 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -545,6 +545,8 @@ struct Battle_Config { int player_warp_keep_direction; int atcommand_levelup_events; // Enable atcommands trigger level up events for NPCs + + int bow_unequip_arrow; int max_summoner_parameter; // Summoner Max Stats int mvp_exp_reward_message; diff --git a/src/map/pc.c b/src/map/pc.c index 9ef7d084f..e9855c16d 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -10035,6 +10035,11 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) status_change_end(&sd->bl, SC_ARMOR_RESIST, INVALID_TIMER); } +#ifdef RENEWAL + if (battle->bc->bow_unequip_arrow && pos&EQP_ARMS && sd->equip_index[EQI_AMMO] > 0) + pc->unequipitem(sd, sd->equip_index[EQI_AMMO], PCUNEQUIPITEM_FORCE); +#endif + if( sd->state.autobonus&pos ) sd->state.autobonus &= ~sd->status.inventory[n].equip; //Check for activated autobonus [Inkfish] |