Jump to content
  • 0

How to make RANDOM OPTION weapon effect with more than 1 random option?


rakuzas

Question


  • Group:  Members
  • Topic Count:  152
  • Topics Per Day:  0.04
  • Content Count:  459
  • Reputation:   6
  • Joined:  06/29/12
  • Last Seen:  

Example to get Crimson Weapon with Ghost property:
	// +9 Crimson Dagger [2]
	setarray .@OptID[0],RDMOPT_WEAPON_ATTR_TELEKINESIS;
	setarray .@OptVal[0],0;
	setarray .@OptParam[0],0;
	getitem3 28705,1,1,9,0,0,0,0,0,.@OptID,.@OptVal,.@OptParam;

Hello,

I tried making adding 3 random effect on item.. I already tried many ways to make it random.. But always got no option ID error.. Or sometimes the NPC stuck.. 

I tried giving random 3 effect to player item.. But always fail.. But I can give up to 5 effect but not random.. It just give the 5 in the first line only.. 
 

Below is working.. But limit 2 random per effect only.. How to give it more than 2?

	setarray .@OptID[0],rand (RDMOPT_VAR_AGIAMOUNT,RDMOPT_VAR_MAXHPPERCENT),rand (RDMOPT_VAR_SPACCELERATION,RDMOPT_VAR_PLUSASPD),RDMOPT_VAR_LUKAMOUNT;
	setarray .@OptVal[0],rand (1,3),rand (1,3),rand (1,3),rand (1,3);
	setarray .@OptParam[0],3;
	getitem3 28705,1,1,9,0,0,0,0,0,.@OptID,.@OptVal,.@OptParam;

 

Please guide me.. Thanks..

Edited by rakuzas
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

	setarray .@OptID[0], RDMOPT_WEAPON_ATTR_TELEKINESIS, RDMOPT_VAR_AGIAMOUNT;
	setarray .@OptVal[0], 0,3;
	setarray .@OptParam[0], 0,0;
	getitem3 28705,1,1,9,0,0,0,0,0,.@OptID,.@OptVal,.@OptParam;

should give 2 charms in the item. Fill the arrays.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

4 hours ago, rakuzas said:

Example to get Crimson Weapon with Ghost property:
	// +9 Crimson Dagger [2]
	setarray .@OptID[0],RDMOPT_WEAPON_ATTR_TELEKINESIS;
	setarray .@OptVal[0],0;
	setarray .@OptParam[0],0;
	getitem3 28705,1,1,9,0,0,0,0,0,.@OptID,.@OptVal,.@OptParam;

Hello,

I tried making adding 3 random effect on item.. I already tried many ways to make it random.. But always got no option ID error.. Or sometimes the NPC stuck.. 

I tried giving random 3 effect to player item.. But always fail.. But I can give up to 5 effect but not random.. It just give the 5 in the first line only.. 
 

Below is working.. But limit 2 random per effect only.. How to give it more than 2?


	setarray .@OptID[0],rand (RDMOPT_VAR_AGIAMOUNT,RDMOPT_VAR_MAXHPPERCENT),rand (RDMOPT_VAR_SPACCELERATION,RDMOPT_VAR_PLUSASPD),RDMOPT_VAR_LUKAMOUNT;
	setarray .@OptVal[0],rand (1,3),rand (1,3),rand (1,3),rand (1,3);
	setarray .@OptParam[0],3;
	getitem3 28705,1,1,9,0,0,0,0,0,.@OptID,.@OptVal,.@OptParam;

 

Please guide me.. Thanks..

 Couple of things that jumped out right off the bat...

RDMOPT_VAR_AGIAMOUNT = 4

RMDOPT_VAR_MAXHPPERCENT = 1 ... so you are going backwards in your RAND( 4, 1 ) instead of RAND( 1, 4 )

RDMOPT_VAR_SPACCELERATION 12

RDMOPT_VAR_PLUSASPD 15

So rand(12,15) is correct

and luck amount is by itself so that is ok... 

Next, you are giving 3 attributes (X, Y, and luck)

however in your options array, you are passing 4 values... so that needs to change to 3... 

I couldn't figure out what Param Option does, as all random items didn't see to have something for that...

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  152
  • Topics Per Day:  0.04
  • Content Count:  459
  • Reputation:   6
  • Joined:  06/29/12
  • Last Seen:  

Ahhh.. That just my example.. 

What I want to do is.. Every 1 effect/layer.. We can make more random options rather than my current scripts only support 2.. I tried making array that have more than 2.. But everytime I got error said no optionID.. 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

2 hours ago, rakuzas said:

Ahhh.. That just my example.. 

What I want to do is.. Every 1 effect/layer.. We can make more random options rather than my current scripts only support 2.. I tried making array that have more than 2.. But everytime I got error said no optionID.. 

Would have to see what you are actually trying to do then?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  98
  • Reputation:   74
  • Joined:  12/04/14
  • Last Seen:  

On 8/15/2017 at 10:09 AM, Z3R0 said:

Would have to see what you are actually trying to do then?

 He's trying to say that "getitem3" can only give 1 random option..

He is asking on how to make "getitem3" to give 2 or more random options in one time.

perhaps @Cydh can help coz i am curious too.

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

7 hours ago, Keitenai said:

 He's trying to say that "getitem3" can only give 1 random option..

He is asking on how to make "getitem3" to give 2 or more random options in one time.

perhaps @Cydh can help coz i am curious too.

this thread almost a year and still there's someone who can't understand the doc/script_commands.txt? humanity will be vanished very soon. Thanks Capuche

  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

It can't be, France need to fully celebrate the World Cup victory. Please read carefully the docs @Keitenai.

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