Ir para conteúdo

Storm

Héroi
  • Registro em

  • Última visita

Tudo que Storm postou

  1. local config = { porc = 25, -- | % de chance | -- itemid, qnt = 5252, 1, -- | id do item e sua count | -- storage = 232526, -- | Storage | -- horas = 1 -- | Horas para usar o item novamente | -- } local msgs = { exaust = "você so pode usar isso a cada uma hora", -- | Msg de exaust | -- sucess = "voce recebeu o item", -- | Msg quando conseguir | -- fail = "voce n recebeu o item" -- | Msg quando falhar | -- } function onUse(cid, item, fromPosition, itemEx, toPosition) local pos = getCreaturePosition(cid) if os.time() - getPlayerStorageValue(cid, config.storage) <= config.horas * 3600 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, msgs.exaust) doSendMagicEffect(pos, 3) return true end if math.random(1, 100) <= config.porc then doSendMagicEffect(pos, 5) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, msgs.sucess) doPlayerAddItem(cid, config.itemid, config.qnt) setPlayerStorageValue(cid, config.storage, os.time()) return true end doSendMagicEffect(pos, 5) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, msgs.fail) setPlayerStorageValue(cid, config.storage, os.time()) return true end
  2. exhaustion = { check = function (cid, storage) if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then return false end return getPlayerStorageValue(cid, storage) >= os.time(t) end, get = function (cid, storage) if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then return false end local exhaust = getPlayerStorageValue(cid, storage) if(exhaust > 0) then local left = exhaust - os.time(t) if(left >= 0) then return left end end return false end, set = function (cid, storage, time) setPlayerStorageValue(cid, storage, os.time(t) + time) end, make = function (cid, storage, time) local exhaust = exhaustion.get(cid, storage) if(not exhaust) then exhaustion.set(cid, storage, time) return true end return false end } local configg = { waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4820, 4821, 4822, 4823, 4824, 4825} } local monsters = { {'rat'}, {'rabit'} } local numero = 2 -- numero de monstros que você colocou /\ local number = 100 -- < quanto maior, mais dificil de pescar um monstro 175000 function onUse(cid, item, frompos, item2, topos) local config = { rateSkill = getConfigValue("rateSkill"), allowFromPz = false, useWorms = false } local waittime = 1.5 -- Tempo de exhaustion local storage = 250002 if exhaustion.check(cid, storage) then doPlayerSendCancel(cid, "You are exhausted") return false end exhaustion.set(cid, storage, waittime) if isInArray(configg.waterIds, item2.itemid) == FALSE then return false end local chance = math.random(1,numero+number) -- if chance >= 1 and chance <= numero then create = monsters[chance][1] doSummonCreature(create, getCreaturePosition(cid)) doSendMagicEffect(topos, 11) doCreatureSay(cid, "A Big Monster Has Become Very Disgruntled Due To You !", TEXTCOLOR_BLUE) else doSendMagicEffect(topos, CONST_ME_LOSEENERGY) end if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and item2.itemid ~= 493 and math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))) then doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill) doSendMagicEffect(topos, CONST_ME_LOSEENERGY) else doSendMagicEffect(topos, CONST_ME_LOSEENERGY) end return true end
  3. Arrumei definitivamente ; configure aqui local waittime = 1.5 -- Tempo de exhaustion local storage = 250002
  4. Da um CTRL + F e procura por exhaustion.set(cid, 120, 0.5) Onde tá 0.5 são os segundos , configure ao seu modo.
  5. Perdão , erro meu </movevent> <movevent event="Equip" itemid="2164" slot="ring" function="onEquipItem"/> <movevent event="DeEquip" itemid="2164" slot="ring" function="onDeEquipItem"/> <vocation name="Knight"/> <vocation name="Slayer Knight"/> <vocation name="Elite Knight" showInDescription="0"/> </movevent>
  6. exhaustion = { check = function (cid, storage) if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then return false end return getPlayerStorageValue(cid, storage) >= os.time(t) end, get = function (cid, storage) if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then return false end local exhaust = getPlayerStorageValue(cid, storage) if(exhaust > 0) then local left = exhaust - os.time(t) if(left >= 0) then return left end end return false end, set = function (cid, storage, time) setPlayerStorageValue(cid, storage, os.time(t) + time) end, make = function (cid, storage, time) local exhaust = exhaustion.get(cid, storage) if(not exhaust) then exhaustion.set(cid, storage, time) return true end return false end } local configg = { waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4820, 4821, 4822, 4823, 4824, 4825} } local monsters = { {'rat'}, {'rabit'} } local numero = 2 -- numero de monstros que você colocou /\ local number = 100 -- < quanto maior, mais dificil de pescar um monstro 175000 function onUse(cid, item, frompos, item2, topos) local config = { rateSkill = getConfigValue("rateSkill"), allowFromPz = false, useWorms = false } if exhaustion.check(cid, 120) == TRUE then doPlayerSendCancel(cid, "You are exhausted.") doSendMagicEffect(getCreaturePosition(cid), 3) return TRUE end if isInArray(configg.waterIds, item2.itemid) == FALSE then return false end local chance = math.random(1,numero+number) -- if chance >= 1 and chance <= numero then create = monsters[chance][1] doSummonCreature(create, getCreaturePosition(cid)) doSendMagicEffect(topos, 11) exhaustion.set(cid, 120, 0.5) doCreatureSay(cid, "A Big Monster Has Become Very Disgruntled Due To You !", TEXTCOLOR_BLUE) else doSendMagicEffect(topos, CONST_ME_LOSEENERGY) end if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and item2.itemid ~= 493 and math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))) then doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill) doSendMagicEffect(topos, CONST_ME_LOSEENERGY) else doSendMagicEffect(topos, CONST_ME_LOSEENERGY) end return true end
  7. @Infused em Data>Lib crie um arquivo chamado 034-exhaustion e cole isso dentro exhaustion = { check = function (cid, storage) if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then return false end return getPlayerStorageValue(cid, storage) >= os.time(t) end, get = function (cid, storage) if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then return false end local exhaust = getPlayerStorageValue(cid, storage) if(exhaust > 0) then local left = exhaust - os.time(t) if(left >= 0) then return left end end return false end, set = function (cid, storage, time) setPlayerStorageValue(cid, storage, os.time(t) + time) end, make = function (cid, storage, time) local exhaust = exhaustion.get(cid, storage) if(not exhaust) then exhaustion.set(cid, storage, time) return true end return false end }
  8. <movevent event="Equip" itemid="2164" slot="ring" function="onEquipItem"/> <movevent event="DeEquip" itemid="2164" slot="ring" function="onDeEquipItem"/> <vocation name="Knight"/> <vocation name="Slayer Knight"/> <vocation name="Elite Knight" showInDescription="0"/> </movevent>
  9. http://www.tibiaking.com/forum/forums/topic/82474-ethno-gengia-ghala-ghenov-oken-pyre-vikia-atlantyda/
  10. local configg = { waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4820, 4821, 4822, 4823, 4824, 4825} } local monsters = { {'rat'}, {'rabit'} } local numero = 2 -- numero de monstros que você colocou /\ local number = 100 -- < quanto maior, mais dificil de pescar um monstro 175000 local config = { rateSkill = getConfigValue("rateSkill"), allowFromPz = false, useWorms = false } function onUse(cid, item, frompos, item2, topos) if exhaustion.check(cid, 120) == TRUE then doPlayerSendCancel(cid, "You are exhausted.") doSendMagicEffect(getCreaturePosition(cid), 3) return TRUE end if isInArray(configg.waterIds, item2.itemid) == FALSE then return false end local chance = math.random(1,numero+number) -- if chance >= 1 and chance <= numero then create = monsters[chance][1] doSummonCreature(create, getCreaturePosition(cid)) doSendMagicEffect(topos, 11) exhaustion.set(cid, 120, 0.5) doCreatureSay(cid, "A Big Monster Has Become Very Disgruntled Due To You !", TEXTCOLOR_BLUE) else doSendMagicEffect(topos, CONST_ME_LOSEENERGY) end if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and item2.itemid ~= 493 and math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and (not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))) then doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill) doSendMagicEffect(topos, CONST_ME_LOSEENERGY) else doSendMagicEffect(topos, CONST_ME_LOSEENERGY) end return true end
  11. Só por source editing
  12. Movements.XML
  13. local t = { [2200] = {200, 100} -- [ID DO ITEM AO EQUIPAR] = {HP EXTRA, MP EXTRA} } local get_item = t[item] function onEquip(cid, item, slot) local pid = getCreaturePosition(cid) if get_item then setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + get_item[1]) setCreatureMaxMana(cid, getCreatureMaxMana(cid) + get_item[2]) doSendMagicEffect(pid, 3) return true end end function onDeEquip(cid, item, slot) local pid = getCreaturePosition(cid) if get_item then setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - get_item[1]) setCreatureMaxMana(cid, getCreatureMaxMana(cid) - get_item[2]) doSendMagicEffect(pid, 2) return true end end Com essa script você precisar criar apenas 1 script ; porém na XML cada item que você adicionar na tabela terá que adicionar também na XML <movevent type="Equip" itemid="2195" slot="ring" event="script" value="extra.lua"/> <movevent type="DeEquip" itemid="2195" slot="ring" event="script" value="extra.lua"/> Caso a script não funcione ,provavelmente não terá uma solução por LUA ; porque no tibia quando se usa setCreatureMaxHealth(param) o player tem que relogar para que a vida se altera , porém quando se desloga automaticamente os itens são desequipados ; tenho receio de não funcionar.
  14. Parece que sua função getPlayerNameByWildcard é diferente das outras , ela procura até mesmo players offline
  15. Você cria um arquivo XML na pasta NPC , cola isso dentro e edita.
  16. <?xml version="1.0" encoding="UTF-8"?> <npc name="Tyoric" script="default.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="134" head="57" body="59" legs="40" feet="76" addons="0"/> <parameters> <parameter key="module_shop" value="1"/> <parameter key="shop_sellable" value="crossbow,2455,150;bow,2456,130"/> <parameter key="shop_buyable" value="crossbow,2455,360;bow,2456,200;spear,2389,20;poison arrow,2545,18;bolt,2543,3;arrow,2544,2"/> </parameters> </npc>
  17. -- By Kimoszin -- <event type="login" name="Anti" event="script" value="anti.lua"/> local config = { max = 1, -- número de players permitido com o mesmo ip group_id = 1 -- kikar apenas player com o group id 1 } local accepted_ip_list = {} -- lista dos players permitidos a usar MC, exemplo: {"200.85.3.60", "201.36.5.222"} local function antiMC(p) if #getPlayersByIp(getPlayerIp(p.pid)) >= p.max then doRemoveCreature(p.pid) end return true end function onLogin(cid) if getPlayerGroupId(cid) <= config.group_id then if isInArray(accepted_ip_list,doConvertIntegerToIp(getPlayerIp(cid))) == false then addEvent(antiMC, 1000, {pid = cid, max = config.max+1}) end end return true end
  18. Storm postou uma resposta no tópico em Suporte Tibia OTServer
    Faz assim , manda por aqui sua creaturescripts.XML
  19. Storm postou uma resposta no tópico em Suporte Tibia OTServer
    Como assim sem push ?
  20. -- <talkaction words="!kickstorage" event="script" value="kickstorage.lua"/> function onSay(cid, words, param) local storage = 49015 local online = getPlayersOnline() for _, pid in pairs(online) do if getPlayerStorageValue(pid, storage) > 0 then doRemoveCreature(pid) end end end
  21. -- <talkaction words="!info" event="script" value="info.lua"/> function getDeathsAndKills(cid, type) -- by vodka local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0 if (query:getID() ~= -1) then repeat d = d+1 until not query:next() query:free() end return d end function onSay(cid, words, param) local kill = 65432 -- -- Storages de kill e death , respectivamente local death = 23456 -- local a = string.explode(param, ",") local b = getPlayerByNameWildcard(a[1]) if (param == '') then doSendMagicEffect(getCreaturePosition(cid), 2) return doPlayerSendTextMessage(cid, 25, "Digite !Player [nome do player]") end if not b then doSendMagicEffect(getCreaturePosition(cid), 2) return doPlayerSendTextMessage(cid, 25, "Player não encontrado ou Offline") end doShowTextDialog(cid, 2175,"Name = [ ".. getCreatureName(b) .." ] \n \n Level = [".. getPlayerLevel(b) .."] \n \n MagicLevel = [ ".. getPlayerMagLevel(b) .." ] \n \n Sword = [".. getPlayerSkillLevel(b, 2) .."]\n \n Fist = [".. getPlayerSkillLevel(b, 0).."]\n \n Club = [".. getPlayerSkillLevel(b, 1).."]\n \n Axe = [".. getPlayerSkillLevel(b, 3).."] \n \n Distance = [".. getPlayerSkillLevel(b, 4).."] \n \n Shield = [".. getPlayerSkillLevel(b, 5).."] \n \n Fishing = [".. getPlayerSkillLevel(b, 6).."] \n \n -- PVP -- \n \n Kills/Deaths = [".. getDeathsAndKills(b, "kill") .."/".. getDeathsAndKills(b, "death") .."]") return false end Sobre contar deaths de monsters eu não consigo , não está no meu conhecimento.
  22. Muda a tag na XML para <talkaction words="!info" script="info.lua"/>
  23. Não tem lógica da esse erro ; tenta com letra com a inicial maiúscula .
  24. -- Action function onUse(cid, item, fromPosition, itemEx, toPosition) local storages = {23466, 415142, 12345} local exaust = 1 -- horas pra usar novamente if os.time() - getPlayerStorageValue(cid, storages[1]) <= exaust * 3600 and os.time() - getPlayerStorageValue(cid, storages[2]) <= exaust * 60 and os.time() - getPlayerStorageValue(cid, storages[2]) <= exaust * 60 then doSendMagicEffect(getCreaturePosition(cid), 2) return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Aguarde o tempo restante para usar o item novamente") end setPlayerStorageValue(cid, storages[1], os.time()) setPlayerStorageValue(cid, storages[2], os.time()) setPlayerStorageValue(cid, storages[3], os.time()) return doPlayerSendTextMessage(cid, 25, "Você habilitou 3 spells") end

Informação Importante

Confirmação de Termo