Since there is no group permission which gives certain group having INTRAVISION (pc_bonus(SP_INTRAVISION,0)) 'automatically' when pc_group_pc_load loaded, I decide to make it.
the flow
Give permission on group.conf
permissions: {
intravision: true
}
After player login, player who has intravision group permission, will automatically has intravision (Maya Purple Card effect) Then, if the group permission is changed then use @reloadatcommand and intravision permission is gone, player's intravision will be gone too if their group doesn't have it.
problems
If I place
if(sd->permissions&PC_PERM_INTRAVISION)
{
pc_bonus(sd, SP_INTRAVISION,0);
}
else
{
sd->special_state.intravision = 0;
clif_status_load(&sd->bl, SI_INTRAVISION, 0);
} on pc_groups.c > pc_group_pc_load(...) after player choose the char, it will never load the map server until it's 'Rejected from server'
If I insert the code above (remove the code placement above) on pc.c > pc_authok(...) between
/* load user permissions */
pc_group_pc_load(sd);
memcpy(&sd->status, st, sizeof(*st));. It has same problem like above.
If I insert the code on status.c status_calc_pc_(), it will loaded, player gets Intravision but even the group permission is changed for intravision permission, player who before having intravision still has it although the permission is gone and.
notes
I tried to use
pc_has_permission(sd)also for replacing
if(sd->permissions&PC_PERM_INTRAVISION)
I've use
pc_bonus(sd, SP_INTRAVISION,0);before using
if(sd->state.lr_flag != 2) {
sd->special_state.intravision = 1;
clif_status_load(&sd->bl, SI_INTRAVISION, 1);
}
I added
#include "status.h"
#include "clif.h"if it's necessary
If you suggest me to use @intravision command, I know it because I made it too, but I need permission.
the most important is, CMIIW.