Feat(Documentation): Add missing documentation for all methods and classes (#315)

This commit is contained in:
Aldori
2025-09-17 09:01:24 -04:00
committed by GitHub
parent 313596f86e
commit b559d02658
20 changed files with 498 additions and 55 deletions

View File

@@ -7,6 +7,13 @@
#ifndef SPELLENTRYMETHODS_H
#define SPELLENTRYMETHODS_H
/***
* Represents spell data loaded from the DBCs, including effects, costs, attributes, and requirements.
*
* Used for inspecting the properties of any spell in the game, such as mana cost, targets, or effects.
*
* Inherits all methods from: none
*/
namespace LuaSpellEntry
{
/**
@@ -152,6 +159,13 @@ namespace LuaSpellEntry
return 1;
}
/**
* Returns the stance restriction bitmask for which the [SpellEntry] cannot be used.
*
* This mask indicates which shapeshift forms (stances) prevent the spell from being cast.
*
* @return uint32 stancesNotMask
*/
int GetStancesNot(lua_State* L, SpellEntry* entry)
{
Eluna::Push(L, entry->StancesNot);
@@ -180,66 +194,143 @@ namespace LuaSpellEntry
return 1;
}
/**
* Returns the SpellFocus ID required to cast this [SpellEntry].
*
* Some spells require proximity to a specific game object (e.g., a brazier or altar).
*
* @return uint32 spellFocusId
*/
int GetRequiresSpellFocus(lua_State* L, SpellEntry* entry)
{
Eluna::Push(L, entry->RequiresSpellFocus);
return 1;
}
/**
* Returns the facing flags for this [SpellEntry].
*
* Indicates whether the caster must be facing the target or meet other orientation constraints.
*
* @return uint32 facingFlags
*/
int GetFacingCasterFlags(lua_State* L, SpellEntry* entry)
{
Eluna::Push(L, entry->FacingCasterFlags);
return 1;
}
/**
* Returns the required caster aura state for this [SpellEntry].
*
* The spell can only be cast if the caster has a specific aura state active.
*
* @return uint32 casterAuraState
*/
int GetCasterAuraState(lua_State* L, SpellEntry* entry)
{
Eluna::Push(L, entry->CasterAuraState);
return 1;
}
/**
* Returns the required target aura state for this [SpellEntry].
*
* The spell can only be cast if the target has a specific aura state active.
*
* @return uint32 targetAuraState
*/
int GetTargetAuraState(lua_State* L, SpellEntry* entry)
{
Eluna::Push(L, entry->TargetAuraState);
return 1;
}
/**
* Returns the forbidden caster aura state for this [SpellEntry].
*
* The spell cannot be cast if the caster has this aura state active.
*
* @return uint32 casterAuraStateNot
*/
int GetCasterAuraStateNot(lua_State* L, SpellEntry* entry)
{
Eluna::Push(L, entry->CasterAuraStateNot);
return 1;
}
/**
* Returns the forbidden target aura state for this [SpellEntry].
*
* The spell cannot be cast if the target has this aura state active.
*
* @return uint32 targetAuraStateNot
*/
int GetTargetAuraStateNot(lua_State* L, SpellEntry* entry)
{
Eluna::Push(L, entry->TargetAuraStateNot);
return 1;
}
/**
* Returns the required aura spell ID that must be on the caster.
*
* The spell can only be cast if the caster has an aura from this spell.
*
* @return uint32 casterAuraSpellId
*/
int GetCasterAuraSpell(lua_State* L, SpellEntry* entry)
{
Eluna::Push(L, entry->CasterAuraSpell);
return 1;
}
/**
* Returns the required aura spell ID that must be on the target.
*
* The spell can only be cast if the target has an aura from this spell.
*
* @return uint32 targetAuraSpellId
*/
int GetTargetAuraSpell(lua_State* L, SpellEntry* entry)
{
Eluna::Push(L, entry->TargetAuraSpell);
return 1;
}
/**
* Returns the aura spell ID that must NOT be on the caster.
*
* The spell cannot be cast if the caster has an aura from this spell.
*
* @return uint32 excludeCasterAuraSpellId
*/
int GetExcludeCasterAuraSpell(lua_State* L, SpellEntry* entry)
{
Eluna::Push(L, entry->ExcludeCasterAuraSpell);
return 1;
}
/**
* Returns the aura spell ID that must NOT be on the target.
*
* The spell cannot be cast if the target has an aura from this spell.
*
* @return uint32 excludeTargetAuraSpellId
*/
int GetExcludeTargetAuraSpell(lua_State* L, SpellEntry* entry)
{
Eluna::Push(L, entry->ExcludeTargetAuraSpell);
return 1;
}
/**
* Returns the casting time index of this [SpellEntry].
*
* This index is used to look up the base casting time in SpellCastTimes.dbc.
*
* @return uint32 castingTimeIndex
*/
int GetCastingTimeIndex(lua_State* L, SpellEntry* entry)
{
Eluna::Push(L, entry->CastingTimeIndex);
@@ -268,24 +359,52 @@ namespace LuaSpellEntry
return 1;
}
/**
* Returns the interrupt flags for this [SpellEntry].
*
* Determines what can interrupt this spell while casting (e.g., movement, taking damage).
*
* @return uint32 interruptFlags
*/
int GetInterruptFlags(lua_State* L, SpellEntry* entry)
{
Eluna::Push(L, entry->InterruptFlags);
return 1;
}
/**
* Returns the aura interrupt flags for this [SpellEntry].
*
* Indicates what actions will break or remove the aura applied by this spell.
*
* @return uint32 auraInterruptFlags
*/
int GetAuraInterruptFlags(lua_State* L, SpellEntry* entry)
{
Eluna::Push(L, entry->AuraInterruptFlags);
return 1;
}
/**
* Returns the channel interrupt flags for this [SpellEntry].
*
* Specifies conditions under which a channeled spell will be interrupted (e.g., moving or turning).
*
* @return uint32 channelInterruptFlags
*/
int GetChannelInterruptFlags(lua_State* L, SpellEntry* entry)
{
Eluna::Push(L, entry->ChannelInterruptFlags);
return 1;
}
/**
* Returns the proc flags for this [SpellEntry].
*
* Determines the types of actions or triggers that can cause this spell to proc.
*
* @return uint32 procFlags
*/
int GetProcFlags(lua_State* L, SpellEntry* entry)
{
Eluna::Push(L, entry->ProcFlags);
@@ -899,6 +1018,14 @@ namespace LuaSpellEntry
return 1;
}
/**
* Returns a table of [SpellFamilyFlags] for each effect of this [SpellEntry].
*
* These flags are used to categorize spell effects for use with spell group logic.
* The table contains up to 3 bitmask entries, one per effect.
*
* @return table effectSpellClassMask : table of [SpellFamilyFlags] per effect
*/
int GetEffectSpellClassMask(lua_State* L, SpellEntry* entry)
{
lua_newtable(L);
@@ -1055,13 +1182,26 @@ namespace LuaSpellEntry
return 1;
}
/**
* Returns the spell family name of this [SpellEntry].
*
* This identifies the broader category or class of spells (e.g., Mage, Warrior, Rogue).
*
* @return uint32 spellFamilyName
*/
int GetSpellFamilyName(lua_State* L, SpellEntry* entry)
{
Eluna::Push(L, entry->SpellFamilyName);
return 1;
}
/**
* Returns the spell family flags of this [SpellEntry].
*
* These bitflags represent specific characteristics or subcategories of spells within a family.
*
* @return uint64 spellFamilyFlags
*/
int GetSpellFamilyFlags(lua_State* L, SpellEntry* entry)
{
Eluna::Push(L, entry->SpellFamilyFlags);
@@ -1143,6 +1283,13 @@ namespace LuaSpellEntry
return 1;
}
/**
* Returns the Area Group ID associated with this [SpellEntry].
*
* AreaGroupId is used to restrict spell usage to specific zones or areas.
*
* @return uint32 areaGroupId
*/
int GetAreaGroupId(lua_State* L, SpellEntry* entry)
{
Eluna::Push(L, entry->AreaGroupId);
@@ -2256,4 +2403,3 @@ namespace LuaSpellEntry
}
#endif