mod-eluna icon indicating copy to clipboard operation
mod-eluna copied to clipboard

Feat(LuaEngine): Add SpellInfo & SpellEffectInfo methods

Open iThorgrim opened this issue 11 months ago • 1 comments

📝 Description

This pull request introduces a lot of new methods in mod-eluna for Spell, SpellInfo, SpellEffectInfo:

  • GetName
  • HasAttribute
  • GetAttributes
  • IsAffectingArea
  • GetCategory ...

🆕 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

image

iThorgrim avatar Jan 25 '25 15:01 iThorgrim

@iThorgrim build is failing. I'll happily merge this next when it works.

55Honey avatar Feb 11 '25 19:02 55Honey