RATDOG/_module/nss/cr_bloodfly_hb.nss
Jaysyn904 df709d33fc Horsefly Swamp update
Creatures & encounter tables to support Horsefly swamp expansion.
2023-08-13 17:21:44 -04:00

53 lines
1.9 KiB
Plaintext

//:://////////////////////////////////////////////
//:://
/*
cr_bloodfly_hb.nss | Jaysyn 20230812
Battle Damage. Changes swarm model as HP
increases and decreases.
*/
//:://
//:://////////////////////////////////////////////
void main()
{
//:: Declare major variables
object oSwarm = OBJECT_SELF;
object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN);
int nMaxHP = GetMaxHitPoints(oSwarm);
int nHP = GetCurrentHitPoints(oSwarm);
int nAppearance;
float fHealth = 100 * nHP / IntToFloat(nMaxHP);
effect eGhost = EffectCutsceneGhost();
effect eInvis = EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY);
if (fHealth <= 32.0f)
{
nAppearance = 910; //:: Swarm, Red Flies / 05 Bugs / Tiny [Acidchalk]
//SendMessageToPC(oPC, "Switching to Swarm, Tiny 5 Creatures");
//SendMessageToAllDMs("Switching to Swarm, Tiny 5 Creatures");
}
else if (fHealth >= 33.0f && fHealth <= 65.0f)
{
nAppearance = 911; //:: Swarm, Red Flies / 10 Bugs / Tiny [Acidchalk]
//SendMessageToPC(oPC, "Switching to Swarm, Tiny 10 Creatures");
//SendMessageToAllDMs("Switching to Swarm, Tiny 10 Creatures");
}
else
{
nAppearance = 912; //:: Swarm, Red Flies / 15 Bugs / Tiny [Acidchalk]
//SendMessageToPC(oPC, "Switching to Swarm, Tiny 15 Creatures");
//endMessageToAllDMs("Switching to Swarm, Tiny 15 Creatures");
}
DelayCommand(0.0f, SetCreatureAppearanceType(oSwarm, nAppearance));
DelayCommand(0.1f, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhost, oSwarm));
//DelayCommand(0.1f, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eInvis, oSwarm, 0.1f));
DelayCommand(0.3f,AssignCommand(oSwarm, ActionPlayAnimation(ANIMATION_LOOPING_PAUSE, 1.0f, 1.0f)));
}