🌎Quest Events
Quest events are one of the most amazing features of this system and it allows you to add fully custom logic happening around the world after quests are being completed. You can either trigger the EVR on Namalsk, or change weather, spawn creatures, items, explosions, whatever you want.
There are two types of Quest Event Handlers
QuestEventHandlerServer
This is responsible for triggering the logic upon completion on the server side. Spawning creatures, objects and changing the game environment should be done here so everything is synchronized to the other players. As you might remember, in the Quest/Goal definition, the parameter "TriggerSendToClient": false
This paramater does the passing of an information, that the event should also happen on the client.
IMPORTANT - it doesn't mean, that this logic is the same on client
QuestEventHandlerClient
You can specify additional logic like post processing changes, specifically sounds and other things you can do on the client only.
Sound for example
You can invoke sounds by calling CRDTN_PluginBase.CRDTN_PlaySound("SOUNDSET", GetGame().GetPlayer());
EXAMPLE OF THE TELEPORTATION TRIGGER
This trigger teleports a player to a certain location when completing the quest. You can see the event key test_quest_complete
which has to be in the quest definition at parameter
```c
modded class QuestEventHandlerServer
{
override void OnQuestEvent(PlayerBase questCompleteActor, Quest questDefinition, string eventKey, ref Param params = NULL, ref PlayerIdentity identity = NULL, ref Object target = NULL, bool sendToClient = true)
{
if (questCompleteActor == NULL || eventKey == "")
{
return;
}
// Event triggered by the explore trigger in the quest
// THIS EVENT KEY NEEDS TO BE IN THE QUEST DEFINITION
if (eventKey == "test_quest_complete")
{
questCompleteActor.SetPosition("9817.386719 250.825714 11459.413086");
}
super.OnQuestEvent(questCompleteActor, questDefinition, eventKey, params, identity, target, sendToClient);
};
};
```
Make sure you check the examples in the package. If you're still not sure what is this about. Do not hesitate to ask on the discord.
Last updated