-
Total de itens
962 -
Registro em
-
Última visita
-
Dias Ganhos
10
Tudo que Furabio postou
-
Tu teria que fazer o uso dessa função : https://otland.net/threads/creatureevent-onmoveitem-cid-item-count-tocontainer-fromcontainer.185781/
-
Tópico movido para a seção de dúvidas e pedidos resolvidos.
-
Testei aqui e funcionando 100% : local arena = { frompos = {x = 137, y = 380, z = 7}, topos = {x = 154, y = 403, z = 7}, } function isInRange(pos, fromPos, toPos) return pos.x >= fromPos.x and pos.y >= fromPos.y and pos.z >= fromPos.z and pos.x <= toPos.x and pos.y <= toPos.y and pos.z <= toPos.z end function onPrepareDeath(player, killer, mostDamageKiller) if player:isPlayer() and killer:isMonster() then local ppos = player:getPosition() if isInRange(ppos, arena.frompos, arena.topos) then player:teleportTo(player:getTown():getTemplePosition()) player:addHealth(player:getMaxHealth()) player:addMana(player:getMaxMana()) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You were killed by '.. killer:getName() ..'.') end end return true end function onLogin(player) player:registerEvent("MArena") return true end <event type="preparedeath" name="MArena" script="arquivo.lua"/> <event type="login" name="verf_MArena" script="arquivo.lua"/>
-
Tente usar assim : function onPrepareDeath(player, creature, lastHitKiller, mostDamageKiller) if player:isPlayer() and creature:isMonster() then local ppos = player:getPosition() if isInRange(ppos, arena.frompos, arena.topos) then local maxhp = player:getMaxHealth() player:addHealth(maxhp) addEvent(doCreatureAddHealth, 100, player:getId(), maxhp) player:teleportTo(arena.exitpos) end end return true end
-
Teste : local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local xmsg = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local storage = 62003 local monsters = { ["Dragons"] = {storage = 5010, mstorage = 19000, amount = 10, exp = 5000, mount = 10}, ["Dragon Lords"] = {storage = 5011, mstorage = 19001, amount = 10, exp = 10000, mount = 20}, ["Hydras"] = {storage = 5012, mstorage = 19002, amount = 10, exp = 18000, mount = 30}, ["Demons"] = {storage = 5013, mstorage = 19003, amount = 10, exp = 20000, mount = 40} } local function Cptl(f, r) return f:upper()..r:lower() end function creatureSayCallback(cid, type, msg) local player, cmsg = Player(cid), msg:gsub("(%a)([%w_']*)", Cptl) if not npcHandler:isFocused(cid) then if msg == "hi" or msg == "hello" then npcHandler:addFocus(cid) if player:getStorageValue(storage) == -1 then local text, n = "", 0 for k, x in pairs(monsters) do if player:getStorageValue(x.mstorage) < x.amount then n = n + 1 text = text .. ", " text = text .. ""..x.amount.." {"..k.."}" end end if n > 1 then npcHandler:say("I have several tasks for you to kill monsters"..text..", which one do you choose? I can also show you a {list} with rewards and you can {stop} a task if you want.", cid) npcHandler.topic[cid] = 1 xmsg[cid] = msg elseif n == 1 then npcHandler:say("I have one last task for you"..text..".", cid) npcHandler.topic[cid] = 1 else npcHandler:say("You already did all tasks, I have nothing for you to do anymore, good job though.", cid) end elseif player:getStorageValue(storage) == 1 then for k, x in pairs(monsters) do if player:getStorageValue(x.storage) == 1 then npcHandler:say("Did you kill "..x.amount.." "..k.."?", cid) npcHandler.topic[cid] = 2 xmsg[cid] = k end end end else return false end elseif monsters[cmsg] and npcHandler.topic[cid] == 1 then if player:getStorageValue(monsters[cmsg].storage) == -1 then npcHandler:say("Good luck, come back when you killed "..monsters[cmsg].amount.." "..cmsg..".", cid) player:setStorageValue(storage, 1) player:setStorageValue(monsters[cmsg].storage, 1) else npcHandler:say("You already did the "..cmsg.." mission.", cid) end npcHandler.topic[cid] = 0 elseif msgcontains(msg, "yes") and npcHandler.topic[cid] == 2 then local x = monsters[xmsg[cid]] if player:getStorageValue(x.mstorage) >= x.amount then npcHandler:say("Good job, here is your reward, ".. x.mount..".", cid) player:addMount(x.mount) player:addExperience(x.exp) player:setStorageValue(x.storage, 2) player:setStorageValue(storage, -1) npcHandler.topic[cid] = 3 else npcHandler:say("You didn't kill them all, you still need to kill "..x.amount -(player:getStorageValue(x.mstorage) + 1).." "..xmsg[cid]..".", cid) end elseif msgcontains(msg, "task") and npcHandler.topic[cid] == 3 then local text, n = "", 0 for k, x in pairs(monsters) do if player:getStorageValue(x.mstorage) < x.amount then n = n + 1 text = text .. (n == 1 and "" or ", ") text = text .. "{"..k.."}" end end if text ~= "" then npcHandler:say("Want to do another task? You can choose "..text..".", cid) npcHandler.topic[cid] = 1 else npcHandler:say("You already did all tasks.", cid) end elseif msgcontains(msg, "no") and npcHandler.topic[cid] == 1 then npcHandler:say("Ok then.", cid) npcHandler.topic[cid] = 0 elseif msgcontains(msg, "stop") then local text, n = "", 0 for k, x in pairs(monsters) do if player:getStorageValue(x.mstorage) < x.amount then n = n + 1 text = text .. (n == 1 and "" or ", ") text = text .. "{"..k.."}" if player:getStorageValue(x.storage) == 1 then player:setStorageValue(x.storage, -1) end end end if player:getStorageValue(storage) == 1 then npcHandler:say("Alright, let me know if you want to continue an other task, you can still choose "..text..".", cid) else npcHandler:say("You didn't start any new task yet, if you want to start one, you can choose "..text..".", cid) end player:setStorageValue(storage, -1) npcHandler.topic[cid] = 1 elseif msgcontains(msg, "list") then local text = "Tasks\n\n" for k, x in pairs(monsters) do if player:getStorageValue(x.mstorage) < x.amount then text = text ..k .." ["..(player:getStorageValue(x.mstorage) + 1).."/"..x.amount.."]:\n Rewards:\n ".. x.mount .."\n "..x.exp.." experience \n\n" else text = text .. k .." [DONE]\n" end end player:showTextDialog(1949, "" .. text) npcHandler:say("Here you are.", cid) elseif msgcontains(msg, "bye") then npcHandler:say("Bye.", cid) npcHandler:releaseFocus(cid) else npcHandler:say("What?", cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) a identação ficou bem bugada por causa que usei o ident automático no script sem identação... em : ["Dragons"] = {storage = 5010, mstorage = 19000, amount = 10, exp = 5000, mount = 10}, mount = ID DA MOUNT
-
Você quer que ele ganhe o item e a mount, ou só a mount ?
-
Sempre deixe a dúvida no tópico e se resolveu coloque a resposta também, ajuda todos vocês querem, mas ajudar que é bom nada ZzZzZzZ Tópico movido para a seção de dúvidas e pedidos resolvidos.
-
Tópico movido para a seção de dúvidas e pedidos resolvidos.
-
bug Efeito saindo do chao que tira life do player
pergunta respondeu ao Drk Shadow de Furabio em Scripts
Tópico movido para a seção de dúvidas e pedidos resolvidos. -
data/talkactions/script/mute.lua TFS 1.1 : function onSay(cid, words, param) local CHANNEL_HELP = 7 local player = Player(cid) local storage = 456112 if words == "/mute" then local mute = param:split(",") if mute[1] == nil or mute[1] == " " then player:sendCancelMessage("Invalid player specified.") return false end if mute[2] == nil or mute[2] == " " then player:sendCancelMessage("Invalid time specified.") return false end local target = Player(mute[1]) local time = tonumber(mute[2]) local condition = Condition(CONDITION_CHANNELMUTEDTICKS, CONDITIONID_DEFAULT) condition:setParameter(CONDITION_PARAM_SUBID, CHANNEL_HELP) condition:setParameter(CONDITION_PARAM_TICKS, time*60*1000) if player:getAccountType() < ACCOUNT_TYPE_TUTOR then return false end if target == nil then player:sendCancelMessage("A player with that name is not online.") return false end if target:getAccountType() >= ACCOUNT_TYPE_TUTOR then player:sendCancelMessage("Only player can be mutated") return false end target:addCondition(condition) sendChannelMessage(CHANNEL_HELP, TALKTYPE_CHANNEL_R1, target:getName() .. " has been muted by " .. player:getName() .. " for using Help Channel inappropriately.") target:setStorageValue(storage, 1) return false end if words == "/unmute" then local remove = Player(param) if player:getAccountType() < ACCOUNT_TYPE_TUTOR then return false end if remove == nil then player:sendCancelMessage("A player with that name is not online.") return false end if remove:getAccountType() >= ACCOUNT_TYPE_TUTOR then return false end if remove:getStorageValue(storage) == 1 then remove:removeCondition(CONDITION_CHANNELMUTEDTICKS, CONDITIONID_DEFAULT, CHANNEL_HELP) sendChannelMessage(CHANNEL_HELP, TALKTYPE_CHANNEL_R1, remove:getName() .. " has been unmuted by " .. player:getName() .. ".") remove:setStorageValue(storage, -1) else player:sendCancelMessage("A player " .. remove:getName() .. "is not mutated") end end return false end em talkactions.XML, adicione : <talkaction words="/mute" separator=" " script="mute.lua" /> <talkaction words="/unmute" separator=" " script="mute.lua" /> Modo de usar : /mute ScreaM, 1 /unmute ScreaM
-
Tópico movido para a seção de dúvidas e pedidos resolvidos.
-
Tópico movido para a seção de dúvidas e pedidos resolvidos.
-
Movido.
-
Tópico movido para a seção de dúvidas e pedidos resolvidos.
-
action [Movements] Tp com Limite de Players
tópico respondeu ao Krono de Furabio em CreatureScripts e Movements
Tenta assim : local c = { limit = 5, -- Limite de jogadores msgCancel = 'Tp bloqueado. Maximo de jogadores atingido', -- Mensagem quando o limite de jogadores estiver atingido area = { From = {x = 1069, y = 1027, z = 6}, -- Coordenada maxima superior esquerda To = {x = 1071, y = 1030, z = 7}, -- Coordenada minima inferior direita }, pos = {x = 1070, y = 1030, z = 7}, -- Coordenada onde será teletransportado } local function getPlayersInArea(fromPos, toPos) local t = {} for _, cid in ipairs(getPlayersOnline()) do if isInRange(getThingPos(cid), fromPos, toPos) then table.insert(t, cid) end end return t end function onStepIn(cid, item, fromPos, toPos) if isPlayer(cid) then if table.getn(getPlayersInArea(c.area.From, c.area.To)) < c.limit then doSendMagicEffect(fromPos, CONST_ME_TELEPORT) doTeleportThing(cid, c.pos) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) else doPlayerSendCancel(cid, c.msgCancel) doTeleportThing(cid, toPos, false) end end return true end faltava um "}" pra fechar a tabela.- 6 respostas
-
- tp com limite
- players restrito
- (e 1 mais)
-
Tópico movido para a seção de dúvidas e pedidos resolvidos.
-
Tópico movido para a seção de dúvidas e pedidos resolvidos.
-
[Tutorial] Editar icons de cooldown (spell)
tópico respondeu ao Administrador de Furabio em Tutoriais de Clients
Parabéns pelo belo tutorial, vai ajudar muita gente. -
Tópico movido para a seção de dúvidas e pedidos resolvidos.
-
local voc = {6,7,8,9,10,11,12} -- Vocations local dalay = 2 -- Segundos local effect = 70 -- Efeito function ariseAura(cid) if isInArray(voc, getPlayerVocation(cid)) and isPlayer(cid) then doSendMagicEffect(getThingPos(cid), effect) addEvent(ariseAura, delay * 1000, cid) end return true end function onLogin(cid) ariseAura(cid) return true end
-
Concordo, seria muito bom mesmo,
-
Tópico movido para a seção de dúvidas e pedidos resolvidos.
-
Tópico movido para a seção de dúvidas e pedidos resolvidos.
-
Aprovado e movido.
-
dúvida Erro ao usar uma magia em protection zone
pergunta respondeu ao AdilsonHacker de Furabio em Scripts
Tópico movido para a seção de dúvidas e pedidos resolvidos.
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.