Dear All,
I took and modify the script below for gacha pull @500.000 z for each pull and gain reward as described.
I want to modify the npc so we can customize the number of pull and charged based on the number of pull
Need to add check of the zeny as well to check if zeny amount owned is sufficient.
So the flow will be
npc init -> show the dialog -> how many pull ? -> Insert number -> Check zeny -> Give reward based on how many pull
I hope anyone can help to modify the script or you also may contribute to revamp the script.
xxx,167,163,4 script Lotto 72,{
mes "[Lotto]";
mes "I'm Lotto! I'll exchange";
mes "Random Prizes for every";
mes "^ff0000500,000 zeny^000000.";
next;
mes "[Lotti Girl]";
mes "Our Grand prize is:";
mes "^ff0000 x1 TCG Card^000000";
mes "^ff0000 x1 Costume set^000000";
mes "Consolations are:";
mes "^ff0000 x?? Gold Coin^000000";
mes "^ff0000 x?? Gold^000000";
mes "^ff0000 x?? Treasure Box^000000";
mes "^ff0000 x?? Oridecon^000000";
mes "^ff0000 x?? Elunium^000000";
mes "And many more!!";
if (Zeny < 500000)
close;
next;
if(select("Let's Do This!!:No thanks...")==2) close;
mes "[Lotti Girl]";
mes "Here we go...";
set Zeny, Zeny - 500000;
set .@Total,15;
//<%>,<ItemID>,<Amount>
setarray .@P1[0],1,35031,1; //demoniac mid
setarray .@P2[0],1,35081,1; //demoniac upper
setarray .@P3[0],1,35099,1; //demoniac low
setarray .@P4[0],2,7227,1; //tcg
setarray .@P5[0],5,7539,rand(1,2); //diablocoin
setarray .@P6[0],8,969,rand(1,3); //gold
setarray .@P7[0],10,604,rand(1,3); //deadbranch
setarray .@P8[0],8,7444,rand(1,3); //treasurebox
setarray .@P9[0],8,12208,rand(1,2); //battle manual
setarray .@P10[0],20,985,rand(3,8); //elu
setarray .@P11[0],25,7063,rand(2,5); //alice apron
setarray .@P12[0],25,7047,rand(2,5); // soft feather
setarray .@P13[0],20,984,rand(3,8); //ori
setarray .@P14[0],15,748,rand(1,3); //witherless
setarray .@Default[0],rand(901,926),rand(5,15);
set .@i, rand(1,.@Total);
if (rand(1,100) > getd(".@P"+.@i+"[0]"))
{
for(set .@j,0; .@j<getarraysize(.@Default); set .@j,.@j+2)
{
getitem .@Default[.@j], .@Default[.@j+1];
if(!.@k[0])
setarray .@k[0], .@Default[.@j], .@Default[.@j+1];
}
}
else{
for(set .@j,1; .@j<getarraysize(getd(".@P"+.@i)); set .@j,.@j+2)
{
getitem getd(".@P"+.@i+"["+.@j+"]"), getd(".@P"+.@i+"["+(.@j+1)+"]");
if (!.@k[0])
{
set .@gz,.@i;
setarray .@k[0], getd(".@P"+.@i+"["+.@j+"]"), getd(".@P"+.@i+"["+(.@j+1)+"]");
break;
}
}
}
if(1<=.@gz&&.@gz<=4)
announce "Hey! "+strcharinfo(0)+" just received "+getitemname(.@k[0])+" x "+.@k[1]+" from Lotti Girl!",0;
specialeffect2 248;
close;
OnInit:
delwaitingroom;
waitingroom "Try your Luck?",0;
end;
}