Ir para conteúdo

tonynamoral

Visconde
  • Total de itens

    319
  • Registro em

  • Última visita

Posts postados por tonynamoral

  1. Olá galera , eu estou querendo pedir um sistema que nao é muito easy fazer nao ,

    bom , ele funciona assim , eu tenho 1 bag que fica na minha (RIGHT HAND) *Mao Direita* {Lugar aonde poe o shield}

    Bom , ai dentro dessa bag eu posso por runas, e o funcionamento seria assim

     

    Eu estou usando uma wand de fogo , ai eu tenho a minha bag lá na right hand , e eu tenho 1 poison rune na minha outra bag

    ai eu abro a minha bag que está no right hand , e ponho a runa dentro dessa bag , ai a wand de fogo , vai atacar também de poison,

     

    tipo , o mesmo dano que ela tirar de fogo vai tirar de poison , e isso é valido para os 4 elementos

     

    {Fire, Ice, Energy, Poison}

     

    E se eu colocassse +1 rune , iria atirar o Fogo + Posison + A rune que eu colokei.

     

    Então galera é isso ai .

  2. Deu esse error aqui ó :

     

    
    [24/01/2013 23:38:32] [Error - Action Interface] 
    [24/01/2013 23:38:32] data/actions/scripts/upgrade.lua:onUse
    [24/01/2013 23:38:32] Description: 
    [24/01/2013 23:38:32] data/lib/items.lua:2: attempt to index local 'item' (a number value)
    [24/01/2013 23:38:32] stack traceback:
    [24/01/2013 23:38:32]  data/lib/items.lua:2: in function 'getItemAttack'
    [24/01/2013 23:38:32]  data/actions/scripts/upgrade.lua:87: in function 'doTransform'
    [24/01/2013 23:38:32]  data/actions/scripts/upgrade.lua:109: in function <data/actions/scripts/upgrade.lua:95>
    

  3. Error :

    
    [24/01/2013 22:33:23] [Error - Action Interface] 
    [24/01/2013 22:33:23] data/actions/scripts/upgrade.lua:onUse
    [24/01/2013 22:33:23] Description: 
    [24/01/2013 22:33:23] data/actions/scripts/upgrade.lua:87: attempt to call global 'getItemAttack' (a nil value)
    [24/01/2013 22:33:23] stack traceback:
    [24/01/2013 22:33:23]  data/actions/scripts/upgrade.lua:87: in function 'doTransform'
    [24/01/2013 22:33:23]  data/actions/scripts/upgrade.lua:109: in function <data/actions/scripts/upgrade.lua:95>
    

     

    Script ;

     

     

     

    --- Perfect refine system by Mock the bear (MTB).

    --- Email: <a href="mailto:mock_#####@hotmail.com">mock_#####@hotmail.com</a>

    -- &a = weapon attack

    -- &d = weapon defense

    -- &s = shield defense

    -- &p = armor defense

    -- # = nivel do item

    -- @ = max level

    local gain = {

    gainArmor='&p+(1)',loseArmor='&p-(1)',

    gainShield='&s+#',loseShield='&s-(#+1)',

    gainAttack='&a+(1*(#))',loseAttack='&a-(1*(#+1))',

    gainDefense='&d+(1*(#))',loseDefense='&d-(1*(#+1))',

    chance='(100/math.sqrt((((@/4)+(#*2))/@)*#))',

    maxlvl = 5,

    blocked_ids = {8881}

    }

    local it = {

    --[itemid] = [percent]

    [8306] = 0, -- 0% additional

    [8305] = 100, -- 50%

    }

    if not setItemName then

    function setItemName(uid,name)

    return doItemSetAttribute(uid,'name',name)

    end

    function setItemArmor(uid,name)

    return doItemSetAttribute(uid,'armor',name)

    end

    function setItemDefense(uid,name)

    return doItemSetAttribute(uid,'defense',name)

    end

    function setItemAttack(uid,name)

    return doItemSetAttribute(uid,'attack',name)

    end

    function getItemAttack(uid)

    return getItemAttribute(uid,'attack')

    end

    function getItemDefense(uid)

    return getItemAttribute(uid,'defense')

    end

    function getItemArmor(uid)

    if type(uid) == 'number' then

    return getItemAttribute(uid,'armor')

    else

    return getItemInfo(uid.itemid).armor

    end

    end

    end

     

    local function isArmor(uid) -- Function by Mock the bear.

    if (getItemInfo(uid.itemid).armor ~= 0) and (getItemWeaponType(uid.uid) == 0) then

    return true

    end

    return false

    end

    local function isWeapon(uid) -- Function by Mock the bear.

    uid = uid or 0

    local f = getItemWeaponType(uid)

    if f == 1 or f == 2 or f == 3 then

    return true

    end

    return false

    end

    local function isShield(uid) -- Function by Mock the bear.

    uid = uid or 0

    if getItemWeaponType(uid) == 4 then

    return true

    end

    return false

    end

    local function isBow(uid) -- Function by Mock the bear.

    uid = uid or 0

    if getItemWeaponType(uid) == 5 then

    return true

    end

    return false

    end

    local function getWeaponLevel(uid) -- Function by Mock the bear.

    uid = uid or 0

    local name = getItemName(uid.uid) or getItemInfo(uid.itemid).name or ''

    local lvl = string.match(name,'%s%+(%d+)%s*')

    return tonumber(lvl) or 0

    end

    local function doTransform(s,i) -- Function by Mock the bear.

    local c = string.gsub(s,'@',gain.maxlvl)

    local c = string.gsub(c,'&a',(getItemAttack(i.uid) ~= 0 and getItemAttack(i.uid) or getItemInfo(i.itemid).attack))

    local c = string.gsub(c,'&d',(getItemDefense(i.uid) ~= 0 and getItemDefense(i.uid) or getItemInfo(i.itemid).defense))

    local c = string.gsub(c,'&s',(getItemDefense(i.uid) ~= 0 and getItemDefense(i.uid) or getItemInfo(i.itemid).defense))

    local c = string.gsub(c,'&p',(getItemArmor(i.uid) ~= 0 and getItemArmor(i.uid) or getItemInfo(i.itemid).armor))

    local c = string.gsub(c,'#',getWeaponLevel(i))

    local q = assert(loadstring('return '..c))

    return math.floor(assert(q()))

    end

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

    if item.uid == 0 or item.itemid == 0 then return false end

    toPosition.stackpos = 255

    if isInArray(gain.blocked_ids, itemEx.itemid)

    or (not getItemWeaponType(itemEx.uid) or getItemWeaponType(itemEx.uid) > 5)

    or (getItemWeaponType(itemEx.uid) == 0 and not isArmor(itemEx))

    or itemEx.itemid == 0 or itemEx.type > 1 or isItemStackable(itemEx.uid) then

    doPlayerSendTextMessage(cid,22,"You cant refine this item.")

    return TRUE

    end

    if isCreature(itemEx.uid) == TRUE then

    return FALSE

    end

    local level = getWeaponLevel(itemEx)

    local chance = doTransform(gain.chance,itemEx)

    if level == gain.maxlvl then

    doSendMagicEffect(toPosition, 2)

    return doPlayerSendTextMessage(cid,22,"Your item is on max level, you can't upgrade it.")

    end

    doPlayerSendTextMessage(cid, 22,"Trying refine with "..(chance+it[item.itemid] > 100 and 100 or chance+it[item.itemid]).."% of sucess!")

    if chance+it[item.itemid] >= math.random(0,100) then

    local nm = getItemName(itemEx.uid)

    local slot = nm:match('(%[.+%])') or '' ---If you server use slot system dont change it ^^

    slot = slot~='' and ' '..slot or slot

    setItemName(itemEx.uid, getItemNameById(itemEx.itemid)..' +'..(level+1)..slot)

    addEvent(doPlayerSendTextMessage,500,cid,22,"Your item has been upgrated to +"..(level+1)..slot..".")

    doSendMagicEffect(toPosition, 12)

    if isArmor(itemEx) then

    local get = doTransform(gain.gainArmor,itemEx)

    setItemArmor(itemEx.uid,get)

    elseif isBow(itemEx.uid) then

    setItemAttack(itemEx.uid, doTransform(gain.gainAttack,itemEx))

    elseif isWeapon(itemEx.uid) then

    setItemAttack(itemEx.uid, doTransform(gain.gainAttack,itemEx))

    setItemDefense(itemEx.uid, doTransform(gain.gainDefense,itemEx))

    elseif isShield(itemEx.uid) then

    setItemDefense(itemEx.uid, doTransform(gain.gainShield,itemEx))

    end

    else

    if level == 0 then

    addEvent(doPlayerSendTextMessage,500,cid,22,"No effect.")

    doSendMagicEffect(toPosition, 2)

    elseif level > 0 then

    local nm = getItemName(itemEx.uid)

    local slot = nm:match('(%[.+%])') or '' ---If you server use slot system dont change it ^^

    slot = slot~='' and ' '..slot or slot

    if level == 1 then

    setItemName(itemEx.uid, getItemNameById(itemEx.itemid)..slot)

    addEvent(doPlayerSendTextMessage,500,cid,22,"Your item back to normal.")

    else

    setItemName(itemEx.uid, getItemNameById(itemEx.itemid)..' +'..(level-1)..slot)

    addEvent(doPlayerSendTextMessage,500,cid,22,"Your item back to +"..(level-1)..slot..".")

    end

    if isArmor(itemEx) then

    setItemArmor(itemEx.uid,doTransform(gain.loseArmor ,itemEx))

    elseif isWeapon(itemEx.uid) then

    setItemAttack(itemEx.uid, doTransform(gain.loseAttack,itemEx))

    setItemDefense(itemEx.uid, doTransform(gain.loseDefense,itemEx))

    elseif isBow(itemEx.uid) then

    setItemAttack(itemEx.uid, doTransform(gain.loseAttack,itemEx))

    elseif isShield(itemEx.uid) then

    setItemDefense(itemEx.uid, doTransform(gain.loseShield,itemEx))

    end

    end

    doSendMagicEffect(toPosition, 9)

    end

    doRemoveItem(item.uid,1)

    return true

    end

     

     

  4. Testei um aqui , só que deu error

     

    script

    
    
    -- TonyNamoral Scripts --
    items = {
    [0] = {id = 2472, count = 1, chance = 2},
    [1] = {id = 2466, count = 1, chance = 5},
    [2] = {id = 8930, count = 1, chance = 10},
    [3] = {id = 8858, count = 1, chance = 15},
    [4] = {id = 2160, count = 10, chance = 30},
    [5] = {id = 6569, count = 50, chance = 100}
    }
    function onUse(cid, item, fromPos, item2, toPos)
    local pos = {x = 1012, y = 992, y = 7, stackpos = 2}
    if item2.itemid == 2450 then
    if not getTileItemById(pos, 2450).uid <= 0 then
    doPlayerSendcancel(cid,"Voce precisa da table")
    return false
    end
    for i = 0, #items do
    if (items[i].chance > math.random(1, 100)) then
    doPlayerAddItem(cid, items[i].id, items[i].count)
    doPlayerSendTextMessage(cid,27,"You make a "..getItemNameById(items[i].id).."")
    doRemoveItem(item2.uid, 1)
    return true
    end
    end
    doPlayerSendTextMessage(cid,27,"You dont make nothing")
    doRemoveItem(item2.uid, 1)
    return false
    end
    end
    

     

    error : [21/01/2013 18:11:00] [Error - Action Interface]

    [21/01/2013 18:11:00] data/actions/scripts/box1.lua:onUse

    [21/01/2013 18:11:00] Description:

    [21/01/2013 18:11:00] data/actions/scripts/box1.lua:14: attempt to compare boolean with number

    [21/01/2013 18:11:00] stack traceback:

    [21/01/2013 18:11:00] data/actions/scripts/box1.lua:14: in function <data/actions/scripts/box1.lua:11>

  5. Bom , agora so aparece que eu nao criei o item

     

    fica dando só essa msg ->

     

    doPlayerSendTextMessage(cid, 27, "You don't make nothing"),

     

    bom sera que tem como fazer se o player nao estiver com a madeira no lgar certo, aparece 1 msg que a madeira precisar estar em cima de 1 lugar e talz?

     

     

    Eu olhei o script , e axei algo esquisito

     

     

    local match

     

    if not match ....

     

    oq acontece? , o match nao é nada mesmo?

  6. Error :

     

     

    [21/01/2013 16:00:15] [Error - Action Interface]

    [21/01/2013 16:00:15] data/actions/scripts/box1.lua:onUse

    [21/01/2013 16:00:15] Description:

    [21/01/2013 16:00:15] (luaGetThingPosition) Thing not found

     

    [21/01/2013 16:00:15] [Error - Action Interface]

    [21/01/2013 16:00:15] data/actions/scripts/box1.lua:onUse

    [21/01/2013 16:00:15] Description:

    [21/01/2013 16:00:15] data/actions/scripts/box1.lua:13: attempt to index a boolean value

    [21/01/2013 16:00:15] stack traceback:

    [21/01/2013 16:00:15] data/actions/scripts/box1.lua:13: in function <data/actions/scripts/box1.lua:10>

     

    Script

    
    -- TonyNamoral Scripts --
    items = {
    [0] = {id = 2472, count = 1, chance = 2},
    [1] = {id = 2466, count = 1, chance = 5},
    [2] = {id = 8930, count = 1, chance = 10},
    [3] = {id = 8858, count = 1, chance = 15},
    [4] = {id = 2160, count = 10, chance = 30},
    [5] = {id = 6569, count = 50, chance = 100}
    }
    function onUse(cid, item, fromPos, item2, toPos)
    local position = {x = 1011, y = 991, z = 7}
    
    if getThingPosition(item2).x == position.x and getThingPosition(item2).y == position.y and getThingPosition(item2).z == position.z then
    if item2.itemid == 2472 then
    for i = 0, #items do
    if (items[i].chance > math.random(1, 100)) then
    doPlayerAddItem(cid, items[i].id, items[i].count)
    doPlayerSendTextMessage(cid,27,"You make a "..getItemNameById(items[i].id).."")
    doRemoveItem(item2.uid, 1)
    return true
    end
    end
    doPlayerSendTextMessage(cid,27,"You dont make nothing")
    doRemoveItem(item2.uid, 1)
    return false
    end
    end
    end
    

  7. Olá galera eu quero por uma limitaçao nessa script

     

     

     

     

    -- TonyNamoral Scripts --

    items = {

    [0] = {id = 2472, count = 1, chance = 2},

    [1] = {id = 2466, count = 1, chance = 5},

    [2] = {id = 8930, count = 1, chance = 10},

    [3] = {id = 8858, count = 1, chance = 15},

    [4] = {id = 2160, count = 10, chance = 30},

    [5] = {id = 6569, count = 50, chance = 100}

    }

    function onUse(cid, item, fromPos, item2, toPos)

    if item2.itemid == 2472 then

    for i = 0, #items do

    if (items.chance > math.random(1, 100)) then

    doPlayerAddItem(cid, items.id, items.count)

    doPlayerSendTextMessage(cid,27,"You make a "..getItemNameById(items.id).."")

    doRemoveItem(item2.uid, 1)

    return true

    end

    end

    doPlayerSendTextMessage(cid,27,"You dont make nothing")

    doRemoveItem(item2.uid, 1)

    return false

    end

    end

     

     

     

     

    Bom eu so quero por assim , o player só pode usar o "use with" , no item2 , se o item2 tiver em uma certa posiçao.

  • Quem Está Navegando   0 membros estão online

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