diff options
author | Michieru <Michieru@users.noreply.github.com> | 2014-11-03 20:05:53 +0100 |
---|---|---|
committer | Michieru <Michieru@users.noreply.github.com> | 2014-11-03 20:05:53 +0100 |
commit | ea85ad9514c6d1e64457c215294a7090831d971b (patch) | |
tree | e75d66f7e068d5d4df567182d0739a7a03307fcc | |
parent | 715af9d93adf4e07f11ff09a6a1b55d49d32849d (diff) | |
parent | 82037b89b33c3fa2a5cfaf33038fbf9ebddea17f (diff) | |
download | hercules-ea85ad9514c6d1e64457c215294a7090831d971b.tar.gz hercules-ea85ad9514c6d1e64457c215294a7090831d971b.tar.bz2 hercules-ea85ad9514c6d1e64457c215294a7090831d971b.tar.xz hercules-ea85ad9514c6d1e64457c215294a7090831d971b.zip |
Merge pull request #363 from EPuncker/master
Added 4 new permissions
-rw-r--r-- | doc/permissions.txt | 4 | ||||
-rw-r--r-- | src/map/clif.c | 4 | ||||
-rw-r--r-- | src/map/pc.c | 6 | ||||
-rw-r--r-- | src/map/pc_groups.c | 4 | ||||
-rw-r--r-- | src/map/pc_groups.h | 4 | ||||
-rw-r--r-- | src/map/skill.c | 3 |
6 files changed, 23 insertions, 2 deletions
diff --git a/doc/permissions.txt b/doc/permissions.txt index 7280395dc..a656f8bcf 100644 --- a/doc/permissions.txt +++ b/doc/permissions.txt @@ -33,3 +33,7 @@ disable_pvp : Ability to disable Player vs. Player. disable_commands_when_dead : Ability to disable @command usage when dead. can_trade_bound: Ability to trade or otherwise distribute bound items (drop, storage, vending etc...). hchsys_admin : Hercules Chat System Admin (Ability to modify channel settings regardless of ownership and join password-protected channels without requiring a password.) +disable_pickup: Ability to disable the player from picking up any item from ground, they can still receive items picked up by others means like party share píck. +disable_exp: Ability to disable the player from gaining any experience point. +disable_store: Ability to disable the player from using/openning npc and player stores. +disable_skill_usage: Ability to disable the player from using any skill. 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 |