WIP: checkpoint AdventureBot intents and unfinished profession implementation
This commit is contained in:
1 parent
119d63ed1c
commit
722b513ee0
83 files changed
+11946
-199
No files matched your search
@@ -1,3 +1,4 @@
|
||||
#include "AdventureProfessionPolicy.h"
|
||||
#include "ClientlessLuaEngine.h"
|
||||
#include "ClientlessPlayerMgr.h"
|
||||
#include "ClientlessActionExecutorMgr.h"
|
||||
@@ -383,6 +384,8 @@ bool ClientlessLuaEngine::LoadAdventureProfile(Player* player)
|
||||
profile.GroundMounts = ReadMountDictionary(_state, -1);
|
||||
profile.CanFreeFly = ReadBoolField(_state, -1, "can_free_fly", false);
|
||||
profile.FlightMounts = ReadMountDictionary(_state, -1, "flight_mounts");
|
||||
profile.CompanionSpell = uint32(std::max(0.0f, ReadFloatField(_state, -1, "companion_spell", 0)));
|
||||
profile.CompanionLeashItem = uint32(std::max(0.0f, ReadFloatField(_state, -1, "companion_leash_item", 0)));
|
||||
}
|
||||
lua_pop(_state, 1);
|
||||
|
||||
@@ -402,6 +405,25 @@ bool ClientlessLuaEngine::LoadAdventureProfile(Player* player)
|
||||
}
|
||||
lua_pop(_state, 1);
|
||||
|
||||
lua_getfield(_state,rootTable,"professions");
|
||||
if(lua_istable(_state,-1))
|
||||
{
|
||||
lua_getfield(_state,-1,"primary");
|
||||
if(lua_istable(_state,-1))
|
||||
for(size_t index=1;index<=lua_rawlen(_state,-1);++index)
|
||||
{
|
||||
lua_rawgeti(_state,-1,index);
|
||||
if(lua_type(_state,-1)==LUA_TSTRING)
|
||||
{
|
||||
std::string name=lua_tostring(_state,-1);
|
||||
if(AdventureProfessionPolicy::PrimaryName(name))profile.PrimaryProfessions.insert(name);
|
||||
else TC_LOG_WARN("server.adventurebot","PROFILE_UNKNOWN_PROFESSION guid=%u name='%s'",player->GetGUID().GetCounter(),name.c_str());
|
||||
}
|
||||
lua_pop(_state,1);
|
||||
}
|
||||
lua_pop(_state,1);
|
||||
}
|
||||
lua_pop(_state,1);
|
||||
uint32 const guid = player->GetGUID().GetCounter();
|
||||
_profiles[guid] = std::move(profile);
|
||||
ClientlessAdventureProfile const& stored = _profiles.at(guid);
|
||||
@@ -416,6 +438,8 @@ bool ClientlessLuaEngine::LoadAdventureProfile(Player* player)
|
||||
uint32(stored.Personality.size()), uint32(stored.RegionAffinity.size()),
|
||||
uint32(stored.ActivityAffinity.size()));
|
||||
|
||||
TC_LOG_INFO("server.adventurebot","PROFILE_PROFESSIONS guid=%u primary=%u",guid,uint32(stored.PrimaryProfessions.size()));
|
||||
|
||||
if (stored.CanGroundMount && stored.GroundMounts.empty())
|
||||
TC_LOG_WARN("server.adventurebot",
|
||||
"[AdventureBot][Profile] guid=%u enables ground mounts but defines no ground_mounts", guid);
|
||||
|
||||
Reference in new issue
Block a user