Adding Guild Missions

Adding Guild Mission

Adding a NPC to create a new guild

To pick up guild missions you must be in a guild, so first of all you may wonder how to create a new guild. To create a new NPC please refer Adding quests for more information. It functions as the fundamentals for adding missions. 

Once you created your new NPC, open its properties window and set the chat_parameters to:

shop:guild_creator
menu: MENU_WHOAMI WHOAMI_GUILD_CLERK

Now, you're NPC will be able to create a new guild for you.

Notice: Creating a guild can be expensive, if you don't have enough money you can:

  • Open the entities_game_service_default.cfg file and change the variable GuildCreationCost to 0, which gives you GuildCreationCost = 0;.
  • Or you can use a command to give you some money: /a Money 1000000 (execute this command in the chat dialog)

Creating a new primitive

To add a mission we must open a world and add a primitive to it (you can also use an existing primitive, the steps are the same, but in this article we will create a new primitive).
To add a primitive go to Project -> New Primitive and create your primitive. Your should now have a new primitive in the tree on the right of the world editor.

What are we gonna do ?

We are gonna create a new guild mission and a new solo mission that some guild members will have to complete. 
Only the guild leader will be able to pick this mission.

The objectives of this mission are:

  • 2 guild members will have to complete a solo mission
  • The guild members will have to kill a total of 2 yubos

Each member will earn 50 gold and the guild will earn 100 gold.

The objective of the solo mission is to kill 1 yubo. The reward of this mission is 20 gold.

Create a new guild mission

Now that you have a primitive, do a right click on it and select Add missions_editor.
You will have a new item in the tree, do a right click on the new item (a mission_editor item) and select Add mission_tree

Here is what you should have in your tree (i set the title of the mission tree to GUILD_MISSION)

 

Properties

Now that you have a mission tree it's time to set its properties.
Fill the properties of the mission tree like this (double click on the mission tree to see the properties window):

  • The name is just the name you want to set for the world editor.
  • The audience must be Guild because it's a guild mission.
  • I set the giver primitive to urban_newbieland.primitive because i want a NPC from the urban_newbieland primitive to give us the mission. If you don't have this primitive you can learn how to create a new NPC that gives mission in this article: Adding Quests.
  • I set the mission category to Killing.
  • I set mission description to: GUILD_MISSION_DESC. The mission description must be a language code that you must add to the language files.GUILD_MISSION_DESC does not exist in those files so the description of the mission will simply be GUILD_MISSION_DESC.
  • I set the mission giver to: $givervar@fullname$. We will see later what it means.
  • I set the mission title to: GUILD_MISSION_TITLE. (Same remark that for the mission description).
  • You don't see it in the screenshot but i checked the replayable radio box to allow us to complete this mission several times.

I told you to set the mission giver to: $givervar@fullname$. It's actually a variable that contains the name of the NPC that will give the mission.
Do a right click on the variables item in the tree and select Add var_npc.
Fill the window like this:

The NPC is a NPC from the urban_newbieland primitive so if you don't have it, just fill the form with the NPC you have.

Pre-requisites

In the pre-requisite form just set the require_guild_grade to Leader, and check the require_guild_membership radio box.
It means that only the leader of the guild will be able to pick up the mission.

Pre actions

First of all, you must add a step. Do a right click on the mission tree and select Add step.
You must have these new items in your tree:

Because one of the objectives of this mission is to complete another mission twice (by 2 guild members), we must spawn this mission in the guild members' quest journal.
To do so, we will add a new pre-action that will spawn the mission.
Do a right click on pre_actions and select Add spawn_mission.

Fill the form like this:

  • I set the giver name to: chiang_the_strong because the mission i want to spawn is given by him.
  • I checked guild because i want the mission to be spawned for each guild member connected.
  • I set the mission name to: SOLO_GUILD_MISSION because the solo mission will have this name.

Objectives

We will have 2 objectives for this mission.
The first one will be to do the solo mission twice (by 2 guild members) and the second one will be to kill 2 yubos.

Do a right click on the objectives item and select Add do_mission.

Fill the form like this:

  • For the mission names put: SOLO_GUILD_MISSION 2. It means that the objective is to complete the mission called SOLO_GUILD_MISSION 2 times and that's what we want here.
  • I set the overload objective to MIS_DO_MISSIONMIS_DO_MISSION is a language code and the text of this code will be displayed as a replacement of the objective text.

Now we have to create the second objective.
Do a right click on the objectives item and select Add kill.

Fill the form like this:

  • Set fauna/quantity to: chdfa1 2 . It means that the objective is to kill 2 creatures with the code chdfa1 (it's the yubos).

Post actions

Now that we set the objectives we need to add some rewards.
We will add a money reward for each member of the guild, and another money reward for the guild inventory.

First we are gonna add the money reward for the guild. Do a right click on the post_actions item and select Add recv_money.

Fill the form like this:

  • We set the amount to: 100.
  • We check the guild option, which means that the money must be delivered in the guild inventory.

We now do the exact same thing for the second money reward (for each guild member).
This time we set the amount to 50 and we DON'T check the guild option.

Create a new solo mission for guild members

Now that we have a guild mission that spawns a solo mission for each guild member connected, we must create this solo mission.
To do so, do a right click on the missions editor and select Add mission_tree.

Properties

We must now define the properties of this mission.

Fill the form like this:

  • Set the name to: SOLO_GUILD_MISSION because that's the name we used in the guild mission to spawn the solo mission and for thedo_mission objective.
  • The audience is now solo because it's a solo mission.
  • I also set the giver primitive to: urban_newbieland.primitive because my NPC is in this primitive.
  • I set Killing for the category.
  • I set SOLO_GUILD_MISSION_DESC for the mission description.
  • I set the mission giver to: $givervar@fullname$. (We will set this variable like we set the previous one for the guild mission).
  • I set the title to: SOLO_GUILD_MISSION_TITLE.
  • I checked not_proposed because i don't want to see this mission in the mission list of the giver NPC.
  • I set replayable because i want to be able to replay this mission.

As for the guild mission we will set a new variable for the NPC name. So do a right click on the variables item and select Add var_npc.

Fill the window like this:

The NPC is a NPC from the urban_newbieland primitive so if you don't have it, just fill the form with the NPC you have.

Pre-requisites

There is nothing special to set for the pre-requisites of this mission.

Pre actions

There is no pre-action for this mission.

Objectives

The objective is to kill one yubo. So do a right click on the objectives item and select Add kill.

Fill the form like this:

  • I set fauna/quantity to: chdfa1 1 because we want to kill 1 yubo (defined by the code chdfa1).

Post actions

The reward of this mission will be 20 gold.
So do a right click on the post_actions item and select Add recv_money.

Just set the amount to 20 and DON'T check the guild option because we are not in a guild mission.

Compile the mission

Now that we have created our missions, we need to compile them.

Open the mission compiler.
Set the path to your primitives folder in the first field.
You should see your primitive in the list on the left.
Select your primitive and click on the >> button. Your primitive will move to the right list.

You should see something like this (maybe you don't have all the primitives i have but it's not important):

No click on VALIDATE and then click on COMPILE. If everything is correct the mission should be compiled.

Test the mission

Now to test your mission, put your primitive in the primitives folder used by your server (for more information on how to set your own server see this link: Set your server), and launch your server.
Be careful. Because the NPC i chose to give my missions is in the urban_newbieland primitive, the mission script is in this primitive, not in the primitive i created, so be sure you also added the urban_newbieland primitive in the primitives folder of the server if your mission giver is in the urban_newbieland primitive.

Video

Here is a video showing these guild missions: