Skip to content

michcio15/QuestSystem

Repository files navigation

Quest System

An Exiled plugin that makes it easier to create custom quests.

Usage/Examples

There is an example in this repo. Usage in short you need to create a PlayerQuestComponent for example in

public static void OnVerified(VerifiedEventArgs ev)

with

QuestComponent.Register(ev.Player, out QuestComponent component);

and to create a new quest you need to make a new class inheriting from BaseQuest

public class KillPlayersQuest : BaseQuest

and in there you provide what should happen when progress to this quest is added and when the quest is finished

 protected override void OnAddedProgress(Player player, float progress)
    {
        Log.Info($"{player.Nickname} has killquest progress : {CurrentProgress}/{MaxProgress}");
    }

    protected override void OnQuestCompleted(Player player)
    {
        Log.Info("Quest completed");
        player.AddItem(ItemType.Adrenaline);
    }

and to add that quest to a player you need to have a QuestComponent. You can use for it QuestComponent.Get(Player). Once you have it need to

QuestComponent::Add(Basequest);

so in this example

QuestComponent.Add(new KillPlayersQuest(5f));

this 5f means what is the max progress that once its reached the BaseQuest::OnQuestCompleted would be called.

Support

If you have any questions feel free to dm me on discord (@michcio15) or ping on Exiled discord server

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages