API

Assembly: Spark.Professions Interface: IProfessionsPlugin Implementation: ProfessionsPlugin

Interface

public interface IProfessionsPlugin
{
    void LearnProfession(string entityId, string professionId,
        GameObject source = null);
    bool IsProfessionLearned(string entityId, string professionId);
    List<string> GetLearnedProfessions(string entityId);
}

Methods

LearnProfession

void LearnProfession(string entityId, string professionId,
    GameObject source = null)

Grants a profession to an entity. Publishes both ProfessionLearnedEvent and ProfessionUnlockedEvent. Professions are permanent once learned.

IsProfessionLearned

Returns true if the entity has learned the specified profession.

GetLearnedProfessions

Returns all profession IDs the entity has learned.

ProfessionEntry

Extends SparkDatabaseEntry. Defines a profession (Blacksmithing, Alchemy, etc.).

The entry is intentionally minimal. Profession depth comes from extensions added by other plugins.

Events

Event
Fields
Description

ProfessionLearnedEvent

EntityId, ProfessionId, Source, Timestamp

Profession learned

ProfessionUnlockedEvent

EntityId, ProfessionId, Source, Timestamp

Profession unlocked

Both events are published when a profession is learned.

Trigger Types

Trigger
Description

LearnProfessionTriggerType

Grants a profession via trigger system

AddProfessionTriggerType

Alternative trigger for granting a profession

Save Data

ProfessionsSaveData

Extends SaveDataEntry.

Field
Type
Description

learnedProfessionIds

List<string>

All learned professions

Methods:

There is no method to unlearn a profession. Once learned, professions are permanent.

Usage

Last updated

Was this helpful?