viewing paste Unknown #16243 | 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 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
prontera,139,170,6  script  MVP Ladder  837,{
set .ahmel$,"^00aa00[MVP Ladder]^000000";
 
mes .ahmel$;
mes "I list those players who succeeds to kill MVP and/or Mini Boss monsters and organize them on a Ranking List!";
mes "^0000ffMVP Boss^000000 = 3 points";
mes "^0000ffMini Boss^000000 = 1 point";
next;
    if(getgroupid() == 99)
    {
        switch(select("Show MVP Ladder:Point Shop:Reset Ladder:Cancel"))
            {
                case 1:
                goto mvprank;
 
                case 2:
                goto pointshop;
                
                case 3:
                goto reset;
 
                case 4:
                goto cancel;
            }
    }
    else
    {
        switch(select("Show MVP Ladder:Point Shop:Cancel"))
            {
                case 1:
                goto mvprank;
 
                case 2:
                goto pointshop;
                
                case 3:
                goto cancel;
            }
    }
    
    
pointshop:
    mes .ahmel$;
    mes "Here you can use your MVP Points to purchase useful items:";
    next;
    mes "^0000ffMVP Badge^000000: requirement for Class Specialization";
    mes "^ffffff.^000000";
    //mes "^0000ffArmor Exchange Ticket^000000: useful if you want to exchange your QUEST armor for another QUEST armor of the same level";
    //mes "^ffffff.^000000";
    //mes "^0000ffWeapon Exchange Ticket^000000: useful if you want to exchange your QUEST weapon for another QUEST weapon";
    //mes "^ffffff.^000000";
    //mes "^0000ffHeadgear Exchange Ticket^000000: useful if you want to exchange your tier 3 QUEST headgears for another tier 3 QUEST headgear set";
    //mes "^ffffff.^000000";
    switch(select("MVP Badge - 30 pts:^aaaaaaArmor Exchange Ticket - 150 pts:Weapon Exchange Ticket - 150 pts:Headgear Exchange Ticket - 150 pts^000000"))
    {
    case 1:
    next;
    set .@price,30;
    set .@mvpitem$,"MVP Badge";
    set .@itemshit,26047;
    mes .ahmel$;
    mes "How many MVP Badge do you want to purchase?";
    input .@quantity;
    next;
    goto shopmenu;
 
        
    case 2:
        next;
        mes .ahmel$;
        mes "Not yet implemented!";
        close;
        //set .@price,150;
        //set .@mvpitem$,"Armor Excange Ticket";
        //set .@itemshit,26018;
        //mes .ahmel$;
        //mes "How many Armor Exchange Ticket do you want to purchase?";
        //input .@quantity;
        //next;
        //goto shopmenu;
 
    
    case 3:
        next;
        mes .ahmel$;
        mes "Not yet implemented!";
        close;
        //set .@price,150;
        //set .@mvpitem$,"Weapon Exchange Ticket";
        //set .@itemshit,26020;
        //mes .ahmel$;
        //mes "How many Weapon Exchange Ticket do you want to purchase?";
        //input .@quantity;
        //next;
        //goto shopmenu;
 
    
    case 4:
        next;
        mes .ahmel$;
        mes "Not yet implemented!";
        close;
        //set .@price,150;
        //set .@mvpitem$,"Headgear Exchange Ticket";
        //set .@itemshit,26019;
        //mes .ahmel$;
        //mes "How many Headgear Exchange Ticket do you want to purchase?";
        //input .@quantity;
        //next;
        //goto shopmenu;
        
    }
    
shopmenu:
    mes .ahmel$;
    mes "You're going to purchase "+.@quantity+" "+.@mvpitem$+", proceed?";
    menu "Yes",yesbadge,"Cancel",nobadge;
        
        yesbadge:
        next;
        query_sql( "SELECT `Count` FROM `E-MVPRank` where `name`= '" + escape_sql( strcharinfo(0) ) + "'", .@Count );
        if(.@Count < .@price*.@quantity){
        mes .ahmel$;
        mes "Insufficient Points";
        mes ""+.@Count+" "+.@quantity+" "+.@price+"";
        close; }
        else {
        getitem .@itemshit,.@quantity;
        set .@quantity,.@quantity*.@price;
        query_sql( "INSERT INTO `E-MVPRank` SET `char_id`='"+getcharid(0)+"',`name`='"+strcharinfo(0)+"',`Count`='3' ON DUPLICATE KEY UPDATE `Count`=`Count`-"+.@quantity+"" );
        mes .ahmel$;
        mes "Done! Here are your "+.@mvpitem$+".";
        mes "^ff0000"+.@quantity+" pts^000000 have been deducted to you";
        close;}
        
        nobadge:
        next;
        mes .ahmel$;
        mes "Alright! Come back when you're decided."; close;
        
        
mvprank:
    query_sql( "SELECT `name`,`Count` FROM `E-MVPRank` ORDER BY `Count` DESC LIMIT 5",.@Name$,.@Count );
    
    if( getarraysize( .@Name$ ) ){
        for( set .@i,0; .@i < getarraysize( .@Name$ ); set .@i,.@i + 1 )
            mes "[# "+( .@i + 1 )+" ]^ff0000 "+.@Name$[.@i]+" ^000000- "+.@Count[.@i]+" Point(s)"; 
            if(getgroupid() == 99)
                {
                    switch(select("Reset Ladder","Close"))
                        {
                            case 1:
                            goto reset;
                            
                            case 2:
                            close;
                        }
                }
            else
                {
                    close;
                }
        }
    else{
        mes .ahmel$;
        mes "No Record Found."; close; end;
        }
 
 
reset:
    next;
    mes .ahmel$;
    mes "Are you really sure you want to reset the MVP Ladder?";
    switch(select("Yes","Cancel"))
    {
    
    case 1:
    next;
    mes .ahmel$;
    mes "Input Reset Password:";
    next;
    input .@pwdreset$;
    if(.@pwdreset$ == "phoenix")
    {
        mes .ahmel$;
        mes "Done!"; 
        query_sql( "TRUNCATE TABLE `E-MVPRank`;" );
        announce "[MVP Ladder]: Ranking is Reset! Goodluck Boss-hunting everyone!",bc_all,0xdddddd;
        end;
        close;
    }
    else if(.@pwdreset$ != "phoenix")
    {
    next;
    mes .ahmel$;
    mes "INVALID PASSWORD!"; end; close;
    }
    
    case 2:
    close;
    }
 
cancel:
    mes .ahmel$;
    mes "Okay, goodluck hunting MVPs!";
    close;
 
OnNPCKillEvent:
if( getmonsterinfo( killedrid,MOB_MVPEXP ) )
    { query_sql( "INSERT INTO `E-MVPRank` SET `char_id`='"+getcharid(0)+"',`name`='"+strcharinfo(0)+"',`Count`='3' ON DUPLICATE KEY UPDATE `Count`=`Count`+2" );
        announce "[MVP Ladder]: "+strcharinfo(0)+" slained "+getmonsterinfo( killedrid,MOB_NAME )+" at "+strcharinfo(3),bc_all,0xdddddd; }
    
if ( getmonsterinfo( killedrid,MOB_MODE ) & 0x0020 ) 
    { query_sql( "INSERT INTO `E-MVPRank` SET `char_id`='"+getcharid(0)+"',`name`='"+strcharinfo(0)+"',`Count`='1' ON DUPLICATE KEY UPDATE `Count`=`Count`+1" );}
end;
}
Viewed 673 times, submitted by Guest.