viewing paste Unknown #27997 | Athena

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
-   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;
    
}
Viewed 1122 times, submitted by Dastgir.