Jump to content

[LE] How do you add a leveled spell list to an NPC?


JobVanDam

Recommended Posts

Or, you could use a formlist of formlists and choose a formlist to pull spells from based on level. Example:

 

Formlist Property MyLeveledSpells Auto

Event OnCellAttach()
    Int Level = self.Getlevel()
    Formlist LeveledSpellList = MyLeveledSpells.GetAt(0) as Formlist
    
    If Level > 10
        LeveledSpellList = MyLeveledSpells.GetAt(2) as Formlist
    Elseif Level > 5
        LeveledSpellList = MyLeveledSpells.GetAt(1) as Formlist
    Endif
    
    Int Max = LeveledSpellList.GetSize() - 1
    
    Spell SpellToAdd = LeveledSpellList.GetAt(Utility.RandomInt(0, Max)) as Spell 
    
    Self.AddSpell(SpellToAdd)
EndEvent
Link to comment
Share on other sites

A TIP:

You can have in one spell more than one of the same MagicEffect as long as it has different name, each MagicEffect can have different values that can be 'Conditioned' to be apply by different npc's levels.


For Example:

- My "Super Spell" has

- My "Super MagicEffect LV1" with condition on the spell "Run on subject - GetLevel <= 25"

- My "Super MagicEffect LV2" with condition on the spell "Run on subject - GetLevel >= 26"


This way the same spell can apply 2 different damage values according to the level that the spell carrier has.



By using this technic and what dylbill suggested you can reduce a lot the processing time and the number of 'Same Spell' you have for the same purpose.

* The longer the FormList and the number of FormLists the longer the processing time.

The longer a FormList is, the slower it becomes.

Edited by maxarturo
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...