Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //*:**************************************************************************
- //*:* NW_S0_AnimDead.nss
- //*:**************************************************************************
- //*:* An altered version of Preston Watamaniuk ((BioWare)) animate dead spell.
- //*:* The spell allows for more then one animated dead depending on caster level
- //*:* and necromatic feats.
- //*:**************************************************************************
- //*:* Created By: Matthew "TheGmork" Meier
- //*:* Created On: 27/01/2014
- //*:**************************************************************************
- #include "x2_inc_spellhook"
- void main()
- {
- /*
- Spellcast Hook Code
- Added 2003-06-23 by GeorgZ
- If you want to make changes to all spells,
- check x2_inc_spellhook.nss to find out more
- */
- if (!X2PreSpellCastCode())
- {
- // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
- return;
- }
- // End of Spell Cast Hook
- //set the max number of henchmen;should do this in on mod load
- SetMaxHenchmen(99);
- //Declare major variables
- int nInt;
- int nMaxUndead;
- object oTarget;
- object oSpawn;
- location lTarget;
- int nCasterLevel = GetCasterLevel(OBJECT_SELF);
- int nCount = 1
- oTarget = GetSpellTargetLocation();
- lTarget = GetLocation(oTarget);
- oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "nr_anim_skell", lTarget);
- oTarget = oSpawn;
- nInt = GetObjectType(oTarget);
- //Set the max number to summon based on the summoner level
- if (nCasterLevel <= 6)
- nMaxUndead = 3;
- else if (nCasterLevel <= 10)
- nMaxUndead = 5;
- else if (nCasterLevel <= 15)
- nMaxUndead = 7;
- else
- nMaxUndead = 8;
- // if spell focus necromancy, increase maximum undead
- if (GetHasFeat(FEAT_SPELL_FOCUS_NECROMANCY, OBJECT_SELF))
- nMaxUndead++;
- if (GetHasFeat(FEAT_GREATER_SPELL_FOCUS_NECROMANCY, OBJECT_SELF))
- nMaxUndead++;
- while (nCount <= nMaxUndead)
- {
- if (nInt != OBJECT_TYPE_WAYPOINT) DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD), oTarget));
- else DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD), GetLocation(oTarget)));
- oTarget = GetObjectByTag("nr_anim_skell");
- AddHenchman(oPC, oTarget);
- nCount++
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement