Initial upload
Initial upload. PRC8 has been added. Module compiles, PRC's default AI & treasure scripts have been integrated. Started work on top hak for SLA / Ability / Scripting modifications.
This commit is contained in:
85
_module/nss/nw_c2_defaulte.nss
Normal file
85
_module/nss/nw_c2_defaulte.nss
Normal file
@@ -0,0 +1,85 @@
|
||||
/////::///////////////////////////////////////////////
|
||||
//:: 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
|
||||
//:://////////////////////////////////////////////
|
||||
#include "NW_I0_GENERIC"
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
ExecuteScript("prc_npc_blocked", OBJECT_SELF);
|
||||
|
||||
object oDoor = GetBlockingDoor();
|
||||
if (GetObjectType(oDoor) == OBJECT_TYPE_CREATURE)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
/* object oDoor = GetBlockingDoor();
|
||||
object oTarget=GetTarget();
|
||||
//debug
|
||||
//SpeakString("I am blocked");
|
||||
//AssignCommand(oDoor,SpeakString("I am the door"));
|
||||
|
||||
if((GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) >= 5)&&(GetObjectType(oDoor)==OBJECT_TYPE_DOOR))
|
||||
{
|
||||
// SpeakString("I have the int");
|
||||
|
||||
|
||||
if( GetLocked( oDoor))
|
||||
{
|
||||
//SpeakString("It is locked");
|
||||
|
||||
if(GetIsObjectValid(GetItemPossessedBy( OBJECT_SELF, GetLockKeyTag( oDoor))))
|
||||
{
|
||||
//SpeakString("I have the key and I'm trying to open it");
|
||||
|
||||
SetLocked(oDoor, 0);
|
||||
ClearAllActions();
|
||||
ActionOpenDoor(oDoor);
|
||||
if (GetIsObjectValid(oTarget)&&!GetIsFighting(OBJECT_SELF))
|
||||
{
|
||||
ActionMoveToObject(oTarget);
|
||||
}
|
||||
//AssignCommand(oDoor,ActionOpenDoor(oDoor));
|
||||
//ActionOpenDoor(oDoor);
|
||||
}
|
||||
else
|
||||
{
|
||||
//SpeakString("I dont have the key it needs");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//SpeakString("It's *not* locked and I'm trying to open it");
|
||||
ClearAllActions();
|
||||
ActionOpenDoor(oDoor);
|
||||
if (GetIsObjectValid(oTarget)&&!GetIsFighting(OBJECT_SELF))
|
||||
{
|
||||
ActionMoveToObject(oTarget);
|
||||
}
|
||||
// AssignCommand(oDoor,ActionOpenDoor(oDoor));
|
||||
//ActionOpenDoor(oDoor);
|
||||
}
|
||||
} */
|
||||
}
|
||||
Reference in New Issue
Block a user