DayZ
  • 🌶️FoxApo DayZ Mods
  • ⚙️Modding | Repacking
  • MODS
    • 👻CRDTN Creatures
      • Phantom
      • config.cpp
    • 💯CRDTN Core
      • File Logger
        • Logger Player Connected
      • Rest Api
        • Getting started
      • Event Handler
      • Notifications UI
      • Admin Utils
      • NPCs
    • 📺CRDTN Gui
    • 📦CRDTN Krabice
    • 🫂CRDTN Factions
    • ⁉️CRDTN Quests
      • ⁉️Getting started
      • 💻Client Side
      • 🖥️Server Side
        • ⚙️Installation
          • 🛠️Quests.json
            • ⚔️Goal
            • 🎁Reward
          • 🌎Quest Events
            • Teleport quest with quest event (server)
        • ⚙️Quest & Goal Types
          • 📜Turn-In goal
          • 📜Kill goal
          • 📜Trade goal
          • 📜Craft goal
          • 📜Action goal
          • 📜Explore goal
        • ⚙️Rewards
        • ⚙️Quest NPCs
    • 🔥CRDTN Fire Regen
      • Config
    • 🔊CRDTN Sounds
    • 🚪CRDTN Locked Doors
      • Config
      • How To
      • config.cpp
Powered by GitBook
On this page
  1. MODS
  2. CRDTN Quests
  3. Server Side
  4. Installation

Quest Events

PreviousRewardNextTeleport quest with quest event (server)

Last updated 1 year ago

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

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.

⁉️
🖥️
⚙️
🌎
Quest
Goal
You can invoke sounds by calling CRDTN_PluginBase.CRDTN_PlaySound("SOUNDSET", GetGame().GetPlayer());