Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Portuguese version
- //Build inspection By Emistry - https://rathena.org/board/topic/57838-show-equip/#entry138108
- //Auction system by Gabriel Barberini (klesler)
- //v 1.0.1
- // Case sensitive solved on line 51 https://rathena.org/board/topic/115559-how-to-deal-with-case-sensitive/ thanks @Pajodex and @AnnieRuru !
- // Solution made for when the victim disconnects or is afk, thank you so much @Pajodex for the insight!
- // The solution made with OnTimer solves also the cancel button scenario
- prontera,163,194,4 script Detetive 10085,{
- // ItemID + Amount
- // ctrl f 'créditos simples' and change for your item's name
- setarray .@Item[0],7420,20;
- // Começo
- if( @NPCBeingUsed == 1 ) {
- mes "O NPC ^FF0000Detetive^000000 já está sendo utilizado no momento";
- mes "Por favor volte mais tarde.";
- close;
- }
- query_sql("DELETE FROM `acc_reg_num` WHERE `key` = X'2356494354494D';"); //anti log out solution
- query_sql("DELETE FROM `acc_reg_num` WHERE `key` = X'235354414C4B4552';"); //anti log out solution
- set @NPCBeingUsed,1;
- mes "[^DD0000 Detetive ^000000]";
- mes "Seja bem vindo!";
- mes "Deseja verificar a build de algum jogador?";
- next;
- switch(prompt("Sim:Não")) {
- Case 1:
- mes "[^DD0000 Detetive ^000000]";
- mes "O preço mínimo é de ^FF0000"+.@Item[1]+" x "+getitemname(.@Item[0])+"^000000";
- mes "Por gentileza informe o nome do jogador(a) a ser verificado.";
- input .@PlayerSpecInputName$;
- next;
- if( countitem(.@Item[0]) < .@Item[1] ) {
- mes "Você não possui ^FF0000Caveiras^000000 suficiente.";
- close;
- } else { mes "Deseja pagar algum ^FF0000"+getitemname(.@Item[0])+"^000000 a mais?"; next; }
- switch(prompt("Sim:Não")) {
- Case 1:
- mes "Insira somente números, ex: 13";
- input .@bid;
- goto Validate;
- Case 2:
- set .@bid,0;
- goto Validate;
- Case 255:
- set @NPCBeingUsed,0;
- close;
- }
- Case 2:
- mes "[^DD0000 Detetive ^000000]";
- mes "Okidoki! Volte quando desejar :)";
- set @NPCBeingUsed,0;
- close;
- Case 255:
- set @NPCBeingUsed,0;
- close;
- }
- Validate:
- set .@cost,(.@Item[1]+.@bid);
- set .@ownName$,strcharinfo(0);
- if( countitem(.@Item[0]) < .@cost ) {
- mes "Você não possui ^FF0000Caveiras^000000 suficiente.";
- set @NPCBeingUsed,0;
- close;
- } else if (compare(.@PlayerSpecInputName$, .@ownName$) && compare(.@ownName$, .@PlayerSpecInputName$)) {
- mes "Você não pode espionar a sí mesmo.";
- set @NPCBeingUsed,0;
- close;
- } else if( !isloggedin( getcharid(3,.@PlayerSpecInputName$) ) ) {
- mes "O jogador não existe ou não está logado no momento.";
- set @NPCBeingUsed,0;
- close;
- } else if( checkidle(.@PlayerSpecInputName$) >= 300) {
- mes "O jogador está AFK no momento.";
- set @NPCBeingUsed,0;
- close;
- } else {
- goto Proceed;
- }
- end;
- Proceed:
- set .@PlayerSpecID,getcharid(3);
- mes "Por favor aguarde...";
- message .@PlayerSpecInputName$,"O jogador "+strcharinfo(0)+" está tentando espionar a sua build por ^FF0000"+.@cost+"^000000 ^FF0000Caveiras^000000.";
- set .@VictimAccountID,getcharid(3,.@PlayerSpecInputName$);
- attachrid( .@VictimAccountID );
- disable_command;
- query_sql("INSERT INTO `acc_reg_num` (`account_id`, `key`, `index`, `value`) VALUES ("+.@PlayerSpecID+", '#STALKER', "+.@Cost+", "+.@Item+");"); // anti log out solution
- query_sql("INSERT INTO `acc_reg_num` (`account_id`, `key`, `index`, `value`) VALUES ("+.@VictimAccountID+", '#VICTIM', '0', '0');"); // anti log out solution
- mes "Deseja pagar "+.@cost+" créditos simples de volta para evitar que ele consiga?";
- initnpctimer;
- switch(prompt("Sim:Não")) {
- Case 1:
- if( countitem(.@Item[0]) < .@cost ) {
- mes "Você não possui ^FF0000Caveiras^000000 suficiente.";
- } else {
- stopnpctimer;
- delitem .@Item[0],.@cost;
- close2;
- attachrid( .@PlayerSpecID );
- delitem .@Item[0],.@cost;
- mes "^DD0000 O jogador pagou o mesmo valor de volta para evitar ter sua build verificada! ^000000";
- break;
- }
- close2;
- goto OnPaying;
- Case 2:
- close2;
- goto OnPaying;
- Case 255:
- goto OnPaying;
- }
- end;
- OnPaying:
- stopnpctimer;
- query_sql("SELECT `account_id` FROM `acc_reg_num` WHERE `key` = '#VICTIM';",.@VictimAccountID); //anti log out solution
- query_sql("SELECT `account_id` FROM `acc_reg_num` WHERE `key` = '#STALKER';",.@PlayerSpecID); //anti log out solution
- query_sql("SELECT `index` FROM `acc_reg_num` WHERE `key` = '#STALKER';",.@cost); //anti log out solution
- query_sql("SELECT `value` FROM `acc_reg_num` WHERE `key` = '#STALKER';",.@Item); //anti log out solution
- attachrid( .@VictimAccountID );
- atcommand "@refresh";
- for( set .@i,1; .@i <= 10; set .@i,.@i + 1 )
- if( getequipid(.@i) > 0 ){
- set .@EquipList[.@i],getequipid(.@i);
- set .@ItemSlot[.@i],getitemslots(getequipid(.@i));
- set .@Refine[.@i],getequiprefinerycnt(.@i);
- set .@Slot_1[.@i],getequipcardid(.@i,0);
- set .@Slot_2[.@i],getequipcardid(.@i,1);
- set .@Slot_3[.@i],getequipcardid(.@i,2);
- set .@Slot_4[.@i],getequipcardid(.@i,3);
- }
- setarray .@Stats[0],readparam(13),readparam(14),readparam(15),readparam(16),readparam(17),readparam(18);
- attachrid( .@PlayerSpecID );
- delitem .@Item,.@cost;
- next;
- set @NPCBeingUsed,0;
- query_sql("DELETE FROM `acc_reg_num` WHERE `key` = X'2356494354494D';"); //anti log out solution
- query_sql("DELETE FROM `acc_reg_num` WHERE `key` = X'235354414C4B4552';"); //anti log out solution
- mes "^FF0000Lista de equipamentos :^000000";
- for( set .@i,1; .@i < getarraysize( .@EquipList ); set .@i,.@i + 1 )
- if( .@EquipList[.@i] ){
- mes "^0055FF"+( (.@Refine[.@i])?"+"+.@Refine[.@i]:"" )+" "+getitemname(.@EquipList[.@i])+" ["+.@ItemSlot[.@i]+"]";
- if( .@Slot_1[.@i] ) mes " ~ ^777777"+getitemname( .@Slot_1[.@i] )+"^000000";
- if( .@Slot_2[.@i] ) mes " ~ ^777777"+getitemname( .@Slot_2[.@i] )+"^000000";
- if( .@Slot_3[.@i] ) mes " ~ ^777777"+getitemname( .@Slot_3[.@i] )+"^000000";
- if( .@Slot_4[.@i] ) mes " ~ ^777777"+getitemname( .@Slot_4[.@i] )+"^000000";
- }
- next;
- setarray .@Stat$[0],"STR","AGI","VIT","INT","DEX","LUK";
- mes "^FF0000Status Build :^000000";
- for( set .@i,0; .@i < getarraysize( .@Stat$ ); set .@i,.@i + 1 )
- mes "^0055FF"+.@Stat$[.@i]+" : ^777777"+.@Stats[.@i]+"^000000";
- close;
- end;
- OnPCLogoutEvent:
- query_sql("SELECT `account_id` FROM `acc_reg_num` WHERE `key` = '#VICTIM';",.@VictimAccountID); //anti log out solution
- query_sql("SELECT `account_id` FROM `acc_reg_num` WHERE `key` = '#STALKER';",.@PlayerSpecID); //anti log out solution
- if ( !isloggedin(.@VictimAccountID) || !isloggedin(.@PlayerSpecID) ) {
- goto OnPaying;
- }
- end;
- OnTimer15000:
- goto OnPaying;
- end;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement