Updated skill_range_leniency code when casting a ground targetting spell

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@1018 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
(no author) 2005-02-01 11:22:25 +00:00
parent 1d1976479b
commit f186098d59
2 changed files with 28 additions and 13 deletions

View File

@ -1,6 +1,8 @@
Date Added
01/31
* Updated skill_range_leniency code when casting a ground targetting spell
( as in Revision 968) [celest]
* Added Karma and Manner to const.txt
-- To change a player's alignment to more Good/Evil in scripting for example,
use:

View File

@ -811,8 +811,7 @@ int skill_count_target(struct block_list *bl, va_list ap );
// [MouseJstr] - skill ok to cast? and when?
int skillnotok(int skillid, struct map_session_data *sd) {
if (sd == 0)
return 0;
nullpo_retr (1, sd);
if (!(skillid >= 10000 && skillid < 10015))
if ((skillid > MAX_SKILL) || (skillid < 0))
@ -7806,14 +7805,28 @@ int skill_use_pos( struct map_session_data *sd,
bl.m = sd->bl.m;
bl.x = skill_x;
bl.y = skill_y;
{
int check_range_flag = 0;
/* ŽËöÆ<E2809A>áŠQ•¨ƒ`ƒFƒbƒN */
range = skill_get_range(skill_num,skill_lv);
if(range < 0)
range = status_get_range(&sd->bl) - (range + 1);
// be lenient if the skill was cast before we have moved to the correct position [Celest]
// be lenient if the skill was cast before we have moved to the correct position [Celest]
if (sd->walktimer != -1)
range += battle_config.skill_range_leniency;
if(!battle_check_range(&sd->bl,&bl,range) )
else check_range_flag = 1;
if(!battle_check_range(&sd->bl,&bl,range)) {
if (check_range_flag && battle_check_range(&sd->bl,&bl,range + battle_config.skill_range_leniency)) {
int dir, mask[8][2] = {{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1},{1,0},{1,1}};
dir = map_calc_dir(&sd->bl,bl.x,bl.y);
pc_walktoxy (sd, sd->bl.x + mask[dir][0] * battle_config.skill_range_leniency,
sd->bl.y + mask[dir][1] * battle_config.skill_range_leniency);
} else
return 0;
}
}
pc_stopattack(sd);