summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-04-02 19:21:01 -0300
committershennetsind <ind@henn.et>2013-04-02 19:21:01 -0300
commite6320b892516ba49af88bb4cc616952fa7cab6cd (patch)
tree3320f24c1bf2654ad3eee3d043691aed8d41a3f2 /src/map/status.c
parent1ee2b136cce11a1eda33a5165cb087370b52d563 (diff)
downloadhercules-e6320b892516ba49af88bb4cc616952fa7cab6cd.tar.gz
hercules-e6320b892516ba49af88bb4cc616952fa7cab6cd.tar.bz2
hercules-e6320b892516ba49af88bb4cc616952fa7cab6cd.tar.xz
hercules-e6320b892516ba49af88bb4cc616952fa7cab6cd.zip
Updated Map Zone Database
Introducing unit-type-based skill restrictions, details in the link http://hercules.ws/board/topic/302-introducing-hercules-map-zone-database/?p=2227 Special Thanks to lighta and Muad_Dib Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c54
1 files changed, 33 insertions, 21 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 809fac4c5..8589a54e7 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1494,28 +1494,40 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin
return 0;
}
- switch( skill_id ) {
- case PA_PRESSURE:
- if( flag && target ) {
- //Gloria Avoids pretty much everything....
- tsc = status_get_sc(target);
- if(tsc && tsc->option&OPTION_HIDE)
- return 0;
- }
- break;
- case GN_WALLOFTHORN:
- if( target && status_isdead(target) )
- return 0;
- break;
- case AL_TELEPORT:
- //Should fail when used on top of Land Protector [Skotlex]
- if (src && map_getcell(src->m, src->x, src->y, CELL_CHKLANDPROTECTOR)
- && !(status->mode&MD_BOSS)
- && (src->type != BL_PC || ((TBL_PC*)src)->skillitem != skill_id))
+ if( skill_id ) {
+ int i;
+
+ for(i = 0; i < map[src->m].zone->disabled_skills_count; i++) {
+ if( skill_id == map[src->m].zone->disabled_skills[i]->nameid && (map[src->m].zone->disabled_skills[i]->type&src->type) ) {
+ if( src->type == BL_PC )
+ clif->msg((TBL_PC*)src, SKILL_CANT_USE_AREA); // This skill cannot be used within this area
return 0;
- break;
- default:
- break;
+ }
+ }
+
+ switch( skill_id ) {
+ case PA_PRESSURE:
+ if( flag && target ) {
+ //Gloria Avoids pretty much everything....
+ tsc = status_get_sc(target);
+ if(tsc && tsc->option&OPTION_HIDE)
+ return 0;
+ }
+ break;
+ case GN_WALLOFTHORN:
+ if( target && status_isdead(target) )
+ return 0;
+ break;
+ case AL_TELEPORT:
+ //Should fail when used on top of Land Protector [Skotlex]
+ if (src && map_getcell(src->m, src->x, src->y, CELL_CHKLANDPROTECTOR)
+ && !(status->mode&MD_BOSS)
+ && (src->type != BL_PC || ((TBL_PC*)src)->skillitem != skill_id))
+ return 0;
+ break;
+ default:
+ break;
+ }
}
if ( src ) sc = status_get_sc(src);