By mock the bear.
Tested on TFS 0.3.6pl1
Go to luascript.cpp
in last line add:
and before
add:
On luascript.h
before:
add:
:thumbup:
Tested on TFS 0.3.6pl1
Go to luascript.cpp
in last line add:
Code:
int32_t LuaScriptInterface::luamoveCreatureTo(lua_State* L)
{
//moveCreatureTo(cid,pos[,mindist[,maxdist]])
ScriptEnviroment* env = getEnv();
uint32_t mindist = 1, maxdist = 1;
if(lua_gettop(L) > 3)
maxdist = popNumber(L);
if(lua_gettop(L) > 2)
mindist = popNumber(L);
PositionEx pos;
popPosition(L, pos);
if(Creature* creature = env->getCreatureByUID(popNumber(L)))
{
std::list<Direction> listDir;
if(!g_game.getPathToEx(creature, pos, listDir, 1, maxdist, true, true))
{
lua_pushboolean(L, false);
return 1;
}
creature->startAutoWalk(listDir);
lua_pushboolean(L, true);
}
else
{
errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
lua_pushboolean(L, false);
}
return 1;
}
Code:
lua_register(m_luaState, "doPlayerAddMapMark", LuaScriptInterface::luaDoPlayerAddMapMark);
Code:
//moveCreatureTo(cid,pos[,minist [,maxdist]])
lua_register(m_luaState, "moveCreatureTo", LuaScriptInterface::luamoveCreatureTo);
On luascript.h
before:
Code:
static int32_t luaGetPlayerByGUID(lua_State* L);
Code:
static int32_t luamoveCreatureTo(lua_State* L);
:thumbup:
Last edited: