Skip to content

Commit 5c65625

Browse files
committed
Added configuration to fullprotect skill
If active, should replace strip status and add new one protected
1 parent 41d370c commit 5c65625

File tree

5 files changed

+36
-8
lines changed

5 files changed

+36
-8
lines changed

conf/map/battle/skill.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,3 +330,10 @@ bowling_bash_area: 0
330330
// punch a hole into SG it will for example create a "suck in" effect.
331331
// If you disable this setting, the knockback direction will be completely random (eAthena style).
332332
stormgust_knockback: true
333+
334+
// Config for full protect skill creator.
335+
// 0: Default, only for equipped itens.
336+
// 1: Apply full protected even item not equipped.
337+
// Remove all debuffs from stripped status.
338+
// 2: Apply this config even for alchemist skills. (Protect Armor, Protect Weapon, Protect Helm, Protect Shield)
339+
creator_fullprotect: 0

src/map/battle.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7413,6 +7413,7 @@ static const struct battle_data {
74137413
{ "min_item_buy_price", &battle_config.min_item_buy_price, 1, 0, INT_MAX, },
74147414
{ "min_item_sell_price", &battle_config.min_item_sell_price, 0, 0, INT_MAX, },
74157415
{ "display_fake_hp_when_dead", &battle_config.display_fake_hp_when_dead, 1, 0, 1, },
7416+
{ "creator_fullprotect", &battle_config.creator_fullprotect, 0, 0, 2, },
74167417
};
74177418

74187419
static bool battle_set_value_sub(int index, int value)

src/map/battle.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,8 @@ struct Battle_Config {
576576
int min_item_sell_price;
577577

578578
int display_fake_hp_when_dead;
579+
580+
int creator_fullprotect;
579581
};
580582

581583
/* criteria for battle_config.idletime_critera */

src/map/skill.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7678,10 +7678,10 @@ static int skill_castend_nodamage_id(struct block_list *src, struct block_list *
76787678
{
76797679
unsigned int equip[] = { EQP_WEAPON, EQP_SHIELD, EQP_ARMOR, EQP_HEAD_TOP };
76807680
int index;
7681-
if ( sd && (bl->type != BL_PC || (dstsd && pc->checkequip(dstsd, equip[skill_id - AM_CP_WEAPON]) < 0) ||
7681+
if ( sd && (bl->type != BL_PC || (battle_config.creator_fullprotect != 2 && ((dstsd && pc->checkequip(dstsd, equip[skill_id - AM_CP_WEAPON]) < 0) ||
76827682
(dstsd && equip[skill_id - AM_CP_WEAPON] == EQP_SHIELD && pc->checkequip(dstsd, EQP_SHIELD) > 0
76837683
&& (index = dstsd->equip_index[EQI_HAND_L]) >= 0 && dstsd->inventory_data[index]
7684-
&& dstsd->inventory_data[index]->type != IT_ARMOR)) ) {
7684+
&& dstsd->inventory_data[index]->type != IT_ARMOR)))) ) {
76857685
clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0);
76867686
map->freeblock_unlock(); // Don't consume item requirements
76877687
return 0;
@@ -8380,13 +8380,15 @@ static int skill_castend_nodamage_id(struct block_list *src, struct block_list *
83808380
{
83818381
unsigned int equip[] = { EQP_WEAPON, EQP_SHIELD, EQP_ARMOR, EQP_HEAD_TOP };
83828382
int i, s = 0, skilltime = skill->get_time(skill_id, skill_lv);
8383-
for ( i = 0; i < 4; i++ ) {
8384-
if ( bl->type != BL_PC || (dstsd && pc->checkequip(dstsd, equip[i]) < 0) )
8385-
continue;
8386-
if ( dstsd && equip[i] == EQP_SHIELD ) {
8387-
short index = dstsd->equip_index[EQI_HAND_L];
8388-
if ( index >= 0 && dstsd->inventory_data[index] && dstsd->inventory_data[index]->type != IT_ARMOR )
8383+
for (i = 0; i < 4; i++) {
8384+
if (!battle_config.creator_fullprotect) {
8385+
if (bl->type != BL_PC || (dstsd && pc->checkequip(dstsd, equip[i]) < 0))
83898386
continue;
8387+
if ( dstsd && equip[i] == EQP_SHIELD ) {
8388+
short index = dstsd->equip_index[EQI_HAND_L];
8389+
if ( index >= 0 && dstsd->inventory_data[index] && dstsd->inventory_data[index]->type != IT_ARMOR )
8390+
continue;
8391+
}
83908392
}
83918393
sc_start(src, bl, (sc_type)(SC_PROTECTWEAPON + i), 100, skill_lv, skilltime);
83928394
s++;

src/map/status.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7755,6 +7755,22 @@ static int status_change_start(struct block_list *src, struct block_list *bl, en
77557755
}
77567756
if (tick == 1) return 1; //Minimal duration: Only strip without causing the SC
77577757
break;
7758+
case SC_PROTECTWEAPON:
7759+
if(battle_config.creator_fullprotect)
7760+
status_change_end(bl, SC_NOEQUIPWEAPON, INVALID_TIMER);
7761+
break;
7762+
case SC_PROTECTHELM:
7763+
if(battle_config.creator_fullprotect)
7764+
status_change_end(bl, SC_NOEQUIPHELM, INVALID_TIMER);
7765+
break;
7766+
case SC_PROTECTARMOR:
7767+
if(battle_config.creator_fullprotect)
7768+
status_change_end(bl, SC_NOEQUIPARMOR, INVALID_TIMER);
7769+
break;
7770+
case SC_PROTECTSHIELD:
7771+
if(battle_config.creator_fullprotect)
7772+
status_change_end(bl, SC_NOEQUIPSHIELD, INVALID_TIMER);
7773+
break;
77587774
case SC_MER_FLEE:
77597775
case SC_MER_ATK:
77607776
case SC_MER_HP:

0 commit comments

Comments
 (0)