
Tudo que Kemmlly postou
-
ERRO NO SCRIPT - AJUDA
doPlayerSetLossPercent(cid, experience, 0) Remove isso do script, porém, ele n vai perder o loot mas vai perder xp quando morrer.
-
Items contáveis
Item Editor, abra o item e desmarque a opção Stackable. Segue um exemplo..
-
Erro No Config.lua TSF 1.2 GLOBAL 10.95
Troque o 127.0.0.1 por "localhost", ou deixe em branco "", ou o ip do seu computador na rede, acredito que um desses irá resolver o problema.
-
Bug Potions REP +
local config = { removeOnUse = "no", usableOnTarget = "yes", -- can be used on target? (fe. healing friend) splashable = "no", realAnimation = "no", -- make text effect visible only for players in range 1x1 healthMultiplier = 1.0, manaMultiplier = 1.0 } config.removeOnUse = getBooleanFromString(config.removeOnUse) config.usableOnTarget = getBooleanFromString(config.usableOnTarget) config.splashable = getBooleanFromString(config.splashable) config.realAnimation = getBooleanFromString(config.realAnimation) local POTIONS = { [8704] = {empty = 7636, splash = 2, health = {100, 200}}, -- small health potion [7618] = {empty = 7636, splash = 2, health = {150, 200}}, -- health potion [7588] = {empty = 7634, splash = 2, health = {300, 350}, level = 50, vocations = {3, 4, 7, 8}, vocStr = "knights and paladins"}, -- strong health potion [7591] = {empty = 7635, splash = 2, health = {800, 900}, level = 80, vocations = {4, 8}, vocStr = "knights"}, -- great health potion [8473] = {empty = 7635, splash = 2, health = {1100, 1200}, level = 130, vocations = {4, 8}, vocStr = "knights"}, -- ultimate health potion [7620] = {empty = 7636, splash = 7, mana = {200, 250}}, -- mana potion [7589] = {empty = 7634, splash = 7, mana = {300, 300}, level = 50, vocations = {1, 2, 3, 5, 6, 7}, vocStr = "sorcerers, druids and paladins"}, -- strong mana potion [7590] = {empty = 7635, splash = 7, mana = {650, 750}, level = 80, vocations = {1, 2, 5, 6}, vocStr = "sorcerers and druids"}, -- great mana potion [8472] = {empty = 7635, splash = 3, health = {350, 400}, mana = {300, 350}, level = 80, vocations = {3, 7}, vocStr = "paladins"}, -- great spirit potion } local exhaust = createConditionObject(CONDITION_EXHAUST) setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100)) function onUse(cid, item, fromPosition, itemEx, toPosition) local potion = POTIONS[item.itemid] if(not potion) then return false end if(not isPlayer(itemEx.uid) or (not config.usableOnTarget and cid ~= itemEx.uid)) then if(not config.splashable) then return false end if(toPosition.x == CONTAINER_POSITION) then toPosition = getThingPos(item.uid) end doDecayItem(doCreateItem(2016, potion.splash, toPosition)) doTransformItem(item.uid, potion.empty) return TRUE end if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED) return TRUE end if(((potion.level and getPlayerLevel(cid) < potion.level) or (getPlayerVocation(cid) ~= potion.vocations))) and not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then doCreatureSay(itemEx.uid, "Only " .. potion.vocStr .. (potion.level and (" of level " .. potion.level) or "") .. " or above may drink this fluid.", TALKTYPE_ORANGE_1) return TRUE end local health = potion.health if(health and not doCreatureAddHealth(itemEx.uid, math.ceil(math.random(health[1], health[2]) * config.healthMultiplier))) then return false end local mana = potion.mana if(mana and not doPlayerAddMana(itemEx.uid, math.ceil(math.random(mana[1], mana[2]) * config.manaMultiplier))) then return false end doSendMagicEffect(getThingPos(itemEx.uid), 66) if(not realAnimation) then doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1) else for i, tid in ipairs(getSpectators(getCreaturePosition(cid), 1, 1)) do if(isPlayer(tid)) then doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1, false, tid) end end end doAddCondition(cid, exhaust) if(not potion.empty or config.removeOnUse) then doRemoveItem(item.uid, 1) return TRUE end doRemoveItem(item.uid, 0) doPlayerAddItem(cid, potion.empty, 0) doPlayerRemoveItem(cid, potion.empty, getPlayerItemCount(cid, potion.empty)) doPlayerAddItem(cid, potion.empty, getPlayerItemCount(cid, potion.empty)) return TRUE end Tenta assim...
-
Npc que teleporta player para vários lugares...
local tab = { pos = {x = 1004, y = 1021, z = 7}, -- posição x, y, z do local a teleportar o player pos1 = {x = 1004, y = 1021, z = 7}, -- posição x, y, z do local a teleportar o player pos2 = {x = 1004, y = 1021, z = 7}, -- posição x, y, z do local a teleportar o player pos3 = {x = 1004, y = 1021, z = 7}, -- posição x, y, z do local a teleportar o player pos4 = {x = 1004, y = 1021, z = 7}, -- posição x, y, z do local a teleportar o player pos5 = {x = 1004, y = 1021, z = 7}, -- posição x, y, z do local a teleportar o player pos6 = {x = 1004, y = 1021, z = 7}, -- posição x, y, z do local a teleportar o player pos7 = {x = 1004, y = 1021, z = 7}, -- posição x, y, z do local a teleportar o player } local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 function creatureSayCallback(cid, type, msg) if (not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if (msgcontains(msg, 'lugar')) then selfSay('Boa viagem!', cid) doTeleportThing(cid, tab.pos) elseif (msgcontains(msg, 'lugar2')) then selfSay('Boa viagem!', cid) doTeleportThing(cid, tab.pos1) elseif msgcontains(msg, 'lugar3') then selfSay('Boa viagem!', cid) doTeleportThing(cid, tab.pos2) elseif msgcontains(msg, 'lugar4') then selfSay('Boa viagem!', cid) doTeleportThing(cid, tab.pos3) elseif msgcontains(msg, 'lugar5') then selfSay('Boa viagem!', cid) doTeleportThing(cid, tab.pos4) elseif msgcontains(msg, 'lugar6') then selfSay('Boa viagem!', cid) doTeleportThing(cid, tab.pos5) elseif msgcontains(msg, 'lugar7') then doTeleportThing(cid, tab.pos6) selfSay('Boa viagem.', cid) elseif msgcontains(msg, 'lugar8') then doTeleportThing(cid, tab.pos7) selfSay('Boa viagem.', cid) else return false end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
Task Addon!
Você adicionou no lugar errado, tem que ser abaixo disso; doPlayerAddExp(cid, config.exp[1] == true and config.exp[2] or 0)
-
Task Addon!
É só adicionar essa tag embaixo da recompensa da tag q vc quer, ou, embaixo da recompensa de terminar todas as tasks
-
Task Addon!
doPlayerAddItem(cid, 5878, 100) Só adicionar isso /\ embaixo de doPlayerAddExp(cid, config.exp[1] == true and config.exp[2] or 0)
-
[Pedido] NPC Bless 8.6
Disponha.
-
[Pedido] NPC Bless 8.6
Pelo que vi, você tentou fazer o NPC todo no XML, o ideal é usar o XML só para chamar o script do NPC e nesse script fazer o resto. Se o NPC for só de fala, você usa o elseif para cada fala e registra o talkState[talkUser] = para gravar a mensagem falada, exemplo; if (msgcontains(msg, 'sacrificio')) then talkState[talkUser] = 1 selfSay('Precisamos de sacrificios para manter os portais abertos e também o acesso as {quests}.', cid) elseif (msgcontains(msg, 'quest') and talkState[talkUser] == 1) then selfSay('Texto que o npc vai falar com {palavra} pra frase 2.', cid) talkState[talkUser] = 2 elseif (msgcontains(msg, 'palavra') and talkState[talkUser] == 2) then selfSay('Texto que o npc vai falar com {palavra} pra frase 3.', cid) talkState[talkUser] = 3 Nesse caso, se um player chegar no NPC e falar diretamente QUEST, como o talkState[talkUser] não é igual a 1 ainda, ele não falará nada, mas se falar as frases na ordem, o NPC irá contar toda a história. Acredito que seja o suficiente pra você criar seu NPC.
-
[Pedido] NPC Bless 8.6
1 - local tab = { price = 50, -- Preco BLESS, 50 = 50k price2 = 20 -- Preco AOL, 20 = 20k } local bless = {1, 2, 3, 4, 5} local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 function creatureSayCallback(cid, type, msg) if (not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if (msgcontains(msg, 'bless')) then talkState[talkUser] = 1 selfSay('Deseja comprar todas as bles? Isso ira te custar '..tab.price..'k!', cid) elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then for i = 1, table.maxn(bless) do if getPlayerBlessing(cid, bless[i]) then selfSay('Voce ja tem todas as blessings.', cid) elseif (doPlayerRemoveMoney(cid, tab.price) == TRUE) then doPlayerAddBlessing(cid, bless[i]) talkState[talkUser] = 0 selfSay('Voce comprou todas as blessings.', cid) doSendMagicEffect(getPlayerPosition(cid), 49) elseif (doPlayerRemoveMoney(cid, tab.price) == FALSE) then selfSay('Voce nao tem dinheiro suficiente!', cid) end end elseif msgcontains(msg, 'aol') then talkState[talkUser] = 2 selfSay('Deseja comprar uma AOL por '..tab.price2..'k?', cid) elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 2) then if (doPlayerRemoveMoney(cid, tab.price2) == TRUE) then doPlayerAddItem(cid,2173,1) talkState[talkUser] = 0 doSendMagicEffect(getPlayerPosition(cid),6) selfSay('Aqui esta sua AOL!', cid) else selfSay('Voce nao tem dinheiro suficiente!', cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) 2 - É um NPC fácil, você só precisa especificar as falas. 3 - local tab = { pos = {x = 1004, y = 1021, z = 7}, -- posição x, y, z do local a teleportar o player item = {5920, 50}, -- {id, quantidade} item2 = {5882, 30}, -- {id, quantidade} item3 = {11199, 20} -- {id, quantidade} } local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 function creatureSayCallback(cid, type, msg) if (not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if (msgcontains(msg, 'teleport')) then talkState[talkUser] = 1 selfSay('Lembre-se.. Voce precisa de '..tab.item[2]..' '..getItemNameById(tab.item[1])..', '..tab.item2[2]..' '..getItemNameById(tab.item2[1])..' e '..tab.item3[2]..' '..getItemNameById(tab.item3[1])..' para teleportar, voce tem todos os itens?', cid) elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if (getPlayerItemCount(cid, tab.item[1]) >= tab.item[2] and getPlayerItemCount(cid, tab.item2[1]) >= tab.item2[2] and getPlayerItemCount(cid, tab.item3[1]) >= tab.item3[2]) then doPlayerRemoveItem(cid, tab.item[1], tab.item[2]) doPlayerRemoveItem(cid, tab.item2[1], tab.item2[2]) doPlayerRemoveItem(cid, tab.item3[1], tab.item3[2]) doTeleportThing(cid, tab.pos) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) selfSay('Voce foi teleportado!', cid) else talkState[talkUser] = 0 selfSay('Perdao, mas voce nao tem os itens necessarios ainda.', cid) end elseif (msgcontains(msg, 'no') and talkState[talkUser] == 1) then talkState[talkUser] = 0 selfSay('Pois bem, pegue os itens e retorne.', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
Pet System Simples
Ha um tempo atrás eu procurei um Pet System bem simples pro meu servidor, e achei um muito bacana. TFS: 0.4 Tibia: 8.6 O sistema original foi postado pelo @Luquinha no tópico: O script funciona corretamente, eu fiz apenas algumas alterações e queria compartilhar caso vocês tenham as mesmas exigências que eu; * Ao tentar usar o PET em PZ não da mais erro na distro, sobe um efeito FAILED! no player e manda uma mensagem. * Agora cada PET precisa de um storage para ser usado, no meu caso, cada PET tem sua quest individual. O script modificado: function onUse(cid, item, frompos, item2, topos) local dolls = { [11256] = {pet = "Rat"}, [11207] = {pet = "Demon"}, [5791] = {pet = "Dragon"}, } local go = dolls[item.itemid] local summon = getCreatureSummons(cid) --------------------------------------------------- if not (getTilePzInfo(getCreaturePosition(cid))) then if #summon >= 1 then for _, pid in ipairs(summon) do doRemoveCreature(pid) doCreatureSay(cid, ""..go.pet..", Recuar!", TALKTYPE_ORANGE_1) end return true end if item.itemid == 5791 then if getPlayerStorageValue(cid, 6666) == 1 then doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid))) doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1) else doPlayerSendTextMessage(cid, 19, "Voce precisa da quest para usar esse PET!") doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180) end end if item.itemid == 11256 then if getPlayerStorageValue(cid, 4444) == 1 then doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid))) doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1) else doPlayerSendTextMessage(cid, 19, "Voce precisa da quest para usar esse PET!") doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180) end end if item.itemid == 11207 then if getPlayerStorageValue(cid, 4445) == 1 then doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid))) doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1) else doPlayerSendTextMessage(cid, 19, "Voce precisa fazer a quest para usar esse PET!") doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180) end end else doPlayerSendTextMessage(cid, 19, "Voce nao pode sumonar seu PET em Protect Zone!") doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180) return true end end Creditos: @Luquinha @Roksas @Kemmlly
-
[Pedido] Tutorial - Novo server
Acredito que esses tutoriais possam te ajudar, estão bem explicados:
-
Porta selada só abre se o player Tiver x Storage
Acredito que só mude isso: if getPlayerStorageValue(cid, storage) > 0 then Pra isso: if Player:getStorageValue(storage) > 0 then Isso mesmo? Não manjo de 1.2, só 0.4 msm
-
Porta selada só abre se o player Tiver x Storage
Se não me engano esse script é para 0.4, pega no 1.2 também?
-
[Pedido] Storage por tempo
function onUse(cid, item, itemEx) local dias = 7 -- Quantidade em dias que o storage vai durar local time = dias * 24 * 60 * 60 local storage = 3030 -- Storage que adiciona if getPlayerStorageValue(cid, storage) - os.time() >= 1 then doPlayerSendTextMessage(cid,25,"Voce ja esta sobre o efeito do item, espere o efeito acabar.") else doPlayerSendTextMessage(cid, 22, "Voce agora esta sobre o efeito do item!") doRemoveItem(item.uid, 1) setPlayerStorageValue(cid, storage, os.time() + time) return true end end
-
Ajuda help please
Bom dia. Ao pedir algum script, por favor especifique a versão do seu servidor para adiantar o processo, qual sua versão?
-
create teleport
data/movements/scripts/script.lua local tps = { pos = {x=1017, y=1020, z=7}, -- Local onde vai aparecer o TP toPos = {x=1019, y=1022, z=7}, -- Local para onde o TP leva } local function removeTp(tps) local t = getTileItemById(tps.pos, 5023).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(tp.pos, CONST_ME_POFF) end function onStepIn(cid, item, frompos, item2, topos) if isPlayer(cid) then doCreateTeleport(5023, tps.toPos, tps.pos) doCreatureSay(cid, "O teleport foi criado!.", TALKTYPE_ORANGE_1) addEvent(removeTp, 10*1000, tps) end return true end movements.xml <movevent type="StepIn" uniqueid="UNIQUE ID QUE VOCE ESCOLHER" event="script" value="nome do script.lua"/>
-
Corrigir Script de uma spell!
Da algum erro no executável?
-
Problema com Cast System
No CONFIG.LUA mudou enableCast para TRUE?
-
Task Addon!
Pela manhã resolvo pra você, me manda o script.
-
(Resolvido)[SCRIPT] Item para Last Hit
ok
-
[Creaturevent+Talkaction] Anti-bot
Explica melhor aí que não entendi o que você quer mudar.
-
(Resolvido)[SCRIPT] Item para Last Hit
Sim, esse aí é o mesmo script, só adicionei o not isPlayer(cid, target) porque no eu tava ativando o script toda vez que um player matava o outro.
-
(Resolvido)[SCRIPT] Item para Last Hit
O script buscar informções na lista de mortes, a posição [1] é quem deu o ultimo hit e a posição [2] quem tirou mais HP do monstro, o script ta certo , é o que eu uso.