Jump to content
  • 0

Skull Collector NPC Ranker?


Question

Posted

Players will exchange the skulls they collected from PvP to a NPC.

 

The NPC will give the players Skull Points.

 

It will rank the highest skull collectors to top 10.

 

Anybody please?

14 answers to this question

Recommended Posts

Posted

prontera,155,180,0	script	Skull Points	910,{

switch(select("View PVP Skull Points Ladder:" + (countitem(.ITEMID_SKULL_) ?

("Exchange "+countitem(.ITEMID_SKULL_)+" "+((countitem(.ITEMID_SKULL_)==1)?"Skull":"Skulls")+" --> Points") : "")

)) {

case 1:

query_sql "SELECT `char`.`name`, CAST(`value` AS UNSIGNED) " +

"FROM global_reg_value " +

"LEFT JOIN `char` ON global_reg_value.char_id=`char`.char_id " +

"WHERE global_reg_value.`str`='skull_points' AND CAST(`value` AS UNSIGNED) > 0 " +

"ORDER BY CAST(`value` AS UNSIGNED) DESC LIMIT 10",

.@name$, .@points;

mes "[Top 10 Skull Points]";

for (set .@i,0; .@i<getarraysize(.@name$); set .@i,.@i+1) {

mes (.@i+1) +". ^0000FF"+ .@name$[.@i] +"^000000 ("+ .@points[.@i] +((.@points[.@i]==1)?" pt":" pts")+")";

}

break;

case 2:

set .@skulls, countitem(.ITEMID_SKULL_);

if (.@skulls < 1) {

mes "You don't have any PVP Skulls.";

} else {

delitem .ITEMID_SKULL_, .@skulls;

set skull_points, skull_points + .@skulls;

dispbottom "Gained "+.@skulls+" skull points. Total = " + skull_points;

}

break;

}

close;

OnInit:

// should match /src/map/itemdb.h

set .ITEMID_SKULL_, 7420;

end;

}

  • Upvote 1
Posted

if (countitem(.ITEMID_SKULL_) < 1) {

mes "You don't have any PVP Skulls.";

} else {

set .@skulls, .ITEMID_SKULL_;

delitem .ITEMID_SKULL_, .@skulls;

getitem 7227,.@skulls;

set skull_points, skull_points + .@skulls;

dispbottom "Gained "+.@skulls+" skull points. Total = " + skull_points;

}

Posted

yep i'm using the skull that has names on it.... after being killed the 7420 and still don't get any.



this is the error i get everytime i try to exchange the skulls

post-3034-0-26597900-1362249769_thumb.jpg

Posted
prontera,155,180,0    script    Skull Points    910,{
    switch(select("View PVP Skull Points Ladder:" + (countitem(.ITEMID_SKULL_) ?
     ("Exchange "+countitem(.ITEMID_SKULL_)+" "+((countitem(.ITEMID_SKULL_)==1)?"Skull":"Skulls")+" --> Points") : "")
     )) {
    case 1:
        query_sql "SELECT `char`.`name`, CAST(`value` AS UNSIGNED) " +
         "FROM global_reg_value " +
         "LEFT JOIN `char` ON global_reg_value.char_id=`char`.char_id " +
         "WHERE global_reg_value.`str`='skull_points' AND CAST(`value` AS UNSIGNED) > 0 " +
         "ORDER BY CAST(`value` AS UNSIGNED) DESC LIMIT 10",
         .@name$, .@points;
        mes "[Top 10 Skull Points]";
        for (set .@i,0; .@i<getarraysize(.@name$); set .@i,.@i+1) {
            mes (.@i+1) +". ^0000FF"+ .@name$[.@i] +"^000000 ("+ .@points[.@i] +((.@points[.@i]==1)?" pt":" pts")+")";
        }
        break;
    case 2:
        set .@skulls, countitem(.ITEMID_SKULL_);
        if (.@skulls < 1) {
            mes "You don't have any PVP Skulls.";
        } else {
            delitem .ITEMID_SKULL_, .@skulls;
            getitem 7227, .@skulls;
            set skull_points, skull_points + .@skulls;
            dispbottom "Gained "+.@skulls+" skull points. Total = " + skull_points;
        }
        break;
    }
    close;
OnInit:
    // should match /src/map/itemdb.h
    set .ITEMID_SKULL_, 7420;
    end;
}

/?

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...