summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c4
-rw-r--r--src/map/pc.c6
-rw-r--r--src/map/pc_groups.c4
-rw-r--r--src/map/pc_groups.h4
-rw-r--r--src/map/skill.c3
5 files changed, 19 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index f5f1c5512..169f30793 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -10902,7 +10902,7 @@ void clif_parse_NpcBuyListSend(int fd, struct map_session_data* sd)
unsigned short* item_list = (unsigned short*)RFIFOP(fd,4);
int result;
- if( sd->state.trading || !sd->npc_shopid )
+ if( sd->state.trading || !sd->npc_shopid || pc_has_permission(sd,PC_PERM_DISABLE_STORE) )
result = 1;
else
result = npc->buylist(sd,n,item_list);
@@ -15621,7 +15621,7 @@ void clif_parse_cashshop_buy(int fd, struct map_session_data *sd)
int fail = 0;
nullpo_retv(sd);
- if( sd->state.trading || !sd->npc_shopid )
+ if( sd->state.trading || !sd->npc_shopid || pc_has_permission(sd,PC_PERM_DISABLE_STORE) )
fail = 1;
else {
#if PACKETVER < 20101116
diff --git a/src/map/pc.c b/src/map/pc.c
index f07858ca6..1dc032f7c 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4153,6 +4153,9 @@ int pc_takeitem(struct map_session_data *sd,struct flooritem_data *fitem)
if(!check_distance_bl(&fitem->bl, &sd->bl, 2) && sd->ud.skill_id!=BS_GREED)
return 0; // Distance is too far
+ if( pc_has_permission(sd,PC_PERM_DISABLE_PICK_UP) )
+ return 0;
+
if (sd->status.party_id)
p = party->search(sd->status.party_id);
@@ -6029,6 +6032,9 @@ bool pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned in
if(!battle_config.pvp_exp && map->list[sd->bl.m].flag.pvp) // [MouseJstr]
return false; // no exp on pvp maps
+ if( pc_has_permission(sd,PC_PERM_DISABLE_EXP) )
+ return false;
+
if(sd->status.guild_id>0)
base_exp-=guild->payexp(sd,base_exp);
diff --git a/src/map/pc_groups.c b/src/map/pc_groups.c
index e577c642f..9cd478b3f 100644
--- a/src/map/pc_groups.c
+++ b/src/map/pc_groups.c
@@ -420,6 +420,10 @@ void do_init_pc_groups(void) {
{ "disable_commands_when_dead", PC_PERM_DISABLE_CMD_DEAD },
{ "hchsys_admin", PC_PERM_HCHSYS_ADMIN },
{ "can_trade_bound", PC_PERM_TRADE_BOUND },
+ { "disable_pickup", PC_PERM_DISABLE_PICK_UP },
+ { "disable_store", PC_PERM_DISABLE_STORE },
+ { "disable_exp", PC_PERM_DISABLE_EXP },
+ { "disable_skill_usage", PC_PERM_DISABLE_SKILL_USAGE },
};
unsigned char i, len = ARRAYLENGTH(pc_g_defaults);
diff --git a/src/map/pc_groups.h b/src/map/pc_groups.h
index f52e2ba22..48ff782dd 100644
--- a/src/map/pc_groups.h
+++ b/src/map/pc_groups.h
@@ -35,6 +35,10 @@ enum e_pc_permission {
PC_PERM_DISABLE_CMD_DEAD = 0x100000,
PC_PERM_HCHSYS_ADMIN = 0x200000,
PC_PERM_TRADE_BOUND = 0x400000,
+ PC_PERM_DISABLE_PICK_UP = 0x800000,
+ PC_PERM_DISABLE_STORE = 0x1000000,
+ PC_PERM_DISABLE_EXP = 0x2000000,
+ PC_PERM_DISABLE_SKILL_USAGE = 0x4000000,
};
// Cached config settings for quick lookup
diff --git a/src/map/skill.c b/src/map/skill.c
index a51dec868..d3c00a75b 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -453,6 +453,9 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd)
if (idx == 0)
return 1; // invalid skill id
+ if( pc_has_permission(sd, PC_PERM_DISABLE_SKILL_USAGE) )
+ return 1;
+
if (pc_has_permission(sd, PC_PERM_SKILL_UNCONDITIONAL))
return 0; // can do any damn thing they want