Jump to content

Generating Random Events For A Quest


Recommended Posts

Simply gets a random number and outputs the quest info.

@vb = rand(1, 4);
echo @content[@vb];

Gives/removes a key depending on certain event
@vz = "rendrilrevant-";//define key prefix
//make sure user cannot retrigger the events
if(!mds_has_rpcq_keys(@vz . "random-event-triggered")){
@vb = rand(1, 4);//generate random number from 1 to 4 inclusive
if(@vb == 2)//event in case of 2
mds_give_rpcq_keys(@vz . "second-event-key");
else if(@vb == 3)//event in case of 3
mds_remove_rpcq_keys(@vz . "third-event-key")
mds_give_rpcq_keys(@vz . "random-event-triggered");
echo @content[@vb];//display event's content
echo "You have already been here...move along."

Sometimes the user might want to retrace their steps to look for clues in the quest where they have been, in that case barring them from revisiting might not be the best choice. But this was a random event, better remember it next time :)

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.

Reply to this topic...

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

  • Forum Statistics

    Total Topics
    Total Posts
  • Recently Browsing

    • No registered users viewing this page.
  • Upcoming Events

    No upcoming events found
  • Recent Event Reviews

  • Create New...