Informations
Jump to content

Lorem Ipsum...

Click to Dismiss this Notification
Ładowanie danych...

Recommended Posts

Hello there!

As requested in the discussions section, I’m excited to share a beginner-friendly tutorial on quest creation. Feel free to point out any mistakes or enhancements in the comments below. Together, we can compile a comprehensive "book" of tutorials contributed by various users.

Let’s get started!


Understanding Quest Structure

I'll denote every variable you can customize as <variable>.

The first essential line to include in any quest is as follows (remember, Lua requires you to close most structures with "end"):

 
This is the hidden content, please

For the initial setup, let’s create the first state of the quest. A state functions similarly to a chapter, and you should always start with the state labeled "start." Be sure to close it with "end" as shown below:

 
This is the hidden content, please

Now, let's move on to adding events.

Available Actions and Descriptions

Here’s a list of possible actions you can integrate into your quests:

  • kill: Triggered whenever a player defeats a monster or another player.
  • party_kill: Activated when you or a member of your party defeats a monster or another player.
  • enter (you can also use "letter" here): Triggered when transitioning into a state (more details later).
  • leave: Triggered when transitioning out of a state.
  • <mobvnum>.chat."<message>": Activates when clicking on the NPC with <mobvnum> and selecting <message> in the quest window.
  • <mobvnum>.click: Triggered by clicking on the NPC with <mobvnum>.
  • unmount: Happens when you dismount your horse.
  • info or button (should be used together): Activated by clicking on a quest scroll.
  • login: Triggered upon logging in.
  • logout or disconnect (should be used together): Triggered when logging out.
  • take: Triggered when interacting with an item on an NPC.

Example: Login Message

Let’s illustrate a basic example using a login message. The event syntax looks like this:

 
This is the hidden content, please

In this context, the line “when login begin” gets triggered when a user logs in. The chat() command is a standard quest function that will display a message in the public chat, similar to how any player would communicate.

Now you’re familiar with the basic quest syntax!

Using the "with" Condition

To refine the conditions for actions, you can use the "with" tag. For example, if you want to send a message only when the player is above level 25, you could write:

 
This is the hidden content, please

I've omitted the "quest" and "state" structure for brevity since you should understand what it entails by now.

In this example, with pc.get_level() > 25 checks if the player's level is over 25 upon logging in. Functions like pc.get_level() and chat() are standard calls that you’ll become familiar with over time.

Notifying Players of Boss Kills

Now, suppose you have a boss monster with the mob Vnum 90001 and you want all players to be notified when a heroic player defeats it.

You already know how to trigger the kill event, but how do you restrict it to just one specific monster? By using the "with" tag and the command npc.get_race(), which identifies the Vnum of the monster killed:

 
This is the hidden content, please

In this case, pc.get_name() returns the name of the player, and the two dots (..) concatenate the string correctly.

Creating Dialogue with an NPC

If you want to have a conversation with an NPC, such as an old woman (mob Vnum 9006), you might set it up like this:

 
This is the hidden content, please

An "OK" button will automatically be generated below the final line of text. If you want the dialogue to span multiple pages, you can add a wait() command where you'd like the next page to begin, but remember to include a new say_title().

Using Conditional Statements

Lastly, let's cover if statements. For instance, if a player receives 10 Yang when below level 20, and 20 Yang when level 20 or above, it would look like this:

 
This is the hidden content, please

If you have any questions, feel free to ask!

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

spacer.png

Disable AdBlock
The popup will be closed in 5 seconds...