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: Add DBCStores access via Lua with getters for DBC entries #222

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

Conversation

iThorgrim
Copy link

@iThorgrim iThorgrim commented Jan 22, 2025

This pull request introduces functionality to access and interact with DBC data through Lua in Eluna, enabling developers to retrieve and utilize server-loaded DBC entries programmatically.

Key Features:

  1. DBC Entry Lookup:
    • Load specific DBC entries using the table name and a primary key.
    • Example:
      local spell_dbc = LookupEntry("Spell", 133)
  2. Getters:
    • Retrieve DBC attributes using predefined getter methods for the loaded entry.
    • Example:
      print(spell_dbc:GetSpellFamilyName())

Test performed :

Lua Script:

print("=== Testing DBCStores Access ===")

-- Test 1: Lookup a Spell DBC entry
local spell_dbc = LookupEntry("Spell", 133) -- Fireball
if spell_dbc then
    print("Test 1: Spell DBC entry found!")
    print("Spell Family Name:", spell_dbc:GetSpellFamilyName())
    print("Spell School Mask:", spell_dbc:GetSchoolMask())
else
    print("Test 1: Failed to find Spell DBC entry!")
end

-- Test 2: Lookup a GemProperties entry
local gem_dbc = LookupEntry("GemProperties", 21)
if gem_dbc then
    print("Test 2: GemProperties DBC entry found!")
    print("ID:", gem_dbc:GetId())
    print("Spell Item Enchantement:", gem_dbc:GetSpellItemEnchantement())
else
    print("Test 2: Failed to find GemProperties DBC entry!")
end

-- Test 3: Invalid DBC entry
local invalid_dbc = LookupEntry("InvalidTable", 999)

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.

1 participant