Skill Functions¶
Skill Info Queries¶
All take a skill index (number) and return number.
| Function | Description |
|---|---|
GetSkillDamage(index) |
Base damage of the skill |
GetSkillMana(index) |
Mana cost |
GetSkillBP(index) |
AG (BP) cost |
GetSkillType(index) |
Skill type (attack, buff, etc.) |
GetSkillEffect(index) |
Effect ID the skill applies |
GetSkillDelay(index) |
Cooldown time |
GetSkillDamageType(index) |
Damage type (physical, magic, etc.) |
GetElementImprintBonus(index) |
Elemental imprint bonus value |
GetAddDamageOption(index) |
Additional damage option value |
local manaCost = GetSkillMana(41) -- Mana cost of skill 41
local dmg = GetSkillDamage(41)
LogAdd(LOG_BLUE, "Skill 41: damage=" .. dmg .. " mana=" .. manaCost)
Skill Info (Object-Dependent)¶
| Function | Description |
|---|---|
GetSkillRange(lpObj, index) |
Effective range for the player |
GetSkillRadio(lpObj, index) |
AoE radius for the player |
GetSkillSlot(lpObj, index) |
Slot index of the skill in the player's skill list |
GetSkillMultiCount(lpObj, lpSkill) |
Number of multi-hit targets |
GetSkillNumber(index, level)¶
Returns the resolved skill number for a base skill at a given level.
GetSkillAngle(x, y, tx, ty)¶
Calculates the angle between two positions (for frustrum skills).
- Returns:
number— angle value
AttackDirection(aIndex, bIndex)¶
Returns the attack direction byte from attacker to target.
GetDirectionAboutByte(dir)¶
Converts a direction byte to a normalized direction value.
Skill Requirement Checks¶
All return boolean.
| Function | Description |
|---|---|
CheckSkillMana(lpObj, index) |
Has enough mana |
CheckSkillBP(lpObj, index) |
Has enough AG |
CheckSkillRange(lpObj, index, x, y, tx, ty) |
Target is in range |
CheckSkillRadio(lpObj, index, x, y, tx, ty) |
Target is in AoE radius |
CheckSkillDelay(lpObj, lpSkill, type) |
Skill is not on cooldown |
CheckSkillTarget(lpObj, aIndex, bIndex, type) |
Target is valid |
CheckSkillRequireLevel(lpObj, index) |
Player meets level requirement |
CheckSkillRequireEnergy(lpObj, index) |
Player meets energy requirement |
CheckSkillRequireLeadership(lpObj, index) |
Player meets leadership requirement |
CheckSkillRequireKillPoint(lpObj, index) |
Player meets kill point requirement |
CheckSkillRequireGuildStatus(lpObj, index) |
Player meets guild status requirement |
CheckSkillRequireClass(lpObj, index) |
Skill is available for player's class |
CheckSkillRequireWeapon(lpObj, index) |
Player has the required weapon equipped |
CheckAttackRange(nIndex, nTargetIndex, nDistance, nAttackType, nSubAttackType) |
Attack range check |
if CheckSkillMana(player, 41) and CheckSkillBP(player, 41) then
LogAdd(LOG_GREEN, "Player can cast skill 41.")
end
IsSkillItem(index)¶
Returns true if the given skill index belongs to an item skill.
Skill Add/Remove¶
| Function | Description | Returns |
|---|---|---|
AddSkill(lpObj, index, level, group) |
Adds or updates a skill | number (slot) |
DelSkill(lpObj, index) |
Removes a skill | number |
GetSkill(lpObj, index) |
Gets the CSkill object | CSkill or nil |
AddSkillWeapon(lpObj, index, level) |
Adds a weapon skill | number |
DelSkillWeapon(lpObj, index, level) |
Removes a weapon skill | number |
AddMasterSkill(lpObj, index, level) |
Adds a Master skill | number |
DelMasterSkill(lpObj, index) |
Removes a Master skill | number |
GetMasterSkill(lpObj, index) |
Gets a Master CSkill | CSkill or nil |
AddEnhanceSkill(lpObj, index, level, group) |
Adds an Enhance (4th) skill | number |
AddEnhancePassiveSkill(lpObj, index, level, group) |
Adds an Enhance passive skill | number |
GetEnhanceSkill(lpObj, index, group) |
Gets an Enhance CSkill | CSkill or nil |
GetEnhancePassiveSkill(lpObj, index, group) |
Gets an Enhance passive CSkill | CSkill or nil |
AddSkill(player, 41, 1, 0) -- Add skill 41 at level 1
GCSkillListSend(player, 0) -- Refresh client skill list
Skill Tree Queries¶
| Function | Description | Returns |
|---|---|---|
CheckMasterLevel(lpObj) |
Can gain Master experience | boolean |
GetMasterSkillValue(lpObj, skillIndex) |
Computed value of a Master skill | number (float) |
GetMasterSkillLevel(lpObj, skillIndex) |
Current level of a Master skill | number |
CheckEnhanceLevel(lpObj) |
Can use 4th skill tree | boolean |
CheckAbilityLevel(lpObj) |
Can use Ability Enhancement (v1913+) | boolean |
GetEnhanceSkillValue(lpObj, skillIndex, group) |
Value of an Enhance skill | number |
if CheckMasterLevel(player) then
local val = GetMasterSkillValue(player, 300)
LogAdd(LOG_BLUE, "Master skill 300 value: " .. val)
end
Special Skill Functions¶
SkillSpinStepExplosion(lpObj, lpTarget, skillIndex, damage)¶
Executes the Spin Step Explosion skill (Rage Fighter). Available from version S6 onwards.
- Returns:
boolean
SkillMagicGladiatorExplosion(lpObj, skillIndex, damage)¶
Executes the MG Explosion skill AoE.
gObjSkillUseProc(lpObj)¶
Processes pending skill actions for the object. Used in monster AI.
These send skill-related packets to clients for visual feedback.
GCSkillAttackSend(lpObj, skillIndex, lpTarget, type)¶
Notifies clients of a skill attack animation.
GCSkillCancelSend(lpObj, skill)¶
Cancels a skill effect on the client.
GCDurationSkillAttackSend(lpObj, bIndex, skill, x, y, dir)¶
Sends a duration-based skill attack (e.g., area effects).
GCSkillActionSend(lpObj, lpSkill, bIndex, skillsuccess, x, y)¶
Sends a skill action packet (used for buff/special skills).
local sk = GetSkill(player, 41)
if sk then
GCSkillActionSend(player, sk, target.Index, 1, player.X, player.Y)
end
GCRuneWizzardSkillAttackSend(lpObj, lpSkill, tx, ty, dir, angle)¶
Sends a Rune Wizard skill attack packet.
local sk = GetSkill(player, 700)
if sk then
GCRuneWizzardSkillAttackSend(player, sk, target.X, target.Y, player.Dir, 0)
end
GCRageFighterSkillAttackSend(lpObj, skill, aIndex, type)¶
Sends a Rage Fighter skill attack packet.
GCSkillAddSend(aIndex, slot, skill, level, type)¶
Notifies the client that a skill was added.
GCSkillDelSend(aIndex, slot, skill, level, type)¶
Notifies the client that a skill was removed.
GCSkillListSend(lpObj, type)¶
Sends the full skill list to the player client.
Help