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. Bem, é meio simples mas eu não sou tão bom em programação! Eu queria q quando o player falasse com o npc "historia" ele contasse uma historia e quando falasse "missão" ganharia uma storage, ai quando tivesse outra storage a (13500) ele mandasse matar alguns monstros e quando terminasse de matar ele dava uns golds Rep+
  2. Entao, queria a ajuda de vcs pra criar um npc simples q venda outfit pra player. bem normal msm REP+
  3. é o seguinte, tenho um NPC de TASK, mas se tu tiver muitos itens ele da o premio varias vezes... quero apenas q ele de o premio 1x e depois não dê mais ! SCRIPT DELE 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 msg = string.lower(msg) --------- local need = { {id = 2092, qt = 1}, --diamond } local rewards = { {id = 14252, qt = 1}, --mega Stone {id = 12618, qt = 20}, --booststone } local stoFinish = 92119 --------- if msgcontains(msg, 'help') or msgcontains(msg, 'ajuda') then if getPlayerStorageValue(cid, stoFinish) >= 99 then selfSay("Sorry, you already had done this quest.", cid) talkState[talkUser] = 0 return true end selfSay("Olá meu amigo, sou o NPC de trocas, me dê 1 Bone Chave e lhe darei 1 Mega Stone ! Diga YES para trocarmos",cid) talkState[talkUser] = 1 return true elseif msgcontains(msg, 'yes') or msgcontains(msg, 'sim') and talkState[talkUser] == 1 then if getPlayerItemCount(cid, need[1].id) < need[1].qt then selfSay("Você não me trouxe a Bone Chave...", cid) selfSay("Lembre-se, eu preciso de 1 Bone Chave...", cid) talkState[talkUser] = 0 return true end local sto = getFreeTaskStorage(cid) if sto == -1 then selfSay("Você não pode fazer essa TASK NoVamente VocÊ ja fez o max de "..(maxTasks).." tasks!", cid) talkState[talkUser] = 0 return true end for i = 1, #need do doPlayerRemoveItem(cid, need[i].id, need[i].qt) end for i = 1, #rewards do doPlayerAddItem(cid, rewards[i].id, rewards[i].qt) doPlayerAddExperience(cid, 0) end selfSay("Obrigado, tchau!", cid) setPlayerStorageValue(cid, stoFinish, 1) talkState[talkUser] = 0 return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  4. Olá... eu não sei se tem, pois eu não encontrei (devo ter feito uma pesquisa meio apressada pq estou fazendo muitas cosias no momento, qualquer coisa continuarei minha pesquisa) eu gostaria de um npc que para liberar a quest dele eu tenha que ter feito uma outra quest (bau ou de outro npc) e que nesse mesmo npc eu tenha 3-5 quests sendo que aós terminar uma, eu libere a seguinte e assim por diante!! Sou basico dos basicos com script, então se puderem me enviar o script junto com as informações de onde por cada tag, cada parte e editá-los... seria muito agradecido!! obg! Servidor: PDA Base: Cyan gostaria que fosse possivel editar no npc: a looktype, o pedido das quest (itens, matar X pokes em X qntidades, batalhar com npc X ... etc...) mas, um basico com apenas derrotar X pokes em X qntidades ou pedindo X itens já ajuda!! (Ps: Se tiver alguma informação que precise que não dei me informe que editarei aki!!) @Up ... =/ qualquer informação sobre esse npc (se já tiver algum link com eles por ai) me ajudaria muito!! obg
  5. Alguém pode me ajudar com este erro, quando vou abrir o meu server?? Ajudem dou REP!!
  6. Galera, eu queria um script de task com npc, seria 5 tasks, só pode pedir uma por vez, podendo cancelar caso queira, e ao finalizar as 5 tasks ganharia os addons 1 e 2 do assassin outfit, vlw!
  7. Olá pessoal olha eu aqui mais uma vez para pedir a ajuda de vocês novamente estou com 1 problema e quero pedir uma ajuda também em um script dos Treinadores de Ginásio do meu serv. Obs: quem min ajudar já sabe receberá rep 1° bug ou problema não sei Meu serv de pokémon está quase normal só estou com problema no depot na hora que capturo um poke sendo que eu tenho 6 na bp ai quando captura vai pro depot aparece a msg certinha ai quando chego no depot pra olhar o poke ai não está lá o poke o que devo fazer? ai está uma imagem do depot depois que ele captura ai está o script do catch system.lua localizada na pasta lib também estou precisando de um script para os mestres de ginasio eles estão dando as insignias normais ao char mais quero que deixe ela dando uma storange também para o player quando ele vencer ela pra min configurar um script que tenho do site pra aparer no site quando o player ganhar de tal mestre de ginasio. script da sabrina Galera o sistema do depot eu já consegui arrumar comecei verificar as funções e encontrei essa dai que estava errada Função errada if (getPlayerFreeCap(cid) >= 6 and not isInArray({5, 6}, getPlayerGroupId(cid))) or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then doPlayerSendMailByName(getCreatureName(cid), item, 1) doPlayerSendTextMessage(cid, 27, "Congratulations, you caught a pokemon ("..poke..")!") doPlayerSendTextMessage(cid, 27, "Since you are already holding six pokemons, this pokeball has been sent to your depot.") else doPlayerSendTextMessage(cid, 27, "Congratulations, you caught a ("..poke..")!") end Função certa if (getPlayerFreeCap(cid) >= 6 and not isInArray({5, 6}, getPlayerGroupId(cid))) or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then doPlayerAddDepotItems(getCreatureName(cid), item, 1) doPlayerSendTextMessage(cid, 27, "Congratulations, you caught a pokemon ("..poke..")!") doPlayerSendTextMessage(cid, 27, "Since you are already holding six pokemons, this pokeball has been sent to your depot.") else doPlayerSendTextMessage(cid, 27, "Congratulations, you caught a ("..poke..")!") end Foi alterada a linha doPlayerSendMailByName(getCreatureName(cid), item, 1) para doPlayerAddDepotItems(getCreatureName(cid), item, 1) up Resolvido! Galera eu consegui arrumar os NPC só que ainda tem um problema ele está dando a storage mais não aparece no site na mesma hora só aparece quando eu salvo o serv
  8. Fala galerinha! Estou precisando muito de um NPC que venda um item por uma moeda diferente (Barras de Ouro) Meu servidor é TFS 1.2 Achei alguns NPCs como eu queria mas na hora que eu digo o nome do item que vou comprar pelas barras, o NPC não entrega o item e nem pega as barras de ouro. Ficarei muito grato a quem puder me ajudar. *** 10 Barras -> Soft Boots 5 Barras -> Demon Armor (Quero poder colocar mais de um item a venda nesse NPC) Abração!
  9. Então ,tem como colocar que o player deve matar um tanto de criaturas ao invés de entregar o item nessa linha aqui do npc addoner?? ['first chaos acolyte addon'] = {cost = 0, items = {{2271,100}}, outfit_female = 664, outfit_male = 750, addon = 1, storageID = 10054} eu tentei trocar mais não tive sucesso.
  10. Bom galera como eu não achei um npc que vendece Bless full compativel com TFS 1.x estou postando este que achei em outro forum, Assim como eu, acho que muita gente precisa. Então esta ai. NPC.lua NPC.xml <?xml version="1.0" encoding="UTF-8"?> <npc name="NPCNAME" script="bless_heal.lua" walkinterval="2000" floorchange="0" speechbubble="1"> <health now="100" max="100"/> <look type="138" head="58" body="114" legs="87" addons="3"/> <parameters> <parameter key="module_keywords" value="1" /> <parameter key="keywords" value="bless;blessings" /> <parameter key="keyword_reply1" value="I can grant you blessings such as {Wisdom} {of} {Solitude}, {Spark} {of} {The} {Phoenix}, our {Fire} {of} {Two} {Suns}, {Spiritual} {Shielding} and {The Embrace}. I can also grant you {all} of these blessings, just ask me." /> <parameter key="keyword_reply2" value="I can grant you blessings such as {Wisdom} {of} {Solitude}, {Spark} {of} {The} {Phoenix}, our {Fire} {of} {Two} {Suns}, {Spiritual} {Shielding} and {The Embrace}. I can also grant you {all} of these blessings, just ask me." /> </parameters> </npc> Estou usando ele no servidor Vanaheim do Bruno. Testado e funcionando perfeitamente. Créditos: Flavio S
  11. Gokussj5

    Npc mostro

    Bom galera queria sabe se e possível uma script de npc, que ao falar com ele, ele se torna um mostro para pfv preciso dele para uma quest @up @up
  12. Ola Pessoal Do Xtibia, Hoje vim aqui pedir uma ajuda, estava querendo um npc que teleporta-se o player para x posição se ele tive-se tal item, e o npc iria deletar o item dele e mandar ele para la, se alguem me ajuda rep+.
  13. Bom Dia, Hoje gostaria da ajuda de vocês para quando o jogador for viajar apenas precise falar o nome da cidade e ele viajaria; Segue o NPC de viagem: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) -- OTServ event handling functions start 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 -- OTServ event handling functions end -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'yalahar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para Yalahar por 210 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 210, destination = {x=1555, y=2576, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'}) keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Eu posso te levar para {dorion}, {Yalahar}, {Alfon}, {venonh} e {Anknor} por um pequeno custo.'}) -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'dorion'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para Dorion por 110 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 110, destination = {x=31, y=79, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'}) keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'dorion\' for just a small fee.'}) -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'alfon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para alfon por 115 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 115, destination = {x=114, y=282, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'}) keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'Alfon\' for just a small fee.'}) -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'venonh'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para venonh por 100 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 100, destination = {x=238, y=370, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'}) keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'venohn\' for just a small fee.'}) -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'anknor'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para anknor por 175 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 175, destination = {x=487, y=261, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'}) keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'Anknor\' for just a small fee.'}) -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'evora'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para évora por 175 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 175, destination = {x=1046, y=2048, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'}) keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'Anknor\' for just a small fee.'}) -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'anknor'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para anknor por 100 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 100, destination = {x=487, y=261, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'}) keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'anknor\' for just a small fee.'}) -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'smallville'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para smallville por 190 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 190, destination = {x=1995, y=2394, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'}) keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'smallville\' for just a small fee.'}) -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions! local travelNode = keywordHandler:addKeyword({'goroma'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer viajar para Goroma por 55 gold coins?'}) travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 55, destination = {x=1367, y=195, z=6} }) travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'}) keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'goroma\' for just a small fee.'}) -- Makes sure the npc reacts when you say hi, bye etc. npcHandler:addModule(FocusModule:new())
  14. Gente, estou com uma dúvida, tem como colocar um script de um npc para um monstro? Segue a baixo o script que era de um npc, que eu queria que funcionasse em um monstro... Resumindo o script ele ataca apenas players com skull, mas isso é para um npc, no caso a gente coloca esse script, na pasta de script do npc lá e funciona... mas eu precisava isso para um monstro, tipo o monstro executa esse script ai. alguém consegue me ajudar? local level = 10 ----- change this to make the npc hit more/less---------------------|damage_min = (level * 2 + maglevel * 3) * min_multiplier | local maglevel = 10 ----- change this to make the npc hit more/less -----------------|damage_max = (level * 2 + maglevel * 3) * max_multiplier | local min_multiplier = 2.1 ----- change this to make the npc hit more/less ----------|damage_formula = math.random(damage_min,damage_max) | local max_multiplier = 4.2 ----- change this to make the npc hit more/less --------------------------------------------------------------------- local check_interval = 5 ----- change this to the time between checks for a creature (the less time the more it will probably lag :S) local radiusx = 7 ----- change this to the amount of squares left/right the NPC checks (default 7 so he checks 7 squares left of him and 7 squares right (the hole screen) local radiusy = 5 ----- change this to the amount of squares left/right the NPC checks (default 5 so he checks 5 squares up of him and 5 squares down (the hole screen) local Attack_message = "An Invader, ATTACK!!!" ----- change this to what the NPC says when he sees a monster(s) local town_name = "Archgard" ----- the name of the town the NPC says when you say "hi" local Attack_monsters = TRUE ----- set to TRUE for the npc to attack monsters in his area or FALSE if he doesnt local Attack_swearers = TRUE ----- set to TRUE for the npc to attack players that swear near him or FALSE if he doesnt local Attack_pkers = TRUE ----- set to TRUE for the npc to attack players with white and red skulls or FALSE if he doesnt local health_left = 10 ----- set to the amount of health the npc will leave a player with if they swear at him (ie at 10 he will hit the player to 10 health left) local swear_message = "Take this!!!" ----- change this to what you want the NPC to say when he attackes a swearer local swear_words = {"shit", "fuck", "dick", "cunt"} ----- if "Attack_swearers" is set to TRUE then the NPC will attack anyone who says a word in here. Remember to put "" around each word and seperate each word with a comma (,) local hit_effect = CONST_ME_MORTAREA ----- set this to the magic effect the creature will be hit with, see global.lua for more effects local shoot_effect = CONST_ANI_SUDDENDEATH ----- set this to the magic effect that will be shot at the creature, see global.lua for more effects local damage_colour = TEXTCOLOR_RED ----- set this to the colour of the text that shows the damage when the creature gets hit ------------------end of config------------------ local check_clock = os.clock() ----- leave this local focus = 0 ----- leave this function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) msg = string.lower(msg) health = getCreatureHealth(cid) - health_left if ((string.find(msg, '(%a*)hi(%a*)'))) and getDistanceToCreature(cid) < 4 then selfSay('Hello ' .. creatureGetName(cid) .. '! I am a defender of '..town_name..'.') doNpcSetCreatureFocus(cid) focus = 0 end if msgcontains(msg, 'time') then selfSay('The time is ' .. getWorldTime() .. '.') end if messageIsInArray(swear_words, msg) then if Attack_swearers == TRUE then selfSay('' .. swear_message ..' ') doCreatureAddHealth(cid,-health) doSendMagicEffect(getThingPos(cid),17) doSendAnimatedText(getThingPos(cid),health,180) doNpcSetCreatureFocus(cid) focus = 0 end end end function getMonstersfromArea(pos, radiusx, radiusy, stack) local monsters = { } local starting = {x = (pos.x - radiusx), y = (pos.y - radiusy), z = pos.z, stackpos = stack} local ending = {x = (pos.x + radiusx), y = (pos.y + radiusy), z = pos.z, stackpos = stack} local checking = {x = starting.x, y = starting.y, z = starting.z, stackpos = starting.stackpos} repeat creature = getThingfromPos(checking) if creature.itemid > 0 then if isCreature(creature.uid) == TRUE then if isPlayer(creature.uid) == FALSE then if Attack_monsters == TRUE then table.insert (monsters, creature.uid) check_clock = os.clock() end elseif isPlayer(creature.uid) == TRUE then if Attack_pkers == TRUE then if getPlayerSkullType(creature.uid) > 0 then table.insert (monsters, creature.uid) check_clock = os.clock() end end end end end if checking.x == pos.x-1 and checking.y == pos.y then checking.x = checking.x+2 else checking.x = checking.x+1 end if checking.x > ending.x then checking.x = starting.x checking.y = checking.y+1 end until checking.y > ending.y return monsters end function onThink() if (Attack_monsters == TRUE and Attack_pkers == TRUE) or (Attack_monsters == TRUE and Attack_pkers == FALSE) or (Attack_monsters == FALSE and Attack_pkers == TRUE) then if (os.clock() - check_clock) > check_interval then monster_table = getMonstersfromArea(getCreaturePosition(getNpcCid( )), radiusx, radiusy, 253) if #monster_table >= 1 then selfSay('' .. Attack_message ..' ') for i = 1, #monster_table do doNpcSetCreatureFocus(monster_table[i]) local damage_min = (level * 2 + maglevel * 3) * min_multiplier local damage_max = (level * 2 + maglevel * 3) * max_multiplier local damage_formula = math.random(damage_min,damage_max) doSendDistanceShoot(getCreaturePosition(getNpcCid( )), getThingPos(monster_table[i]), shoot_effect) doSendMagicEffect(getThingPos(monster_table[i]),hit_effect) doSendAnimatedText(getThingPos(monster_table[i]),damage_formula,damage_colour) doCreatureAddHealth(monster_table[i],-damage_formula) check_clock = os.clock() focus = 0 end elseif table.getn(monster_table) < 1 then focus = 0 check_clock = os.clock() end end end focus = 0 end
  15. data/npcs/scripts/BlessMan.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 onPlayerEndTrade(cid) npcHandler:onPlayerEndTrade(cid) end function onPlayerCloseChannel(cid) npcHandler:onPlayerCloseChannel(cid) end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = cid local p = Player(cid) local heal = false local hp = p:getHealth() if msgcontains(msg, "heal") then if getCreatureCondition(cid, CONDITION_FIRE) then selfSay("You are burning. I will help you.", cid) doRemoveCondition(cid, CONDITION_FIRE) heal = true elseif getCreatureCondition(cid, CONDITION_POISON) then selfSay("You are poisoned. I will cure you.", cid) doRemoveCondition(cid, CONDITION_POISON) heal = true elseif getCreatureCondition(cid, CONDITION_ENERGY) then selfSay("You are electrificed. I will help you.", cid) doRemoveCondition(cid, CONDITION_ENERGY) heal = true elseif getCreatureCondition(cid, CONDITION_PARALYZE) then selfSay("You are paralyzed. I will cure you.", cid) doRemoveCondition(cid, CONDITION_PARALYZE) heal = true elseif getCreatureCondition(cid, CONDITION_DROWN) then selfSay("You are drowing. I will help you.", cid) doRemoveCondition(cid, CONDITION_DROWN) heal = true elseif getCreatureCondition(cid, CONDITION_FREEZING) then selfSay("You are cold! I will help you.", cid) doRemoveCondition(cid, CONDITION_FREEZING) heal = true elseif getCreatureCondition(cid, CONDITION_BLEEDING) then selfSay("You are bleeding! I will help you.", cid) doRemoveCondition(cid, CONDITION_BLEEDING) heal = true elseif getCreatureCondition(cid, CONDITION_DAZZLED) then selfSay("You are dazzled! Do not mess with holy creatures anymore!", cid) doRemoveCondition(cid, CONDITION_DAZZLED) heal = true elseif getCreatureCondition(cid, CONDITION_CURSED) then selfSay("You are cursed! I will remove it.", cid) doRemoveCondition(cid, CONDITION_CURSED) heal = true elseif hp < 65 then selfSay("You are looking really bad. Let me heal your wounds.", cid) p:addHealth(65 - hp) heal = true elseif hp < 2000 then selfSay("I did my best to fix your wounds.", cid) p:addHealth(2000 - hp) heal = true end if heal then p:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) else local msgheal = { "You aren't looking really bad, " .. getCreatureName(cid) .. ". I only help in cases of real emergencies. Raise your health simply by eating {food}.", "Seriously? It's just a scratch", "Don't be a child. You don't need any help with your health.", "I'm not an expert. If you need help find a medic.", "Don't even waste my time, I have bigger problems than your scratched armor." } selfSay("" .. msgheal[math.random(1, #msgheal)] .. "", cid) end return true end if msgcontains(msg, "yes") and talkState[talkUser] > 90 and talkState[talkUser] < 96 then if getPlayerBlessing(cid, talkState[talkUser] - 90) then selfSay("You already have this blessing!", cid) else b_price = (2000 + ((math.min(130, getPlayerLevel(cid)) - 30) * 200)) if b_price < 2000 then b_price = 2000 end if doPlayerRemoveMoney(cid, b_price) then selfSay("You have been blessed by one of the five gods!", cid) doPlayerAddBlessing(cid, talkState[talkUser] - 90) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) else selfSay("I'm sorry. We need money to keep this temple up.", cid) end end talkState[talkUser] = 0 return true end if msgcontains(msg, "yes") and talkState[talkUser] == 96 then havebless = {} for i = 1, 5 do if(getPlayerBlessing(cid, i)) then table.insert(havebless,i) end end if #havebless == 5 then selfSay('You already have all available blessings.',cid) talkState[talkUser] = 0 return true end b_price = (2000 + ((math.min(130, getPlayerLevel(cid)) - 30) * 200)) if b_price < 2000 then b_price = 2000 end b_price = ((5 - #havebless) * b_price) if doPlayerRemoveMoney(cid, b_price) then selfSay("You have been blessed by the five gods!", cid) for i = 1, 5 do doPlayerAddBlessing(cid, i) end doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) else selfSay("I'm sorry. We need money to keep this temple up.", cid) end talkState[talkUser] = 0 return true end if msgcontains(msg, "all") then havebless = {} b_price = (2000 + ((math.min(130, getPlayerLevel(cid)) - 30) * 200)) if b_price < 2000 then b_price = 2000 end for i = 1, 5 do if(getPlayerBlessing(cid, i)) then table.insert(havebless,i) end end b_price = ((5 - #havebless) * b_price) if b_price == 0 then selfSay('You already have all available blessings.',cid) talkState[talkUser] = 0 return true end selfSay('Do you want to receive all blessings for ' .. b_price .. ' gold?',cid) talkState[talkUser] = 96 return true end local blesskeywords = {'wisdom', 'spark', 'fire', 'spiritual', 'embrace'} local blessnames = {'Wisdom of Solitude', 'Spark of The Phoenix', 'Fire of Two Suns', 'Spiritual Shielding', 'The Embrace'} for i = 1, #blesskeywords do if msgcontains(msg, blesskeywords[i]) then b_price = (2000 + ((math.min(130, getPlayerLevel(cid)) - 30) * 200)) if b_price < 2000 then b_price = 2000 end selfSay('Do you want me to grant you ' .. blessnames[i] .. ' blessing for ' .. b_price .. ' gold?',cid) talkState[talkUser] = 90 + i return true end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) data/npcs/BlessMan.xml : <?xml version="1.0" encoding="UTF-8"?> <npc name="Willian" script="BlessMan.lua" walkinterval="2000" floorchange="0" speechbubble="1"> <health now="100" max="100"/> <look type="134" head="58" body="114" legs="87" addons="3"/> <parameters> <parameter key="module_keywords" value="1" /> <parameter key="keywords" value="bless;blessings" /> <parameter key="keyword_reply1" value="I can grant you blessings such as {Wisdom} {of} {Solitude}, {Spark} {of} {The} {Phoenix}, our {Fire} {of} {Two} {Suns}, {Spiritual} {Shielding} and {The Embrace}. I can also grant you {all} of these blessings, just ask me." /> <parameter key="keyword_reply2" value="I can grant you blessings such as {Wisdom} {of} {Solitude}, {Spark} {of} {The} {Phoenix}, our {Fire} {of} {Two} {Suns}, {Spiritual} {Shielding} and {The Embrace}. I can also grant you {all} of these blessings, just ask me." /> </parameters> </npc> Esse NPC tem um diferencial que ele tem um sistema de Healing, tira poison etc. Para comprar todas as blessings basta dizer "ALL" que ele te vende todas de uma vez.
  16. Ola galera, bom como o titulo diz eu gostaria que me passassem um script de item que teletransporta o PLAyER para tal posição mais com isso quero que depois de um tempo (12 Horas) o item transporte o personagem do local para o templo. Exemplo: Item "X" leva o player para uma cave onde ele pode fica ate 12Horas logo depois disso o item transporta ele para o templo.
  17. Olá galera do XT, Boa tarde O que eu gostaria hoje era que meu npc de casamento retirasse o anel de casado ao se divorciarem e desse o broken com o look de divorcio. Exemplo: Você vê um engraved wedding ring. Fulano & Sicrano para sempre - casaram em 29 December 2015 11:39:46 . obs: Esse eles estão casados O do divorcio seria mais o menos assim: Exemplo: Você vê um broken engraved wedding ring. Fulano e Sicrano para sempre não existe - Se divorciaram em 29 December 2015 11:39:46 . Se não tiver o look não tem problema, poderia ser so o npc retirando o engraved ring e dando o broken aos jogadores. Então o script que eu uso é esse: http://www.xtibia.com/forum/topic/188712-marriage-system-npc/ Para aqueles que não quiserem entrar na pagina o script do NPC: <spoiler> domodlib('marry_func') 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 msg,players = string.lower(msg), {getPlayerGUID(cid)} if msgcontains(msg, 'marry') or msgcontains(msg, 'marriage') then if isMarried(cid) then npcHandler:say("Sorry, You already is wedded.", cid) elseif getPlayerStorageValue(cid, marry_config.storage3) >= 1 then npcHandler:say("you must sign the {divorce}.", cid) elseif getPlayerStorageValue(cid, marry_config.storage1) >= os.time() then local pid = getPlayerStorageValue(cid, marry_config.storage2) npcHandler:say(getPlayerNameByGUID(pid).." has set a wedding date with you. Do you want to {proceed} or {cancel} the wedding?", cid) talkState[talkUser] = 2 else npcHandler:say("Would you like to get married?", cid) talkState[talkUser] = 1 end elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then npcHandler:say("And what\'s the name of your future partner?", cid) talkState[talkUser] = 3 elseif talkState[talkUser] == 3 then local player = getPlayerByNameWildcard(msg) if(not player)then npcHandler:say(msg.." is offline or does not exist.", cid) return true elseif isMarried(player) then npcHandler:say("He already is wedded.", cid) return true elseif getPlayerStorageValue(cid, marry_config.storage3) >= 1 or getPlayerStorageValue(player, marry_config.storage3) >= 1 then npcHandler:say((getPlayerStorageValue(cid, marry_config.storage1) >= 1 and "You" or "He").." must sign the divorce.", cid) return true elseif getPlayerLevel(cid) < marry_config.Level or getPlayerLevel(player) < marry_config.Level then npcHandler:say("players must to be level "..marry_config.Level, cid) return true elseif getPlayerStorageValue(player, marry_config.storage1) >= os.time() then npcHandler:say(msg.." already have a wedding invitation, wait.", cid) return true elseif getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(player)) > marry_config.MaxSqm then npcHandler:say("you are far away from each other to get married.", cid) return true elseif marry_config.OnlyDifferentSex and getPlayerSex(cid) == getPlayerSex(player) then npcHandler:say("you can only marry the opposite sex", cid) return true elseif not doPlayerRemoveMoney(cid, marry_config.Marry_Price) then npcHandler:say("Sorry, but you do not have "..marry_config.Marry_Price.." gp(s) to ask "..msg.." in marriage.", cid) return true end setPlayerStorageValue(player, marry_config.storage1,os.time()+marry_config.TimeAccept) setPlayerStorageValue(player, marry_config.storage2, getPlayerGUID(cid)) npcHandler:say("you asked "..msg.." in marriage, wait a answer!", cid) doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE,getCreatureName(cid).." asked you in marriage.") talkState[talkUser] = 0 elseif msgcontains(msg, "proceed") and talkState[talkUser] == 2 then player = getPlayerStorageValue(cid, marry_config.storage2) if getPlayerStorageValue(cid, marry_config.storage1) >= os.time() then if not isMarried(cid) then if Ponline(player) then x = getPlayerByNameWildcard(getPlayerNameByGUID(player)) if getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(x)) <= marry_config.MaxSqm then table.insert(players, player) doMarry(cid, player) for i = 1, #players do local ring = doPlayerAddItem(getPlayerByNameWildcard(getPlayerNameByGUID(players[i])), marry_config.RingID, 1) doItemSetAttribute(ring, "description", getCreatureName(cid) .. " & " .. getPartner(cid) .. " forever - married on " ..getMarryDate(cid).. ".") doCreatureSay(getPlayerByNameWildcard(getPlayerNameByGUID(players[i])), marry_config.Text[math.random(1,#marry_config.Text)], TALKTYPE_ORANGE_1) doSendMagicEffect(getCreaturePosition(getPlayerByNameWildcard(getPlayerNameByGUID(players[i]))), 35) setPlayerStorageValue(getPlayerByNameWildcard(getPlayerNameByGUID(players[i])), marry_config.storage3, 1) setPlayerStorageValue(getPlayerByNameWildcard(getPlayerNameByGUID(players[i])), 150420, 1) end npcHandler:say("Congratulations! Now you may kiss your partner! to see the status of marriage enter !marriage status", cid) talkState[talkUser] = 0 else npcHandler:say("you're far away from her suitor.", cid) end else npcHandler:say("suitor offline.", cid) end else npcHandler:say("you are not married.", cid) talkState[talkUser] = 0 end else npcHandler:say("you do not received none wedding invitation.", cid) talkState[talkUser] = 0 end elseif msgcontains(msg, "cancel") and talkState[talkUser] == 2 then player = getPlayerStorageValue(cid, marry_config.storage2) if getPlayerStorageValue(cid, marry_config.storage1) >= os.time() then if not isMarried(cid) then setPlayerStorageValue(cid, marry_config.storage1, -1) npcHandler:say("You just refuse the wedding invitation from player "..getPlayerNameByGUID(player), cid) if Ponline(player) then doPlayerSendTextMessage(getPlayerByNameWildcard(getPlayerNameByGUID(player)), MESSAGE_STATUS_CONSOLE_ORANGE,getCreatureName(cid).." rejected his marriage proposal.") end else npcHandler:say("you are already married.", cid) talkState[talkUser] = 0 end else npcHandler:say("you do not received none wedding invitation.", cid) talkState[talkUser] = 0 end elseif msgcontains(msg, "divorce") then if isMarried(cid) then npcHandler:say("Would you like to divorce of your partner for "..marry_config.Divorce_Price.." gp(s) ? {yes}", cid) talkState[talkUser] = 6 elseif getPlayerStorageValue(cid, marry_config.storage3) >= 1 then npcHandler:say("you must sign here to end your marriage, ok? {yes}", cid) talkState[talkUser] = 7 else npcHandler:say("you are not married", cid) talkState[talkUser] = 0 end elseif msgcontains(msg, "yes") and talkState[talkUser] == 6 then if isMarried(cid) then if doPlayerRemoveMoney(cid, marry_config.Divorce_Price) then npcHandler:say("Congratulations, you end up divorcing from player: "..getPartner(cid), cid) setPlayerStorageValue(cid, 150420, -1) setPlayerStorageValue(cid, marry_config.storage3, -1) pguid = getPlayerGUIDByName(getPartner(cid)) if Ponline(pguid) then setPlayerStorageValue(getPlayerByNameWildcard(getPlayerNameByGUID(pguid)), 150420, -1) else db.executeQuery("DELETE FROM `player_storage` WHERE `player_id` = " .. pguid .. " AND `key` = 150420;") end doDivorcePlayer(cid) else npcHandler:say("Sorry, you do not have "..marry_config.Divorce_Price.." gp(s).", cid) end else npcHandler:say("you are not married.", cid) end elseif msgcontains(msg, "yes") and talkState[talkUser] == 7 then npcHandler:say("Congratulations, you end up divorcing.", cid) setPlayerStorageValue(cid, marry_config.storage3, -1) 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()) <spoiler/> Aqui é o MOD, creio que onde tudo se resume ao look no ring. <spoiler> <?xml version="1.0" encoding="UTF-8"?> <mod name="MarriageSystem" version="1.0" author="Vodkart" contact="xtibia.com" enabled="yes"> <config name="marry_func"><![CDATA[ marry_config = { OnlyDifferentSex = false, Marry_Price = 300000, Divorce_Price = 100000, Level = 50, MaxSqm = 7, -- to marry Text = {'I love you!','My love!','Baby dear!'}, RingID = 10502, TimeAccept = 30, storage1 = 300235, storage2 = 300236, storage3 = 300237 } function isMarried(cid) local m = db.getResult("SELECT `player_id` FROM `marriage_system` WHERE `player_id` = '"..getPlayerGUID(cid).."';") if(m:getID() == -1) then local e = db.getResult("SELECT `partner` FROM `marriage_system` WHERE `partner` = '"..getPlayerGUID(cid).."';") if(e:getID() == -1) then return false end end return true end function isPatner(cid) local p = db.getResult("SELECT `partner` FROM `marriage_system` WHERE `player_id` = '"..getPlayerGUID(cid).."';") if(p:getID() == -1) then return true end return false end function Ponline(player) local rows = db.getResult("SELECT `online` FROM `players` WHERE `id` = " .. player .. ";") local on = rows:getDataInt("online") if on ~= 0 then return TRUE else return FALSE end end function getPartner(cid) if isPatner(cid) then a = db.getResult("SELECT `player_id` FROM `marriage_system` WHERE `partner` = '"..getPlayerGUID(cid).."';") b = "player_id" else a = db.getResult("SELECT `partner` FROM `marriage_system` WHERE `player_id` = '"..getPlayerGUID(cid).."';") b = "partner" end local query = a return getPlayerNameByGUID(query:getDataString(b)) end function doMarry(cid, patner) return db.executeQuery("INSERT INTO `marriage_system` (`player_id`, `partner`, `marriage_date`) VALUES ('".. getPlayerGUID(cid) .."', '"..patner.."', '".. os.time() .."');") end function doDivorcePlayer(cid) if isPatner(cid) then pid,player = getPlayerGUIDByName(getPartner(cid)),getPlayerByNameWildcard(getPartner(cid)) else pid,player = getPlayerGUID(cid),cid end return db.executeQuery("DELETE FROM `marriage_system` WHERE `player_id` = '" .. pid .. "';") end function getMarryDate(cid) local player = isPatner(cid) and getPlayerGUIDByName(getPartner(cid)) or getPlayerGUID(cid) local date = db.getResult("SELECT `marriage_date` FROM `marriage_system` WHERE `player_id` = '"..player.."';") return os.date("%d %B %Y %X ", date:getDataInt("marriage_date")) end ]]></config> <talkaction words="/marriage;!marriage" event="buffer"><![CDATA[ domodlib('marry_func') param = string.lower(param) if (param == "") then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"invalid command, for more information enter !marriage info") elseif(param == "info") then doShowTextDialog(cid,2160,"Marriage Info:\n\nLevel Minimum: "..marry_config.Level.."\nMarriage Cost: "..marry_config.Marry_Price.."\nDivorce Cost: "..marry_config.Divorce_Price.."\n\nMarried Players have a special buffs as a wedding gift given by the union\n\nThis bonus is only given if the married players are nearby.") elseif(param == "status") then doPlayerPopupFYI(cid,""..(isMarried(cid) and "Marriage Status".."\n\nMarried with: ["..getPartner(cid).."]\n\nThe date of his marriage was: "..getMarryDate(cid).."" or "you are not married").."") end return true ]]></talkaction> <event type="login" name="MarryRegister" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "MarryLook") registerCreatureEvent(cid, "MarryNoAttack") return true end]]></event> <event type="look" name="MarryLook" event="script"><![CDATA[ domodlib('marry_func') function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) and isMarried(thing.uid) then doPlayerSetSpecialDescription(thing.uid,'.\n'..(getPlayerSex(thing.uid) == 0 and 'She' or 'He')..' is married to '..getPartner(thing.uid)) end return true end]]></event> <event type="combat" name="MarryNoAttack" event="script"><![CDATA[ domodlib('marry_func') if isPlayer(cid) and isPlayer(target) and isMarried(cid) and isMarried(target) then if (getCreatureName(target) == getPartner(cid))then doPlayerSendCancel(cid, "You may not attack this player.") return false end end return true ]]></event> </mod> <spoiler/>
  18. Versão testada: 9.1 Descrição: É um npc simples que tem como função alugar determinadas montarias por certo tempo, dias para ser exato. Em Mods: AluguelMount.xml <?xml version="1.0" encoding="UTF-8"?> <mod name="Aluguel Mounts" version="1.0" author="Vodkart" contact="xtibia.com" enabled="yes"> <config name="aluguel_func"><![CDATA[ Aluguel_mounts = { ["war horse"] = {price = 10000, days = 2, mountid = 17, level = 10, premium = false, storage = 500561}, ["fire war horse"] = {price = 30000, days = 1, mountid = 23, level = 20, premium = false, storage = 500562}, ["sandstone scorpion"] = {price = 50000, days = 1, mountid = 21, level = 30, premium = true, storage = 500563} } function doRemovePlayerMount(cid, mountId) doPlayerRemoveMount(cid, mountId) return doCreatureChangeOutfit(cid,{lookType = getCreatureOutfit(cid).lookType, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet, lookAddons = getCreatureOutfit(cid).lookAddons}) end function CheckRentMount(cid) for var, ret in pairs(Aluguel_mounts) do if canPlayerRideMount(cid, ret.mountid) and getPlayerStorageValue(cid, ret.storage) ~= -1 and getPlayerStorageValue(cid, ret.storage) <= os.time() then doRemovePlayerMount(cid, ret.mountid) doPlayerSendTextMessage(cid,18,"O tempo da sua montaria "..var.." acabou, para adquirir ela novamente volte ao npc.") end end end ]]></config> <globalevent name="CheckMount" interval="60000" event="script"><![CDATA[ domodlib('aluguel_func') function onThink(interval, lastExecution) local on = getPlayersOnline() if #on > 0 then for i = 1, #on do CheckRentMount(on[i]) end end return true end]]></globalevent> </mod> obs: Checar duas coisas em mods, primeira: Se a função que checa se tem a mount é 'canPlayerRideMount' ou 'getPlayerMount', caso for 'getPlayerMount' trocar: canPlayerRideMount(cid, ret.mountid) por: getPlayerMount(cid, ret.mountid) segunda: o intervalo de tempo na tag do globalevents, no meu server era em mile segundos: interval="60000" -- caso o seu não seja em mile segundos troque 60000 por 60. Data/Npc Peach.xml <?xml version="1.0"?> <npc name="Peach" script="data/npc/scripts/aluguelmounts.lua" walkinterval="50000" floorchange="0"> <health now="1000" max="1000"/> <look type="130" head="0" body="114" legs="114" feet="0" addons="0"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|. You want to {rent} a {mount}?"/> </parameters> </npc> Data/Npc/Script aluguelmounts.lua domodlib('aluguel_func') 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 msg = string.lower(msg) if isInArray({'aluguel','alugar', 'rent', 'mounts', 'mount'}, msg) then npcHandler:say("Você pode comprar {war horse}, {fire war horse} e {sandstone scorpion}!", cid) talkState[talkUser] = 1 elseif talkState[talkUser] == 1 then if Aluguel_mounts[msg] then if Aluguel_mounts[msg].premium == true and not isPremium(cid) then npcHandler:say('Você precisa ser premium para alugar essa montaria.', cid) return true elseif getPlayerLevel(cid) < Aluguel_mounts[msg].level then npcHandler:say('você precisa ter level ' .. Aluguel_mounts[msg].level .. ' ou mais para alugar essa montaria.', cid) return true elseif getPlayerStorageValue(cid, Aluguel_mounts[msg].storage) >= os.time() then npcHandler:say('você já alugou essa montaria!', cid) return true end name,price,stor,days,mountid = msg,Aluguel_mounts[msg].price,Aluguel_mounts[msg].storage,Aluguel_mounts[msg].days,Aluguel_mounts[msg].mountid npcHandler:say('Você quer alugar a montaria '..name..' por '..days..' dia'..(days > 1 and 's' or '')..' no preço de '..price..' gps? {yes}', cid) talkState[talkUser] = 2 else npcHandler:say('Desculpe, eu não vendo essa montaria.', cid) end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 2) then if doPlayerRemoveMoney(cid, price) then doPlayerAddMount(cid, mountid) setPlayerStorageValue(cid, stor, os.time()+days*86400) npcHandler:say('Aqui está sua montaria '..name..', ela irá durar até '..os.date("%d %B %Y %X", getPlayerStorageValue(cid,stor))..'.', cid) else npcHandler:say('você não tem dinheiro suficiente para alugar a montaria!', cid) talkState[talkUser] = 0 end elseif msg == "no" then selfSay("Then not", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Configuração: Em mods tem uma tabela chamada 'Aluguel_mounts'
  19. Galera, no meu distro ao ligar o server, aparece essa DROGA DE ERRO: Essa droga ta me irritando faz 6 meses... Tem como me ajudarem? Não indica qual o erro com o NPC, não fala qual NPC que é, e tem vários npcs no mapa... URGENTE!
  20. Bom galera, eu tenho um mapa aqui, eu uso TFS 0.4 nele, eu que compilei e tals, uso esse distro em todo mapa que eu tenho, mas nesse, aparece um problema que eu não entendi, ai vai uma screenshot: Quero resolver essa parada logo! Por favor galera! Obrigado! up up!
  21. Galera Eu To Com Um Sistema Akatsuki Q Peguei Em Um Forum So Q Quando Coloco Ele No Meu Server Algums Player Q Ja Tinha Conta Antes Deu Colocar O Sistema Nao Consegue Fazer A Quest Poq Fala Q O Player Ja Fez Sendo Q O Player Nao Fez ... Os Q Criaram Char Dps Do Sistema Consegue De Boa Alguem Pode AJudar Vou Postar O Script Abaixo EH Por Npc ! Script : -- Script Akatsuki System Advance 1.0 -- -- By RigBy -- 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 local level = 600 -- Level preciso pra entra para akatsuki local itemid = 5943 -- id do coração local quantidade =1 -- quantos hearts e preciso local bonushp = 300000 -- quanto de bonus de life vai ganha local bonusmp = 30000 -- quanto de bonus de mana vai ganha local experience = 20 -- Experience rates no caso 2x a experiencia do seu servidor. local config = { --[Vocation] = ( Nova Vocation, New Outfit ) [230] = { 500, 704}, -- Naruto [24] = { 502, 700}, -- Sasuke [328] = { 506, 736}, -- Lee [42] = { 504, 170}, -- Sakura [61] = { 508, 719}, -- Gaara [78] = { 514, 754}, -- Neji [98] = { 510, 710}, -- Kiba [116] = { 512, 729}, -- Shikamaru [135] = { 516, 717}, -- Hinata [158] = { 544, 725}, -- Tenten [177] = { 518, 589}, -- Itachi [196] = { 520, 722}, -- Killer Bee [231] = { 522, 744}, -- Kakashi [246] = { 538, 705}, -- Minato [260] = { 546, 709}, -- Kisame [275] = { 548, 629}, -- Raikage [287] = { 526, 891}, -- Yahiko [297] = { 530, 713}, -- Kankuro [314] = { 528, 396}, -- Kakuzo [325] = { 532, 726}, -- Temari [229] = { 524, 481}, -- Obito [372] = { 550, 520}, -- Jiraya [348] = { 542, 876}, -- Shisui [404] = { 540, 630}, -- Tobirama [427] = { 534, 718}, -- Kabuto [391] = { 536, 721}, -- Chouji [382] = { 552, 650}, -- Deidara [414] = { 555, 892}, -- Hashirama } function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 1 or cid if msgcontains(msg, 'akatsuki') then if getPlayerVocation(cid) ~= config then if getPlayerStorageValue(cid, 89745) == -1 then if getPlayerLevel(cid) >= level then selfSay('Tem certeza de que quer se juntar a Akatsuki?.', cid) talkState[talkUser] = 1 else selfSay('Você nem sabe o nível que é pra entrar na akatsuki, suma da minha frente seu idiota.', cid) end else selfSay('Você já faz parte da Akatsuki!', cid) end else selfSay('Não preciso de você agora!', cid) end end if talkState[talkUser] == 1 and msgcontains(msg, 'yes') then selfSay('Para provar a sua lealdade, você tem que trazer '..quantidade..' {coraçao}.', cid) talkState[talkUser] = 2 end if talkState[talkUser] == 2 and msgcontains(msg, 'coraçao') then if getPlayerItemCount(cid, 5943) >= 1 then local voc = config[getPlayerVocation(cid)] doPlayerSetVocation(cid, voc[1]) local outfit = {lookType = voc[2]} doCreatureChangeOutfit(cid, outfit) setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+bonushp) setCreatureMaxMana(cid, getCreatureMaxMana(cid)+bonusmp) doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) doPlayerRemoveItem(cid, 5943, 1) doCreatureAddMana(cid, getCreatureMaxMana(cid)) setPlayerStorageValue(cid,89745,6) doPlayerSetExperienceRate(cid, experience) selfSay('Parabéns agora você faz parte da Akatsuki.', cid) talkState[talkUser] = 0 else selfSay('Não adianta me enganar, você não tem '..quantidade..' corações, vai atrás, e só volte com eles.', cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  22. ola! eu gostaria de ajuda para criar 2 npcs. 1 npc> de duel que bata em todos player ao seu alcance ele fica em um pokemom se tira o pokemon ele vai no mais proximo e tbm os player possam bater nos pokes desse npc varios players e nao somente o player que o npc estiver focando. 1 script de invasão> seria assim uma script pre programada de invasao ou pode ser por comando de gm. a invasão ocorrera pelo mapa e chegara aleatoriamente na cidade serao npcs de duel ou pokemons pode ser 2 script uma pra cada. a intenção e recriar as invasões da pxg dos npc que protejem a natureza e os polices e rokets invadindo a cidade. se puder quando occorrer a invasão aonda os npcs estiverem o mapa teria que virar pvp area pra player matar player. se precisar que explique minha ideia mais a fundo add skype. clebermoreno1 apos tudo feito prometo gratificações a quem puder ajudar obrigado.
  23. Boa tarde Xtibianos eu aqui de novo, O que eu gostaria hoje seria um "NPC" que mudasse o PVP do player. * O jogador chega no NPC e fala Hi, Desativar PVP por um preço ou "ITEM" configurável. * Mesma coisa quando for ativar o PVP, Hi, Ativar PVP por um preço ou "ITEM" configurável . * Se tiver como deixar ele com uma Skull após desativar o PVP eu agradeceria muito, mais a Skull Yellow ou Green por exemplo. É isso ai galerinha desde já agradeço ^^.
  24. Olá Galera Primeiramente Queria Um Npc Que Trocasse x item por x item Queria Também Que Ele Trocasse 10 Itens+ ID DO ITEM QUE O O PLAYER PAGA: 2151 Estou Utilizando Base PDA Queria a para poder editar a quantidade e o item q o npc troca VLW AI
  25. como diz o titulo do topico,gostaria de um npc que dá x outfit por x item [Configuraveis] 7 Ex: Player:Hi NPC:Olá,diga outfits para ver todas as outfits a venda. Player:outfits npc:Bem tenho as seguintes Outfits,Gengar,Blastoise,Pikachu e Azumaril,escolha uma e repita o nome da escolhida. Player:Gengar Npc:Você comprou a outfit Gengar,parabens. Player:Bye. Npc:Tchau. Mais ou menos isso,obg!
×
×
  • Criar Novo...