tatu hunter
Insane Mind~
I request a function to check if the tile is non-pvp, it can be like getTilePzInfo(pos), but for check the NonPVP tile.
thx
thx
int32_t LuaScriptInterface::luaGetTileNonPvpInfo(lua_State* L)
{
//getTilePzInfo(pos)
PositionEx pos;
popPosition(L, pos);
Tile *tile = g_game.getMap()->getTile(pos);
if(tile)
{
if(tile->hasFlag(TILESTATE_NOPVPZONE))
lua_pushnumber(L, LUA_TRUE);
else
lua_pushnumber(L, LUA_FALSE);
}
else
{
reportErrorFunc(getErrorDesc(LUA_ERROR_TILE_NOT_FOUND));
lua_pushnumber(L, LUA_ERROR);
}
return 1;
}
and in luascript.h//getTileNonPvpInfo(pos)
//1 is non-pvp. 0 no non-pvp.
lua_register(m_luaState, "getTileNonPvpInfo", LuaScriptInterface::luaGetTileNonPvpInfo);
static int32_t luaGetTileNonPvpInfo(lua_State* L);
int32_t LuaScriptInterface::luaGetTileInfo(lua_State* L)
{
//getTilePzInfo(pos)
PositionEx pos;
popPosition(L, pos);
Tile *tile = g_game.getMap()->getTile(pos);
if(tile)
{
if(tile->hasFlag(TILESTATE_PROTECTIONZONE))
lua_pushnumber(L, LUA_TRUE);
else if(tile->hasFlag(TILESTATE_NOPVPZONE))
lua_pushnumber(L, 2);
else if(tile->hasFlag(TILESTATE_PVPZONE))
lua_pushnumber(L, 3);
else if(tile->hasFlag(TILESTATE_NOLOGOUT))
lua_pushnumber(L, 4);
else
lua_pushnumber(L, LUA_FALSE);
}
else
{
reportErrorFunc(getErrorDesc(LUA_ERROR_TILE_NOT_FOUND));
lua_pushnumber(L, LUA_ERROR);
}
return 1;
}
I think they doesn't die, before die they are teleported to the temple.
@up
NO if you die you will lose items...
NON-PVP tool in RME is only to make areas non-pvp where players cant attack other players.