Ir para conteúdo

Janmix

Cavaleiro
  • Total de itens

    152
  • Registro em

  • Última visita

Histórico de Reputação

  1. Upvote
    Janmix deu reputação a dalvorsn em [Pedido] Por Para Magia Nao Atravesar Parede E Potion Por % De Hp.   
    esse if da callback da spell ta todo errado, ele ta comparando um numeral com uma função =s, enfim ta ai arrumado

    local config = { efeitoTele = 10, -- efeito q ira aparacer a cada teleport. efeitoDamage = 22, -- efeito q ira aparecer ao hitar no alvo hits = 5, -- quantos hits vai dar delay = 500, -- intervalo de tempo a cada hit min = 1000, -- dano minimo max = 3000, -- dano maximo damage = COMBAT_PHYSICALDAMAGE -- tipo do dano } function onGetFormulaValues(cid, level, skill, attack, factor) local skillTotal, levelTotal = skill + attack, level / 5 return -(skillTotal * 5.5 + levelTotal), -(skillTotal * 8.5 + levelTotal) end function isWalkable(pos, creature, pz, proj) -- nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and not pz then return false end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function getPosDirs(p, dir) -- mkalo return dir == 1 and {x=p.x-1, y=p.y, z=p.z} or dir == 2 and {x=p.x-1, y=p.y+1, z=p.z} or dir == 3 and {x=p.x, y=p.y+1, z=p.z} or dir == 4 and {x=p.x+1, y=p.y+1, z=p.z} or dir == 5 and {x=p.x+1, y=p.y, z=p.z} or dir == 6 and {x=p.x+1, y=p.y-1, z=p.z} or dir == 7 and {x=p.x, y=p.y-1, z=p.z} or dir == 8 and {x=p.x-1, y=p.y-1, z=p.z} end function validPos(pos) tb = {} for i = 1, 8 do newpos = getPosDirs(pos, i) if isWalkable(newpos) then table.insert(tb, newpos) end end table.insert(tb, pos) return tb end spell = { start = function (cid, target, markpos, hits) if not isCreature(cid) then return true end if not isCreature(target) or hits < 1 then doTeleportThing(cid, markpos) doSendMagicEffect(getThingPos(cid), config.efeitoTele) return true end posAv = validPos(getThingPos(target)) rand = #posAv == 1 and 1 or #posAv - 1 doSendMagicEffect(getThingPos(cid), config.efeitoTele) doTeleportThing(cid, posAv[math.random(1, rand)]) doAreaCombatHealth(cid, config.damage, getThingPos(target), 0, -config.min, -config.max, config.efeitoDamage) addEvent(spell.start, config.delay, cid, target, markpos, hits - 1) end } function onCastSpell(cid) target = getCreatureTarget(cid) if isCreature(target) then spell.start(cid, target, getThingPos(cid), config.hits) return true end return false end
  2. Upvote
    Janmix deu reputação a jhon992 em [Pedido] Aura Ou Raio [Urgente]   
    --[[ Spell by Shawak - Edited by Jhon992. Wolf transform ]]-- local time = 120 * 1000 -- 120 * 1000 = 2 min local addShielding = 20 -- how much shielding should be added local cooldown = 30 local effect = {32, 43, 23} -- efeitos ao usar spell, caso queira só 1 remova os outros, exemplo: local effect = {32} local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, 42) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, time) setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, addShielding) setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE) setCombatCondition(combat, condition) local speed = createConditionObject(CONDITION_HASTE) setConditionParam(speed, CONDITION_PARAM_TICKS, time) setConditionFormula(speed, 0.7, -56, 0.7, -56) setCombatCondition(combat, speed) function cooldownready(cid) if isPlayer(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Cooldown of Transform is ready!") end end function sendMagic(cid) if isPlayer(cid) then for i=1, #effect do doSendMagicEffect(getCreaturePosition(cid), effect[i]) end end end function onCastSpell(cid, var) if exhaustion.check(cid, 50001) == false then exhaustion.set(cid, 50001, cooldown) addEvent(cooldownready, cooldown*1000, cid) tempo = 0 while (tempo ~= time) do addEvent(sendMagic, tempo, cid) tempo = tempo + 2000 -- se quiser diminuir o intervalo do effect, diminui de 2000 para 1000. end return doCombat(cid, combat, var) else doPlayerSendCancel(cid, "Cooldown: [" ..exhaustion.get(cid, 50001).."] seconds.") end end
  3. Upvote
    Janmix deu reputação a LuckOake em [Pedido] Por Level Maximo Nas Magias.   
    Primeiro pedido:
     
    Só alterar isso no fim:
     

    function onCastSpell(cid, var) if getPlayerLevel(cid) <= 50 then return doCombat(cid, combat, var) else doPlayerSendCancel(cid, "Você só pode usar essa spell entre o level 20 e level 50.") return false end end
     
    PS: O level mínimo você configura na TAG na parte lvl="10"
     
    Exemplo de spell:
     
     
  4. Upvote
    Janmix deu reputação a bepokemon em [Pedido] Script Magia Ou Talkaction Para Controlar Um Bixo   
    Agora entendi oque você quis, HAHA. Aqui o código:

    function onCastSpell(cid, var) if #getCreatureSummons(cid) < 1 then return doConvinceCreature(cid, getCreatureTarget(cid)), TRUE else return doPlayerSendCancel(cid, 'You can\'t control more creatures.'), FALSE end end
  5. Upvote
    Janmix deu reputação a bepokemon em [Pedido] Script Magia Ou Talkaction Para Controlar Um Bixo   
    Script:

    function onCastSpell(cid, var) if getCreatureName(getCreatureTarget(cid)) == 'NomeDaCreature' then return doConvinceCreature(cid, getCreatureTarget(cid)), TRUE else return doPlayerSendCancel(cid, 'You can\'t control this creature.'), FALSE end end
     
    Tag:

    <instant name="" words="" lvl="" mana="" range="3" needtarget="1" blockwalls="1" exhaustion="2000" needlearn="0" event="script" value="script.lua"> <vocation id="1;2"/> </instant>
     
    Qualquer dúvida poste aqui mesmo para que possamos te ajudar.
  6. Upvote
    Janmix deu reputação a Vodkart em [Mod] Map Change 2.0   
    é um script que muda de mapa a cada X horas(ou minutos)
     
    Creditos: Vodkart e Demonbholder que me ajudo *-*
     
    na pasta mods crie um arquivo.xml e renomeie para
     
     
    ChangeMap.xml
     

    <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="ChangeMap" version="2.0" author="Vodkart" contact="none.com" enabled="yes"> <config name="map_func"><![CDATA[ info = { [0] = 1, [1] = 3, [2] = 4 } storage = 789520 ]]></config> <event type="login" name="Check Map" event="script"><![CDATA[ domodlib('map_func') function onLogin(cid) if getGlobalStorageValue(storage) == -1 then setGlobalStorageValue(storage, 0) end doTeleportThing(cid, getTownTemplePosition(info[getGlobalStorageValue(storage)])) return true end ]]></event> <globalevent name="ChangeMap" interval="3600" event="script"><![CDATA[ domodlib('map_func') function onThink(interval, lastExecution) doBroadcastMessage('The map will be changed again in 1 hour.') setGlobalStorageValue(storage, getGlobalStorageValue(storage) < #info and getGlobalStorageValue(storage)+1 or 0) for _, pid in ipairs(getPlayersOnline()) do doPlayerSetTown(pid, info[getGlobalStorageValue(storage)]) doRemoveConditions(pid, true) doCreatureAddHealth(pid, getCreatureMaxHealth(pid)) doCreatureAddMana(pid, getCreatureMaxMana(pid)) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) end return true end]]></globalevent> </mod>
     
    Explicação:
     
    No info é o id das town
    para adicionar mais mapas é só colocar uma virgula no último e adicionar o novo town_id
     

    [3] = 5, [4] = ??
     
    e o tempo você muda nessa parte interval="3600"
    no caso está para 1 hora
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...