I need to control the rate of each item that this machine will generate
prontera,141,226,4 script Maquina de Promoções 2_DROP_MACHINE,{
mes .npc_n$;
mes "Você precisa de apenas "+.itm_a+" "+.itm_n$+" para poder usar a maquina de promoção.!";
mes "Você gostaria de usar-la..?"; next;
if(select("^0084ff[ • ]^000000 Sim:^CD3278[ • ]^000000 Não:^0084ff[ • ]^000000 O que posso ganhar?")&2) {
if(@menu-2) {
set .@mes$, "Você pode ganhar: ";
for(set(.@a,1);.@a<=.len_i;set(.@a,.@a+1)) {
set .@itm$, getitemname(.itm_l[(.@a-1)]);
if(.@a%10&&.@a<=.len_i&&.@a!=.len_i) {
set .@mes$, .@mes$+((!((.@a%10)-9)&&.@a<=.len_i)?
"and "+.@itm$+".":.@itm$+", ");
} else {
mes .npc_n$;
if(.@a<.len_i) {
mes .@mes$; set .@mes$, "Você também pode ganhar: "+.@itm$+", "; next;
if(select("Seguir:Fechar")&2) close;
} else {
mes .@mes$+"e "+.@itm$+"."; close;
}
}
}
} else close;
}
if (countitem(.itm_p) < .itm_a) {
mes .npc_n$;
mes "Você não tem "+.itm_a+" "+.itm_n$;
close;
}
mes .npc_n$;
mes "Aqui está!";
delitem .itm_p,.itm_a;
set .@get, .itm_l[rand(.len_i-1)];
if(compare(.itm_a$,""+.@get)) announce strnpcinfo(0)+": "+strcharinfo(0)+" Obteve ["+getitemname(.@get)+"] da Máquina de Promoções!",bc_all|bc_yellow;
getitem .@get,1;
close;
OnInit:
set .npc_n$, "[^4B0082Maquina de Promoções^000000]"; //Nome NPC.
setarray .itm_l , 502, 678, 607 ,608 ,508 ,509 ,510 ,2132 ,555;// Lista de Itens
set .itm_a$, "555";//IDs de item nesta cadeia são anunciados.
set .len_i , getarraysize(.itm_l); //Comprimento da matriz.
set .itm_a , 1; //Custo do NPC.
set .itm_p , 7608; //Item usado como moeda.
set .itm_n$, getitemname(.itm_p); //Nome do item.
}
Question
ADM Ytallo
I need to control the rate of each item that this machine will generate
Use codebox next time.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.