summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorL0ne_W0lf <L0ne_W0lf@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-09-20 23:46:48 +0000
committerL0ne_W0lf <L0ne_W0lf@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-09-20 23:46:48 +0000
commitdbc3e0878510f5d8ae7d3aca21607bfa2648b421 (patch)
tree87867007c2154b99b44924c907ecfbf553c6ebf1 /src/map
parentb793bb7e9eb87a9dddfb1f78c3ae0d795bdb14f8 (diff)
downloadhercules-dbc3e0878510f5d8ae7d3aca21607bfa2648b421.tar.gz
hercules-dbc3e0878510f5d8ae7d3aca21607bfa2648b421.tar.bz2
hercules-dbc3e0878510f5d8ae7d3aca21607bfa2648b421.tar.xz
hercules-dbc3e0878510f5d8ae7d3aca21607bfa2648b421.zip
* Applied map flag update patch provided by Daegaladh. Will mess with custom restricted items.
- Adds a reset mapflag which is checked when using the Neuralizer. - Syncronizes the item_noequip_db bitmasks with with skill_nocast_db. - Updates mapflags, and both skills and items which are restricted. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14961 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c2
-rw-r--r--src/map/map.h1
-rw-r--r--src/map/npc.c2
-rw-r--r--src/map/pc.c33
-rw-r--r--src/map/script.c6
-rw-r--r--src/map/status.c10
6 files changed, 40 insertions, 14 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index c2599d68d..e98481f22 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -4416,6 +4416,8 @@ ACMD_FUNC(mapinfo)
strcat(atcmd_output, "NoIcewall | ");
if (map[m_id].flag.allowks)
strcat(atcmd_output, "AllowKS | ");
+ if (map[m_id].flag.reset)
+ strcat(atcmd_output, "Reset | ");
clif_displaymessage(fd, atcmd_output);
strcpy(atcmd_output,"Other Flags: ");
diff --git a/src/map/map.h b/src/map/map.h
index cd2ea9411..6af6efb2c 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -491,6 +491,7 @@ struct map_data {
unsigned partylock :1;
unsigned guildlock :1;
unsigned src4instance : 1; // To flag this map when it's used as a src map for instances
+ unsigned reset :1; // [Daegaladh]
} flag;
struct point save;
struct npc_data *npc[MAX_NPC_PER_MAP];
diff --git a/src/map/npc.c b/src/map/npc.c
index ceb1f3f1d..897475f73 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -3117,6 +3117,8 @@ static const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, con
map[m].flag.partylock=state;
else if (!strcmpi(w3,"guildlock"))
map[m].flag.guildlock=state;
+ else if (!strcmpi(w3,"reset"))
+ map[m].flag.reset=state;
else
ShowError("npc_parse_mapflag: unrecognized mapflag '%s' (file '%s', line '%d').\n", w3, filepath, strline(buffer,start-buffer));
diff --git a/src/map/pc.c b/src/map/pc.c
index 23605409a..b93334f35 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -720,13 +720,17 @@ int pc_isequip(struct map_session_data *sd,int n)
return 0;
if(item->sex != 2 && sd->status.sex != item->sex)
return 0;
- if(map[sd->bl.m].flag.pvp && ((item->flag.no_equip&1) || !pc_isAllowedCardOn(sd,item->slot,n,1)))
+ if(!map_flag_vs(sd->bl.m) && ((item->flag.no_equip&1) || !pc_isAllowedCardOn(sd,item->slot,n,1)))
+ return 0;
+ if(map[sd->bl.m].flag.pvp && ((item->flag.no_equip&2) || !pc_isAllowedCardOn(sd,item->slot,n,2)))
+ return 0;
+ if(map_flag_gvg(sd->bl.m) && ((item->flag.no_equip&4) || !pc_isAllowedCardOn(sd,item->slot,n,4)))
+ return 0;
+ if(map[sd->bl.m].flag.battleground && ((item->flag.no_equip&8) || !pc_isAllowedCardOn(sd,item->slot,n,8)))
return 0;
- if(map_flag_gvg(sd->bl.m) && ((item->flag.no_equip&2) || !pc_isAllowedCardOn(sd,item->slot,n,2)))
- return 0;
if(map[sd->bl.m].flag.restricted)
{
- int flag =map[sd->bl.m].zone;
+ int flag =8*map[sd->bl.m].zone;
if (item->flag.no_equip&flag || !pc_isAllowedCardOn(sd,item->slot,n,flag))
return 0;
}
@@ -3648,6 +3652,11 @@ int pc_isUseitem(struct map_session_data *sd,int n)
if( nameid == 12243 && sd->md->db->lv < 80 )
return 0;
break;
+
+ case 12213: //Neuralizer
+ if( !map[sd->bl.m].flag.reset )
+ return 0;
+ break;
}
if( nameid >= 12153 && nameid <= 12182 && sd->md != NULL )
@@ -3655,9 +3664,11 @@ int pc_isUseitem(struct map_session_data *sd,int n)
//added item_noequip.txt items check by Maya&[Lupus]
if (
- (map[sd->bl.m].flag.pvp && item->flag.no_equip&1) || // PVP
- (map_flag_gvg(sd->bl.m) && item->flag.no_equip&2) || // GVG
- (map[sd->bl.m].flag.restricted && item->flag.no_equip&map[sd->bl.m].zone) // Zone restriction
+ (!map_flag_vs(sd->bl.m) && item->flag.no_equip&1) || // Normal
+ (map[sd->bl.m].flag.pvp && item->flag.no_equip&2) || // PVP
+ (map_flag_gvg(sd->bl.m) && item->flag.no_equip&4) || // GVG
+ (map[sd->bl.m].flag.battleground && item->flag.no_equip&8) || // Battleground
+ (map[sd->bl.m].flag.restricted && item->flag.no_equip&(8*map[sd->bl.m].zone)) // Zone restriction
)
return 0;
@@ -7435,9 +7446,11 @@ int pc_checkitem(struct map_session_data *sd)
if( it )
{ // check for forbiden items.
int flag =
- (map[sd->bl.m].flag.restricted?map[sd->bl.m].zone:0)
- | (map[sd->bl.m].flag.pvp?1:0)
- | (map_flag_gvg(sd->bl.m)?2:0);
+ (map[sd->bl.m].flag.restricted?(8*map[sd->bl.m].zone):0)
+ | (!map_flag_vs(sd->bl.m)?1:0)
+ | (map[sd->bl.m].flag.pvp?2:0)
+ | (map_flag_gvg(sd->bl.m)?4:0)
+ | (map[sd->bl.m].flag.battleground?8:0);
if( flag && (it->flag.no_equip&flag || !pc_isAllowedCardOn(sd,it->slot,i,flag)) )
{
pc_unequipitem(sd, i, 2);
diff --git a/src/map/script.c b/src/map/script.c
index 0da5e21aa..6a5243f74 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -348,7 +348,8 @@ enum {
MF_ALLOWKS,
MF_MONSTER_NOTELEPORT,
MF_PVP_NOCALCRANK, //50
- MF_BATTLEGROUND
+ MF_BATTLEGROUND,
+ MF_RESET
};
const char* script_op2name(int op)
@@ -9632,6 +9633,7 @@ BUILDIN_FUNC(getmapflag)
case MF_MONSTER_NOTELEPORT: script_pushint(st,map[m].flag.monster_noteleport); break;
case MF_PVP_NOCALCRANK: script_pushint(st,map[m].flag.pvp_nocalcrank); break;
case MF_BATTLEGROUND: script_pushint(st,map[m].flag.battleground); break;
+ case MF_RESET: script_pushint(st,map[m].flag.reset); break;
}
}
@@ -9701,6 +9703,7 @@ BUILDIN_FUNC(setmapflag)
case MF_MONSTER_NOTELEPORT: map[m].flag.monster_noteleport=1; break;
case MF_PVP_NOCALCRANK: map[m].flag.pvp_nocalcrank=1; break;
case MF_BATTLEGROUND: map[m].flag.battleground = (!val || atoi(val) < 0 || atoi(val) > 2) ? 1 : atoi(val); break;
+ case MF_RESET: map[m].flag.reset=1; break;
}
}
@@ -9767,6 +9770,7 @@ BUILDIN_FUNC(removemapflag)
case MF_MONSTER_NOTELEPORT: map[m].flag.monster_noteleport=0; break;
case MF_PVP_NOCALCRANK: map[m].flag.pvp_nocalcrank=0; break;
case MF_BATTLEGROUND: map[m].flag.battleground=0; break;
+ case MF_RESET: map[m].flag.reset=0; break;
}
}
diff --git a/src/map/status.c b/src/map/status.c
index 89ad5c483..3ec822a6a 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1992,11 +1992,15 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
if(!data->script)
continue;
if(data->flag.no_equip) { //Card restriction checks.
- if(map[sd->bl.m].flag.restricted && data->flag.no_equip&map[sd->bl.m].zone)
+ if(map[sd->bl.m].flag.restricted && data->flag.no_equip&(8*map[sd->bl.m].zone))
continue;
- if(map[sd->bl.m].flag.pvp && data->flag.no_equip&1)
+ if(!map_flag_vs(sd->bl.m) && data->flag.no_equip&1)
continue;
- if(map_flag_gvg(sd->bl.m) && data->flag.no_equip&2)
+ if(map[sd->bl.m].flag.pvp && data->flag.no_equip&2)
+ continue;
+ if(map_flag_gvg(sd->bl.m) && data->flag.no_equip&4)
+ continue;
+ if(map[sd->bl.m].flag.battleground && data->flag.no_equip&8)
continue;
}
if(i == EQI_HAND_L && sd->status.inventory[index].equip == EQP_HAND_L)