Advertisement
Guest User

fidelidae

a guest
Jul 6th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. - script fidelidade -1,{
  2.  
  3. OnInit:
  4. bindatcmd "fidelidade",strnpcinfo(3)+"::Onfidelidade";
  5.  
  6. setarray .Currency[1],507;
  7. setarray .Shop1[0],12210,1,12208,1,12103,5;
  8. setarray .Shop2[0],5518,300,5374,300,2202,100;
  9.  
  10. set .@i,1;
  11. while (.@i <= getarraysize(.Currency)) {
  12. set .@j,0;
  13. while (.@j < getarraysize(getd(".Shop"+.@i))) {
  14. npcshopdelitem "presenceshop"+.@i,512;
  15. npcshopadditem "presenceshop"+.@i, getd(".Shop"+.@i+"["+.@j+"]"), getd(".Shop"+.@i+"["+(.@j+1)+"]");
  16. set .@j, .@j+2; }
  17. set .@i, .@i+1; }
  18. end;
  19.  
  20. }
  21.  
  22. - shop presenceshop -1,512:-1
  23.  
  24. Onfidelidade:{
  25. mes "[Sistema de Fidelidade]";
  26. mes ""+strcharinfo(0)+", bem-vind"+(Sex?"o":"a")+" ao sistema de fidelidade.";
  27. mes "O que deseja fazer hoje?";
  28. switch(select("Marcar Fidelidade:Trocar meus pontos:Informações:Sair"))
  29. {
  30. case 1:
  31. next;
  32. set @n1, rand(1,9);
  33. set @n2, rand(1,9);
  34. set @n3, rand(1,9);
  35. set @n4, rand(1,9);
  36. set @numero, @n1*1000+@n2*100+@n3*10+@n4;
  37.  
  38. mes "[Sistema de Fidelidade]";
  39. mes "Quais numeros aparecem aqui?";
  40. mes "---->[ "+@n1+" "+@n2+" "+@n3+" "+@n4+" ]<----";
  41. input @respnum;
  42. next;
  43. mes "[Sistema de Fidelidade]";
  44. if(@respnum == @numero){
  45. mes "Você acertou as respostas!";
  46. mes "Desculpe o inconveniente.";
  47. }
  48. if(@respnum != @numero){
  49. mes "Você NÃO acertou as respostas!";
  50. close;
  51. }
  52. next;
  53.  
  54. mes "[Sistema de Fidelidade]";
  55.  
  56. if(!#counting)
  57. {
  58. set #online_time, gettimetick(2) + $time;
  59. set #counting,1;
  60. mes "Tempo marcado, volte dentro de "+((#online_time-gettimetick(2))/60)+" minuto(s)!";
  61. close2;
  62. dispbottom "Para verificar o tempo que resta, mande uma MP para npc:"+strnpcinfo(1)+".";
  63. end;
  64. }
  65. if(#online_time >= gettimetick(2))
  66. {
  67. mes "Você ainda deve aguardar "+((#online_time-gettimetick(2))/60)+" minuto(s).";
  68. close;
  69. }
  70. mes "Receba agora seu ponto de presença.";
  71. set #point_presence,#point_presence + $point;
  72. set #counting,0;
  73. close;
  74.  
  75. case 2:
  76. close2;
  77. set @s, select("Utilidades");
  78. message strcharinfo(0),"Esta loja só aceita Pontos Fidelidade.";
  79. dispbottom "Você tem "+$point+" de fidelidade.";
  80. callshop "presenceshop"+@s,1;
  81. npcshopattach "presenceshop"+@s;
  82. end;
  83.  
  84. case 3:
  85. next;
  86. mes "[Sistema de Fidelidade]";
  87. mes "Aqui você poderá ganhar pontos por tempo online no servidor.";
  88. next;
  89. mes "[Sistema de Fidelidade]";
  90. mes "A cada "+$time/60+" minutos, você ganhará "+$point+" ponto(s).";
  91. next;
  92. mes "[Sistema de Fidelidade]";
  93. mes "Você pode trocar os pontos acumulados por itens.";
  94. mes "Aproveite!";
  95. close;
  96.  
  97. case 4:
  98. close;
  99. }
  100.  
  101. OnWhisperGlobal:
  102. if(!#counting)
  103. {
  104. dispbottom "Você ainda não marcou sua presença.";
  105. end;
  106. }
  107. dispbottom "Faltam ainda "+((#online_time-gettimetick(2))/60)+" minuto(s).";
  108. end;
  109.  
  110. OnPCLogoutEvent:
  111. if(#counting == 1)
  112. {
  113. if(checkvending(strcharinfo(0)))
  114. {
  115. set #counting,0;
  116. }
  117. set #offline_time,#online_time - gettimetick(2);
  118. end;
  119. }
  120.  
  121. OnPCLoginEvent:
  122. if(#counting == 1)
  123. {
  124. set #online_time, gettimetick(2) + #offline_time;
  125. end;
  126. }
  127.  
  128. if(!$new_time) { set $time,3600; }
  129. if(!$new_point) { set $point,1; }
  130. end;
  131. }
  132. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement