-
Total de itens
3406 -
Registro em
-
Última visita
-
Dias Ganhos
113
Tudo que Vodkart postou
-
Ta dando isso, esta tudo do jeito que você falou para mim no tópico. Quando se usa !health ele da isso. Sabe porque está dando isso? é porque no seu servidor não existe essa função também! Vou te passar a função que eu fiz: lib/functions coloca function getPlayerHealth(cid) -- by vodka doPlayerSave(cid) local PlayerInfo = db.getResult("SELECT `health` FROM `players` WHERE `id` = " .. getPlayerGUID(cid)) return PlayerInfo:getDataInt("health") end ai no script ali onde tiver "getCreatureHealth" troca por "getPlayerHealth"
-
function onUse(cid, item, fromPosition, itemEx, toPosition) local monstros = { {{x = 187, y = 56, z = 7}, "Demon"}, {{x = 187, y = 59, z = 7}, "Demon"}, {{x = 191, y = 59, z = 7}, "Ghazbaran"} } for _, summon in pairs(monstros) do local creature = getTopCreature(summon[1]).uid if(creature > 0 and not isPlayer(creature)) then return doPlayerSendCancel(cid, "sorry already have monster.") end doCleanTile(summon[1]) doCreateMonster(summon[2], summon[1]) end doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end é isso que vc quer?
-
-- Na talkaction.xml posso substituir !health por !vida normal sem afetar o script? velho eu editei o script ontem, eu já mudei a função "getPlayerHealth" por "getCreatureHealth", só copiar de novo o script. e se você mudar o !health por !vida vai afetar sim, você tem que alterar tanto na tag quanto no script '-'
-
não intendi nada =s puxar a alavanca e ser sumnonado vários monstro em uma tabela? e se puxar de novo eles irão ser removidos e os tiles limpos? (clean)
-
function onSay(cid, words, param) gold = 9971 --ID do item que ira remover skill = 50 --quantidade que ira aumentar a skill do jogador skill2 = 0 -- numero da skill que ira aumentar levelskill = 350 --level da skill maximo if getPlayerSkill(cid, skill2) < levelskill then if doPlayerRemoveItem(cid, gold, 200) then doPlayerAddSkillTry(cid, skill2, skill) doPlayerSendTextMessage(cid,22,"Voce comprou sua skill") else doPlayerSendCancel(cid,"Voce não tem o necessário de barras de ouro.") end else doPlayerSendCancel(cid,"Voce já atingiu seu nivel de skill maximo") end return TRUE end
-
ATUALIZADO PARA V.1 - Mostra agora se o player morreu [blessed] ou com [Aol] - Mostra últimas mortes do servidor
-
[Creaturescript] Simple Reputation System !
tópico respondeu ao jhon992 de Vodkart em Globalevents e Spells
Passando para deixar um Rep Look: nome do seu script.lua function getReps(cid) return getPlayerStorageValue(cid,102086) < 0 and 0 or getPlayerStorageValue(cid,102086) end function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) then doPlayerSetSpecialDescription(thing.uid, "\n[Reps: " .. getReps(thing.uid) .."]") end return true end creaturescript.xml <event type="look" name="showRep" event="script" value="nome do seu script.lua"/> creaturescript/script/login.lua adc: registerCreatureEvent(cid, "showRep") -
ta mto quadrado isso ai, poderia colocar mais detalhes ali na loja '-'
-
Não sei cara, eu testei num 8.6 do baiak tbm '-'
-
~~> O que é uma lógica de programação? Somente após aprender lógica de programação, você estará apto a estudar e aprender as linguagens de programação, seja ela qual for. Então por isso temos aprender a desenvolver algoritmos. ~~> O que é um Algoritmo? Um algoritmo é uma sequência finita de instruções bem definidas e não ambíguas, um algoritmo é o caminho para a solução de um problema, e em geral, os caminhos que levam a uma solução são muitos. ~~> E como devemos aprender algoritmos? Esse aprendizado de algoritmos não se consegue a não ser através de muitos exercícios. Lembre-se que você não irá aprender se apenas: copiar algoritmos, estudar algoritmos, Você só vai aprender algoritmos só se: construir um algoritmo, testar alguns algoritmos. ~~> Exemplos de Algoritmos Ir ao Shopping Fritar um Ovo Para que uma pessoa possa seguir esse algoritmo, é necessário que ela saiba o significado das palavras como "colocar", "retirar", "quebrar"... E que nenhuma instrução possua mais de um significado (não ambiguidade) um algoritmo nada mais é do que uma receita que mostra passo a passo os procedimentos necessários para a resolução de uma tarefa, ele não responde a pergunta “o que fazer?”, mas sim “como fazer”. Agora vamos analisar o script: - Para começar, você pode ver que as ordens são dadas em sequência de cima para baixo (como fazemos a leitura). - A pessoa tem que fazer exatamente o que está descrito ao longo do script - Em vermelho, vemos que em certos momentos a pessoa deve tomar algumas decisões de acordo como anda a situação descrita Bom vamos estudar um script agora, irei deixar em spoiler alguns identificadores léxicos 1 - function onSay(cid, words, param) 2 - doPlayerAddItem(cid,2173,1) 3 - if doPlayerRemoveMoney(cid, 1000) then 4 - doSendPlayerTextMessage(cid,"Você comprou um aol!",23) 5 - else 6 - doPlayerSendCancel(cid,"Você não tem dinheiro.") 7 - end 8 - return TRUE 9 - end Podemos perceber que temos um erro de algoritmo neste script, na linha 2 percebemos que: Ele adiciona o item ao jogador sem ter checado que iria remover ou não o dinheiro, enquanto o correto seria: 1 - function onSay(cid, words, param) 2 - if doPlayerRemoveMoney(cid, 1000) then 3 - doPlayerAddItem(cid,2173,1) 4 - doSendPlayerTextMessage(cid,"Você comprou um aol!",23) 5 - else 6 - doPlayerSendCancel(cid,"Você não tem dinheiro.") 7 - end 8 - return TRUE 9 - end Pois agora na linha 2 ele irá checar se o jogador tem o dinheiro então só assim será executado um bloco de comandos pré definidos. ~~> Exercícios: 1° - Faça um algoritmo para ir para escola 2° - Faça um algoritmo para tomar banho
-
não, no caso dele é uma outfit para determinada vocation , elite knight não iria poder usar a outfit de knight mas neste tópico sim: http://www.xtibia.com/forum/topic/152827-vocation-oufit/
-
kk deixa assim: local color = 145
-
mas a graça do jogo não é sentir medo?
-
aqui funcionou, cada um usa a sua outfit, olha como eu deixei no meu outfit.xml
-
o primeiro pedido é o mais fácil, só fazer pelo onStats
-
AH TA ESQUECI DE MUDAR A FUNÇÃO, no meu ot a função é "getPlayerHealth(cid)" de vez de "getCreatureHealth(cid)" pronto, está editado
-
Como eu vou saber? O pedido foi de npc, eu testei e funcionou. e outra, acho que não é nem outfit, você se confundiu, você quis dizer addon?
-
infomanahp.lua function onSay(cid, words, param, channel) if words == "!health" then if param == "" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Minha Vida atual: [" .. getCreatureHealth(cid) .. "/" .. getCreatureMaxHealth(cid) .. "]") return true end local player = getPlayerByNameWildcard(param) if(not player)then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") return true elseif not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "você precisa ser premium.") return true end return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Vida de "..getCreatureName(player).." Atual: ["..getCreatureHealth(player).."/" .. getCreatureMaxHealth(player) .. "]") elseif words == "!mana" then if param == "" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Minha Mana atual: [" .. getCreatureMana(cid) .. "/" .. getCreatureMaxMana(cid) .. "]") return true end local player = getPlayerByNameWildcard(param) if(not player)then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") return true elseif not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "você precisa ser premium.") return true end return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Mana de " ..getCreatureName(player).. " Atual: ["..getCreatureMana(player).."/" .. getCreatureMaxMana(player) .. "]") end return true end talkactions.xml <talkaction words="!mana;!health" event="script" value="infomanahp.lua"/>
-
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 AddOutfit(cid, message, keywords, parameters, node) --by vodka if(not npcHandler:isFocused(cid)) then return false end if (isPlayerPremiumCallback == nil or isPlayerPremiumCallback(cid) == true or parameters.premium == false) then if(parameters.level ~= nil and getPlayerLevel(cid) < parameters.level) then npcHandler:say('You must reach level ' .. parameters.level .. ' to buy this mount.', cid) elseif getPlayerStorageValue(cid, parameters.storage[getPlayerSex(cid)]) ~= -1 then npcHandler:say('you already have this outfit!', cid) elseif not doPlayerRemoveMoney(cid, parameters.price) then npcHandler:say('Sorry You need '..parameters.price..' gps to buy this addon!', cid) else doPlayerAddOutfit(cid, parameters.outfit[getPlayerSex(cid)], parameters.addon) setPlayerStorageValue(cid, parameters.storage[getPlayerSex(cid)], 1) npcHandler:say('Here is your addon!', cid) npcHandler:resetNpc() end else npcHandler:say('I can only allow premium players to buy this addon.', cid) end npcHandler:resetNpc() return true end local outs = { {"first assassin addon", outfitID = {[0] = 156,[1] = 152}, price = 2000, stor = {[0] = 51001,[1] = 52001},addons = 1, level = 10, premium = true}, {"second assassin addon", outfitID = {[0] = 156,[1] = 152}, price = 5000, stor = {[0] = 51002,[1] = 52002},addons = 2, level = 15, premium = true}, {"first pirate addon", outfitID = {[0] = 155,[1] = 151}, price = 5000,stor = {[0] = 51003,[1] = 52003}, addons = 1, level = 15, premium = false}, {"second pirate addon", outfitID = {[0] = 155,[1] = 151}, price = 1000,stor = {[0] = 51004,[1] = 52004}, addons = 2, level = 15, premium = false}, {"outfits", text = "I sell these outfits: {assassin},{pirate}, or {beggar}!"}, {"help", text = "To buy the first addon say {first NAME addon}, for the second addon say {second NAME addon}."} } for i = 1, #outs do local get = outs[i] if type(get.outfitID) == "table" then local node = keywordHandler:addKeyword({get[1]}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "You want to buy the oufit " .. get[1] .. " for "..get.price.." gps?"}) node:addChildKeyword({"yes"}, AddOutfit, {price = get.price, outfit = get.outfitID, addon = get.addons, storage = get.stor, level = get.level, premium = get.premium}) node:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Ok, then.", reset = true}) else keywordHandler:addKeyword({get[1]}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = get.text}) end end mounts = nil npcHandler:addModule(FocusModule:new()) configuração: outfitID = { [0] = 156, -- ID da outfit female [1] = 152 -- ID da outfit male } price = 2000 -- quanto irá custar o addon stor = { [0] = 51001, -- storage female para não repetir a compra [1] = 52001 -- storage male para não repetir a compra } addons = 1 esse é que addon vai dar level = 10 que level precisa ter pra comprar a addon premium = true -- se precisa ser premium (true ou false)
-
Eu posso até fazer o npc, mas não vou adicionar todos, ai você configura
-
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 AddOutfit(cid, message, keywords, parameters, node) --by vodka if(not npcHandler:isFocused(cid)) then return false end if (isPlayerPremiumCallback == nil or isPlayerPremiumCallback(cid) == true or parameters.premium == false) then if(parameters.level ~= nil and getPlayerLevel(cid) < parameters.level) then npcHandler:say('You must reach level ' .. parameters.level .. ' to buy this mount.', cid) elseif getPlayerStorageValue(cid, parameters.storage[getPlayerSex(cid)]) ~= -1 then npcHandler:say('you already have this outfit!', cid) elseif not doPlayerRemoveMoney(cid, parameters.price) then npcHandler:say('Sorry You need '..parameters.price..' gps to buy this mount!', cid) else doPlayerAddOutfit(cid, parameters.outfit[getPlayerSex(cid)], 1) setPlayerStorageValue(cid, parameters.storage[getPlayerSex(cid)], 1) npcHandler:say('Here is your outfits!', cid) npcHandler:resetNpc() end else npcHandler:say('I can only allow premium players to buy this outfit.', cid) end npcHandler:resetNpc() return true end local outs = { {"assassin", outfitID = {[0] = 156,[1] = 152}, price = 2000, stor = {[0] = 51001,[1] = 52001}, level = 10, premium = true}, {"pirate", outfitID = {[0] = 156,[1] = 152}, price = 5000,stor = {[0] = 51002,[1] = 52002}, level = 15, premium = false}, {"outfits", text = "I sell these outfits: {assassin},{pirate}, or {beggar}!"} } for i = 1, #outs do local get = outs[i] if type(get.outfitID) == "table" then local node = keywordHandler:addKeyword({get[1]}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "You want to buy the oufit " .. get[1] .. " for "..get.price.." ?"}) node:addChildKeyword({"yes"}, AddOutfit, {price = get.price, outfit = get.outfitID, storage = get.stor, level = get.level, premium = get.premium}) node:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Ok, then.", reset = true}) else keywordHandler:addKeyword({get[1]}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = get.text}) end end mounts = nil npcHandler:addModule(FocusModule:new()) outfitID = { [0] = 156, -- 0 significa sexo feminino, logo é o id da outfit female [1] = 152 -- 1 significa sexo masculino, logo é o id da outfit male } stor = { [0] = 51002, -- storage pro sexo feminino [1] = 52002 -- storage pro sexo masculino } storage serve para ele não comprar a mesma outfits várias vezes.
-
obrigado por avisar, é fácil remover esse problema, acho que nem é um problema mas irei remover mesmo assim! obrigado
-
function onStepIn(cid, item, position, fromPosition) local quant_reset = 3 -- quantidade de resets para poder passar if (getPlayerResets(cid) < quant_reset) then doTeleportThing(cid, fromPosition, false) doSendMagicEffect(position, CONST_ME_MAGIC_BLUE) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente players com "..quant_reset.." ou mais podem passar.") return TRUE end return TRUE end
- 6 respostas
-
- precisando urgentemente.
- otserv
- (e 2 mais)
-
1° deixe assim: local color = TEXT_COLOR_RED 2° apague: local pos2 = {x=getCreaturePosition(attacker).x+1,y=getCreaturePosition(attacker).y,z=getCreaturePosition(attacker).z} doSendAnimatedText(pos2, "HIT", color)
-
e não dá para fazer pelo items.xml? colocar na tag das parte do set <attribute key="manaGain" value="25" /> <attribute key="manaTicks" value="1000" /> ...
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.