Ir para conteúdo

xWhiteWolf

Héroi
  • Registro em

  • Última visita

Tudo que xWhiteWolf postou

  1. Esse tipo de script de npc é muito complicado de se mexer.. acho melhor vc tentar pegar outro tipo e usar math.random
  2. eu não manjo de 1.0 mas que eu sabia a função addOutfitCondition não é por array não: addOutfitCondition(condition, lookTypeEx, lookType, lookHead, lookBody, lookLegs, lookFeet) tira os {}
  3. as pessoas responderiam se vocês soubessem explicar oque querem... oque é um clã? é a mesma coisa que uma guild? Rank seria o guild rank mesmo? Ou clã seria vocação? explica melhor que não é todo mundo que sabe doque vc tá falando
  4. <talkaction log="yes" words="!status" event="script" value="status.lua"/> function onSay(cid, words, param) local level = getPlayerLevel(cid) local vocation = getPlayerVocationName(cid) local health, maxhealth = getCreatureHealth(cid), getCreatureMaxHealth(cid) local mana, maxmana = getCreatureMana(cid), getCreatureMaxMana(cid) local fist, club, sword, axe = getPlayerSkillLevel(cid, 0), getPlayerSkillLevel(cid, 1), getPlayerSkillLevel(cid, 2), getPlayerSkillLevel(cid, 3) local distance, shield, fishing, magic = getPlayerSkillLevel(cid, 4), getPlayerSkillLevel(cid, 5), getPlayerSkillLevel(cid, 6), getPlayerMagLevel(cid) function getCritical(cid) crit = getPlayerStorageValue(cid, 48913) if crit < 0 then crit = 0 end return crit * 0.3 end function getResets(cid) resets = getPlayerStorageValue(cid, 378378) if resets < 0 then resets = 0 end return resets end function getItemAbsorve(itemuid) return getItemAttribute(itemuid, "absorbPercentAll") end function getItemMagicIncrease(itemuid) return getItemAttribute(itemuid, "increaseMagic") end local max = 50 local dodgePercent = math.floor(0) local all, increasemagic = 0, 0 for i = 1, 9 do if getPlayerSlotItem(cid, i).uid > 1 then if getItemDodgePercent(getPlayerSlotItem(cid, i).uid) then dodgePercent = dodgePercent + getItemDodgePercent(getPlayerSlotItem(cid, i).uid) end if getItemAbsorve(getPlayerSlotItem(cid, i).uid) then all = all + getItemAbsorve(getPlayerSlotItem(cid, i).uid) end if getItemMagicIncrease(getPlayerSlotItem(cid, i).uid) then increasemagic = increasemagic + getItemMagicIncrease(getPlayerSlotItem(cid, i).uid) end end end if dodgePercent >= max then dodgePercent = max end dodgeTotal = math.floor(dodgePercent*10)/10 local cap = getPlayerFreeCap(cid) local text = "Vocation: "..vocation.."\nLevel: ".. level .."\nHP: ".. health .."/".. maxhealth .."\nMP: ".. mana .."/".. maxmana .."\nReset(s): "..getResets(cid).."\nCapacity: ".. cap .."\n\nDodge Percent: ".. (dodgeTotal) .."%\nCritical: ".. getCritical(cid) .."%\nProtection: ".. all .."%\nMagic Increase: ".. increasemagic .."%\nMagic Level: ".. magic .."\n\nFist: ".. fist .."\nClub: ".. club .."\nSword: ".. sword .."\nAxe: ".. axe .."\nDistance: ".. distance .."\nShield: ".. shield .."\nFishing: ".. fishing .."" doShowTextDialog(cid, 5808, text) return true end não ficou tão bom quanto eu queria (tentei adicionar algumas outras informações mas sem sucesso.. a absorvall e increaseMagic não pegam no meu servidor.. vc tem que pegar o nome delas certinho e adicionar aqui: Entretanto eu adicionei a opção de mostrar a porcentagem de critical (do meu sistema de critical), espero que vc goste e qualquer coisa é só remover essa parte aqui: \nCritical: ".. getCritical(cid) .."% lembrando que \n significa pular uma linha. print de como fica no server:
  5. Fala galera do TK, hoje vim trazer pra vocês à pedidos do grande @azzouks uma versão do meu Dodge System por equips. Explicação: É um sistema onde vc pode colocar uma % de esquiva nos itens e ao usá-los você ganha a chance de desviar dos ataques e levar somente metade do dano. Qualquer semelhança com esse > http://www.tibiaking.com/forum/topic/8223-mod-reflect-system-01/ < mod do @Aluccard não é mera coincidência, eu usei o mod dele como base pra fazer o meu *-* Sem mais delongas vamos ao script: Vá na pasta do seu server e abra uma pasta chamada "mods".. lá dentro crie um arquivo com o nome que vc quiser (sério) de extensão.xml e adicione o seguinte nele: Configurando: Se você não manja de script então eu sugiro que vcs só alterem essa parte aqui: em vermelho é o máximo que uma pessoa pode ter de dodge: se ela tiver usando um full set que deixe ela com um total de 99% de dodge ela só vai poder aproveitar 50%. Isso foi feito pra evitar um bug.. vocês podem se sentir livres pra alterar esse numero mas não coloquem nada muito grande pra evitar que seus servers explodam. em verde é a porcentagem do dano que vocês vao tomar ao desviar.. nesse caso os ataques que eu der dodge darão 50% do dano (0.5) em azul é a porcentagem inicial que todos os players vão ter. Por padrão está 0 mas se vc quiser que todos os players do seu server tenham 20% e que cada item dê 5% também é possível editando esse 0 pra 20. Feito isso vá em data\lib\function.lua e adicione essas linhas function getItemDodgePercent(itemuid) return getItemAttribute(itemuid, "dodgePercent") end function doPlayerAddDodgeItem(cid, itemid, percent) local item = doPlayerAddItem(cid, itemid) doItemSetAttribute(item, "description", "[Dodge: "..percent.."%]") doItemSetAttribute(item, "dodgePercent", percent) end Agora é só aproveitar no seu server.. toda vez que vc for usar num script vc poderá utilizar as funções getItemDodgePercent(item) e a doPlayerAddDodgeItem(cid, itemid, percent). Pra finalizar aqui tem um exemplo de uma quest que dá uma plate armor com 0.8% de dodge: Espero que gostem! EDITADO: Fiz um script de action pra ser uma pedra que vai dar dodge nos items. Ele tem muito que melhorar mas por ora ele tá 99% pronto pra ser colocado em algum server que utilize esse dodge system. function isHandItem(uid) -- NW based on Mock uid = uid or 0 if isInArray({1,2,3,4,5,6}, getItemWeaponType(uid)) then return true end return false end function getItemDodgePercent(itemuid) return getItemAttribute(itemuid, "dodgePercent") or 0 end function setItemDodgePercent(uid, percent) doItemSetAttribute(uid, "description", "[Dodge: "..percent.."%]") doItemSetAttribute(uid, "dodgePercent", percent) end function onUse(cid, item, fromPosition, itemEx, toPosition) level = 0 local upgrade = { [1] = {min = 1, max = 5, chance = 100}, [2] = {min = 5, max = 10, chance = 80}, [3] = {min = 10, max = 20, chance = 60}, [4] = {min = 20, max = 40, chance = 40}, [5] = {min = 40, max = 50, chance = 20} } function isWearing(uid) -- NW based on Mock uid = uid or 0 if isInArray({uid}, getPlayerSlotItem(cid, 1).uid) or isInArray({uid}, getPlayerSlotItem(cid, 4).uid) or isInArray({uid}, getPlayerSlotItem(cid, 7).uid) or isInArray({uid}, getPlayerSlotItem(cid, 8).uid) then return true end return false end if isHandItem(itemEx.uid) or isWearing(itemEx.uid) then local name = getItemName(itemEx.uid) local atual = math.floor(getItemDodgePercent(itemEx.uid)*10)/10 for i = 1, #upgrade do if string.find(tostring(name),"+".. i .."") then level = i end end if level >= #upgrade then doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"Your item is already on max level, you can't upgrade it any further.") return true end if math.random(0,100) <= upgrade[level + 1].chance then doRemoveItem(item.uid, 1) doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"You leveled your "..getItemNameById(itemEx.itemid).." to ".. level+1 ..".") setItemDodgePercent(itemEx.uid, atual + (math.random(upgrade[level+1].min,upgrade[level+1].max))/10) doItemSetAttribute(itemEx.uid,'name', getItemNameById(itemEx.itemid)..' +'..(level+1)) doSendMagicEffect(toPosition, math.random(28,30)) else doRemoveItem(itemEx.uid, 1) doRemoveItem(item.uid, 1) doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"Your "..getItemNameById(item.itemid).." has failed and destroyed your "..getItemNameById(itemEx.itemid).." in the process") doSendMagicEffect(toPosition, 4) end else doPlayerSendTextMessage(cid, 24,"You cant refine this item.") end return true end Note que pra colocar dodge num item ele tem que: Estar equipado se for qualquer tipo de armadura (legs, boots, helmet, armor) ou livremente (se for weapon/shield).. Necklaces, rings e pendants não são possíveis de colocar dodge.. se vc quiser que seja edita essa função dentro do script pros slots de ring e necklace mas eu não aconselharia a fazer isso. e no xml coloque: <action itemid="8306" script=upgraderock.lua"/>
  6. terminei de fazer aqui, vendo o script por 500 reais AUHIHEAUHIEUHIAUHI brincadeira. Jajá eu posto ele no fórum e vai ficar na minha assinatura, ok?
  7. xWhiteWolf postou uma resposta no tópico em Suporte Tibia OTServer
    acabei de testar aqui cara.. meu spells.xml tá assim: <instant name="Light" words="utevo lux" lvl="8" mana="20" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="support/light.lua"> <vocation id="1"/> <vocation id="2"/> <vocation id="3"/> <vocation id="4"/> <vocation id="5"/> <vocation id="6"/> <vocation id="7"/> <vocation id="8"/> </instant> funcionou perfeitamente... a unica coisa que pode tar interfirindo seria se você ja tivesse colocado em algum outro script a variavel global "cooldown" nesse caso troca cooldown por alguma outra palavra
  8. <!-- Guild Outfit Command --> <config name="guild-outfit-config"><![CDATA[ exhaust = 30 -- in seconds storage = 3005 -- storage value used to save exhaustion ]]></config> <talkaction words="!go;/go" event="script"><![CDATA[ domodlib('guild-outfit-config') local config = { exhaustion = exhaust, storage = storage } function onSay(cid, words, param, channel) if (getPlayerStorageValue(cid, 140125) ~= -1) or (getPlayerStorageValue(cid, 140124) ~= -1) then doPlayerSendCancel(cid, "Você não pode usar invisible durante o evento!") doSendMagicEffect(getThingPos(cid), 2) return true else if(exhaustion.check(cid, config.storage)) then doPlayerSendCancel(cid, "You can change outfit only 1 time per " .. config.exhaustion .. " seconds.") return true end local playerGuild = getPlayerGuildId(cid) if(not playerGuild or playerGuild == 0) then doPlayerSendCancel(cid, "Sorry, you're not in a guild.") return true end if(getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER) then doPlayerSendCancel(cid, "You have to be Leader of your guild to change outfits!") return true end local outfit, members = getCreatureOutfit(cid), 0 local message = "*Guild* Your outfit has been changed by leader. (" .. getCreatureName(cid) .. ")" for _, tid in ipairs(getPlayersOnline()) do if(getPlayerGuildId(tid) == playerGuild and cid ~= tid) then if (getPlayerStorageValue(tid, 140125) ~= -1) or (getPlayerStorageValue(tid, 140124) ~= -1) then else local newOutfit = outfit if(not canPlayerWearOutfit(tid, outfit.lookType, outfit.lookAddons)) then local tmpOutfit = getCreatureOutfit(tid) newOutfit.lookAddons = 0--tmpOutfit.lookAddons if(not canPlayerWearOutfit(tid, outfit.lookType, 0)) then newOutfit.lookType = tmpOutfit.lookType end end doSendMagicEffect(getCreaturePosition(tid), 66) doCreatureChangeOutfit(tid, newOutfit) doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, message) members = members + 1 end end exhaustion.set(cid, config.storage, config.exhaustion) doPlayerSendCancel(cid, "Guild members outfit has been changed. (Total: " .. members .. ")") end end return true end ]]></talkaction> agora deve funcionar
  9. xWhiteWolf postou uma resposta no tópico em Suporte Tibia OTServer
    tá mas me manda um print do seu sql editor me mostrando como é a tabela desse premium point
  10. ele nao tá conseguindo calcular essa soma aqui: skills.magic + config.mlnew cara.. quando eu fiz esse script pra você eu te disse que não dava pra fazer.. criar um tópico aqui é escolha sua mas eu não tenho competência pra te ajudar nesse erro.
  11. ahh, eu li errado.. foi mal: if isPremium(cid) then playerid = getPlayerGUID(cid) db.executeQuery("UPDATE `players` SET `description` = ' [VIP]' WHERE `players`.`id`= ".. playerid .."") end
  12. xWhiteWolf postou uma resposta no tópico em Suporte Tibia OTServer
    local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_LIGHT) setConditionParam(condition, CONDITION_PARAM_LIGHT_LEVEL, 6) setConditionParam(condition, CONDITION_PARAM_LIGHT_COLOR, 215) setConditionParam(condition, CONDITION_PARAM_TICKS, (6 * 60 + 10) * 1000) setCombatCondition(combat, condition) function onCastSpell(cid, var) if getPlayerVocation(cid) >= 10 then cooldown = 5 else cooldown = 10 end if os.time() - getPlayerStorageValue(cid, 23000) >= 0 then setPlayerStorageValue(cid, 23000, os.time() + cooldown) doCombat(cid, combat, var) return true else doPlayerSendCancel(cid, "You are exhausted.") doSendMagicEffect(getCreaturePosition(cid), 2) return false end end coloca exhaustion="1000" no spells.xml.. O cooldown é dentro do script: cooldown = 5 else cooldown = 10 cooldown pra voc premium é o primeiro, o segundo é pra quem não é voc premium (o tempo é em segundos)
  13. xWhiteWolf postou uma resposta no tópico em Suporte Tibia OTServer
    esse 1 ponto no site é pelo que? sql, storage, função nova???
  14. xWhiteWolf postou uma resposta no tópico em Suporte Tibia OTServer
    prontíssimo: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_LIGHT) setConditionParam(condition, CONDITION_PARAM_LIGHT_LEVEL, 6) setConditionParam(condition, CONDITION_PARAM_LIGHT_COLOR, 215) setConditionParam(condition, CONDITION_PARAM_TICKS, (6 * 60 + 10) * 1000) setCombatCondition(combat, condition) function onCastSpell(cid, var) if getPlayerVocation(cid) >= 10 then cooldown = 5 else cooldown = 10 end if os.time() - getPlayerStorageValue(cid, 23000) >= 0 then setPlayerStorageValue(cid, 23000, os.time() + cooldown) doCombat(cid, combat, var) else doPlayerSendCancel(cid, "You are exhausted.") doSendMagicEffect(getCreaturePosition(cid), 2) end return true end ele checa se a voc do cara é 10 ou maior.. se for o cooldown é 5, se não é 10 segundos. Qualquer erro pode falar aqui
  15. xWhiteWolf postou uma resposta no tópico em Suporte Tibia OTServer
    Oque acontece é que ele não tá conseguindo achar o player na função getPlayerSlotItem(cid, 3) mas eu não sei oque pode tar causando isso... a menos que seu server esteja com essa função bugada
  16. xWhiteWolf postou uma resposta no tópico em Suporte Tibia OTServer
    a exp pode ser mudada em 3 lugares diferentes nos servidores comuns (não sei de poketibia mas acho que é a mesma coisa) O primeiro lugar é no config.lua: -- Rates -- NOTE: experienceStages configuration is located in data/XML/stages.xml. -- rateExperienceFromPlayers 0 to disable. experienceStages = "no" rateExperience = 70 rateExperienceFromPlayers = 0 rateSkill = 60 rateMagic = 60 rateLoot = 4 rateSpawn = 10 você pode ativar ou desativar a experiencia por stages no primeiro rate experience é o quanto será multiplicada a experiencia dos monstros rate experience from players é o quanto ganha de experiencia ao matar players o resto tem a ver com a facilidade de upar skills, de dropar loot e do monstro nascer Agora em data\XML\stages.xml você pode editar a experiencia que você ganha a cada level: <?xml version="1.0" encoding="UTF-8"?> <stages> <world id="0" multiplier="1"> <stage minlevel="1" maxlevel="50" multiplier="200"/> <stage minlevel="50" maxlevel="100" multiplier="150"/> <stage minlevel="100" maxlevel="200" multiplier="70"/> <stage minlevel="200" maxlevel="300" multiplier="50"/> <stage minlevel="300" multiplier="30"/> </world> </stages> nesse caso do level 1 ao 50 a experiencia é 200x maior porém acima do level 300 a experiencia é 30x maior. Por último no vocations.xml você pode editar uma experiencia maior pra cada classe: estando 1.0 significa que ele vai multiplicar a exp do server por 1 (que vai dar ela mesma) somente praquela classe.
  17. no seu config.lua mude isso daqui: freePremium = false coloque true /\ Agora em creaturescripts\scripts\login.lua adicione essas linhas antes do ultimo return true: if getPlayerStorageValue(cid, 19300) <= 0 then playerid = getPlayerGUID(cid) db.executeQuery("UPDATE `players` SET `description` = ' [VIP]' WHERE `players`.`id`= ".. playerid .."") setPlayerStorageValue(cid, 19300, 1) end
  18. eu pensei nisso também mas pelo que ele falou a unica coisa que não funciona é a alteração da database de skills
  19. dá um ctrl + f nesse id "7424" e remove a linha que diz que ele é uma club... se não pode dar erro
  20. vou dar uma olhada pra ver oque eu consigo fazer.. to seguindo o tópico, caso eu consiga eu posto aqui
  21. quando eu te passei esse script eu te falei que ele ia precisar ser modificado de acordo com o seu server... a parte que edita as skills é aqui e se não tá adicionando é porque tem alguma coisa errada: Procura estudar esses comandos de db.executeQuery ------------------------------ EDIÇÃO DAS SKILLS -------------------- local skills = { magic = getPlayerSkillLevel(cid, SKILL__MAGLEVEL), club = getPlayerSkillLevel(cid, SKILL_CLUB), axe = getPlayerSkillLevel(cid, SKILL_AXE), sword = getPlayerSkillLevel(cid, SKILL_SWORD), shield = getPlayerSkillLevel(cid, SKILL_SHIELD), distance = getPlayerSkillLevel(cid, SKILL_DISTANCE) } if isInArray({13,14}, getPlayerVocation(cid)) then db.executeQuery("UPDATE `player_skills` SET `value` = " .. (skills.magic + config.mlnew) .. ", `count` = 0 WHERE `skillid` = 7 and `player_id` = " .. playerid .. ";") end if isInArray({16}, getPlayerVocation(cid)) then db.executeQuery("UPDATE `player_skills` SET `value` = " .. (skill.shield + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 5 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (skill.axe + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 3 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (skill.sword + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 2 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (skill.club + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 1 and `player_id` = " .. playerid .. ";") end if isInArray({15}, getPlayerVocation(cid)) then db.executeQuery("UPDATE `player_skills` SET `value` = " .. (skill.shield + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 5 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (skill.distance + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 4 and `player_id` = " .. playerid .. ";") end ------------------------FIM ----------------------------------
  22. xWhiteWolf postou uma resposta no tópico em Suporte Tibia OTServer
    sim, vou fazer pra você qnd eu acordar hoje
  23. xWhiteWolf postou uma resposta no tópico em Suporte Tibia OTServer
    você não entendeu oque eu quis dizer haha deixa um utevo lux só e edita o script (só o script), no spells.xml vc só pode deixar 1 utevo lux. Vai ser a mesma spell mas dentro do script vai haver uma checagem se for vip ele seta o cooldown pra 5 segundos, do contrário é 10 segundos
  24. eu acredito que amigos vem e vão e você não deve ficar se lamentando quando eles forem e muito menos os considerar falsos por conta disso. O negócio é agradecer a "estadia" e ser grato por ter conhecido alguém que foi legal com você.

Informação Importante

Confirmação de Termo