summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2020-05-04 14:25:04 +0200
committerGitHub <noreply@github.com>2020-05-04 14:25:04 +0200
commita126526feea0acbbc4cc8c591b8759093b144dd9 (patch)
treebeff524d797ea48c037f165d457f3e96746f95f5
parent43b9a6987c5fc22c15c817a7c364393b49fb5f36 (diff)
parentcd593de68b02d77766fcb3b7b2a869096ceb7183 (diff)
downloadhercules-a126526feea0acbbc4cc8c591b8759093b144dd9.tar.gz
hercules-a126526feea0acbbc4cc8c591b8759093b144dd9.tar.bz2
hercules-a126526feea0acbbc4cc8c591b8759093b144dd9.tar.xz
hercules-a126526feea0acbbc4cc8c591b8759093b144dd9.zip
Merge pull request #2188 from bWolfie/cell_noskill
Adds 'cell_noskill' which blocks skill usage.
-rw-r--r--db/constants.conf26
-rw-r--r--doc/constants.md6
-rw-r--r--src/map/map.c3
-rw-r--r--src/map/map.h5
-rw-r--r--src/map/skill.c3
5 files changed, 32 insertions, 11 deletions
diff --git a/db/constants.conf b/db/constants.conf
index 9b11a43e9..6f8030a45 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -428,17 +428,20 @@ constants_db: {
mf_nogstorage: 60
comment__: "Cell Properties"
- cell_walkable: 0
- cell_shootable: 1
- cell_water: 2
- cell_npc: 3
- cell_basilica: 4
- cell_landprotector: 5
- cell_novending: 6
- cell_nochat: 7
+ cell_walkable: 0
+ cell_shootable: 1
+ cell_water: 2
+ cell_npc: 3
+ cell_basilica: 4
+ cell_landprotector: 5
+ cell_novending: 6
+ cell_nochat: 7
+ cell_icewall: 8
+ cell_noicewall: 9
+ cell_noskill: 10
comment__: "Cell checks"
- //cell_gettype: 0
+ cell_gettype: 0
cell_chkwall: 1
cell_chkwater: 2
cell_chkcliff: 3
@@ -446,12 +449,15 @@ constants_db: {
cell_chkreach: 5
cell_chknopass: 6
cell_chknoreach: 7
- //cell_chkstack: 8
+ cell_chkstack: 8
cell_chknpc: 9
cell_chkbasilica: 10
cell_chklandprotector: 11
cell_chknovending: 12
cell_chknochat: 13
+ cell_chkicewall: 14
+ cell_chknoicewall: 15
+ cell_chknoskill: 16
comment__: "Bonuses / Parameter IDs"
bMaxHP: 6
diff --git a/doc/constants.md b/doc/constants.md
index 1bd6c79d5..509764424 100644
--- a/doc/constants.md
+++ b/doc/constants.md
@@ -375,6 +375,9 @@
- `cell_landprotector`: 5
- `cell_novending`: 6
- `cell_nochat`: 7
+- `cell_icewall`: 8
+- `cell_noicewall`: 9
+- `cell_noskill`: 10
### Cell checks
@@ -390,6 +393,9 @@
- `cell_chklandprotector`: 11
- `cell_chknovending`: 12
- `cell_chknochat`: 13
+- `cell_chkicewall`: 14
+- `cell_chknoicewall`: 15
+- `cell_chknoskill`: 16
### Bonuses / Parameter IDs
diff --git a/src/map/map.c b/src/map/map.c
index 40e66e4df..f66f40dfc 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -3077,6 +3077,8 @@ static int map_getcellp(struct map_data *m, const struct block_list *bl, int16 x
return (cell.icewall);
case CELL_CHKNOICEWALL:
return (cell.noicewall);
+ case CELL_CHKNOSKILL:
+ return (cell.noskill);
// special checks
case CELL_CHKPASS:
@@ -3141,6 +3143,7 @@ static void map_setcell(int16 m, int16 x, int16 y, cell_t cell, bool flag)
case CELL_NOCHAT: map->list[m].cell[j].nochat = flag; break;
case CELL_ICEWALL: map->list[m].cell[j].icewall = flag; break;
case CELL_NOICEWALL: map->list[m].cell[j].noicewall = flag; break;
+ case CELL_NOSKILL: map->list[m].cell[j].noskill = flag; break;
default:
ShowWarning("map_setcell: invalid cell type '%d'\n", (int)cell);
diff --git a/src/map/map.h b/src/map/map.h
index 2de6df2f7..64736a6f5 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -588,6 +588,7 @@ typedef enum {
CELL_NOCHAT,
CELL_ICEWALL,
CELL_NOICEWALL,
+ CELL_NOSKILL,
} cell_t;
@@ -612,6 +613,7 @@ typedef enum {
CELL_CHKNOCHAT,
CELL_CHKICEWALL,
CELL_CHKNOICEWALL,
+ CELL_CHKNOSKILL,
} cell_chk;
@@ -630,7 +632,8 @@ struct mapcell {
novending : 1,
nochat : 1,
icewall : 1,
- noicewall : 1;
+ noicewall : 1,
+ noskill : 1;
#ifdef CELL_NOSTACK
int cell_bl; //Holds amount of bls in this cell.
diff --git a/src/map/skill.c b/src/map/skill.c
index 0ead96472..caa1a0f29 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1026,6 +1026,9 @@ static int skillnotok(uint16 skill_id, struct map_session_data *sd)
if (pc_has_permission(sd, PC_PERM_SKILL_UNCONDITIONAL))
return 0; // can do any damn thing they want
+ if (map->getcell(sd->bl.m, &sd->bl, sd->bl.x, sd->bl.y, CELL_CHKNOSKILL))
+ return 1; // block usage on 'noskill' cells [Wolfie]
+
if (skill_id == AL_TELEPORT && sd->autocast.type == AUTOCAST_ITEM && sd->autocast.skill_lv > 2)
return 0; // Teleport level 3 and higher bypasses this check if cast by itemskill() script commands.