• 0
manuel

request npc mvp rank rewarding

Question

Hi, nice to meet you
how can i make the npc ranking give prizes to the first place

Quote

 

prontera,164,174,3    script    MvP Rank Kamael    660,{
query_sql( "DELETE FROM `mvp_ranking` WHERE `name` NOT IN ( SELECT `name` FROM `char` )" );
query_sql( "select name, points from mvp_ranking where points > 0 order by points desc limit "+ .top, [email protected]$, [email protected] );

set [email protected], query_sql( "select name, points from mvp_ranking where points > 0 order by points desc limit "+ .top, [email protected]$, [email protected] );

    mes "[^FF0000MvP ^0000FFRank ^00FF00 ^FF0000" + .top +"^000000]";
    for (set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected] + 1)
        mes "Lider ^FF0000" +([email protected] + 1) +"^000000 ^0000FF" + [email protected]$[[email protected]] +"^000000 con ^FF0000" + [email protected][[email protected]] +"^000000 MvP.";
        mes "* ^ff0000 RANK SE RESETEA LOS DOMINGOS ^000000 *";
    close;

OnInit: // Script Configuration

// lsitado mvp
setarray $mobmvpA[0],1046,1059,1086,1112,1115,1147,1150,1159,1885,1980,1389,1038,1039,1087,1157,1190,1251,1252,1272,1312,1373,1399,1418,1492,1511,1583,1630,1658,1785,1623,1685,1688,1708,1719,1734,1751,1768,1832,1871,1874,1917,2022,16461647,1648,1649,1650,1651; 
    set .a, 1; // Broadcast who killed the MvP and wich MvP and wick Map [0 Off - 1 On]
    set .top, 10; // Max. Top Rank (Hihgly recommended between 5~10, more maybe bug the server (limited variables)
    end;

OnNPCKillEvent: // Script execution

    for (set [email protected], 0; [email protected] < getarraysize($mobmvpA); set [email protected], [email protected] + 1) {
        if(killedrid == $mobmvpA[[email protected]]) {

    if (.a) // If announce On
        announce "[ Moodplay Anuncia ]: [ " +getmonsterinfo(killedrid,0) +" ]  ha sido destrozado por [ " +strcharinfo(0) +" ]",bc_blue|bc_all;
    query_sql "insert into `mvp_ranking` value ( "+ getcharid(0) +", '"+ escape_sql( strcharinfo(0) ) +"', 1 ) on duplicate key update `points` = if ( `points` + 1 > 200, 0, `points` + 1 )";
    end;
    
    }
    }

}

 

 

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...