Jump to content
  • 0

Lotti Girl Limit of Player Use


itsmeyoe

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  54
  • Reputation:   1
  • Joined:  05/19/12
  • Last Seen:  

I want this script to be like this

Each players can use this NPC 10x every 24 hours after that it will reload again to 0/10 then

when you click the npc it will show Lotti Girl Use 10/10 after you use it. 

Next it will say 

You can't use Lotti Girl now comeback tomorrow.

 



prontera,163,193,5 script Lotti Girl 719,{
mes "[Lotti Girl]";
mes "It costs ["+.Price+"] Zeny to play.";
mes "This are the list of prizes:";
mes "1 Bronze Coin, 1 Silver Coin, 1 Gold Coin, 1 Mithril Coin, 2 Convex Mirror and 3 TCG for the JACKPOT!";
if (Zeny < .Price) end;
next;
if(select("Deal me in!:No way...")==2) end;
mes "[Lotti Girl]";
mes "Here we go...";
progressbar "",2;
set Zeny, Zeny-.Price;
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]) setarray .@k[0], getd(".P"+.@i+"["+.@j+"]"), getd(".P"+.@i+"["+(.@j+1)+"]"); } }
//announce "Congratulations to "+strcharinfo(0)+" for getting "+.@k[1]+"x "+getitemname(.@k[0])+"!",0;
specialeffect2 248;
end;
OnInit:
// Format: <%>,<item ID>,<count>{,...};
setarray .P1[0],50,675,1; //Baphomet Card 1 PC 50%
setarray .P2[0],50,671,1; //Alice Apron 50%
setarray .P3[0],50,674,1; //Cursed Baphomet Doll 5 pcs 40%
setarray .P4[0],2,7199,10; //Berry Ticket
setarray .P4[0],2,7227,3; //TCG
//setarray .P5[0],2,12214,3; //Convex Mirror 1pc
setarray .Default[0],673,1; //convex mirror default 1pcs
//setarray .Cost[0],6242,1; // 1pcs Woe coinrequired para makalaro sa lotti
.Price = 10000000;
set .Total,8;
end;
}

Edited by Emistry
Please use CODEBOX.
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   345
  • Joined:  02/26/12
  • Last Seen:  

Not tested, but something like that (below)

prontera,163,193,5 script Lotti Girl 719,{

	if( lotti_doll_timeout < gettimetick(0) ) {
		lotti_doll_counter = 0;
	}

	if( lotti_doll_counter > 10 ) {
		mes "[Lotti Girl]";
		mes "Lotti Girl Use 10/10";
		mes "Limit reached, please try at next day";
		close;
	}

	mes "[Lotti Girl]";
	mes "It costs ["+.Price+"] Zeny to play.";
	mes "This are the list of prizes:";
	mes "1 Bronze Coin, 1 Silver Coin, 1 Gold Coin, 1 Mithril Coin, 2 Convex Mirror and 3 TCG for the JACKPOT!";

	if (Zeny < .Price)
		end;

	next;

	if(select("Deal me in!","No way...")==2)
		end;

	mes "[Lotti Girl]";
	mes "Here we go...";

	progressbar "",2;
	set Zeny, Zeny-.Price;

	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]) setarray .@k[0], getd(".P"+.@i+"["+.@j+"]"), getd(".P"+.@i+"["+(.@j+1)+"]");
		}
	}
	//announce "Congratulations to "+strcharinfo(0)+" for getting "+.@k[1]+"x "+getitemname(.@k[0])+"!",0;
	specialeffect2 248;
	lotti_doll_counter++;
	lotti_doll_timeout = gettimetick(0) + 60 * 60 * 24;
	end;

OnInit:
	// Format: <%>,<item ID>,<count>{,...};
	setarray .P1[0],50,675,1; //Baphomet Card 1 PC 50%
	setarray .P2[0],50,671,1;  //Alice Apron 50%
	setarray .P3[0],50,674,1; //Cursed Baphomet Doll 5 pcs 40%
	setarray .P4[0],2,7199,10; //Berry Ticket
	setarray .P4[0],2,7227,3; //TCG
	//setarray .P5[0],2,12214,3; //Convex Mirror 1pc
	setarray .Default[0],673,1; //convex mirror default 1pcs
	//setarray .Cost[0],6242,1; // 1pcs Woe coinrequired para makalaro sa lotti
	.Price = 10000000;
	set .Total,8;
	end;
}


Main logic: every time when player uses this npc services, his counter increased + setted new nexttime timer.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...