[DiscordArchive] uint32values: is this the ElunaQuery:GetUInt32?
[DiscordArchive] uint32values: is this the ElunaQuery:GetUInt32?
Archived author: kabi • Posted: 2024-05-01T18:36:07.922000+00:00
Original source
it's better in general performance-wise to do it via these methods?
Archived author: Foe • Posted: 2024-05-01T18:36:37.277000+00:00
Original source
yes
Archived author: kabi • Posted: 2024-05-01T18:41:04.001000+00:00
Original source
this may be offtopic, but does your commit need to be adopted by mod-eluna? or does "porting it" mean that the base is already there in mod-eluna and one does "only" need to add it?
Archived author: kabi • Posted: 2024-05-01T18:41:59.547000+00:00
Original source
if the latter is the case i think i'll dive in
Archived author: Foe • Posted: 2024-05-01T18:42:50.484000+00:00
Original source
mod-eluna is a fork of Eluna maintained by Azerothcore
Archived author: Foe • Posted: 2024-05-01T18:43:14.754000+00:00
Original source
Quite a bit behind atm but I assume they'd accept a PR
Archived author: kabi • Posted: 2024-05-01T18:45:20.224000+00:00
Original source
ok, thank you for clarifying
ush(L, creature->GetCreatureTemplate()->rank);Archived author: kabi • Posted: 2024-05-01T20:18:00.709000+00:00
Original source
i figured it out Foe
mod-eluna
- CreatureMethods.h
```c++
/**
* Returns the [Creature]'s rank.
*
* @return [Rank] rank
*/
int GetRank(lua_State* L, Creature* creature)
{
Eluna:
ush(L, creature->GetCreatureTemplate()->rank);
return 1;
}
```
- LuaFunctions.cpp
```c++
ElunaRegister<Creature> CreatureMethods[] =
{
// Getters
// ...
{ "GetRank", &LuaCreature::GetRank },
// ...
};
```
lua_scripts
- test-rare.lua
```lua
local function PlayerKillsRare(event, player)
local creature = player:GetSelection()
if creature then
if (creature:GetRank() == 2) then
print("Rare creature killed.")
else
print("Normal creature killed.")
end
else
return false;
end
end
RegisterPlayerEvent(7, PlayerKillsRare)
```
this prints the expected values to the console
now i just need to learn how to use Github and PRs. thank you for nudging me in the right direction.
Archived author: Foe • Posted: 2024-05-01T20:24:50.764000+00:00
Original source
gj