• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    Pedido Script Item Cambio de Vocacion

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    1default Pedido Script Item Cambio de Vocacion el Jue Jul 19, 2018 4:46 am

    Roo

    avatar
    Miembro
    Miembro
    Hola que tal a todos de Tibia Face! Very Happy
    Quisiera hacer un Pedido de Script, ayuda  no se si sea posible
    de un item que te cambie la vocación aleatoria mente al darle clic y que desaparesca o algo Similar  


    Por ejemplo: soy Sorcerer, que al darle clic Te Cambie la Vocacion entre Druid, Paladin o Knight,

    Espero y puedan ayudarme de antemano Muchas Gracias! y Un Saludo! que Tengan un Buen Dia! Very Happy Smile

    TIBIAFACE

    Ver perfil de usuario

    2default Re: Pedido Script Item Cambio de Vocacion el Jue Jul 19, 2018 10:11 pm

    [Admin] God Maya

    avatar
    Administrador
    Administrador
    Código:
    --SCRIPT BY AlcikOTS----tibiaserver.pl--BEST SERVER ONLINE--
    -----------------------CONFIG---START-----------------------------------------
    local config = {
        removelevel = 35, -- Amount of level taken away.
        itemid = 8982, -- Item ID.
        efekt = 2, -- Effect shown.
        skilafter = 10, -- What skill will the player have after change.
        minimumlevel = 100, -- What will be min level required?
        magafter = 2, -- What magic level will he recive after change?
        --Change only if you have edited your vocations.xml so players get more mana/health/cap each level.
        sorcincrease = {5, 30, 10}, --The amount of health/mana/cap that increases when Sorcerer levels up.
        druidincrease = {5, 30, 10}, --The amount of health/mana/cap that increases when Druid levels up.
        paladinincrease = {10, 10, 20}, --The amount of health/mana/cap that increases when Paladin levels up.
        knightincrease = {15, 5, 25} --The amount of health/mana/cap that increases when Knight levels up.
    }
    -----------------------CONFIG---END-------------------------------------------
     
    function onSay(cid, words, param)
     
    if(param == "") then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must say what vocation you want change to.")
            return TRUE
        end
     if(param == "sorcerer") or (param == "druid") or (param == "knight") or (param == "paladin") or (param == "Paladin") or (param == "Druid") or (param == "Sorcerer") or (param == "Knight") or (param == "sorc") or (param == "Sorc") then
            if getPlayerLevel(cid) >= config.minimumlevel then
                if getPlayerItemCount(cid, config.itemid) >= 1 then
                    if(param == "sorcerer") or (param == "Sorcerer") or (param == "sorc") or (param == "Sorc") then
                        if getPlayerVocation(cid) > 1 then
                        doPlayerAddLevel(cid, -(config.removelevel))
                            doPlayerSetVocation(cid, 1) -- Sorc
                            setCreatureMaxHealth(cid, (185+(config.sorcincrease[1]*((getPlayerLevel(cid)-8)))))
                            setCreatureMaxMana(cid, (35+(config.sorcincrease[2]*((getPlayerLevel(cid)-8)))))
                            doPlayerSetMaxCapacity(cid, (470+(config.sorcincrease[3]*((getPlayerLevel(cid)-8)))))
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your vocation has been changed to sorcerer.")
                        else doPlayerSendCancel(cid, "You are already a sorcerer.")
                        doSendMagicEffect(getCreaturePosition(cid), 2)
                        return TRUE
                        end   
                    end
     
                    if(param == "druid") or (param == "Druid") then
                        if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) > 2 then
                        doPlayerAddLevel(cid, -(config.removelevel))
                            doPlayerSetVocation(cid, 2) -- Druid
                            setCreatureMaxHealth(cid, (185+(config.druidincrease[1]*((getPlayerLevel(cid)-8)))))
                            setCreatureMaxMana(cid, (35+(config.druidincrease[2]*((getPlayerLevel(cid)-8)))))
                            doPlayerSetMaxCapacity(cid, (470+(config.druidincrease[3]*((getPlayerLevel(cid)-8)))))           
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your vocation has been changed to druid.") 
                        else doPlayerSendCancel(cid, "You are already a druid.")
                        doSendMagicEffect(getCreaturePosition(cid), 2)
                        return TRUE
                        end
                    end
     
                    if(param == "paladin") or (param == "Paladin") then
                        if getPlayerVocation(cid) < 3 or getPlayerVocation(cid) > 3 then
                        doPlayerAddLevel(cid, -(config.removelevel))
                        doPlayerSetVocation(cid, 3) -- Sorc
                            setCreatureMaxHealth(cid, (185+(config.paladinincrease[1]*((getPlayerLevel(cid)-8)))))
                            setCreatureMaxMana(cid, (35+(config.paladinincrease[2]*((getPlayerLevel(cid)-8)))))
                            doPlayerSetMaxCapacity(cid, (470+(config.paladinincrease[3]*((getPlayerLevel(cid)-8)))))
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your vocation has been changed to paladin.")
                        else doPlayerSendCancel(cid, "You are already a paladin.")
                        doSendMagicEffect(getCreaturePosition(cid), 2)
                        return TRUE
                        end
                    end
     
                    if(param == "knight") or (param == "Knight") then
                        if getPlayerVocation(cid) < 4 then
                        doPlayerAddLevel(cid, -(config.removelevel))
                        doPlayerSetVocation(cid, 4) -- Sorc
                            setCreatureMaxHealth(cid, (185+(config.knightincrease[1]*((getPlayerLevel(cid)-8)))))
                            setCreatureMaxMana(cid, (35+(config.knightincrease[2]*((getPlayerLevel(cid)-8)))))
                            doPlayerSetMaxCapacity(cid, (470+(config.knightincrease[3]*((getPlayerLevel(cid)-8)))))
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your vocation has been changed to knight.")   
                        else doPlayerSendCancel(cid, "You are already a knight.")
                        doSendMagicEffect(getCreaturePosition(cid), 2)
                        return TRUE
                        end
                    end
                 
                    doPlayerRemoveItem(cid, config.itemid, 1)
                    doPlayerAddMagLevel(cid, -((getPlayerMagLevel(cid))-config.magafter))
                    doSendMagicEffect(getCreaturePosition(cid), config.efekt)
                    doCreatureAddMana(cid, -((getCreatureMana(cid))-(getCreatureMaxMana(cid))))
                    doCreatureAddHealth(cid, -((getCreatureHealth(cid))-(getCreatureMaxHealth(cid))))
                                for a = 0,6 do
                                    doPlayerAddSkill(cid, a, -(getPlayerSkillLevel(cid, a)-config.skilafter))
                                end
                 
                else doPlayerSendCancel(cid, "You need "..getItemNameById(config.itemid).." to change your vocation.")
                doSendMagicEffect(getCreaturePosition(cid), 2)
                end
            else doPlayerSendCancel(cid, "You don't have enough level. Your level must be "..(config.minimumlevel).." or higher.")
            doSendMagicEffect(getCreaturePosition(cid), 2)
            end
    else doPlayerSendCancel(cid, "You must say what vocation you want change to.")
    doSendMagicEffect(getCreaturePosition(cid), 2)
    end
    end

    Código:
    <talkaction words="!changevoc" event="script" value="vocations.lua"/>



    Código:
    ################# SCRIPTED BY Bartastkd http://hellice.pl/ XP ####################
     
    function onSay(cid, words, param, channel)
     
    local config = {
    sorcerer = {hp = 5, mp = 30, cap = 10},
    druid = {hp = 5, mp = 30, cap = 10},
    paladin = {hp = 10, mp = 15, cap = 20},
    knight = {hp = 15, mp = 5, cap = 25}
     
    }
     
    local czas = 1
    local storage = 4544
    local proma = getPlayerPromotionLevel(cid)
    local rookedGUID = getPlayerGUID(cid)
    local lvl = getPlayerLevel(cid)
    local so = {hp = (config.sorcerer.hp * lvl) + 180, mp = (config.sorcerer.mp * lvl) + 35, cap = (config.sorcerer.cap * lvl) + 430}
    local dr = {hp = (config.druid.hp * lvl) + 180, mp = (config.druid.mp * lvl) + 35, cap = (config.druid.cap * lvl) + 430}
    local pa = {hp = (config.paladin.hp * lvl) + 180, mp = (config.paladin.mp * lvl) + 35, cap = (config.paladin.cap * lvl) + 430}
    local kn = {hp = (config.knight.hp * lvl) + 180, mp = (config.knight.mp * lvl) + 35, cap = (config.knight.cap * lvl) + 430}
     
        if exhaustion.get(cid, storage) == FALSE then
            exhaustion.set(cid, storage, czas)
        else
            doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Musisz czekac " .. exhaustion.get(cid, storage) .. " sekund.")
            return true
        end 
     
        if param == 'sorcerer' then
                if proma == 1 then
                    if getPlayerItemCount(cid,8983) >= 1 then
                                      if (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) then
                        doPlayerRemoveItem(cid, 8983, 1)
                        setCreatureMaxHealth(cid, so.hp)
                        setCreatureMaxMana(cid, so.mp)
                        doCreatureAddHealth(cid, so.hp)
                        doCreatureAddMana(cid, so.mp)
                        doPlayerSetMaxCapacity(cid, so.cap)
                        doPlayerSetVocation(cid, 1)
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are now a sorcerer")
                        doRemoveCreature(cid)
                        db.executeQuery("UPDATE `players` SET `maglevel` = '1', `manaspent` = '0' WHERE `id` = " .. rookedGUID .. ";")
                        db.executeQuery("UPDATE `player_skills` SET `value` = '10', `count` = '0' WHERE `player_id` = " .. rookedGUID .. " LIMIT 7;")
                        else
                        doCreatureSay(cid, "Masz Pz Ziam !", TALKTYPE_ORANGE_1)
                    end
                    else
                        doPlayerSendTextMessage(cid,22,"Nie masz runy to zmiany profesji")
                        doSendMagicEffect(getPlayerPosition(cid),4)
                    end
                else
                    doPlayerSendTextMessage(cid,22,"You dont have promotion")
                    doSendMagicEffect(getPlayerPosition(cid),4)
                end
        end
     
    if param == 'druid' then
                if proma == 1 then
                    if getPlayerItemCount(cid,8983) >= 1 then
                                      if (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) then
                        doPlayerRemoveItem(cid, 8983, 1)
                        setCreatureMaxHealth(cid, dr.hp)
                        setCreatureMaxMana(cid, dr.mp)
                        doCreatureAddHealth(cid, dr.hp)
                        doCreatureAddMana(cid, dr.mp)
                        doPlayerSetMaxCapacity(cid, dr.cap)
                        doPlayerSetVocation(cid, 2)
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are now a druid")
                        doRemoveCreature(cid)
                        db.executeQuery("UPDATE `players` SET `maglevel` = '1', `manaspent` = '0' WHERE `id` = " .. rookedGUID .. ";")
                        db.executeQuery("UPDATE `player_skills` SET `value` = '10', `count` = '0' WHERE `player_id` = " .. rookedGUID .. " LIMIT 7;")
                else
                        doCreatureSay(cid, "Masz Pz Ziam !", TALKTYPE_ORANGE_1)
                    end
                    else
                        doPlayerSendTextMessage(cid,22,"Nie masz runy to zmiany profesji")
                        doSendMagicEffect(getPlayerPosition(cid),4)
                    end
                else
                    doPlayerSendTextMessage(cid,22,"You dont have promotion")
                    doSendMagicEffect(getPlayerPosition(cid),4)
                end
        end
    if param == 'paladin' then
                if proma == 1 then
                    if getPlayerItemCount(cid,8983) >= 1 then
                        if (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) then
                        doPlayerRemoveItem(cid, 8983, 1)
                        setCreatureMaxHealth(cid, pa.hp)
                        setCreatureMaxMana(cid, pa.mp)
                        doCreatureAddHealth(cid, pa.hp)
                        doCreatureAddMana(cid, pa.mp)
                        doPlayerSetMaxCapacity(cid, pa.cap)
                        doPlayerSetVocation(cid, 3)
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are now a paladin")
                        doRemoveCreature(cid)
                        db.executeQuery("UPDATE `players` SET `maglevel` = '1', `manaspent` = '0' WHERE `id` = " .. rookedGUID .. ";")
                        db.executeQuery("UPDATE `player_skills` SET `value` = '10', `count` = '0' WHERE `player_id` = " .. rookedGUID .. " LIMIT 7;")
                else
                        doCreatureSay(cid, "Masz Pz Ziam !", TALKTYPE_ORANGE_1)
                    end
                    else
                        doPlayerSendTextMessage(cid,22,"Nie masz runy to zmiany profesji")
                        doSendMagicEffect(getPlayerPosition(cid),4)
                    end
                else
                    doPlayerSendTextMessage(cid,22,"You dont have promotion")
                    doSendMagicEffect(getPlayerPosition(cid),4)
                end
        end
    if param == 'knight' then
                if proma == 1 then
                    if getPlayerItemCount(cid,8983) >= 1 then
                        if (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) then
                        doPlayerRemoveItem(cid, 8983, 1)
                        setCreatureMaxHealth(cid, kn.hp)
                        setCreatureMaxMana(cid, kn.mp)
                        doCreatureAddHealth(cid, kn.hp)
                        doCreatureAddMana(cid, kn.mp)
                        doPlayerSetMaxCapacity(cid, kn.cap)
                        doPlayerSetVocation(cid, 4)
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are now a knight")
                        doRemoveCreature(cid)
                        db.executeQuery("UPDATE `players` SET `maglevel` = '1', `manaspent` = '0' WHERE `id` = " .. rookedGUID .. ";")
                        db.executeQuery("UPDATE `player_skills` SET `value` = '10', `count` = '0' WHERE `player_id` = " .. rookedGUID .. " LIMIT 7;")
                    else
                        doCreatureSay(cid, "Masz Pz Ziam !", TALKTYPE_ORANGE_1)
                    end
                    else
                        doPlayerSendTextMessage(cid,22,"Nie masz runy to zmiany profesji")
                        doSendMagicEffect(getPlayerPosition(cid),4)
                    end
                else
                    doPlayerSendTextMessage(cid,22,"You dont have promotion")
                    doSendMagicEffect(getPlayerPosition(cid),4)
                end
        end
    return true
    end
       

    Ver perfil de usuario http://www.tibiaface.com

    3default Re: Pedido Script Item Cambio de Vocacion el Vie Jul 20, 2018 12:56 am

    Roo

    avatar
    Miembro
    Miembro
    [Tienes que estar registrado y conectado para ver este vínculo]  Gracias Amigo esta Perfecto !! Very Happy Smile

    Ver perfil de usuario

    Contenido patrocinado


    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).