From 14b59636c7a3705fffde0ae8af8f672ce6d9ae8d Mon Sep 17 00:00:00 2001 From: skotlex Date: Tue, 1 Aug 2006 18:37:16 +0000 Subject: [PATCH] - Made Deluge/volcano/v. gale be castable on top of each other again - Modified unit_walktoxy and NPC_RUN to enable running even when the caster does not has the MD_CANMOVE bit on. - PF_MINDBREAKER will now silently fail if you try to use it on someone who already has the status active. - Cleaned up yet again skill_landprotector, now new cells of Deluge/Volcano/V.Gale will delete previous cells when they are recasted on top of each other. - Summoned Marine Spheres no longer get the MD_CANMOVE bit. git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8039 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 8 +++++ db/Changelog.txt | 2 ++ db/skill_unit_db.txt | 6 ++-- src/map/mob.c | 4 +-- src/map/skill.c | 81 +++++++++++++++++++++++++------------------- src/map/status.c | 1 - src/map/unit.c | 9 +++-- 7 files changed, 68 insertions(+), 43 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index be6ee68489..3701f990f5 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,14 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2006/08/01 + * Modified unit_walktoxy and NPC_RUN to enable running even when the caster + does not has the MD_CANMOVE bit on. [Skotlex] + * PF_MINDBREAKER will now silently fail if you try to use it on someone who + already has the status active. [Skotlex] + * Cleaned up yet again skill_landprotector, now new cells of + Deluge/Volcano/V.Gale will delete previous cells when they are recasted on + top of each other. [Skotlex] + * Summoned Marine Spheres no longer get the MD_CANMOVE bit. [Skotlex] * Cleaned up some more the SC_JAILED code [Skotlex] * merged in atcommands jailfor, jailtime, charjailtime. Thanks to Meruru and Coltaro for the code. [Skotlex] diff --git a/db/Changelog.txt b/db/Changelog.txt index e0e145e493..509eb7f10e 100644 --- a/db/Changelog.txt +++ b/db/Changelog.txt @@ -20,6 +20,8 @@ ========================= 08/01 + * Made Deluge/volcano/v. gale be castable on top of each other again + [Skotlex] * Cleaned up some of the db files. [Skotlex] * Fixed name of Freya's Shoes [Playtester] * Small item update from Haplo [Playtester] diff --git a/db/skill_unit_db.txt b/db/skill_unit_db.txt index 7e1627d3fd..3fcb497fff 100644 --- a/db/skill_unit_db.txt +++ b/db/skill_unit_db.txt @@ -52,9 +52,9 @@ 220,0xb0, , 0, 0, -1,all, 0x002 //RG_GRAFFITI 229,0xb1, , 0, 1,1000,enemy, 0x006 //AM_DEMONSTRATION 254,0x86, , -1, 0, 400,enemy, 0x000 //CR_GRANDCROSS -285,0x9a, , 3, 0, -1,all, 0x002 //SA_VOLCANO -286,0x9b, , 3, 0, -1,all, 0x002 //SA_DELUGE -287,0x9c, , 3, 0, -1,all, 0x002 //SA_VIOLENTGALE +285,0x9a, , 3, 0, -1,all, 0x000 //SA_VOLCANO +286,0x9b, , 3, 0, -1,all, 0x000 //SA_DELUGE +287,0x9c, , 3, 0, -1,all, 0x000 //SA_VIOLENTGALE 288,0x9d,,3:3:4:4:5,0, -1,all, 0x000 //SA_LANDPROTECTOR 306,0x9e, , 4, 0,6000,all, 0x200 //BD_LULLABY 307,0x9f, , 4, 0, -1,enemy, 0x210 //BD_RICHMANKIM diff --git a/src/map/mob.c b/src/map/mob.c index 6e167b3ccc..b4bd0750c7 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1670,8 +1670,8 @@ void mob_damage(struct mob_data *md, struct block_list *src, int damage) } } - if(md->special_state.ai==2 && md->master_id == src->id) - { + if(md->special_state.ai==2/* && md->master_id == src->id*/) + { //LOne WOlf explained that ANYONE can trigger the marine countdown skill. [Skotlex] md->state.alchemist = 1; mobskill_use(md, gettick(), MSC_ALCHEMIST); } diff --git a/src/map/skill.c b/src/map/skill.c index c7ea8ef5dc..a78e7820ac 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2180,20 +2180,6 @@ static int skill_check_unit_range_sub (struct block_list *bl, va_list ap) if(g_skillid != MG_SAFETYWALL && g_skillid != AL_PNEUMA) return 0; break; - //Cannot stack among themselves. - case SA_VOLCANO: - case SA_DELUGE: - case SA_VIOLENTGALE: - switch (g_skillid) - { - case SA_VOLCANO: - case SA_DELUGE: - case SA_VIOLENTGALE: - break; - default: - return 0; - } - break; case AL_WARP: case HT_SKIDTRAP: case HT_LANDMINE: @@ -4916,8 +4902,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in const int mask[8][2] = {{0,-1},{1,-1},{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1}}; int dir = (bl == src)?unit_getdir(src):map_calc_dir(src,bl->x,bl->y); //If cast on self, run forward, else run away. unit_stop_attack(src); - //Run skillv tiles. - unit_walktoxy(src, bl->x + skilllv * mask[dir][0], bl->y + skilllv * mask[dir][1], 0); + //Run skillv tiles overriding the can-move check. + unit_walktoxy(src, bl->x + skilllv * mask[dir][0], bl->y + skilllv * mask[dir][1], 2); } break; @@ -5114,6 +5100,13 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in return 1; } + if (tsc && tsc->data[type].timer != -1) + { //HelloKitty2 (?) explained that this silently fails when target is + //already inflicted. [Skotlex] + map_freeblock_unlock(); + return 1; + } + //Has a 55% + skilllv*5% success chance. if (!clif_skill_nodamage(src,bl,skillid,skilllv, sc_start(bl,type,55+5*skilllv,skilllv,skill_get_time(skillid,skilllv)))) @@ -9282,19 +9275,43 @@ int skill_landprotector (struct block_list *bl, va_list ap) if (unit == NULL || unit->group == NULL) return 0; - if (skillid == SA_LANDPROTECTOR && unit->group->skill_id == SA_LANDPROTECTOR - && battle_check_target(bl, src, BCT_ENEMY) > 0) - { //Check for offensive Land Protector to delete both. [Skotlex] - (*alive) = 0; - skill_delunit(unit); - return 1; - } - - if((skillid == SA_LANDPROTECTOR || skillid == HW_GANBANTEIN) && - skill_get_type(unit->group->skill_id) == BF_MAGIC) - { //Delete Magical effects - skill_delunit(unit); - return 1; + switch (skillid) + { + case SA_LANDPROTECTOR: + if (unit->group->skill_id == SA_LANDPROTECTOR && + battle_check_target(bl, src, BCT_ENEMY) > 0) + { //Check for offensive Land Protector to delete both. [Skotlex] + (*alive) = 0; + skill_delunit(unit); + return 1; + } + //Delete the rest of types. + case HW_GANBANTEIN: + if(skill_get_type(unit->group->skill_id) == BF_MAGIC) + { //Delete Magical effects + skill_delunit(unit); + return 1; + } + break; + case SA_VOLCANO: + case SA_DELUGE: + case SA_VIOLENTGALE: + switch (unit->group->skill_id) + { //These override each other. + case SA_VOLCANO: + case SA_DELUGE: + case SA_VIOLENTGALE: + skill_delunit(unit); + return 1; + } + break; + case HP_BASILICA: + if (unit->group->skill_id == HP_BASILICA) + { //Basilica can't be placed on top of itself to avoid map-cell stacking problems. [Skotlex] + (*alive) = 0; + return 1; + } + break; } if (unit->group->skill_id == SA_LANDPROTECTOR && skill_get_type(skillid) == BF_MAGIC) @@ -9302,11 +9319,7 @@ int skill_landprotector (struct block_list *bl, va_list ap) (*alive) = 0; return 1; } - if (skillid == HP_BASILICA && unit->group->skill_id == HP_BASILICA) - { //Basilica can't be placed on top of itself to avoid map-cell stacking problems. [Skotlex] - (*alive) = 0; - return 1; - } + return 0; } diff --git a/src/map/status.c b/src/map/status.c index a2038456ac..e783b6f568 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1238,7 +1238,6 @@ int status_calc_mob(struct mob_data* md, int first) { // different levels of HP according to skill level if (ud->skillid == AM_SPHEREMINE) { status->max_hp = 2000 + 400*ud->skilllv; - status->mode|= MD_CANMOVE; //Needed for the skill } else { //AM_CANNIBALIZE status->max_hp = 1500 + 200*ud->skilllv + 10*status_get_lv(mbl); status->mode|= MD_CANATTACK|MD_AGGRESSIVE; diff --git a/src/map/unit.c b/src/map/unit.c index 606d648011..9d2356d584 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -258,6 +258,7 @@ static int unit_walktoxy_timer(int tid,unsigned int tick,int id,int data) return 0; } +//Easy parameter: &1 -> 1/2 = easy/hard, &2 -> ignore MD_CANMOVE check int unit_walktoxy( struct block_list *bl, int x, int y, int easy) { struct unit_data *ud = NULL; struct status_change *sc = NULL; @@ -271,11 +272,13 @@ int unit_walktoxy( struct block_list *bl, int x, int y, int easy) { if( ud == NULL) return 0; - // 移動出来ないユニットは弾く - if(!(status_get_mode(bl)&MD_CANMOVE) || !unit_can_move(bl)) + if(!(easy&2) && !status_get_mode(bl)&MD_CANMOVE) + return 0; + + if (!unit_can_move(bl)) return 0; - ud->state.walk_easy = easy; + ud->state.walk_easy = easy&1; ud->target = 0; ud->to_x = x; ud->to_y = y;