- script disable_enable FAKE_NPC,{
OnInit:
bindatcmd "disablenpc", strnpcinfo(3)+"::OnDisable", 99, 99;
bindatcmd "enablenpc", strnpcinfo(3)+"::OnEnable", 99, 99;
bindatcmd "hideonnpc", strnpcinfo(3)+"::OnHide", 99, 99;
bindatcmd "hideoffnpc", strnpcinfo(3)+"::OnUnhide", 99, 99;
end;
OnDisable:
callsub OnOperation, "disablenpc", "Disabled", 0;
end;
OnEnable:
callsub OnOperation, "enablenpc", "Enabled", 1;
end;
OnHide:
callsub OnOperation, "hideonnpc", "Hidden", 2;
end;
OnUnhide:
callsub OnOperation, "hideoffnpc", "Revealed", 3;
end;
OnOperation:
if (.@atcmd_numparameters < 1) {
dispbottom "Usage: @"+ getarg(0) +" <NPC Name>";
}
.@name$ = "";
for (.@i = 0; .@i < .@atcmd_numparameters; ++.@i) {
.@name$ += (.@i > 0 ? " " : "") + .@atcmd_parameters$[.@i];
}
switch(getarg(2, 0)) {
case 0:
disablenpc .@name$;
break;
case 1:
enablenpc .@name$;
break;
case 2:
hideonnpc .@name$;
break;
case 3:
hideoffnpc .@name$;
break;
}
dispbottom .@name$ +" has been "+ getarg(1);
end;
}