2025/07/28 Update
Added PEPS AI Full compile.
This commit is contained in:
@@ -1,35 +1,54 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: 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
|
||||
//:: Modified by Zarathstra217
|
||||
//:://////////////////////////////////////////////
|
||||
#include "z217_behold"
|
||||
object oBeholder=GetAreaOfEffectCreator();
|
||||
/*//////////////////////////////////////////////////////////////////////////////
|
||||
Script: nw_c2_defaulte
|
||||
Programmer: Philos
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Monsters OnBlocked event script;
|
||||
Can be blocked by a creature or door.
|
||||
*///////////////////////////////////////////////////////////////////////////////
|
||||
#include "0i_associates"
|
||||
void main()
|
||||
{
|
||||
object oDoor = GetBlockingDoor();
|
||||
|
||||
ExecuteScript("prc_npc_blocked", OBJECT_SELF);
|
||||
|
||||
if(GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) >= 5)
|
||||
object oCreature = OBJECT_SELF;
|
||||
ExecuteScript("prc_npc_blocked", oCreature);
|
||||
// This actually gets either a Creature or Door that is blocking OBJECT_SELF.
|
||||
object oObject = GetBlockingDoor();
|
||||
if(AI_DEBUG) ai_Debug("nw_c2_defaulte", "14", GetName(oCreature) + " is being blocked by " + GetName(oObject));
|
||||
int nObjectType = GetObjectType(oObject);
|
||||
if(nObjectType == OBJECT_TYPE_CREATURE)
|
||||
{
|
||||
if(GetIsDoorActionPossible(oDoor, DOOR_ACTION_OPEN) && GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) >= 7 )
|
||||
if(GetIsEnemy(oObject, oCreature))
|
||||
{
|
||||
DoDoorAction(oDoor, DOOR_ACTION_OPEN);
|
||||
}
|
||||
else if(GetIsDoorActionPossible(oDoor, DOOR_ACTION_BASH))
|
||||
{
|
||||
Disintegrate(oDoor); //DoDoorAction(oDoor, DOOR_ACTION_BASH);
|
||||
if(ai_CanIAttack(oCreature) && ai_GetIsInCombat(oCreature))
|
||||
{
|
||||
ai_DoMonsterCombatRound(oCreature);
|
||||
return;
|
||||
}
|
||||
if(ai_CheckForCombat(oCreature, TRUE)) return;
|
||||
}
|
||||
}
|
||||
// Anything below blocking us is a door.
|
||||
if(nObjectType != OBJECT_TYPE_DOOR) return;
|
||||
// Only open the door if the player has turned door opening on.
|
||||
if(!GetLocalInt(GetModule(), AI_RULE_OPEN_DOORS)) return;
|
||||
//if(GetLockKeyTag(oObject) != "") return;
|
||||
else if(GetIsDoorActionPossible(oObject, DOOR_ACTION_OPEN) &&
|
||||
GetAbilityScore(oCreature, ABILITY_INTELLIGENCE) >= 5)
|
||||
{
|
||||
if(AI_DEBUG) ai_Debug("nw_c2_defaulte", "33", GetName(oCreature) + " is opening " + GetName(oObject));
|
||||
DoDoorAction(oObject, DOOR_ACTION_OPEN);
|
||||
return;
|
||||
}
|
||||
// If we are in combat we should ignore doors that do not easily open.
|
||||
if(GetIsDoorActionPossible(oObject, DOOR_ACTION_BASH) &&
|
||||
ai_GetWeaponDamage(oCreature, 3, TRUE) > GetHardness(oObject) &&
|
||||
GetLockKeyTag(oObject) == "")
|
||||
{
|
||||
ActionWait(1.0);
|
||||
ActionAttack(oObject);
|
||||
// Give them 3 rounds to break through a door.
|
||||
DelayCommand(18.0, ai_ClearCreatureActions(TRUE));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user