Giter VIP home page Giter VIP logo

mod-eluna's Introduction

Eluna

About

Eluna Lua Engine © is a lua engine embedded to World of Warcraft emulators. Eluna supports MaNGOS, CMaNGOS, TrinityCore and AzerothCore. We are currently working hard to make Eluna better from inside and outside.

If you are having trouble with installation or scripts, please feel free to open an issue. For documentation and reference see Eluna API (AC version) and Lua reference manual.

Community

You can join the official Eluna Discord server, where you'll be able to find resources, releases and support provided by the community:

The official Azerothcore Discord server offers a channel dedicated to lua development as well:

logo mod-eluna for AzerothCore

  • Latest build status with azerothcore: Build Status

english | 中文说明 | Español

An Eluna module for AzerothCore.

How to install:

1) Download the sources

You can get the sources using git.

download with git

  1. open a terminal inside your azerothcore-wotlk folder
  2. go inside the modules folder: cd modules
  3. download the module sources using:
git clone https://github.com/azerothcore/mod-eluna.git mod-eluna

2) Build

You need to run the cmake again and rebuild the project.

Eluna API for AC: https://www.azerothcore.org/pages/eluna/index.html

Documentation

Links

Additions from Eluna/master

Player

  • Added RegisterPlayerEvent 43 (PLAYER_EVENT_ON_PET_ADDED_TO_WORLD) fires for pets and summoned creatures: #3
  • Added RegisterPlayerEvent 44 (PLAYER_EVENT_ON_LEARN_SPELL): #46
  • Added RegisterPlayerEvent 45 (PLAYER_ON_ACHIEVEMENT_COMPLETE): #47
  • Added RegisterPlayerEvent 46 (PLAYER_EVENT_ON_FFAPVP_CHANGE): #63
  • Added RegisterPlayerEvent 47 (PLAYER_EVENT_ON_UPDATE_AREA): #65
  • Added RegisterPlayerEvent 48 (PLAYER_EVENT_ON_CAN_INIT_TRADE): #83
  • Added RegisterPlayerEvent 49 (PLAYER_EVENT_ON_CAN_SEND_MAIL): #85
  • Added RegisterPlayerEvent 50 (PLAYER_EVENT_ON_CAN_JOIN_LFG): #86
  • Added RegisterPlayerEvent 51 (PLAYER_EVENT_ON_QUEST_REWARD_ITEM): #88
  • Added RegisterPlayerEvent 52 (PLAYER_EVENT_ON_CREATE_ITEM): #88
  • Added RegisterPlayerEvent 53 (PLAYER_EVENT_ON_STORE_NEW_ITEM): #88
  • Added RegisterPlayerEvent 54 (PLAYER_EVENT_ON_COMPLETE_QUEST): #90
  • Added RegisterPlayerEvent 55 (PLAYER_EVENT_ON_CAN_GROUP_INVITE): #100
  • Added RegisterPlayerEvent 56 (PLAYER_EVENT_ON_GROUP_ROLL_REWARD_ITEM): #119
  • Added RegisterPlayerEvent 57 (PLAYER_EVENT_ON_BG_DESERTION): #146
  • Added Player:GetMailCount(): #76
  • Added Player:GetXP(): #77
  • Added Player:GetAchievementCriteriaProgress(): #78
  • Added vendor entry as argument to Player:SendListInventory(object, vendorentry): #48
  • Added Player:GetPlayerSettingValue() and Player:UpdatePlayerSetting(): #125
  • Added Player:GetTrader(): #126
  • Added Player:CanCompleteRepeatableQuest(questId): #141
  • Added Player:CanRewardQuest(questId): #141
  • Added Player:SetGlyph(glyphId, slotIndex): #152

Group

  • Added Group:GetGroupType(): #82
  • Added Group:SetMemberFlag(): #102

Unit

  • Added Unit:ModifyThreatPct(): #25
  • Added Unit:GetAttackers(): #116
  • Added Unit:GetThreatList(): #117
  • Added Unit:GetUnitFlags(): #137
  • Added Unit:GetUnitFlagsTwo(): #137
  • Added Unit:SetUnitFlags(flags): #137
  • Added Unit:SetUnitFlagsTwo(flags): #137
  • Added Unit:SetSpeedRate(unitMoveType, speed): #155
  • Added Unit:SetSpeedRate(): #155

GameObject

  • Added GameObject:AddLoot() to add loot at runtime to an empty container: #52

Object

  • Added Object:IsPlayer(): #42

Item

  • Added Item:GetItemTemplate(): #84

Misc

  • Added HttpRequest(): #2
  • Added GetItemTemplate(itemEntry): #84
  • Added ChatHandler methods: #23
  • Added ItemTemplate methods: #84
  • Added Roll methods: #119
  • Added logging with ELUNA_LOG_INFO for RunCommand(): #75
  • Added GetOwnerHalaa and SetOwnerHalaa: #79
  • Added WorldDBQueryAsync, CharDBQueryAsync and AuthDBQueryAsync: #113

mod-eluna's People

Contributors

55honey avatar ayasecore avatar billy1arm avatar easelm avatar foereaper avatar francescoborzi avatar h0zen avatar helias avatar ithorgrim avatar kitzunu avatar locus313 avatar myles512 avatar nefertumm avatar new-havenwotlk avatar noisiver avatar nyeriah avatar r-o-b-o-t-o avatar redskull-666 avatar rochet2 avatar ryancheung avatar salja avatar tikki100 avatar ultranix avatar veserine avatar vhiperdev avatar winfidonarleyan avatar wizzymore avatar xivan0ff avatar yehonal avatar zwisus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mod-eluna's Issues

Item:GetItemLink case server crash

RegisterPlayerEvent(PLAYER_EVENT_ON_STORE_NEW_ITEM) is fired when the player creates a character. Try to use Item:GetItemLink, the server will restart without any log.

function OnLoot(event, player, item, count)
    print(item:GetItemLink(4))
end

RegisterPlayerEvent(53, OnLoot)

error compiling with latest AC update

f8cce45e8a5b49f63c413ed250acf3f84b7ebd24

In file included from /mnt/hdd/am-code/modules/mod-eluna/src/LuaEngine/LuaFunctions.cpp:23:
/mnt/hdd/am-code/modules/mod-eluna/src/LuaEngine/UnitMethods.h:1208:31: fatal error: no member named 'name' in 'ChrRacesEntry'; did you mean 'Name'?
Eluna::Push(L, entry->name[locale]);
^~~~
Name
/mnt/hdd/am-code/src/server/shared/DataStores/DBCStructure.h:701:17: note: 'Name' declared here
char const* Name[16]; // 14-29
^
1 error generated.
make[2]: *** [modules/CMakeFiles/modules.dir/build.make:297: modules/CMakeFiles/modules.dir/mod-eluna/src/LuaEngine/LuaFunctions.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....

player:SendListInventory does not fire

want to do a multi vendor script via eluna... so wanted to use the player:SendListInventory function but nothing happens at all.

extra checked the function in PlayerMethods.h to see if it is able to call the vendor directly via entry and was like... yes it is able to...

and then nothing happens on triggering it via lua =(
here a snippet of my code e.g.:

local function MultiVendorOnGossipSelect(event, player, creature, sender, intid, code)
    if (intid == 1) then
        player:SendListInventory(creature, 500059)
        else if (intid == 2) then
            player:SendListInventory(creature, 500058)

would be really nice if somebody could look over that issue! =D
thx in advance! ^.^

Customized new hook: OnPlayerDamage

Eluna:
image

ScriptMgr:
image

ElunaScript:
image

Combat Log:
image

Perhaps it was an eluna hook encoding error
In fact, the amount of health removed by the victim was after the change. However, the client displays before the change

Allow multiple AIs in parallel

Event related to RegisterCreatureEvent

For example, for CREATURE_ EVENT_ ON_ ENTER_ The COMBAT event returns false and cannot function properly. Of course, this creature has a 'ScriptName'
Printable, indicating that the event is functioning properly
But the ScriptName of 36612 is not working properly
I returned false
Is it because once there is a ScriptName, it cannot be used simultaneously with CreatureEvent?
Creature: 36612 = boss_lord_marrowgar
Test Code:
RegisterCreatureEvent(36612,1, function(event, creature) print("go into action")-- return false; end)

I believe the expected behavior is:

  1. The console prints logs normally

  2. It should enter the appropriate ScriptName logical section

:660:65: fatal error: non-virtual member function marked 'override' hides virtual member function

/home/ubuntu/azerothcore/modules/mod-eluna/src/ElunaLuaEngine_SC.cpp:660:65: fatal error: non-virtual member function marked 'override' hides virtual member function
void OnGiveXP(Player* player, uint32& amount, Unit* victim) override
^
/home/ubuntu/azerothcore/src/server/game/Scripting/ScriptMgr.h:1038:18: note: hidden overloaded virtual function 'PlayerScript::OnGiveXP' declared here: different number of parameters (4 vs 3)
virtual void OnGiveXP(Player* /player/, uint32& /amount/, Unit* /victim/, uint8 /xpSource/) { }
^
1 error generated.
make[2]: *** [modules/CMakeFiles/modules.dir/build.make:154: modules/CMakeFiles/modules.dir/mod-eluna/src/ElunaLuaEngine_SC.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1287: modules/CMakeFiles/modules.dir/all] Error 2

Remove Code/Eluna interaction restrictions

Currently Eluna can not interact with map data which are not scripted in Eluna. These restrictions should be removed and methods like Set/GetBossState should be exposed.

For example this adjustment can remove some restrictions:

int SaveInstanceData(lua_State* /*L*/, Map* map)

    int SaveInstanceData(lua_State* /*L*/, Map* map)
    {
        if (InstanceMap* inst = map->ToInstanceMap())
            if (InstanceScript* script = inst->GetInstanceScript())
                script->SaveToDB();

        return 0;
    }

Thanks @Nyeriah for the help with this issue.

fresh pull

i did a fresh pull of azerothcore and mod-eluna got undefined reference to OPvPCapturePointNA::GetControllingFaction() const' while trying to compile ../../../modules/libmodules.a(LuaFunctions.cpp.o): in function LuaGlobalFunctions::GetOwnerHalaa(lua_State*)':
/home/fcastle/azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/GlobalMethods.h:3363: undefined reference to `OPvPCapturePointNA::GetControllingFaction() const'

GAME_EVENT_START and GAME_EVENT_STOP

  1. When using the following script, hooks for GAME_EVENT_START and GAME_EVENT_STOP do not fire.
    .event start 1 or other numbers do not result in prints. Same for .event stop 2

LUA_STATE_CLOSE works, e.g. when typing .reload eluna.

  1. This issue was discovered when investigating why the core stops game_events automatically after 15 minutes (or less) when they were started from Eluna, but it does not stop them when they were started from a GM command. Seemingly they are stopped every 1-15 minutes with no noticeable scheme. The moment were the events started by eluna are stopped are not at a certain time e.g. at 15, 30 or 45 minutes after a full hour.
local PLAYER_EVENT_ON_COMMAND = 42       -- (event, player, command)
local ELUNA_EVENT_ON_LUA_STATE_CLOSE = 16       -- (event) - triggers just before shutting down eluna (on shutdown and restart)
local GAME_EVENT_START = 34                     -- (event, gameeventid)
local GAME_EVENT_STOP = 35                      -- (event, gameeventid)

local function OnGameEventStart()
    print('OnGameEventStart')
end

local function OnGameEventStop()
    print('OnGameEventStop')
end

local function CloseLua()
    print('CloseLua')
end

local function TestCommand(event,player,command)
    if command ~= 'abc' then
        return
    end
    
    StartGameEvent( 1 )
    print('Starting game event 1')
    return false
end

RegisterServerEvent( ELUNA_EVENT_ON_LUA_STATE_CLOSE, CloseLua, 0 )
RegisterServerEvent( GAME_EVENT_START, OnGameEventStart, 0 )
RegisterServerEvent( GAME_EVENT_STOP, OnGameEventStop, 0 )
RegisterPlayerEvent(PLAYER_EVENT_ON_COMMAND, TestCommand)

Attaching the debugger when typing .event start 1 results in the script manager being called.
image

The same behavior exists when starting an event from an Eluna script with StartGameEvent( 1 ). (Type .abc with example above.
image

.event stop 1 results in a script manager call as well.
image

These never fire when using .event start 1 or .event stop 1:
image

I am not sure if this it the right place to look for it, but there is no call of an Eluna event-start-hook to be found here:
https://github.com/azerothcore/azerothcore-wotlk/blob/f3435c6e1c37a516677b2885e90d7ce7248cbdca/src/server/game/Events/GameEventMgr.cpp#L1230

Last bigger change I could track for game events:
https://github.com/azerothcore/azerothcore-wotlk/pull/9598/files

CREATURE_EVENT_ON_DIED for RegisterCreatureEvent not working on reload

The event CREATURE_EVENT_ON_DIED(ID 4) for RegisterCreatureEvent is no triggered if added to a script and then you reload eluna.

It only starts to work after you restart the server

Steps to reproduce:
1.) on a running server, create a lua script that uses the RegisterCreatureEvent and the CREATURE_EVENT_ON_DIED(ID 4) event.
2.) reload eluna using .reload eluna and try to kill the creature you referenced in the RegisterCreatureEvent

Feature request: expose OnGroupRollRewardItem player event

In PlayerScript, there are OnLootItem, OnStoreNewItem, OnCreateItem, OnQuestRewardItem, OnGroupRollRewardItem methods, but only PLAYER_EVENT_ON_LOOT_ITEM = 32 is found in RegisterPlayerEvent. Is there a corresponding serial number for OnStoreNewItem, OnCreateItem, OnQuestRewardItem, OnGroupRollRewardItem? If not, can it be increased?

ResetPetTalents case server crash

now the function will case the server crash

    int ResetPetTalents(lua_State* /*L*/, Player* player)
    {
#ifndef TRINITY
        Pet* pet = player->GetPet();
        Pet::resetTalentsForAllPetsOf(player, pet);
        if (pet)
            player->SendTalentsInfoData(true);
#else
        player->ResetPetTalents();
        player->SendTalentsInfoData(true);
#endif
        return 0;
    }

if change to below code, the crash will not action, and work ok

    int ResetPetTalents(lua_State* /*L*/, Player* player)
    {
#ifndef TRINITY
        player->ResetPetTalents();
#else
        player->ResetPetTalents();
        player->SendTalentsInfoData(true);
#endif
        return 0;
    }

as below function include the SendTalentsInfoData(true); so the player->SendTalentsInfoData(true); not need

void Player::ResetPetTalents()
{
    // This needs another gossip option + NPC text as a confirmation.
    // The confirmation gossip listid has the text: "Yes, please do."
    Pet* pet = GetPet();

    if (!pet || pet->getPetType() != HUNTER_PET || pet->m_usedTalentCount == 0)
        return;

    CharmInfo* charmInfo = pet->GetCharmInfo();
    if (!charmInfo)
    {
        LOG_ERROR("entities.player", "Object ({}) is considered pet-like but doesn't have a charminfo!", pet->GetGUID().ToString());
        return;
    }
    pet->resetTalents();
    SendTalentsInfoData(true);
}

So I think only call player->ResetPetTalents(); and do nothing will fix the crash, or #ifndef azerothcore use player->ResetPetTalents(); only?

    int ResetPetTalents(lua_State* /*L*/, Player* player)
    {
        player->ResetPetTalents();
        return 0;
    }

It's not an issue, but a question.

Can I use Eluna to write a script that can auto set hp and mana in battle when low hp/mana is detected? I usually use the GM command to set mana and hp to a very high value before entering a dungeon. Some bosses have skills to affect your mana/hp which make them roll back to the original setting without my realizing it. I hope a Lua script can help mitigate this concern. Whenver the script detects low hp/mana, it reset them to a high value.

To think further, if I organize a RAID, can I use Lua to implement group AI, could be a complex one to make battle experience as real as you play with real players.

make error

azerothcore rev. is f2e01028cf4d3977b4e1c5a821f44097ec032975
eluna rev. is 8bcec88
image

Compile errors

14>G:\WoW Server\AzerothCore\Core\modules\mod-eluna\src\LuaEngine\ElunaUtility.h(55,36): error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt. (Quelldatei wird kompiliert G:\WoW Server\AzerothCore\Core\modules\mod-eluna\src\ElunaLuaEngine_SC.cpp)
14>G:\WoW Server\AzerothCore\Core\modules\mod-eluna\src\LuaEngine\ElunaUtility.h(55,26): error C2146: Syntaxfehler: Fehlendes ";" vor Bezeichner "ElunaQuery" (Quelldatei wird kompiliert G:\WoW Server\AzerothCore\Core\modules\mod-eluna\src\ElunaLuaEngine_SC.cpp)
14>G:\WoW Server\AzerothCore\Core\modules\mod-eluna\src\LuaEngine\ElunaUtility.h(56,1): warning C4005: "ASSERT": Makro-Neudefinition (Quelldatei wird kompiliert G:\WoW Server\AzerothCore\Core\modules\mod-eluna\src\ElunaLuaEngine_SC.cpp)
14>G:\WoW Server\AzerothCore\Core\src\common\Debugging\Errors.h(68): message : Siehe vorherige Definition von "ASSERT" (Quelldatei wird kompiliert G:\WoW Server\AzerothCore\Core\modules\mod-eluna\src\ElunaLuaEngine_SC.cpp)
14>G:\WoW Server\AzerothCore\Core\modules\mod-eluna\src\LuaEngine\ElunaEventMgr.h(22,10): fatal error C1083: Datei (Include) kann nicht geöffnet werden: "Platform/Define.h": No such file or directory (Quelldatei wird kompiliert G:\WoW Server\AzerothCore\Core\modules\mod-eluna\src\ElunaLuaEngine_SC.cpp)

Compile issues as of latest Eluna Module update

Error(s):

Error C2061 syntax error: identifier 'EvadeReason' (compiling source file C:\AzerothCore\Source\azerothcore-wotlk\modules\mod-eluna\src\LuaEngine\LuaEngine.cpp) modules C:\AzerothCore\Source\azerothcore-wotlk\modules\mod-eluna\src\LuaEngine\ElunaCreatureAI.h 157

Error (active) E2500 a literal operator template must have a template parameter list equivalent to '<char ...>' modules C:\AzerothCore\Source\azerothcore-wotlk\deps\fmt\include\fmt\format.h 3030

Error (active) E1455 member function declared with 'override' does not override a base class member modules C:\AzerothCore\Source\azerothcore-wotlk\modules\mod-eluna\src\LuaEngine\ElunaCreatureAI.h 157

Error (active) E0020 identifier "EvadeReason" is undefined modules C:\AzerothCore\Source\azerothcore-wotlk\modules\mod-eluna\src\LuaEngine\ElunaCreatureAI.h 157

RegisterInstanceEvent( instance_id, event, function ) does not fire

Tested with

function InitInstance(event, instance_data, map)
    print("InitInstance 1")
end
function LoadInstance(event, instance_data, map)
    print("LoadInstance 2")
end
function UpdateInstance(event, instance_data, map)
    print("UpdateInstance 3")
end
function PlayerEnterInstance(event, instance_data, map)
    print("PlayerEnterInstance 4")
end
function CreatureCreateInInstance(event, instance_data, map)
    print("CreatureCreateInInstance 5")
end
function GOCreateInInstance(event, instance_data, map)
    print("GOCreateInInstance 6")
end
function EncounterInProgress(event, instance_data, map)
    print("EncounterInProgress 7")
end

RegisterInstanceEvent(36, 1, InitInstance, 0)
RegisterInstanceEvent(36, 2, LoadInstance, 0)
RegisterInstanceEvent(36, 3, UpdateInstance, 0)
RegisterInstanceEvent(36, 4, PlayerEnterInstance, 0)
RegisterInstanceEvent(36, 5, CreatureCreateInInstance, 0)
RegisterInstanceEvent(36, 6, GOCreateInInstance, 0)
RegisterInstanceEvent(36, 7, EncounterInProgress, 0)

instanceData = sEluna->GetInstanceData(instanceMap);

As you may see, sEluna->GetInstanceData is called to create a new instance data, but it is assigned to instanceData which is actually just a local variable.

error compiling lua

In file included from /mnt/hdd/amanthul-azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/LuaFunctions.cpp:23:
/mnt/hdd/amanthul-azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/UnitMethods.h:2997:30: fatal error: no member named 'modifyThreatPercent' in 'ThreatMgr'; did you mean 'ModifyThreatByPercent'?
unit->GetThreatMgr().modifyThreatPercent(victim, threatPct);
^~~~~~~~~~~~~~~~~~~
ModifyThreatByPercent
/mnt/hdd/amanthul-azerothcore-wotlk/src/server/game/Combat/ThreatMgr.h:220:10: note: 'ModifyThreatByPercent' declared here
void ModifyThreatByPercent(Unit* victim, int32 percent);
^
1 error generated.
make[2]: *** [modules/CMakeFiles/modules.dir/build.make:544: modules/CMakeFiles/modules.dir/mod-eluna/src/LuaEngine/LuaFunctions.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1218: modules/CMakeFiles/modules.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Segmentation Fault in HttpManager::HttpWorkerThread on SSL Verification Failure

I encountered a segmentation fault within the HttpManager::HttpWorkerThread method when making HTTPS requests that fail SSL verification. The segmentation fault occurs specifically when attempting to access properties (status, body, headers) of a null HTTP response object, which is null due to an SSL server verification error.

Steps to Reproduce

  • Configure Eluna module to make an HTTPS request to a server with a self-signed certificate or a certificate that fails SSL verification.
  • Observe that the HttpManager::HttpWorkerThread method experiences a segmentation fault due to a null dereference when attempting to process the HTTP response.

Expected Behavior

The module should handle SSL verification errors gracefully without causing a segmentation fault. There should be error handling to check for null HTTP response objects and log or manage the error without crashing.

Actual Behavior

The application crashes with a segmentation fault when the HTTP response object is null due to an SSL server verification failure.

Environment

AzerothCore Version: a2f21bd
Module: Eluna
OS: Ubuntu 22.04
Compiler: clang
Debug Information
GDB backtrace revealed that the crash occurs at:

HttpManager::HttpWorkerThread (this=0x7ffff29aafc0) at /path/to/HttpManager.cpp:170
170 responseQueue.push(new HttpResponse(req->funcRef, res->status, res->body, res->headers));
The HTTP response object (res) was null due to an httplib::Error::SSLServerVerification error.

Workaround

Installing a valid SSL certificate (e.g., from Let's Encrypt) on the server being queried resolved the issue by allowing SSL verification to succeed.

Suggested Fix

Implement additional error handling within the HttpManager::HttpWorkerThread method to check for null HTTP response objects before attempting to access their properties. Consider logging SSL verification failures and other HTTP errors in a way that does not lead to a null dereference and application crash.

PLAYER_EVENT_ON_GROUP_ROLL_REWARD_ITEM count issue

PLAYER_EVENT_ON_GROUP_ROLL_REWARD_ITEM = 56, // (event, player, item, count, voteType, roll)
cancel = RegisterPlayerEvent( event, function )

I use Yogg-Saron to test the drop of Fragment of Val'anyr. It should be 1 every time, but the value obtained by count is different every time.

Icaca won Fragment of Val'anyr (x24) with NEED (1)
Player GUID: 2 voted: NEED (1)
ItemGUID: 1344123
ItemId: 45038
ItemRandomPropId: 0
ItemRandomSuffix: 0
ItemCount: 1
TotalPlayersRolling: 1
TotalNeed: 1
TotalGreed: 0
TotalPass: 0
ItemSlot: 6
RollVoteMask: 7

add player:isFollow

return false or ture whether follow another player.

PLAYER_EVENT_ON_FOLLOW_BEGIN
PLAYER_EVENT_ON_FOLLOW_STOP

The following error occurred while compiling the eluna module:

In file included from /root/azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/HttpManager.cpp:11:
/root/azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/libs/httplib.h:3975:37: warning: 'MD5_Init' is deprecated [-Wdeprecated-declarations]
return message_digest<MD5_CTX>(s, MD5_Init, MD5_Update, MD5_Final,
^
/usr/include/openssl/md5.h:49:1: note: 'MD5_Init' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int MD5_Init(MD5_CTX *c);
^
/usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'

define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0)

                                            ^

/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'

define OSSL_DEPRECATED(since) attribute((deprecated))

                                               ^

In file included from /root/azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/HttpManager.cpp:11:
/root/azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/libs/httplib.h:3975:47: warning: 'MD5_Update' is deprecated [-Wdeprecated-declarations]
return message_digest<MD5_CTX>(s, MD5_Init, MD5_Update, MD5_Final,
^
/usr/include/openssl/md5.h:50:1: note: 'MD5_Update' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int MD5_Update(MD5_CTX *c, const void *data, size_t len);
^
/usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'

define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0)

                                            ^

/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'

define OSSL_DEPRECATED(since) attribute((deprecated))

                                               ^

In file included from /root/azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/HttpManager.cpp:11:
/root/azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/libs/httplib.h:3975:59: warning: 'MD5_Final' is deprecated [-Wdeprecated-declarations]
return message_digest<MD5_CTX>(s, MD5_Init, MD5_Update, MD5_Final,
^
/usr/include/openssl/md5.h:51:1: note: 'MD5_Final' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int MD5_Final(unsigned char *md, MD5_CTX *c);
^
/usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'

define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0)

                                            ^

/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'

define OSSL_DEPRECATED(since) attribute((deprecated))

                                               ^

In file included from /root/azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/HttpManager.cpp:11:
/root/azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/libs/httplib.h:3980:40: warning: 'SHA256_Init' is deprecated [-Wdeprecated-declarations]
return message_digest<SHA256_CTX>(s, SHA256_Init, SHA256_Update, SHA256_Final,
^
/usr/include/openssl/sha.h:73:1: note: 'SHA256_Init' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int SHA256_Init(SHA256_CTX *c);
^
/usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'

define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0)

                                            ^

/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'

define OSSL_DEPRECATED(since) attribute((deprecated))

                                               ^

In file included from /root/azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/HttpManager.cpp:11:
/root/azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/libs/httplib.h:3980:53: warning: 'SHA256_Update' is deprecated [-Wdeprecated-declarations]
return message_digest<SHA256_CTX>(s, SHA256_Init, SHA256_Update, SHA256_Final,
^
/usr/include/openssl/sha.h:74:1: note: 'SHA256_Update' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int SHA256_Update(SHA256_CTX *c,
^
/usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'

define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0)

                                            ^

/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'

define OSSL_DEPRECATED(since) attribute((deprecated))

                                               ^

In file included from /root/azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/HttpManager.cpp:11:
/root/azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/libs/httplib.h:3980:68: warning: 'SHA256_Final' is deprecated [-Wdeprecated-declarations]
return message_digest<SHA256_CTX>(s, SHA256_Init, SHA256_Update, SHA256_Final,
^
/usr/include/openssl/sha.h:76:1: note: 'SHA256_Final' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int SHA256_Final(unsigned char *md, SHA256_CTX *c);
^
/usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'

define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0)

                                            ^

/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'

define OSSL_DEPRECATED(since) attribute((deprecated))

                                               ^

In file included from /root/azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/HttpManager.cpp:11:
/root/azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/libs/httplib.h:3985:40: warning: 'SHA512_Init' is deprecated [-Wdeprecated-declarations]
return message_digest<SHA512_CTX>(s, SHA512_Init, SHA512_Update, SHA512_Final,
^
/usr/include/openssl/sha.h:123:1: note: 'SHA512_Init' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int SHA512_Init(SHA512_CTX *c);
^
/usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'

define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0)

                                            ^

/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'

define OSSL_DEPRECATED(since) attribute((deprecated))

                                               ^

In file included from /root/azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/HttpManager.cpp:11:
/root/azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/libs/httplib.h:3985:53: warning: 'SHA512_Update' is deprecated [-Wdeprecated-declarations]
return message_digest<SHA512_CTX>(s, SHA512_Init, SHA512_Update, SHA512_Final,
^
/usr/include/openssl/sha.h:124:1: note: 'SHA512_Update' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int SHA512_Update(SHA512_CTX *c,
^
/usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'

define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0)

                                            ^

/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'

define OSSL_DEPRECATED(since) attribute((deprecated))

                                               ^

In file included from /root/azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/HttpManager.cpp:11:
/root/azerothcore-wotlk/modules/mod-eluna/src/LuaEngine/libs/httplib.h:3985:68: warning: 'SHA512_Final' is deprecated [-Wdeprecated-declarations]
return message_digest<SHA512_CTX>(s, SHA512_Init, SHA512_Update, SHA512_Final,
^
/usr/include/openssl/sha.h:126:1: note: 'SHA512_Final' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int SHA512_Final(unsigned char *md, SHA512_CTX *c);
^
/usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'

define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0)

                                            ^

/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'

define OSSL_DEPRECATED(since) attribute((deprecated))

Logger/Appender not working

After restarting the server, no data is written to eluna.log
It is required to perform a .reload config to make it start logging to the file.

Additionally the current log file is wiped on use of .reload config if a log from the name already exists.
That is also, if the log name includes the server's startup timestamp.

player:SendTrainerList(sender) does not fire!

I tried right now to do a mixed npc (vendor + trainer in one).

When I tried it with:

player:SendTrainerList(creature,1) it didn't even give me an error... since it should do in regular for that clearly wrong function statement

so it seems to not fire at all.

how to replicate:

try a script like this here... just add a npc id at the gossipevents...

local function RidingTrainerMountVendorOnGossipHello(event, player, creature)
    player:GossipClearMenu()
    player:GossipMenuAddItem(1, "Let me browse your goods!", 0, 1)
    player:GossipMenuAddItem(4, "Train me.", 1, 2)
    player:GossipMenuAddItem(0, "Close", 1, 3)
    player:GossipSendMenu(1, creature, 1)
end

RegisterCreatureGossipEvent(NPC_ID, 1, RidingTrainerMountVendorOnGossipHello)


local function RidingTrainerMountVendorOnGossipSelect(event, player, creature, sender, intid, code, menu_id)
    if (intid == 1) then
        player:SendListInventory(creature)
    elseif (intid == 2) then
        player:SendTrainerList(creature)
    elseif (intid == 3) then
        player:GossipComplete()
    end
end

RegisterCreatureGossipEvent(NPC_ID, 2, RidingTrainerMountVendorOnGossipSelect)

then try the script... u will see that all will work except the SendTrainerList(creature)...

if u then add to the SendTrainerList(creature) a 1... so it looks like this:

local function RidingTrainerMountVendorOnGossipHello(event, player, creature)
    player:GossipClearMenu()
    player:GossipMenuAddItem(1, "Let me browse your goods!", 0, 1)
    player:GossipMenuAddItem(4, "Train me.", 1, 2)
    player:GossipMenuAddItem(0, "Close", 1, 3)
    player:GossipSendMenu(1, creature, 1)
end


RegisterCreatureGossipEvent(NPC_ID, 1, RidingTrainerMountVendorOnGossipHello)

local function RidingTrainerMountVendorOnGossipSelect(event, player, creature, sender, intid, code, menu_id)
    if (intid == 1) then
        player:SendListInventory(creature)
    elseif (intid == 2) then
        player:SendTrainerList(creature,1)
    elseif (intid == 3) then
        player:GossipComplete()
    end
end

RegisterCreatureGossipEvent(NPC_ID, 2, RidingTrainerMountVendorOnGossipSelect)

you will see that it does not give an error message to the console which it should ^^

Game events started via scripts end automatically

Game events started from GM commands last as expected.
Game events started via an Eluna script end automatically, as soon as any other event triggers even though their duration is much longer.

Example:

local PLAYER_EVENT_ON_COMMAND = 42       -- (event, player, command)
local GAME_EVENT_START = 34                     -- (event, gameeventid)
local GAME_EVENT_STOP = 35                      -- (event, gameeventid)

local function OnGameEventStart(event,gameeventid)
    print('-----------------------------')
    print('GetGameTime(): ' .. tostring(GetGameTime()))
    print('OnGameEventStart')
    print(gameeventid)
    print('-----------------------------')
end

local function OnGameEventStop(event,gameeventid)
    print('-----------------------------')
    print('GetGameTime(): ' .. tostring(GetGameTime()))
    print('OnGameEventStop')
    print(gameeventid)
    print('-----------------------------')
end

local function TestCommand(event,player,command)
    if command == 'abc' then
        StartGameEvent( 1 )
        print('Starting game event 1')
        return false
    end
end

RegisterServerEvent( GAME_EVENT_START, OnGameEventStart, 0 )
RegisterServerEvent( GAME_EVENT_STOP, OnGameEventStop, 0 )
RegisterPlayerEvent(PLAYER_EVENT_ON_COMMAND, TestCommand)

Typing .abc results in:

-----------------------------
GetGameTime(): 1655302388
OnGameEventStart
1
-----------------------------
Starting game event 1
Update time diff: 15. Players online: 1.
-----------------------------
GetGameTime(): 1655302501
OnGameEventStop
33
-----------------------------
-----------------------------
GetGameTime(): 1655302501
OnGameEventStop
69
-----------------------------
-----------------------------
GetGameTime(): 1655302501
OnGameEventStop
1
-----------------------------

When starting game event 1 from a script and typing .event info 1, the dates aren't entered properly. 1st print before the event was started, second with the event currently running ('active') from a script:
image

Same as above, but this time the game event was started by typing .event start 1:
image

Unit:SendUnitSay does not work

Hi,

I am using the docker way of setting up Azerothcore with the current version and installed this eluna module, also with current version.
Everything seems to be working great, except that Unit:SendUnitSay() seems to be not working.

I have this example script:


local function OnPlayerResurrected(event, player)
    local creaturesInRange = player:GetCreaturesInRange(200, 29445)
    for key, unit in pairs(creaturesInRange) do
        if (unit:GetName() == "Thorim") then
            unit:SendUnitYell("Wie kann das sein?!", 0)
            unit:SendUnitSay("Wie kann das sein?!", 0)
            unit:SendUnitSay("Offenbar seid ihr wohl stärker als ich dachte.", 0)
            unit:SendUnitWhisper("Offenbar seid ihr wohl stärker als ich dachte.", 0, player)
            unit:SendUnitWhisper("Wohlmöglich könntet ihr mir bei einer Sache helfen?", 0, player)
            unit:SendUnitWhisper("Keine Zeit für Fragen! Wenn ihr bereit seid, müsst ihr mich bloß annicken.", 0, player)
        end
    end
end

RegisterPlayerEvent(PLAYER_EVENT_ON_RESURRECT, OnPlayerResurrected)

As you can see in this screenshot, yelling and whispering works, but say does not.

image

I didn't find anything related to this, so that's why I am posting this.

BR & Thanks in advance

make error

/AC/azerothcore-npcbots/modules/mod-eluna/src/ElunaLuaEngine_SC.cpp:660:81: fatal error: non-virtual member function marked 'override' hides virtual member function
void OnGiveXP(Player* player, uint32& amount, Unit* victim, uint8 xpSource) override
^
/AC/azerothcore-npcbots/src/server/game/Scripting/ScriptMgr.h:1040:18: note: hidden overloaded virtual function 'PlayerScript::OnGiveXP' declared here: different number of parameters (3 vs 4)
virtual void OnGiveXP(Player* /player/, uint32& /amount/, Unit* /victim/) { }

Can add feature Player::GetAchievementPoint ?

Every player can see achievement point, but It's hard to get if use database or a specific achievement to accumulate, but I think it must have a place have already calculate and store the point on server. So if can return GetAchievementPoint hock? then I can do much things abuout total achievementpoint.

PLAYER_EVENT_ON_CHANNEL_CHAT channel argument invalid

When using PLAYER_EVENT_ON_CHANNEL_CHAT event(ID: 22) it has the following arguments:
(event, player, msg, Type, lang, channel)

The channel argument/variable is always 0 instead of the real channel ID that is stored in the db.
Not sure if this should be channel name, or ID. I think ID makes more sense as there can be multiple channels with the same name.

Player Hook 45 - Achievement seem to cause segfault often, but not always

Commit: bad5bb7

I am encountering segvaults when hooking player event 45 to trigger an HTTP request.

It's no 100%, but 90% of the time when an achievement is triggered the server dies which is very unfortunate because loot gets lost on any major dungeon achievement. Unhooking removes the crash.

Didn't get a chance to debug build and investigate yet.

local function OnPlayerAchievementComplete (event, player, achievement)
  if (achievement ~= nil and achievement:GetId() ~= 0) then
   
  // HttpRequest(....)

  end
end

RegisterPlayerEvent(45, OnPlayerAchievementComplete)

error occurs when use cmake v3.26.3-1,clang v15.0.7-2

Q1: In file included from /root/azerothcore/modules/mod-eluna/src/LuaEngine/LuaFunctions.cpp:20:
/root/azerothcore/modules/mod-eluna/src/LuaEngine/GlobalMethods.h:1843:70: fatal error: no member named 'GetGOData' in 'ObjectMgr'
eObjectMgr->AddGameobjectToGrid(guidLow, eObjectMgr->GetGOData(guidLow));

Q2: make[2]: *** [modules/CMakeFiles/modules.dir/build.make:300: modules/CMakeFiles/modules.dir/mod-eluna/src/LuaEngine/LuaFunctions.cpp.o]

error occurs when use cmake v3.26.3-1,clang v15.0.7-2

player:SendQuestTemplate(questID)

I'm having trouble using the player:SendQuestTemplate(questID) function to allow players to accept quests. The function displays quest details but doesn't enable quest acceptance. Could someone please advise me on how to implement quest acceptance for players? Thank you!

Segmentation fault (m_time ++ diff?) on worldserver / Linux build / AC with NPCBots

Hello everyone... I'm really sorry if this is not the place to try to solve this, but I've been searching every possible place for a way to solve my issue.

I have a Ubuntu 22.4 server and have been trying to run AC with NPCBots with some Lua scripts.
I run the worldserver normally and, after some time (randomly), I get a Segmentation fault crash.

The log output is as follows:

Thread 8 "worldserver" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f31f1bff640 (LWP 25186)]
0x000055b775944b6a in ElunaEventProcessor::Update (this=0x0, diff=2257412096) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/modules/mod-eluna/src/LuaEngine/ElunaEventMgr.cpp:44
44	    m_time += diff;
#0  0x000055b775944b6a in ElunaEventProcessor::Update (this=0x0, diff=2257412096) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/modules/mod-eluna/src/LuaEngine/ElunaEventMgr.cpp:44
#1  0x000055b7758dc0c6 in Eluna_WorldObjectScript::OnWorldObjectUpdate (this=0x7f323bfce3f0, object=0x7f31868d6000, diff=2257412096) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/modules/mod-eluna/src/ElunaLuaEngine_SC.cpp:920
#2  0x000055b7770fa6fa in ScriptMgr::OnWorldObjectUpdate(WorldObject*, unsigned int)::$_4::operator()(WorldObjectScript*) const (this=0x7f31f1bfb208, script=0x7f323bfce3f0) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Scripting/ScriptDefines/WorldObjectScript.cpp:67
#3  0x000055b7770fa6b2 in std::__invoke_impl<void, ScriptMgr::OnWorldObjectUpdate(WorldObject*, unsigned int)::$_4&, WorldObjectScript*>(std::__invoke_other, ScriptMgr::OnWorldObjectUpdate(WorldObject*, unsigned int)::$_4&, WorldObjectScript*&&) (__f=..., __args=@0x7f31f1bfb140: 0x7f323bfce3f0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/invoke.h:61
#4  0x000055b7770fa642 in std::__invoke_r<void, ScriptMgr::OnWorldObjectUpdate(WorldObject*, unsigned int)::$_4&, WorldObjectScript*>(ScriptMgr::OnWorldObjectUpdate(WorldObject*, unsigned int)::$_4&, WorldObjectScript*&&) (__fn=..., __args=@0x7f31f1bfb140: 0x7f323bfce3f0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/invoke.h:111
#5  0x000055b7770fa522 in std::_Function_handler<void (WorldObjectScript*), ScriptMgr::OnWorldObjectUpdate(WorldObject*, unsigned int)::$_4>::_M_invoke(std::_Any_data const&, WorldObjectScript*&&) (__functor=..., __args=@0x7f31f1bfb140: 0x7f323bfce3f0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_function.h:290
#6  0x000055b7770faa35 in std::function<void (WorldObjectScript*)>::operator()(WorldObjectScript*) const (this=0x7f31f1bfb208, __args=0x7f323bfce3f0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_function.h:590
#7  0x000055b7770fa988 in ExecuteScript<WorldObjectScript>(std::function<void (WorldObjectScript*)>) (executeHook=...) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Scripting/ScriptMgrMacros.h:63
#8  0x000055b7770f91ae in ScriptMgr::OnWorldObjectUpdate (this=0x55b7788fd450 <ScriptMgr::instance()::instance>, object=0x7f31868d6000, diff=2257412096) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Scripting/ScriptDefines/WorldObjectScript.cpp:65
#9  0x000055b7768d69db in WorldObject::Update (this=0x7f31868d6000, time_diff=2257412096) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Entities/Object/Object.cpp:1063
#10 0x000055b7768da342 in WorldObject::CanSeeOrDetect (this=0x7f31a27db000, obj=0x7f31868d6000, ignoreStealth=false, distanceCheck=false, checkAlert=false) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Entities/Object/Object.cpp:1740
#11 0x000055b776ab114f in Unit::_IsValidAttackTarget (this=0x7f31a27db000, target=0x7f31868d6000, bySpell=0x7f32389ee000, obj=0x0) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Entities/Unit/Unit.cpp:14645
#12 0x000055b777390946 in SpellInfo::CheckExplicitTarget (this=0x7f32389ee000, caster=0x7f31a27db000, target=0x7f31868d6000, itemTarget=0x0) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Spells/SpellInfo.cpp:1988
#13 0x000055b77733ceda in Spell::CheckCast (this=0x7f3186c95000, strict=true) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Spells/Spell.cpp:6012
#14 0x000055b776a82b16 in Unit::_UpdateAutoRepeatSpell (this=0x7f31a27db000) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Entities/Unit/Unit.cpp:4108
#15 0x000055b776a5bd07 in Unit::_UpdateSpells (this=0x7f31a27db000, time=0) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Entities/Unit/Unit.cpp:4017
#16 0x000055b776a5b572 in Unit::Update (this=0x7f31a27db000, p_time=0) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Entities/Unit/Unit.cpp:425
#17 0x000055b776852e7b in Creature::Update (this=0x7f31a27db000, diff=0) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Entities/Creature/Creature.cpp:747
#18 0x000055b776d13425 in Acore::ObjectUpdater::Visit<Creature> (this=0x7f31f1bfd400, m=...) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Grids/Notifiers/GridNotifiers.cpp:395
#19 0x000055b776ee0a7d in VisitorHelper<Acore::ObjectUpdater, Creature> (v=..., c=...) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/common/Dynamic/TypeContainerVisitor.h:44
#20 0x000055b776ee0a3d in VisitorHelper<Acore::ObjectUpdater, Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > (v=..., c=...) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/common/Dynamic/TypeContainerVisitor.h:50
#21 0x000055b776ee09de in VisitorHelper<Acore::ObjectUpdater, GameObject, TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > > (v=..., c=...) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/common/Dynamic/TypeContainerVisitor.h:51
#22 0x000055b776ee099d in VisitorHelper<Acore::ObjectUpdater, TypeList<GameObject, TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > > > (v=..., c=...) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/common/Dynamic/TypeContainerVisitor.h:57
#23 0x000055b776ee0960 in TypeContainerVisitor<Acore::ObjectUpdater, TypeMapContainer<TypeList<GameObject, TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > > > >::Visit (this=0x7f31f1bfd3f8, c=...) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/common/Dynamic/TypeContainerVisitor.h:91
#24 0x000055b776ee092d in Grid<Player, TypeList<GameObject, TypeList<Player, TypeList<Creature, TypeList<Corpse, TypeList<DynamicObject, TypeNull> > > > >, TypeList<GameObject, TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > > >::Visit<Acore::ObjectUpdater> (this=0x7f31c3320098, visitor=...) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Grids/Grid.h:89
#25 0x000055b776ee0901 in NGrid<8u, Player, TypeList<GameObject, TypeList<Player, TypeList<Creature, TypeList<Corpse, TypeList<DynamicObject, TypeNull> > > > >, TypeList<GameObject, TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > > >::VisitGrid<Acore::ObjectUpdater, TypeList<GameObject, TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > > > (this=0x7f31c331d9c0, x=2, y=6, visitor=...) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Grids/NGrid.h:152
#26 0x000055b776ece147 in Map::Visit<Acore::ObjectUpdater, TypeMapContainer<TypeList<GameObject, TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > > > > (this=0x7f3203bd1340, cell=..., visitor=...) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Maps/Map.h:904
#27 0x000055b776eb727a in Map::VisitNearbyCellsOf (this=0x7f3203bd1340, obj=0x7f31a27db000, gridVisitor=..., worldVisitor=...) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Maps/Map.cpp:758
#28 0x000055b776eb757f in Map::Update (this=0x7f3203bd1340, t_diff=0, s_diff=1556) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Maps/Map.cpp:805
#29 0x000055b776ef53a1 in MapUpdateRequest::call (this=0x7f3198107c00) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Maps/MapUpdater.cpp:44
#30 0x000055b776ef47f9 in MapUpdater::WorkerThread (this=0x55b7788fc488 <MapMgr::instance()::instance+224>) at /home/rdpuser/wow/AzerothCore-wotlk-with-NPCBots/src/server/game/Maps/MapUpdater.cpp:156
#31 0x000055b776ef651e in std::__invoke_impl<void, void (MapUpdater::*)(), MapUpdater*> (__f=@0x7f31fcd5c6f0: (void (MapUpdater::*)(MapUpdater * const)) 0x55b776ef4770 <MapUpdater::WorkerThread()>, __t=@0x7f31fcd5c6e8: 0x55b7788fc488 <MapMgr::instance()::instance+224>) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/invoke.h:74
#32 0x000055b776ef6432 in std::__invoke<void (MapUpdater::*)(), MapUpdater*> (__fn=@0x7f31fcd5c6f0: (void (MapUpdater::*)(MapUpdater * const)) 0x55b776ef4770 <MapUpdater::WorkerThread()>, __args=@0x7f31fcd5c6e8: 0x55b7788fc488 <MapMgr::instance()::instance+224>) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/invoke.h:96
#33 0x000055b776ef63f2 in std::thread::_Invoker<std::tuple<void (MapUpdater::*)(), MapUpdater*> >::_M_invoke<0ul, 1ul> (this=0x7f31fcd5c6e8) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_thread.h:259
#34 0x000055b776ef63a5 in std::thread::_Invoker<std::tuple<void (MapUpdater::*)(), MapUpdater*> >::operator() (this=0x7f31fcd5c6e8) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_thread.h:266
#35 0x000055b776ef6209 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (MapUpdater::*)(), MapUpdater*> > >::_M_run (this=0x7f31fcd5c6e0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_thread.h:211
#36 0x00007f323e9a7253 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#37 0x00007f323e630ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#38 0x00007f323e6c2a40 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Unfortunately, I've been unable to find anyone that have experienced the same issue (I may be searching the wrong way)
If you could shed some light on what migh be the issue, I would greatly appreciate.

Thanks

[Issue] Method Global:RegisterPlayerEvent apply and remove aura

azerothcore
Two of the events not working. I don't think I am doing anything wrong even tried using the aura in different ways
https://www.azerothcore.org/pages/eluna/Global/RegisterPlayerEvent.html
PLAYER_EVENT_ON_APPLY_AURA = 57, // (event, player, aura, isNewAura)
PLAYER_EVENT_ON_REMOVE_AURA = 58, // (event, player, aura, isExpired)

local voidSpell                   = 168

local PLAYER_EVENT_ON_APPLY_AURA  = 57 --,       // (event, player, aura, isNewAura)
local PLAYER_EVENT_ON_REMOVE_AURA = 58 --,       // (event, player, aura, isExpired)



local function OnApplyAura(event, player, aura, isNewAura)
    print("FUNCTION START")
    if aura:GetAuraId() == voidSpell then
        print("is this on?")
        player:SetFaction(14)
        player:SetPvP(true) -- Enable PvP
    end
    print("FUNCTION END")
end

local function OnRemoveAura(event, player, aura, isExpired)
    print("FUNCTION START")
    if aura:GetAuraId() == voidSpell then
        player:SetFaction(player:GetTeam()) -- Set faction back to original faction
        player:SetPvP(false)                -- Disable PvP
    end
    print("FUNCTION END")
end


RegisterPlayerEvent(PLAYER_EVENT_ON_APPLY_AURA, OnApplyAura)
RegisterPlayerEvent(PLAYER_EVENT_ON_REMOVE_AURA, OnRemoveAura)

use mod-eluna not valid

Hi,

I am using the docker way of setting up Azerothcore with the current version and installed this eluna module, also with current version.

微信图片_20230202132343
微信图片_20230202132350

Where should I put lua_scripts

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.