mod-eluna
mod-eluna copied to clipboard
Feat(LuaEngine): Add SpellInfo & SpellEffectInfo methods
📝 Description
This pull request introduces a lot of new methods in mod-eluna for Spell, SpellInfo, SpellEffectInfo:
GetNameHasAttributeGetAttributesIsAffectingAreaGetCategory...
🆕 New Methods Overview
1. GetName()
Returns the name of the SpellInfo.
Example
local spell_info = GetSpellInfo(133)
spell_info :GetName(2) -- Return spell name in French
2. GetCategory()
Retrieves the category of the
Example
local spell_info = GetSpellInfo(133)
spell_info :GetCategory()
3. IsLootCrafting()
Checks if the SpellInfo is related to loot crafting.
Example
local spell_info = GetSpellInfo(133)
spell_info :IsLootCrafting()
4. GetSpellInfo()
Return SpellInfo from Spell
Example
local spell_info = spell:GetSpellInfo()
🧪 Test Case
Test Script
local spell_info = GetSpellInfo(133)
print("SpellInfo", spell_info)
print("SpellInfo->GetName", spell_info:GetName(2))
print("SpellInfo->GetCategory", spell_info:GetCategory())
print("SpellInfo->IsLootCrafting", spell_info:IsLootCrafting())
local spell_effect = spell_info:GetEffectInfo(1)
print("SpellEffectInfo", spell_effect)
print("SpellEffectInfo->GetMiscValue", spell_effect:GetMiscValue())
print("SpellEffectInfo->GetMiscValueB", spell_effect:GetMiscValueB())
📸 Test Results
@iThorgrim build is failing. I'll happily merge this next when it works.