# SpellData
# Description
The SpellData class contains static data information for skills, such as skill name, cast range, projectile speed, etc., which typically does not change during gameplay.
# How to Use
AIBaseClient* hero = ObjectManager::Player();
if (hero) {
SpellDataInst* qSpell = hero->GetSpell(eSpellSlot::Q);
if (qSpell) {
SpellData* spellData = qSpell->SData();
if (spellData) {
float range = spellData->CastRange();
// Use skill range data
}
}
}
# Hash
std::uint32_t Hash()
Gets the hash value of the skill.
SpellData* spellData = qSpell->SData();
if (spellData) {
std::uint32_t hash = spellData->Hash();
// Use skill hash value
}
# Name
const char* Name()
Gets the name of the skill.
SpellData* spellData = qSpell->SData();
if (spellData) {
const char* name = spellData->Name();
// Use skill name
}
# TargettingType
eSpellDataTargetType TargettingType()
Gets the target type of the skill.
SpellData* spellData = qSpell->SData();
if (spellData) {
eSpellDataTargetType targetType = spellData->TargettingType();
if (targetType == eSpellDataTargetType::LocationAoe) {
// This is an area skill
}
}
# SpellTotalTime
float SpellTotalTime()
Gets the total casting time of the skill.
SpellData* spellData = qSpell->SData();
if (spellData) {
float totalTime = spellData->SpellTotalTime();
// Use skill total casting time
}
# SpellTotalTimeArray
float SpellTotalTimeArray(int level)
Gets the total casting time of the skill at a specified level.
Parameter Name | Parameter Type | Description |
---|---|---|
level | int | Skill level |
SpellData* spellData = qSpell->SData();
if (spellData) {
int level = qSpell->Level();
float totalTime = spellData->SpellTotalTimeArray(level);
// Use total casting time of the skill at current level
}
# CastRange
float CastRange()
Gets the cast range of the skill.
SpellData* spellData = qSpell->SData();
if (spellData) {
float range = spellData->CastRange();
// Use skill cast range
}
# CastRangeArray
float CastRangeArray(int level)
Gets the cast range of the skill at a specified level.
Parameter Name | Parameter Type | Description |
---|---|---|
level | int | Skill level |
SpellData* spellData = qSpell->SData();
if (spellData) {
int level = qSpell->Level();
float range = spellData->CastRangeArray(level);
// Use cast range of the skill at current level
}
# MissileSpeed
float MissileSpeed()
Gets the speed of the skill projectile.
SpellData* spellData = qSpell->SData();
if (spellData) {
float missileSpeed = spellData->MissileSpeed();
// Use skill projectile speed
}
# LineWidth
float LineWidth()
Gets the width of a linear skill.
SpellData* spellData = qSpell->SData();
if (spellData) {
float width = spellData->LineWidth();
// Use linear skill width
}
# Icon
uintptr_t* Icon(uint8_t index = 0)
Gets the icon of the skill.
Parameter Name | Parameter Type | Description |
---|---|---|
index | uint8_t | Icon index, default is 0 |
SpellData* spellData = qSpell->SData();
if (spellData) {
uintptr_t* icon = spellData->Icon();
if (icon) {
// Use skill icon
}
}
← Spell SpellDataInst →