2025/07/20 Update
Added PEPS AI. Full compile.
This commit is contained in:
110
_removed/nw_c2_default1.nss
Normal file
110
_removed/nw_c2_default1.nss
Normal file
@@ -0,0 +1,110 @@
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: NW_C2_DEFAULT1
|
||||
/*
|
||||
Default OnHeartbeat script for NPCs.
|
||||
|
||||
This script causes NPCs to perform default animations
|
||||
while not otherwise engaged.
|
||||
|
||||
This script duplicates the behavior of the default
|
||||
script and just cleans up the code and removes
|
||||
redundant conditional checks.
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: Copyright (c) 2002 Floodgate Entertainment
|
||||
//:: Created By: Naomi Novik
|
||||
//:: Created On: 12/22/2002
|
||||
//:://////////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_generic"
|
||||
#include "creature_inc"
|
||||
|
||||
void main()
|
||||
{
|
||||
// * if not runnning normal or better Ai then exit for performance reasons
|
||||
if (GetAILevel() == AI_LEVEL_VERY_LOW) return;
|
||||
|
||||
ExecuteScript("prc_npc_hb", OBJECT_SELF);
|
||||
|
||||
// Set correct name of creature
|
||||
creature_SetName(OBJECT_SELF);
|
||||
|
||||
// Buff ourselves up right away if we should
|
||||
if(GetSpawnInCondition(NW_FLAG_FAST_BUFF_ENEMY))
|
||||
{
|
||||
// This will return TRUE if an enemy was within 40.0 m
|
||||
// and we buffed ourselves up instantly to respond --
|
||||
// simulates a spellcaster with protections enabled
|
||||
// already.
|
||||
if(TalentAdvancedBuff(40.0))
|
||||
{
|
||||
// This is a one-shot deal
|
||||
SetSpawnInCondition(NW_FLAG_FAST_BUFF_ENEMY, FALSE);
|
||||
|
||||
// This return means we skip sending the user-defined
|
||||
// heartbeat signal in this one case.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(GetHasEffect(EFFECT_TYPE_SLEEP))
|
||||
{
|
||||
// If we're asleep and this is the result of sleeping
|
||||
// at night, apply the floating 'z's visual effect
|
||||
// every so often
|
||||
|
||||
if(GetSpawnInCondition(NW_FLAG_SLEEPING_AT_NIGHT))
|
||||
{
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_SLEEP);
|
||||
if(d10() > 6)
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we have the 'constant' waypoints flag set, walk to the next
|
||||
// waypoint.
|
||||
else if ( GetWalkCondition(NW_WALK_FLAG_CONSTANT) )
|
||||
{
|
||||
WalkWayPoints();
|
||||
}
|
||||
|
||||
// Check to see if we should be playing default animations
|
||||
// - make sure we don't have any current targets
|
||||
else if ( !GetIsObjectValid(GetAttemptedAttackTarget())
|
||||
&& !GetIsObjectValid(GetAttemptedSpellTarget())
|
||||
// && !GetIsPostOrWalking())
|
||||
&& !GetIsObjectValid(GetNearestSeenEnemy()))
|
||||
{
|
||||
if (GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL) || GetBehaviorState(NW_FLAG_BEHAVIOR_OMNIVORE) ||
|
||||
GetBehaviorState(NW_FLAG_BEHAVIOR_HERBIVORE))
|
||||
{
|
||||
// This handles special attacking/fleeing behavior
|
||||
// for omnivores & herbivores.
|
||||
DetermineSpecialBehavior();
|
||||
}
|
||||
else if (!IsInConversation(OBJECT_SELF))
|
||||
{
|
||||
if (GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS)
|
||||
|| GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS_AVIAN)
|
||||
|| GetIsEncounterCreature())
|
||||
{
|
||||
PlayMobileAmbientAnimations();
|
||||
}
|
||||
else if (GetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS))
|
||||
{
|
||||
PlayImmobileAmbientAnimations();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Send the user-defined event signal if specified
|
||||
if(GetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT))
|
||||
{
|
||||
SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_HEARTBEAT));
|
||||
}
|
||||
}
|
||||
|
||||
210
_removed/nw_c2_default2.nss
Normal file
210
_removed/nw_c2_default2.nss
Normal file
@@ -0,0 +1,210 @@
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: NW_C2_DEFAULT2
|
||||
/*
|
||||
Default OnPerception event handler for NPCs.
|
||||
|
||||
Handles behavior when perceiving a creature for the
|
||||
first time.
|
||||
*/
|
||||
//:://////////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_generic"
|
||||
#include "anph_inc"
|
||||
|
||||
int DruidIsNear(object PC)
|
||||
{
|
||||
if (GetLevelByClass(CLASS_TYPE_DRUID, PC) > 0)
|
||||
return 1;
|
||||
|
||||
int Nth = 1;
|
||||
object Druid;
|
||||
|
||||
|
||||
Druid = GetNearestCreature(CREATURE_TYPE_CLASS, CLASS_TYPE_DRUID, PC, Nth);
|
||||
// Search friendly druid
|
||||
while (GetIsEnemy(Druid, PC) && GetIsObjectValid(Druid) && GetDistanceBetween(PC, Druid) < 50.0)
|
||||
{
|
||||
Nth++;
|
||||
Druid = GetNearestCreature(CREATURE_TYPE_CLASS, CLASS_TYPE_DRUID, GetLastPerceived(), Nth);
|
||||
}
|
||||
|
||||
if (!GetIsEnemy(Druid, PC) && GetIsObjectValid(Druid) && GetDistanceBetween(PC, Druid) < 50.0)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
// * if not runnning normal or better Ai then exit for performance reasons
|
||||
// * if not runnning normal or better Ai then exit for performance reasons
|
||||
if (GetAILevel() == AI_LEVEL_VERY_LOW) return;
|
||||
|
||||
ExecuteScript("prc_npc_percep", OBJECT_SELF);
|
||||
|
||||
object oPerceiver = OBJECT_SELF;
|
||||
object oPercep = GetLastPerceived();
|
||||
int bSeen = GetLastPerceptionSeen();
|
||||
int bHeard = GetLastPerceptionHeard();
|
||||
if (bHeard == FALSE)
|
||||
{
|
||||
// Has someone vanished in front of me?
|
||||
bHeard = GetLastPerceptionVanished();
|
||||
}
|
||||
|
||||
// This will cause the NPC to speak their one-liner
|
||||
// conversation on perception even if they are already
|
||||
// in combat.
|
||||
if(GetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION)
|
||||
&& GetIsPC(oPercep)
|
||||
&& bSeen)
|
||||
{
|
||||
SpeakOneLinerConversation();
|
||||
}
|
||||
|
||||
// March 5 2003 Brent
|
||||
// Had to add this section back in, since modifications were not taking this specific
|
||||
// example into account -- it made invisibility basically useless.
|
||||
//If the last perception event was hearing based or if someone vanished then go to search mode
|
||||
if ((GetLastPerceptionVanished()) && GetIsEnemy(GetLastPerceived()))
|
||||
{
|
||||
object oGone = GetLastPerceived();
|
||||
if((GetAttemptedAttackTarget() == GetLastPerceived() ||
|
||||
GetAttemptedSpellTarget() == GetLastPerceived() ||
|
||||
GetAttackTarget() == GetLastPerceived()) && GetArea(GetLastPerceived()) != GetArea(OBJECT_SELF))
|
||||
{
|
||||
if ((GetLevelByClass(CLASS_TYPE_ANIMAL) > 0 && !DruidIsNear(GetLastPerceived())) ||
|
||||
(GetLevelByClass(CLASS_TYPE_ANIMAL) == 0))
|
||||
{
|
||||
ClearAllActions();
|
||||
DetermineCombatRound();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This section has been heavily revised while keeping the
|
||||
// pre-existing behavior:
|
||||
// - If we're in combat, keep fighting.
|
||||
// - If not and we've perceived an enemy, start to fight.
|
||||
// Even if the perception event was a 'vanish', that's
|
||||
// still what we do anyway, since that will keep us
|
||||
// fighting any visible targets.
|
||||
// - If we're not in combat and haven't perceived an enemy,
|
||||
// see if the perception target is a PC and if we should
|
||||
// speak our attention-getting one-liner.
|
||||
if (GetIsInCombat(OBJECT_SELF))
|
||||
{
|
||||
// don't do anything else, we're busy
|
||||
//MyPrintString("GetIsFighting: TRUE");
|
||||
|
||||
}
|
||||
// * BK FEB 2003 Only fight if you can see them. DO NOT RELY ON HEARING FOR ENEMY DETECTION
|
||||
else if (GetIsEnemy(oPercep) && bSeen)
|
||||
{ // SpawnScriptDebugger();
|
||||
//MyPrintString("GetIsEnemy: TRUE");
|
||||
// We spotted an enemy and we're not already fighting
|
||||
if(!GetHasEffect(EFFECT_TYPE_SLEEP))
|
||||
{
|
||||
// Blow fa horn if we have one. The NPC in question MUST have the faction ring of
|
||||
// his faction somewhere in his inventory AND an item with the tag "NPCHorn"
|
||||
object oHorn = GetItemPossessedBy(oPerceiver, "NPCHorn");
|
||||
if (GetIsObjectValid(oHorn) &&
|
||||
GetIsPC(oPercep) &&
|
||||
!GetIsDM(oPercep) &&
|
||||
GetLocalInt(oPerceiver, "HornSounded") == FALSE)
|
||||
{
|
||||
AnphSendWarningCall(oPerceiver);
|
||||
SetLocalInt(oPerceiver, "HornSounded", TRUE);
|
||||
AssignCommand(GetModule(), DelayCommand(60.0f, DeleteLocalInt(oPerceiver, "HornSounded")));
|
||||
}
|
||||
|
||||
if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL))
|
||||
{
|
||||
//MyPrintString("DetermineSpecialBehavior");
|
||||
DetermineSpecialBehavior();
|
||||
} else if ((GetLevelByClass(CLASS_TYPE_ANIMAL) == 0) ||
|
||||
(GetLevelByClass(CLASS_TYPE_ANIMAL) > 0 && !DruidIsNear(oPercep)))
|
||||
{
|
||||
//MyPrintString("DetermineCombatRound");
|
||||
SetFacingPoint(GetPosition(oPercep));
|
||||
SpeakString("NW_I_WAS_ATTACKED", TALKVOLUME_SILENT_TALK);
|
||||
DetermineCombatRound();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bSeen)
|
||||
{
|
||||
//MyPrintString("GetLastPerceptionSeen: TRUE");
|
||||
if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) {
|
||||
DetermineSpecialBehavior();
|
||||
} else if (GetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION)
|
||||
&& GetIsPC(oPercep))
|
||||
{
|
||||
// The NPC will speak their one-liner conversation
|
||||
// This should probably be:
|
||||
// SpeakOneLinerConversation(oPercep);
|
||||
// instead, but leaving it as is for now.
|
||||
ActionStartConversation(OBJECT_SELF);
|
||||
}
|
||||
}
|
||||
else
|
||||
// * July 14 2003: Some minor reactions based on invisible creatures being nearby
|
||||
if (bHeard && GetIsEnemy(oPercep))
|
||||
{
|
||||
// SpeakString("vanished");
|
||||
// * don't want creatures wandering too far after noises
|
||||
if (GetDistanceToObject(oPercep) <= 7.0)
|
||||
{
|
||||
// if (GetHasSpell(SPELL_TRUE_SEEING) == TRUE)
|
||||
if (GetHasSpell(SPELL_TRUE_SEEING))
|
||||
{
|
||||
ActionCastSpellAtObject(SPELL_TRUE_SEEING, OBJECT_SELF);
|
||||
}
|
||||
else
|
||||
// if (GetHasSpell(SPELL_SEE_INVISIBILITY) == TRUE)
|
||||
if (GetHasSpell(SPELL_SEE_INVISIBILITY))
|
||||
{
|
||||
ActionCastSpellAtObject(SPELL_SEE_INVISIBILITY, OBJECT_SELF);
|
||||
}
|
||||
else
|
||||
// if (GetHasSpell(SPELL_INVISIBILITY_PURGE) == TRUE)
|
||||
if (GetHasSpell(SPELL_INVISIBILITY_PURGE))
|
||||
{
|
||||
ActionCastSpellAtObject(SPELL_INVISIBILITY_PURGE, OBJECT_SELF);
|
||||
}
|
||||
else
|
||||
{
|
||||
ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 0.5);
|
||||
ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_RIGHT, 0.5);
|
||||
ActionPlayAnimation(ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD, 0.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// activate ambient animations or walk waypoints if appropriate
|
||||
if (!IsInConversation(OBJECT_SELF)) {
|
||||
if (GetIsPostOrWalking()) {
|
||||
WalkWayPoints();
|
||||
} else if (GetIsPC(oPercep) &&
|
||||
(GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS)
|
||||
|| GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS_AVIAN)
|
||||
|| GetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS)
|
||||
|| GetIsEncounterCreature()))
|
||||
{
|
||||
SetAnimationCondition(NW_ANIM_FLAG_IS_ACTIVE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Send the user-defined event if appropriate
|
||||
if(GetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT) && GetLastPerceptionSeen())
|
||||
{
|
||||
SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_PERCEIVE));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
58
_removed/nw_c2_default3.nss
Normal file
58
_removed/nw_c2_default3.nss
Normal file
@@ -0,0 +1,58 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Default: End of Combat Round
|
||||
//:: NW_C2_DEFAULT3
|
||||
//:: Copyright (c) 2008 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Calls the end of combat script every round
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Oct 16, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Modified By: Deva Winblood
|
||||
//:: Modified On: Feb 16th, 2008
|
||||
//:: Added Support for Mounted Combat Feat Support
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "NW_I0_GENERIC"
|
||||
|
||||
void main()
|
||||
{
|
||||
ExecuteScript("prc_npc_combat", OBJECT_SELF);
|
||||
|
||||
if (!GetLocalInt(GetModule(),"X3_NO_MOUNTED_COMBAT_FEAT"))
|
||||
{ // set variables on target for mounted combat
|
||||
DeleteLocalInt(OBJECT_SELF,"bX3_LAST_ATTACK_PHYSICAL");
|
||||
DeleteLocalInt(OBJECT_SELF,"nX3_HP_BEFORE");
|
||||
DeleteLocalInt(OBJECT_SELF,"bX3_ALREADY_MOUNTED_COMBAT");
|
||||
if (GetHasFeat(FEAT_MOUNTED_COMBAT,OBJECT_SELF))
|
||||
{ // check for AC increase
|
||||
int nRoll=d20()+GetSkillRank(SKILL_RIDE);
|
||||
nRoll=nRoll-10;
|
||||
if (nRoll>4)
|
||||
{ // ac increase
|
||||
nRoll=nRoll/5;
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectACIncrease(nRoll),OBJECT_SELF,8.5);
|
||||
} // ac increase
|
||||
} // check for AC increase
|
||||
} // set variables on target for mounted combat
|
||||
|
||||
if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL))
|
||||
{
|
||||
DetermineSpecialBehavior();
|
||||
}
|
||||
else if(!GetSpawnInCondition(NW_FLAG_SET_WARNINGS))
|
||||
{
|
||||
DetermineCombatRound();
|
||||
}
|
||||
if(GetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT))
|
||||
{
|
||||
SignalEvent(OBJECT_SELF, EventUserDefined(1003));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
92
_removed/nw_c2_default4.nss
Normal file
92
_removed/nw_c2_default4.nss
Normal file
@@ -0,0 +1,92 @@
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: NW_C2_DEFAULT4
|
||||
/*
|
||||
Default OnConversation event handler for NPCs.
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: Copyright (c) 2002 Floodgate Entertainment
|
||||
//:: Created By: Naomi Novik
|
||||
//:: Created On: 12/22/2002
|
||||
//:://////////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_generic"
|
||||
|
||||
void main()
|
||||
{
|
||||
// * if petrified, jump out
|
||||
if (GetHasEffect(EFFECT_TYPE_PETRIFY, OBJECT_SELF) == TRUE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// * If dead, exit directly.
|
||||
if (GetIsDead(OBJECT_SELF) == TRUE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ExecuteScript("prc_npc_conv", OBJECT_SELF);
|
||||
|
||||
// See if what we just 'heard' matches any of our
|
||||
// predefined patterns
|
||||
int nMatch = GetListenPatternNumber();
|
||||
object oShouter = GetLastSpeaker();
|
||||
|
||||
if (nMatch == -1)
|
||||
{
|
||||
// Not a match -- start an ordinary conversation
|
||||
if (GetCommandable(OBJECT_SELF))
|
||||
{
|
||||
ClearActions(CLEAR_NW_C2_DEFAULT4_29);
|
||||
BeginConversation();
|
||||
}
|
||||
else
|
||||
// * July 31 2004
|
||||
// * If only charmed then allow conversation
|
||||
// * so you can have a better chance of convincing
|
||||
// * people of lowering prices
|
||||
if (GetHasEffect(EFFECT_TYPE_CHARMED) == TRUE)
|
||||
{
|
||||
ClearActions(CLEAR_NW_C2_DEFAULT4_29);
|
||||
BeginConversation();
|
||||
}
|
||||
}
|
||||
// Respond to shouts from friendly non-PCs only
|
||||
else if (GetIsObjectValid(oShouter)
|
||||
&& !GetIsPC(oShouter)
|
||||
&& GetIsFriend(oShouter))
|
||||
{
|
||||
object oIntruder = OBJECT_INVALID;
|
||||
// Determine the intruder if any
|
||||
if(nMatch == 4)
|
||||
{
|
||||
oIntruder = GetLocalObject(oShouter, "NW_BLOCKER_INTRUDER");
|
||||
}
|
||||
else if (nMatch == 5)
|
||||
{
|
||||
oIntruder = GetLastHostileActor(oShouter);
|
||||
if(!GetIsObjectValid(oIntruder))
|
||||
{
|
||||
oIntruder = GetAttemptedAttackTarget();
|
||||
if(!GetIsObjectValid(oIntruder))
|
||||
{
|
||||
oIntruder = GetAttemptedSpellTarget();
|
||||
if(!GetIsObjectValid(oIntruder))
|
||||
{
|
||||
oIntruder = OBJECT_INVALID;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Actually respond to the shout
|
||||
RespondToShout(oShouter, nMatch, oIntruder);
|
||||
}
|
||||
|
||||
// Send the user-defined event if appropriate
|
||||
if(GetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT))
|
||||
{
|
||||
SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_DIALOGUE));
|
||||
}
|
||||
}
|
||||
71
_removed/nw_c2_default5.nss
Normal file
71
_removed/nw_c2_default5.nss
Normal file
@@ -0,0 +1,71 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Default On Attacked
|
||||
//:: NW_C2_DEFAULT5
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
If already fighting then ignore, else determine
|
||||
combat round
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Oct 16, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Modified By: Deva Winblood
|
||||
//:: Modified On: Jan 4th, 2008
|
||||
//:: Added Support for Mounted Combat Feat Support
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_generic"
|
||||
|
||||
void main()
|
||||
{
|
||||
ExecuteScript("prc_npc_physatt", OBJECT_SELF);
|
||||
|
||||
if (!GetLocalInt(GetModule(),"X3_NO_MOUNTED_COMBAT_FEAT"))
|
||||
{ // set variables on target for mounted combat
|
||||
SetLocalInt(OBJECT_SELF,"bX3_LAST_ATTACK_PHYSICAL",TRUE);
|
||||
SetLocalInt(OBJECT_SELF,"nX3_HP_BEFORE",GetCurrentHitPoints(OBJECT_SELF));
|
||||
} // set variables on target for mounted combat
|
||||
|
||||
if(GetFleeToExit()) {
|
||||
// Run away!
|
||||
ActivateFleeToExit();
|
||||
} else if (GetSpawnInCondition(NW_FLAG_SET_WARNINGS)) {
|
||||
// We give an attacker one warning before we attack
|
||||
// This is not fully implemented yet
|
||||
SetSpawnInCondition(NW_FLAG_SET_WARNINGS, FALSE);
|
||||
|
||||
//Put a check in to see if this attacker was the last attacker
|
||||
//Possibly change the GetNPCWarning function to make the check
|
||||
} else {
|
||||
object oAttacker = GetLastAttacker();
|
||||
if (!GetIsObjectValid(oAttacker)) {
|
||||
// Don't do anything, invalid attacker
|
||||
|
||||
} else if (!GetIsFighting(OBJECT_SELF)) {
|
||||
// We're not fighting anyone else, so
|
||||
// start fighting the attacker
|
||||
if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) {
|
||||
SetSummonHelpIfAttacked();
|
||||
DetermineSpecialBehavior(oAttacker);
|
||||
} else if (GetArea(oAttacker) == GetArea(OBJECT_SELF)) {
|
||||
SetSummonHelpIfAttacked();
|
||||
DetermineCombatRound(oAttacker);
|
||||
}
|
||||
|
||||
//Shout Attack my target, only works with the On Spawn In setup
|
||||
SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK);
|
||||
|
||||
//Shout that I was attacked
|
||||
SpeakString("NW_I_WAS_ATTACKED", TALKVOLUME_SILENT_TALK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(GetSpawnInCondition(NW_FLAG_ATTACK_EVENT))
|
||||
{
|
||||
SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_ATTACKED));
|
||||
}
|
||||
}
|
||||
113
_removed/nw_c2_default6.nss
Normal file
113
_removed/nw_c2_default6.nss
Normal file
@@ -0,0 +1,113 @@
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: NW_C2_DEFAULT6
|
||||
//:: Default OnDamaged handler
|
||||
/*
|
||||
If already fighting then ignore, else determine
|
||||
combat round
|
||||
*/
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: Copyright (c) 2002 Floodgate Entertainment
|
||||
//:: Created By: Naomi Novik
|
||||
//:: Created On: 12/22/2002
|
||||
//:://////////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: Modified By: Deva Winblood
|
||||
//:: Modified On: Jan 17th, 2008
|
||||
//:: Added Support for Mounted Combat Feat Support
|
||||
//:://////////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_generic"
|
||||
#include "x3_inc_horse"
|
||||
#include "creature_inc"
|
||||
|
||||
void main()
|
||||
{
|
||||
ExecuteScript("prc_npc_damaged", OBJECT_SELF);
|
||||
|
||||
// Set Name including health tag
|
||||
creature_SetName(OBJECT_SELF);
|
||||
|
||||
object oDamager = GetLastDamager();
|
||||
object oMe=OBJECT_SELF;
|
||||
int nHPBefore;
|
||||
if (!GetLocalInt(GetModule(),"X3_NO_MOUNTED_COMBAT_FEAT"))
|
||||
if (GetHasFeat(FEAT_MOUNTED_COMBAT)&&HorseGetIsMounted(OBJECT_SELF))
|
||||
{ // see if can negate some damage
|
||||
if (GetLocalInt(OBJECT_SELF,"bX3_LAST_ATTACK_PHYSICAL"))
|
||||
{ // last attack was physical
|
||||
nHPBefore=GetLocalInt(OBJECT_SELF,"nX3_HP_BEFORE");
|
||||
if (!GetLocalInt(OBJECT_SELF,"bX3_ALREADY_MOUNTED_COMBAT"))
|
||||
{ // haven't already had a chance to use this for the round
|
||||
SetLocalInt(OBJECT_SELF,"bX3_ALREADY_MOUNTED_COMBAT",TRUE);
|
||||
int nAttackRoll=GetBaseAttackBonus(oDamager)+d20();
|
||||
int nRideCheck=GetSkillRank(SKILL_RIDE,OBJECT_SELF)+d20();
|
||||
if (nRideCheck>=nAttackRoll&&!GetIsDead(OBJECT_SELF))
|
||||
{ // averted attack
|
||||
if (GetIsPC(oDamager)) SendMessageToPC(oDamager,GetName(OBJECT_SELF)+GetStringByStrRef(111991));
|
||||
//if (GetIsPC(OBJECT_SELF)) SendMessageToPCByStrRef(OBJECT_SELF,111992");
|
||||
if (GetCurrentHitPoints(OBJECT_SELF)<nHPBefore)
|
||||
{ // heal
|
||||
effect eHeal=EffectHeal(nHPBefore-GetCurrentHitPoints(OBJECT_SELF));
|
||||
AssignCommand(GetModule(),ApplyEffectToObject(DURATION_TYPE_INSTANT,eHeal,oMe));
|
||||
} // heal
|
||||
} // averted attack
|
||||
} // haven't already had a chance to use this for the round
|
||||
} // last attack was physical
|
||||
} // see if can negate some damage
|
||||
if(GetFleeToExit()) {
|
||||
// We're supposed to run away, do nothing
|
||||
} else if (GetSpawnInCondition(NW_FLAG_SET_WARNINGS)) {
|
||||
// don't do anything?
|
||||
} else {
|
||||
if (!GetIsObjectValid(oDamager)) {
|
||||
// don't do anything, we don't have a valid damager
|
||||
} else if (!GetIsFighting(OBJECT_SELF)) {
|
||||
// If we're not fighting, determine combat round
|
||||
if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) {
|
||||
DetermineSpecialBehavior(oDamager);
|
||||
} else {
|
||||
if(!GetObjectSeen(oDamager)
|
||||
&& GetArea(OBJECT_SELF) == GetArea(oDamager)) {
|
||||
// We don't see our attacker, go find them
|
||||
ActionMoveToLocation(GetLocation(oDamager), TRUE);
|
||||
ActionDoCommand(DetermineCombatRound());
|
||||
} else {
|
||||
DetermineCombatRound();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// We are fighting already -- consider switching if we've been
|
||||
// attacked by a more powerful enemy
|
||||
object oTarget = GetAttackTarget();
|
||||
if (!GetIsObjectValid(oTarget))
|
||||
oTarget = GetAttemptedAttackTarget();
|
||||
if (!GetIsObjectValid(oTarget))
|
||||
oTarget = GetAttemptedSpellTarget();
|
||||
|
||||
// If our target isn't valid
|
||||
// or our damager has just dealt us 25% or more
|
||||
// of our hp in damager
|
||||
// or our damager is more than 2HD more powerful than our target
|
||||
// switch to attack the damager.
|
||||
if (!GetIsObjectValid(oTarget)
|
||||
|| (
|
||||
oTarget != oDamager
|
||||
&& (
|
||||
GetTotalDamageDealt() > (GetMaxHitPoints(OBJECT_SELF) / 4)
|
||||
|| (GetHitDice(oDamager) - 2) > GetHitDice(oTarget)
|
||||
)
|
||||
)
|
||||
)
|
||||
{
|
||||
// Switch targets
|
||||
DetermineCombatRound(oDamager);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Send the user-defined event signal
|
||||
if(GetSpawnInCondition(NW_FLAG_DAMAGED_EVENT))
|
||||
{
|
||||
SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_DAMAGED));
|
||||
}
|
||||
}
|
||||
113
_removed/nw_c2_default7.nss
Normal file
113
_removed/nw_c2_default7.nss
Normal file
@@ -0,0 +1,113 @@
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: NW_C2_DEFAULT7
|
||||
/*
|
||||
Default OnDeath event handler for NPCs.
|
||||
|
||||
Adjusts killer's alignment if appropriate and
|
||||
alerts allies to our death.
|
||||
*/
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: Copyright (c) 2002 Floodgate Entertainment
|
||||
//:: Created By: Naomi Novik
|
||||
//:: Created On: 12/22/2002
|
||||
//:://////////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: Modified By: Deva Winblood
|
||||
//:: Modified On: April 1st, 2008
|
||||
//:: Added Support for Dying Wile Mounted
|
||||
//:://///////////////////////////////////////////////
|
||||
|
||||
const string sHenchSummonedFamiliar = "HenchSummonedFamiliar";
|
||||
const string sHenchSummonedAniComp = "HenchSummonedAniComp";
|
||||
const string sHenchLastHeardOrSeen = "LastSeenOrHeard";
|
||||
|
||||
#include "x2_inc_compon"
|
||||
#include "x0_i0_spawncond"
|
||||
|
||||
// Clears the last unheard, unseen enemy location
|
||||
void ClearEnemyLocation();
|
||||
|
||||
void main()
|
||||
{
|
||||
object oKiller = GetLastKiller();
|
||||
object oMaster = GetMaster();
|
||||
|
||||
int nAlign = GetAlignmentGoodEvil(OBJECT_SELF);
|
||||
|
||||
if(GetLocalInt(GetModule(), "X3_ENABLE_MOUNT_DB") && GetIsObjectValid(oMaster))
|
||||
SetLocalInt(oMaster, "bX3_STORE_MOUNT_INFO", TRUE);
|
||||
|
||||
// If we're a good/neutral commoner,
|
||||
// adjust the killer's alignment evil
|
||||
if(GetLevelByClass(CLASS_TYPE_COMMONER)
|
||||
&& (nAlign == ALIGNMENT_GOOD || nAlign == ALIGNMENT_NEUTRAL))
|
||||
{
|
||||
AdjustAlignment(oKiller, ALIGNMENT_EVIL, 5);
|
||||
}
|
||||
|
||||
//Start Hench AI
|
||||
if(GetLocalInt(OBJECT_SELF, "GaveHealing"))
|
||||
{
|
||||
// Pausanias: destroy potions of healing
|
||||
object oItem = GetFirstItemInInventory();
|
||||
while(GetIsObjectValid(oItem))
|
||||
{
|
||||
if(GetTag(oItem) == "NW_IT_MPOTION003")
|
||||
DestroyObject(oItem);
|
||||
oItem = GetNextItemInInventory();
|
||||
}
|
||||
}
|
||||
|
||||
if(GetLocalInt(OBJECT_SELF, sHenchSummonedFamiliar))
|
||||
{
|
||||
object oFam = GetLocalObject(OBJECT_SELF, sHenchSummonedFamiliar);
|
||||
if(GetIsObjectValid(oFam))
|
||||
{
|
||||
//if(DEBUG) DoDebug(GetName(OBJECT_SELF) + " destroy familiar");
|
||||
DestroyObject(oFam, 0.1);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oFam));
|
||||
}
|
||||
}
|
||||
if(GetLocalInt(OBJECT_SELF, sHenchSummonedAniComp))
|
||||
{
|
||||
object oAni = GetLocalObject(OBJECT_SELF, sHenchSummonedAniComp);
|
||||
if(GetIsObjectValid(oAni))
|
||||
{
|
||||
//if(DEBUG) DoDebug(GetName(OBJECT_SELF) + " destroy ani comp");
|
||||
DestroyObject(oAni, 0.1);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oAni));
|
||||
}
|
||||
}
|
||||
|
||||
ClearEnemyLocation();
|
||||
//End Hench AI
|
||||
|
||||
// Call to allies to let them know we're dead
|
||||
SpeakString("NW_I_AM_DEAD", TALKVOLUME_SILENT_TALK);
|
||||
|
||||
//Shout Attack my target, only works with the On Spawn In setup
|
||||
SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK);
|
||||
|
||||
// NOTE: the OnDeath user-defined event does not
|
||||
// trigger reliably and should probably be removed
|
||||
if(GetSpawnInCondition(NW_FLAG_DEATH_EVENT))
|
||||
SignalEvent(OBJECT_SELF, EventUserDefined(1007));
|
||||
|
||||
craft_drop_items(oKiller);
|
||||
|
||||
ExecuteScript("prc_npc_death", OBJECT_SELF);
|
||||
ExecuteScript("prc_pwondeath", OBJECT_SELF);
|
||||
}
|
||||
|
||||
void ClearEnemyLocation()
|
||||
{
|
||||
DeleteLocalInt(OBJECT_SELF, sHenchLastHeardOrSeen);
|
||||
DeleteLocalLocation(OBJECT_SELF, sHenchLastHeardOrSeen);
|
||||
|
||||
object oInvisTarget = GetLocalObject(OBJECT_SELF, sHenchLastHeardOrSeen);
|
||||
if (GetIsObjectValid(oInvisTarget))
|
||||
{
|
||||
DestroyObject(oInvisTarget);
|
||||
DeleteLocalObject(OBJECT_SELF, sHenchLastHeardOrSeen);
|
||||
}
|
||||
}
|
||||
30
_removed/nw_c2_default8.nss
Normal file
30
_removed/nw_c2_default8.nss
Normal file
@@ -0,0 +1,30 @@
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: NW_C2_DEFAULT8
|
||||
/*
|
||||
Default OnDisturbed event handler for NPCs.
|
||||
*/
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: Copyright (c) 2002 Floodgate Entertainment
|
||||
//:: Created By: Naomi Novik
|
||||
//:: Created On: 12/22/2002
|
||||
//:://////////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_generic"
|
||||
|
||||
void main()
|
||||
{
|
||||
ExecuteScript("prc_npc_disturb", OBJECT_SELF);
|
||||
|
||||
object oTarget = GetLastDisturbed();
|
||||
|
||||
// If we've been disturbed and are not already fighting,
|
||||
// attack our disturber.
|
||||
if (GetIsObjectValid(oTarget) && !GetIsFighting(OBJECT_SELF)) {
|
||||
DetermineCombatRound(oTarget);
|
||||
}
|
||||
|
||||
// Send the disturbed flag if appropriate.
|
||||
if(GetSpawnInCondition(NW_FLAG_DISTURBED_EVENT)) {
|
||||
SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_DISTURBED));
|
||||
}
|
||||
}
|
||||
20
_removed/nw_c2_defaulta.nss
Normal file
20
_removed/nw_c2_defaulta.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Default: On Rested
|
||||
//:: NW_C2_DEFAULTA
|
||||
//:: Copyright (c) 2002 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Determines the course of action to be taken
|
||||
after having just rested.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Don Moar
|
||||
//:: Created On: April 28, 2002
|
||||
//:://////////////////////////////////////////////
|
||||
void main()
|
||||
{
|
||||
ExecuteScript("prc_npc_rested", OBJECT_SELF);
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
164
_removed/nw_c2_defaultb.nss
Normal file
164
_removed/nw_c2_defaultb.nss
Normal file
@@ -0,0 +1,164 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Default: On Spell Cast At
|
||||
//:: NW_C2_DEFAULTB
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
This determines if the spell just cast at the
|
||||
target is harmful or not.
|
||||
|
||||
GZ 2003-Oct-02 : - New AoE Behavior AI. Will use
|
||||
Dispel Magic against AOES
|
||||
- Flying Creatures will ignore
|
||||
Grease
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Dec 6, 2001
|
||||
//:: Last Modified On: 2003-Oct-13
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Modified By: Deva Winblood
|
||||
//:: Modified On: Jan 4th, 2008
|
||||
//:: Added Support for Mounted Combat Feat Support
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_generic"
|
||||
#include "x2_i0_spells"
|
||||
#include "creature_inc"
|
||||
|
||||
void main()
|
||||
{
|
||||
ExecuteScript("prc_npc_spellat", OBJECT_SELF);
|
||||
|
||||
// If non-harmful spell was cast, it possibly was a heal, update the Creature name
|
||||
if (!GetLastSpellHarmful())
|
||||
creature_SetName(OBJECT_SELF);
|
||||
|
||||
object oCaster = GetLastSpellCaster();
|
||||
|
||||
|
||||
if(GetLastSpellHarmful())
|
||||
{
|
||||
SetCommandable(TRUE);
|
||||
|
||||
if (!GetLocalInt(GetModule(),"X3_NO_MOUNTED_COMBAT_FEAT"))
|
||||
{ // set variables on target for mounted combat
|
||||
DeleteLocalInt(OBJECT_SELF,"bX3_LAST_ATTACK_PHYSICAL");
|
||||
} // set variables on target for mounted combat
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// If I was hurt by someone in my own faction
|
||||
// Then clear any hostile feelings I have against them
|
||||
// After all, we're all just trying to do our job here
|
||||
// if we singe some eyebrow hair, oh well.
|
||||
// ------------------------------------------------------------------
|
||||
if (GetFactionEqual(oCaster, OBJECT_SELF) == TRUE)
|
||||
{
|
||||
ClearPersonalReputation(oCaster, OBJECT_SELF);
|
||||
ClearAllActions(TRUE);
|
||||
DelayCommand(1.2, ActionDoCommand(DetermineCombatRound(OBJECT_INVALID)));
|
||||
// Send the user-defined event as appropriate
|
||||
if(GetSpawnInCondition(NW_FLAG_SPELL_CAST_AT_EVENT))
|
||||
{
|
||||
SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_SPELL_CAST_AT));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
int bAttack = TRUE;
|
||||
// ------------------------------------------------------------------
|
||||
// GZ, 2003-Oct-02
|
||||
// Try to do something smart if we are subject to an AoE Spell.
|
||||
// ------------------------------------------------------------------
|
||||
if (MatchAreaOfEffectSpell(GetLastSpell()) == TRUE)
|
||||
{
|
||||
int nAI = (GetBestAOEBehavior(GetLastSpell())); // from x2_i0_spells
|
||||
switch (nAI)
|
||||
{
|
||||
case X2_SPELL_AOEBEHAVIOR_DISPEL_L:
|
||||
case X2_SPELL_AOEBEHAVIOR_DISPEL_N:
|
||||
case X2_SPELL_AOEBEHAVIOR_DISPEL_M:
|
||||
case X2_SPELL_AOEBEHAVIOR_DISPEL_G:
|
||||
case X2_SPELL_AOEBEHAVIOR_DISPEL_C:
|
||||
bAttack = FALSE;
|
||||
ActionCastSpellAtLocation(nAI, GetLocation(OBJECT_SELF));
|
||||
ActionDoCommand(SetCommandable(TRUE));
|
||||
SetCommandable(FALSE);
|
||||
break;
|
||||
|
||||
case X2_SPELL_AOEBEHAVIOR_FLEE:
|
||||
ClearActions(CLEAR_NW_C2_DEFAULTB_GUSTWIND);
|
||||
oCaster = GetLastSpellCaster();
|
||||
ActionForceMoveToObject(oCaster, TRUE, 2.0);
|
||||
DelayCommand(1.2, ActionDoCommand(DetermineCombatRound(oCaster)));
|
||||
bAttack = FALSE;
|
||||
break;
|
||||
|
||||
case X2_SPELL_AOEBEHAVIOR_IGNORE:
|
||||
// well ... nothing
|
||||
break;
|
||||
|
||||
case X2_SPELL_AOEBEHAVIOR_GUST:
|
||||
ActionCastSpellAtLocation(SPELL_GUST_OF_WIND, GetLocation(OBJECT_SELF));
|
||||
ActionDoCommand(SetCommandable(TRUE));
|
||||
SetCommandable(FALSE);
|
||||
bAttack = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
// ---------------------------------------------------------------------
|
||||
// Not an area of effect spell, but another hostile spell.
|
||||
// If we're not already fighting someone else,
|
||||
// attack the caster.
|
||||
// ---------------------------------------------------------------------
|
||||
if( !GetIsFighting(OBJECT_SELF) && bAttack)
|
||||
{
|
||||
if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL))
|
||||
{
|
||||
DetermineSpecialBehavior(oCaster);
|
||||
}
|
||||
else
|
||||
{
|
||||
DetermineCombatRound(oCaster);
|
||||
}
|
||||
}
|
||||
|
||||
// We were attacked, so yell for help
|
||||
SetCommandable(TRUE);
|
||||
//Shout Attack my target, only works with the On Spawn In setup
|
||||
SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK);
|
||||
|
||||
//Shout that I was attacked
|
||||
SpeakString("NW_I_WAS_ATTACKED", TALKVOLUME_SILENT_TALK);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ---------------------------------------------------------------------
|
||||
// July 14, 2003 BK
|
||||
// If there is a valid enemy nearby and a NON HARMFUL spell has been
|
||||
// cast on me I should call DetermineCombatRound
|
||||
// I may be invisible and casting spells on myself to buff myself up
|
||||
// ---------------------------------------------------------------------
|
||||
// Fix: JE - let's only do this if I'm currently in combat. If I'm not
|
||||
// in combat, and something casts a spell on me, it'll make me search
|
||||
// out the nearest enemy, no matter where they are on the level, which
|
||||
// is kinda dumb.
|
||||
object oEnemy =GetNearestEnemy();
|
||||
if ((GetIsObjectValid(oEnemy) == TRUE) && (GetIsInCombat() == TRUE))
|
||||
{
|
||||
// SpeakString("keep me in combat");
|
||||
DetermineCombatRound(oEnemy);
|
||||
}
|
||||
}
|
||||
|
||||
// Send the user-defined event as appropriate
|
||||
if(GetSpawnInCondition(NW_FLAG_SPELL_CAST_AT_EVENT))
|
||||
{
|
||||
SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_SPELL_CAST_AT));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
51
_removed/nw_c2_defaulte.nss
Normal file
51
_removed/nw_c2_defaulte.nss
Normal file
@@ -0,0 +1,51 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Default On Blocked
|
||||
//:: NW_C2_DEFAULTE
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
This will cause blocked creatures to open
|
||||
or smash down doors depending on int and
|
||||
str.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Nov 23, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
ExecuteScript("prc_npc_blocked", OBJECT_SELF);
|
||||
|
||||
object oDoor = GetBlockingDoor();
|
||||
if (GetObjectType(oDoor) == OBJECT_TYPE_CREATURE)
|
||||
{
|
||||
// * Increment number of times blocked
|
||||
/*SetLocalInt(OBJECT_SELF, "X2_NUMTIMES_BLOCKED", GetLocalInt(OBJECT_SELF, "X2_NUMTIMES_BLOCKED") + 1);
|
||||
if (GetLocalInt(OBJECT_SELF, "X2_NUMTIMES_BLOCKED") > 3)
|
||||
{
|
||||
SpeakString("Blocked by creature");
|
||||
SetLocalInt(OBJECT_SELF, "X2_NUMTIMES_BLOCKED",0);
|
||||
ClearAllActions();
|
||||
object oEnemy = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY);
|
||||
if (GetIsObjectValid(oEnemy) == TRUE)
|
||||
{
|
||||
ActionEquipMostDamagingRanged(oEnemy);
|
||||
ActionAttack(oEnemy);
|
||||
}
|
||||
return;
|
||||
} */
|
||||
return;
|
||||
}
|
||||
if(GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) >= 5)
|
||||
{
|
||||
if(GetIsDoorActionPossible(oDoor, DOOR_ACTION_OPEN) && GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) >= 7 )
|
||||
{
|
||||
DoDoorAction(oDoor, DOOR_ACTION_OPEN);
|
||||
}
|
||||
else if(GetIsDoorActionPossible(oDoor, DOOR_ACTION_BASH))
|
||||
{
|
||||
DoDoorAction(oDoor, DOOR_ACTION_BASH);
|
||||
}
|
||||
}
|
||||
}
|
||||
4
_removed/nw_ch_aca.nss
Normal file
4
_removed/nw_ch_aca.nss
Normal file
@@ -0,0 +1,4 @@
|
||||
void main()
|
||||
{
|
||||
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user