pastebin - collaborative debugging tool
rathena.kpaste.net RSS


Emp Break Ladder
Posted by Anonymous on Sun 10th Feb 2013 07:05
raw | new post

  1. // http://rathena.org/board/topic/78486-breaker-rankings-npc/
  2. // NPC that:
  3. // - displays top 10 emperium breaker (Rank, Char Name, Guild Name, Breaker Points)
  4. // - when a player was the last to break the emp after the WoE he will get 1 point
  5. // - selection which enables the player to trade their points into TCG (item id: 7227)
  6. // but their break points are still displayed
  7.  
  8. prontera,155,188,0      script  Emp Break Ladder        910,{
  9.         switch(select("View Emp Break Ladder:Redeem points for TCG:More Info")) {
  10.         case 1:
  11.                 query_sql "SELECT `char`.`name`, guild.`name`, CAST(`value` AS UNSIGNED) " +
  12.                           "FROM global_reg_value " +
  13.                           "LEFT JOIN `char` ON global_reg_value.char_id=`char`.char_id " +
  14.                           "LEFT JOIN `guild` ON `char`.guild_id=guild.guild_id " +
  15.                           "WHERE global_reg_value.`str`='breaker_points' " +
  16.                           "ORDER BY CAST(`value` AS UNSIGNED) DESC LIMIT 10",
  17.                           .@name$, .@guild$, .@points;
  18.                 mes "[Top 10 Emp Breakers]";
  19.                 for (set .@i,0; .@i<getarraysize(.@name$); set .@i,.@i+1) {
  20.                         mes (.@i+1) +". ^0000FF"+ .@name$[.@i] +"^000000, "+ .@guild$[.@i] +" ("+ .@points[.@i] +((.@points[.@i]==1)?" pt":" pts")+")";
  21.                 }
  22.                 break;
  23.         case 2:
  24.                 mes "[Emp Break Ladder]";
  25.                 mes "Total Emp Breaks: " + breaker_points;
  26.                 mes "Available Points: " + (breaker_points - breaker_tcg);
  27.                
  28.                 if (breaker_points == 0) {
  29.                         mes "You have not broke the emp yet!";
  30.                 } else if (breaker_points <= breaker_tcg) {
  31.                         mes "You've already exchanged all your points for TCG.";
  32.                         mes "Come back after you break the emp again!";
  33.                 } else {
  34.                         set .@reward, breaker_points - breaker_tcg;
  35.                         if (select("Redeem points for "+.@reward+" TCG:Cancel") == 2) {
  36.                                 mes "Come back if you change your mind.";
  37.                         } else if (checkweight(7227, .@reward) == 0) {
  38.                                 mes "You are overweight or carrying too many items.";
  39.                         } else {
  40.                                 getitem 7227, .@reward;
  41.                                 set breaker_tcg, breaker_tcg + .@reward
  42.                                 mes "Here are your "+.@reward+" TCG!";
  43.                         }
  44.                 }
  45.                 break;
  46.         case 3:
  47.                 mes "[Emp Break Ladder]";
  48.                 mes "Each time you break the emp, you earn 1 point.";
  49.                 mes "Then, talk to me to redeem your point(s) for TCG.";
  50.                 break;
  51.         }
  52.         close;
  53. }

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at