Ir para conteúdo

Zanrix

Membro
  • Registro em

  • Última visita

Tudo que Zanrix postou

  1. Como assim o effect continua? Sobre a vocação, faz assim: creaturescripts/scripts/login.lua (Antes do último return true coloca): if getPlayerVocation(cid) == 10 then -- aqui nesse 10 vc coloca o id da vocação do modo transformado doPlayerSetVocation(cid, 8) -- aqui nesse 8 vc coloca o id da vocação normal end
  2. Sobre a mana não vou saber te ajudar, mas aqui ta com os efeitos: local voc_inical = 2 -- id da vocação antes de se transformar local vocation = 4 -- id da vocação que a magia vai transformar local outfit = 250 -- looktype da outfit que a magia vai transformar local mana = 10 -- quanto de mana por segundo a magia vai dar local segundos = 30 -- quantos segundos a magia vai durar local efeito1 = CONST_ME_MAGIC_BLUE -- efeito de quando se transformar local efeito2 = CONST_ME_MAGIC_BLUE -- efeito de quando acabar a transformação local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, efeito1) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_REGENERATION) setConditionParam(condition, CONDITION_PARAM_SUBID, 1) setConditionParam(condition, CONDITION_PARAM_BUFF, true) setConditionParam(condition, CONDITION_PARAM_TICKS, 1 * segundos * 1000) setConditionParam(condition, CONDITION_PARAM_MANAGAIN, mana) setConditionParam(condition, CONDITION_PARAM_MANATICKS, 1000) local condition2 = createConditionObject(CONDITION_OUTFIT) setConditionParam(condition2, CONDITION_PARAM_TICKS, 1 * segundos * 1000) addOutfitCondition(condition2, {lookType = outfit, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}) setCombatCondition(combat, condition) setCombatCondition(combat, condition2) local function onCastSpell1(parameters) doPlayerSetVocation(parameters.cid, vocation) end local function onCastSpell2(parameters) if parameters.cid then doSendMagicEffect(getPlayerPosition(parameters.cid), efeito2) doPlayerSetVocation(parameters.cid, voc_inical) end end function onCastSpell(cid, var) local tempo = segundos * 1000 local parameters = { cid = cid, var = var } addEvent(onCastSpell1, 1, parameters) addEvent(onCastSpell2, tempo, parameters) return doCombat(cid, combat, var) end
  3. Testa aí local voc_inical = 2 -- id da vocação antes de se transformar local vocation = 4 -- id da vocação que a magia vai transformar local outfit = 250 -- looktype da outfit que a magia vai transformar local mana = 10 -- quanto de mana por segundo a magia vai dar local segundos = 30 -- quantos segundos a magia vai durar local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_REGENERATION) setConditionParam(condition, CONDITION_PARAM_SUBID, 1) setConditionParam(condition, CONDITION_PARAM_BUFF, true) setConditionParam(condition, CONDITION_PARAM_TICKS, 1 * segundos * 1000) setConditionParam(condition, CONDITION_PARAM_MANAGAIN, mana) setConditionParam(condition, CONDITION_PARAM_MANATICKS, 1000) local condition2 = createConditionObject(CONDITION_OUTFIT) setConditionParam(condition2, CONDITION_PARAM_TICKS, 1 * segundos * 1000) addOutfitCondition(condition2, {lookType = outfit, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}) setCombatCondition(combat, condition) setCombatCondition(combat, condition2) local function onCastSpell1(parameters) doPlayerSetVocation(parameters.cid, vocation) end local function onCastSpell2(parameters) if parameters.cid then doPlayerSetVocation(parameters.cid, voc_inical) end end function onCastSpell(cid, var) local tempo = segundos * 1000 local parameters = { cid = cid, var = var } addEvent(onCastSpell1, 1, parameters) addEvent(onCastSpell2, tempo, parameters) return doCombat(cid, combat, var) end
  4. Healar a vida e a mana ou só mana? e healar de uma vez só ou ir ganhando por segundo?
  5. Testa aí amigo: spells.xml <instant name="Cura" words="cura" lvl="1" mana="1" prem="0" selftarget="1" aggressive="0" needlearn="0" event="script" value="cura.lua"> <vocation id="4"/> </instant> spells/scripts/cura.lua local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_REGENERATION) setConditionParam(condition, CONDITION_PARAM_SUBID, 1) setConditionParam(condition, CONDITION_PARAM_BUFF, true) setConditionParam(condition, CONDITION_PARAM_TICKS, 1 * 5 * 1000) setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, 200000) setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 1000) setCombatCondition(combat, condition) function onCastSpell(cid, var) local cd_stg = 90950 -- storage do cooldown local cd_time = 180 -- 1 = 1 segundo de cooldown if exhaustion.check(cid, cd_stg) == false then if (getCreatureHealth(cid) >= (getCreatureMaxHealth(cid) * 0.90)) then exhaustion.set(cid, cd_stg, cd_time) return doCombat(cid, combat, var) else doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) doPlayerSendCancel(cid, "You can only use this spell with more than 90% health.") return false end else doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) doPlayerSendCancel(cid, "Spells is on cooldown [" ..exhaustion.get(cid, cd_stg).."s].") return false end end
  6. Try this: talkactions.xml <talkaction words="!rank rebirth" event="script" value="rank rebirth.lua"/> talkactions/rank rebirth.lua function onSay(cid, words, param) local players = 20 -- How many players will be showed in the highscore local str = "" local name = "" local player_id = 0 local result = nil local result2 = nil local first_val = "" local first_nam = "" str = "# [Rebirths] - Name\n" name = "name" result = db.getResult("SELECT `player_id`, (`value` * 1) AS `value` FROM `player_storage` WHERE `key` = 85987 ORDER BY `value` DESC;") result2 = db.getResult("SELECT `name` FROM `players` WHERE id = "..result:getDataString("player_id")..";") first_val = result:getDataString("value") first_nam = result2:getDataString("name") str = str.."\n ".."1. ["..first_val.."] - "..first_nam if (result:getID() ~= -1) then local i = 2 while TRUE do if not(result:next()) or i > players then break end result2 = db.getResult("SELECT `name` FROM `players` WHERE id = "..result:getDataString("player_id")..";") str = str .. "\n " .. i .. ". [" .. result:getDataString("value") .. "] - " .. (name ~= "" and result2:getDataString("name") or getPlayerNameByGUID(result:getDataInt(player_id))) i = i+1 result2:free() end result:free() end if str ~= "" then doPlayerPopupFYI(cid, str) end return TRUE end
  7. Do you want to put the rebirth ranking on the look?
  8. @robi123 O amigo postou ali já: actions.xml <action itemid="2156" event="script" value="red gem.lua"/> <action itemid="2158" event="script" value="blue gem.lua"/> actions/scripts/red gem.lua function onUse(cid, item, fromPosition, itemEx, toPosition) setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 100) doRemoveItem(item.uid, 1) return true end actions/scripts/blue gem.lua function onUse(cid, item, fromPosition, itemEx, toPosition) setCreatureMaxMana(cid, getPlayerMaxMana(cid) + 100) doRemoveItem(item.uid, 1) return true end
  9. Na tag da magia dentro do spells.xml, coloca: direction="1"
  10. Tenta nessa linha, aumentar esse valor 120000: shutdownEvent = addEvent(prepareShutdown, 120000, minutes - 1)
  11. @Nandozeraah Tenta repor aquele seu esquema de CONDITION_PARAM_SUBID, 2 e trocar esse 2 pra um outro número pra ver se funciona, acho que tiraria o conflito do buff @login12 Usando diretamente o math.random eu tbm não consegui fazer funcionar.. Esse é o único outro jeito que conheço de fazer o desejado. Eu tbm posso estar errado, mas acredito que não tem problema nenhum criar loop de combats e conditions, vários sistemas grandes os usam ^-^
  12. Tenta assim: local config = { day = "Sunday", ----> SEI QUE E NESSA LINHA, JA EDITEI ELA DE TODOS OS TIPOW E O TELEPORT NÃO ABRE ! pos = {x=172, y=44, z=7}, topos = {x=733, y=507, z=7}, time = 2, -- tempo que o teleport ira sumir em minutos msg_open = "O portal do BOSS DIVINE BRONZE estara aberto durante 2 minutos. Corra para derrota-lo.", msg_teste = "O portal do BOSS DIVINE BRONZE estara aberto durante 2 minutos. Corra para derrota-lo.", msg_close = "O portal do BOSS DIVINE BRONZE se fechou.", color = 27 } local function DelTp() local t = getTileItemById(config.pos, 1387) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(config.pos, CONST_ME_POFF) end end function onTime() --if (os.date("%A") == config.day) then doCreateTeleport(1387, config.topos, config.pos) doBroadcastMessage(config.msg_open) doBroadcastMessage(config.msg_teste, config.color) addEvent(DelTp, config.time*60*1000) addEvent(doBroadcastMessage, config.time*60*1000, config.msg_close) --end return true end
  13. Da uma testada aí local combats, conditions = {}, {} for i=20,70 do combats[i] = createCombatObject() setCombatParam(combats[i], COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT) setCombatParam(combats[i], COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY) end for i=20,70 do conditions[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditions[i], CONDITION_PARAM_TICKS,10000) setConditionParam(conditions[i],CONDITION_PARAM_STAT_MAGICLEVELPERCENT, i) setCombatCondition(combats[i], conditions[i]) end local area = createCombatArea(AREA_CIRCLE2X2) setCombatArea(combats[i], area) function onCastSpell(cid, var) local random = math.random(20,70) return doCombat(cid, combats[random], var) end
  14. local config = { -- [bless] = preços [5] = {"Blessing", 500000} } 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 for k, v in pairs(config) do if v[1]:lower():find(msg:lower()) then selfSay("You are sure?", cid) talkState[talkUser] = k end if msgcontains(msg:lower(), "yes") then if talkState[talkUser] == k then if getPlayerPremiumDays(cid) > 0 then if not getPlayerBlessing(cid, k) then if doPlayerRemoveMoney(cid, v[2]) then doPlayerAddBlessing(cid, k) selfSay("You received the bless " .. v[1]:gsub("The ", "", 1) .. "!", cid) doSendMagicEffect(getThingPos(cid), 10) else selfSay("You no have money.", cid) end else selfSay("You have " .. v[1] .. ".", cid) end else selfSay("You do not have premmium account.", cid) end talkState[talkUser] = 0 end end end if msgcontains(msg:lower(), "no") and talkState[talkUser] >= 1 then selfSay("Bye!!", cid) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  15. Zanrix postou uma resposta no tópico em Suporte Tibia OTServer
    Sim, tem que ter. Esse script vai funcionar se o servidor tiver suporte a essa tag no items.xml: <attribute key="dualwield" value="1"/>
  16. Zanrix postou uma resposta no tópico em Suporte Tibia OTServer
    Testa aí amigo, fiz rapidinho no xxxx tu coloca o id do item/pedra que vai ser usado actions.xml <action itemid="xxxx" event="script" value="pedraDual.lua"/> actions/scripts/pedraDual.lua local function isWeapon(uid) uid = uid or 0 local f = getItemWeaponType(uid) if f == 1 or f == 2 or f == 3 then return true end return false end function onUse(cid, item, fromPosition, itemEx, toPosition) if item.uid == 0 or item.itemid == 0 then return false end if isCreature(itemEx.uid) == TRUE then return false end if isWeapon(itemEx.uid) then if math.random(1,100) < 15 then doItemSetAttribute(itemEx.uid, 'dualwield', true) doPlayerSendCancel(cid, "Item encantado com sucesso!") else doPlayerSendCancel(cid, "Sua pedra quebrou ao tentar encantar o item.") end doRemoveItem(item.uid) else doPlayerSendCancel(cid, "Use a pedra em alguma arma.") end return true end
  17. Zanrix postou uma resposta no tópico em Suporte Tibia OTServer
    Ta igualzinho amigo, não faz sentido estar dando slow Aqui funcionou certinho
  18. Zanrix postou uma resposta no tópico em Suporte Tibia OTServer
    Ué eu me baseei nas magias que já existem de dar speed.. Talvez seja sua versão.. Posta um script de speed do seu server, tipo utani gran hur ou algo do tipo
  19. Zanrix postou uma resposta no tópico em Suporte Tibia OTServer
    Pra aumentar o speed é aqui setConditionFormula(condition, 0.9, -140, 0.9, -140) Aumenta esses dois 140 E como assim dar um effect? Ta dando um brilho azul já nele, não? Ou seria quando acaba a magia?
  20. Zanrix postou uma resposta no tópico em Suporte Tibia OTServer
    spells.xml <instant name="Super Charge" words="utani super hur" lvl="50" mana="0" prem="0" aggressive="0" selftarget="1" exhaustion="40000" groups="3,2000" icon="131" needlearn="0" event="script" value="super charge.lua"> <vocation id="4"/> </instant> spells/scripts/super charge.lua local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_HASTE) setConditionParam(condition, CONDITION_PARAM_TICKS, 40000) setConditionFormula(condition, 0.9, -140, 0.9, -140) setCombatCondition(combat, condition) local function onCastSpell1(parameters) if isCreature(parameters.cid) then doPlayerAddMana(parameters.cid, -getPlayerMana(parameters.cid)) doCreatureAddHealth(parameters.cid, -(getCreatureHealth(parameters.cid)*0.5)) end end function onCastSpell(cid, var) local parameters = { cid = cid, var = var } addEvent(onCastSpell1, 40000, parameters) return doCombat(cid, combat, var) end
  21. Zanrix postou uma resposta no tópico em Suporte Tibia OTServer
    Como seria essa stone? Você da 'use with' com a pedra no item e ele se transforma? Ou você aperta na pedra e todos itens de Event são transformados? Ou...? Qual ID da pedra? E quais IDs dos itens Event?
  22. Zanrix postou uma resposta no tópico em Suporte Tibia OTServer
    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 npcHandler:setMessage(MESSAGE_GREET, "Oi |PLAYERNAME|. Eu posso {trocar} item.") function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, "troca") then selfSay("Troco 50 brown piece of cloth e 200 gold por uma jacket, aceita?", cid) talkState[talkUser] = 1 elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then if getPlayerItemCount(cid, 5913) >= 50 and getPlayerMoney(cid) >= 200 then doPlayerRemoveItem(cid, 5913, 50) -- brown piece of cloth doPlayerRemoveMoney(cid, 200) doPlayerAddItem(cid, 2650) -- jacket else selfSay("Volte quando tiver os itens.", cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  23. Simples assim: local posZ = getCreaturePosition(cid).z
  24. function onUse(cid, item, fromPosition, itemEx, toPosition) local player = Player(cid) if player:getStorageValue (Storage.Chest) == -1 then player:setStorageValue(Storage.Chest, 1) player:addItem(2160, 1 * getPlayerLevel(cid)) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You've your reward.") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The chest is empty.") end return true end

Informação Importante

Confirmação de Termo