Daegaladh Posted June 27, 2012 Group: Developer Topic Count: 30 Topics Per Day: 0.01 Content Count: 239 Reputation: 147 Joined: 11/21/11 Last Seen: Wednesday at 07:39 AM Share Posted June 27, 2012 (edited) I think it would be useful to add a can_attack permission, so you can prevent GMs to attack monsters or players (to prevent corruption acts like: tanking players, get items to give to players, etc...). I've just coded it by myself, so here's the code Edit: I think I should add a check to pets, homunculus, mercenaries and elementals too... pc_groups.c { "use_changemaptype", PC_PERM_USE_CHANGEMAPTYPE }, { "all_commands", PC_PERM_USE_ALL_COMMANDS }, { "receive_requests", PC_PERM_RECEIVE_REQUESTS }, + { "can_attack", PC_PERM_ATTACK}, }; /** pc.h PC_PERM_USE_CHANGEMAPTYPE = 0x04000, PC_PERM_USE_ALL_COMMANDS = 0x08000, PC_PERM_RECEIVE_REQUESTS = 0x10000, + PC_PERM_ATTACK = 0x20000, }; #define pc_setdead(sd) ( (sd)->state.dead_sit = (sd)->vd.dead_sit = 1 ) clif.c : case 0x00: // once attack case 0x07: // continuous attack + if( !pc_has_permission(sd, PC_PERM_ATTACK) ) + return; + if( pc_cant_act(sd) || sd->sc.option&OPTION_HIDE ) return; if( skilllv < 1 ) skilllv = 1; //No clue, I have seen the client do this with guild skills :/ [skotlex] + if( !pc_has_permission(sd, PC_PERM_ATTACK) ) + return; + tmp = skill_get_inf(skillnum); if (tmp&INF_GROUND_SKILL || !tmp) return; //Using a ground/passive skill on a target? WRONG. /// There are various variants of this packet, some of them have padding between fields. void clif_parse_UseSkillToPos(int fd, struct map_session_data *sd) { + if( !pc_has_permission(sd, PC_PERM_ATTACK) ) + return; if (pc_cant_act(sd)) return; if (pc_issit(sd)) Edited June 27, 2012 by Daegaladh 3 Quote Link to comment Share on other sites More sharing options...
GM Takumirai Posted June 27, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.01 Content Count: 592 Reputation: 31 Joined: 11/14/11 Last Seen: July 29, 2015 Share Posted June 27, 2012 - good idea putting this on gm.conf to activate or not Quote Link to comment Share on other sites More sharing options...
Daegaladh Posted June 27, 2012 Group: Developer Topic Count: 30 Topics Per Day: 0.01 Content Count: 239 Reputation: 147 Joined: 11/21/11 Last Seen: Wednesday at 07:39 AM Author Share Posted June 27, 2012 Nope, it goes on groups.conf Quote Link to comment Share on other sites More sharing options...
Tragedy Posted June 27, 2012 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 37 Reputation: 11 Joined: 11/10/11 Last Seen: March 26, 2021 Share Posted June 27, 2012 Good idea Dae Like it :3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.