Files
HeroesStone_PRC8/_module/nss/cr_kuotoa_dmg.nss
Jaysyn904 1eefc84201 Initial Commit
Initial Commit.
2025-09-14 15:40:46 -04:00

69 lines
2.7 KiB
Plaintext

#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));
}
// SendMessageToPC(GetLastDamager(), "Distance: " + FloatToString(GetDistanceToObject(GetLastDamager())));
// SendMessageToPC(GetLastDamager(), "Piercing: " + IntToString(GetDamageDealtByType(DAMAGE_TYPE_PIERCING)));
object oAttacker = GetLastDamager(); // Didn't work
object oWeapon = GetLastWeaponUsed(oAttacker);
ClearAllActions();
// Kuo-Toa Sticky Disarm if close
if (GetDistanceToObject(oAttacker)<4.0 && !GetWeaponRanged(oWeapon) && GetIsObjectValid(oWeapon)) {
if (!ReflexSave(GetLastDamager(), 14)) {
object oDamager=GetLastDamager();
ActionTakeItem(oWeapon, oAttacker);
ActionSpeakString("(" + ObjectToString(oDamager) +")'s weapon gets stuck against the sticky skin of the Kuo-Toa", TALKVOLUME_TALK);
// SendMessageToPC(GetLastDamager(), "The sticky nature of the Kuo-Toa's skin rips your weapon from your hand!");
}
}
ActionAttack(oAttacker);
}