//:://///////////////////////////////////////////// //:: Default On Damaged //:: NW_C2_DEFAULT6 //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* If already fighting then ignore, else determine combat round */ //::////////////////////////////////////////////// //:: Created By: Preston Watamaniuk //:: Created On: Oct 16, 2001 //::////////////////////////////////////////////// #include "NW_I0_GENERIC" void main() { object self = OBJECT_SELF ; int HP = GetCurrentHitPoints(self); if (HP <= 200) { location queen = GetLocation(self); CreateObject(OBJECT_TYPE_ITEM, "queenskey", queen, FALSE); ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(900), self); SpeakString("NOOOOO!! You will not have the Crown!!!"); DelayCommand(2.0, ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_PWKILL), queen, 2.5)); DelayCommand(2.0, ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3), queen, 5.0)); DelayCommand(3.0, DestroyObject(self)); } if(!GetFleeToExit()) { if(!GetSpawnInCondition(NW_FLAG_SET_WARNINGS)) { if(!GetIsObjectValid(GetAttemptedAttackTarget()) && !GetIsObjectValid(GetAttemptedSpellTarget())) { if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) { DetermineSpecialBehavior(GetLastDamager()); } else if(GetIsObjectValid(GetLastDamager())) { DetermineCombatRound(); if(!GetIsFighting(OBJECT_SELF)) { object oTarget = GetLastDamager(); if(!GetObjectSeen(oTarget) && GetArea(OBJECT_SELF) == GetArea(oTarget)) { ActionMoveToLocation(GetLocation(oTarget), TRUE); ActionDoCommand(DetermineCombatRound()); } } } } else if (!GetIsObjectValid(GetAttemptedSpellTarget())) { object oTarget = GetAttackTarget(); if(!GetIsObjectValid(oTarget)) { oTarget = GetAttemptedAttackTarget(); } object oAttacker = GetLastHostileActor(); if (GetIsObjectValid(oAttacker) && oTarget != oAttacker && GetIsEnemy(oAttacker) && (GetTotalDamageDealt() > (GetMaxHitPoints(OBJECT_SELF) / 4) || (GetHitDice(oAttacker) - 2) > GetHitDice(oTarget) ) ) { DetermineCombatRound(oAttacker); } } } } if(GetSpawnInCondition(NW_FLAG_DAMAGED_EVENT)) { SignalEvent(OBJECT_SELF, EventUserDefined(1006)); } }