
Histórico de Curtidas
-
deza deu reputação a Mateus Robeerto em (Resolvido)Trocar varios items por 1 por avalanvaBoa tarde! Fiz um script melhor e bem simples. É possível entender o script, Segue o GIF para ver como ele funciona e foi testado no tfs 0.4, tudo certo. Divirta-se
function onUse(cid, item, frompos, item2, topos) local playerLocation = getCreaturePosition(cid) local itemData = { {itemId = 2400, x = 722, y = 658, z = 7}, {itemId = 2401, x = 722, y = 657, z = 7}, {itemId = 2376, x = 724, y = 658, z = 7} -- Adicione mais itens para combinação aqui } local newItemId = 2406 -- ID do novo item após a combinação local newItemPosition = {x = 724, y = 657, z = 7} -- Posição para o novo item local foundItems = {} local hasAllItems = true for _, data in ipairs(itemData) do local tileItem = getTileItemById({x = data.x, y = data.y, z = data.z}, data.itemId) if tileItem.uid > 0 then table.insert(foundItems, tileItem.uid) else hasAllItems = false break end end if hasAllItems then for _, uid in ipairs(foundItems) do if not doRemoveItem(uid, 1) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Erro ao remover um dos itens necessários.") return false end end local newItem = doCreateItem(newItemId, 1, newItemPosition) if newItem ~= LUA_ERROR then doSendMagicEffect(newItemPosition, 39) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Erro ao criar o novo item.") return false end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não possui todos os itens necessários para a combinação.") return false end return true end
@deza
20231130_150112.mp4 -
deza deu reputação a Movie em (Resolvido)Consertar erro GLOBALEVENTSlocal templeCicleEff = { eff = 4, delay = 100, [1] = {x = 487, y = 493, z = 7,}, [2] = {x = 493, y = 493, z = 7,}, [3] = {x = 495, y = 493, z = 7,}, [4] = {x = 499, y = 495, z = 7,}, [5] = {x = 501, y = 495, z = 7,}, [6] = {x = 505, y = 495, z = 7,}, } function onThink(cid, interval, lastExecution) for i = 1, 6 do local initialPos = templeCicleEff[i] local finalPos = templeCicleEff[i+1] if i == 6 then finalPos = templeCicleEff[1] end doSendDistanceShoot(initialPos, finalPos, templeCicleEff.eff) end return true end
-
deza deu reputação a Thony D. Serv em Quest: Baú com recompensa aleatórialocal items = { {itemId = 2126, count = 1, chance = 10}, -- ITEM, QUANTIDADE, CHANCE {itemId = 2661, count = 1, chance = 30}, {itemId = 2245, count = 1, chance = 15}, {itemId = 2127, count = 1, chance = 5}, } function onUse(cid, item, frompos, item2, topos) local config = { pos = getCreaturePosition(cid), -- posição do player } if getPlayerStorageValue(cid, 44231) <= 1 then doPlayerSendTextMessage(cid,25,"Voce já recebeu seu item.") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return true end local totalChance, randomTable, randomNumber = 0, {}, 0 addEvent(doPlayerSendTextMessage, 1*1000, cid, 27, "Procurando algo...") addEvent(doPlayerSendTextMessage, 2*1000, cid, 27, "Procurando algo...") addEvent(doPlayerSendTextMessage, 3*1000, cid, 27, "Procurando algo...") addEvent(doPlayerSendTextMessage, 4*1000, cid, 27, "Procurando algo...") addEvent(doPlayerSendTextMessage, 5*1000, cid, 27, "Procurando algo...") addEvent(doSendAnimatedText, 1*1000, config.pos, "[5]", 180) addEvent(doSendAnimatedText, 2*1000, config.pos, "[4]", 180) addEvent(doSendAnimatedText, 3*1000, config.pos, "[3]", 180) addEvent(doSendAnimatedText, 4*1000, config.pos, "[2]", 180) addEvent(doSendAnimatedText, 5*1000, config.pos, "[1]", 180) addEvent(doSendAnimatedText, 6*1000, config.pos, "DONE!", 180) for _, itemInfo in pairs (items) do randomTable[itemInfo.itemId] = {min = totalChance + 1, max = itemInfo.chance, count = itemInfo.count or 1} totalChance = totalChance + itemInfo.chance end randomNumber = math.random(1, totalChance) for itemId, itemInfo in pairs (randomTable) do local min, max = itemInfo.min, itemInfo.min + itemInfo.max if randomNumber >= min and randomNumber <= max then local newItem = addEvent(doPlayerAddItem, 6*1000, cid, itemId, itemInfo.count, false) if not newItem then return doPlayerSendCancel(cid, "Voce nao tem espaco para receber o item!") end setPlayerStorageValue(cid,44231,1) local iInfo = getItemInfo(itemId) addEvent(doPlayerSendTextMessage, 6*1000, cid, 27, "Voce achou ("..iInfo.name..")!") break end end return true end
<action actionid="55661" event="script" value="boxrandom"/>
Dei Uma Pesquisada A Respeito Deste Bau Que Voce Encontrou E Modifiquei Ele, Vê Se Funciona Ai
-
deza deu reputação a Nolangg em tile ou porta que cobra ao passarlocal config = { dinheiro = "gold coins", valor = 3000, } function onStepIn(cid, item, position, fromPosition) if isPlayer(cid) then if doPlayerRemoveMoney(cid, config.valor) == true then doPlayerSendTextMessage(cid, 22, "we debited 100 gold coins of you bank account for you pass here...") doSendMagicEffect(getCreaturePos(cid), 11) else doPlayerSendCancel(cid, "Ooops, gotta out in here, you don't have " .. config.valor .. " " .. config.dinheiro .. ".") doTeleportThing(cid, fromPosition, true) doSendMagicEffect(getCreaturePos(cid), CONST_ME_POFF) end end return true end
aí está ?
-
deza deu reputação a So volto tarde em [DUVIDA] left e Rightvoce pode tentar com right-hand ou shield, mas o melhor seria adicionar uma verificação por script, ficando:
function onEquip(cid, item, slot) if slot == 5 then return true end end
-
deza recebeu reputação de MatteusDeli em (Resolvido)Tile que gasta soul ao entrar@MatteusDeli Muito obrigado, muito obrigado mesmo, de coração. Super me ajudou ! *-*
Agradeço tbm ao @luanluciano93
Nao duvidando da minha capacidade de aprender e nem da capacidade de quem quer ensinar, mas eu nunca q ia conseguir fazer um script desse.
-
deza deu reputação a Vodkart em Alavanca Que Cria items.function getItemsFromList(items) local str = "" if table.maxn(items) > 0 then for i = 1, table.maxn(items) do str = str .. items[i][2] .. " " .. getItemNameById(items[i][1]) if i ~= table.maxn(items) then str = str .. ", " end end end return str end function doRemoveItemsFromList(cid, items) local count = 0 if table.maxn(items) > 0 then for i = 1, table.maxn(items) do if getPlayerItemCount(cid, items[i][1]) >= items[i][2] then count = count + 1 end end end if count == table.maxn(items) then for i = 1, table.maxn(items) do doPlayerRemoveItem(cid, items[i][1], items[i][2]) end else return false end return true end local items = {{15992, 5}, {15993, 5}, {15994, 5}, {15995, 5}, {15996, 5}} local item_give = 13515 function onUse(cid, item, frompos, item2, topos) if not doRemoveItemsFromList(cid, items) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Voce não tem " .. getItemsFromList(items) .. ".") return true end doPlayerAddItem(cid, item_give) doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Voce ganhou 1x " .. getItemNameById(item_give) .. ".") return true end
-
deza deu reputação a MySticaL em [0.3.6] Função doPlayerOpenChannelEDITADO REMOVIDO A VERSÃO 0.4 QUE CONTIA!
SE QUISER A VERSÃO 0.4 SÓ VER NO PERFIL DO ALEXY.
Oi, vim trazer a função doPlayerOpenChannel para tfs 0.3.6
Essa função nada mais é que quando o player loga abre os chat selecionado no login.lua automaticamente
Essa função é para 0.3.6
Versões testada: 8.54
Vamos ao código
em LuaScript.cpp
Procure:
//getChannelUsers(channelId) lua_register(m_luaState, "getChannelUsers", LuaScriptInterface::luaGetChannelUsers); Adicione em baixo:
//doPlayerOpenChannel(cid, channelId) lua_register(m_luaState, "doPlayerOpenChannel", LuaScriptInterface::luaDoPlayerOpenChannel); Continuando procure:
int32_t LuaScriptInterface::internalGetPlayerInfo(lua_State* L, PlayerInfo_t info) Acima adicione:
int32_t LuaScriptInterface::luaDoPlayerOpenChannel(lua_State* L) { //doPlayerOpenChannel(cid, channelId) uint32_t channelId = popNumber(L); uint32_t cid = popNumber(L); ScriptEnviroment* env = getEnv(); Player* player = env->getPlayerByUID(cid); if(player) lua_pushnumber(L, g_game.playerOpenChannel(cid, channelId) ? true : false); else { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushnumber(L, false); } return 1; } Agora em LuaScript.h
Procure por:
static int32_t luaGetChannelUsers(lua_State* L); abaixo adicione:
static int32_t luaDoPlayerOpenChannel(lua_State* L); Agora em data/creaturescripts/scripts/login.lua
Antes do último
return true Adicione:
doPlayerOpenChannel(cid, 7) -- 7 é o número do channel para ver é em data/xml/channels.xml
Rep não cai o dedo
-
deza deu reputação a So volto tarde em (Resolvido)Ajuda com essa queryexecuta no seu banco de dados:
CREATE TABLE monster_boost (
monster TEXT PRIMARY KEY,
loot INTEGER,
exp INTEGER
);
lembrando que esse erro pode voltar mais tarde, e, que se você for trocar para mysql, a sintaxe dessa query também terá de ser trocada
-
deza deu reputação a koyotestark em (Resolvido)Ajuda com essa queryvc precisa adicionar essa tabela "monster_boost" ao bancos de dados, o problema é saber os valores que ela precisa pra funcionar.
outra forma de resolver seria desativar essa tal função monster boost
-
deza deu reputação a vine96 em Ajuda - Action que vende itens da BPtinha entrado em contato via mensagem com outro membro aqui do fórum o @Wakon e ele me disponibilizou, fiz umas modificações e está 100%
Para quem tem interesse o script completo é esse:
local items = { [2537] = {value = 4800}, [2377] = {value = 480}, [2663] = {value = 600}, [2472] = {value = 90000}, [2475] = {value = 7200}, [2519] = {value = 8000}, [2497] = {value = 6000}, [2523] = {value = 180000}, [2494] = {value = 108000}, [2400] = {value = 144000}, [2491] = {value = 2500}, [2421] = {value = 108000}, [2646] = {value = 240000}, [2477] = {value = 5000}, [2656] = {value = 10000}, [2498] = {value = 30000}, [2647] = {value = 600}, [2534] = {value = 15000}, [7402] = {value = 15000}, [2466] = {value = 20000}, [2465] = {value = 240}, [2408] = {value = 120000}, [2518] = {value = 1800}, [2500] = {value = 3000}, [2470] = {value = 30000}, [2645] = {value = 30000}, [2434] = {value = 2000}, [2463] = {value = 480}, [2536] = {value = 9000}, [2387] = {value = 240}, [2396] = {value = 1000}, [2381] = {value = 450}, [2528] = {value = 8000}, [2409] = {value = 1800}, [2414] = {value = 9000}, [2427] = {value = 11000}, [2407] = {value = 7200}, [2383] = {value = 960}, [2392] = {value = 4000}, [2488] = {value = 12000}, [2525] = {value = 250}, [2423] = {value = 1000}, [2462] = {value = 4800}, [2520] = {value = 30000}, [2390] = {value = 180000}, [2417] = {value = 500}, [2436] = {value = 6000}, [5741] = {value = 40000}, [2378] = {value = 500}, [2487] = {value = 12000}, [2476] = {value = 5000}, [8891] = {value = 15000}, [2195] = {value = 30000}, [2391] = {value = 7200}, [8889] = {value = 18000}, [2432] = {value = 8000}, [2431] = {value = 108000}, [2492] = {value = 40000}, [2515] = {value = 2000}, [2430] = {value = 2000}, [2393] = {value = 17000}, [7419] = {value = 10000}, [2522] = {value = 120000}, [2514] = {value = 50000}, [7418] = {value = 35000} } function onUse(cid, item, frompos, itemEx, topos) if (itemEx.itemid == item.itemid) then local str = "" for i, k in pairs(items) do str = str ..getItemNameById(i):gsub("%a", string.upper, 1).. ": ".. k.value .. "\n" end doShowTextDialog(cid, 6533, "Item Name: Price\n-----------------------------\n".. str) return true end --local i = items[getItemNameById(itemEx.itemid)] local i = items[itemEx.itemid] if (i) then local count = getPlayerItemCount(cid, itemEx.itemid) if (count > 0) then doPlayerSellItem(cid, itemEx.itemid, count, i.value * count, false) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você vendeu ".. count .." ".. (count == 1 and getItemNameById(itemEx.itemid) or getItemPluralNameById(itemEx.itemid)) .. " por ".. i.value * count .." gold coins.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não possuí esse item, o sistema irá vender apenas os items em seu inventário, items equipados não serão vendidos!") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Não foi possível vender esse item, use o loot seller nele mesmo para ver a lista de items disponíveis.") doSendMagicEffect(frompos, CONST_ME_POFF) end return true end