Skip to content

Commit

Permalink
Updated Illusion - Bewitch effect
Browse files Browse the repository at this point in the history
* Positions are not swapped on GvG/Battleground maps.
* Confusion is applied no matter the map type and ignores status resistances.
  • Loading branch information
aleos89 committed Jan 26, 2016
1 parent d170b55 commit 5afc620
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/map/skill.c
Original file line number Diff line number Diff line change
Expand Up @@ -10362,23 +10362,26 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
case KO_GENWAKU:
if ( !map_flag_gvg2(src->m) && ( dstsd || dstmd ) && !(tstatus->mode&MD_PLANT) && battle_check_target(src,bl,BCT_ENEMY) > 0 ) {
if ((dstsd || dstmd) && !(tstatus->mode&MD_PLANT) && battle_check_target(src,bl,BCT_ENEMY) > 0) {
int x = src->x, y = src->y;

if( sd && rnd()%100 > ((45+5*skill_lv) - status_get_int(bl)/10) ){//[(Base chance of success) - (Intelligence Objectives / 10)]%.
if (sd && rnd()%100 > ((45+5*skill_lv) - status_get_int(bl)/10)) { //[(Base chance of success) - (Intelligence Objectives / 10)]%.
clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}

if (unit_movepos(src,bl->x,bl->y,0,0)) {
clif_skill_nodamage(src,src,skill_id,skill_lv,1);
// Confusion is still inflicted (but rate isn't reduced), no matter map type.
status_change_start(src, src, SC_CONFUSION, 2500, skill_lv, 0, 0, 0, skill_get_time(skill_id, skill_lv), SCSTART_NORATEDEF);
if (!is_boss(bl))
status_change_start(src, bl, SC_CONFUSION, 7500, skill_lv, 0, 0, 0, skill_get_time(skill_id, skill_lv), SCSTART_NORATEDEF);

if (unit_movepos(src,bl->x,bl->y,0,0) && !map_flag_gvg2(src->m) && !map[src->m].flag.battleground) {

This comment has been minimized.

Copy link
@cydh

cydh Jan 27, 2016

Contributor

doesn't this better becomes

if (!map_flag_gvg2(src->m) && !map[src->m].flag.battleground && unit_movepos(src,bl->x,bl->y,0,0)) {

This comment has been minimized.

Copy link
@aleos89

aleos89 Jan 27, 2016

Author Contributor

I was looking through various other skills that have these blocks and it seems to be all over the place. Maybe it would be nice to create a new define including BG and refactor it all.

clif_skill_nodamage(src, src, skill_id, skill_lv, 1);
clif_blown(src);
sc_start(src,src,SC_CONFUSION,25,skill_lv,skill_get_time(skill_id,skill_lv));
if (!is_boss(bl) && unit_movepos(bl,x,y,0,0)) {
if( bl->type == BL_PC && pc_issit((TBL_PC*)bl))
if (bl->type == BL_PC && pc_issit((TBL_PC*)bl))
clif_sitting(bl); //Avoid sitting sync problem
clif_blown(bl);
sc_start(src,bl,SC_CONFUSION,75,skill_lv,skill_get_time(skill_id,skill_lv));
}
}
}
Expand Down

0 comments on commit 5afc620

Please sign in to comment.