Jump to content
  • 0

Prize Roulette


Evrard

Question


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  03/27/13
  • Last Seen:  

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

  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  763
  • Reputation:   227
  • Joined:  02/11/17
  • Last Seen:  

-	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;
		.@prize = rand(1,2);
			if(.@prize == 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 .@prize rand (1,2){ -> set .@prize, rand(1,2);
  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  03/27/13
  • Last Seen:  

done

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  03/27/13
  • Last Seen:  

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 .@map$, "prontera";
	if(strcharinfo(3)==.@map$){
		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 .@prize rand (1,2){
				if (.@prize == 1) {
					dispbottom "You got the first prize on the Roulette!";
					getitem 2285,1;
					}
				if (.@prize == 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

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  03/27/13
  • Last Seen:  

4 minutes ago, crazyarashi said:

you're wrong in the rand line.


set .@prize rand (1,2){ -> set .@prize, rand(1,2);

Thanks! I was also missing something in the announce lines. xD

 

Its working now!

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