Jump to content
  • 0
Evrard

Prize Roulette

Question

Hello team!

I was looking to make a script that on a certain map, if you kill monsters, for each mob you kill you get +1 point and once you reach a certain amount of points it triggers a roullete than can warp you out of the map, give something from an item list or set  your score to a different value.

 

So like for example the roullette triggers at 70 points, and it can warp you to prontera give you an item or set your score to 30~50.

 

I'm not asking for the whole script, it's just that I'm not sure which variables to use for this specific task.

 

Thanks in advance!

 

Managed to start it, I'm moving to the support section instead of the request one 😄

Edited by Evrard
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
-	script	Dynamic_Drops	-1,{
OnNPCKillEvent:
	if( strcharinfo(3) == .map$ ){
		if( killedrid == .killed_id ){
			flks++;
			announce "Points +1 ["+ f1ks +"/5]",3;
		}
	if( f1ks >= 5 ){
		flks = 0;
		sc_start sc_INCREASEAGI, 360000,10;
		sc_start sc_BLESSING, 360000,10;
		[email protected] = rand(1,2);
			if([email protected] == 1){
				dispbottom "You got the first prize on the Roulette!";
				getitem 2285,1;
			} else {
				announce "You got the second prize on the Roulette!";
				getitem 16707,1;
			}
		}
	}
	end;
	
OnInit:	
	.map$ = "prontera";
	.killed_id = 1002;
	end;
}

you're wrong in the rand line.

set [email protected] rand (1,2){ -> set [email protected], rand(1,2);
  • Love 1
Link to comment
Share on other sites

  • 0

Hi Guys!

So I got this script working that when you kill X ammount of mobs then you get a prize, but what it's not working is when I try to randomize the reward.

this is what I got:

-	script	DynamicDrop	-1,{
OnNPCKillEvent:		set [email protected]$, "prontera";
	if(strcharinfo(3)[email protected]$){
		if(killedrid==1002){ // and replace the 1002 for any monster ID 
				set f1ks,f1ks +1;// to count +1 kills;
				announce "Points +1 ["+ f1ks +"/5]",3;
			}
		if (f1ks >= 5){
			set f1ks,0; //to reset the counter and buff
			sc_start sc_INCREASEAGI, 360000,10;
			sc_start sc_BLESSING, 360000,10;
			set [email protected] rand (1,2){
				if ([email protected] == 1) {
					dispbottom "You got the first prize on the Roulette!";
					getitem 2285,1;
					}
				if ([email protected] == 2) {
					announce "You got the second prize on the Roulette!";
					getitem 16707,1;
					}
				}
		}
	end;
	}

 

But I can't seem to make it work with multiple rewards and a rand command, can you guys please help me see what I'm doing wrong?

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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.