Daegaladh Posted June 27, 2012 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
GM Takumirai Posted June 27, 2012 Posted June 27, 2012 - good idea putting this on gm.conf to activate or not Quote
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.