Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Link para o post
Compartilhar em outros sites

Cara, use CODE quando for postar um script, ajuda bastante na leitura.

Sobre o erro, me diga o ID do item que você está dando USE.

Editado por luangop
a (veja o histórico de edições)

Te ajudei? Clique em  Gostei ! 

²²²d¬¬b²²²

 

 

"She's got a smile that it seems to me...."  ♪♪

Link para o post
Compartilhar em outros sites
7 minutos atrás, luangop disse:

Cara, use CODE quando for postar um script, ajuda bastante na leitura.

Sobre o erro, me diga o ID do item que você está dando USE.

<item id="2158" article="a" name="blue gem">
        <attribute key="weight" value="30" />
    </item>

Link para o post
Compartilhar em outros sites
1 minuto atrás, tiroleivi disse:

<item id="2158" article="a" name="blue gem">
        <attribute key="weight" value="30" />
    </item>

Simples, você provavelmente só botou o id 2158 na tag do actions mas não botou no script, pois no script não tem mount configurada para o itemid 2158.

E quando falei pra usar code, quis dizer assim:
 

Spoiler

local ACTION_RUN, ACTION_BREAK, ACTION_NONE, ACTION_ALL = 1, 2, 3, 4
local TYPE_MONSTER, TYPE_NPC, TYPE_ITEM, TYPE_ACTION, TYPE_UNIQUE = 1, 2, 3, 4, 5

