From 74d35a9d33bcdba381e9e78af1bdf59d106f1493 Mon Sep 17 00:00:00 2001 From: zephyrus Date: Wed, 20 Aug 2008 19:24:19 +0000 Subject: - Fixes on schg_cas02 and arug_cas01.txt - Official Meteor Storm. Meteors can fail and just not fall, and only fall where you can get a shootable path. * Tested on Aegis with help of ultramage. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13096 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/skill.c | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/map/skill.c b/src/map/skill.c index 4bec332d6..af47b0a87 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2122,13 +2122,18 @@ static int skill_timerskill(int tid, unsigned int tick, int id, intptr data) else { if(src->m != skl->map) break; - switch(skl->skill_id) { + switch( skl->skill_id ) + { case WZ_METEOR: - if(skl->type >= 0) { - skill_unitsetting(src,skl->skill_id,skl->skill_lv,skl->type>>16,skl->type&0xFFFF,skl->flag); - clif_skill_poseffect(src,skl->skill_id,skl->skill_lv,skl->x,skl->y,tick); + if( skl->type >= 0 ) + { + int x = skl->type>>16, y = skl->type&0xFFFF; + if( path_search_long(NULL, src->m, src->x, src->y, x, y, CELL_CHKWALL) ) + skill_unitsetting(src,skl->skill_id,skl->skill_lv,x,y,skl->flag); + if( path_search_long(NULL, src->m, src->x, src->y, skl->x, skl->y, CELL_CHKWALL) ) + clif_skill_poseffect(src,skl->skill_id,skl->skill_lv,skl->x,skl->y,tick); } - else + else if( path_search_long(NULL, src->m, src->x, src->y, skl->x, skl->y, CELL_CHKWALL) ) skill_unitsetting(src,skl->skill_id,skl->skill_lv,skl->x,skl->y,skl->flag); break; } @@ -5756,25 +5761,29 @@ int skill_castend_pos2(struct block_list* src, int x, int y, int skillid, int sk case WZ_METEOR: { - int flag=0, area = skill_get_splash(skillid, skilllv); + int flag = 0, area = skill_get_splash(skillid, skilllv); short tmpx = 0, tmpy = 0, x1 = 0, y1 = 0; - if (sc && sc->data[SC_MAGICPOWER]) + + if( sc && sc->data[SC_MAGICPOWER] ) flag = flag|2; //Store the magic power flag for future use. [Skotlex] - for(i=0;i<2+(skilllv>>1);i++) { - tmpx = x; - tmpy = y; - if (!map_search_freecell(NULL, src->m, &tmpx, &tmpy, area, area, 1)) - continue; - if(!(flag&1)){ + + for( i = 0; i < 2 + (skilllv>>1); i++ ) + { + // Creates a random Cell in the Splash Area + tmpx = x - area + rand()%(area * 2 + 1); + tmpy = y - area + rand()%(area * 2 + 1); + + if( i == 0 && path_search_long(NULL, src->m, src->x, src->y, tmpx, tmpy, CELL_CHKWALL) ) clif_skill_poseffect(src,skillid,skilllv,tmpx,tmpy,tick); - flag=flag|1; - } - if(i > 0) + + if( i > 0 ) skill_addtimerskill(src,tick+i*1000,0,tmpx,tmpy,skillid,skilllv,(x1<<16)|y1,flag&2); //Only pass the Magic Power flag + x1 = tmpx; y1 = tmpy; } - skill_addtimerskill(src,tick+i*1000,0,tmpx,tmpy,skillid,skilllv,-1,flag&2); //Only pass the Magic Power flag + + skill_addtimerskill(src,tick+i*1000,0,tmpx,tmpy,skillid,skilllv,-1,flag&2); } break; -- cgit v1.2.3-70-g09d2