Ir para conteúdo

totonho18

Campones
  • Total de itens

    60
  • Registro em

  • Última visita

  • Dias Ganhos

    2

Posts postados por totonho18

  1. Como Totonho disse, script bem simples. Erro, só se instalar errado, testei aqui tb pra qalquer coisa e funfou...

     

    Rep+ Totonho, pela atenção com os membros e por ter o rpgbrasil como otserv preferido .. ausheuashueas

    vlw amigão, estou as ordens :)

  2. Já sei, no meu ot rodou sem problemas, então só pode ser uma coisa!!!

     

    o seu distro não está reconhecendo o formato do arquivo, então abre o arquivo como bloco de notas, ai você vai lá no canto superior esquerdo e clica em arquivo/salvar como ai lá em baixo do lado de salvar vai estar escrito codificação, ai você altera a codificação, se tiver ansi vc passa pra UTF -8 , e se tiver UTF-8 vc passa pra ansi, e salva

     

    ai tem que dar certo, se persistir no erro, provavelmente é seu distro que está ultrapassado e não está reconhecendo o comando stamina, eu testei esse código mano, e é um código muito simples, não faz sentido dar esse tipo de erro.

     

    Me mantém informado, a gente vai resolver isso e qual a versão do seu ot?

  3. Tendi, pode ser porque a potion está no chão, coloca a potion dentro da bp do jogador, ele tem que usar a potion de dentro da sua bp.

     

    testei aqui e deu certo amigo, se der errado me fala que ai vou analisar isso do zero e procurar a falha.


    Mano não tem como dar errado, é um script muito simples. Siga o tutorial exatamente como está.

     

    Primeiro passo -> copie um arquivo da pasta data/actions/scripts e renomeie para stamina.lua, agora abra-o, apague tudo que tem dentro e coloque esse código no lugar

    --Stamina Potion System--
    --Autor: Totonho 18 --
    function onUse(cid, item, frompos, item2, topos)
    
    	local Item = 7489 -- ID do item que será retirado
    	
    	if getPlayerItemCount(cid,Item) >= 1 then
    		doPlayerAddStamina(cid, 2520) 
    		doSendMagicEffect(frompos, 14) 
    		doPlayerRemoveItem(cid,Item,1)
    	end
    
    return true
    
    end
    

    feito isso salve e feche, agora no xml da pasta data/actions/actions.xml coloque essa tag

    <action itemid="7489" script="stamina.lua"/>
    

    Salve e feche, TEM QUE FUNCIONAR.

     

    POSSIVEIS ERROS -> PRESTE ATENÇÃO

     

    O script dará errado se;

    1 - Se a potion não estiver na bp do jogador

    2 - Se o item id que você usou como potion já estiver em uso em outro script

    3 - Se o distro não estiver reconhecendo o formato do arquivo

    4 - Se você instalou errado, na pasta errada, ou copiou com algum simbolo faltando, etc..

     

    Se der algum erro, olhe essas 4 possibilidades e diga em qual delas o erro se enquadra, qualquer duvida manda aqui!

  4. Ué não achou? é um script bem simples. está ai

    function onUse(cid, item, frompos, item2, topos)
        doPlayerAddStamina(cid, 2520) 
        doSendMagicEffect(getPlayerPosition(cid), 14) 
        doRemoveItem(item.uid, 1) 
    return true
    end
    

    ai lá no xml da action vc coloca isso

    <action itemid="ITEMID" event="script" value="NomeDoArquivo"/>
    

    no ITEMID é só você colocar o id do item que você quer

     

    É isso mesmo? qualquer duvida manda aqui

  5. Perunta 1 -> como colocar essa equação no dano da minha spell?

    function onGetFormulaValues(cid, level, weaponSkill, weaponAttack, factor)
    	damage_min = (weaponSkill * weaponAttack / 27 + level) * 1
        damage_max = (weaponSkill * weaponAttack / 27 + level) * 1.1
    	
    	return - math.max(damage_min, damage_max), - math.min(damage_min, damage_max)
    end
    

    OBS A SPELL DA OITO DANOS, tem que colocar essa equação em TODOS os oito danos da spell, ela está aqui:

    
    
    local combat1 = createCombatObject()
    local combat2 = createCombatObject()
    local combat3 = createCombatObject()
    local combat4 = createCombatObject()
    local combat5 = createCombatObject()
    local combat6 = createCombatObject()
    local combat7 = createCombatObject()
    local combat8 = createCombatObject()
    
    local combat1 = createCombatObject()
    setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatParam(combat1, COMBAT_PARAM_EFFECT, 2)
    setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -7.5, -50, -7.8, 0)
    
    local combat2 = createCombatObject()
    setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatParam(combat2, COMBAT_PARAM_EFFECT, 2)
    setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -7.5, -50, -7.8, 0)
    
    local combat3 = createCombatObject()
    setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatParam(combat3, COMBAT_PARAM_EFFECT, 2)
    setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -7.5, -50, -7.8, 0)
    
    local combat4 = createCombatObject()
    setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatParam(combat4, COMBAT_PARAM_EFFECT, 2)
    setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -7.5, -50, -7.8, 0)
    
    local combat5 = createCombatObject()
    setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatParam(combat5, COMBAT_PARAM_EFFECT, 2)
    setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, -7.5, -50, -7.8, 0)
    
    local combat6 = createCombatObject()
    setCombatParam(combat6, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatParam(combat6, COMBAT_PARAM_EFFECT, 2)
    setCombatFormula(combat6, COMBAT_FORMULA_LEVELMAGIC, -7.5, -50, -7.8, 0)
    
    local combat7 = createCombatObject()
    setCombatParam(combat7, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatParam(combat7, COMBAT_PARAM_EFFECT, 2)
    setCombatFormula(combat7, COMBAT_FORMULA_LEVELMAGIC, -7.5, -50, -7.8, 0)
    
    local combat8 = createCombatObject()
    setCombatParam(combat8, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatParam(combat8, COMBAT_PARAM_EFFECT, 2)
    setCombatFormula(combat8, COMBAT_FORMULA_LEVELMAGIC, -7.5, -50, -7.8, 0)
    
    
    arr1 = {
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    }
    
    arr2 = {
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    }
    
    arr3 = {
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    }
    
    arr4 = {
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    }
    
    
    arr5 = {
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    }
    
    
    arr6 = {
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    }
    
    
    arr7 = {
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    }
    
    
    arr8 = {
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    }
    
    
    local area1 = createCombatArea(arr1)
    local area2 = createCombatArea(arr2)
    local area3 = createCombatArea(arr3)
    local area4 = createCombatArea(arr4)
    local area5 = createCombatArea(arr5)
    local area6 = createCombatArea(arr6)
    local area7 = createCombatArea(arr7)
    local area8 = createCombatArea(arr8)
    setCombatArea(combat1, area1)
    setCombatArea(combat2, area2)
    setCombatArea(combat3, area3)
    setCombatArea(combat4, area4)
    setCombatArea(combat5, area5)
    setCombatArea(combat6, area6)
    setCombatArea(combat7, area7)
    setCombatArea(combat8, area8)
    
    local function onCastSpell1(parameters)
    doCombat(parameters.cid, parameters.combat1, parameters.var)
    end
    
    local function onCastSpell2(parameters)
    doCombat(parameters.cid, parameters.combat2, parameters.var)
    end
    
    local function onCastSpell3(parameters)
    doCombat(parameters.cid, parameters.combat3, parameters.var)
    end
    
    local function onCastSpell4(parameters)
    doCombat(parameters.cid, parameters.combat4, parameters.var)
    end
    
    local function onCastSpell5(parameters)
    doCombat(parameters.cid, parameters.combat5, parameters.var)
    end
    
    local function onCastSpell6(parameters)
    doCombat(parameters.cid, parameters.combat6, parameters.var)
    end
    
    local function onCastSpell7(parameters)
    doCombat(parameters.cid, parameters.combat7, parameters.var)
    end
    
    local function onCastSpell8(parameters)
    doCombat(parameters.cid, parameters.combat8, parameters.var)
    end
    
    
    function onCastSpell(cid, var) 
    local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3, combat4 = combat4, combat5 = combat5, combat6 = combat6, combat7 = combat7, combat8 = combat8 }
    addEvent(onCastSpell1, 1, parameters) 
    addEvent(onCastSpell2, 1000, parameters) 
    addEvent(onCastSpell3, 2000, parameters) 
    addEvent(onCastSpell4, 3000, parameters) 
    addEvent(onCastSpell5, 4000, parameters) 
    addEvent(onCastSpell6, 5000, parameters) 
    addEvent(onCastSpell7, 6000, parameters) 
    addEvent(onCastSpell8, 7000, parameters) 
    return true
    end
    

    Perunta 2 -> Magias de área no meu server estão pegando a animação delas em protect zone e atravessando paredes, tem como programar pra spell não atravessar paredes e não entrar em pz? tipo um blockwalls??

  6. Desculpa é que esqueci de mandar o registro:

     

    tenta além do script que te passei usar esse aqui,

     

    creaturescript

    function onLogin(cid)
            local temple = { x =160, y = 51, z = 7}
            if vip.hasVip(cid) == true then
                    if getPlayerStorageValue(cid,55555) ~= 1 then
                            setPlayerStorageValue(cid,55555,1)
                    end
            else
                    if getPlayerStorageValue(cid,55555) == 1 then
                            doTeleportThing(cid, temple)
                            doPlayerSendTextMessage(cid, 22, "Your VIP Time over!")
                            db.query("UPDATE `accounts` SET `vip_time` = 0 WHERE `id` = ".. getAccountIdByName(getPlayerName(cid)) ..";")
                            setPlayerPromotionLevel(cid, 1)
                            setPlayerStorageValue(cid, 55555, 0)
                    end
            end
            return true
    end
    

    tag do login

    registerCreatureEvent(cid, "FimVip")
    

    tag do xml

     

    <event type="login" name="FimVip" event="script" value="vip2.lua"/>
    
    tem mais, coloca mais essa aqui;
    function onLogin(cid)
    registerCreatureEvent(cid, "Exp_P")
    if getPlayerStorageValue(cid, death_tabble.check) >= 1 then
    setPlayerStorageValue(cid, death_tabble.after_exp, getPlayerExperience(cid))
    setPlayerStorageValue(cid, death_tabble.check, -1)
    end
    return true
    end
    function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
    setPlayerStorageValue(cid, death_tabble.before_exp, getPlayerExperience(cid))
    setPlayerStorageValue(cid, death_tabble.check, 1)
    return TRUE
    end
    

    xml

    
    <event type="preparedeath" name="Exp_P" event="script" value="vipname.lua"/>
    

    acho q agora vai dar, caso persista no erro avisa aqui, ai deve ter q fazer algo na lib

     

  7. Seria algo assim?

    function onSay(cid, words, param)
    
    
    access = 3 -- não mude
    days = 30 -- quantidade de dias
    
    
    player = getPlayerByName(param)
    daysvalue = days*3600*24
    storageplayer = getPlayerStorageValue(player,13540)
    timenow = os.time()
    if storageplayer == -1 or storageplayer == 0 then
    time = timenow+daysvalue
    else
    time = storageplayer+daysvalue
    end
    
    
    if param ~= "" then
    if getPlayerGroupId(cid) >= access then
    doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.")
    setPlayerStorageValue(player,13540,time)
    quantity = math.floor((getPlayerStorageValue(player,13540) - timenow)/(3600*24))
    doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")
    else
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Somente jogadores com acesso maior que "..access.." podem adicionar vips.")
    end
    
    end
    
    end
    

    xml

    <talkaction log="yes" words="/vip" access="5" event="script" value="vip/addvipp.lua" />
    
  8. É simples, abra a pasta data/actions/scripts/liquids e abra o arquivo potions.lua ou apenas potions, provavalmenta estará escrito apenas potions, dê um Ctrl+f e digite doCreatureSay(itemEx.uid, "Aaaah..." ou pesquise apenas "Aaaah" Voce chegará em uma linha onde a expressão Aaaah estará escrito, agora apague essa linha e substitua pela linha que citei abaixo:

    doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
    

    Salve e de reload, isso resolverá o problema, qualquer duvida manda msg!

     

    OBS --> É provavel que a tática acima resolva o problema, maaas se por acaso der alguma zebra, vc vai ter que fazer o seguinte, nesse caso dentro dessa mesma pasta liquids você vai ter que abrir os arquivos das potions uma por uma e editar separadamente todas elas, great_mana,strong_mana,etc.A edição parte do mesmo pré suposto do caso acima, vc procura a frase Aaaah dentro do código e apaga toda a linha que tem essa frase e subistitua pela tag que mostrei acima --> doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)

     

    Ajudei? REP+

     

     

  9. É um script de quest feito 100% por mim

     

    O que ela retorna?

     

    Essa quest simplesmente te fornece um conjunto de itens dentro de uma bag, itens básicos, porém os itens recebidos da quest são diferentes para cada vocação, e detalhe, ela fornece uma sword ou um axe ou um club para o jogador caso ele seja knight, o tipo da arma dependerá do skill do mesmo, se seu maior skill for axe, ele receberá um machado, e o maior skill for club ele recebe uma clava e se o maior for sword ele recebe uma espada, é um sistema de fácil configuração e acredito que pode ser útil de alguma forma principalmente aos programadores iniciantes.

     

    Implementação;

     

    Abra a pasta data/actions/scripts -> copie e cole um arquivo qualquer e o renomeie para recompensa.lua

     

    Apague tudo que tiver dentro e cole o seguinte código:

    function onUse(cid, item, frompos, item2, topos)
    	
    	--A Configuração abaixo
    	local config = {
    		level_min = 20, -- level mínimo
    		Premium = true, -- Necessita P.A? true para sim ou false para não
    		Club  =  7381,  -- id da clava caso o suposto knight tenha skill club superior
    		Sword =  7385, -- id da espada caso o suposto knight tenha skill sword superior
    		Axe   =  2435 -- id da machado caso o suposto knight tenha skill axe superior
    	}
    	-- Fim da config OBS Configure dessa linha pra baixo se e somente se souber o que está fazendo
    	
    	local SkillClub  = getPlayerSkillLevel(cid, 1)
    	local SkillSword = getPlayerSkillLevel(cid, 2)
    	local SkillAxe   = getPlayerSkillLevel(cid, 3)
    	local level = getPlayerLevel(cid)
    	local Voc = getPlayerVocation(cid)
    	local QuestStatus = getPlayerStorageValue(cid,13139)
    	
    	if config.Premium and not isPremium(cid) then
    		doPlayerSendTextMessage(cid,29,"Apenas para jogadores premium accounts")
    		return 0
    	end
    	
    
    	if Voc == 4 or Voc == 8 then
    	  if level >= config.level_min then
    		if QuestStatus == -1 then
    					if (SkillClub > SkillSword) and (SkillClub > SkillAxe) then
    							doPlayerAddItem(cid,config.Club,1)
    						elseif (SkillSword > SkillClub) and (SkillSword > SkillAxe) then
    							doPlayerAddItem(cid,config.Sword,1)
    						elseif (SkillAxe > SkillClub) and (SkillAxe > SkillSword) then
    							doPlayerAddItem(cid,config.Axe,1)
    					end
    				local bag = doPlayerAddItem(cid,3939,1)	
    				doPlayerSendTextMessage(cid,29,"Voce recebeu alguns itens uteis")	
    				doAddContainerItem(bag, 2152, 50)
    				doAddContainerItem(bag, 2647, 1)
    				doAddContainerItem(bag, 2463, 1)
    				doAddContainerItem(bag, 2457, 1)
    				doAddContainerItem(bag, 2661, 1)
    				doAddContainerItem(bag, 2525, 1)
    				setPlayerStorageValue(cid,13139,1)
    			else
    				return doPlayerSendTextMessage(cid,29,"Vazio")
    		end
    		else
    			doPlayerSendTextMessage(cid,29,"Only Level "..config.level_min.."+")
    	  end	
    	elseif Voc == 3 or Voc == 7 then
    			if level >= config.level_min then
    				if QuestStatus == -1 then
    					local bag = doPlayerAddItem(cid,3939,1)	
    					doPlayerSendTextMessage(cid,29,"Voce recebeu alguns itens uteis")
    					doAddContainerItem(bag, 2152, 50)
    					doAddContainerItem(bag, 2647, 1)
    					doAddContainerItem(bag, 8872, 1)
    					doAddContainerItem(bag, 2457, 1)
    					doAddContainerItem(bag, 2661, 1)
    					doAddContainerItem(bag, 2525, 1)
    					doAddContainerItem(bag, 7438, 1)
    					setPlayerStorageValue(cid,13139,1)	
    				else
    					return doPlayerSendTextMessage(cid,29,"Vazio")
    				end	
    			else
    				doPlayerSendTextMessage(cid,29,"Only Level "..config.level_min.."+")
    			end	
    	elseif Voc == 1 or Voc == 5 then
    			if level >= config.level_min then
    				if QuestStatus == -1 then
    					local bag = doPlayerAddItem(cid,3939,1)	
    					doPlayerSendTextMessage(cid,29,"Voce recebeu alguns itens uteis")
    					doAddContainerItem(bag, 2152, 50)
    					doAddContainerItem(bag, 2323, 1)
    					doAddContainerItem(bag, 2188, 1)
    					doAddContainerItem(bag, 2647, 1)
    					doAddContainerItem(bag, 8892, 1)
    					doAddContainerItem(bag, 2525, 1)
    					doAddContainerItem(bag, 2661, 1)
    					setPlayerStorageValue(cid,13139,1)	
    				else
    					return doPlayerSendTextMessage(cid,29,"Vazio")
    				end	
    			else
    				doPlayerSendTextMessage(cid,29,"Only Level "..config.level_min.."+")
    			end
    	elseif Voc == 2 or Voc == 6 then 
    			if level >= config.level_min then
    				if QuestStatus == -1 then
    					local bag = doPlayerAddItem(cid,3939,1)	
    					doPlayerSendTextMessage(cid,29,"Voce recebeu alguns itens uteis")
    					doAddContainerItem(bag, 2152, 50)
    					doAddContainerItem(bag, 2323, 1)
    					doAddContainerItem(bag, 2185, 1)
    					doAddContainerItem(bag, 2647, 1)
    					doAddContainerItem(bag, 8892, 1)
    					doAddContainerItem(bag, 2525, 1)
    					doAddContainerItem(bag, 2661, 1)
    					setPlayerStorageValue(cid,13139,1)	
    				else
    					return doPlayerSendTextMessage(cid,29,"Vazio")
    				end	
    			else
    				doPlayerSendTextMessage(cid,29,"Only Level "..config.level_min.."+")
    			end			
    	end
    
    	return true
    end
    
    

    feito isso salve e feche o arquivo.

     

    Agora vá na pasta data/actions/actions.xml e cole a seguinte tag abaixo:

    <action uniqueid="7111" script ="recompensa.lua" />
    

    Feito isso basta abrir seu map editor e colocar o unique id no local onde o player vai clicar pra fazer a quest, seja lá o que for, um baú, uma estátua, uma parede,etc.

     

    Gostou? REP+

     

    Analíse, critique, elogie, comente, me ajude a crescer.

     

    By Totonho 18, autor do código :smile_positivo:

  10. Ai é que está o mistério amigo, não há erro nenhum no distro, o sistema não acusa nada fora do normal, o script simplesmente por alguma razão que desconheço não consegue armazenar itens na lista.

     

    To esperando alguém que tenha um ot 9.60 ou mais e que tenha um sistema de auto loot funcional pra me orientar, você não tem ideia do que pode estar acontecendo não?

  11. Procurei procurei e procurei e nada encontrei, preciso de um sistema de autoloot pro meu server, até achei vários sistemas diferentes mas por alguma razão nenhum funcionou no ot, a versão é 9.60, alguém consegue implementar um que funcione? ou me recomendar algum sei lá, desde já agradeço.

     

    Encontrei esse sistema aqui, que QUASE funcionou mas não deu certo tb, o erro que deu nele é na hora de add o item, simplesmente diz que o item não existe.

     

    o link do tópico que quase funcionou é esse se quiserem olhar -> http://www.xtibia.com/forum/topic/234430-sistema-autoloot/

  12. Cara sensacional, ficou perfeito, aprovado, você é o cara, valeu mesmo, REP+ e pode deixxar que vou estudar seu tutorial agora mesmo.

    Ultima pergunta, tem como fazer essa mesma magia porém em estilo meteoro? ou seja a animação "cai do ceu", aplicando o estilo aleatório?

  13. Ta estranho, olha só o tamanho da área da magia, e quando o player usa, não aparece animação nenhuma, só da o dano sem a animação, OBS é uma magia de área tipo um exevo gran mas flam, porém a ideia dessa magia é um monte de assassin stars saírem do corpo do usuário e se espalharem pela área, para vcs terem uma noção exata do que quero que aconteça é spo pegar o God do server de vocês e escrever o comando /x 18 vcs notarão que sairá um monte de assassins dele, ESSA É A IDEIA DESSA MAGIA,mas isso não está acontecendo, alguém por favor pode me ajudar a desvendar esse mistério??? REP+

    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
    setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_REDSTAR)
    
    function onGetFormulaValues(cid, level, Skill, factor)
    damage_min = (Skill * 6 + level * 1.5) * 1
        damage_max = (Skill * 6 + level * 1.5) * 1.2
    
    return - math.max(damage_min, damage_max), - math.min(damage_min, damage_max)
    end
    
    combat_arr = {
    {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0,},
    {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0,},
    {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,},
    {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,},
    {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,},
    {1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1,},
    {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,},
    {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,},
    {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,},
    {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0,},
    {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0,},
    }
    
    local combat_area = createCombatArea(combat_arr)
    setCombatArea(combat, combat_area)
    
    setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
    function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
    end 

    Dica uma coisa que talvez funcione é criar um evento por fora que gere a animação, pois o dano já funciona certo, só a animação que não aparece, pessoal me ajudem se puder to precisando muito desse script :/ REP+

    l
  14. Ta ótimo, REP+ pros dois, achei interessante a função addEvent, eu já tinha visto muitas vezes mas não sabia a real função dela, essa função serve pra fazer callbacks de outras? outra coisa, eu posso colocar mais callbacks nela? Ex

    addEvent(function()
       if isCreature(cid) then
    	  doPlayerSendTextMessage(cid, 29, "Voce foi teleportado com sucesso!")
          doTeleportThing(cid, townpos)
          doSendMagicEffect(getPlayerPosition(cid), 10)
       end
    end, pausa * 1000, cid, townpos,call4,call5........,calln) -- é permitido essa sintaxe?
    

    obs usei call como uma chamada de instrução, e pode ela er qualquer comando

  15. É o seguinte, eu consegui sem problemas criar um código que teletransporta o player pro templo de sua cidade se ele não tiver com batlle, porém o tp é instantâneo, como eu faria pra add uma pausa nesse código? ou seja, pra ele levar x segundos antes de teleportar. Desde já agradeço, REP+

    Eis o código

    function onSay(cid, words, param, channel)
    	
    local pos = getPlayerTown(cid)
    local fight = hasCondition(cid, CONDITION_INFIGHT)
    local townpos = getTownTemplePosition(pos)
    
    if fight == false then
    	doPlayerSendTextMessage(cid, 29, "Voce foi teleportado com sucesso!")
    	doTeleportThing(cid, townpos)
    	doSendMagicEffect(getPlayerPosition(cid), 10)
    	else	
    		doPlayerSendTextMessage(cid, 29, "Espere o battle sair")	
    		doSendMagicEffect(getPlayerPosition(cid), 2)		
    end
    
    	return true
    end
    
    

    É isso ai, me ajudem ai, sou programador clássico, mas to aprendendo a programar em lua agora, as vezes me perco um pouco! Abração...

  16. Antes de mais nada quero deixar claro q os Créditos são 100% Meus!

     

    Introdução:

    Você por exemplo é um elite knight High LVL e vai ao npc,compra umas 2000 mana potions e sai MUITO bem equipado para ficar horas na hunt,e conseguir boa exp e lucros,mas quando vc volta,sua bp esta LOTADA de vials vazios das potions,e vc n sabe oq fazer com todos esses milhares de vials???

    Seus problemas acabaram,com essa função você você pode clicar em uma estatua estrategicamente posicionada e dar um simples use nela,apartir do momento q vc executa essa ação,TODOS OS SEUS VIALS serão vendidos ao mesmo tempo,esvaziando sua bp na mesma HORA!

     

    OBS:essa função é programada para vender até 1000 vials de uma só vez,se tiver mais de 1000 é só dar um click duplo,ex vamos supor q vc tenha 3000 vials,vc clica 3x e vende instantaneamente todos os 3000 vials.

     

    Outra OBS:a função é programada para vender TODOS os tipos de vials,n apenas mana potions,mas strongs,greats e etc,cada um com um diferente preço

     

    -------------------------Fim da Explicação-------------------------

     

    Abra a pasta data/actions/scripts e crie um arquivo.lua com o nome "sellvials.lua" e cole a função

    function onUse(cid, item, fromPosition, item2, toPosition)
    if getPlayerItemCount(cid,7636) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7636, 100)
    		doPlayerAddItem(cid, 2152, 10)
            end
    		if getPlayerItemCount(cid,7636) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7636, 100)
    		doPlayerAddItem(cid, 2152, 10)
            end
    		if getPlayerItemCount(cid,7636) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7636, 100)
    		doPlayerAddItem(cid, 2152, 10)
            end
    		if getPlayerItemCount(cid,7636) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7636, 100)
    		doPlayerAddItem(cid, 2152, 10)
            end
    		if getPlayerItemCount(cid,7636) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7636, 100)
    		doPlayerAddItem(cid, 2152, 10)
            end
    		if getPlayerItemCount(cid,7636) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7636, 100)
    		doPlayerAddItem(cid, 2152, 10)
            end
    		if getPlayerItemCount(cid,7636) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7636, 100)
    		doPlayerAddItem(cid, 2152, 10)
            end
    		if getPlayerItemCount(cid,7636) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7636, 100)
    		doPlayerAddItem(cid, 2152, 10)
            end
    		if getPlayerItemCount(cid,7636) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7636, 100)
    		doPlayerAddItem(cid, 2152, 10)
            end
    		if getPlayerItemCount(cid,7636) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7636, 100)
    		doPlayerAddItem(cid, 2152, 10)
            end
    		-------------- Empty Mana Potion,Health potion ou Small health potion compra no minimo 100 e no maximo 1000! de uma vez só
    if getPlayerItemCount(cid,7634) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7634, 100)
    		doPlayerAddItem(cid, 2152, 20)
            end
    		if getPlayerItemCount(cid,7634) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7634, 100)
    		doPlayerAddItem(cid, 2152, 20)
            end
    		if getPlayerItemCount(cid,7634) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7634, 100)
    		doPlayerAddItem(cid, 2152, 20)
            end
    		if getPlayerItemCount(cid,7634) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7634, 100)
    		doPlayerAddItem(cid, 2152, 20)
            end
    		if getPlayerItemCount(cid,7634) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7634, 100)
    		doPlayerAddItem(cid, 2152, 20)
            end
    		if getPlayerItemCount(cid,7634) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7634, 100)
    		doPlayerAddItem(cid, 2152, 20)
            end
    		if getPlayerItemCount(cid,7634) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7634, 100)
    		doPlayerAddItem(cid, 2152, 20)
            end
    		if getPlayerItemCount(cid,7634) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7634, 100)
    		doPlayerAddItem(cid, 2152, 20)
            end
    		if getPlayerItemCount(cid,7634) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7634, 100)
    		doPlayerAddItem(cid, 2152, 20)
            end
    		if getPlayerItemCount(cid,7634) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7634, 100)
    		doPlayerAddItem(cid, 2152, 20)
            end
    		------------------------------------------------- mesmo esquema de cima porém aqui é com Strong health ou strong mana
    if getPlayerItemCount(cid,7635) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7635, 100)
    		doPlayerAddItem(cid, 2152, 35)
            end	
    if getPlayerItemCount(cid,7635) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7635, 100)
    		doPlayerAddItem(cid, 2152, 35)
            end	
    if getPlayerItemCount(cid,7635) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7635, 100)
    		doPlayerAddItem(cid, 2152, 35)
            end	
    if getPlayerItemCount(cid,7635) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7635, 100)
    		doPlayerAddItem(cid, 2152, 35)
            end	
    if getPlayerItemCount(cid,7635) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7635, 100)
    		doPlayerAddItem(cid, 2152, 35)
            end	
    if getPlayerItemCount(cid,7635) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7635, 100)
    		doPlayerAddItem(cid, 2152, 35)
            end	
    if getPlayerItemCount(cid,7635) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7635, 100)
    		doPlayerAddItem(cid, 2152, 35)
            end	
    if getPlayerItemCount(cid,7635) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7635, 100)
    		doPlayerAddItem(cid, 2152, 35)
            end	
    if getPlayerItemCount(cid,7635) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7635, 100)
    		doPlayerAddItem(cid, 2152, 35)
            end	
    if getPlayerItemCount(cid,7635) >= 100 then
            doSendMagicEffect(getPlayerPosition(cid), 2)
            doPlayerRemoveItem(cid, 7635, 100)
    		doPlayerAddItem(cid, 2152, 35)
            end	
    ------------------------------------------------------ mesmo esquema só que para Great mana,great health ou ultimate health
    end
    
    

    feito isso vá no arquivo xml da pasta data/actions/actions.xml e cole a tag

    <action actionid="5141" script="sellvial" />
    

    coloque essa action em uma estatua ou pedra,ai quando o jogador clicar nela vai acontecer oq foi explicado.

    Abraços ai mais uma função exclusivamente minha!

  17. Slicer sua ideia seria perfeita pra mim,porém meu server não é open source,ai já descarta essa possibilidade,agora a ideia do creaturescript seria legal,até acho q eu seria capaz de criar um script assim,mas creio q teria q criar um script pra cada monster,aí é trabalho demais. Mas valeu então não vai ter solução,pode fechar o tópico e obrigado!

     

    Slicer disse!

    dai eh soh saber oq ta fazendo ^^ -ps: o loot maximo eh de 100 [std::min(100, intValue)]... em tese, n adianta tu botar 143 o.O-

     

    funciona colocar + de 100 unidades sim amigão,nos ots mais novos pelo menos eu tenho certeza q da,a partir do 9.10 todos os servers q controlo já são capazes de usar esse artifício porém tem o jeito certo de usar!

    <item id="2148" countmax="955" chance="100000"/> -- ERRADO! DESSE JEITO N FUNCIONA
    <item id="2148" count="955" chance="100000"/> -- CORRETO,assim funciona é só tirar o "max"

    Abraços! e vlw

  18. Quero colocar uma quantidade mínima no loot do monster.

    quando vou programar uso essa tag:

    <item id="2148" count="143" chance="100000"/>

    Traduzindo ela tem 100% de chance de dropar no mínimo 1 e no maximo 143 itens de natureza 2148!

     

    Eu quero programar o loot para dropar um quantidade mínima de itens.

    EXEMPLO que drope no mínimo 80 e no maxmo 143.

    Eu imagino q seria uma tag desse estilo,aqui \/ porém esse já testei,e n deu certo!!!

    <item id="2148" countmin="80" countmax="143"chance="100000"/>

    como faço pra programar a quantidade mínima de itens ao meu gosto?

    REP+

  • Quem Está Navegando   0 membros estão online

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