Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(LuaEngine): Add SpellInfo & SpellEffectInfo methods #242

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

iThorgrim
Copy link

@iThorgrim iThorgrim commented Jan 25, 2025

📝 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants