-
Member
[QUESTION] GetSpellIDByName (3.3.5a)
Hi,
I was wondering if anyone knew how to use the GetSpellIDByName function on patch 3.3.5a.
I've been trying with various variable types and it always crashes.
Has anyone here been able to successfully return the spell ID?
-
Member
Last edited by =manzarek=; 10-16-2013 at 04:39 PM.
-
Member
Thanks but that won't help me for what I'm trying to do. I'll however look into GetSpellInfo(ID);
-
Member
-
Maybe you should explain a bit more what you're trying to achieve and how/what you tried. Right now, you are asking for spoonfeeding.
Also, have a look at:
https://github.com/miceiken/IceFlake...lCollection.cs
https://github.com/miceiken/IceFlake...ts/WoWSpell.cs
-
Member
I'm trying to get the spell ID by name.
Basically the function takes two arguments, both integers, but I don't know what to pass to them.
-
Banned for scamming
Well just take a look at how the func is called and how args is handled, from what I see first arg is the char* of the spell name, and second a reference to a DWORD.
-
Member
-
Member
Here is the method i am using
Code:
int GetSpellIdByName(lua_State* L)
{
// Check if the first argument is a string.
if (!lua_isstring(L, 1))
{
// If not, display an error message.
DisplayError(L, "GetSpellIdFromName: Invalid argument. Expected a string.");
lua_pushnil(L); // Push nil onto the Lua stack to represent an error.
return 1; // Return the number of values pushed onto the stack (1 in this case).
}
// Convert the Lua string argument to a C string.
const char* SpellName = ToString(L, 1);
// Variables to store the rank and SpellId.
int rank;
int Spellid = ((int(__cdecl*)(const char*, int*))0x00540200)(SpellName, &rank);
// Push the SpellId onto the Lua stack and return 1 (number of values pushed).
lua_pushinteger(L, Spellid);
return 1;
}
-
Contributor
For a moment i thought there was a active topic. But you replied to a 10 year old topic... Good job
-
Member
Id love a active wotlk 3.3.5a topic sharing idea's and stuff but seems to me no one really working on wotlk anymore.
-
Member
I'm working on an internal, just don't post much, have been learning from previous posts Currently figuring out calling these Lua funcs
-
Member
if you are up for sharing knowledge and want to chat, message me and well exchange discords. i am more then happy to share with people willing to learn
-
Post Thanks / Like - 1 Thanks
unsigned (1 members gave Thanks to Turtle25 for this useful post)