viewing paste [ Request ] Equipment Restriction | 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 47 48 49
// =============================
/* (Alternative) Equipment Restriction v2: http://herc.ws/board/topic/14063-equipment-restriction/
    ----------------------------
    by: Legend
    compatible w/: Hercules
    ----------------------------
    Description:
    * Temporary restriction since Map_zone_db.conf
      ain't working properly as of the moment [01-15-2017].
    ----------------------------
    Changelogs:
    v1: Warps you out if you equip the restricted item.
    v2: Automatically unequip the restricted item.
    ----------------------------
    Comments:
    * Please report to me if bugs were found:
      Contact: http://herc.ws/board/user/5387-legend/
*/
// =============================
-   script  request#10  FAKE_NPC,{
OnInit:
    // ---- Restricted Items ---- //
    setarray .ri[0],1201,2220,1202;
    
    // ---- Restriction Maps ---- //
    setarray .rm$[0],"prontera","payon";
    
    // -- DO NOT TOUCH THIS :)) -- //
    for (.@z = 0; .@z < getarraysize(.rm$); ++.@z){
        setmapflag .rm$[.@z],mf_loadevent;
    }
    end;
        
        
OnPCLoadMapEvent:
    for (.@z = 0; .@z < getarraysize(.rm$); ++.@z){
        while (strcharinfo(3) == .rm$[.@z] ) {
            for (.@x = 0; .@x < 21; ++.@x){
                for (.@y = 0; .@y < getarraysize(.ri); ++.@y){
                    if (getequipid(.@x) == .ri[.@y]){
                        unequip (.@x);
                    }
                }
            }
        sleep2 500;
        }
    }
    end;
}
Viewed 1156 times, submitted by Legend.