summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuilherme G. Menaldo <guilherme.menaldo@outlook.com>2018-10-02 11:22:22 -0300
committerGuilherme G. Menaldo <guilherme.menaldo@outlook.com>2020-02-08 16:43:46 -0300
commited5d9b62be788d7b25fbf93c77f8495888fbbe39 (patch)
treecebbb25e25197b0df6829c691388078fe66ec6c9
parentd38c436a04b8ad65ece34272dfb49622e6cdd8b5 (diff)
downloadhercules-ed5d9b62be788d7b25fbf93c77f8495888fbbe39.tar.gz
hercules-ed5d9b62be788d7b25fbf93c77f8495888fbbe39.tar.bz2
hercules-ed5d9b62be788d7b25fbf93c77f8495888fbbe39.tar.xz
hercules-ed5d9b62be788d7b25fbf93c77f8495888fbbe39.zip
Fixed the number of cells that 'Asura Strike' caster walks when it fails
-rw-r--r--src/map/skill.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 867555aa6..b490a66c3 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5873,16 +5873,26 @@ static int skill_castend_id(int tid, int64 tick, int id, intptr_t data)
if (target && target->m == src->m) {
//Move character to target anyway.
int dir, x, y;
+ int dist = 3; // number of cells that asura caster will walk
+
dir = map->calc_dir(src,target->x,target->y);
- if( dir > 0 && dir < 4) x = -2;
- else if( dir > 4 ) x = 2;
- else x = 0;
- if( dir > 2 && dir < 6 ) y = -2;
- else if( dir == 7 || dir < 2 ) y = 2;
- else y = 0;
- if (unit->movepos(src, src->x+x, src->y+y, 1, 1)) {
+ if (dir > 0 && dir < 4)
+ x = -dist;
+ else if (dir > 4)
+ x = dist;
+ else
+ x = 0;
+
+ if (dir > 2 && dir < 6)
+ y = -dist;
+ else if (dir == 7 || dir < 2)
+ y = dist;
+ else
+ y = 0;
+
+ if (unit->movepos(src, src->x + x, src->y + y, 1, 1) == 1) {
//Display movement + animation.
- clif->slide(src,src->x,src->y);
+ clif->slide(src, src->x, src->y);
clif->spiritball(src);
}
// "Skill Failed" message was already shown when checking that target is invalid