Guest User

Untitled

a guest
May 18th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. //::///////////////////////////////////////////////
  2. //:: [Ressurection]
  3. //:: [NW_S0_Ressurec.nss]
  4. //:: Copyright (c) 2000 Bioware Corp.
  5. //:://////////////////////////////////////////////
  6. //:: Brings a character back to life with full
  7. //:: health.
  8. //:: When cast on placeables, you get a default error message.
  9. //:: * You can specify a different message in
  10. //:: X2_L_RESURRECT_SPELL_MSG_RESREF
  11. //:: * You can turn off the message by setting the variable
  12. //:: to -1
  13. //:://////////////////////////////////////////////
  14. //:: Created By: Preston Watamaniuk
  15. //:: Created On: Jan 31, 2001
  16. //:://////////////////////////////////////////////
  17. //:: Last Updated By: Georg Z on 2003-07-31
  18. //:: VFX Pass By: Preston W, On: June 22, 2001
  19. //:: Last Updated By: Michael Marzilli (11/15/2006): Added function to update Database Table with function Row_PlayerRaise
  20. //::
  21.  
  22. #include "x2_inc_spellhook"
  23. #include "row_inc_functions"
  24.  
  25.  
  26. void main()
  27. {
  28.  
  29. /*
  30. Spellcast Hook Code
  31. Added 2003-06-20 by Georg
  32. If you want to make changes to all spells,
  33. check x2_inc_spellhook.nss to find out more
  34.  
  35. */
  36.  
  37. if (!X2PreSpellCastCode())
  38. {
  39. // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
  40. return;
  41. }
  42.  
  43. // End of Spell Cast Hook
  44.  
  45.  
  46. //Get the spell target
  47. object oTarget = GetSpellTargetObject();
  48. //Check to make sure the target is dead first
  49. //Fire cast spell at event for the specified target
  50. if (GetIsObjectValid(oTarget))
  51. {
  52. SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_RESURRECTION, FALSE));
  53. if(GetIsDead(oTarget))
  54. {
  55.  
  56. Row_PlayerRaise(FALSE, oTarget);
  57.  
  58. //Declare major variables
  59. int nHealed = GetMaxHitPoints(oTarget);
  60. effect eRaise = EffectResurrection();
  61. effect eHeal = EffectHeal(nHealed + 10);
  62. effect eVis = EffectVisualEffect(VFX_IMP_HEALING_G);
  63.  
  64. //Apply the heal, raise dead and VFX impact effect
  65. // ApplyEffectToObject(DURATION_TYPE_INSTANT, eRaise, oTarget);
  66. ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
  67. ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget));
  68. }
  69. else if(GetObjectType(oTarget) == OBJECT_TYPE_PLACEABLE)
  70. {
  71. int nStrRef = GetLocalInt(oTarget,"X2_L_RESURRECT_SPELL_MSG_RESREF");
  72. if (nStrRef == 0) { nStrRef = 83861; }
  73. if (nStrRef != -1) { FloatingTextStrRefOnCreature(nStrRef,OBJECT_SELF); }
  74. }
  75. }
  76. }
Add Comment
Please, Sign In to add comment