Jump to content
  • 0

tr0n's questboard


tofubeng

Question


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  05/13/16
  • Last Seen:  

Hi all,

 

I am currently working on tr0n's questboard.

I have tried to edit the script to make the monsters to be random instead.

 

Specific lines are as below:

 

 

setarray .MHuntArray[0],1031,1002,1400,1863;
set .MHuntMob,.MHuntArray[rand(getarraysize(.MHuntArray))];
AddHunting("Test",1,99,1234,1,0,0,0,.MHuntMob,10);

 

 

However, it doesn't seem to random it. It only randoms if i @reloadscript

 

Full script as below:

http://upaste.me/09a32717014d73d09

 

Appreciate if anyone can give me an advice or two on this.

 

Thank you.

setarray .MHuntArray[0],1031,1002,1400,1863;
set .MHuntMob,.MHuntArray[rand(getarraysize(.MHuntArray))];
AddHunting("Test",1,99,1234,1,0,0,0,.MHuntMob,10);
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

That's because it under the OnInit label which is only run on script loading, be to make it random you would need to move that up in the script where a player triggers it.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  05/13/16
  • Last Seen:  

That's because it under the OnInit label which is only run on script loading, be to make it random you would need to move that up in the script where a player triggers it.

 

Hi Stolao,

 

I did as you said actually before this, putting 

 

setarray .MHuntArray[0],1031,1002,1400,1863;
set .MHuntMob,.MHuntArray[rand(getarraysize(.MHuntArray))];
 
right after the script starts. But it seems .MHuntMob is unable to capture the value in AddHunting function that way
Appreciate if you could advise me further.
 
Thanks in advance.
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...