waitAIHealthLevel

An eventCall that tells the idEncounterManager to wait until the specified ai type reaches a certain HP level, before executing the next eventCalls.

Usage

item[0] = {
    eventCall = {
        eventDef = "waitAIHealthLevel";
        args = {
            num = 3;
            item[0] = {
                eEncounterSpawnType_t = "ENCOUNTER_SPAWN_HELL_KNIGHT"; // spawnType
            }
            item[1] = {
                float = 0.5; // target_group_health
            }
            item[2] = {
                string = ""; // group_label
            }
        }
    }
}

Example Usage

item[0] = {
    eventCall = {
        eventDef = "spawnSingleAI";
        args = {
            num = 3;
            item[0] = {
                eEncounterSpawnType_t = "ENCOUNTER_SPAWN_CYBER_MANCUBUS"; // spawnType
            }
            item[1] = {
                entity = "game_target_spawn_1312"; // spawnTarget
            }
            item[2] = {
                string = "check health"; // group_label
            } 
        }
    }
}
item[1] = {
    eventCall = {
        eventDef = "waitAIHealthLevel";
        args = {
            num = 3;
            item[0] = {
                eEncounterSpawnType_t = "ENCOUNTER_SPAWN_CYBER_MANCUBUS"; // spawnType
            }
            item[1] = {
				float = 0.6; // target_group_health
            }
            item[2] = {
                string = "check health"; // group_label
            } 
        }
    }
}
item[2] = {
    eventCall = {
        eventDef = "spawnAI";
        args = {
            num = 4;
            item[0] = {
                eEncounterSpawnType_t = "ENCOUNTER_SPAWN_CACODEMON"; // spawnType
            }
            item[1] = {
				int = 2; // spawn_count
            }
            item[2] = {
                entity = "mod_spawngroup_flying_7"; // spawnGroup
            }
            item[3] = {
                string = "heavy"; // group_label
            }
        }
    }
}

In this example, we spawn a Cyber-Mancubus with the label check_health. Then we call waitAIHealthLevel with said spawnType and group_label, with target_group_health set to 0.6, so that when the Cyber-Mancubus is <= 60% of its HP, the encounter will proceed.

 


Revision #4
Created 6 September 2021 01:02:36 by SamPT
Updated 2 April 2023 15:09:08 by SamPT