local config = {
    [5907]    =    {NAME = 'Bear',                    ID = 3,        TYPE = TYPE_MONSTER,    CHANCE = 20,    FAIL_MSG = { {1, 'The bear ran away.'}, {2, 'Oh no! The slingshot broke.'}, {3, 'The bear is trying to hit you with its claws.'} },SUCCESS_MSG = 'You have tamed the bear.'},
    [13295]    =    {NAME = 'Black Sheep',                ID = 4,        TYPE = TYPE_MONSTER,    CHANCE = 25,    FAIL_MSG = { {1, 'The black sheep ran away.'}, {2, 'Oh no! The reins were torn.'}, {3, 'The black sheep is trying to run away.'} },SUCCESS_MSG = 'You have tamed the sheep.'},
    [13293]    =    {NAME = 'Midnight Panther',            ID = 5,        TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The panther has escaped.'}, {2, 'The whip broke.'} },SUCCESS_MSG = 'You have tamed the panther.'},
    [13298]    =    {NAME = 'Terror Bird',                ID = 2,        TYPE = TYPE_MONSTER,    CHANCE = 15,    FAIL_MSG = { {1, 'The bird ran away.'}, {3, 'The terror bird is pecking you.'} }, SUCCESS_MSG = 'You have tamed the bird.'},
    [13247]    =    {NAME = 'Boar',                    ID = 10,    TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The boar has run away'}, {3, 'The boar attacks you.'} }, SUCCESS_MSG = 'You have tamed the boar.'},
    [13305]    =    {NAME = 'Crustacea Gigantica',            ID = 7,        TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The crustacea has run away.'}, {2, 'The crustacea ate the shrimp.'} }, SUCCESS_MSG = 'You have tamed the crustacea.'},
    [13291]    =    {NAME = 'Undead Cavebear',            ID = 12,    TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The undead bear has run away.'} }, SUCCESS_MSG = 'You have tamed the skeleton.'},
    [13307]    =    {NAME = 'Wailing Widow',            ID = 1,        TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The widow has run away.'}, {2, 'The widow has eaten the sweet bait.'} }, SUCCESS_MSG = 'You have tamed the widow.'},
    [13292]    =    {NAME = 'inoperative tin lizzard',        ID = 8,        TYPE = TYPE_ITEM,    CHANCE = 40,    FAIL_MSG = { {2, 'The key broke inside.'} }, SUCCESS_MSG = 'You wind up the tin lizzard.'},
    [13294]    =    {NAME = 'Draptor',                ID = 6,        TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The draptor has run away.'}, {3, 'The draptor has fled.'} }, SUCCESS_MSG = 'You have tamed the draptor.'},
    [13536]    =    {NAME = 'Crystal Wolf',                ID = 16,    TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The wolf has run away.'} }, SUCCESS_MSG = 'You have tamed the wolf.'},
    [13539]    =    {NAME = 'Enraged White Deer',            ID = 18,    TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {2, 'The cone broke.'}, {3, 'The deer has fled in fear.'} }, SUCCESS_MSG = 'You have tamed the deer.'},
    [13538]    =    {NAME = 'Panda',                ID = 19,    TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {4, 'Panda ate the leaves and ran away.'} }, SUCCESS_MSG = 'You have tamed the panda.'},
    [13535]    =    {NAME = 'Dromedary',                ID = 20,    TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'Dromedary has run away.'} }, SUCCESS_MSG = 'You have tamed the dromedary.'},
    [13498]    =    {NAME = 'Sandstone Scorpion',            ID = 21,    TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The scorpion has vanished.'}, {2, 'Scorpion broken the sceptre.'} }, SUCCESS_MSG = 'You have tamed the scorpion.'},
    [13537]    =    {NAME = 'Donkey',                ID = 13,    TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The witch has escaped!'} }, SUCCESS_MSG = 'You have tamed the mule.'},
    [13938]    =    {NAME = 'inoperative uniwheel',            ID = 15,    TYPE = TYPE_ITEM,    CHANCE = 40,    FAIL_MSG = { {3, 'The oil have no effect.'}, {2, 'Splosh!'} }, SUCCESS_MSG = 'The strange wheel seems to vibrate and slowly starts turning continuously.'},
    [13508]    =    {NAME = 'Slug',                    ID = 14,    TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The slug has run away.'}, {3, 'The drug had no effect.'} }, SUCCESS_MSG = 'You have tamed the slug.'},
    [13939]    =    {NAME = 'Wild Horse',                ID = 17,    TYPE = TYPE_MONSTER,    CHANCE = 15,    FAIL_MSG = { {1, 'The horse runs away.'}, {2, 'The horse ate the oats.'} }, SUCCESS_MSG = 'You have tamed the horse.'},
    [15545]    =    {NAME = 'Manta Ray',                ID = 28,    TYPE = TYPE_MONSTER,    CHANCE = 30,    FAIL_MSG = { {1, 'The manta ray fled.'}, {3, 'The manta ray is trying to escape.'} }, SUCCESS_MSG = 'You have tamed the manta ray.'},
    [15546]    =    {NAME = 'Lady Bug',                ID = 27,    TYPE = TYPE_MONSTER,    CHANCE = 30,    FAIL_MSG = { {1, 'The ladybug got scared and ran away.'}, {3, 'The ladybug is trying to nibble.'} }, SUCCESS_MSG = 'You tame a lady bug.'},
    [18447]    =    {NAME = 'Ironblight',                ID = 29,    TYPE = TYPE_MONSTER,    CHANCE = 30,    FAIL_MSG = { {1, 'The ironblight managed to run away.'}, {2, 'Oh no! The magnet lost its power!'}, {3, 'The ironblight is fighting against the magnetic force.'} }, SUCCESS_MSG = 'You tamed the ironblight.'},
    [18449] =       {NAME = 'Dragonling',                              ID = 31,        TYPE = TYPE_MONSTER,    CHANCE = 30,    FAIL_MSG = { {1, "The dragonling got scared and ran away."}, {3, "The dragonling is trying to nibble."} }, SUCCESS_MSG = "You tamed a dragonling."},
    [18448]    =    {NAME = 'Magma Crawler',            ID = 30,    TYPE = TYPE_MONSTER,    CHANCE = 30,    FAIL_MSG = { {1, 'The magma crawler refused to drink wine and vanishes into thin air.'}, {2, 'Argh! The magma crawler pushed you and you spilled the glow wine!'}, {3, 'The magma crawler is smelling the glow wine suspiciously.'} }, SUCCESS_MSG = 'The magma crawler will accompany you as a friend from now on.'},
    [18516]    =    {NAME = 'Modified Gnarlhound',             ID = 32,    TYPE = TYPE_MONSTER,    CHANCE = 100,    FAIL_MSG = { }, SUCCESS_MSG = 'You now own a modified gnarlhound.'},
    [21452] =       {NAME = 'Gravedigger',                      ID = 39,        TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, "The gravedigger got scared and ran away."}, {3, "The gravedigger is trying to nibble."} }, SUCCESS_MSG = "You tamed the hellgrip."},
    [20138]    =    {NAME = 'Water Buffalo',            ID = 35,    TYPE = TYPE_MONSTER,    CHANCE = 30,    FAIL_MSG = { {1, 'The water buffalo got scared and ran away.'}, {3, 'The water buffalo is trying to nibble.'} }, SUCCESS_MSG = 'You tamed a water buffalo.'},
    [22608]    =    {NAME = 'Shock Head',                 ID = 42,    TYPE = TYPE_MONSTER,    CHANCE = 30,    FAIL_MSG = { {1, 'The shock head ran away.'}, {3, 'The shock head is growling at you.'} }, SUCCESS_MSG = 'You tamed the shock head.'},
    [23550]    =    {NAME = 'Walker',                 ID = 43,    TYPE = TYPE_MONSTER,    CHANCE = 15,    FAIL_MSG = { {2, 'This walker is incompatible with your control unit.'}, {4, 'This walker is incompatible with your control unit.'} }, SUCCESS_MSG = 'You tamed the walker.'},
    [23880]    =    {NAME = 'Noble Lion',                 ID = 40,    TYPE = TYPE_MONSTER,    CHANCE = 30,    FAIL_MSG = { {2, 'The lion got scared and ran away.'}, {4, 'The lion is trying to nibble.'} }, SUCCESS_MSG = 'You tamed the lion.'}
}

local function doFailAction(cid, mount, pos, item, itemEx)
    local action, effect = mount.FAIL_MSG[math.random(#mount.FAIL_MSG)], CONST_ME_POFF
    if(action[1] == ACTION_RUN) then
        Creature(itemEx.uid):remove()
    elseif(action[1] == ACTION_BREAK) then
        effect = CONST_ME_BLOCKHIT
        Item(item.uid):remove(1)
    elseif(action[1] == ACTION_ALL) then
        Creature(itemEx.uid):remove()
        Item(item.uid):remove(1)
    end

    pos:sendMagicEffect(effect)
    Player(cid):say(action[2], TALKTYPE_MONSTER_SAY)
    return action
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
    local targetMonster = Monster(itemEx.uid)
    local targetNpc = Npc(itemEx.uid)
    local targetItem = Item(itemEx.uid)
    local mount = config[item.itemid]
    if mount == nil or player:hasMount(mount.ID) then
        return false
    end

    local rand = math.random(100)
    --Monster Mount
    if targetMonster ~= nil and mount.TYPE == TYPE_MONSTER then
        if Creature(itemEx.uid):getMaster() then
            player:say('You can\'t tame a summon!', TALKTYPE_MONSTER_SAY)
            return true
        end

        if mount.NAME == targetMonster:getName() then
            if rand > mount.CHANCE then
                doFailAction(cid, mount, toPosition, item, itemEx)
                return true
            end

            player:addMount(mount.ID)
            player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)
            targetMonster:remove()

            toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
            Item(item.uid):remove(1)
            return true
        end
    --NPC Mount
    elseif targetNpc ~= nil and mount.TYPE == TYPE_NPC then
        if mount.NAME == targetNpc:getName() then
            if rand > mount.CHANCE then
                doFailAction(cid, mount, toPosition, item, itemEx)
                return true
            end

            player:addMount(mount.ID)
            player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)

            toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
            Item(item.uid):remove(1)
            return true
        end
    --Item Mount
    elseif targetItem ~= nil and mount.TYPE == TYPE_ITEM then
        if mount.NAME == targetItem:getName() then
            if rand > mount.CHANCE then
                doFailAction(cid, mount, toPosition, item, itemEx)
                return true
            end

            player:addMount(mount.ID)
            player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)

            toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
            Item(item.uid):remove(1)
            return true
        end
    --Action Mount
    elseif itemEx.actionid > 0 and mount.TYPE == TYPE_ACTION then
        if(mount.NAME == itemEx.actionid) then
            if rand > mount.CHANCE then
                doFailAction(cid, mount, toPosition, item, itemEx)
                return true
            end

            player:addMount(mount.ID)
            player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)

            toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
            Item(item.uid):remove(1)
            return true
        end
    --Unique Mount
    elseif itemEx.uid <= 65535 and mount.TYPE == TYPE_UNIQUE then
        if mount.NAME == itemEx.uid then
            if rand > mount.CHANCE then
                doFailAction(cid, mount, toPosition, item, itemEx)
                return true
            end

            player:addMount(mount.ID)
            player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)

            toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
            Item(item.uid):remove(1)
            return true
        end
    end
    return false
end

 

 

Editado por luangop
a (veja o histórico de edições)

Te ajudei? Clique em  Gostei ! 

²²²d¬¬b²²²

 

 

"She's got a smile that it seems to me...."  ♪♪

Link para o post
Compartilhar em outros sites
2 minutos atrás, luangop disse:

Simples, você provavelmente só botou o id 2158 na tag do actions mas não botou no script, pois no script não tem mount configurada para o itemid 2158.

tem, é que aquele arquivo é da onde eu peguei - (o meu ta assim [2158]    =    {NAME = 'Black Sheep',                ID = 4,        TYPE = TYPE_MONSTER,)

[Estou usando a distro 8.6 tfs 1.2]

Editado por tiroleivi (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
Agora, tiroleivi disse:

tem, é que aquele arquivo é da onde eu peguei - (o meu ta assim [2158]    =    {NAME = 'Black Sheep',                ID = 4,        TYPE = TYPE_MONSTER,)

Quando posta erro, tem que postar o script que você ta usando, se vc modificou o script já alterou as posições de linha, e eu já procurei por erro na linha errada...

Te ajudei? Clique em  Gostei ! 

²²²d¬¬b²²²

 

 

"She's got a smile that it seems to me...."  ♪♪

Link para o post
Compartilhar em outros sites
Agora, luangop disse:

Quando posta erro, tem que postar o script que você ta usando, se vc modificou o script já alterou as posições de linha, e eu já procurei por erro na linha errada...

é pq vc falou postar em CODE fico tudo bugado, tendeu ?

Link para o post
Compartilhar em outros sites
Agora, tiroleivi disse:

é pq vc falou postar em CODE fico tudo bugado, tendeu ?

Cara, isso não implica em nada, se vc tem um script com problema, e posta outro, nunca vou poder ajudar.

Te ajudei? Clique em  Gostei ! 

²²²d¬¬b²²²

 

 

"She's got a smile that it seems to me...."  ♪♪

Link para o post
Compartilhar em outros sites
1 minuto atrás, luangop disse:

Cara, isso não implica em nada, se vc tem um script com problema, e posta outro, nunca vou poder ajudar.

 

taming.lua

local ACTION_RUN, ACTION_BREAK, ACTION_NONE, ACTION_ALL = 1, 2, 3, 4
local TYPE_MONSTER, TYPE_NPC, TYPE_ITEM, TYPE_ACTION, TYPE_UNIQUE = 1, 2, 3, 4, 5

local config = {
    [5907]    =    {NAME = 'Bear',                    ID = 3,        TYPE = TYPE_MONSTER,    CHANCE = 20,    FAIL_MSG = { {1, 'The bear ran away.'}, {2, 'Oh no! The slingshot broke.'}, {3, 'The bear is trying to hit you with its claws.'} },SUCCESS_MSG = 'You have tamed the bear.'},
    [2158]    =    {NAME = 'Black Sheep',                ID = 4,        TYPE = TYPE_MONSTER,    CHANCE = 25,    FAIL_MSG = { {1, 'The black sheep ran away.'}, {2, 'Oh no! The reins were torn.'}, {3, 'The black sheep is trying to run away.'} },SUCCESS_MSG = 'You have tamed the sheep.'},
    [13293]    =    {NAME = 'Midnight Panther',            ID = 5,        TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The panther has escaped.'}, {2, 'The whip broke.'} },SUCCESS_MSG = 'You have tamed the panther.'},
    [13298]    =    {NAME = 'Terror Bird',                ID = 2,        TYPE = TYPE_MONSTER,    CHANCE = 15,    FAIL_MSG = { {1, 'The bird ran away.'}, {3, 'The terror bird is pecking you.'} }, SUCCESS_MSG = 'You have tamed the bird.'},
    [13247]    =    {NAME = 'Boar',                    ID = 10,    TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The boar has run away'}, {3, 'The boar attacks you.'} }, SUCCESS_MSG = 'You have tamed the boar.'},
    [13305]    =    {NAME = 'Crustacea Gigantica',            ID = 7,        TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The crustacea has run away.'}, {2, 'The crustacea ate the shrimp.'} }, SUCCESS_MSG = 'You have tamed the crustacea.'},
    [13291]    =    {NAME = 'Undead Cavebear',            ID = 12,    TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The undead bear has run away.'} }, SUCCESS_MSG = 'You have tamed the skeleton.'},
    [13307]    =    {NAME = 'Wailing Widow',            ID = 1,        TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The widow has run away.'}, {2, 'The widow has eaten the sweet bait.'} }, SUCCESS_MSG = 'You have tamed the widow.'},
    [13292]    =    {NAME = 'inoperative tin lizzard',        ID = 8,        TYPE = TYPE_ITEM,    CHANCE = 40,    FAIL_MSG = { {2, 'The key broke inside.'} }, SUCCESS_MSG = 'You wind up the tin lizzard.'},
    [13294]    =    {NAME = 'Draptor',                ID = 6,        TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The draptor has run away.'}, {3, 'The draptor has fled.'} }, SUCCESS_MSG = 'You have tamed the draptor.'},
    [13536]    =    {NAME = 'Crystal Wolf',                ID = 16,    TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The wolf has run away.'} }, SUCCESS_MSG = 'You have tamed the wolf.'},
    [13539]    =    {NAME = 'Enraged White Deer',            ID = 18,    TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {2, 'The cone broke.'}, {3, 'The deer has fled in fear.'} }, SUCCESS_MSG = 'You have tamed the deer.'},
    [13538]    =    {NAME = 'Panda',                ID = 19,    TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {4, 'Panda ate the leaves and ran away.'} }, SUCCESS_MSG = 'You have tamed the panda.'},
    [13535]    =    {NAME = 'Dromedary',                ID = 20,    TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'Dromedary has run away.'} }, SUCCESS_MSG = 'You have tamed the dromedary.'},
    [13498]    =    {NAME = 'Sandstone Scorpion',            ID = 21,    TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The scorpion has vanished.'}, {2, 'Scorpion broken the sceptre.'} }, SUCCESS_MSG = 'You have tamed the scorpion.'},
    [13537]    =    {NAME = 'Donkey',                ID = 13,    TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The witch has escaped!'} }, SUCCESS_MSG = 'You have tamed the mule.'},
    [13938]    =    {NAME = 'inoperative uniwheel',            ID = 15,    TYPE = TYPE_ITEM,    CHANCE = 40,    FAIL_MSG = { {3, 'The oil have no effect.'}, {2, 'Splosh!'} }, SUCCESS_MSG = 'The strange wheel seems to vibrate and slowly starts turning continuously.'},
    [13508]    =    {NAME = 'Slug',                    ID = 14,    TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, 'The slug has run away.'}, {3, 'The drug had no effect.'} }, SUCCESS_MSG = 'You have tamed the slug.'},
    [13939]    =    {NAME = 'Wild Horse',                ID = 17,    TYPE = TYPE_MONSTER,    CHANCE = 15,    FAIL_MSG = { {1, 'The horse runs away.'}, {2, 'The horse ate the oats.'} }, SUCCESS_MSG = 'You have tamed the horse.'},
    [15545]    =    {NAME = 'Manta Ray',                ID = 28,    TYPE = TYPE_MONSTER,    CHANCE = 30,    FAIL_MSG = { {1, 'The manta ray fled.'}, {3, 'The manta ray is trying to escape.'} }, SUCCESS_MSG = 'You have tamed the manta ray.'},
    [15546]    =    {NAME = 'Lady Bug',                ID = 27,    TYPE = TYPE_MONSTER,    CHANCE = 30,    FAIL_MSG = { {1, 'The ladybug got scared and ran away.'}, {3, 'The ladybug is trying to nibble.'} }, SUCCESS_MSG = 'You tame a lady bug.'},
    [18447]    =    {NAME = 'Ironblight',                ID = 29,    TYPE = TYPE_MONSTER,    CHANCE = 30,    FAIL_MSG = { {1, 'The ironblight managed to run away.'}, {2, 'Oh no! The magnet lost its power!'}, {3, 'The ironblight is fighting against the magnetic force.'} }, SUCCESS_MSG = 'You tamed the ironblight.'},
    [18449] =       {NAME = 'Dragonling',                              ID = 31,        TYPE = TYPE_MONSTER,    CHANCE = 30,    FAIL_MSG = { {1, "The dragonling got scared and ran away."}, {3, "The dragonling is trying to nibble."} }, SUCCESS_MSG = "You tamed a dragonling."},
    [18448]    =    {NAME = 'Magma Crawler',            ID = 30,    TYPE = TYPE_MONSTER,    CHANCE = 30,    FAIL_MSG = { {1, 'The magma crawler refused to drink wine and vanishes into thin air.'}, {2, 'Argh! The magma crawler pushed you and you spilled the glow wine!'}, {3, 'The magma crawler is smelling the glow wine suspiciously.'} }, SUCCESS_MSG = 'The magma crawler will accompany you as a friend from now on.'},
    [18516]    =    {NAME = 'Modified Gnarlhound',             ID = 32,    TYPE = TYPE_MONSTER,    CHANCE = 100,    FAIL_MSG = { }, SUCCESS_MSG = 'You now own a modified gnarlhound.'},
    [21452] =       {NAME = 'Gravedigger',                      ID = 39,        TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, "The gravedigger got scared and ran away."}, {3, "The gravedigger is trying to nibble."} }, SUCCESS_MSG = "You tamed the hellgrip."},
    [20138]    =    {NAME = 'Water Buffalo',            ID = 35,    TYPE = TYPE_MONSTER,    CHANCE = 30,    FAIL_MSG = { {1, 'The water buffalo got scared and ran away.'}, {3, 'The water buffalo is trying to nibble.'} }, SUCCESS_MSG = 'You tamed a water buffalo.'},
    [22608]    =    {NAME = 'Shock Head',                 ID = 42,    TYPE = TYPE_MONSTER,    CHANCE = 30,    FAIL_MSG = { {1, 'The shock head ran away.'}, {3, 'The shock head is growling at you.'} }, SUCCESS_MSG = 'You tamed the shock head.'},
    [23550]    =    {NAME = 'Walker',                 ID = 43,    TYPE = TYPE_MONSTER,    CHANCE = 15,    FAIL_MSG = { {2, 'This walker is incompatible with your control unit.'}, {4, 'This walker is incompatible with your control unit.'} }, SUCCESS_MSG = 'You tamed the walker.'},
    [23880]    =    {NAME = 'Noble Lion',                 ID = 40,    TYPE = TYPE_MONSTER,    CHANCE = 30,    FAIL_MSG = { {2, 'The lion got scared and ran away.'}, {4, 'The lion is trying to nibble.'} }, SUCCESS_MSG = 'You tamed the lion.'}
}

local function doFailAction(cid, mount, pos, item, itemEx)
    local action, effect = mount.FAIL_MSG[math.random(#mount.FAIL_MSG)], CONST_ME_POFF
    if(action[1] == ACTION_RUN) then
        Creature(itemEx.uid):remove()
    elseif(action[1] == ACTION_BREAK) then
        effect = CONST_ME_BLOCKHIT
        Item(item.uid):remove(1)
    elseif(action[1] == ACTION_ALL) then
        Creature(itemEx.uid):remove()
        Item(item.uid):remove(1)
    end

    pos:sendMagicEffect(effect)
    Player(cid):say(action[2], TALKTYPE_MONSTER_SAY)
    return action
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
    local targetMonster = Monster(itemEx.uid)
    local targetNpc = Npc(itemEx.uid)
    local targetItem = Item(itemEx.uid)
    local mount = config[item.itemid]
    if mount == nil or player:hasMount(mount.ID) then
        return false
    end

    local rand = math.random(100)
    --Monster Mount
    if targetMonster ~= nil and mount.TYPE == TYPE_MONSTER then
        if Creature(itemEx.uid):getMaster() then
            player:say('You can\'t tame a summon!', TALKTYPE_MONSTER_SAY)
            return true
        end

        if mount.NAME == targetMonster:getName() then
            if rand > mount.CHANCE then
                doFailAction(cid, mount, toPosition, item, itemEx)
                return true
            end

            player:addMount(mount.ID)
            player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)
            targetMonster:remove()

            toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
            Item(item.uid):remove(1)
            return true
        end
    --NPC Mount
    elseif targetNpc ~= nil and mount.TYPE == TYPE_NPC then
        if mount.NAME == targetNpc:getName() then
            if rand > mount.CHANCE then
                doFailAction(cid, mount, toPosition, item, itemEx)
                return true
            end

            player:addMount(mount.ID)
            player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)

            toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
            Item(item.uid):remove(1)
            return true
        end
    --Item Mount
    elseif targetItem ~= nil and mount.TYPE == TYPE_ITEM then
        if mount.NAME == targetItem:getName() then
            if rand > mount.CHANCE then
                doFailAction(cid, mount, toPosition, item, itemEx)
                return true
            end

            player:addMount(mount.ID)
            player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)

            toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
            Item(item.uid):remove(1)
            return true
        end
    --Action Mount
    elseif itemEx.actionid > 0 and mount.TYPE == TYPE_ACTION then
        if(mount.NAME == itemEx.actionid) then
            if rand > mount.CHANCE then
                doFailAction(cid, mount, toPosition, item, itemEx)
                return true
            end

            player:addMount(mount.ID)
            player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)

            toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
            Item(item.uid):remove(1)
            return true
        end
    --Unique Mount
    elseif itemEx.uid <= 65535 and mount.TYPE == TYPE_UNIQUE then
        if mount.NAME == itemEx.uid then
            if rand > mount.CHANCE then
                doFailAction(cid, mount, toPosition, item, itemEx)
                return true
            end

            player:addMount(mount.ID)
            player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)

            toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
            Item(item.uid):remove(1)
            return true
        end
    end
    return false
end

 

action.xml

<action itemid="13941" script="other/cup of molten gold.lua"/>
    <action itemid="5907" script="other/taming.lua"/>
    <action itemid="13247" script="other/taming.lua"/>
    <action itemid="13291" script="other/taming.lua"/>
    <action itemid="13292" script="other/taming.lua"/>
    <action itemid="13293" script="other/taming.lua"/>
    <action itemid="13294" script="other/taming.lua"/>
    <action itemid="2158" script="other/taming.lua"/>
    <action itemid="13298" script="other/taming.lua"/>
    <action itemid="13305" script="other/taming.lua"/>
    <action itemid="13307" script="other/taming.lua"/>
    <action itemid="13508" script="other/taming.lua"/>
    <action itemid="13535" script="other/taming.lua"/>
    <action itemid="13536" script="other/taming.lua"/>
    <action itemid="13537" script="other/taming.lua"/>
    <action itemid="13538" script="other/taming.lua"/>
    <action itemid="13539" script="other/taming.lua"/>
    <action itemid="13938" script="other/taming.lua"/>
    <action itemid="13939" script="other/taming.lua"/>
    <action itemid="13498" script="other/taming.lua"/>
    <action itemid="15545" script="other/taming.lua"/>
    <action itemid="15546" script="other/taming.lua"/>
    <action itemid="20138" script="other/taming.lua"/>
    <action itemid="21452" script="other/taming.lua"/>
    <action itemid="22608" script="other/taming.lua"/>
    <action itemid="18449" script="other/taming.lua"/>
    <action itemid="18447" script="other/taming.lua"/>
    <action itemid="18448" script="other/taming.lua"/>
    <action itemid="18516" script="other/taming.lua"/>
    <action itemid="23550" script="other/taming.lua"/>
    <action itemid="23880" script="other/taming.lua"/>
    <action itemid="18511" script="other/taming.lua"/>

 

Link para o post
Compartilhar em outros sites

Velho, analisei de vários lados, e me parece tudo certo.

Ultima coisa que penso no momento são:
Ou seu servidor está faltando a function player:hasMount, ou a identação está atrapalhando.

Para eliminar a possibilidade da identação, teste assim:
 

local ACTION_RUN, ACTION_BREAK, ACTION_NONE, ACTION_ALL = 1, 2, 3, 4
local TYPE_MONSTER, TYPE_NPC, TYPE_ITEM, TYPE_ACTION, TYPE_UNIQUE = 1, 2, 3, 4, 5

local config = {
	[5907] = {NAME = 'Bear', ID = 3, TYPE = TYPE_MONSTER, CHANCE = 20, FAIL_MSG = { {1, 'The bear ran away.'}, {2, 'Oh no! The slingshot broke.'}, {3, 'The bear is trying to hit you with its claws.'} },SUCCESS_MSG = 'You have tamed the bear.'},
	[2158] = {NAME = 'Black Sheep', ID = 4, TYPE = TYPE_MONSTER, CHANCE = 25, FAIL_MSG = { {1, 'The black sheep ran away.'}, {2, 'Oh no! The reins were torn.'}, {3, 'The black sheep is trying to run away.'} },SUCCESS_MSG = 'You have tamed the sheep.'},
	[13293] = {NAME = 'Midnight Panther', ID = 5, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The panther has escaped.'}, {2, 'The whip broke.'} },SUCCESS_MSG = 'You have tamed the panther.'},
	[13298] = {NAME = 'Terror Bird', ID = 2, TYPE = TYPE_MONSTER, CHANCE = 15, FAIL_MSG = { {1, 'The bird ran away.'}, {3, 'The terror bird is pecking you.'} }, SUCCESS_MSG = 'You have tamed the bird.'},
	[13247] = {NAME = 'Boar', ID = 10, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The boar has run away'}, {3, 'The boar attacks you.'} }, SUCCESS_MSG = 'You have tamed the boar.'},
	[13305] = {NAME = 'Crustacea Gigantica', ID = 7, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The crustacea has run away.'}, {2, 'The crustacea ate the shrimp.'} }, SUCCESS_MSG = 'You have tamed the crustacea.'},
	[13291] = {NAME = 'Undead Cavebear', ID = 12, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The undead bear has run away.'} }, SUCCESS_MSG = 'You have tamed the skeleton.'},
	[13307] = {NAME = 'Wailing Widow', ID = 1, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The widow has run away.'}, {2, 'The widow has eaten the sweet bait.'} }, SUCCESS_MSG = 'You have tamed the widow.'},
	[13292] = {NAME = 'inoperative tin lizzard', ID = 8, TYPE = TYPE_ITEM, CHANCE = 40, FAIL_MSG = { {2, 'The key broke inside.'} }, SUCCESS_MSG = 'You wind up the tin lizzard.'},
	[13294] = {NAME = 'Draptor', ID = 6, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The draptor has run away.'}, {3, 'The draptor has fled.'} }, SUCCESS_MSG = 'You have tamed the draptor.'},
	[13536] = {NAME = 'Crystal Wolf', ID = 16, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The wolf has run away.'} }, SUCCESS_MSG = 'You have tamed the wolf.'},
	[13539] = {NAME = 'Enraged White Deer', ID = 18, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {2, 'The cone broke.'}, {3, 'The deer has fled in fear.'} }, SUCCESS_MSG = 'You have tamed the deer.'},
	[13538] = {NAME = 'Panda', ID = 19, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {4, 'Panda ate the leaves and ran away.'} }, SUCCESS_MSG = 'You have tamed the panda.'},
	[13535] = {NAME = 'Dromedary', ID = 20, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'Dromedary has run away.'} }, SUCCESS_MSG = 'You have tamed the dromedary.'},
	[13498] = {NAME = 'Sandstone Scorpion', ID = 21, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The scorpion has vanished.'}, {2, 'Scorpion broken the sceptre.'} }, SUCCESS_MSG = 'You have tamed the scorpion.'},
	[13537] = {NAME = 'Donkey', ID = 13, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The witch has escaped!'} }, SUCCESS_MSG = 'You have tamed the mule.'},
	[13938] = {NAME = 'inoperative uniwheel', ID = 15, TYPE = TYPE_ITEM, CHANCE = 40, FAIL_MSG = { {3, 'The oil have no effect.'}, {2, 'Splosh!'} }, SUCCESS_MSG = 'The strange wheel seems to vibrate and slowly starts turning continuously.'},
	[13508] = {NAME = 'Slug', ID = 14, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The slug has run away.'}, {3, 'The drug had no effect.'} }, SUCCESS_MSG = 'You have tamed the slug.'},
	[13939] = {NAME = 'Wild Horse', ID = 17, TYPE = TYPE_MONSTER, CHANCE = 15, FAIL_MSG = { {1, 'The horse runs away.'}, {2, 'The horse ate the oats.'} }, SUCCESS_MSG = 'You have tamed the horse.'},
	[15545] = {NAME = 'Manta Ray', ID = 28, TYPE = TYPE_MONSTER, CHANCE = 30, FAIL_MSG = { {1, 'The manta ray fled.'}, {3, 'The manta ray is trying to escape.'} }, SUCCESS_MSG = 'You have tamed the manta ray.'},
	[15546] = {NAME = 'Lady Bug', ID = 27, TYPE = TYPE_MONSTER, CHANCE = 30, FAIL_MSG = { {1, 'The ladybug got scared and ran away.'}, {3, 'The ladybug is trying to nibble.'} }, SUCCESS_MSG = 'You tame a lady bug.'},
	[18447] = {NAME = 'Ironblight', ID = 29, TYPE = TYPE_MONSTER, CHANCE = 30, FAIL_MSG = { {1, 'The ironblight managed to run away.'}, {2, 'Oh no! The magnet lost its power!'}, {3, 'The ironblight is fighting against the magnetic force.'} }, SUCCESS_MSG = 'You tamed the ironblight.'},
	[18449] = {NAME = 'Dragonling', ID = 31, TYPE = TYPE_MONSTER, CHANCE = 30, FAIL_MSG = { {1, "The dragonling got scared and ran away."}, {3, "The dragonling is trying to nibble."} }, SUCCESS_MSG = "You tamed a dragonling."},
	[18448] = {NAME = 'Magma Crawler', ID = 30, TYPE = TYPE_MONSTER, CHANCE = 30, FAIL_MSG = { {1, 'The magma crawler refused to drink wine and vanishes into thin air.'}, {2, 'Argh! The magma crawler pushed you and you spilled the glow wine!'}, {3, 'The magma crawler is smelling the glow wine suspiciously.'} }, SUCCESS_MSG = 'The magma crawler will accompany you as a friend from now on.'},
	[18516] = {NAME = 'Modified Gnarlhound', ID = 32, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { }, SUCCESS_MSG = 'You now own a modified gnarlhound.'},
	[21452] = {NAME = 'Gravedigger', ID = 39, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, "The gravedigger got scared and ran away."}, {3, "The gravedigger is trying to nibble."} }, SUCCESS_MSG = "You tamed the hellgrip."},
	[20138] = {NAME = 'Water Buffalo', ID = 35, TYPE = TYPE_MONSTER, CHANCE = 30, FAIL_MSG = { {1, 'The water buffalo got scared and ran away.'}, {3, 'The water buffalo is trying to nibble.'} }, SUCCESS_MSG = 'You tamed a water buffalo.'},
	[22608] = {NAME = 'Shock Head', ID = 42, TYPE = TYPE_MONSTER, CHANCE = 30, FAIL_MSG = { {1, 'The shock head ran away.'}, {3, 'The shock head is growling at you.'} }, SUCCESS_MSG = 'You tamed the shock head.'},
	[23550] = {NAME = 'Walker', ID = 43, TYPE = TYPE_MONSTER, CHANCE = 15, FAIL_MSG = { {2, 'This walker is incompatible with your control unit.'}, {4, 'This walker is incompatible with your control unit.'} }, SUCCESS_MSG = 'You tamed the walker.'},
	[23880] = {NAME = 'Noble Lion', ID = 40, TYPE = TYPE_MONSTER, CHANCE = 30, FAIL_MSG = { {2, 'The lion got scared and ran away.'}, {4, 'The lion is trying to nibble.'} }, SUCCESS_MSG = 'You tamed the lion.'}
}

local function doFailAction(cid, mount, pos, item, itemEx)
	local action, effect = mount.FAIL_MSG[math.random(#mount.FAIL_MSG)], CONST_ME_POFF
	if(action[1] == ACTION_RUN) then
		Creature(itemEx.uid):remove()
	elseif(action[1] == ACTION_BREAK) then
		effect = CONST_ME_BLOCKHIT
		Item(item.uid):remove(1)
	elseif(action[1] == ACTION_ALL) then
		Creature(itemEx.uid):remove()
		Item(item.uid):remove(1)
	end
	
	pos:sendMagicEffect(effect)
	Player(cid):say(action[2], TALKTYPE_MONSTER_SAY)
	return action
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local player = Player(cid)
	local targetMonster = Monster(itemEx.uid)
	local targetNpc = Npc(itemEx.uid)
	local targetItem = Item(itemEx.uid)
	local mount = config[item.itemid]
	if mount == nil or player:hasMount(mount.ID) then
		return false
	end
	
	local rand = math.random(100)
	--Monster Mount
	if targetMonster ~= nil and mount.TYPE == TYPE_MONSTER then
		if Creature(itemEx.uid):getMaster() then
			player:say('You can\'t tame a summon!', TALKTYPE_MONSTER_SAY)
			return true
		end
		
		if mount.NAME == targetMonster:getName() then
			if rand > mount.CHANCE then
				doFailAction(cid, mount, toPosition, item, itemEx)
				return true
			end
			
			player:addMount(mount.ID)
			player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)
			targetMonster:remove()
			
			toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
			Item(item.uid):remove(1)
			return true
		end
		--NPC Mount
	elseif targetNpc ~= nil and mount.TYPE == TYPE_NPC then
		if mount.NAME == targetNpc:getName() then
			if rand > mount.CHANCE then
				doFailAction(cid, mount, toPosition, item, itemEx)
				return true
			end
			
			player:addMount(mount.ID)
			player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)
			
			toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
			Item(item.uid):remove(1)
			return true
		end
		--Item Mount
	elseif targetItem ~= nil and mount.TYPE == TYPE_ITEM then
		if mount.NAME == targetItem:getName() then
			if rand > mount.CHANCE then
				doFailAction(cid, mount, toPosition, item, itemEx)
				return true
			end
			
			player:addMount(mount.ID)
			player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)
			
			toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
			Item(item.uid):remove(1)
			return true
		end
		--Action Mount
	elseif itemEx.actionid > 0 and mount.TYPE == TYPE_ACTION then
		if(mount.NAME == itemEx.actionid) then
			if rand > mount.CHANCE then
				doFailAction(cid, mount, toPosition, item, itemEx)
				return true
			end
			
			player:addMount(mount.ID)
			player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)
			
			toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
			Item(item.uid):remove(1)
			return true
		end
		--Unique Mount
	elseif itemEx.uid <= 65535 and mount.TYPE == TYPE_UNIQUE then
		if mount.NAME == itemEx.uid then
			if rand > mount.CHANCE then
				doFailAction(cid, mount, toPosition, item, itemEx)
				return true
			end
			
			player:addMount(mount.ID)
			player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)
			
			toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
			Item(item.uid):remove(1)
			return true
		end
	end
	return false
end

 

Te ajudei? Clique em  Gostei ! 

²²²d¬¬b²²²

 

 

"She's got a smile that it seems to me...."  ♪♪

Link para o post
Compartilhar em outros sites
43 minutos atrás, luangop disse:

Velho, analisei de vários lados, e me parece tudo certo.

Ultima coisa que penso no momento são:
Ou seu servidor está faltando a function player:hasMount, ou a identação está atrapalhando.

Para eliminar a possibilidade da identação, teste assim:
 


local ACTION_RUN, ACTION_BREAK, ACTION_NONE, ACTION_ALL = 1, 2, 3, 4
local TYPE_MONSTER, TYPE_NPC, TYPE_ITEM, TYPE_ACTION, TYPE_UNIQUE = 1, 2, 3, 4, 5

local config = {
	[5907] = {NAME = 'Bear', ID = 3, TYPE = TYPE_MONSTER, CHANCE = 20, FAIL_MSG = { {1, 'The bear ran away.'}, {2, 'Oh no! The slingshot broke.'}, {3, 'The bear is trying to hit you with its claws.'} },SUCCESS_MSG = 'You have tamed the bear.'},
	[2158] = {NAME = 'Black Sheep', ID = 4, TYPE = TYPE_MONSTER, CHANCE = 25, FAIL_MSG = { {1, 'The black sheep ran away.'}, {2, 'Oh no! The reins were torn.'}, {3, 'The black sheep is trying to run away.'} },SUCCESS_MSG = 'You have tamed the sheep.'},
	[13293] = {NAME = 'Midnight Panther', ID = 5, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The panther has escaped.'}, {2, 'The whip broke.'} },SUCCESS_MSG = 'You have tamed the panther.'},
	[13298] = {NAME = 'Terror Bird', ID = 2, TYPE = TYPE_MONSTER, CHANCE = 15, FAIL_MSG = { {1, 'The bird ran away.'}, {3, 'The terror bird is pecking you.'} }, SUCCESS_MSG = 'You have tamed the bird.'},
	[13247] = {NAME = 'Boar', ID = 10, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The boar has run away'}, {3, 'The boar attacks you.'} }, SUCCESS_MSG = 'You have tamed the boar.'},
	[13305] = {NAME = 'Crustacea Gigantica', ID = 7, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The crustacea has run away.'}, {2, 'The crustacea ate the shrimp.'} }, SUCCESS_MSG = 'You have tamed the crustacea.'},
	[13291] = {NAME = 'Undead Cavebear', ID = 12, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The undead bear has run away.'} }, SUCCESS_MSG = 'You have tamed the skeleton.'},
	[13307] = {NAME = 'Wailing Widow', ID = 1, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The widow has run away.'}, {2, 'The widow has eaten the sweet bait.'} }, SUCCESS_MSG = 'You have tamed the widow.'},
	[13292] = {NAME = 'inoperative tin lizzard', ID = 8, TYPE = TYPE_ITEM, CHANCE = 40, FAIL_MSG = { {2, 'The key broke inside.'} }, SUCCESS_MSG = 'You wind up the tin lizzard.'},
	[13294] = {NAME = 'Draptor', ID = 6, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The draptor has run away.'}, {3, 'The draptor has fled.'} }, SUCCESS_MSG = 'You have tamed the draptor.'},
	[13536] = {NAME = 'Crystal Wolf', ID = 16, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The wolf has run away.'} }, SUCCESS_MSG = 'You have tamed the wolf.'},
	[13539] = {NAME = 'Enraged White Deer', ID = 18, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {2, 'The cone broke.'}, {3, 'The deer has fled in fear.'} }, SUCCESS_MSG = 'You have tamed the deer.'},
	[13538] = {NAME = 'Panda', ID = 19, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {4, 'Panda ate the leaves and ran away.'} }, SUCCESS_MSG = 'You have tamed the panda.'},
	[13535] = {NAME = 'Dromedary', ID = 20, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'Dromedary has run away.'} }, SUCCESS_MSG = 'You have tamed the dromedary.'},
	[13498] = {NAME = 'Sandstone Scorpion', ID = 21, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The scorpion has vanished.'}, {2, 'Scorpion broken the sceptre.'} }, SUCCESS_MSG = 'You have tamed the scorpion.'},
	[13537] = {NAME = 'Donkey', ID = 13, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The witch has escaped!'} }, SUCCESS_MSG = 'You have tamed the mule.'},
	[13938] = {NAME = 'inoperative uniwheel', ID = 15, TYPE = TYPE_ITEM, CHANCE = 40, FAIL_MSG = { {3, 'The oil have no effect.'}, {2, 'Splosh!'} }, SUCCESS_MSG = 'The strange wheel seems to vibrate and slowly starts turning continuously.'},
	[13508] = {NAME = 'Slug', ID = 14, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, 'The slug has run away.'}, {3, 'The drug had no effect.'} }, SUCCESS_MSG = 'You have tamed the slug.'},
	[13939] = {NAME = 'Wild Horse', ID = 17, TYPE = TYPE_MONSTER, CHANCE = 15, FAIL_MSG = { {1, 'The horse runs away.'}, {2, 'The horse ate the oats.'} }, SUCCESS_MSG = 'You have tamed the horse.'},
	[15545] = {NAME = 'Manta Ray', ID = 28, TYPE = TYPE_MONSTER, CHANCE = 30, FAIL_MSG = { {1, 'The manta ray fled.'}, {3, 'The manta ray is trying to escape.'} }, SUCCESS_MSG = 'You have tamed the manta ray.'},
	[15546] = {NAME = 'Lady Bug', ID = 27, TYPE = TYPE_MONSTER, CHANCE = 30, FAIL_MSG = { {1, 'The ladybug got scared and ran away.'}, {3, 'The ladybug is trying to nibble.'} }, SUCCESS_MSG = 'You tame a lady bug.'},
	[18447] = {NAME = 'Ironblight', ID = 29, TYPE = TYPE_MONSTER, CHANCE = 30, FAIL_MSG = { {1, 'The ironblight managed to run away.'}, {2, 'Oh no! The magnet lost its power!'}, {3, 'The ironblight is fighting against the magnetic force.'} }, SUCCESS_MSG = 'You tamed the ironblight.'},
	[18449] = {NAME = 'Dragonling', ID = 31, TYPE = TYPE_MONSTER, CHANCE = 30, FAIL_MSG = { {1, "The dragonling got scared and ran away."}, {3, "The dragonling is trying to nibble."} }, SUCCESS_MSG = "You tamed a dragonling."},
	[18448] = {NAME = 'Magma Crawler', ID = 30, TYPE = TYPE_MONSTER, CHANCE = 30, FAIL_MSG = { {1, 'The magma crawler refused to drink wine and vanishes into thin air.'}, {2, 'Argh! The magma crawler pushed you and you spilled the glow wine!'}, {3, 'The magma crawler is smelling the glow wine suspiciously.'} }, SUCCESS_MSG = 'The magma crawler will accompany you as a friend from now on.'},
	[18516] = {NAME = 'Modified Gnarlhound', ID = 32, TYPE = TYPE_MONSTER, CHANCE = 100, FAIL_MSG = { }, SUCCESS_MSG = 'You now own a modified gnarlhound.'},
	[21452] = {NAME = 'Gravedigger', ID = 39, TYPE = TYPE_MONSTER, CHANCE = 40, FAIL_MSG = { {1, "The gravedigger got scared and ran away."}, {3, "The gravedigger is trying to nibble."} }, SUCCESS_MSG = "You tamed the hellgrip."},
	[20138] = {NAME = 'Water Buffalo', ID = 35, TYPE = TYPE_MONSTER, CHANCE = 30, FAIL_MSG = { {1, 'The water buffalo got scared and ran away.'}, {3, 'The water buffalo is trying to nibble.'} }, SUCCESS_MSG = 'You tamed a water buffalo.'},
	[22608] = {NAME = 'Shock Head', ID = 42, TYPE = TYPE_MONSTER, CHANCE = 30, FAIL_MSG = { {1, 'The shock head ran away.'}, {3, 'The shock head is growling at you.'} }, SUCCESS_MSG = 'You tamed the shock head.'},
	[23550] = {NAME = 'Walker', ID = 43, TYPE = TYPE_MONSTER, CHANCE = 15, FAIL_MSG = { {2, 'This walker is incompatible with your control unit.'}, {4, 'This walker is incompatible with your control unit.'} }, SUCCESS_MSG = 'You tamed the walker.'},
	[23880] = {NAME = 'Noble Lion', ID = 40, TYPE = TYPE_MONSTER, CHANCE = 30, FAIL_MSG = { {2, 'The lion got scared and ran away.'}, {4, 'The lion is trying to nibble.'} }, SUCCESS_MSG = 'You tamed the lion.'}
}

local function doFailAction(cid, mount, pos, item, itemEx)
	local action, effect = mount.FAIL_MSG[math.random(#mount.FAIL_MSG)], CONST_ME_POFF
	if(action[1] == ACTION_RUN) then
		Creature(itemEx.uid):remove()
	elseif(action[1] == ACTION_BREAK) then
		effect = CONST_ME_BLOCKHIT
		Item(item.uid):remove(1)
	elseif(action[1] == ACTION_ALL) then
		Creature(itemEx.uid):remove()
		Item(item.uid):remove(1)
	end
	
	pos:sendMagicEffect(effect)
	Player(cid):say(action[2], TALKTYPE_MONSTER_SAY)
	return action
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local player = Player(cid)
	local targetMonster = Monster(itemEx.uid)
	local targetNpc = Npc(itemEx.uid)
	local targetItem = Item(itemEx.uid)
	local mount = config[item.itemid]
	if mount == nil or player:hasMount(mount.ID) then
		return false
	end
	
	local rand = math.random(100)
	--Monster Mount
	if targetMonster ~= nil and mount.TYPE == TYPE_MONSTER then
		if Creature(itemEx.uid):getMaster() then
			player:say('You can\'t tame a summon!', TALKTYPE_MONSTER_SAY)
			return true
		end
		
		if mount.NAME == targetMonster:getName() then
			if rand > mount.CHANCE then
				doFailAction(cid, mount, toPosition, item, itemEx)
				return true
			end
			
			player:addMount(mount.ID)
			player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)
			targetMonster:remove()
			
			toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
			Item(item.uid):remove(1)
			return true
		end
		--NPC Mount
	elseif targetNpc ~= nil and mount.TYPE == TYPE_NPC then
		if mount.NAME == targetNpc:getName() then
			if rand > mount.CHANCE then
				doFailAction(cid, mount, toPosition, item, itemEx)
				return true
			end
			
			player:addMount(mount.ID)
			player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)
			
			toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
			Item(item.uid):remove(1)
			return true
		end
		--Item Mount
	elseif targetItem ~= nil and mount.TYPE == TYPE_ITEM then
		if mount.NAME == targetItem:getName() then
			if rand > mount.CHANCE then
				doFailAction(cid, mount, toPosition, item, itemEx)
				return true
			end
			
			player:addMount(mount.ID)
			player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)
			
			toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
			Item(item.uid):remove(1)
			return true
		end
		--Action Mount
	elseif itemEx.actionid > 0 and mount.TYPE == TYPE_ACTION then
		if(mount.NAME == itemEx.actionid) then
			if rand > mount.CHANCE then
				doFailAction(cid, mount, toPosition, item, itemEx)
				return true
			end
			
			player:addMount(mount.ID)
			player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)
			
			toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
			Item(item.uid):remove(1)
			return true
		end
		--Unique Mount
	elseif itemEx.uid <= 65535 and mount.TYPE == TYPE_UNIQUE then
		if mount.NAME == itemEx.uid then
			if rand > mount.CHANCE then
				doFailAction(cid, mount, toPosition, item, itemEx)
				return true
			end
			
			player:addMount(mount.ID)
			player:say(mount.SUCCESS_MSG, TALKTYPE_MONSTER_SAY)
			
			toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
			Item(item.uid):remove(1)
			return true
		end
	end
	return false
end

 

l47xbFXtS6_J0vOTeZzg_A.png

Link para o post
Compartilhar em outros sites

@tiroleivi o erro é o fato do script está chamando o meta método(method) hasMount, que verifica se o player tem tal montaria, porém esse method não existe nessa versão, como você pode ver no repositório do tfs que você está usando: https://github.com/ninjalulz/forgottenserver/blob/8.6/src/luascript.cpp

 

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Link para o post
Compartilhar em outros sites
Em 22/07/2017 ás 19:16, KotZletY disse:

@tiroleivi o erro é o fato do script está chamando o meta método(method) hasMount, que verifica se o player tem tal montaria, porém esse method não existe nessa versão, como você pode ver no repositório do tfs que você está usando: https://github.com/ninjalulz/forgottenserver/blob/8.6/src/luascript.cpp

 

 

se eu adicionar na source funcionaria ?

Link para o post
Compartilhar em outros sites
5 minutos atrás, tiroleivi disse:

se eu adicionar na source funcionaria ?

Não, esse sistema não funciona em client 8.6
Apenas em client que tenha a opção de montaria na janela de change outfit.

Te ajudei? Clique em  Gostei ! 

²²²d¬¬b²²²

 

 

"She's got a smile that it seems to me...."  ♪♪

Link para o post
Compartilhar em outros sites
1 minuto atrás, luangop disse:

Não, esse sistema não funciona em client 8.6
Apenas em client que tenha a opção de montaria na janela de change outfit.

 

 

Em 22/07/2017 ás 19:16, KotZletY disse:

@tiroleivi o erro é o fato do script está chamando o meta método(method) hasMount, que verifica se o player tem tal montaria, porém esse method não existe nessa versão, como você pode ver no repositório do tfs que você está usando: https://github.com/ninjalulz/forgottenserver/blob/8.6/src/luascript.cpp

 

 

 

Em 22/07/2017 ás 18:13, EddyHavoc disse:

Esse sistema de montaria não funciona no 8.6

vlw obrigado, pelas respostas

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por Jaurez
      .
    • Por Cat
      Em alguns casos, o tibia 8.60 comum não abre de jeito nenhum no map editor, mesmo desmarcando check file signatures e configurando o path corretamente.
       
      Este é o client 8.60 adaptado para o Remere's Map Editor. Resolvi postar já que ele foi removido do site oficial do RME. (ficou apenas a versão para linux lá)
      Se estiver tendo problemas para abrir a versão 8.60, tente utilizar este.
                                                                                                                     
      Baixar o Tibia Client 8.60 que funciona no Remere’s Map Editor
      Essa versão do Tibia 8.60 client resolve o erro unsupported client version ou Could not locate tibia.dat and/or tibia.spr, please navigate to your tibia 8.60 installation folder.
       
      Downloads
      https://tibiaking.com/applications/core/interface/file/attachment.php?id=47333

      Scan: https://www.virustotal.com/gui/file/333e172ac49ba2028db9eb5889994509e7d2de28ebccfa428c04e86defbe15cc
       
    • Por Bruxo Ots
      Fala queridos, estarei compartilhando o npc de addon que ja é bem antigo, porém não achei em local nenhum atualizado, esse esta lindo de bonito, acredito que seja destinado a servidores baiak ou qualquer outro tipo de server.
      Ambos os NPC'S estão por gold, e as storages são em sequencia pra facilitar a vida.
       
      Os codigos estão em spoiler pra não pesar, mas caso queiram se adiantar no fim do post tem o link do github.
      Imagem meramente Ilustrativa:
       
      Script Do addon:
       
      Montarias
       
       
       
      Sempre que atualizar os addons e mounts no global estarei adicionando aos NPC'S.
       
       
      GITHUB
       
       
           Creditos
      Comedinha (scripts das montarias) Zbizu (acredito que tenha atualizado para 1.1) E ao criador do npc Varkhal, realmente não faço ideia de quem seja.  
       
       
       
       
    • Por danilo belato
      Fala Galera To Com um problema aki 
       
      quero exporta umas sprites de um server para colocar em outro 
       
      eu clico na sprites ai aparece tds a forma delas do lado de la >>
       
      ai eu clico nela e ponho a opiçao de export mais quando salvo a sprite ela n abri 
       
      aparece isso quando tento vê-la 
       
      visualização não disponível ( no formatos png e bitmap)
       
      Agora no formato idc fala que o paint n pode ler 
       
      me ajudem ae...
    • Por Thiago Virtuoso
      Ola galera, como podem ver eu estou precisando de um srcript que se o player estiver usando um certo outfit, ele não poderá usar mounts.
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo