Skip to content

Health Prediction

Using Health Prediction SDK

WARNING

Before using the SDK you need to instantiate it using sdk_init::health_prediction() - example provided on this page

Predict Object Health

float sdk::health_prediction->get_predicted_health( game_object* target, const float time )

INFO

The time argument is in seconds from the start of the game - like g_sdk->clock_facade->get_game_time()

Example predicting hovered target health in 0.25 seconds

cpp
const auto hovered_target = g_sdk->hud_manager->get_hovered_target();
if ( hovered_target )
{
    const auto game_time = g_sdk->clock_facade->get_game_time();
    const auto predicted_health = sdk::health_prediction->get_predicted_health( hovered_target, game_time + 0.25f );
    g_sdk->log_console( "%s health will be %.2f (currently %.2f)", hovered_target->get_char_name().c_str(), predicted_health, hovered_target->get_hp() );
}
const auto hovered_target = g_sdk->hud_manager->get_hovered_target();
if ( hovered_target )
{
    const auto game_time = g_sdk->clock_facade->get_game_time();
    const auto predicted_health = sdk::health_prediction->get_predicted_health( hovered_target, game_time + 0.25f );
    g_sdk->log_console( "%s health will be %.2f (currently %.2f)", hovered_target->get_char_name().c_str(), predicted_health, hovered_target->get_hp() );
}

Getting an Ally Minion Focus

To get the ally minion focus you may use the function
game_object* sdk::health_prediction->get_minion_focus( game_object* source )