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:
parent
1d1976479b
commit
f186098d59
@ -1,6 +1,8 @@
|
|||||||
Date Added
|
Date Added
|
||||||
|
|
||||||
01/31
|
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
|
* Added Karma and Manner to const.txt
|
||||||
-- To change a player's alignment to more Good/Evil in scripting for example,
|
-- To change a player's alignment to more Good/Evil in scripting for example,
|
||||||
use:
|
use:
|
||||||
|
@ -811,12 +811,11 @@ int skill_count_target(struct block_list *bl, va_list ap );
|
|||||||
|
|
||||||
// [MouseJstr] - skill ok to cast? and when?
|
// [MouseJstr] - skill ok to cast? and when?
|
||||||
int skillnotok(int skillid, struct map_session_data *sd) {
|
int skillnotok(int skillid, struct map_session_data *sd) {
|
||||||
if (sd == 0)
|
nullpo_retr (1, sd);
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (!(skillid >= 10000 && skillid < 10015))
|
if (!(skillid >= 10000 && skillid < 10015))
|
||||||
if ((skillid > MAX_SKILL) || (skillid < 0))
|
if ((skillid > MAX_SKILL) || (skillid < 0))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (pc_isGM(sd) >= 20)
|
if (pc_isGM(sd) >= 20)
|
||||||
return 0; // gm's can do anything damn thing they want
|
return 0; // gm's can do anything damn thing they want
|
||||||
@ -7806,14 +7805,28 @@ int skill_use_pos( struct map_session_data *sd,
|
|||||||
bl.m = sd->bl.m;
|
bl.m = sd->bl.m;
|
||||||
bl.x = skill_x;
|
bl.x = skill_x;
|
||||||
bl.y = skill_y;
|
bl.y = skill_y;
|
||||||
range = skill_get_range(skill_num,skill_lv);
|
|
||||||
if(range < 0)
|
{
|
||||||
range = status_get_range(&sd->bl) - (range + 1);
|
int check_range_flag = 0;
|
||||||
// be lenient if the skill was cast before we have moved to the correct position [Celest]
|
|
||||||
if (sd->walktimer != -1)
|
/* ŽË’ö‚Æ<E2809A>áŠQ•¨ƒ`ƒFƒbƒN */
|
||||||
range += battle_config.skill_range_leniency;
|
range = skill_get_range(skill_num,skill_lv);
|
||||||
if(!battle_check_range(&sd->bl,&bl,range) )
|
if(range < 0)
|
||||||
return 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]
|
||||||
|
if (sd->walktimer != -1)
|
||||||
|
range += battle_config.skill_range_leniency;
|
||||||
|
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);
|
pc_stopattack(sd);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user