Ir para conteúdo

Featured Replies

Postado

Esse sistema é bem legal para aqueles que gostam de tipo tibia gta , o script não é perfeito mas é bem criativo e legal.

Crie um arquivo em nas pata action com nome de arma.lua

Cole isso


function isWalkable(pos, creature, proj, pz)-- by 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 pz then return false, true 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 doShootEffect(distancetotarget, effect, l, y) -- l = localpos(lookdirpos), y = dirvalue

    for i = 0, distancetotarget-1 do

        if isInArray({0,3}, y) then

            local _J = y == 0 and {x = l.x, y = l.y-i, z = l.z} or y == 3 and {x = l.x-i, y = l.y, z = l.z}

            doSendMagicEffect(_J, effect)

        else

            _J = y == 1 and {x = l.x+i, y = l.y, z = l.z} or y == 2 and {x = l.x, y = l.y+i, z = l.z}

            doSendMagicEffect(_J, effect)                                

        end

    end

    return true

end

local items = {

[2534] = {

    balaid = 2545, 

    level = 1,  

    skillup = 5, 

    mindamage = -1,  

    maxdamage = -5255, 

    damagetype = COMBAT_HOLYDAMAGE,

}

}

local _MIT = {}

local shootmode = "shooteffect mode" -- "effect mode" or "shooteffect mode"

function onUse(cid, item, fromPosition, itemEx, toPosition)

    local function getFirstThingInArea(pos)

            for areax = pos.x, pos.x do

                for areay = pos.y, pos.y do

                    local area = {x = areax, y = areay, z = pos.z}

                    if isCreature(getTopCreature(area).uid) or not isWalkable(area) then

                        table.insert(_MIT, getThingFromPos(area).uid)

                        for s = 1, #_MIT-1 do

                            table.remove(_MIT, s+1)

                        end

                    end

                end

            end

        return true

    end

    local l = getPlayerLookPos(cid)

    local y = getCreatureLookDirection(cid)

    local g = items[item.itemid]

    if g then

        if getPlayerLevel(cid) < g.level then

            return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need level ".. g.level .." or higher.")

        end

        if getTilePzInfo(getCreaturePosition(cid)) then 

            return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot use a gun in a protection zone.")

        end

        if item.uid ~= getPlayerSlotItem(cid, 5).uid then

            return doPlayerSendCancel(cid, "Equip your gun on gun slot.")

        end

        if getPlayerSlotItem(cid, 10).itemid == g.balaid then

            doRemoveItem(getPlayerSlotItem(cid, 10).uid, 1)

            doPlayerAddSkillTry(cid, g.skillup, 1)   

            for T = 0, 20 do

                local _g = y == 0 and {x = l.x, y = l.y-T, z = l.z} or y == 3 and {x = l.x-T, y = l.y, z = l.z} or y == 1 and {x = l.x+T, y = l.y, z = l.z} or y == 2 and {x = l.x, y = l.y+T, z = l.z}

                getFirstThingInArea(_g)

            end

            if #_MIT >= 1 then

                local mpos = getThingPos(_MIT[1])

                local ppos = getDistanceBetween(mpos, l)

                local ft = y == 0 and {x = l.x, y = l.y-ppos, z = l.z} or y == 1 and {x = l.x+ppos, y = l.y, z = l.z} or y == 2 and {x = l.x, y = l.y+ppos, z = l.z}  or y == 3 and {x = l.x-ppos, y = l.y, z = l.z}

                if isCreature(getTopCreature(mpos).uid) then

                    doAreaCombatHealth(0, g.damagetype, ft, 0, g.mindamage, g.maxdamage, 0)

                else

                    doSendMagicEffect(ft, 3)

                end

                if shootmode == "shooteffect mode" then

                    doShootEffect(ppos, 12, l, y)

                elseif shootmode == "effect mode" then

                    doSendDistanceShoot(l, mpos, 40)

                end

                table.remove(_MIT, 1)

            end

        else 

            doPlayerSendCancel(cid, "You do not have munition.") 

        end

    end

    return true

end

Cole isso agora em action.xml

<action itemid="2534" event="script" value="arma.lua"/>

Explicação:

local shootmode <-- Pode trocar para effect mode

[2534] = { <-- ID DA ARMA

    balaid = 2545, <-- ID DA BALA

    level = 1, <-- Level para usar

    skillup = 5, <-- SKILL UP

    mindamage = -1, <-- MINIMO DE DANO

    maxdamage = -5255,  <-- MAXIMO DE DANO

    damagetype = COMBAT_HOLYDAMAGE, <-- EFEITO DO TIRO


<action itemid="2534"/>

Id da arma , preste atenção se mudar também no script. Video demostrando:

KylerXxX 

Skydangerous - Explica&#231;&#227;o , tutorial e video

Créditos:

 http://baiakuza.com/
IP: baiakuza.com
TIBIA: 10.96
Baiak Custom [ High Exp Rate ]

 

 

 

 

  • Respostas 5
  • Visualizações 2.4k
  • Created
  • Última resposta

Top Posters In This Topic

  • 2 months later...
  • 3 weeks later...
  • 5 months later...
Postado

[03/08/2012 11:34:46] [Error - LuaScriptInterface::loadFile] cannot open data/actions/scripts/armanew.lua: No such file or directory

[03/08/2012 11:34:46] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/armanew.lua)

[03/08/2012 11:34:46] cannot open data/actions/scripts/armanew.lua: No such file or directory

QUERO SABER ARRUMAR PLXX AJUDA AEEE [03/08/2012 11:34:46] [Error - LuaScriptInterface::loadFile] cannot open data/actions/scripts/armanew.lua: No such file or directory

[03/08/2012 11:34:46] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/armanew.lua)

[03/08/2012 11:34:46] cannot open data/actions/scripts/armanew.lua: No such file or directory

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo