//::////////////////////////////////////////////// //::// /* 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))); }