Ir para conteúdo

Alumoz

Membro
  • Registro em

  • Última visita

Tudo que Alumoz postou

  1. Olá, Estou procurando ajuda para finalizar um sistema de condição/penalidade no mapa. No revscript gostaria de saber como adicionar por exemplo a condição CURSED de 100 de dano a cada 3 segundos nesse script se alguém puder me ajudar, Mas também como adicionar várias condições, menos vida, mais vida, menos mana, mais mana, dano de fogo, dano de gelo, dano de terra, dano de morte, dano físico, 20% menos espada de habilidade... etc. A base, local topLeftCorner = Position(1000, 1000, 7) local bottomRightCorner = Position(1100, 1100, 7) for _, player in pairs(Game.getPlayers()) do if player:getPosition():isInRange(topLeftCorner, bottomRightCorner) then -- CONDITION.. end end Eu tentei mas não funcionou para mim: local riftCond = CreatureEvent("riftCond") local topLeftCorner = Position(32377, 32241, 7) local bottomRightCorner = Position(32387, 32249, 7) local condition = Condition(CONDITION_CURSED) condition:setParameter(CONDITION_PARAM_DELAYED, 1) condition:setParameter(CONDITION_PARAM_TYPE, CONDITION_CURSED) condition:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_DEATH) local parameters = { {key = CONDITION_PARAM_TICKS, value = 10 * 1000}, } -- local target = creature:getTarget() function riftCond.xxxxxxxx(creature, variant) -- Creature / player ? is onCastSpell the right function ? for _, player in pairs(Game.getPlayers()) do target:addAttributeCondition(parameters) -- Not sure addDamage / target:addCondition(condition) -- condition:addDamage(5,1000, -100) -- condition:addCondition(condition) -- condition:execute(creature, var) end condition:execute(creature, variant) return true end riftCond:register()
  2. Olá desculpe a demora na resposta, parece que o site .com está inacessível, exceto se você clicar em fóruns, eu finalmente encontrei local config = { actionId = 45001, baseChance = 100, cooldown = { active = true, key = 11111, value = 64800 }, chanceIncreasers = { [1111] = {chanceIncrease = 10} }, rewards = { {itemId = 1111, minCount = 1, maxCount = 1, chance = 500}, {itemId = 2222, minCount = 1, maxCount = 10, chance = 50}, {itemId = 3333, minCount = 10, maxCount = 50, chance = 5} } } local rewardChest = Action() function rewardChest.onUse(player, item, fromPosition, target, toPosition, isHotkey) if config.cooldown.active then local currentTime = os.time() local currentStorage = player:getStorageValue(config.cooldown.key) if currentStorage > currentTime then player:sendCancelMessage("Currently on cooldown. Can use again in ".. os.date("!%Hh %Mm %Ss", currentStorage - currentTime) .."") return true end player:setStorageValue(config.cooldown.key, (currentTime + config.cooldown.value)) end local chance = config.baseChance for v, k in pairs(config.chanceIncreasers) do local increaserCount = player:getItemCount(v) local increasersUsed = 0 while chance < 1000 and increaserCount > 0 do chance = chance + k.chanceIncrease increasersUsed = increasersUsed - 1 end player:removeItem(config.itemChanceIncreaserId, increasersUsed) end local rand = math.random(1000) if chance > rand then player:say("No reward.", TALKTYPE_MONSTER_SAY) return true end local rewardList = {} while #rewardList < 1 do for i = 1, #config.rewards do rand = math.random(1000) if rand <= config.rewards[i].chance then rewardList[#rewardList + 1] = i end end end rand = math.random(#rewardList) player:addItem(config.rewards[rand].itemId, math.random(config.rewards[rand].minCount, config.rewards[rand].maxCount), true) player:say("Received " .. ItemType(config.rewards[rand].itemId):getName():lower() .. " as reward.", TALKTYPE_MONSTER_SAY) return true end rewardChest:aid(config.actionId) rewardChest:register()
  3. .Qual servidor ou website você utiliza como base? Znote Qual o motivo deste tópico? Script Ola pessoal, estou procurando um script tfs 1.3, um baú tem 10% de chance de saquear um item (como 10 itens no total, aleatório com chance) Se eu obtiver, por exemplo, um item, aumentarei 5% essa chance para 10 + 5 % para obter um item, se eu usar 10 items aumentarei para 10+50%, Chance de cada item diferente, como 60% 10 crystal coins, 20% uma bp, 5% uma runa, etc. removendo o item enquanto estiver usando o baú. Não tenho certeza se é possível fazer esse tipo de script Eu sei que poderiamos usar atributos como: mas nao sei como criar esse tipo de script, cooldown_storage = 44444 cooldown = 60 * 60 * 2 player:setStorageValue(config.cooldown_storage, os.time() + config.cooldown) _____________________________________________________________________________ local box = Action() local JEWEL = {2152, 2148} local REWARD = {2160} function box.onUse(cid, item, fromPosition, itemEx, toPosition) local randomChance = math.random(1, #REWARD) doPlayerAddItem(cid, REWARD[randomChance], 1) local randomLoot = math.random(1,20) if randomLoot == 1 then doPlayerSendTextMessage(cid, 22, "You found an extra item!") local randomChance = math.random(1, #REWARD) doPlayerAddItem(cid, REWARD[randomChance], 1) end local randomJewel = math.random(1,10) if randomJewel == 1 then doPlayerSendTextMessage(cid, 22, "You found an extra item!") local randomChance = math.random(1, #JEWEL) doPlayerAddItem(cid, JEWEL[randomChance], 1) end doSendMagicEffect(getPlayerPosition(cid), 172) doRemoveItem(item.uid, 1) return true end box:id(18100) box:register() Obrigado

Informação Importante

Confirmação de Termo