Changed folder name.
Changed folder name.
This commit is contained in:
72
_module/nss/livingstatue37.nss
Normal file
72
_module/nss/livingstatue37.nss
Normal file
@@ -0,0 +1,72 @@
|
||||
#include "NW_I0_GENERIC"
|
||||
|
||||
void main()
|
||||
{
|
||||
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));
|
||||
}
|
||||
//Check to see if weapon type is valid: not ranged, or too far away.
|
||||
object oAttacker = GetLastDamager();
|
||||
object oWeapon = GetLastWeaponUsed(oAttacker);
|
||||
if (GetTag(oWeapon) == "DancingBlade"){return;}
|
||||
if (GetWeaponRanged(oWeapon) == TRUE ||
|
||||
|
||||
GetAbilityModifier(ABILITY_STRENGTH, oAttacker) + d20(1) > 26 ||
|
||||
GetDistanceToObject(oAttacker) > 5.0)
|
||||
return;
|
||||
else if (oWeapon != OBJECT_INVALID)
|
||||
{
|
||||
SpeakString("Your weapon has been absorbed into the Living Statue!");
|
||||
DestroyObject(oWeapon); // after script is done.
|
||||
if (GetItemPossessedBy(OBJECT_SELF, GetTag(oWeapon)) == OBJECT_INVALID){
|
||||
CopyObject(oWeapon,GetLocation(OBJECT_SELF),OBJECT_SELF);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user