summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 6d4b8d5fa..d3fa25aaa 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1138,7 +1138,7 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp,
struct status_change *sc;
int hp,sp;
- /* here onwards we consider it a 32-type, the client does not support higher and from here onwards the value doesn't get thru percentage modifiers */
+ /* From here onwards, we consider it a 32-type as the client does not support higher and the value doesn't get through percentage modifiers */
hp = (int)cap_value(in_hp,INT_MIN,INT_MAX);
sp = (int)cap_value(in_sp,INT_MIN,INT_MAX);
@@ -1371,7 +1371,7 @@ int status_heal(struct block_list *bl,int64 in_hp,int64 in_sp, int flag) {
if (st == &status->dummy || !st->hp)
return 0;
- /* here onwards we consider it a 32-type, the client does not support higher and from here onwards the value doesn't get thru percentage modifiers */
+ /* From here onwards, we consider it a 32-type as the client does not support higher and the value doesn't get through percentage modifiers */
hp = (int)cap_value(in_hp,INT_MIN,INT_MAX);
sp = (int)cap_value(in_sp,INT_MIN,INT_MAX);
@@ -6959,7 +6959,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
return 0; //Overthrust can't take effect if under Max Overthrust. [Skotlex]
case SC_OVERTHRUSTMAX:
if( sc->option&OPTION_MADOGEAR )
- return 0;//Overthrust and Overthrust Max cannot be used on Mado Gear [Ind]
+ return 0; //Overthrust and Overthrust Max cannot be used on Mado Gear [Ind]
break;
case SC_ADRENALINE:
if(sd && !pc_check_weapontype(sd,skill->get_weapontype(BS_ADRENALINE)))
@@ -6995,7 +6995,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_CARTBOOST:
case SC_ASSNCROS:
if(sc->option&OPTION_MADOGEAR)
- return 0;//Mado is immune to wind walk, cart boost, etc (others above) [Ind]
+ return 0; //Mado is immune to wind walk, cart boost, etc (others above) [Ind]
case SC_INC_AGI:
if (sc->data[SC_QUAGMIRE])
return 0;
@@ -8635,7 +8635,12 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
break;
case SC__ENERVATION:
val2 = 20 + 10 * val1; // ATK Reduction
- if( sd ) pc->delspiritball(sd,sd->spiritball,0);
+ if ( sd ) {
+ int i;
+ pc->delspiritball(sd, sd->spiritball, 0);
+ for (i = SPIRITS_TYPE_CHARM_WATER; i < SPIRITS_TYPE_SPHERE; i++)
+ pc->del_charm(sd, sd->spiritcharm[i], i);
+ }
break;
case SC__GROOMY:
val2 = 20 + 10 * val1; //ASPD. Need to confirm if Movement Speed reduction is the same. [Jobbie]
@@ -10466,8 +10471,12 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
if(opt_flag&4) //Out of hiding, invoke on place.
skill->unit_move(bl,timer->gettick(),1);
- if(opt_flag&2 && sd && map->getcell(bl->m,bl->x,bl->y,CELL_CHKNPC))
- npc->touch_areanpc(sd,bl->m,bl->x,bl->y); //Trigger on-touch event.
+ if (opt_flag & 2 && sd) {
+ if (map->getcell(bl->m,bl->x,bl->y,CELL_CHKNPC))
+ npc->touch_areanpc(sd,bl->m,bl->x,bl->y); //Trigger on-touch event.
+ else
+ npc->untouch_areanpc(sd, bl->m, bl->x, bl->y);
+ }
ers_free(status->data_ers, sce);
return 1;
@@ -11469,9 +11478,13 @@ int status_get_weapon_atk(struct block_list *bl, struct weapon_atk *watk, int fl
short index = sd->equip_index[EQI_HAND_R], refine;
if ( index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == IT_WEAPON
&& (refine = sd->status.inventory[index].refine) < 16 && refine ) {
- int r = (rnd() % 100) % ((status->refine_info[watk->wlv].randombonus_max[refine + (4 - watk->wlv)] / 100)) + 1;
- max += r / 10;
+ int r = status->refine_info[watk->wlv].randombonus_max[refine + (4 - watk->wlv)] / 100;
+ if ( r )
+ max += (rnd() % 100) % r + 1;
}
+
+ if ( sd->spiritcharm[SPIRITS_TYPE_CHARM_LAND] > 0 )
+ max += 10 * max * sd->spiritcharm[SPIRITS_TYPE_CHARM_LAND] / 100;
}
max = status->calc_watk(bl, sc, max, false);
@@ -11560,8 +11573,9 @@ void status_get_matk_sub(struct block_list *bl, int flag, unsigned short *matk_m
short index = sd->equip_index[EQI_HAND_R], refine;
if ( index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == IT_WEAPON
&& (refine = sd->status.inventory[index].refine) < 16 && refine ) {
- int r = (rnd() % 100) % ((status->refine_info[sd->inventory_data[index]->wlv].randombonus_max[refine + (4 - sd->inventory_data[index]->wlv)] / 100)) + 1;
- st->matk_max += r / 10;
+ int r = status->refine_info[sd->inventory_data[index]->wlv].randombonus_max[refine + (4 - sd->inventory_data[index]->wlv)] / 100;
+ if ( r )
+ st->matk_max += (rnd() % 100) % r + 1;
}
}
#endif