Advertisement
johnlol

GMPrize

Aug 9th, 2023
1,067
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VeriLog 3.27 KB | Gaming | 0 0
  1. //======Name========================================
  2. // Event Reward Giver
  3. //======Version=====================================
  4. // 0.9 (Untested)
  5. // Authors: UnoDelta, Sandbox
  6. //======Comments====================================
  7. // In loving memory of AstralRO
  8. //==================================================
  9. /*
  10. Tabela SQL:
  11. CREATE TABLE evt_prize(rwd_time varchar(255),player varchar(255),item_id varchar(255),amount varchar(255),gm_name varchar(255));
  12. */
  13. prt_in,279,139,4    script  Event Reward    563,{
  14.  
  15. set .npcname$,"[ Event Reward ]";
  16. if (getgroupid() < 4){end;}
  17.  
  18. mes .npcname$;
  19. mes "Hello "+strcharinfo(0)+", How can I help you?";
  20. menu "-Give Reward",N_Name,"-Nothing",-;
  21. next;
  22. mes .npcname$;
  23. mes "Alright! See you soon.";
  24. close;
  25.  
  26. N_Name:
  27. next;
  28. mes .npcname$;
  29. mes "Please tell me the name of the player:";
  30. input .@Rew_Name$;
  31. next;
  32. query_sql "SELECT `online` FROM `char` WHERE `name`='"+.@Rew_Name$+"'",.@charstatus; //STATUS CHECK (ONLINE/OFFLINE)
  33. if (.@charstatus == 0) {
  34. mes .npcname$;
  35. mes "Char Name: "+.@Rew_Name$+".";
  36. mes "Char Status: ^FF0000OFFLINE^000000";
  37. mes "";
  38. mes "You cannot proceed.";
  39. menu "-Try Again",N_Name,"-Cancel",-;
  40. next;
  41. mes .npcname$;
  42. mes "Your action was canceled.";
  43. set .@loop,0;
  44. close;}
  45.  
  46. if (.@charstatus == 1) {
  47. mes .npcname$;
  48. mes "Char Name: "+.@Rew_Name$+".";
  49. mes "Char Status: ^009F00ONLINE^000000";
  50. mes "";
  51. mes "You may proceed.";
  52. if (.@loop == 1) {goto N_End;}
  53. goto N_Item;}
  54.  
  55. N_Item:
  56. next;
  57. mes .npcname$;
  58. mes "Please input the item ID to be given:";
  59. mes "^FF0000*Note that only item ID's will be accepted.^000000";
  60. input .@Rew_Item;
  61. if (.@Rew_Item <= 500) {goto N_Item;}
  62. set .@itemname$,getitemname(.@Rew_Item);
  63. if (.@loop == 1) {goto N_End;}
  64. goto N_Amt;
  65.  
  66. N_Amt:
  67. next;
  68. mes .npcname$;
  69. mes "Please input the amount of the reward.";
  70. input .@Rew_Amt;
  71. if (.@Rew_Amt == 0) {goto N_Amt;}
  72. goto N_End;
  73.  
  74. N_End:
  75. next;
  76. query_sql "SELECT `online` FROM `char` WHERE `name`='"+.@Rew_Name$+"'",.@charstatus; //STATUS CHECK (ONLINE/OFFLINE)
  77. if (.@charstatus == 0) {
  78. mes .npcname$;
  79. mes "Char Name: "+.@Rew_Name$+".";
  80. mes "Char Status: ^FF0000OFFLINE^000000";
  81. mes "Item Name: "+.@itemname$+".";
  82. mes "Item Amount: "+.@Rew_Amt+".";
  83. mes "";
  84. mes "You cannot proceed. Character is Offline.";
  85. menu "-Try Again",N_Name,"-Cancel",-;
  86. next;
  87. mes .npcname$;
  88. mes "Your action was canceled.";
  89. set .@loop,0;
  90. close;}
  91.  
  92. if (.@charstatus == 1) {
  93. mes .npcname$;
  94. mes "Char Name: "+.@Rew_Name$+".";
  95. mes "Char Status: ^009F00ONLINE^000000";
  96. mes "Item Name: "+.@itemname$+".";
  97. mes "Item Amount: "+.@Rew_Amt+".";
  98. mes "";
  99. mes "You may proceed. Confirm Reward?";
  100. set .@loop,1;
  101. menu "-Confirm",R_Proc,"-Change Name",N_Name,"-Change Item",N_Item,"-Change Amount",N_Amt,"-Cancel",-;
  102. next;
  103. mes .npcname$;
  104. mes "Your action was cancelled.";
  105. set .@loop,0;
  106. close;}
  107.  
  108. R_Proc:
  109. next;
  110. set .@Rew_GM$,strcharinfo(0);
  111. set .@Rew_Time$,gettimestr("%Y-%m/%d %H:%M:%S",21);
  112. query_sql "INSERT INTO `evt_prize` VALUES('"+.@Rew_Time$+"','"+.@Rew_Name$+"','"+.@Rew_Item+"','"+.@Rew_Amt+"','"+.@Rew_GM$+"')";
  113. getitem .@Rew_Item, .@Rew_Amt,getcharid(3, .@Rew_Name$);
  114. announce "[Event GM] "+strcharinfo(0)+" has rewarded "+.@Rew_Amt+" "+.@itemname$+" to "+.@Rew_Name$+".",bc_all,0xFF8080;
  115. mes .npcname$;
  116. mes "You have given your reward.";
  117. set .@loop,0;
  118. close;
  119. }
  120.  
  121.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement