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

  1. //::///////////////////////////////////////////////
  2. //:: Default On Damaged
  3. //:: NW_C2_DEFAULT6
  4. //:: Copyright (c) 2001 Bioware Corp.
  5. //:://////////////////////////////////////////////
  6. /*
  7.     If already fighting then ignore, else determine
  8.     combat round
  9. */
  10. //:://////////////////////////////////////////////
  11. //:: Created By: Preston Watamaniuk
  12. //:: Created On: Oct 16, 2001
  13. //:://////////////////////////////////////////////
  14.  
  15. #include "NW_I0_GENERIC"
  16.  
  17. void main()
  18. {
  19.     if(!GetFleeToExit())
  20.     {
  21.         if(!GetSpawnInCondition(NW_FLAG_SET_WARNINGS))
  22.         {
  23.             if(!GetIsObjectValid(GetAttemptedAttackTarget()) && !GetIsObjectValid(GetAttemptedSpellTarget()))
  24.             {
  25.                 if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL))
  26.                 {
  27.                     DetermineSpecialBehavior(GetLastDamager());
  28.                 }
  29.                 else if(GetIsObjectValid(GetLastDamager()))
  30.                 {
  31.                     DetermineCombatRound();
  32.                     if(!GetIsFighting(OBJECT_SELF))
  33.                     {
  34.                         object oTarget = GetLastDamager();
  35.                         if(!GetObjectSeen(oTarget) && GetArea(OBJECT_SELF) == GetArea(oTarget))
  36.                         {
  37.                             ActionMoveToLocation(GetLocation(oTarget), TRUE);
  38.                             ActionDoCommand(DetermineCombatRound());
  39.                         }
  40.                     }
  41.                 }
  42.             }
  43.             else if (!GetIsObjectValid(GetAttemptedSpellTarget()))
  44.             {
  45.                 object oTarget = GetAttackTarget();
  46.                 if(!GetIsObjectValid(oTarget))
  47.                 {
  48.                     oTarget = GetAttemptedAttackTarget();
  49.                 }
  50.                 object oAttacker = GetLastHostileActor();
  51.                 if (GetIsObjectValid(oAttacker) && oTarget != oAttacker && GetIsEnemy(oAttacker) &&
  52.                    (GetTotalDamageDealt() > (GetMaxHitPoints(OBJECT_SELF) / 4) ||
  53.                     (GetHitDice(oAttacker) - 2) > GetHitDice(oTarget) ) )
  54.                 {
  55.                     DetermineCombatRound(oAttacker);
  56.                 }
  57.             }
  58.         }
  59.     }
  60.     if(GetSpawnInCondition(NW_FLAG_DAMAGED_EVENT))
  61.     {
  62.         SignalEvent(OBJECT_SELF, EventUserDefined(1006));
  63.     }
  64. }
  65.