summaryrefslogtreecommitdiff
path: root/src/map/pc.c
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/pc.c
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/pc.c')
-rw-r--r--src/map/pc.c33
1 files changed, 23 insertions, 10 deletions
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);