Advertisement
Guest User

Untitled

a guest
Jan 17th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.91 KB | None | 0 0
  1. //Portuguese version
  2. //Build inspection By Emistry - https://rathena.org/board/topic/57838-show-equip/#entry138108
  3. //Auction system by Gabriel Barberini (klesler)
  4.  
  5. //v 1.0.1
  6. // Case sensitive solved on line 51 https://rathena.org/board/topic/115559-how-to-deal-with-case-sensitive/ thanks @Pajodex and @AnnieRuru !
  7. // Solution made for when the victim disconnects or is afk, thank you so much @Pajodex for the insight!
  8. // The solution made with OnTimer solves also the cancel button scenario
  9.  
  10. prontera,163,194,4 script Detetive 10085,{
  11. // ItemID + Amount
  12. // ctrl f 'créditos simples' and change for your item's name
  13. setarray .@Item[0],7420,20;
  14.  
  15. // Começo
  16. if( @NPCBeingUsed == 1 ) {
  17. mes "O NPC ^FF0000Detetive^000000 já está sendo utilizado no momento";
  18. mes "Por favor volte mais tarde.";
  19. close;
  20. }
  21. query_sql("DELETE FROM `acc_reg_num` WHERE `key` = X'2356494354494D';"); //anti log out solution
  22. query_sql("DELETE FROM `acc_reg_num` WHERE `key` = X'235354414C4B4552';"); //anti log out solution
  23. set @NPCBeingUsed,1;
  24. mes "[^DD0000 Detetive ^000000]";
  25. mes "Seja bem vindo!";
  26. mes "Deseja verificar a build de algum jogador?";
  27. next;
  28.  
  29. switch(prompt("Sim:Não")) {
  30. Case 1:
  31. mes "[^DD0000 Detetive ^000000]";
  32. mes "O preço mínimo é de ^FF0000"+.@Item[1]+" x "+getitemname(.@Item[0])+"^000000";
  33. mes "Por gentileza informe o nome do jogador(a) a ser verificado.";
  34. input .@PlayerSpecInputName$;
  35. next;
  36. if( countitem(.@Item[0]) < .@Item[1] ) {
  37. mes "Você não possui ^FF0000Caveiras^000000 suficiente.";
  38. close;
  39. } else { mes "Deseja pagar algum ^FF0000"+getitemname(.@Item[0])+"^000000 a mais?"; next; }
  40. switch(prompt("Sim:Não")) {
  41. Case 1:
  42. mes "Insira somente números, ex: 13";
  43. input .@bid;
  44. goto Validate;
  45. Case 2:
  46. set .@bid,0;
  47. goto Validate;
  48. Case 255:
  49. set @NPCBeingUsed,0;
  50. close;
  51. }
  52.  
  53. Case 2:
  54. mes "[^DD0000 Detetive ^000000]";
  55. mes "Okidoki! Volte quando desejar :)";
  56. set @NPCBeingUsed,0;
  57. close;
  58. Case 255:
  59. set @NPCBeingUsed,0;
  60. close;
  61. }
  62.  
  63. Validate:
  64. set .@cost,(.@Item[1]+.@bid);
  65. set .@ownName$,strcharinfo(0);
  66.  
  67. if( countitem(.@Item[0]) < .@cost ) {
  68. mes "Você não possui ^FF0000Caveiras^000000 suficiente.";
  69. set @NPCBeingUsed,0;
  70. close;
  71. } else if (compare(.@PlayerSpecInputName$, .@ownName$) && compare(.@ownName$, .@PlayerSpecInputName$)) {
  72. mes "Você não pode espionar a sí mesmo.";
  73. set @NPCBeingUsed,0;
  74. close;
  75. } else if( !isloggedin( getcharid(3,.@PlayerSpecInputName$) ) ) {
  76. mes "O jogador não existe ou não está logado no momento.";
  77. set @NPCBeingUsed,0;
  78. close;
  79. } else if( checkidle(.@PlayerSpecInputName$) >= 300) {
  80. mes "O jogador está AFK no momento.";
  81. set @NPCBeingUsed,0;
  82. close;
  83. } else {
  84. goto Proceed;
  85. }
  86. end;
  87.  
  88. Proceed:
  89. set .@PlayerSpecID,getcharid(3);
  90. mes "Por favor aguarde...";
  91. message .@PlayerSpecInputName$,"O jogador "+strcharinfo(0)+" está tentando espionar a sua build por ^FF0000"+.@cost+"^000000 ^FF0000Caveiras^000000.";
  92. set .@VictimAccountID,getcharid(3,.@PlayerSpecInputName$);
  93. attachrid( .@VictimAccountID );
  94. disable_command;
  95. query_sql("INSERT INTO `acc_reg_num` (`account_id`, `key`, `index`, `value`) VALUES ("+.@PlayerSpecID+", '#STALKER', "+.@Cost+", "+.@Item+");"); // anti log out solution
  96. query_sql("INSERT INTO `acc_reg_num` (`account_id`, `key`, `index`, `value`) VALUES ("+.@VictimAccountID+", '#VICTIM', '0', '0');"); // anti log out solution
  97. mes "Deseja pagar "+.@cost+" créditos simples de volta para evitar que ele consiga?";
  98. initnpctimer;
  99. switch(prompt("Sim:Não")) {
  100. Case 1:
  101. if( countitem(.@Item[0]) < .@cost ) {
  102. mes "Você não possui ^FF0000Caveiras^000000 suficiente.";
  103. } else {
  104. stopnpctimer;
  105. delitem .@Item[0],.@cost;
  106. close2;
  107. attachrid( .@PlayerSpecID );
  108. delitem .@Item[0],.@cost;
  109. mes "^DD0000 O jogador pagou o mesmo valor de volta para evitar ter sua build verificada! ^000000";
  110. break;
  111. }
  112. close2;
  113. goto OnPaying;
  114.  
  115. Case 2:
  116. close2;
  117. goto OnPaying;
  118.  
  119. Case 255:
  120. goto OnPaying;
  121. }
  122. end;
  123.  
  124. OnPaying:
  125. stopnpctimer;
  126. query_sql("SELECT `account_id` FROM `acc_reg_num` WHERE `key` = '#VICTIM';",.@VictimAccountID); //anti log out solution
  127. query_sql("SELECT `account_id` FROM `acc_reg_num` WHERE `key` = '#STALKER';",.@PlayerSpecID); //anti log out solution
  128. query_sql("SELECT `index` FROM `acc_reg_num` WHERE `key` = '#STALKER';",.@cost); //anti log out solution
  129. query_sql("SELECT `value` FROM `acc_reg_num` WHERE `key` = '#STALKER';",.@Item); //anti log out solution
  130. attachrid( .@VictimAccountID );
  131. atcommand "@refresh";
  132. for( set .@i,1; .@i <= 10; set .@i,.@i + 1 )
  133. if( getequipid(.@i) > 0 ){
  134. set .@EquipList[.@i],getequipid(.@i);
  135. set .@ItemSlot[.@i],getitemslots(getequipid(.@i));
  136. set .@Refine[.@i],getequiprefinerycnt(.@i);
  137. set .@Slot_1[.@i],getequipcardid(.@i,0);
  138. set .@Slot_2[.@i],getequipcardid(.@i,1);
  139. set .@Slot_3[.@i],getequipcardid(.@i,2);
  140. set .@Slot_4[.@i],getequipcardid(.@i,3);
  141. }
  142. setarray .@Stats[0],readparam(13),readparam(14),readparam(15),readparam(16),readparam(17),readparam(18);
  143. attachrid( .@PlayerSpecID );
  144. delitem .@Item,.@cost;
  145. next;
  146. set @NPCBeingUsed,0;
  147. query_sql("DELETE FROM `acc_reg_num` WHERE `key` = X'2356494354494D';"); //anti log out solution
  148. query_sql("DELETE FROM `acc_reg_num` WHERE `key` = X'235354414C4B4552';"); //anti log out solution
  149. mes "^FF0000Lista de equipamentos :^000000";
  150. for( set .@i,1; .@i < getarraysize( .@EquipList ); set .@i,.@i + 1 )
  151. if( .@EquipList[.@i] ){
  152. mes "^0055FF"+( (.@Refine[.@i])?"+"+.@Refine[.@i]:"" )+" "+getitemname(.@EquipList[.@i])+" ["+.@ItemSlot[.@i]+"]";
  153. if( .@Slot_1[.@i] ) mes " ~ ^777777"+getitemname( .@Slot_1[.@i] )+"^000000";
  154. if( .@Slot_2[.@i] ) mes " ~ ^777777"+getitemname( .@Slot_2[.@i] )+"^000000";
  155. if( .@Slot_3[.@i] ) mes " ~ ^777777"+getitemname( .@Slot_3[.@i] )+"^000000";
  156. if( .@Slot_4[.@i] ) mes " ~ ^777777"+getitemname( .@Slot_4[.@i] )+"^000000";
  157. }
  158. next;
  159. setarray .@Stat$[0],"STR","AGI","VIT","INT","DEX","LUK";
  160. mes "^FF0000Status Build :^000000";
  161. for( set .@i,0; .@i < getarraysize( .@Stat$ ); set .@i,.@i + 1 )
  162. mes "^0055FF"+.@Stat$[.@i]+" : ^777777"+.@Stats[.@i]+"^000000";
  163. close;
  164. end;
  165.  
  166. OnPCLogoutEvent:
  167. query_sql("SELECT `account_id` FROM `acc_reg_num` WHERE `key` = '#VICTIM';",.@VictimAccountID); //anti log out solution
  168. query_sql("SELECT `account_id` FROM `acc_reg_num` WHERE `key` = '#STALKER';",.@PlayerSpecID); //anti log out solution
  169. if ( !isloggedin(.@VictimAccountID) || !isloggedin(.@PlayerSpecID) ) {
  170. goto OnPaying;
  171. }
  172. end;
  173.  
  174. OnTimer15000:
  175. goto OnPaying;
  176. end;
  177.  
  178. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement