diff options
author | Komurka <Komurka@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-01-30 01:00:54 +0000 |
---|---|---|
committer | Komurka <Komurka@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-01-30 01:00:54 +0000 |
commit | 156b7a8517eb78d8c4525dbf0eeecb3afb295891 (patch) | |
tree | 1442b236ff4bb26e1ba8face7783247470b36f2f /src/map | |
parent | b1e5e75543f0eba2ff6885496ecca9a74214952a (diff) | |
download | hercules-156b7a8517eb78d8c4525dbf0eeecb3afb295891.tar.gz hercules-156b7a8517eb78d8c4525dbf0eeecb3afb295891.tar.bz2 hercules-156b7a8517eb78d8c4525dbf0eeecb3afb295891.tar.xz hercules-156b7a8517eb78d8c4525dbf0eeecb3afb295891.zip |
Applied lordalfa patch - you can now forbid usage of certain cards on PVP/GVG/WoE defined in item_noequip.txt
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5103 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/pc.c | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 94aa4c602..31269c150 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -554,6 +554,20 @@ int pc_setequipindex(struct map_session_data *sd) return 0;
}
+int pc_isAllowedCardOn(struct map_session_data *sd,int s,int eqindex,int flag) {
+ int i;
+ struct item_data *data;
+ if (s>0) {
+ for (i=0;i<s;i++) {
+ if ((data = itemdb_search(sd->status.inventory[eqindex].card[i]))) {
+ if (data->flag.no_equip&flag)
+ return 0;
+ }
+ }
+ }
+ return 1;
+}
+
int pc_isequip(struct map_session_data *sd,int n)
{
struct item_data *item;
@@ -572,10 +586,10 @@ 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)) //optimized by Lupus
- return 0;
- if(map_flag_gvg(sd->bl.m) && (item->flag.no_equip>1)) //optimized by Lupus
+ if(map[sd->bl.m].flag.pvp && (item->flag.no_equip&1 || !pc_isAllowedCardOn(sd,item->slot,n,1))) //optimized by Lupus
return 0;
+ if(map_flag_gvg(sd->bl.m) && (item->flag.no_equip&2 || !pc_isAllowedCardOn(sd,item->slot,n,2))) //optimized by Lupus
+ return 0;
if((item->equip & 0x0002 || item->equip & 0x0020) && item->type == 4 && sd->sc_data[SC_STRIPWEAPON].timer != -1) // Also works with left-hand weapons [DracoRPG]
return 0;
if(item->equip & 0x0020 && item->type == 5 && sd->sc_data[SC_STRIPSHIELD].timer != -1) // Also works with left-hand weapons [DracoRPG]
@@ -7174,12 +7188,14 @@ int pc_checkitem(struct map_session_data *sd) calc_flag = 1;
}
//?備制限チェック
- if(sd->status.inventory[i].equip && (map[sd->bl.m].flag.pvp||map[sd->bl.m].flag.gvg) && (it->flag.no_equip&1)){//PVP check for forbiden items. optimized by [Lupus]
- sd->status.inventory[i].equip=0;
- calc_flag = 1;
- }else if(sd->status.inventory[i].equip && map_flag_gvg(sd->bl.m) && (it->flag.no_equip>1)){//GvG optimized by [Lupus]
- sd->status.inventory[i].equip=0;
- calc_flag = 1;
+ if(sd->status.inventory[i].equip && (map[sd->bl.m].flag.pvp||map[sd->bl.m].flag.gvg) &&
+ (it->flag.no_equip&1 || !pc_isAllowedCardOn(sd,it->slot,i,1))){//PVP check for forbiden items. optimized by [Lup$
+ sd->status.inventory[i].equip=0;
+ calc_flag = 1;
+ }else if(sd->status.inventory[i].equip && map_flag_gvg(sd->bl.m) &&
+ (it->flag.no_equip&2 || !pc_isAllowedCardOn(sd,it->slot,i,2))){//GvG optimized by [Lupus]
+ sd->status.inventory[i].equip=0;
+ calc_flag = 1;
}
}
|