johnlol

card_seller

May 4th, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //===== rAthena Script =======================================
  2. //= Card Seller A-Z
  3. //===== By: ==================================================
  4. //= AnnieRuru
  5. //===== Current Version: =====================================
  6. //= 1.0
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= Sells all cards dropped by mobs, grouped alphabetically.
  11. //= MVP cards are excluded from the list.
  12. //=
  13. //= NOTE: Requires SQL item and mob databases.
  14. //===== Additional Comments: =================================
  15. //= 1.0 First version, edited. [Euphy]
  16. //============================================================
  17.  
  18. prontera,155,177,5  script  Card Seller 100,{
  19.     mes "[Card Seller]";
  20.     mes "Welcome!";
  21.     mes "I can sell you any normal monster card in the game. Would you like to have a look?";
  22.     next;
  23.     .@s = select( .alphabet_menu$ ) -1;
  24.     close2;
  25.     callshop "card_mob#"+ .alphabet$[.@s], 1;
  26.     end;
  27. OnInit:
  28.     if (checkre(0)) {
  29.         .@mob_db$  = "mob_db_re";
  30.         .@item_db$ = "item_db_re";
  31.     } else {
  32.         .@mob_db$  = "mob_db";
  33.         .@item_db$ = "item_db";
  34.     }
  35.     freeloop 1;
  36.     .@total = query_sql( "SELECT DISTINCT LEFT( `name_japanese`, 1 ) AS alphabets FROM `"+ .@item_db$ +"` RIGHT JOIN `"+ .@mob_db$ +"` ON `"+ .@item_db$ +"`.`id` = `"+ .@mob_db$ +"`.`dropcardid` WHERE ~(`MODE`) & 32 AND `type` = 6 GROUP BY `name_japanese` ORDER BY alphabets;", .alphabet$ );
  37.     for ( .@i = 0; .@i < .@total; .@i++ ) {
  38.         .alphabet_menu$ = .alphabet_menu$ + .alphabet$[.@i] +" Cards:";
  39.         .@nb = query_sql( "SELECT `"+ .@item_db$ +"`.`id` FROM `"+ .@item_db$ +"` RIGHT JOIN `"+ .@mob_db$ +"` ON `"+ .@item_db$ +"`.`id` = `"+ .@mob_db$ +"`.`dropcardid` WHERE ~(`MODE`) & 32 AND `type` = 6 AND LEFT( `name_japanese`, 1 ) = '"+ .alphabet$[.@i] +"' GROUP BY `name_japanese` ORDER BY `name_japanese` LIMIT 128;", .@id );
  40.         npcshopdelitem "card_mob#"+ .alphabet$[.@i], 501;
  41.         for ( .@j = 0; .@j < .@nb; .@j++ )
  42.             npcshopadditem "card_mob#"+ .alphabet$[.@i], .@id[.@j], 1000000;
  43.     }
  44.     freeloop 0;
  45.     end;
  46. }
  47. -   shop    card_mob#-1,501:1000
  48. -   shop    card_mob#-1,501:1000
  49. -   shop    card_mob#-1,501:1000
  50. -   shop    card_mob#-1,501:1000
  51. -   shop    card_mob#-1,501:1000
  52. -   shop    card_mob#-1,501:1000
  53. -   shop    card_mob#-1,501:1000
  54. -   shop    card_mob#-1,501:1000
  55. -   shop    card_mob#-1,501:1000
  56. -   shop    card_mob#-1,501:1000
  57. -   shop    card_mob#-1,501:1000
  58. -   shop    card_mob#-1,501:1000
  59. -   shop    card_mob#-1,501:1000
  60. -   shop    card_mob#-1,501:1000
  61. -   shop    card_mob#-1,501:1000
  62. -   shop    card_mob#-1,501:1000
  63. -   shop    card_mob#-1,501:1000
  64. -   shop    card_mob#-1,501:1000
  65. -   shop    card_mob#-1,501:1000
  66. -   shop    card_mob#-1,501:1000
  67. -   shop    card_mob#-1,501:1000
  68. -   shop    card_mob#-1,501:1000
  69. -   shop    card_mob#-1,501:1000
  70. -   shop    card_mob#-1,501:1000
  71. -   shop    card_mob#-1,501:1000
  72. -   shop    card_mob#-1,501:1000
Add Comment
Please, Sign In to add comment