viewing paste wear gas mask at coal mines. | 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
 
-   script  Sample#gas_mask -1,{
 
    OnInit:
        .required_equip = Gas_Mask;
        
        setarray .@map$,"mjo_dun02","mjo_dun03";
        .@map_size = getarraysize( .@map$ );
        
        .total_map$ = "#";
        while ( .@i < .@map_size ) {
            .total_map$ = .total_map$ + .@map$[.@i] + "#";
            setmapflag .@map$[.@i],mf_loadevent;
            .@i++;
        }
        .npc_name$ = strnpcinfo(0);
        setitemscript .required_equip,"{ doevent \""+.npc_name$+"::OnRemove\"; }",2;
        end;
        
    OnPCLoadMapEvent:
        deltimer .npc_name$+"::OnRemove";
        if ( !compare( .total_map$,"#"+strcharinfo( PC_MAP )+"#" ) ) 
            end;
            
    OnRemove:
        sleep2 5000;
        if ( !isequipped( .required_equip ) ) {
            unitkill getcharid(3);
            if ( !Hp ) 
                addtimer 5000,.npc_name$+"::OnPCLoadMapEvent";
        }
        end;
}
Viewed 1188 times, submitted by Emistry.