Ir para conteúdo

Pesquisar na Comunidade

Mostrando resultados para as tags ''npc''.

  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo


Fóruns

  • xTibia - Notícias e Suporte
    • Regras
    • Noticias
    • Soluções
    • Projetos Patrocinados
    • Tutoriais para Iniciantes
    • Imprensa
  • OTServ
    • Notícias e Debates
    • OTServlist
    • Downloads
    • Recursos
    • Suporte
    • Pedidos
    • Show-Off
    • Tutoriais
  • OFF-Topic
    • Barzinho do Éks
    • Design
    • Informática

Encontrar resultados em...

Encontrar resultados que contenham...


Data de Criação

  • Início

    FIM


Data de Atualização

  • Início

    FIM


Filtrar pelo número de...

Data de Registro

  • Início

    FIM


Grupo


Sou

  1. AnneMotta

    NPC Dicer

    Bom dia jovens, graças ao grande Omega eu consegui terminar o código do NPC Dicer, a função para checar o gold foi feita por ele então deem um beijo nele O NPC é parecido com aqueles BOTS que ficam no tibia global em yalahar normalmente, você joga uma quantia em gold e fala L ou H também pode ser Low ou High e com sorte pode ganhar o dobro da quantia apostada, exemplo: Eu vou lá jogo 20k na mesa e falo Low, caso caia nos números 1, 2 ou 3 eu irei ganhar o dobro da quantia que eu apostei que no foi 20k, mas se cair nos números 4, 5 ou 6 eu iria perder esses 20k. O High é a mesma coisa porém ao contrario, se eu falo High e cair nos numero 4, 5 ou 6 eu ganho o dobro da quantia que eu apostei e se cair no 1, 2 ou 3 eu perderia tudo. Crie um arquivo em data/npc com o nome dicer.xml e adicione isso dentro: <?xml version="1.0"?> <npc name="Dicer" script="data/npc/scripts/dicer.lua" walkinterval="1000" floorchange="0"> <health now="100" max="100"/> <look type="132" head="114" body="0" legs="0" feet="114" addons="3"/> <parameters> <parameter key="message_greet" value="Ola {|PLAYERNAME|}, caso queria tentar a sorte diga {L} ou {Low} para apostar nos numeros {1}, {2} ou {3} ||| {H} ou {High} para apostar nos numeros {4}, {5} ou {6}!" /> </parameters> </npc> Agora vá até data/npc/scripts e crie um arquivo com o nome dicer.lua e adicione isso dentro: 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 local coins = {[2148] = 1, [2152] = 100, [2160] = 10000} function countMoneyOnPos(pos) local money = 0 for stack = 1, 50 do pos.stackpos = stack local item = getThingFromPos(pos) if item and item.uid > 0 then if coins[item.itemid] then money = money + coins[item.itemid] * item.type end end end return money end local posCoal = {x = 169, y = 58, z = 7} -- POSIÇÃO DO COAL, ONDE O GOLD DEVE ESTAR local posNpc = {x = 193, y = 45, z = 7} -- POSIÇÃO DO NPC local pos = getPosByDir(getThingPos(cid), getCreatureLookDirection(cid), 1) -- NÃO ALTERAR if msgcontains(msg, 'l') or msgcontains(msg, 'L') or msgcontains(msg, 'low') or msgcontains(msg, 'Low') then if countMoneyOnPos(pos) > 0 then if math.random(1, 6) <= 3 then doPlayerAddMoney(cid, countMoneyOnPos(pos)*2) doRemoveItem(getTileItemById(pos, 2148).uid) repeat until not doRemoveItem(getTileItemById(pos, 2148).uid) doRemoveItem(getTileItemById(pos, 2152).uid) repeat until not doRemoveItem(getTileItemById(pos, 2152).uid) doRemoveItem(getTileItemById(pos, 2160).uid) repeat until not doRemoveItem(getTileItemById(pos, 2160).uid) doSendMagicEffect(posNpc, 26) doSendMagicEffect(posNpc, 28) doCreatureSay(getNpcId(), getCreatureName(cid)..' tirou o numero '..math.random(1, 3)..', parabéns!', TALKTYPE_ORANGE_1) else doRemoveItem(getTileItemById(pos, 2148).uid) repeat until not doRemoveItem(getTileItemById(pos, 2148).uid) doRemoveItem(getTileItemById(pos, 2152).uid) repeat until not doRemoveItem(getTileItemById(pos, 2152).uid) doRemoveItem(getTileItemById(pos, 2160).uid) repeat until not doRemoveItem(getTileItemById(pos, 2160).uid) doSendMagicEffect(posNpc, 2) doSendMagicEffect(posNpc, 26) doCreatureSay(getNpcId(), getCreatureName(cid)..' tirou o numero '..math.random(4, 6)..', tente novamente!', TALKTYPE_ORANGE_1) end else doCreatureSay(getNpcId(), getCreatureName(cid)..', coloque uma quantia de gold no recipiente para começar a apostar!', TALKTYPE_ORANGE_1) end elseif msgcontains(msg, 'h') or msgcontains(msg, 'H') or msgcontains(msg, 'high') or msgcontains(msg, 'High') then if countMoneyOnPos(pos) > 0 then if math.random(1, 6) <= 3 then doPlayerAddMoney(cid, countMoneyOnPos(pos)*2) doRemoveItem(getTileItemById(pos, 2148).uid) repeat until not doRemoveItem(getTileItemById(pos, 2148).uid) doRemoveItem(getTileItemById(pos, 2152).uid) repeat until not doRemoveItem(getTileItemById(pos, 2152).uid) doRemoveItem(getTileItemById(pos, 2160).uid) repeat until not doRemoveItem(getTileItemById(pos, 2160).uid) doSendMagicEffect(posNpc, 26) doSendMagicEffect(posNpc, 28) doCreatureSay(getNpcId(), getCreatureName(cid)..' tirou o numero '..math.random(4, 6)..', parabéns!', TALKTYPE_ORANGE_1) else doRemoveItem(getTileItemById(pos, 2148).uid) repeat until not doRemoveItem(getTileItemById(pos, 2148).uid) doRemoveItem(getTileItemById(pos, 2152).uid) repeat until not doRemoveItem(getTileItemById(pos, 2152).uid) doRemoveItem(getTileItemById(pos, 2160).uid) repeat until not doRemoveItem(getTileItemById(pos, 2160).uid) doSendMagicEffect(posNpc, 2) doSendMagicEffect(posNpc, 26) doCreatureSay(getNpcId(), getCreatureName(cid)..' tirou o numero '..math.random(1, 3)..', tente novamente!', TALKTYPE_ORANGE_1) end else doCreatureSay(getNpcId(), getCreatureName(cid)..', coloque uma quantia de gold no recipiente para começar a apostar!', TALKTYPE_ORANGE_1) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Você deve fazer alterações nesta parte: local posCoal = {x = 169, y = 58, z = 7} -- POSIÇÃO DO COAL, ONDE O GOLD DEVE ESTAR local posNpc = {x = 193, y = 45, z = 7} -- POSIÇÃO DO NPC Aconselhável montar uma área pro npc ficar idêntica a da fotos para não bugar o código, o coal() deve sempre ficar na frente do player pois a função ira chegar o gold a frente do player. Ao falar Hi Npc verificando que não tem gold no coal Vencendo uma aposta Perdendo uma aposta Créditos: Markin(Anne) Omega pela função de checar o gold
  2. nossa que titulo bosta hahaha então gente eu gostaria de saber se alguem tem um npc que pede para o jogador pegar tal item e depois entregar para ele. se for possivel o também um npc também pede para entregar o item para outro npc.
  3. Olá galera do XTIBIA, Venho pedir ajuda aos gênios Scripter's do Fórum Preciso de um Npc assim: - O Player diz "hi" - Npc diz um diálogo (configurável) - O Player diz "duel" - O Npc duela com 6 Pokemons e caso o Player vença todos, o Npc da x item para o Player Lembrando que uso como base o servidor Erondino V15 Bem, se for algo meio "impossível" irei entender, mas sei que tem muitos gênios Scripter's aqui e que podem fazer isso ... Obrigado Desde já!
  4. Olá galera do XTIBIA, Venho pedir ajuda aos gênios Scripter's do Fórum Preciso de um Npc assim: - O Player diz "hi" - Npc diz um diálogo (configurável) - O Player diz "duel" - O Npc duela com 6 Pokemons e caso o Player vença todos, o Npc da x item para o Player Lembrando que uso como base o servidor Erondino V15 Bem, se for algo meio "impossível" irei entender, mas sei que tem muitos gênios Scripter's aqui e que podem fazer isso ... Obrigado Desde já!
  5. Tulio271

    NPC CASAMENTO

    Galera quem me puder fazer esse npc ficarei grato d+ 1- npc deve casar 2 player nao importa o sexo 2- deve ser cobrda uma taxa de 1kk para casar e 10kk's para o divorcio 3- quando eu der look em min deve aparecer ( marido de fulano. ) ( esposa de fulano. ) em portugues. 4- o npc deve dar um ring com a data do casamento e o nome de quem casou 5- as falas no npc tem q ser emportugues de preferencia essa aqui quem puder me ajudar ficarei mt feliz.
  6. Olá pessoal do Xtibia, eu preciso que essa script de Raid sumone um NPC ao invés de um monstro... Nome do npc: Dexter Itens A script está 100% funcionando para sumonar monster.. porém se eu colocar o nome do npc no lugar de "demon" o npc não é sumonado. Alguém ajuda? versão 8.60, otx server 2. local raids = { ["Tuesday"] = { ["03:11"] = { name= "Demon", -- Nome do monstro a ser sumonado pos = {toPos= {x = 164, y = 53, z = 7}, fromPos= {x = 165, y = 53, z = 7}}, --Vai ser sumonado de toPos e até fromPos quantidade = 1, -- Quantidade a ser sumonada time = 2, -- Se no tempo determinado em time= x, os monstros não forem mortos eles são removidos automaticamente }, } } function doRemoveMonster(toPos, fromPos) for x = toPos.x, fromPos.x do for y = toPos.y , fromPos.y do local creature = getTopCreature({x=x, y= y, z= fromPos.z}).uid; if creature ~= 0 and isMonster(creature) then doRemoveCreature(creature) end end end return true end function onThink(interval, lastExecution) local hours = tostring(os.date("%X")):sub(1, 5); local days = raids[os.date("%A")][hours]; local raids_storage = 99997; if days then if getGlobalStorageValue(raids_storage) <= os.time() then doBroadcastMessage("The invasion of " .. days.name .. " started") pos = {x= math.random(days.pos.toPos.x, days.pos.fromPos.x), y= math.random(days.pos.toPos.y, days.pos.fromPos.y), z= days.pos.fromPos.z}; monster = 0; repeat doSummonCreature(days.name, pos) monster = monster + 1; until monster == days.quantidade; addEvent(function() doRemoveMonster(days.pos.toPos, days.pos.fromPos) end, days.time*1000*60) setGlobalStorageValue(raids_storage, os.time()+60) end end return true end
  7. Olá pessoal do Xtibia, eu preciso que essa script de Raid sumone um NPC ao invés de um monstro... Nome do npc: Dexter Itens A script está 100% funcionando para sumonar monster.. porém se eu colocar o nome do npc no lugar de "demon" o npc não é sumonado. Alguém ajuda? versão 8.60, otx server 2. local raids = { ["Tuesday"] = { ["03:11"] = { name= "Demon", -- Nome do monstro a ser sumonado pos = {toPos= {x = 164, y = 53, z = 7}, fromPos= {x = 165, y = 53, z = 7}}, --Vai ser sumonado de toPos e até fromPos quantidade = 1, -- Quantidade a ser sumonada time = 2, -- Se no tempo determinado em time= x, os monstros não forem mortos eles são removidos automaticamente }, } } function doRemoveMonster(toPos, fromPos) for x = toPos.x, fromPos.x do for y = toPos.y , fromPos.y do local creature = getTopCreature({x=x, y= y, z= fromPos.z}).uid; if creature ~= 0 and isMonster(creature) then doRemoveCreature(creature) end end end return true end function onThink(interval, lastExecution) local hours = tostring(os.date("%X")):sub(1, 5); local days = raids[os.date("%A")][hours]; local raids_storage = 99997; if days then if getGlobalStorageValue(raids_storage) <= os.time() then doBroadcastMessage("The invasion of " .. days.name .. " started") pos = {x= math.random(days.pos.toPos.x, days.pos.fromPos.x), y= math.random(days.pos.toPos.y, days.pos.fromPos.y), z= days.pos.fromPos.z}; monster = 0; repeat doSummonCreature(days.name, pos) monster = monster + 1; until monster == days.quantidade; addEvent(function() doRemoveMonster(days.pos.toPos, days.pos.fromPos) end, days.time*1000*60) setGlobalStorageValue(raids_storage, os.time()+60) end end return true end
  8. ola! Gostaria de um npc que atacasse os players sem precisar falar com ele. avisto um player ja solta o pokemon e manda ataca sem dó. E tbm uma variavel desse mesmo npc so mostra como edito pra esse mesmo npc apenas atacar players policer ou roket. desde ja agradeço a ajuda.
  9. xMathz

    AJUDA - NPC

    Fala galera do xtibia. Bom,comecei com OT a pouco tempo,e decidi pegar uma base e por as caras,estou com algumas dúvidas e tudo,e vim hoje pedir a ajuda de vocês... Por onde começar? :T Basicamente,eu gostaria de criar um npc que blockasse o monstro mais próximo dele... Ex: Entrei no servidor agora,sou level 8,vejo o npc BLOCKER,falo com ele,e ele comenta algo sobre "gostaria que eu blockasse um monstro para você?" e caso eu respondesse yes,ele iria ate o monstro mais proximo e receberia o dano (sem perder life) enquanto eu matasse :s Caso queiram mais detalhes,só pedir :T Obrigado, Abraços.
  10. I ae,gostaria que alguem modificasse como eu queria. oq eu quero que edite? Gostaria de tirar o dinheiro e botar para comprar outfit por x item e quantia. Só isso obg! Meu script: 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 out = {Jam = 181601, Rap = 181602, Ori = 181603, Roc = 181604, Adv = 181605, Bus = 181606, Atl = 181607, Punk = 181608, Mer = 181610, Hik = 181611} if (msgcontains(msg, 'Outfit') or msgcontains(msg, 'roupas') or msgcontains(msg, 'Outfits') or msgcontains(msg, 'outfits')) then selfSay("I sell this outfits Male..{Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Novinho, Dr House e Malandro Jr}, which outfit do you want??", cid) talkState[talkUser] = 2 ----Fodao elseif (msgcontains(msg, 'Fodao') or msgcontains(msg, 'fodao')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 3 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 3 then if getPlayerStorageValue(cid, out.Jam) <= 0 then if getPlayerPremiumDays(cid) > 0 then if getPlayerMoney(cid) >= 20000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 1562, 1) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Jam, 1) else doPlayerAddOutfit(cid, 1562, 1) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Jam, 1) end else selfSay("You need 200dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("Need be premium to buy this Outfit.", cid) talkState[talkUser] = 0 return false end else selfSay("You already have this outfit, so... I have other outfits {Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 3 then selfSay("So... I have this other outfits {Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid) talkState[talkUser] = 2 ----Gordo Alto elseif (msgcontains(msg, 'Gordo Alto') or msgcontains(msg, 'gordo alto')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 4 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 4 then if getPlayerStorageValue(cid, out.Rap) <= 0 then if getPlayerPremiumDays(cid) > 0 then if getPlayerMoney(cid) >= 20000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 1563, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Rap, 1) else doPlayerAddOutfit(cid, 1563, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Rap, 1) end else selfSay("You need 200dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("Need be premium to buy this Outfit.", cid) talkState[talkUser] = 0 return false end else selfSay("You already have this outfit, so... I have other outfits {Fodao, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 4 then selfSay("So... I have this other outfits {Fodao, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid) talkState[talkUser] = 2 ----Jogado de Basquete elseif (msgcontains(msg, 'Jogado de Basquete') or msgcontains(msg, 'jogado de basquete')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 5 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 5 then if getPlayerStorageValue(cid, out.Ori) <= 0 then if getPlayerPremiumDays(cid) > 0 then if getPlayerMoney(cid) >= 20000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 1568, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Ori, 1) else doPlayerAddOutfit(cid, 1568, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Ori, 1) end else selfSay("You need 200dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("Need be premium to buy this Outfit.", cid) talkState[talkUser] = 0 return false end else selfSay("You already have this outfit, so... I have other outfits {Fodao, Gordo Alto, Sktista, Punk 1, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 5 then selfSay("So... I have this other outfits {Fodao, Gordo Alto, Sktista, Punk 1, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid) talkState[talkUser] = 2 ----Sktista elseif (msgcontains(msg, 'Sktista') or msgcontains(msg, 'sktista')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 6 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 6 then if getPlayerStorageValue(cid, out.Roc) <= 0 then if getPlayerPremiumDays(cid) > 0 then if getPlayerMoney(cid) >= 20000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 1569, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Roc, 1) else doPlayerAddOutfit(cid, 1569, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Roc, 1) end else selfSay("You need 200dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("Need be premium to buy this Outfit.", cid) talkState[talkUser] = 0 return false end else selfSay("You already have this outfit, so... I have other outfits {Fodao, Gordo Alto, Jogado de Basquete, Punk 1, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 6 then selfSay("So... I have this other outfits {Fodao, Gordo Alto, Jogado de Basquete, Punk 1, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid) talkState[talkUser] = 2 ----Punk 1 elseif (msgcontains(msg, 'Punk 1') or msgcontains(msg, 'punk 1')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 7 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 7 then if getPlayerStorageValue(cid, out.Adv) <= 0 then if getPlayerPremiumDays(cid) > 0 then if getPlayerMoney(cid) >= 20000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 1570, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Adv, 1) else doPlayerAddOutfit(cid, 1570, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Adv, 1) end else selfSay("You need 200dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("Need be premium to buy this Outfit.", cid) talkState[talkUser] = 0 return false end else selfSay("You already have this outfit, so... I have other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 7 then selfSay("So... I have this other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid) talkState[talkUser] = 2 ----Malandro elseif (msgcontains(msg, 'Malandro') or msgcontains(msg, 'malandro')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 8 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 8 then if getPlayerStorageValue(cid, out.Bus) <= 0 then if getPlayerMoney(cid) >= 30000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 1574, 0) doPlayerRemoveMoney(cid, 30000) setPlayerStorageValue(cid, out.Bus, 1) else doPlayerAddOutfit(cid, 1574, 0) doPlayerRemoveMoney(cid, 30000) setPlayerStorageValue(cid, out.Bus, 1) end else selfSay("You need 300dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("You already have this outfit, so... I have other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Negao, Novinho, Dr House e Malandro Jr}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 8 then selfSay("So... I have this other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Negao, Novinho, Dr House e Malandro Jr}.", cid) talkState[talkUser] = 2 ----Negao elseif (msgcontains(msg, 'Negao') or msgcontains(msg, 'negao')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 9 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 9 then if getPlayerStorageValue(cid, out.Atl) <= 0 then if getPlayerPremiumDays(cid) > 0 then if getPlayerMoney(cid) >= 20000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 1573, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Atl, 1) else doPlayerAddOutfit(cid, 1573, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Atl, 1) end else selfSay("You need 200dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("Need be premium to buy this Outfit.", cid) talkState[talkUser] = 0 return false end else selfSay("You already have this outfit, so... I have other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Novinho, Dr House e Malandro Jr}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 9 then selfSay("So... I have this other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Novinho, Dr House e Malandro Jr}.", cid) talkState[talkUser] = 2 ----Novinho elseif (msgcontains(msg, 'Novinho') or msgcontains(msg, 'novinho')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 10 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 10 then if getPlayerStorageValue(cid, out.Punk) <= 0 then if getPlayerPremiumDays(cid) > 0 then if getPlayerMoney(cid) >= 20000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 1575, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Punk, 1) else doPlayerAddOutfit(cid, 1575, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Punk, 1) end else selfSay("You need 200dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("Need be premium to buy this Outfit.", cid) talkState[talkUser] = 0 return false end else selfSay("You already have this outfit, so... I have other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Dr House e Malandro Jr}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 10 then selfSay("So... I have this other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Dr House e Malandro Jr}.", cid) talkState[talkUser] = 2 ----Dr House elseif (msgcontains(msg, 'Dr House') or msgcontains(msg, 'dr house')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 12 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 12 then if getPlayerStorageValue(cid, out.Mer) <= 0 then if getPlayerPremiumDays(cid) > 0 then if getPlayerMoney(cid) >= 20000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 1579, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Mer, 1) else doPlayerAddOutfit(cid, 1579, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Mer, 1) end else selfSay("You need 200dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("Need be premium to buy this Outfit.", cid) talkState[talkUser] = 0 return false end else selfSay("You already have this outfit, so... I have other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Novinho e Malandro Jr}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 12 then selfSay("So... I have this other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Novinho e Malandro Jr}.", cid) talkState[talkUser] = 2 ----Malandro Jr elseif (msgcontains(msg, 'Malandro Jr') or msgcontains(msg, 'malandro jr')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 13 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 13 then if getPlayerStorageValue(cid, out.Hik) <= 0 then if getPlayerPremiumDays(cid) > 0 then if getPlayerMoney(cid) >= 20000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 1571, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Hik, 1) else doPlayerAddOutfit(cid, 1571, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Hik, 1) end else selfSay("You need 200dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("Need be premium to buy this Outfit.", cid) talkState[talkUser] = 0 return false end else selfSay("You already have this outfit, so... I have other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Novinho e Dr House}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 13 then selfSay("So... I have this other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Novinho e Dr House}.", cid) talkState[talkUser] = 2 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) @up
  11. Como deixar o personagem que criou uma conta sem vocação. 1-Vá em Config.lua depois procure por (newPlayerChooseVoc = true) onde tiver True, troque por false. EXEMPLO accountManager = true namelockManager = true newPlayerChooseVoc = true > false (Assim ele iniciará sem vocação nem uma.) newPlayerSpawnPosX = x <!-- Posição x --> newPlayerSpawnPosY = y <!-- Posição y --> newPlayerSpawnPosZ = z <!-- Posição z --> newPlayerTownId = 5 <!-- Cidade --> newPlayerLevel = 1 <!-- level que o jogador irá iniciar --> newPlayerMagicLevel = 0 generateAccountNumber = false 2- Vá em Data/npc crie um novo npc renomeia ele como: Sorcerer Estrella.xml Depois abra e cole isso e salva: \/ Code: Agora vai em data/npc/script e crie um novo documento com o nome: iodsorcerer.lua depois abra e cole isso dentro e salva: \/ Code: FAÇA ESSE MESMO PROCESSO COM TODOS OS OUTROS OS NOMES ESTARÃO EM DESTAQUE. ---------------------------------------------------------------------------- Knight Hykrion.xml Code:<?xml version="1.0" encoding="UTF-8"?> iodknight.lua Code: ----------------------------------------------------------------------------- Paladin Narai.xml Code: iodpaladin.lua Code: ----------------------------------------------------------------------------------------------- Druid Yandur.xml Code:<?xml version="1.0" encoding="UTF-8"?> ioddruid.lua Code: FONTE: https://otland.net/threads/island-of-destiny-npcs-and-oracle.120126/
  12. Existe algum jeito de summonar um monstro que não seja atacado por um monstro inimigo? Se sim, como? Obrigado pra quem ajudar
  13. Estou tentando montar esse NPC em que quando o player aceite ajudar, ele diga "Obrigada, você estará fazendo um grande favor.", depois que o player voltar e disser 'help' de novo, ela verificara se o player está com o item, e dará o novo item para o player e uma storage para ele não fazer a quest de novo. Só que não estou conseguindo fazer desta forma, quando o player diz que aceita ajudar, ela já faz a checagem dos itens. Segue o script: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 FUNCAO_NOME(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end local storage = 60080 if getPlayerStorageValue(cid, storage) ~= 1 then npcHandler:say('Obrigada, você estará fazendo um grande favor.', cid) -- MENSAGEM AO REMOVER O ITEM setPlayerStorageValue(cid, storage, 1) end if getPlayerStorageValue(cid, storage) ~= 2 then if getPlayerItemCount(cid,5944) >= 2 then -- SE TIVER 1 OU MAIS ITEM COM ID 2516 if doPlayerRemoveItem(cid,5944,2) then -- remove 1 ITEM DO ITEM COM ID 2516 npcHandler:say('Obrigao, ja fazia ideia de que isso iria acontecer. Pegue isso em forma de gratidao!', cid) -- MENSAGEM AO REMOVER O ITEM doPlayerAddItem(cid,5908,2) -- ADD 1 ITEM COM ID 5908 setPlayerStorageValue(cid, storage, 2) end else npcHandler:say('Isso nao eh do meu irmao, nao brinque comigo!', cid) end else npcHandler:say('Você ja me ajudou!', cid) end end local node2 = keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Meu irmao que se perdeu, pode encontra-lo e trazer alguma informaçao para mim?.'}) node2:addChildKeyword({'yes'}, FUNCAO_NOME, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Até mais.', reset = true}) local node3 = keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce trouxe alguma informaçao dele?.'}) node3:addChildKeyword({'yes'}, FUNCAO_NOME, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Até mais.', reset = true}) npcHandler:addModule(FocusModule:new())
  14. A Algum tempo eu procurei por um NPC que reparasse soft boots mas não encontrei um realmente funcional é que não causa-se bugs. Enfim encontrei esse em um forum pouco conhecido que no qual não me recordo o nome. Agora vamos deixar de BLA BLA BLA é ir ao tutorial. Primeiro crie um arquivo chamado LEONARD.xml e adicione na pasta DATA/NPC. <npc name="Leonard" script="data/npc/scripts/soft.lua" access="5" lookdir="1"> <health now="1000" max="1000"/> <look type="133" head="95" body="86" legs="86" feet="38" addons="3"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|.I've been working hard these days in this project, I can now repair your dear friend {boots}." /> </parameters> </npc> Em seguida vá até a pasta DATA/NPC/Scripts e crie um arquivo chamado SOFT.LUA 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, 'soft') or msgcontains(msg, 'boots')) then selfSay('Do you want to repair your worn soft boots for 20000 gold coins?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if(getPlayerItemCount(cid, 10021) >= 1) then if(doPlayerRemoveMoney(cid, 20000) == TRUE) then doPlayerRemoveItem(cid, 10021, 1) doPlayerAddItem(cid, 2640) selfSay('Here you are.', cid) else selfSay('Sorry, you don\'t have enough gold.', cid) end else selfSay('Sorry, you don\'t have the item.', cid) end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then talkState[talkUser] = 0 selfSay('Ok then.', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  15. Tenho este npc que funciona da seguinte maneira, um player atinge a marca de 55 resets, ai ele vai com determinados itens ao npc Ariel, o mesmo divide por 2 a Life e mana Atuais do jogador , zera os resets do player no caso de 55 ele volta a 0 resets e deixa o player lvl e No caso um Master Sorcerer vai ao npc com os requisitos citados acima e conversa com o npc e se torna um Celestial Sorcerer ( second promotion). O mesmo funcionava quando eu utilizada o servidor na versão 8.60 porém atualizei meu servidor para 10.10 e o npc está apena deixando o player lvl 8, e não da a second promotion ao mesmo e nem zera os resets. Se alguem me Ajudar libero o REP+ Segue abaixo o script: 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 function doRemoveItemsFromList(cid,items) -- by vodka local count = 0 if table.maxn(items) > 0 then for i = 1, table.maxn(items) do if getPlayerItemCount(cid,items[1]) >= items[2] then count = count + 1 end end end if count == table.maxn(items) then for i = 1, table.maxn(items) do doPlayerRemoveItem(cid,items[1],items[2]) end else return false end return true end local talkUser,msg = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid,string.lower(msg) function getResets(cid) local check = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..getPlayerGUID(cid)) return check:getDataInt("reset") < 0 and 0 or check:getDataInt("reset") end local config = { MinResets = 55, Price = {{9971,1000},{2108,1}}, Storages = {7824560,7824570}, newlv = 8, pid = getPlayerGUID(cid) } if isInArray({"resetar","reset","resete","reborn"}, msg) then if getPlayerStorageValue(cid, config.Storages[1]) >= 1 then npcHandler:say("Desculpé amigo, mas você já é celestial.", cid) else npcHandler:say("Você deseja mesmo zerar seus resets e se tornar um celestial? {yes}", cid) talkState[talkUser] = 1 end elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then if getPlayerVocation(cid) > 0 and getPlayerVocation(cid) < 18 then if getResets(cid) >= config.MinResets then if doRemoveItemsFromList(cid,config.Price) then local voc = isInArray({1,2,3,4}, getPlayerVocation(cid)) and (getPlayerVocation(cid)+4) or isInArray({5,6,7,8}, getPlayerVocation(cid)) and (getPlayerVocation(cid)+8) or isInArray({9,11}, getPlayerVocation(cid)) and (getPlayerVocation(cid)+1) or isInArray({10}, getPlayerVocation(cid)) and 18 or isInArray({12}, getPlayerVocation(cid)) and 17 setPlayerStorageValue(cid,config.Storages[1], 1) setPlayerStorageValue(cid,config.Storages[2], voc) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..config.newlv..", `experience` = "..getExperienceForLevel(config.newlv).." WHERE `id` = "..config.pid) else npcHandler:say("Você precisa de 1000 barras de ouro e um corpo divino para se tornar um celestial.", cid) talkState[talkUser] = 0 end else npcHandler:say("Você precisa ter "..config.MinResets.." resets para se tornar um celestial.", cid) talkState[talkUser] = 0 end else npcHandler:say("Você não tem vocação para resetar aqui.", cid) talkState[talkUser] = 0 end elseif msg == "no" and talkState[talkUser] >= 1 then selfSay("tudo bem então.", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) valeu galera fico no aguardo
  16. Bom gostaria que esse npc heala-se 100% a vida do player que falar com ele, desse bless custando 2crystal porem a cada 20 leveis que player upar aumenta-se 2 crystal (bless so a partir do lvl 40), aol custa-se apenas 2 crystal e vendesse 7 days premium por 1kk. TFS1.0 up
  17. GaaraDaAreia

    NPC bugado

    Gente, eu estou trabalhando com um servidor aqui e tive que editar o itens.otb dele, eu adicionei itens novos mas usando as sprites que já existem no tibia normal, usando o mesmo cid. Deu certo, criei eles, consigo criar usando o GOD, eles estão funcionando normal, porém meu problema é que o NPC não consegue vender eles. Eu configurei o NPC pra vender esse custom item e quando eu abro a janela de trade ele até aparece lá, porém eu clico em comprar e nada acontece, mesmo eu tendo o dinheiro suficiente, alguém poderia me ajudar?
  18. Fala Xtibianos! Queria uma ajuda de Vocês, é um Npc que da Missoes, mais quem escolhe a Missao é o PLAYER. Ele vai ter varias alternativas para escolher por exemplo: Demon Helmet, Demon Armor, Demon Shield. Dai o PLAYER escolhe por exemplo Demon Helmet o Npc vai falar que para ele receber o Demon Helmet Tenque trazer 100 scarab coins. Se o Player ja fez a Quest que ele falou dissese "Voce ja fez essa Quest". é Tipo isso Qualquer Duvida Me Chamem Agradeço deis de Já Gustavo
  19. Bom galera, é o seguinte, passei meu servidor (Dbo) de 8.54 para versão 8.60, e nesse processo o Npc Reborn, acabou dando erro, quando você reborna, O certo seria você voltar para o nível 1, Porem isso não está acontecendo, você realmente reborna, passa a utilizar as Outfits Reborn e Attack do mesmo, porem continua no level em que estava. alguém poderia me ajudar? O problema é que ele não volta para o nível 1, Ele continua no level em que estava na hora de Resetar e da erro na Distro. SCRIPT DO NPC : Já tentei trocar isso: Por isso: Alguém consegue me ajudar? Obrigado. Anexo com Print do "Error" :
  20. Caktchup

    Npc Default

    Liguei meu serve deu esse erro tentei usa o script de outros servidores 8.60 mais não resulto em nada Alguem me ajuda meu default
  21. gostaria que alguem modificasse esse npc pra que varios players possam bater nos pokes que ele invoca ao mesmo tempo. do jeito que esta somente o 1 player que esse npc começa atacar que pode atacar tbm porem os players roket que estao proximos a ele tbm tomam o dano. desde ja agradeço muito quem puder ajudar. vlw
  22. Este é o Guard NPC para TFS1.0 (10.31). Descrição Ataca monstros Ataca players com skull (Red ou White) Persegue o alvo Usa ataque corpo-a-corpo ou à distância Instalação Crie um arquivo chamado new npc.xml e adicione: <?xml version="1.0" encoding="UTF-8"?> <npc name="Townguard Steve" script="townsteve.lua" walkinterval="0" floorchange="0" speed="400"> <health now="100" max="100"/> <look type="268" head="0" body="0" legs="79" feet="76" addons="3"/> </npc> Agora em npc/scripts crie townsteve.lua e adicione: -- config local npcname = "Townguard Steve" --Name of your guard NPC local maxdmg = 500 -- maximum dmg dealt local mindmg = 200 -- minimum dmg dealt local speed = 200 -- NPC will follow target every 0.2 seconds (that's "ok" fast) local atkspeed = 1 -- 1= 1 attack per second (!lowest value!) 2= 1 attack per 2 seconds, 3= 1 attack per 3 seconds,... local maxchase = 12 -- 12 tiles chase length (depends on PZs, spawnpoint from NPC, surroundings,... local area = 4 -- 4x4 area will be checked for monsters/players (6 is too much in my oppinion) -- texts local lost = {"I'll get you next time!","I'm to old for this..","Run, coward, RUN!"} -- text if NPC lost target local ktext = {"One for me!","...unworthy!","Bad luck!"} -- text if NPC kills the target local ctext = {"I'm here to help!","Let me handle this!","Die!"} -- text while NPC is in battle (talktype orange!) local ttext = {"Come out ","You coward ","I'll be waiting for you "} -- taunt if player walks into PZ -- Do not edit if you have no clue what you're doing! local hit = 0 local target = 0 local opos = 0 local nid = 0 local spec = {} local kill = 0 local pz = 0 local tpos = 0 local npos = 0 local function goback(nid, opos) if (kill == 0) and (pz == 0) then selfSay(lost[math.random(1,#lost)]) end doSendMagicEffect(getCreaturePosition(nid), 2) doTeleportThing(nid, opos, false) doSendMagicEffect(getCreaturePosition(nid), 101) target = 0 spec = {} pz = 0 kill = 0 end local function closedis(nid, target, opos) if target ~= 0 then tpos = getCreaturePosition(target) npos = getCreaturePosition(nid) if isMonster(target) or isPlayer(target) then if getDistanceBetween(opos, tpos) <= maxchase then if getDistanceBetween(npos, tpos) <= area then if not getTilePzInfo(tpos) then if ((tpos.y - npos.y) >= 2) and ((tpos.y - npos.y)<= area) then if queryTileAddThing(nid, {x=npos.x,y=npos.y+1,z=npos.z}) == 1 then doMoveCreature(nid, SOUTH) elseif queryTileAddThing(nid, {x=npos.x,y=npos.y+1,z=npos.z}) ~= 1 then doTeleportThing(nid, tpos, true) else target = 0 goback(nid,opos) end end if ((npos.y - tpos.y) >= 2) and ((npos.y - tpos.y) <= area) then if queryTileAddThing(nid, {x=npos.x,y=npos.y-1,z=npos.z}) == 1 then doMoveCreature(nid, NORTH) elseif queryTileAddThing(nid, {x=npos.x,y=npos.y-1,z=npos.z}) ~= 1 then doTeleportThing(nid, tpos, true) else target = 0 goback(nid,opos) end end if((tpos.x - npos.x) >= 2) and ((tpos.x - npos.x) <= area) then if queryTileAddThing(nid, {x=npos.x+1,y=npos.y,z=npos.z}) == 1 then doMoveCreature(nid, EAST) elseif queryTileAddThing(nid, {x=npos.x+1,y=npos.y,z=npos.z}) ~= 1 then doTeleportThing(nid, tpos, true) else target = 0 goback(nid,opos) end end if((npos.x - tpos.x) >= 2) and ((npos.x - tpos.x) <= area) then if queryTileAddThing(nid, {x=npos.x-1,y=npos.y,z=npos.z}) == 1 then doMoveCreature(nid, WEST) elseif queryTileAddThing(nid, {x=npos.x-1,y=npos.y,z=npos.z}) ~= 1 then doTeleportThing(nid, tpos, true) else target = 0 goback(nid,opos) end end elseif pz == 0 then selfSay(ttext[math.random(1,#ttext)]..""..getCreatureName(target).."!") pz = 1 target = 0 goback(nid,opos) end end else target = 0 goback(nid,opos) end addEvent(closedis, speed, nid, target, opos) else goback(nid, opos) end end end local function check_target(nid, opos) local position = getThingPos(nid) spec = getSpectators(position, area, area,false,false) if spec then for i = 1, #spec do if isMonster(spec[i]) then target = spec[i] closedis(nid, target, opos) break elseif isPlayer(spec[i]) then if getPlayerSkullType(spec[i]) == (SKULL_WHITE or SKULL_RED) then target = spec[i] closedis(nid, target, opos) break end else target = 0 end end end end function onCreatureAppear(cid) if isNpc(cid) then nid = cid opos = getThingPos(nid) end end function onThink(cid) if target == 0 then check_target(nid, opos) end if target == 0 and kill == 1 then goback(nid,opos) end if (os.clock() - hit) >= atkspeed then if target ~= 0 then if not getTilePzInfo(getCreaturePosition(target)) then if math.random(1,10) < 3 then doSendDistanceShoot(getCreaturePosition(nid), getCreaturePosition(target), 30) doTargetCombatHealth(nid, target, COMBAT_HOLYDAMAGE, -mindmg, -maxdmg, 39) else doTargetCombatHealth(nid, target, COMBAT_PHYSICALDAMAGE, -mindmg, -maxdmg, 0) end if getCreatureHealth(target) <= 0 then kill = 1 selfSay(ktext[math.random(1,#ktext)]) target = 0 else kill = 0 end hit = os.clock() if math.random(1,10) < 3 then doCreatureSay(nid, ctext[math.random(1,#ctext)],34) end end end end end Créditos: Zyntax
  23. Oi, vi a ideia desse NPC em um lugar por aí e resolvi fazer. Consiste em um NPC que aprimora seu item (deve estar em uma das mãos - esquerda ou direita) a troco de um outro item (configurável). A cada nível de aprimoramento, seu item recebe um valor configurável no ataque, defesa e/ou armadura. Você pode configurar o nível de aprimoramento máximo, chance de falhar, valor adicional que o item receberá a cada aprimoração e, como já dito antes, o item que será cobrado pelo NPC. Em data/npc, crie um arquivo com extensão .XML, nomeie-o Upgrader, e coloque o seguinte conteúdo: <?xml version="1.0" encoding="UTF-8"?> <npc name="Upgrader" script="upgradenpc.lua" walkinterval="3000" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="134" head="39" body="113" legs="38" feet="0" addons="3" corpse="2212"/> <parameters> <parameter key="message_greet" value="Olá |PLAYERNAME|, voce gostaria de aprimorar o seu equipamento?"/> </parameters> </npc> Em data/npc/scripts, crie um arquivo com extensão .lua, nomeie-o upgradenpc.lua, e coloque o seguinte conteúdo: 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 local config = { items = {12343, 10}, --Respectivamente, ID do item que o NPC irá cobrar e quantidade. maxBoost = 10, --Nível máximo do equipamento. failChance = 20, --Em porcentagem. upgradeValue = 1, --Valor adicional que o item receberá a cada aprimoração. } if msgcontains(msg:lower(), "yes") then for slot = 5, 6 do local item = getPlayerSlotItem(cid, slot) if item.uid > 0 then if getItemAttack(item) > 0 or getItemDefense(item) > 0 or getItemArmor(item) > 0 then if doPlayerRemoveItem(cid, config.items[1], config.items[2]) then local newUpgrade = (getItemAttribute(item.uid, "upgrade") or 0) + 1 if newUpgrade <= config.maxBoost then if math.random(1, 100) > config.failChance then doItemSetAttribute(item.uid, "name", getItemInfo(item.itemid).name.." [+"..newUpgrade.."]") if getItemAttack(item) > 0 then setItemAttack(item, getItemAttack(item) + config.upgradeValue) end if getItemDefense(item) > 0 then setItemDefense(item, getItemDefense(item) + config.upgradeValue) end if getItemArmor(item) > 0 then setItemArmor(item, getItemArmor(item) + config.upgradeValue) end doItemSetAttribute(item.uid, "upgrade", newUpgrade) selfSay("Seu equipamento foi aprimorado com sucesso.", cid) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) else selfSay("Aah, parece que a aprimoração falhou! Mais sorte na próxima vez.", cid) end return true else return selfSay("Seu equipamento já alcançou o nível máximo.", cid) end else return selfSay("Você não tem "..config._item[2].."x "..getItemNameById(config._item[1])..(config._item[2] > 1 and "s" or "")..".", cid) end end end end selfSay("Parece que você não tem um item para aprimorar.", cid) elseif msgcontains(msg:lower(), "no") then selfSay("Tudo bem, então.") end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Versão testada: 8.54 Bem, é só isso, até mais.
  24. VaizardX

    NPC Editor

    Eai pessoal do xtibia Esse é o meu primeiro post , então qualquer erro me perdoe Vos trago algo muito útil para um servidor , que é um NPC Editor/Maker. Você pode usar ele para criar NPC de venda/troca , ou apenas aqueles NPC's que falam (Como os dos jogos de gameboy , Pokémon por exemplo.) Prints : * Funçoes : * Download Windows (Scan) Linux (Scan) Requerimentos : Você precisa ter o Java no seu computador Créditos : Elime (Otland) VaizardX (Por trazer para o xt)
  25. damiaotorres

    Npc Bugado

    Meu npc de aposta faz 3 aposta diferente mais remove todos a mesma quantia e coloca a mesma quantia e a 1 aposta não tá prestando alguém ajude a versão é e Do OTS, version 0.1.0 (Beta Version) 8.6
×
×
  • Criar Novo...