home *** CD-ROM | disk | FTP | other *** search
/ PC Zone 125 / DPPCZ0203B.7z / DPPCZ0203B.ISO / Demos / Neverwinter / data1.cab / override / nw_ch_ac7.nss < prev    next >
Text File  |  2002-09-10  |  6KB  |  147 lines

  1. //::///////////////////////////////////////////////
  2. //:: Henchman Death Script
  3. //::
  4. //:: NW_CH_AC7.nss
  5. //::
  6. //:: Copyright (c) 2001 Bioware Corp.
  7. //:://////////////////////////////////////////////
  8. //:: <description>
  9. //:://////////////////////////////////////////////
  10. //::
  11. //:: Created By:
  12. //:: Modified by:   Brent, April 3 2002
  13. //::                Removed delay in respawning
  14. //::                the henchman - caused bugs
  15. //:://////////////////////////////////////////////
  16.  
  17. //::///////////////////////////////////////////////
  18. //:: Greater Restoration
  19. //:: NW_S0_GrRestore.nss
  20. //:: Copyright (c) 2001 Bioware Corp.
  21. //:://////////////////////////////////////////////
  22. /*
  23.     Removes all negative effects of a temporary nature
  24.     and all permanent effects of a supernatural nature
  25.     from the character. Does not remove the effects
  26.     relating to Mind-Affecting spells or movement alteration.
  27.     Heals target for 5d8 + 1 point per caster level.
  28. */
  29. //:://////////////////////////////////////////////
  30. //:: Created By: Preston Watamaniuk
  31. //:: Created On: Jan 7, 2002
  32. //:://////////////////////////////////////////////
  33. //:: VFX Pass By: Preston W, On: June 20, 2001
  34. #include "nw_i0_generic"
  35. #include "nw_i0_plot"
  36.  
  37. /*
  38. // * June 1: use RemoveEffects from plot include instead
  39. void GreaterRestore(object oHench)
  40. {
  41.     //Declare major variables
  42.     object oTarget = oHench;
  43.     effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION_GREATER);
  44.  
  45.     effect eBad = GetFirstEffect(oTarget);
  46.     //Search for negative effects
  47.     while(GetIsEffectValid(eBad))
  48.     {
  49.         if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE ||
  50.             GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE ||
  51.             GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE ||
  52.             GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE ||
  53.             GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE ||
  54.             GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE ||
  55.             GetEffectType(eBad) == EFFECT_TYPE_SPELL_RESISTANCE_DECREASE ||
  56.             GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE ||
  57.             GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
  58.             GetEffectType(eBad) == EFFECT_TYPE_DEAF ||
  59.             GetEffectType(eBad) == EFFECT_TYPE_CURSE ||
  60.             GetEffectType(eBad) == EFFECT_TYPE_DISEASE ||
  61.             GetEffectType(eBad) == EFFECT_TYPE_POISON ||
  62.             GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
  63.             GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL)
  64.         {
  65.             //Remove effect if it is negative.
  66.             RemoveEffect(oTarget, eBad);
  67.         }
  68.         eBad = GetNextEffect(oTarget);
  69.     }
  70.    // ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oTarget);
  71. }     */
  72.  
  73.  
  74. void BringBack()
  75. {
  76.     SetLocalObject(OBJECT_SELF,"NW_L_FORMERMASTER", GetMaster());
  77.     // : REMINDER: The delay is here   for a reason
  78.     DelayCommand(0.1, RemoveEffects(OBJECT_SELF));
  79.     DelayCommand(0.2, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectResurrection(), OBJECT_SELF));
  80.     DelayCommand(0.3, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectHeal(GetMaxHitPoints(OBJECT_SELF)), OBJECT_SELF));
  81.     DelayCommand(5.1, SetIsDestroyable(TRUE, TRUE, TRUE));
  82.     object oWay = GetObjectByTag("NW_DEATH_TEMPLE");
  83.     if (GetIsObjectValid(oWay) == TRUE)
  84.     {
  85.         // * if in Source stone area, respawn at opening to area
  86.         if (GetTag(GetArea(OBJECT_SELF)) == "M4Q1D2")
  87.         {
  88.             DelayCommand(0.2, JumpToObject(GetObjectByTag("M4QD07_ENTER"), FALSE));
  89.         }
  90.         else
  91.             DelayCommand(0.2, JumpToObject(oWay, FALSE));
  92.     }
  93.     else
  94.         DelayCommand(0.3, ActionSpeakString("UT: No place to go"));
  95.  
  96.  
  97. }
  98. void main()
  99. {
  100.     // * This is used by the advanced henchmen
  101.     // * Let Brent know if it interferes with animal
  102.     // * companions et cetera
  103.     if (GetIsObjectValid(GetMaster()) == TRUE)
  104.     {
  105.         object oMe = GetAssociate(ASSOCIATE_TYPE_HENCHMAN, GetMaster());
  106.         if (oMe == OBJECT_SELF
  107.             // * this is to prevent 'double hits' from stopping
  108.             // * the henchmen from moving to the temple of tyr
  109.             // * I.e., henchmen dies 'twice', once after leaving  your party
  110.             || GetLocalInt(OBJECT_SELF, "NW_L_HEN_I_DIED") == TRUE)
  111.         {
  112.            SetPlotFlag(oMe, TRUE);
  113.            SetAssociateState(NW_ASC_IS_BUSY, TRUE);
  114.            AddJournalQuestEntry("Henchman", 99, GetMaster(), FALSE, FALSE, FALSE);
  115.            SetIsDestroyable(FALSE, TRUE, TRUE);
  116.            SetLocalInt(OBJECT_SELF, "NW_L_HEN_I_DIED", TRUE);
  117.        //     RemoveHenchman(GetMaster());
  118.            // effect eRaise = EffectResurrection();
  119.             ClearAllActions();
  120.             DelayCommand(0.5, ActionDoCommand(SetCommandable(TRUE)));
  121.             DelayCommand(5.0, ActionDoCommand(SetAssociateState(NW_ASC_IS_BUSY, FALSE)));
  122.  
  123.             DelayCommand(5.0, SetPlotFlag(oMe, FALSE));
  124.  
  125.             BringBack();
  126.             SetCommandable(FALSE);
  127.  
  128.  
  129.         }
  130.         else
  131.         // * I am a familiar, give 1d6 damage to my master
  132.         if (GetAssociate(ASSOCIATE_TYPE_FAMILIAR, GetMaster()) == OBJECT_SELF)
  133.         {
  134.             // April 2002: Made it so that familiar death can never kill the player
  135.             // only wound them.
  136.             int nDam =d6();
  137.             if (nDam >= GetCurrentHitPoints(GetMaster()))
  138.             {
  139.                 nDam = GetCurrentHitPoints(GetMaster()) - 1;
  140.             }
  141.             effect eDam = EffectDamage(nDam);
  142.             FloatingTextStrRefOnCreature(63489, GetMaster(), FALSE);
  143.             ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDam, GetMaster());
  144.         }
  145.     }
  146. }
  147.