summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-22 04:26:57 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-22 04:26:57 +0000
commitf1ab59626ff04306a8009c98566631d81d95c33b (patch)
treeef4a1f99a175325129350a64b7e29af02fdfeaf6
parentcc772f0b2d7475a148ecfb0ef539edadac2c2279 (diff)
downloadhercules-f1ab59626ff04306a8009c98566631d81d95c33b.tar.gz
hercules-f1ab59626ff04306a8009c98566631d81d95c33b.tar.bz2
hercules-f1ab59626ff04306a8009c98566631d81d95c33b.tar.xz
hercules-f1ab59626ff04306a8009c98566631d81d95c33b.zip
Fixed Mechanic Stealth Field to move accordingly and grant proper effect
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15754 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/map/map.c3
-rw-r--r--src/map/skill.c5
-rw-r--r--src/map/status.c72
3 files changed, 44 insertions, 36 deletions
diff --git a/src/map/map.c b/src/map/map.c
index efd3c16e0..d07db5eb5 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -425,8 +425,11 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick)
skill_unit_move_unit_group(skill_id2group(sc->data[SC_WARM]->val4), bl->m, x1-x0, y1-y0);
if (sc->data[SC_BANDING])
skill_unit_move_unit_group(skill_id2group(sc->data[SC_BANDING]->val4), bl->m, x1-x0, y1-y0);
+
if (sc->data[SC_NEUTRALBARRIER_MASTER])
skill_unit_move_unit_group(skill_id2group(sc->data[SC_NEUTRALBARRIER_MASTER]->val2), bl->m, x1-x0, y1-y0);
+ else if (sc->data[SC_STEALTHFIELD_MASTER])
+ skill_unit_move_unit_group(skill_id2group(sc->data[SC_STEALTHFIELD_MASTER]->val2), bl->m, x1-x0, y1-y0);
}
/* Guild Aura Moving */
if( bl->type == BL_PC && ((TBL_PC*)bl)->state.gmaster_flag ) {
diff --git a/src/map/skill.c b/src/map/skill.c
index 24bdd9ee1..c3870a3a3 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -9041,8 +9041,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, int skillid, int sk
case NC_NEUTRALBARRIER:
case NC_STEALTHFIELD:
skill_clear_unitgroup(src); // To remove previous skills - cannot used combined
- if( (sg = skill_unitsetting(src,skillid,skilllv,src->x,src->y,0)) != NULL )
- {
+ if( (sg = skill_unitsetting(src,skillid,skilllv,src->x,src->y,0)) != NULL ) {
sc_start2(src,skillid == NC_NEUTRALBARRIER ? SC_NEUTRALBARRIER_MASTER : SC_STEALTHFIELD_MASTER,100,skilllv,sg->group_id,skill_get_time(skillid,skilllv));
if( sd ) pc_overheat(sd,1);
}
@@ -10520,6 +10519,8 @@ int skill_unit_onout (struct skill_unit *src, struct block_list *bl, unsigned in
case UNT_SAFETYWALL:
case UNT_PNEUMA:
case UNT_EPICLESIS://Arch Bishop
+ case UNT_NEUTRALBARRIER:
+ case UNT_STEALTHFIELD:
if (sce)
status_change_end(bl, type, INVALID_TIMER);
break;
diff --git a/src/map/status.c b/src/map/status.c
index 4d4aa4421..7c53a0f68 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1530,8 +1530,7 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, int
tsc = status_get_sc(target);
- if(tsc && tsc->count)
- {
+ if(tsc && tsc->count) {
if( tsc->data[SC_INVINCIBLE] )
return 0;
if(!skill_num && tsc->data[SC_TRICKDEAD])
@@ -1550,39 +1549,44 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, int
if( skill_get_ele(skill_num,1) == ELE_EARTH ) //TODO: Need Skill Lv here :/
hide_flag &= ~OPTION_HIDE;
- switch( target->type )
- {
- case BL_PC:
- {
- struct map_session_data *sd = (TBL_PC*) target;
- if (pc_isinvisible(sd))
- return 0;
- if (tsc->option&hide_flag && !(status->mode&MD_BOSS) &&
- (sd->special_state.perfect_hiding || !(status->mode&MD_DETECTOR)))
- return 0;
- if( tsc->data[SC_CAMOUFLAGE] && !(status->mode&(MD_BOSS|MD_DETECTOR)) && !skill_num )
- return 0;
- if ( tsc->data[SC_CLOAKINGEXCEED] && !(status->mode&MD_BOSS) )
- return 0;
- }
- break;
- case BL_ITEM: //Allow targetting of items to pick'em up (or in the case of mobs, to loot them).
- //TODO: Would be nice if this could be used to judge whether the player can or not pick up the item it targets. [Skotlex]
- if (status->mode&MD_LOOTER)
- return 1;
- return 0;
- case BL_HOM:
- case BL_MER:
- if( target->type == BL_HOM && skill_num && battle_config.hom_setting&0x1 && skill_get_inf(skill_num)&INF_SUPPORT_SKILL && battle_get_master(target) != src )
- return 0; // Can't use support skills on Homunculus (only Master/Self)
- if( target->type == BL_MER && (skill_num == PR_ASPERSIO || (skill_num >= SA_FLAMELAUNCHER && skill_num <= SA_SEISMICWEAPON)) && battle_get_master(target) != src )
- return 0; // Can't use Weapon endow skills on Mercenary (only Master)
- if( target->type == BL_MER && skill_num == AM_POTIONPITCHER )
- return 0; // Can't use Potion Pitcher on Mercenaries
- default:
- //Check for chase-walk/hiding/cloaking opponents.
- if (tsc && tsc->option&hide_flag && !(status->mode&(MD_BOSS|MD_DETECTOR)))
+ switch( target->type ) {
+ case BL_PC: {
+ struct map_session_data *sd = (TBL_PC*) target;
+ bool is_boss = (status->mode&MD_BOSS), is_detector = (status->mode&MD_DETECTOR);
+ if (pc_isinvisible(sd))
+ return 0;
+ if (tsc->option&hide_flag && !is_boss &&
+ (sd->special_state.perfect_hiding || !is_detector) )
+ return 0;
+ if( tsc->data[SC_CAMOUFLAGE] && !(is_boss || is_detector) && !skill_num )
+ return 0;
+ if( tsc->data[SC_CLOAKINGEXCEED] && !is_boss )
+ return 0;
+ if( tsc->data[SC_STEALTHFIELD] && !is_boss )
+ return 0;
+ }
+ break;
+ case BL_ITEM: //Allow targetting of items to pick'em up (or in the case of mobs, to loot them).
+ //TODO: Would be nice if this could be used to judge whether the player can or not pick up the item it targets. [Skotlex]
+ if (status->mode&MD_LOOTER)
+ return 1;
return 0;
+ case BL_HOM:
+ case BL_MER:
+ if( target->type == BL_HOM && skill_num && battle_config.hom_setting&0x1 && skill_get_inf(skill_num)&INF_SUPPORT_SKILL && battle_get_master(target) != src )
+ return 0; // Can't use support skills on Homunculus (only Master/Self)
+ if( target->type == BL_MER && (skill_num == PR_ASPERSIO || (skill_num >= SA_FLAMELAUNCHER && skill_num <= SA_SEISMICWEAPON)) && battle_get_master(target) != src )
+ return 0; // Can't use Weapon endow skills on Mercenary (only Master)
+ if( target->type == BL_MER && skill_num == AM_POTIONPITCHER )
+ return 0; // Can't use Potion Pitcher on Mercenaries
+ default:
+ //Check for chase-walk/hiding/cloaking opponents.
+ if( tsc ) {
+ if( tsc->option&hide_flag && !(status->mode&(MD_BOSS|MD_DETECTOR)))
+ return 0;
+ if( tsc->data[SC_STEALTHFIELD] && !(status->mode&MD_BOSS) )
+ return 0;
+ }
}
return 1;
}