Added Elite Troll creature

Added Elite Troll creature.
This commit is contained in:
Jaysyn904
2023-01-25 21:49:47 -05:00
parent edb3ec4afe
commit b2c9230e9b
10 changed files with 968 additions and 93 deletions

View File

@@ -15,34 +15,36 @@ void main()
{
object oNPC = OBJECT_SELF;
object oAttacker;
string sResRef = GetResRef(oNPC);
effect eSleep = EffectSleep();
//:: Handles troll regen
if(sResRef == "ra_troll001" || sResRef == "TROLL_FEDORLA")
{
if(GetLocalInt(oNPC, "nSubDual") > 0)
{
SetLocalInt(oNPC, "nSubDual", GetLocalInt(oNPC, "nSubDual") - 5);
effect eSleep = EffectSleep();
if(GetLocalInt(oNPC, "nSubDual") < GetCurrentHitPoints(oNPC))
{
RemoveEffect(oNPC, eSleep);
}
//:: Handles troll regen
if(sResRef == "ra_troll001"
|| sResRef == "ra_troll002"
|| sResRef == "TROLL_FEDORLA")
{
if(GetLocalInt(oNPC, "nSubDual") > 0)
{
SetLocalInt(oNPC, "nSubDual", GetLocalInt(oNPC, "nSubDual") - 5);
if(GetLocalInt(oNPC, "nSubDual") < GetCurrentHitPoints(oNPC))
{
RemoveEffect(oNPC, eSleep);
}
if(GetLocalInt(oNPC, "nSubDual") > GetCurrentHitPoints(oNPC))
{
SpeakString("I am still unconscious!");
SetIsDestroyable(FALSE, TRUE, TRUE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSleep, OBJECT_SELF, 6.5f);
}
//SpeakString("My Subdual is now " + IntToString(GetLocalInt(oNPC, "nSubDual")));
if(GetLocalInt(oNPC, "nSubDual") > GetCurrentHitPoints(oNPC))
{
SpeakString("I am still unconscious!");
SetIsDestroyable(FALSE, TRUE, TRUE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSleep, OBJECT_SELF, 6.5f);
}
SpeakString("My Subdual is now " + IntToString(GetLocalInt(oNPC, "nSubDual")));
}
}
}
//:: Equips best armor
if ((!GetIsInCombat(oNPC) && (GetItemInSlot(INVENTORY_SLOT_CHEST) == OBJECT_INVALID)))