Initialization
From WCell Wiki
- Create a new class
- You must have a public static method with the Initialization attribute
- The Initialization attribute declares on which step during Initialization your method will be called. Take a look at InitializationPass to help you choose the correct pass.
- If you want to change Spells, you *must* use the second InitializationPass
- If you want to change NPCs, Quests, Items, GOs, Loot or any other content that is loaded from DB, make sure to add the DependentInitializationAttribute
- Example:
[Initialization(InitializationPass.Second)]
public static void FixConeOfCold()
{
// Cone of cold is missing Range
SpellLineId.MageConeOfCold.Apply(spell =>
{
spell.Range.MaxDist = 10;
});
}
[Initialization]
[DependentInitialization(typeof(GOMgr))]
public static void InitGOs()
{
// do something to GOs
}
[Initialization]
[DependentInitialization(typeof(NPCMgr))]
[DependentInitialization(typeof(ItemMgr))]
public static void InitNPCs()
{
// do something to NPCs and Items
}
NOTE: These methods can be declared in any public Type, as far as it still is a part of the Addon's project and has the aforementioned attribute.
Add content
- See the article Extend WCell for more information.