You know, i need an clean map for TFS 1.0.0
local cd = 30 -- How long after the broadcast will the map be cleaned? in seconds
function onTime(interval)
broadcastMessage("Game map will be cleaned in ".. cd .." seconds. Mind it may freeze.")
addEvent(cleanMap, cd*1000)
addEvent(broadcastMessage, cd+1*1000, "Game map cleaned.")
return true
end
use isInRange(getThingPos(uid),fromPos,toPos)the function
isMonsterInRange(monsterName, fromPos, toPos)
doesnt work ;S
how to do setCreatureMaxHealth in this version?
Player(cid):setMaxHealth(maxHealth)
luascript.cppWhere can i read the db functions?
const luaL_Reg LuaScriptInterface::luaDatabaseTable[] = {
{"query", LuaScriptInterface::luaDatabaseExecute},
{"storeQuery", LuaScriptInterface::luaDatabaseStoreQuery},
{"escapeString", LuaScriptInterface::luaDatabaseEscapeString},
{"escapeBlob", LuaScriptInterface::luaDatabaseEscapeBlob},
{"lastInsertId", LuaScriptInterface::luaDatabaseLastInsertId},
{"tableExists", LuaScriptInterface::luaDatabaseTableExists},
{nullptr, nullptr}
};
const luaL_Reg LuaScriptInterface::luaResultTable[] = {
{"getDataInt", LuaScriptInterface::luaResultGetDataInt},
{"getDataLong", LuaScriptInterface::luaResultGetDataLong},
{"getDataString", LuaScriptInterface::luaResultGetDataString},
{"getDataStream", LuaScriptInterface::luaResultGetDataStream},
{"next", LuaScriptInterface::luaResultNext},
{"free", LuaScriptInterface::luaResultFree},
{nullptr, nullptr}
};
Wish doItemSetAttribute() was there!![]()
int32_t LuaScriptInterface::luaItemSetAttribute(lua_State* L)
{
// item:setAttribute(key, value)
itemAttrTypes attribute;
if (isNumber(L, 2)) {
attribute = static_cast<itemAttrTypes>(getNumber<int64_t>(L, 2));
} else if (isString(L, 2)) {
attribute = stringToItemAttribute(getString(L, 2));
} else {
attribute = ATTR_ITEM_NONE;
}
Item* item = getUserdata<Item>(L, 1);
if (item) {
if (attribute & 0x7F0013) { // All integer attributes
item->setIntAttr(attribute, getNumber<int32_t>(L, 3));
pushBoolean(L, true);
} else if (attribute & 0x2C) { // All string attributes
item->setStrAttr(attribute, getString(L, 3));
pushBoolean(L, true);
} else {
pushNil(L);
}
} else {
pushNil(L);
}
return 1;
}