Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.94 KB | None | 0 0
  1. //::///////////////////////////////////////////////////////////
  2. //:: EFUA Spell Wrappers
  3. //:: Added by: Johannes
  4. //:: Module Version: v1045
  5. //:: Updated On: Nov 5, 2010
  6. //:: Copyright(c) 2010 escapefromunderdark.com
  7. //::///////////////////////////////////////////////////////////
  8. //:: This script is confidential: it is not to be shared with
  9. //:: anyone, except for staff of escapefromunderdark.com.
  10. //::
  11. //:: Please try to avoid implementing widespread change to
  12. //:: spells by directly editing spell scripts. Whenever
  13. //:: possible, try effecting your changes by editing the EFU
  14. //:: spell function wrappers, which can be found principally
  15. //:: under the include script inc_spells.
  16. //::
  17. //:: Finally, we remind you that it is important to respect
  18. //:: EFU's coding conventions and standards. When in doubt,
  19. //:: please ask your fellow DMs!
  20. //::///////////////////////////////////////////////////////////
  21. #include "inc_spells"
  22. //::///////////////////////////////////////////////
  23. //:: Summon Creature Series
  24. //:: NW_S0_Summon
  25. //:: Copyright (c) 2001 Bioware Corp.
  26. //:://////////////////////////////////////////////
  27. /*
  28. Carries out the summoning of the appropriate
  29. creature for the Summon Monster Series of spells
  30. 1 to 9
  31. */
  32. //:://////////////////////////////////////////////
  33. //:: Created By: Preston Watamaniuk
  34. //:: Created On: Jan 8, 2002
  35. //:://////////////////////////////////////////////
  36. //
  37. // NOTE: This is the script that actually controls
  38. // summoning, ~not~ nw_s0_summon1,2,3,...
  39. //
  40. //:://////////////////////////////////////////////
  41.  
  42. effect SetSummonEffect(int nSpellID);
  43.  
  44. #include "inc_char_token"
  45.  
  46. void main()
  47. {
  48.  
  49. /*
  50. Spellcast Hook Code
  51. Added 2003-06-23 by GeorgZ
  52. If you want to make changes to all spells,
  53. check x2_inc_spellhook.nss to find out more
  54.  
  55. */
  56.  
  57. if (!X2PreSpellCastCode())
  58. {
  59. // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
  60. return;
  61. }
  62.  
  63. // End of Spell Cast Hook
  64.  
  65. //Polymorph ability uses
  66. if (GetIsPC(OBJECT_SELF) && GetHasEffect(EFFECT_TYPE_POLYMORPH))
  67. {
  68. int nUses = GetLocalInt(OBJECT_SELF, "nPolymorphAbility");
  69. if (nUses < 1)
  70. {
  71. FloatingTextStrRefOnCreature(83576, OBJECT_SELF);
  72. return;
  73. }
  74. SetLocalInt(OBJECT_SELF, "nPolymorphAbility", nUses-1);
  75. }
  76.  
  77. // Remove custom systems summons
  78. RemoveMirrorImages(OBJECT_SELF);
  79. RemoveAnimatedWeapons(OBJECT_SELF);
  80. RemoveShadowConjuration(OBJECT_SELF);
  81.  
  82. //Declare major variables
  83. int nSpellID = EFUGetSpellId();
  84. int nDuration = (4 + 2 * (GetWizardSpecialization(OBJECT_SELF) == SPELL_SCHOOL_CONJURATION) + 2 * (GetLocalInt(OBJECT_SELF, "bCultistDuration")) + GetHasFeat(FEAT_SPELL_FOCUS_CONJURATION) + GetHasFeat(FEAT_GREATER_SPELL_FOCUS_CONJURATION)) * EFUGetCasterLevel(OBJECT_SELF);
  85.  
  86. //Make metamagic check for extend
  87. int nMetaMagic = EFU_GetMetaMagicFeat();
  88.  
  89. if (nMetaMagic == METAMAGIC_EXTEND)
  90. nDuration *= 2; //Duration is +100%
  91.  
  92. if(GetTokenInt(OBJECT_SELF,"bFeat_PlanarLock")) nDuration = FloatToInt(IntToFloat(nDuration)*1.2); //Duration + 20%.
  93. //Apply the VFX impact and summon effect
  94. SetLocalInt(OBJECT_SELF, "nSummon_Discount_Needs_Postprocessing", FALSE);
  95. int nPostprocessingInstruction = 0;
  96. effect eSummon = GetSummonEffect(OBJECT_SELF, nSpellID);
  97. if(GetLocalInt(OBJECT_SELF, "nSummon_Discount_Needs_Postprocessing")) {
  98. nPostprocessingInstruction = PROCESS_SUMMON_DISCOUNT;
  99. }
  100.  
  101. int nSpellLevel = StringToInt(Get2DAString("spells.2da", "Innate", nSpellID));
  102. int bNoMultiSummon = FALSE;
  103. if(GetLocalInt(OBJECT_SELF, "bNoMultiSummon") || GetIsObjectValid(GetSpellCastItem()))
  104. bNoMultiSummon = TRUE;
  105. EFUSummon(eSummon, GetSpellTargetLocation(), RoundsToSeconds(nDuration), OBJECT_SELF, SPELL_SCHOOL_CONJURATION, bNoMultiSummon, nPostprocessingInstruction, IntToFloat(nSpellLevel));
  106.  
  107.  
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement