Ir para conteúdo

Featured Replies

Postado

Olá pessoal!
Não vi nada nas regras da seção sobre um intervalo de tópicos, dúvidas ou algo do tipo.. Então como estou desenvolvendo um OT, necessitarei muito da ajuda de vocês do fórum, já que meus conhecimentos de script não vão muito além de HTML e CSS ;x


O usuário zipter98 me ajudou muito com um código para que, a mesma arma use diversas munições, segue aqui o código:

local ar1 = createCombatArea{
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 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},
}
 
function doPlayerShootBazooka(cid, target, times, delay, area, min, max, effect, dist_effect, exhaust, rounds)
    if rounds == nil then rounds = 1 end
    exhaustion.set(cid, 57193, exhaust)
    doSendDistanceShoot(getCreaturePosition(cid), getThingPos(target), dist_effect)
    doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, getThingPos(target), area, -min, -max, effect)
    if rounds == times then
        return true
    end
    addEvent(doPlayerShootBazooka, shots_delay, cid, target, times, delay, area, min, max, effect, dist_effect, exhaust, rounds+1)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local weapons = { -- [ID da arma] = {tiros, delay_dos_tiros, ammo, area, dano_min, dano_max, efeito, distance_effect, exhaustion},
        [2447] = {
            shots = 1,
            shots_delay = 50,
            area = ar1,
            exha = 5,
            ammo = {
                --Configure aqui as munições da arma.
                [11400] = {min = 25600, max = 35720, effect = 15, dist_effect = 8},
                [11399] = {min = 25600, max = 35720, effect = 48, dist_effect = 8},
                [11398] = {min = 25600, max = 35720, effect = 51, dist_effect = 8},
                [11397] = {min = 25600, max = 35720, effect = 43, dist_effect = 8},
                [11396] = {min = 25600, max = 35720, effect = 7, dist_effect = 8},
                [11395] = {min = 25600, max = 35720, effect = 20, dist_effect = 8},
            },
        },
    }
    local gun = weapons[item.itemid]
    
    if gun then
        if getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid ~= item.itemid then
            doPlayerSendCancel(cid, "O lançador deve estar equipado no slot da arma.") return true
        elseif getPlayerStorageValue(cid, 18391) == 1 then
            doPlayerSendCancel(cid, "Você não pode atirar enquanto dirige.") return true
        elseif getPlayerStorageValue(cid, 18393) == 1 then
            doPlayerSendCancel(cid, "Você não pode atirar com o capacete.") return true
        elseif exhaustion.check(cid, 57193) then
            doPlayerSendCancel(cid, "Você está exausto.") return true
        elseif getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid < 1 then
            return doPlayerSendCancel(cid, "A munição deve estar equipada no slot da munição.")
        elseif not gun.ammo[getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid] then
            return doPlayerSendCancel(cid, "Wrong ammo for this gun.")
        elseif getPlayerItemCount(cid, getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid) < gun.shots then
            doPlayerSendCancel(cid, "Você não possui munição.") return true
        end
        local ammo = gun.ammo[getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid]
        doPlayerRemoveItem(cid, getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid, gun.shots)
        doPlayerShootBazooka(cid, itemEx.uid, gun.shots, gun.shots_delay, gun.area, ammo.min, ammo.max, ammo.effect, ammo.dist_effect, gun.exha)
    end
    return true
end

Infelizmente o zipter98 não entende de conditions e necessito de alguém que saiba para acrescentar os seguintes efeitos a tais itens:

 

 

As conditions devem ser feitas em um arquivo separado ao do lança granadas, em ACTIONS ou WEAPONS para evitar BUGS, então linkarei no actions.xml assim:
 

<action itemid="2447" script="launchergrenade.lua"/>
<action itemid="11395; 11396; 11397; 11398; 11399; 11400" script="ammocondition.lua"/>

 

Os itens a seguir, devem acrescentar tais conditions:

 

(ps: com tempo configurável para cada uma delas)

11400 - Burn

11399 - Paralise

11398 - Confusion

11397 - Freeze( congelar )

11395 - Poison

 

 

E caso alguém saiba como arrumar, o código acima está 100% funcional, o único problema é que quando usa a arma no alvo, ele segue até o alvo para poder atirar(o código base dele não fazia isso, atirava em distância mesmo)


PS: SE FOR EM ACTION USAREI O SCRIPT DO zipter98, SE FOR FEITO EM WEAPON ENTÃO CONFIGURAREI NO MODO TRADICIONAL

Desde já, agradeço a quem ajudar e obrigado a todos que lerem esse tópico, GRATO!

Editado por biel.stocco (veja o histórico de edições)

  • Respostas 15
  • Visualizações 925
  • Created
  • Última resposta

Top Posters In This Topic

Postado

tente assim:

local ar1 = createCombatArea{
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 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 freeze = createConditionObject(CONDITION_FREEZING)
setConditionParam(freeze, CONDITION_PARAM_TICKS, 10000)   
setConditionFormula(freeze, -0.5, 0, -0.5, 0)
 
local burning = createConditionObject(CONDITION_FIRE)
setConditionParam(burning, CONDITION_PARAM_TICKS, 10000)
setConditionFormula(burning, -0.5, 0, -0.5, 0)
 
local poison = createConditionObject(CONDITION_POISON)
setConditionParam(poison, CONDITION_PARAM_TICKS, 10000)
setConditionFormula(poison, -0.5, 0, -0.5, 0)
 
local confusion = createConditionObject(CONDITION_PHYSICAL)
setConditionParam(confusion, CONDITION_PARAM_TICKS, 10000)
setConditionFormula(confusion, -0.5, 0, -0.5, 0)
 
local paralyze = createConditionObject(CONDITION_PARALYZE)
setConditionParam(paralyze, CONDITION_PARAM_TICKS, 10000)
setConditionFormula(paralyze, -0.5, 0, -0.5, 0)
 
function doPlayerShootBazooka(cid, target, times, delay, area, min, max, effect, dist_effect, exhaust, rounds)
    if rounds == nil then rounds = 1 end
    exhaustion.set(cid, 57193, exhaust)
    doSendDistanceShoot(getCreaturePosition(cid), getThingPos(target), dist_effect)
    doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, getThingPos(target), area, -min, -max, effect)
    if rounds == times then
        return true
    end
    addEvent(doPlayerShootBazooka, shots_delay, cid, target, times, delay, area, min, max, effect, dist_effect, exhaust, rounds+1)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local weapons = { -- [iD da arma] = {tiros, delay_dos_tiros, ammo, area, dano_min, dano_max, efeito, distance_effect, exhaustion},
        [2447] = {
            shots = 1,
            shots_delay = 50,
            area = ar1,
            exha = 5,
            ammo = {
                --Configure aqui as munições da arma.
                [11400] = {min = 25600, max = 35720, effect = 15, dist_effect = 8},
                [11399] = {min = 25600, max = 35720, effect = 48, dist_effect = 8},
                [11398] = {min = 25600, max = 35720, effect = 51, dist_effect = 8},
                [11397] = {min = 25600, max = 35720, effect = 43, dist_effect = 8},
                [11396] = {min = 25600, max = 35720, effect = 7, dist_effect = 8},
                [11395] = {min = 25600, max = 35720, effect = 20, dist_effect = 8},
            },
        },
    }
    local gun = weapons[item.itemid]
    if gun then
        if getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid ~= item.itemid then
            doPlayerSendCancel(cid, "O lançador deve estar equipado no slot da arma.") return true
        elseif getPlayerStorageValue(cid, 18391) == 1 then
            doPlayerSendCancel(cid, "Você não pode atirar enquanto dirige.") return true
        elseif getPlayerStorageValue(cid, 18393) == 1 then
            doPlayerSendCancel(cid, "Você não pode atirar com o capacete.") return true
        elseif exhaustion.check(cid, 57193) then
            doPlayerSendCancel(cid, "Você está exausto.") return true
        elseif getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid < 1 then
            return doPlayerSendCancel(cid, "A munição deve estar equipada no slot da munição.")
        elseif not gun.ammo[getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid] then
            return doPlayerSendCancel(cid, "Wrong ammo for this gun.")
        elseif getPlayerItemCount(cid, getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid) < gun.shots then
            doPlayerSendCancel(cid, "Você não possui munição.") return true
        end
        local ammo = gun.ammo[getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid]
        local condition = {
        [11400] = {burning},
        [11399] = {paralyze},
        [11398] = {confusion},
        [11397] = {poison},
        [11396] = {freeze},
        [11395] = {burning},
        }
        if getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == true then
        doAddCondition(weapons.ammo, condition)
        doPlayerRemoveItem(cid, getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid, gun.shots)
        doPlayerShootBazooka(cid, itemEx.uid, gun.shots, gun.shots_delay, gun.area, ammo.min, ammo.max, ammo.effect, ammo.dist_effect, gun.exha)
    end
    return true
end

Ando devagar, porque já tive pressa. E levo esse sorriso, porque já chorei demais...

________________________________________________________________________________

Minhas Sprites:

Mega Metagross

Mega Abomasnow

Pack de Shinys

[Posso atualizá-lo com novos shinys a qualquer momento]

Tutoriais:

[Completo] Criando e adicionando um novo Pokémon

[Actions] Criando quest no RME

Editores Lua/Xml/Sync Entre outros:

Editores Win/Mac/Linux

Postado
  • Autor

tente assim:

local ar1 = createCombatArea{
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 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 freeze = createConditionObject(CONDITION_FREEZING)
setConditionParam(freeze, CONDITION_PARAM_TICKS, 10000)   
setConditionFormula(freeze, -0.5, 0, -0.5, 0)
 
local burning = createConditionObject(CONDITION_FIRE)
setConditionParam(burning, CONDITION_PARAM_TICKS, 10000)
setConditionFormula(burning, -0.5, 0, -0.5, 0)
 
local poison = createConditionObject(CONDITION_POISON)
setConditionParam(poison, CONDITION_PARAM_TICKS, 10000)
setConditionFormula(poison, -0.5, 0, -0.5, 0)
 
local confusion = createConditionObject(CONDITION_PHYSICAL)
setConditionParam(confusion, CONDITION_PARAM_TICKS, 10000)
setConditionFormula(confusion, -0.5, 0, -0.5, 0)
 
local paralyze = createConditionObject(CONDITION_PARALYZE)
setConditionParam(paralyze, CONDITION_PARAM_TICKS, 10000)
setConditionFormula(paralyze, -0.5, 0, -0.5, 0)
 
function doPlayerShootBazooka(cid, target, times, delay, area, min, max, effect, dist_effect, exhaust, rounds)
    if rounds == nil then rounds = 1 end
    exhaustion.set(cid, 57193, exhaust)
    doSendDistanceShoot(getCreaturePosition(cid), getThingPos(target), dist_effect)
    doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, getThingPos(target), area, -min, -max, effect)
    if rounds == times then
        return true
    end
    addEvent(doPlayerShootBazooka, shots_delay, cid, target, times, delay, area, min, max, effect, dist_effect, exhaust, rounds+1)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local weapons = { -- [iD da arma] = {tiros, delay_dos_tiros, ammo, area, dano_min, dano_max, efeito, distance_effect, exhaustion},
        [2447] = {
            shots = 1,
            shots_delay = 50,
            area = ar1,
            exha = 5,
            ammo = {
                --Configure aqui as munições da arma.
                [11400] = {min = 25600, max = 35720, effect = 15, dist_effect = 8},
                [11399] = {min = 25600, max = 35720, effect = 48, dist_effect = 8},
                [11398] = {min = 25600, max = 35720, effect = 51, dist_effect = 8},
                [11397] = {min = 25600, max = 35720, effect = 43, dist_effect = 8},
                [11396] = {min = 25600, max = 35720, effect = 7, dist_effect = 8},
                [11395] = {min = 25600, max = 35720, effect = 20, dist_effect = 8},
            },
        },
    }
    local gun = weapons[item.itemid]
    if gun then
        if getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid ~= item.itemid then
            doPlayerSendCancel(cid, "O lançador deve estar equipado no slot da arma.") return true
        elseif getPlayerStorageValue(cid, 18391) == 1 then
            doPlayerSendCancel(cid, "Você não pode atirar enquanto dirige.") return true
        elseif getPlayerStorageValue(cid, 18393) == 1 then
            doPlayerSendCancel(cid, "Você não pode atirar com o capacete.") return true
        elseif exhaustion.check(cid, 57193) then
            doPlayerSendCancel(cid, "Você está exausto.") return true
        elseif getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid < 1 then
            return doPlayerSendCancel(cid, "A munição deve estar equipada no slot da munição.")
        elseif not gun.ammo[getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid] then
            return doPlayerSendCancel(cid, "Wrong ammo for this gun.")
        elseif getPlayerItemCount(cid, getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid) < gun.shots then
            doPlayerSendCancel(cid, "Você não possui munição.") return true
        end
        local ammo = gun.ammo[getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid]
        local condition = {
        [11400] = {burning},
        [11399] = {paralyze},
        [11398] = {confusion},
        [11397] = {poison},
        [11396] = {freeze},
        [11395] = {burning},
        }
        if getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == true then
        doAddCondition(weapons.ammo, condition)
        doPlayerRemoveItem(cid, getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid, gun.shots)
        doPlayerShootBazooka(cid, itemEx.uid, gun.shots, gun.shots_delay, gun.area, ammo.min, ammo.max, ammo.effect, ammo.dist_effect, gun.exha)
    end
    return true
end

primeiramente apareceu essa mensagem, pois faltava um END no fim do código

[10/05/2015 15:17:35] [Error - LuaScriptInterface::loadFile] data/actions/scripts/launchergrenade.lua:98: 'end' expected (to close 'function' at line 47) near '<eof>'
[10/05/2015 15:17:35] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/launchergrenade.lua)
[10/05/2015 15:17:36] data/actions/scripts/launchergrenade.lua:98: 'end' expected (to close 'function' at line 47) near '<eof>'
[10/05/2015 15:17:36] Reloaded actions.

 

acrescentando o ultimo END, aparece essa

[10/05/2015 15:17:57] [Error - Action Interface]
[10/05/2015 15:17:57] data/actions/scripts/launchergrenade.lua
[10/05/2015 15:17:57] Description:
[10/05/2015 15:17:57] (luaSetConditionFormula) Condition not found
[10/05/2015 15:17:57] Reloaded actions]
Postado

acho que foi um erro meu *(eu tenho um probleminha com ends (vai entender  :hum:))

tente assim:

local ar1 = createCombatArea{
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 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 freeze = createConditionObject(CONDITION_FREEZING)
setConditionParam(freeze, CONDITION_PARAM_TICKS, 10000)   
setConditionFormula(freeze, -0.5, 0, -0.5, 0)
 
local burning = createConditionObject(CONDITION_FIRE)
setConditionParam(burning, CONDITION_PARAM_TICKS, 10000)
setConditionFormula(burning, -0.5, 0, -0.5, 0)
 
local poison = createConditionObject(CONDITION_POISON)
setConditionParam(poison, CONDITION_PARAM_TICKS, 10000)
setConditionFormula(poison, -0.5, 0, -0.5, 0)
 
local confusion = createConditionObject(CONDITION_PHYSICAL)
setConditionParam(confusion, CONDITION_PARAM_TICKS, 10000)
setConditionFormula(confusion, -0.5, 0, -0.5, 0)
 
local paralyze = createConditionObject(CONDITION_PARALYZE)
setConditionParam(paralyze, CONDITION_PARAM_TICKS, 10000)
setConditionFormula(paralyze, -0.5, 0, -0.5, 0)
 
function doPlayerShootBazooka(cid, target, times, delay, area, min, max, effect, dist_effect, exhaust, rounds)
    if rounds == nil then rounds = 1 end
    exhaustion.set(cid, 57193, exhaust)
    if getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == true then
    local cond = doAddCondition(cid, condition.itemid)
    local condition = {
        [11400] = {burning},
        [11399] = {paralyze},
        [11398] = {confusion},
        [11397] = {poison},
        [11396] = {freeze},
        [11395] = {burning},
        }
    doSendDistanceShoot(getCreaturePosition(cid), getThingPos(target), dist_effect, cond)
    doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, getThingPos(target), area, -min, -max, effect)
    if rounds == times then
        return true
    end
    addEvent(doPlayerShootBazooka, shots_delay, cid, target, times, delay, area, min, max, effect, dist_effect, exhaust, rounds+1)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local weapons = { -- [iD da arma] = {tiros, delay_dos_tiros, ammo, area, dano_min, dano_max, efeito, distance_effect, exhaustion},
        [2447] = {
            shots = 1,
            shots_delay = 50,
            area = ar1,
            exha = 5,
            ammo = {
                --Configure aqui as munições da arma.
                [11400] = {min = 25600, max = 35720, effect = 15, dist_effect = 8},
                [11399] = {min = 25600, max = 35720, effect = 48, dist_effect = 8},
                [11398] = {min = 25600, max = 35720, effect = 51, dist_effect = 8},
                [11397] = {min = 25600, max = 35720, effect = 43, dist_effect = 8},
                [11396] = {min = 25600, max = 35720, effect = 7, dist_effect = 8},
                [11395] = {min = 25600, max = 35720, effect = 20, dist_effect = 8},
            },
        },
    }
    local gun = weapons[item.itemid]
    if gun then
        if getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid ~= item.itemid then
            doPlayerSendCancel(cid, "O lançador deve estar equipado no slot da arma.") return true
        elseif getPlayerStorageValue(cid, 18391) == 1 then
            doPlayerSendCancel(cid, "Você não pode atirar enquanto dirige.") return true
        elseif getPlayerStorageValue(cid, 18393) == 1 then
            doPlayerSendCancel(cid, "Você não pode atirar com o capacete.") return true
        elseif exhaustion.check(cid, 57193) then
            doPlayerSendCancel(cid, "Você está exausto.") return true
        elseif getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid < 1 then
            return doPlayerSendCancel(cid, "A munição deve estar equipada no slot da munição.")
        elseif not gun.ammo[getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid] then
            return doPlayerSendCancel(cid, "Wrong ammo for this gun.")
        elseif getPlayerItemCount(cid, getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid) < gun.shots then
            doPlayerSendCancel(cid, "Você não possui munição.") return true
        end
        local ammo = gun.ammo[getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid]
        doPlayerRemoveItem(cid, getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid, gun.shots)
        doPlayerShootBazooka(cid, itemEx.uid, gun.shots, gun.shots_delay, gun.area, ammo.min, ammo.max, ammo.effect, ammo.dist_effect, gun.exha)
    end
    return true
end

Ando devagar, porque já tive pressa. E levo esse sorriso, porque já chorei demais...

________________________________________________________________________________

Minhas Sprites:

Mega Metagross

Mega Abomasnow

Pack de Shinys

[Posso atualizá-lo com novos shinys a qualquer momento]

Tutoriais:

[Completo] Criando e adicionando um novo Pokémon

[Actions] Criando quest no RME

Editores Lua/Xml/Sync Entre outros:

Editores Win/Mac/Linux

Postado
  • Autor

acho que foi um erro meu *(eu tenho um probleminha com ends (vai entender  :hum:))

tente assim:

local ar1 = createCombatArea{
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 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 freeze = createConditionObject(CONDITION_FREEZING)
setConditionParam(freeze, CONDITION_PARAM_TICKS, 10000)   
setConditionFormula(freeze, -0.5, 0, -0.5, 0)
 
local burning = createConditionObject(CONDITION_FIRE)
setConditionParam(burning, CONDITION_PARAM_TICKS, 10000)
setConditionFormula(burning, -0.5, 0, -0.5, 0)
 
local poison = createConditionObject(CONDITION_POISON)
setConditionParam(poison, CONDITION_PARAM_TICKS, 10000)
setConditionFormula(poison, -0.5, 0, -0.5, 0)
 
local confusion = createConditionObject(CONDITION_PHYSICAL)
setConditionParam(confusion, CONDITION_PARAM_TICKS, 10000)
setConditionFormula(confusion, -0.5, 0, -0.5, 0)
 
local paralyze = createConditionObject(CONDITION_PARALYZE)
setConditionParam(paralyze, CONDITION_PARAM_TICKS, 10000)
setConditionFormula(paralyze, -0.5, 0, -0.5, 0)
 
function doPlayerShootBazooka(cid, target, times, delay, area, min, max, effect, dist_effect, exhaust, rounds)
    if rounds == nil then rounds = 1 end
    exhaustion.set(cid, 57193, exhaust)
    if getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == true then
    local cond = doAddCondition(cid, condition.itemid)
    local condition = {
        [11400] = {burning},
        [11399] = {paralyze},
        [11398] = {confusion},
        [11397] = {poison},
        [11396] = {freeze},
        [11395] = {burning},
        }
    doSendDistanceShoot(getCreaturePosition(cid), getThingPos(target), dist_effect, cond)
    doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, getThingPos(target), area, -min, -max, effect)
    if rounds == times then
        return true
    end
    addEvent(doPlayerShootBazooka, shots_delay, cid, target, times, delay, area, min, max, effect, dist_effect, exhaust, rounds+1)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local weapons = { -- [iD da arma] = {tiros, delay_dos_tiros, ammo, area, dano_min, dano_max, efeito, distance_effect, exhaustion},
        [2447] = {
            shots = 1,
            shots_delay = 50,
            area = ar1,
            exha = 5,
            ammo = {
                --Configure aqui as munições da arma.
                [11400] = {min = 25600, max = 35720, effect = 15, dist_effect = 8},
                [11399] = {min = 25600, max = 35720, effect = 48, dist_effect = 8},
                [11398] = {min = 25600, max = 35720, effect = 51, dist_effect = 8},
                [11397] = {min = 25600, max = 35720, effect = 43, dist_effect = 8},
                [11396] = {min = 25600, max = 35720, effect = 7, dist_effect = 8},
                [11395] = {min = 25600, max = 35720, effect = 20, dist_effect = 8},
            },
        },
    }
    local gun = weapons[item.itemid]
    if gun then
        if getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid ~= item.itemid then
            doPlayerSendCancel(cid, "O lançador deve estar equipado no slot da arma.") return true
        elseif getPlayerStorageValue(cid, 18391) == 1 then
            doPlayerSendCancel(cid, "Você não pode atirar enquanto dirige.") return true
        elseif getPlayerStorageValue(cid, 18393) == 1 then
            doPlayerSendCancel(cid, "Você não pode atirar com o capacete.") return true
        elseif exhaustion.check(cid, 57193) then
            doPlayerSendCancel(cid, "Você está exausto.") return true
        elseif getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid < 1 then
            return doPlayerSendCancel(cid, "A munição deve estar equipada no slot da munição.")
        elseif not gun.ammo[getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid] then
            return doPlayerSendCancel(cid, "Wrong ammo for this gun.")
        elseif getPlayerItemCount(cid, getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid) < gun.shots then
            doPlayerSendCancel(cid, "Você não possui munição.") return true
        end
        local ammo = gun.ammo[getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid]
        doPlayerRemoveItem(cid, getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid, gun.shots)
        doPlayerShootBazooka(cid, itemEx.uid, gun.shots, gun.shots_delay, gun.area, ammo.min, ammo.max, ammo.effect, ammo.dist_effect, gun.exha)
    end
    return true
end

Aueahuha tendi

Depois de acrescentar o ultimo END novamente, deu isso

[10/05/2015 15:33:13] [Error - Action Interface]
[10/05/2015 15:33:13] data/actions/scripts/launchergrenade.lua
[10/05/2015 15:33:13] Description:
[10/05/2015 15:33:13] (luaSetConditionFormula) Condition not found

[10/05/2015 15:33:13] [Error - Action Interface]
[10/05/2015 15:33:13] data/actions/scripts/launchergrenade.lua
[10/05/2015 15:33:13] Description:
[10/05/2015 15:33:13] (luaSetConditionFormula) Condition not found

[10/05/2015 15:33:13] [Error - Action Interface]
[10/05/2015 15:33:13] data/actions/scripts/launchergrenade.lua
[10/05/2015 15:33:13] Description:
[10/05/2015 15:33:13] (luaSetConditionFormula) Condition not found

[10/05/2015 15:33:13] [Error - Action Interface]
[10/05/2015 15:33:13] data/actions/scripts/launchergrenade.lua
[10/05/2015 15:33:13] Description:
[10/05/2015 15:33:13] (luaSetConditionFormula) Condition not found
[10/05/2015 15:33:13] [Warning - Event::loadScript] Event onUse not found (data/actions/scripts/launchergrenade.lua)
[10/05/2015 15:33:13] Reloaded actions.

[10/05/2015 15:33:22] [Error - Action Interface]
[10/05/2015 15:33:22] data/actions/scripts/launchergrenade.lua
[10/05/2015 15:33:22] Description:
[10/05/2015 15:33:22] (luaSetConditionFormula) Condition not found

[10/05/2015 15:33:22] [Error - Action Interface]
[10/05/2015 15:33:22] data/actions/scripts/launchergrenade.lua
[10/05/2015 15:33:22] Description:
[10/05/2015 15:33:22] (luaSetConditionFormula) Condition not found

[10/05/2015 15:33:22] [Error - Action Interface]
[10/05/2015 15:33:22] data/actions/scripts/launchergrenade.lua
[10/05/2015 15:33:22] Description:
[10/05/2015 15:33:22] (luaSetConditionFormula) Condition not found

[10/05/2015 15:33:22] [Error - Action Interface]
[10/05/2015 15:33:22] data/actions/scripts/launchergrenade.lua
[10/05/2015 15:33:22] Description:
[10/05/2015 15:33:22] (luaSetConditionFormula) Condition not found
[10/05/2015 15:33:22] [Warning - Event::loadScript] Event onUse not found (data/actions/scripts/launchergrenade.lua)
[10/05/2015 15:33:22] Reloaded actions.

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 520.1k

Informação Importante

Confirmação de Termo