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 post
Share on other sites


This topic is now archived and is closed to further replies.

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