Conflicts 10 Posted November 5, 2014 (edited) Hello Hercules Community. I've been looking through my old server backups and .diffs, and I found this interesting snippet. I remember purchasing it from someone well known on rAthena, I think sometime around 2013 (or 2012), if I recall correctly. pc.c bool pc_check_damage_return(struct block_list* bl, int reflect_type) { struct map_session_data* sd; int value; if( bl == NULL || bl->type != BL_PC ) return false; sd = BL_CAST(BL_PC, bl); value = cap_value(sd->damage_return_check[reflect_type],0,100); if( reflect_type && value && rand()%100 < value ) return false; else return true; } pc.c on pc_bonus2 case SP_DAMAGE_RETURN_CHECK: sd->damage_return_check[type2] = += val; break; skill.c (for magic no-reflect) // item-based reflection if( sd && sd->bonus.magic_damage_return && type && rnd()%100 < sd->bonus.magic_damage_return && pc_check_damage_return(src,1) == true ) return 1; Now, this works just fine. (src,1) denotes type2 = 1, in this case I'm using it as Magic no reflect. It's supposed to work similar to this, bonus2 bNoReflect,n,x; where n = type (1 or 2) and x is x/100%. However, my problem is, how do I effectively pass the val value? It seems to always return true. Regardless of what I put. The bolded part above doesn't seem to work as intended. So putting bonus2 bNoReflect,1,1; and putting bonus2 bNoReflect,1,100; both lets you ignore item-based reflects on magic with 100% chance of success. I hope I've explained it clearly. PS: I've posted a similar thread on rAthena, is that bad? PPS: I'm still using rAthena, until eAmod BG gets implemented to Hercules. Edited November 5, 2014 by Conflicts Quote Share this post Link to post Share on other sites
Hello Hercules Community. I've been looking through my old server backups and .diffs, and I found this interesting snippet.
I remember purchasing it from someone well known on rAthena, I think sometime around 2013 (or 2012), if I recall correctly.
pc.c
pc.c on pc_bonus2
skill.c (for magic no-reflect)
Now, this works just fine. (src,1) denotes type2 = 1, in this case I'm using it as Magic no reflect.
It's supposed to work similar to this, bonus2 bNoReflect,n,x; where n = type (1 or 2) and x is x/100%.
However, my problem is, how do I effectively pass the val value? It seems to always return true. Regardless of what I put.
The bolded part above doesn't seem to work as intended. So putting bonus2 bNoReflect,1,1; and putting bonus2 bNoReflect,1,100;
both lets you ignore item-based reflects on magic with 100% chance of success.
I hope I've explained it clearly.
PS: I've posted a similar thread on rAthena, is that bad?
PPS: I'm still using rAthena, until eAmod BG gets implemented to Hercules.
Edited by ConflictsShare this post
Link to post
Share on other sites