Advertisement
Guest User

Untitled

a guest
Jan 31st, 2014
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. //*:**************************************************************************
  2. //*:* NW_S0_AnimDead.nss
  3. //*:**************************************************************************
  4. //*:* An altered version of Preston Watamaniuk ((BioWare)) animate dead spell.
  5. //*:* The spell allows for more then one animated dead depending on caster level
  6. //*:* and necromatic feats.
  7. //*:**************************************************************************
  8. //*:* Created By: Matthew "TheGmork" Meier
  9. //*:* Created On: 27/01/2014
  10. //*:**************************************************************************
  11.  
  12. #include "x2_inc_spellhook"
  13.  
  14. void main()
  15. {
  16. /*
  17. Spellcast Hook Code
  18. Added 2003-06-23 by GeorgZ
  19. If you want to make changes to all spells,
  20. check x2_inc_spellhook.nss to find out more
  21. */
  22.  
  23. if (!X2PreSpellCastCode())
  24. {
  25. // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
  26. return;
  27. }
  28. // End of Spell Cast Hook
  29.  
  30. //set the max number of henchmen;should do this in on mod load
  31. SetMaxHenchmen(99);
  32.  
  33. //Declare major variables
  34. int nInt;
  35. int nMaxUndead;
  36. object oTarget;
  37. object oSpawn;
  38. location lTarget;
  39. int nCasterLevel = GetCasterLevel(OBJECT_SELF);
  40. int nCount = 1
  41.  
  42. oTarget = GetSpellTargetLocation();
  43. lTarget = GetLocation(oTarget);
  44. oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "nr_anim_skell", lTarget);
  45. oTarget = oSpawn;
  46. nInt = GetObjectType(oTarget);
  47.  
  48.  
  49.  
  50. //Set the max number to summon based on the summoner level
  51. if (nCasterLevel <= 6)
  52. nMaxUndead = 3;
  53. else if (nCasterLevel <= 10)
  54. nMaxUndead = 5;
  55. else if (nCasterLevel <= 15)
  56. nMaxUndead = 7;
  57. else
  58. nMaxUndead = 8;
  59. // if spell focus necromancy, increase maximum undead
  60. if (GetHasFeat(FEAT_SPELL_FOCUS_NECROMANCY, OBJECT_SELF))
  61. nMaxUndead++;
  62. if (GetHasFeat(FEAT_GREATER_SPELL_FOCUS_NECROMANCY, OBJECT_SELF))
  63. nMaxUndead++;
  64.  
  65. while (nCount <= nMaxUndead)
  66. {
  67. if (nInt != OBJECT_TYPE_WAYPOINT) DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD), oTarget));
  68. else DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD), GetLocation(oTarget)));
  69. oTarget = GetObjectByTag("nr_anim_skell");
  70. AddHenchman(oPC, oTarget);
  71. nCount++
  72. {
  73.  
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement