# MissileClient
# Description
The MissileClient class is used to obtain and manage properties related to projectiles in the game, such as skill slot, start position, target position, skill data, target object, and caster information.
# How to Use
// Iterate through all projectiles
for (auto missile : ObjectManager::GetAllMissile())
{
if (missile->IsValid() && missile->IsEnemy())
{
// Get the projectile's caster
AIBaseClient* caster = missile->SpellCaster();
if (caster && caster->IsValid() && caster->IsAIHero())
{
// Get the projectile's skill data
SpellData* spellData = missile->SData();
if (spellData)
{
Console::Add("Detected enemy champion %s's projectile: %s", caster->ChampionName(), spellData->Name());
}
}
}
}
# Slot
eSpellSlot Slot()
Gets the skill slot corresponding to the projectile.
eSpellSlot slot = missile->Slot();
if (slot == eSpellSlot::Q)
{
Console::Add("Detected Q skill projectile");
}
# StartPosition
Vector const& StartPosition()
Gets the starting position of the projectile.
Vector startPos = missile->StartPosition();
Console::Add("Projectile start position: %.1f, %.1f, %.1f", startPos.x, startPos.y, startPos.z);
# EndPosition
Vector const& EndPosition()
Gets the target position of the projectile.
Vector endPos = missile->EndPosition();
// Calculate projectile travel distance
float distance = startPos.Distance(endPos);
Console::Add("Projectile travel distance: %.1f", distance);
# EndPosition2
Vector const& EndPosition2()
Gets the second target position of the projectile (used by certain special skills).
Vector endPos2 = missile->EndPosition2();
# SData
SpellData* SData()
Gets the skill data of the projectile.
SpellData* spellData = missile->SData();
if (spellData)
{
Console::Add("Projectile name: %s", spellData->Name());
Console::Add("Projectile speed: %.1f", spellData->MissileSpeed());
}
# Target
AIBaseClient* Target()
Gets the target object of the projectile.
AIBaseClient* target = missile->Target();
if (target && target->IsValid() && target->IsMe())
{
Console::Add("Detected projectile targeting self!");
}
# SpellCaster
AIBaseClient* SpellCaster()
Gets the caster of the projectile.
AIBaseClient* caster = missile->SpellCaster();
if (caster && caster->IsValid() && caster->IsAIHero())
{
Console::Add("Caster: %s", caster->ChampionName());
}
← MenuOption Spell →