Skip to content

Commit

Permalink
Unequip arrows when a bow is unequipped. (RE only)
Browse files Browse the repository at this point in the history
Forces the unequipment of arrows when a bow is unequipped.
Based on original PR by @Jedzkie in #1079
  • Loading branch information
sagunkho committed Apr 4, 2017
1 parent 20145c6 commit 176b7f5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions conf/map/battle/items.conf
Expand Up @@ -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
1 change: 1 addition & 0 deletions src/map/battle.c
Expand Up @@ -7320,6 +7320,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, },
};
#ifndef STATS_OPT_OUT
Expand Down
2 changes: 2 additions & 0 deletions src/map/battle.h
Expand Up @@ -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
};
Expand Down
5 changes: 5 additions & 0 deletions src/map/pc.c
Expand Up @@ -10036,6 +10036,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]

Expand Down

0 comments on commit 176b7f5

Please sign in to comment.