Exemplo n.º 1
0
int NpcScriptInterface::luaActionMoveTo(lua_State* L)
{
    //selfMoveTo(x,y,z)
    Npc* npc = getScriptEnv()->getNpc();
    if (!npc) {
        return 0;
    }

    npc->doMoveTo(Position(
                      getNumber<uint16_t>(L, 1),
                      getNumber<uint16_t>(L, 2),
                      getNumber<uint8_t>(L, 3)
                  ));
    return 0;
}
Exemplo n.º 2
0
int32_t NpcScriptInterface::luaActionMoveTo(lua_State* L)
{
	//selfMoveTo(x,y,z)
	Position target;
	target.z = (int32_t)popNumber(L);
	target.y = (int32_t)popNumber(L);
	target.x = (int32_t)popNumber(L);

	Npc* npc = getScriptEnv()->getNpc();
	if (npc) {
		npc->doMoveTo(target);
	}

	return 0;
}