RevScript Skin on Monsters / Bosses Custom

Alex

Miembro del equipo
Webdesigner
LV
58
 
Awards
38
Hola a todos,

Habran visto seguramente la obsidian knife que permite hacer skin en un determinado monstruo verdad ?
Deseais que por ejemplo un Goshnar , o bien uno de los nuevos monstruos se le pueda hacer el Skin y que te de un recurso ?
Entonces aqui lo podreis hacer simplemente,
Deberan tomar nota de saber el cuerpo ID del monstruo al morir y la arma que usareis para poder hacerlo,

En el caso ejemplo, utilizaremos el Grim Reaper y el Nightmare:

Aqui utilizamos el Icy Clerical Mace, que es una arma que con los updates dejo de ser interessante,
El script utilizado es el del Obsidian knife, lo que quiere decir que para la modificacion se concentraran en las 4 primeras lineas, todo lo demas del script, es el mismo que el de la obsidian knife, tourmaline, ice cube, etc, no deberan de borarrlo porqué en caso contrario no funcionara, no provoca ningun error, testeado con mas de 30 Scripts identicos para varios monsters y no da error en la consola, esto permite no devolver la obsidian knife inutilizable, sino que de poder usarla al mismo tiempo que la nueva arma que agregareis, cada vez bastara unicamente en modificar las 4 primera lineas y el ultimo numero del script.

Código:
local config = {
    [29176] = {


        [8956] = {value = 25000, newItem = 25376, after = 8957}, -- grim reaper
        [6341] = {value = 25000, newItem = 25376, after = 6342}, -- nightmare

    
    },
}


local IcyClericalSkin = Action()

function IcyClericalSkin.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local skin = config[item.itemid][target.itemid]

    if item.itemid == 5908 then
        if target.itemid == 38613 then
            local chance = math.random(1, 10000)
            target:getPosition():sendMagicEffect(CONST_ME_HITAREA)
            target:remove(1)
            if chance <= 9556 then
                player:addItem(38614, 1)
            else
                player:addItem(38615, 1)
            end
            return true
            -- Wrath of the emperor quest
        elseif target.itemid == 12295 then
            target:transform(12287)
            player:say("You carve a solid bowl of the chunk of wood.", TALKTYPE_MONSTER_SAY)
            return true
            -- An Interest In Botany Quest
        elseif target.itemid == 11691 and player:getItemCount(12655) > 0 and player:getStorageValue(Storage.TibiaTales.AnInterestInBotany) == 1 then
            player:say("The plant feels cold but dry and very soft. You streak the plant gently with your knife and put a fragment in the almanach.", TALKTYPE_MONSTER_SAY)
            player:setStorageValue(Storage.TibiaTales.AnInterestInBotany, 2)
            return true
        elseif target.itemid == 11653 and player:getItemCount(12655) > 0 and player:getStorageValue(Storage.TibiaTales.AnInterestInBotany) == 2 then
            player:say("You cut a leaf from a branch and put it in the almanach. It smells strangely sweet and awfully bitter at the same time.", TALKTYPE_MONSTER_SAY)
            player:setStorageValue(Storage.TibiaTales.AnInterestInBotany, 3)
            return true
        elseif target.itemid == 9009 and player:getStorageValue(789100) <= 1 then
            player:say("You got Neutral matter.", TALKTYPE_MONSTER_SAY)
            player:addItem(8310, 1)
            player:setStorageValue(789100, 1)
            return true
        elseif target.itemid == 9010 and player:getStorageValue(789100) <= 1 then
            player:say("You got Neutral matter.", TALKTYPE_MONSTER_SAY)
            player:addItem(8310, 1)
            player:setStorageValue(789100, 2)
            return true
        end
    end

    if not skin then
        player:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
        return true
    end

    local charmMType, chanceRange = player:getCharmMonsterType(CHARM_SCAVENGE), 100000
    if charmMType then
        local charmCorpse = charmMType:getCorpseId()
        if charmCorpse == target.itemid or ItemType(charmCorpse):getDecayId() == target.itemid then
            chanceRange = chanceRange * ((100 - GLOBAL_CHARM_SCAVENGE)/100)
        end
    end

    local random, effect, transform = math.random(1, chanceRange), CONST_ME_MAGIC_GREEN, true
    if type(skin[1]) == 'table' then
        local added = false
        local _skin
        for i = 1, #skin do
            _skin = skin
            if random <= _skin.value then
                if target.itemid == 11343 then
                    target:getPosition():sendMagicEffect(CONST_ME_ICEAREA)
                    local gobletItem = player:addItem(_skin.newItem, _skin.amount or 1)
                    if gobletItem then
                        gobletItem:setDescription(_skin.desc:gsub('|PLAYERNAME|', player:getName()))
                    end
                    target:remove()
                    added = true
                else
                    target:transform(_skin.newItem, _skin.amount or 1)
                    added = true
                end
                break
            end
        end

        if not added and target.itemid == 8961 then
            effect = CONST_ME_POFF
            transform = false
        elseif not added and target.itemid == 11343 then
            effect = CONST_ME_POFF
            transform = false
            target:remove()
        end
    elseif random <= skin.value then
        if isInArray({7441, 7442, 7444, 7445}, target.itemid) then
            if skin.newItem == 7446 then
                player:addAchievement('Ice Sculptor')
            end
            target:transform(skin.newItem, 1)
            effect = CONST_ME_HITAREA
        else
            player:addItem(skin.newItem, skin.amount or 1)
        end
    else
        if isInArray({7441, 7442, 7444, 7445}, target.itemid) then
            player:say('The attempt of sculpting failed miserably.', TALKTYPE_MONSTER_SAY)
            effect = CONST_ME_HITAREA
            target:remove()
        else
            effect = CONST_ME_POFF
        end
    end
    -- SE BUGAR, PEGAR SCRIPT ANTIGO
    toPosition:sendMagicEffect(effect)
    if transform then
        target:transform(skin.after or target:getType():getDecayId() or target.itemid + 1)
    else
        target:remove()
    end

    return true
end

IcyClericalSkin:id(29176)
IcyClericalSkin:register()

Abajo del script y al principio encontraremos el 29176 que corresponde al item ID del arma que se usara,

<item id="29176" article="an" name="Icy Skinning Clerical Mace">
<attribute key="weight" value="300" />
<attribute key="description" value="Can be used on Grim Reaper and Nightmares." />
<attribute key="loottype" value="club" />
</item>

La modificacion:

local config = {
[29176] = { -- ITEM ID utilizado para hacer SKIN


[8956] = {value = 25000, newItem = 25376, after = 8957}, -- grim reaper
[6341] = {value = 25000, newItem = 25376, after = 6342}, -- nightmare


},
}

El 8596 corresponde al cuerpo del grim reaper en el cual se podra utilizar la arma (! Nota no utilizar la primera ID de cuerpo, que es la que no permite hacer skin, como saben siempre hay unos 5s antes de poder hacerlo, sino no dara tiempo al player de poder utilizar la arma, eligiran la segunda ID del cuerpo de la lista items.xml ), el 25000, lo dejan asi, el 2160 Sera el item obtenido al utilizar la arma en el cuerpo del Grim, y el 8957 es el segundo cuerpo en el cual se transformara una vez la arma utilizada en el grim.

Listo, modificando el 21976 al final del script que corresponde también a la arma utilizada ( por la misma que al principio del script ) podran hacer skin en monstruos/bosses differentes.
 

Shuyin

Miembro
LV
23
 
Awards
17
buenas, no acabo de entender muy bien este script. Que se supone que hace con eso del skin y los items?
 

Alex

Miembro del equipo
Webdesigner
LV
58
 
Awards
38
buenas, no acabo de entender muy bien este script. Que se supone que hace con eso del skin y los items?
Hola,

El script lo que hace es retomar la acción que hace la obsidian knife ( que se puede pelar un dragon y obtener por ejemplo el dragon leather ),
este script permite hacer esto en cualquier monstruo, poniéndole el item que tu deseas obtener al utilizar el item de skin ( que habrás elegido ) en el cuerpo del monstruo una vez matado.
En teórica este script fue creado para un sistema de craft, largo, con el tiempo, es decir para forjar una arma legendaria en el juego se debía de obtener varios recursos que únicamente se podían obtener mediante la acción skining en el monstruo determinado con la arma que le correspondía, este ultimo tenia unas 10 armas que podían skin a mas de 20 monstruos diferentes.

Ejemplo, la giant sword se utiliza encima de un cuerpo de guzzlemaw y te da 1 crystal coin.
 
Arriba