This will override the spell list the npc currently has, it will only work for spawns that are NPC's. Spawn is the NPC whos list you want to override, the first int32 is the primary spell list, the second int32 is the secondary spell list. Both int32's default to 0 so they are optional, can call SetSpellList(Spawn) to clear the spell list of the npc.
Code: Select all
function cast(Caster, Target, PetID)
SummonPet(Caster, PetID)
pet = GetPet(Caster)
SetSpellList(pet, 1)
end
I am currently using this to give pet spells, it could be used for other purposes like to give a boss mob more powerful spells when it is low on health, or heal spells. Sure there could be many other uses for it too.