viewing paste Unknown #24479 | Athena

Posted on the
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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
-   script  sv_lvlup_sys    -1,{
    
    /*-----------------------------------------------------
    Script
    -----------------------------------------------------*/
    OnNPCKillEvent:
        // Loop through all unlockable maps
        for (.@i = 0; .@i < getarraysize(.map_name$); .@i++) {
            // Determine if player is eligible to contribute experience
            if (Elaria_Story || strcharinfo(3) == .map_name$[.@i]) {
                // Determine the amount of experience gained from kill
                .@killed_exp = getmonsterinfo(killedrid, MOB_BASEEXP);
                
                // Add experience value to current continent experience
                $cont_exp += .@killed_exp;
                
                // Check if threshold met for current map
                if ($cont_exp < .min_exp[$next_map]) {
                    // Do nothing if threshold not met
                    end;
                }
                
                // Announce map unlock
                announce "The map \""+ .map_vanity$[$next_map] +"\" ("+ .map_name$[$next_map] +") has been unlocked!", bc_all;
                
                // Set flag to unlock next map
                $next_map++;
            }
        }
        
        end;
        
        
    
    /*-----------------------------------------------------
    Configuration
    -----------------------------------------------------*/
    OnInit:
        // Base experience thresholds (11)
        setarray .min_exp[0],
            1000000,
            2000000,
            5000000,
            10000000,
            30000000,
            50000000,
            200000000,
            400000000,
            600000000,
            800000000,
            1000000000,
            2000000000;
            
        // Corresponding maps to unlock
        setarray .map_name$[0],
            "prt_fild01",
            "prt_fild02",
            "prt_fild03",
            "prt_fild04",
            "prt_fild05",
            "prt_fild06",
            "prt_fild07",
            "prt_fild08",
            "prt_fild09",
            "prt_fild10",
            "prt_fild11";
            
            
        // Corresponding vanity names
        setarray .map_vanity$[0],
            "Prontera Field 01",
            "Prontera Field 02",
            "Prontera Field 03",
            "Prontera Field 04",
            "Prontera Field 05",
            "Prontera Field 06",
            "Prontera Field 07",
            "Prontera Field 08",
            "Prontera Field 09",
            "Prontera Field 10",
            "Prontera Field 11";
            
        
        // Create atcommand to check experience progress
        bindatcmd "checkexp", strnpcinfo(3) +"::OnCheckEXP", 0, 99;
            
        end;
        
        
    /*-----------------------------------------------------
    Atcommand @checkexp
    -----------------------------------------------------*/
    OnCheckEXP:
        // Display information about unlocking next map
        message strcharinfo(0), $cont_exp +" / "+ .min_exp[$next_map] +" EXP has been gained toward unlocking "+ $map_vanity$[$next_map];
        
        end;
        
        
    /*-----------------------------------------------------
    Map Status
    -----------------------------------------------------*/
    OnPCLoadMapEvent:
        // Loop through all unlockable maps
        for (.@i = 0; .@i < getarraysize(.map_name$); .@i++) {
            // Check if player is on map and if map is unlocked
            if (strcharinfo(3) == .map_name$[.@i] && .@i < $next_map) {
                // Return to SavePoint if map is locked
                warp "SavePoint", 0, 0;
                end;
            }
        }
        
        end;
    
}
 
 
/*-----------------------------------------------------
Mapflags
-----------------------------------------------------*/
prt_fild01  mapflag loadevent
prt_fild02  mapflag loadevent
prt_fild03  mapflag loadevent
prt_fild04  mapflag loadevent
prt_fild05  mapflag loadevent
prt_fild06  mapflag loadevent
prt_fild07  mapflag loadevent
prt_fild08  mapflag loadevent
prt_fild09  mapflag loadevent
prt_fild10  mapflag loadevent
prt_fild11  mapflag loadevent
 
Viewed 666 times, submitted by Guest.