Ir para conteúdo
  • Cadastre-se

Scripting Simple Task [ERRO] Ajuda não entrega as recompensas


Posts Recomendados

Opa gente pelo amor de deus me ajudem nesse mod, eu coloquei novas task e parou de funcionar, agora não consigo fazer funciona, ele funciona tudo na vdd, porém quando os cara termina as task ele não entrega os itens, alguem pode me ajudar? e da esse erro na distro

Spoiler

Simple Task Mod

 

<?xml version="1.0" encoding="ISO-8859-1"?> 
<mod name="Simple Task" version="4.0" author="Vodkart" contact="tibiaking.com" enabled="yes"> 
<config name="task_func"><![CDATA[
task_sys = {
    [1] = {name = "rat", start = 176201, monsters_list = {"rat","wolf"}, level = 8, count = 60, points = 0, gradrationPoints = 3, items = {}, reward = {11312,1}, exp = 2000, money = 2000},
    [2] = {name = "gamaden", start = 176202, monsters_list = {"gamaden","gamaden","gamaden"}, level = 150, count = 800, points = 0, gradrationPoints = 4, items = {}, reward = {11313,1}, exp = 2500, money = 3000},
    [3] = {name = "mutation", start = 176203, monsters_list = {"mutation creature"}, level = 200, count = 1100, points = 0, gradrationPoints = 5, items = {}, reward = {11314,1}, exp = 3000, money = 3000},
    [4] = {name = "morcego", start = 176204, monsters_list = {"morcego","morcego"}, level = 200, count = 1200, points = 1, gradrationPoints = 6, items = {}, reward = {11315,1}, exp = 10000, money = 5000},
    [5] = {name = "anbu Do Fogo", start = 176205, monsters_list = {"anbu do fogo"}, level = 300, count = 1250, points = 1, gradrationPoints = 7, items = {}, reward = {11316,1}, exp = 10000, money = 5000},
    [6] = {name = "renegade white", start = 176206, monsters_list = {"renegade white"}, level = 350, count = 1280, points = 2, gradrationPoints = 8, items = {}, reward = {11317,1}, exp = 10000, money = 5000},
    [7] = {name = "skeleto", start = 176207, monsters_list = {"skeleto"}, level = 400, count = 1290, points = 3, gradrationPoints = 9, items = {}, reward = {11318,1}, exp = 12000, money = 7000},
    [8] = {name = "orochimaru", start = 176208, monsters_list = {"orochimaru"}, level = 36, count = 1300, points = 3, gradrationPoints = 10, items = {}, reward = {11319,1}, exp = 8000, money = 8000},
    [9] = {name = "raikage Bracelet", start = 176209, monsters_list = {"gamahiro"}, level = 450, count = 1350, points = 2, gradrationPoints = 11, items = {}, reward = {11454,1}, exp = 12000, money = 8200},
    [10] = {name = "samehada", start = 176210, monsters_list = {"gaara sc2"}, level = 500, count = 1380, points = 3, gradrationPoints = 12, items = {}, reward = {2440,1}, exp = 0, money = 0},
    [11] = {name = "skin sasuke", start = 176211, monsters_list = {"great bison"}, level = 550, count = 1400, points = 2, gradrationPoints = 13, items = {}, reward = {11336,1}, exp = 8000, money = 8500},
    [12] = {name = "madara", start = 176212, monsters_list = {"madara","madara"}, level = 560, count = 1500, points = 1, gradrationPoints = 14,  items = {}, reward = {11320,1}, exp = 9000, money = 9000},
    [13] = {name = "gunbai" ,start = 176213, monsters_list = {"madara"}, level = 570, count = 1600, points = 3, gradrationPoints = 15, items = {}, reward = {2511,1}, exp = 20000, money = 15000},
    [14] = {name = "pain boss" ,start = 176214, monsters_list = {"pain boss"}, level = 580, count = 1700, points = 3, gradrationPoints = 16, items = {}, reward = {11454,1}, exp = 25000, money = 11000},
    [15] = {name = "katon element" ,start = 176215, monsters_list = {"skeleto"}, level = 590, count = 1800, points = 0, gradrationPoints = 17, items = {}, reward = {11427,1}, exp = 20000, money = 32000},
    [16] = {name = "suiton element" ,start = 176216, monsters_list = {"renegade"}, level = 600, count = 1900, points = 3, gradrationPoints = 18, items = {}, reward = {11429,1}, exp = 22000, money = 15000},
    [17] = {name = "raiton element" ,start = 176217, monsters_list = {"mutation creature"}, level = 610, count = 2000, points = 3, gradrationPoints = 19, items = {}, reward = {11430}, exp = 25000, money = 18000},
    [17] = {name = "doton element" ,start = 176218, monsters_list = {"electro"}, level = 620, count = 2100, points = 3, gradrationPoints = 20, items = {}, reward = {11430}, exp = 25000, money = 15000}
}
daily_task = {
    [1] = {name = "daily ogres" ,monsters_list = {"ogres"}, count = 900, taskPoints = 1, gradrationPoints = 15, reward = {1960,1}, exp = 5000, money = 10000},
    [2] = {name = "daily suiton element" ,monsters_list = {"tigre"}, count = 1200, taskPoints = 1, gradrationPoints = 15, reward = {11428,1}, exp = 9000, money = 12000},
    [3] = {name = "daily esqueleto" ,monsters_list = {"esqueleto"}, count = 600, taskPoints = 2, gradrationPoints = 15, reward = {11429,1}, exp = 9000, money = 15000},
    [4] = {name = "daily fuuton element" ,monsters_list = {"false zetsu","false zetsu"}, count = 1000, taskPoints = 20, gradrationPoints = 16, reward = {11429,1}, exp = 2000, money = 10000},
    [5] = {name = "daily raiton element" ,monsters_list = {"gamahiro"}, count = 1500, taskPoints = 1, gradrationPoints = 20, reward = {11430,1}, exp = 20000, money = 25000},
    [6] = {name = "daily doton element" ,monsters_list = {"salamandra"}, count = 2000, taskPoints =1, gradrationPoints = 20, reward = {11431,1}, exp = 100000, money = 160000},
    [7] = {name = "daily jya" ,monsters_list = {"jya"}, count = 700, taskPoints = 1, gradrationPoints = 25, reward = {}, exp = 130000, money = 200000},
    [8] = {name = "daily skin kaneki" ,monsters_list = {"demoniac"}, count = 600, taskPoints = 1, gradrationPoints = 25, reward = {11330,1}, exp = 130000, money = 200000},
    [9] = {name = "daily skin zoro" ,monsters_list = {"strong"}, count = 500, taskPoints = 1, gradrationPoints = 25, reward = {11342,1}, exp = 140000, money = 200000},
    [10] = {name = "daily skin natsu" ,monsters_list = {"squartou brock"}, count = 550, taskPoints = 1, gradrationPoints = 30, reward = {11332,1}, exp = 130000, money = 200000},
    [11] = {name = "daily skin lee sin" ,monsters_list = {"squartou hatch"}, count = 500, taskPoints = 1, gradrationPoints = 30, reward = {11334}, exp = 120000, money = 200000},
    [12] = {name = "daily skin luffy" ,monsters_list = {"squartou"}, count = 500, taskPoints = 1, gradrationPoints = 30, reward = {11341,1}, exp = 110000, money = 200000},
    [13] = {name = "daily skin ichigo" ,monsters_list = {"raposa"}, count = 1, taskPoints = 1, gradrationPoints = 35, reward = {11333,1}, exp = 100000, money = 200000},
    [14] = {name = "daily otsutsuki part1" ,monsters_list = {"demoniac"}, count = 1000, taskPoints = 1, gradrationPoints = 35, reward = {11325,1}, exp = 100000, money = 200000},
    [15] = {name = "daily otsutsuki part2" ,monsters_list = {"squartou"}, count = 1100, taskPoints = 1, gradrationPoints = 35, reward = {11326,1}, exp = 100000, money = 200000},
    [16] = {name = "daily otsutsuki part3" ,monsters_list = {"squartou hatch"}, count = 1200, taskPoints = 1, gradrationPoints = 35, reward = {11327,1}, exp = 100000, money = 200000},
    [17] = {name = "daily otsutsuki part4" ,monsters_list = {"squartou brock"}, count = 1300, taskPoints = 1, gradrationPoints = 35, reward = {11328,1}, exp = 100000, money = 200000},
    [18] = {name = "daily otsutsuki part5" ,monsters_list = {"strong"}, count = 1400, taskPoints = 1, gradrationPoints = 35, reward = {11329,1}, exp = 100000, money = 200000}
}
task_sys_storages = {176601, 176602, 176603, 176604, 176605, 176606, 176607, 176608} -- task, taskPoints, count, daily task, daily count, daily time , daily start, contador
function getTaskMission(cid)
    return getPlayerStorageValue(cid,task_sys_storages[1]) < 0 and 1 or getPlayerStorageValue(cid,task_sys_storages[1])
end
function getDailyTaskMission(cid)
    return getPlayerStorageValue(cid,task_sys_storages[4]) < 0 and 1 or getPlayerStorageValue(cid,task_sys_storages[4])
end
function getTaskPoints(cid)
    return getPlayerStorageValue(cid,task_sys_storages[2]) < 0 and 0 or getPlayerStorageValue(cid,task_sys_storages[2])
end
function doRandomDailyTask(cid)
    local t = {
        [{6,49}] = {1,3},
        [{50,79}] = {4,6},
        [{80,129}] = {7,9},
        [{130,math.huge}] = {10,12}
    }
    for a , b in pairs(t) do
        if getPlayerLevel(cid) >= a[1] and getPlayerLevel(cid) <= a[2] then
            return math.random(b[1], b[2])
        end
    end
    return 0
end
function GetRankTask(cid)
    local ranks = {
        [{1, 20}] = "Huntsman",
        [{21, 50}] = "Ranger",
        [{51, 100}] = "Big Game Hunter",
        [{101, 200}] = "Trophy Hunter",    
        [{201, math.huge}] = "Elite Hunter"
    }
    for v , r in pairs(ranks) do
        if getTaskPoints(cid) >= v[1] and getTaskPoints(cid) <= v[2] then
            return r
        end
    end
    return 0
end
function getItemsFromList(items)
    local str = ''
    if table.maxn(items) > 0 then
        for i = 1, table.maxn(items) do
            str = str .. items[i][2] .. ' ' .. getItemNameById(items[i][1])
            if i ~= table.maxn(items) then str = str .. ', '
            end
        end
    end
    return str
end
function doRemoveItemsFromList(cid,items)
    local count = 0
    if table.maxn(items) > 0 then
        for i = 1, table.maxn(items) do
            if getPlayerItemCount(cid,items[i][1]) >= items[i][2] then
            count = count + 1 end
        end
    end
    if count == table.maxn(items) then
        for i = 1, table.maxn(items) do doPlayerRemoveItem(cid,items[i][1],items[i][2]) end
    else
        return false
    end
    return true
end
function getMonsterFromList(monster)
    local str = ''
    if #monster > 0 then
        for i = 1, #monster do
            str = str .. monster[i]
            if i ~= #monster then str = str .. ', ' end
        end
    end
    return str
end
function GiveRewardsTask(cid, items)
    local backpack = doPlayerAddItem(cid, 1999, 1) -- backpackID
    for _, i_i in ipairs(items) do
        local item, amount = i_i[1],i_i[2]
        if isItemStackable(item) or amount == 1 then
            doAddContainerItem(backpack, item, amount)
        else
            for i = 1, amount do
                doAddContainerItem(backpack, item, 1)
            end
        end
    end
end
function isSummon(cid)
    if(not isCreature(cid)) then
        return false
    end
    return getCreatureMaster(cid) ~= cid
end
]]></config>
<event type="login" name="TaskLogin" event="script"><![CDATA[
function onLogin(cid)
    registerCreatureEvent(cid, "KillTask")
    return true
end]]></event>
<talkaction words="/task;!task" event="buffer"><![CDATA[
domodlib('task_func')
param,task,daily = param:lower(), getTaskMission(cid), getDailyTaskMission(cid)
if isInArray({"counter","contador"},param) then
    setPlayerStorageValue(cid, task_sys_storages[8], getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and 1 or 0)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Task System] O contador foi "..(getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and "ativado" or "desativado")..".") return true
elseif isInArray({"daily","diaria"},param) then
    if not daily_task[daily] or getPlayerStorageValue(cid, task_sys_storages[7]) <= 0 then
        doPlayerSendCancel(cid, "Desculpe, Mas você não está em nenhuma Daily Task.") return true
    elseif getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() <= 0 and getPlayerStorageValue(cid, task_sys_storages[5]) < daily_task[daily].count then
        doPlayerSendCancel(cid,"Desculpe, Mas Você não terminou a Daily Task a tempo! Por favor volte ao npc e comece uma nova Daily Task!") return true
    end
    return doShowTextDialog(cid, 8983, "[->] CURRENT DAILY TASK INFO [<-]\n\nNome: "..daily_task[daily].name.."\nProgresso: ["..(getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[5])).."/"..daily_task[daily].count.."]\nPrazo para entrega: "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,task_sys_storages[6])).."\nMonstros para caçar: "..getMonsterFromList(daily_task[daily].monsters_list).."\n\n[->] CURRENT TASK REWARDS [<-]\n\nMoney: "..(daily_task[daily].money > 0 and daily_task[daily].money or 0).."\nExperiencia: "..(daily_task[daily].exp > 0 and daily_task[daily].exp or 0).."\nTask Points: "..daily_task[daily].taskPoints.. "\nGraduação Points: " ..daily_task[daily].gradrationPoints .."\nItems: "..(#daily_task[daily].reward > 0 and getItemsFromList(daily_task[daily].reward) or "Nenhum item de recompensa")..".")
end
if not task_sys[task] or getPlayerStorageValue(cid, task_sys[task].start) <= 0 then
    doPlayerSendCancel(cid, "você não está em nenhuma task.") return true
end
return doShowTextDialog(cid, 8983, "-> CURRENT TASK ["..getTaskMission(cid).."/"..#task_sys.."] <-\n\nTask Name: "..task_sys[task].name.."\nTask Level: "..task_sys[task].level.."\nTask Progress: ["..(getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[3])).."/"..task_sys[task].count.."]\nMonster To Hunt: "..getMonsterFromList(task_sys[task].monsters_list)..".\nItens Para Entrega: "..(#task_sys[task].items > 0 and getItemsFromList(task_sys[task].items) or "Nenhum")..".\n\n[->] CURRENT TASK REWARDS [<-]\n\nReward Money: "..(task_sys[task].money > 0 and task_sys[task].money or 0).."\nReward Experiencia: "..(task_sys[task].exp > 0 and task_sys[task].exp or 0).."\nTask Points: "..task_sys[task].taskPoints.."\nGraduação Points: " ..task_sys[task].gradrationPoints .."\nRedward Items: "..(#task_sys[task].reward > 0 and getItemsFromList(task_sys[task].reward) or "Nenhum item de recompensa")..".")
]]></talkaction>
<event type="kill" name="KillTask" event="script"><![CDATA[
domodlib('task_func')
function onKill(cid, target)
    if isPlayer(cid) and isMonster(target) then
        local t,daily = task_sys[getTaskMission(cid)], daily_task[getDailyTaskMission(cid)]
        if t and getPlayerStorageValue(cid, t.start) > 0 and isInArray(t.monsters_list, getCreatureName(target):lower()) and getPlayerStorageValue(cid, task_sys_storages[3]) < t.count then
            setPlayerStorageValue(cid, task_sys_storages[3], getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and 1 or (getPlayerStorageValue(cid, task_sys_storages[3])+1))
            if getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and getPlayerStorageValue(cid, task_sys_storages[3]) < t.count then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Task System] defeated Total [" .. getPlayerStorageValue(cid, task_sys_storages[3]) .. "/" .. t.count .. "] da Task do " .. t.name .. ".")
            end
            if getPlayerStorageValue(cid, task_sys_storages[3]) >= t.count then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Task System] Parabéns! Você terminou a Task do "..t.name..", volte ao npc parece receber sua recompensa.")
            end
        end
        if daily and getPlayerStorageValue(cid, task_sys_storages[7]) > 0 and getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() >= 0 and isInArray(daily.monsters_list, getCreatureName(target):lower()) and getPlayerStorageValue(cid, task_sys_storages[5]) < daily.count then
            setPlayerStorageValue(cid, task_sys_storages[5], getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and 1 or (getPlayerStorageValue(cid, task_sys_storages[5])+1))
            if getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and getPlayerStorageValue(cid, task_sys_storages[5]) < daily.count then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Daily Task System] defeated Total [" .. getPlayerStorageValue(cid, task_sys_storages[5]) .. "/" .. daily.count .. "] da Task do " .. daily.name .. ".")
            end
            if getPlayerStorageValue(cid, task_sys_storages[5]) >= daily.count then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Daily Task System] Parabéns! Você terminou a Task do "..daily.name..", volte ao npc parece receber sua recompensa.")
            end
        end
    end
    return true
end]]></event>

<action actionid="45250" event="script"><![CDATA[
domodlib('task_func')
function onUse(cid, item, frompos, item2, topos)
local amount = 100
if GRADRATION.getPoints (cid) < amount then
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"Você só pode passar se tiver " .. amount .. " Graduação Points.") 
end
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, topos, true)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Welcome, a Jinchuuriki Florest!")
return true
end]]></action>
</mod>

 

Spoiler

NPC

 

domodlib('task_func')
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 onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    local talkUser,msg, str,rst = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid, msg:lower(),"",""
    local task,daily, hours = getTaskMission(cid),getDailyTaskMission(cid), 24
    if isInArray({"task","tasks","missao","mission"}, msg) then
        if task_sys[task] then
            if getPlayerStorageValue(cid, task_sys[task].start) <= 0 then
                if getPlayerLevel(cid) >= task_sys[task].level then
                    setPlayerStorageValue(cid, task_sys[task].start, 1)
                    npcHandler:say("[Task Avus] Parabéns, agora você esta participando da Task do "..task_sys[task].name.." e devera matar "..task_sys[task].count.." desta lista: "..getMonsterFromList(task_sys[task].monsters_list)..". "..(#task_sys[task].items > 0 and "Ah e por favor me traga "..getItemsFromList(task_sys[task].items).." para mim." or "").."" , cid)
                else
                    npcHandler:say("Desculpe, Mas você precisa alcançar level "..task_sys[task].level.." para poder participar da Task dos "..task_sys[task].name.."!", cid)
                end
            else
                npcHandler:say("Desculpe, Mas você atualmente esta na task "..task_sys[task].name..". você pode {entregar} caso já tenha terminado.", cid)
            end
        else
            npcHandler:say("Desculpe, Mas por enquanto nao tenho mais nenhuma task para você!", cid)
        end
    elseif isInArray({"diaria","daili","daily","dayli","diario"}, msg) then
        if getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() > 0 then
            npcHandler:say("Desculpe, você deve esperar ate "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,task_sys_storages[6])).." para iniciar uma nova task diaria!", cid) return true
        elseif daily_task[daily] and getPlayerStorageValue(cid, task_sys_storages[5]) >= daily_task[daily].count then
            npcHandler:say("Desculpe, você tem task para {entregar} !", cid) return true
        end
        local r = doRandomDailyTask(cid)
        if r == 0 then
            npcHandler:say("Desculpe, mas você nao tem level para completar nenhuma Task diaria.", cid) return true
        end
        setPlayerStorageValue(cid, task_sys_storages[4], r)
        setPlayerStorageValue(cid, task_sys_storages[6], os.time()+hours*3600)
        setPlayerStorageValue(cid, task_sys_storages[7], 1)
        setPlayerStorageValue(cid, task_sys_storages[5], 0)
       local dtask = daily_task[r]
        npcHandler:say("[Daily Task Avus] Parabéns, agora você esta participando da Task Diaria do "..dtask.name.." e devera matar "..dtask.count.." monstros desta lista: "..getMonsterFromList(dtask.monsters_list).." ate "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,task_sys_storages[6]))..". Boa sorte!" , cid)
    elseif isInArray({"receber","reward","recompensa","report","reportar","entregar","entrega"}, msg) then
        local v, k = task_sys[task], daily_task[daily] 
        if v then -- original task
            if getPlayerStorageValue(cid, v.start) > 0 then
                if getPlayerStorageValue(cid,task_sys_storages[3]) >= v.count then
                    if #v.items > 0 and not doRemoveItemsFromList(cid, v.items) then
                        npcHandler:say("Desculpe, Mas você tambem precisa entregar os itens desta lista: "..getItemsFromList(v.items), cid) return true
                    end
             if v.exp > 0 then doPlayerAddExp(cid, v.exp) str = str.."".. (str == "" and "" or ", ") .." "..v.exp.." de exp" end
                 if v.taskPoints > 0 then setPlayerStorageValue(cid, task_sys_storages[2], (getTaskPoints(cid)+v.taskPoints)) str = str.."".. (str == "" and "" or ", ") .." + "..v.taskPoints.."task points" end
                 if v.gradrationPoints > 0 then GRADRATION.addPoints(cid, v.gradrationPoints) str = str.."".. (str == "" and "" or ", ") .." + "..v.gradrationPoints.."Graduação points" end
                 if v.money > 0 then doPlayerAddMoney(cid, v.money) str = str.."".. (str == "" and "" or ", ") ..""..v.money.." gps" end
                 if table.maxn(v.reward) > 0 then GiveRewardsTask(cid, v.reward) str = str.."".. (str == "" and "" or ", ") ..""..getItemsFromList(v.reward) end
                    npcHandler:say("Obrigado pela sua ajuda Recompensas: "..(str == "" and "nenhuma" or ""..str.."").." por ter completado a task do "..v.name, cid)
                    setPlayerStorageValue(cid, task_sys_storages[3], 0)
                    setPlayerStorageValue(cid, task_sys_storages[1], (task+1))
                else
                    npcHandler:say("Desculpe, Mas você ainda nao terminou a sua task do "..v.name..". Preciso que mate mais "..(getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and v.count or -(getPlayerStorageValue(cid,task_sys_storages[3])-v.count)).." Destes monstros terriveis!", cid)
                end
            end
        end 
        if k then -- daily task
            if getPlayerStorageValue(cid, task_sys_storages[7]) > 0 then
                if getPlayerStorageValue(cid, task_sys_storages[5]) >= k.count then
                if k.exp > 0 then doPlayerAddExp(cid, k.exp) rst = rst.."".. (rst == "" and "" or ", ") .." "..k.exp.." de exp" end
                 if k.taskPoints > 0 then setPlayerStorageValue(cid, task_sys_storages[2], (getTaskPoints(cid)+k.taskPoints)) rst = rst.."".. (rst == "" and "" or ", ") .." + "..k.taskPoints.."task points" end
                 if v.gradrationPoints > 0 then GRADRATION.addPoints(cid, v.gradrationPoints) str = str.."".. (str == "" and "" or ", ") .." + "..v.gradrationPoints.."Gradration points" end
                 if k.money > 0 then doPlayerAddMoney(cid, k.money) rst = rst.."".. (rst == "" and "" or ", ") ..""..k.money.." gps" end
                 if table.maxn(k.reward) > 0 then GiveRewardsTask(cid, k.reward) rst = rst.."".. (rst == "" and "" or ", ") ..""..getItemsFromList(k.reward) end
                    npcHandler:say("Obrigado pela sua ajuda! Recompensas: "..(rst == "" and "nenhuma" or ""..rst.."").." por ter completado a task do "..k.name, cid)
                    setPlayerStorageValue(cid, task_sys_storages[4], 0)
                    setPlayerStorageValue(cid, task_sys_storages[5], 0)
                    setPlayerStorageValue(cid, task_sys_storages[7], 0)
                    else
                    npcHandler:say("Desculpe, Mas você ainda nao terminou a sua task diaria do "..k.name..". Preciso que mate mais "..(getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and k.count or -(getPlayerStorageValue(cid,task_sys_storages[5])-k.count)).." Destes monstros!", cid)
                end
            end
        end
    elseif msg == "no" then 
        selfSay("Tudo bem então", cid) 
        talkState[talkUser] = 0 
        npcHandler:releaseFocus(cid) 
    end
    return true
end

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

 

erro.png

Link para o post
Compartilhar em outros sites

muito comum... 

 

errado:

reward = {11316,1}

correto:

reward = {{11316,1}}

 

 

sua tabela refeita:

 

task_sys = {
	[1] = {name = "rat", start = 176201, monsters_list = {"rat","wolf"}, level = 8, count = 60, points = 0, gradrationPoints = 3, items = {}, reward = {{11312,1}}, exp = 2000, money = 2000},
	[2] = {name = "gamaden", start = 176202, monsters_list = {"gamaden","gamaden","gamaden"}, level = 150, count = 800, points = 0, gradrationPoints = 4, items = {}, reward = {{11313,1}}, exp = 2500, money = 3000},
	[3] = {name = "mutation", start = 176203, monsters_list = {"mutation creature"}, level = 200, count = 1100, points = 0, gradrationPoints = 5, items = {}, reward = {{11314,1}}, exp = 3000, money = 3000},
	[4] = {name = "morcego", start = 176204, monsters_list = {"morcego","morcego"}, level = 200, count = 1200, points = 1, gradrationPoints = 6, items = {}, reward = {{11315,1}}, exp = 10000, money = 5000},
	[5] = {name = "anbu Do Fogo", start = 176205, monsters_list = {"anbu do fogo"}, level = 300, count = 1250, points = 1, gradrationPoints = 7, items = {}, reward = {{11316,1}}, exp = 10000, money = 5000},
	[6] = {name = "renegade white", start = 176206, monsters_list = {"renegade white"}, level = 350, count = 1280, points = 2, gradrationPoints = 8, items = {}, reward = {{11317,1}}, exp = 10000, money = 5000},
	[7] = {name = "skeleto", start = 176207, monsters_list = {"skeleto"}, level = 400, count = 1290, points = 3, gradrationPoints = 9, items = {}, reward = {{11318,1}}, exp = 12000, money = 7000},
	[8] = {name = "orochimaru", start = 176208, monsters_list = {"orochimaru"}, level = 36, count = 1300, points = 3, gradrationPoints = 10, items = {}, reward = {{11319,1}}, exp = 8000, money = 8000},
	[9] = {name = "raikage Bracelet", start = 176209, monsters_list = {"gamahiro"}, level = 450, count = 1350, points = 2, gradrationPoints = 11, items = {}, reward = {{11454,1}}, exp = 12000, money = 8200},
	[10] = {name = "samehada", start = 176210, monsters_list = {"gaara sc2"}, level = 500, count = 1380, points = 3, gradrationPoints = 12, items = {}, reward = {{2440,1}}, exp = 0, money = 0},
	[11] = {name = "skin sasuke", start = 176211, monsters_list = {"great bison"}, level = 550, count = 1400, points = 2, gradrationPoints = 13, items = {}, reward = {{11336,1}}, exp = 8000, money = 8500},
	[12] = {name = "madara", start = 176212, monsters_list = {"madara","madara"}, level = 560, count = 1500, points = 1, gradrationPoints = 14, items = {}, reward = {{11320,1}}, exp = 9000, money = 9000},
	[13] = {name = "gunbai" ,start = 176213, monsters_list = {"madara"}, level = 570, count = 1600, points = 3, gradrationPoints = 15, items = {}, reward = {{2511,1}}, exp = 20000, money = 15000},
	[14] = {name = "pain boss" ,start = 176214, monsters_list = {"pain boss"}, level = 580, count = 1700, points = 3, gradrationPoints = 16, items = {}, reward = {{11454,1}}, exp = 25000, money = 11000},
	[15] = {name = "katon element" ,start = 176215, monsters_list = {"skeleto"}, level = 590, count = 1800, points = 0, gradrationPoints = 17, items = {}, reward = {{11427,1}}, exp = 20000, money = 32000},
	[16] = {name = "suiton element" ,start = 176216, monsters_list = {"renegade"}, level = 600, count = 1900, points = 3, gradrationPoints = 18, items = {}, reward = {{11429,1}}, exp = 22000, money = 15000},
	[17] = {name = "raiton element" ,start = 176217, monsters_list = {"mutation creature"}, level = 610, count = 2000, points = 3, gradrationPoints = 19, items = {}, reward = {{11430,1}}, exp = 25000, money = 18000},
	[17] = {name = "doton element" ,start = 176218, monsters_list = {"electro"}, level = 620, count = 2100, points = 3, gradrationPoints = 20, items = {}, reward = {{11430,1}}, exp = 25000, money = 15000}
}
daily_task = {
	[1] = {name = "daily ogres" ,monsters_list = {"ogres"}, count = 900, taskPoints = 1, gradrationPoints = 15, reward = {{1960,1}}, exp = 5000, money = 10000},
	[2] = {name = "daily suiton element" ,monsters_list = {"tigre"}, count = 1200, taskPoints = 1, gradrationPoints = 15, reward = {{11428,1}}, exp = 9000, money = 12000},
	[3] = {name = "daily esqueleto" ,monsters_list = {"esqueleto"}, count = 600, taskPoints = 2, gradrationPoints = 15, reward = {{11429,1}}, exp = 9000, money = 15000},
	[4] = {name = "daily fuuton element" ,monsters_list = {"false zetsu","false zetsu"}, count = 1000, taskPoints = 20, gradrationPoints = 16, reward = {{11429,1}}, exp = 2000, money = 10000},
	[5] = {name = "daily raiton element" ,monsters_list = {"gamahiro"}, count = 1500, taskPoints = 1, gradrationPoints = 20, reward = {{11430,1}}, exp = 20000, money = 25000},
	[6] = {name = "daily doton element" ,monsters_list = {"salamandra"}, count = 2000, taskPoints =1, gradrationPoints = 20, reward = {{11431,1}}, exp = 100000, money = 160000},
	[7] = {name = "daily jya" ,monsters_list = {"jya"}, count = 700, taskPoints = 1, gradrationPoints = 25, reward = {}, exp = 130000, money = 200000},
	[8] = {name = "daily skin kaneki" ,monsters_list = {"demoniac"}, count = 600, taskPoints = 1, gradrationPoints = 25, reward = {{11330,1}}, exp = 130000, money = 200000},
	[9] = {name = "daily skin zoro" ,monsters_list = {"strong"}, count = 500, taskPoints = 1, gradrationPoints = 25, reward = {{11342,1}}, exp = 140000, money = 200000},
	[10] = {name = "daily skin natsu" ,monsters_list = {"squartou brock"}, count = 550, taskPoints = 1, gradrationPoints = 30, reward = {{11332,1}}, exp = 130000, money = 200000},
	[11] = {name = "daily skin lee sin" ,monsters_list = {"squartou hatch"}, count = 500, taskPoints = 1, gradrationPoints = 30, reward = {{11334,1}}, exp = 120000, money = 200000},
	[12] = {name = "daily skin luffy" ,monsters_list = {"squartou"}, count = 500, taskPoints = 1, gradrationPoints = 30, reward = {{11341,1}}, exp = 110000, money = 200000},
	[13] = {name = "daily skin ichigo" ,monsters_list = {"raposa"}, count = 1, taskPoints = 1, gradrationPoints = 35, reward = {{11333,1}}, exp = 100000, money = 200000},
	[14] = {name = "daily otsutsuki part1" ,monsters_list = {"demoniac"}, count = 1000, taskPoints = 1, gradrationPoints = 35, reward = {{11325,1}}, exp = 100000, money = 200000},
	[15] = {name = "daily otsutsuki part2" ,monsters_list = {"squartou"}, count = 1100, taskPoints = 1, gradrationPoints = 35, reward = {{11326,1}}, exp = 100000, money = 200000},
	[16] = {name = "daily otsutsuki part3" ,monsters_list = {"squartou hatch"}, count = 1200, taskPoints = 1, gradrationPoints = 35, reward = {{11327,1}}, exp = 100000, money = 200000},
	[17] = {name = "daily otsutsuki part4" ,monsters_list = {"squartou brock"}, count = 1300, taskPoints = 1, gradrationPoints = 35, reward = {{11328,1}}, exp = 100000, money = 200000},
	[18] = {name = "daily otsutsuki part5" ,monsters_list = {"strong"}, count = 1400, taskPoints = 1, gradrationPoints = 35, reward = {{11329,1}}, exp = 100000, money = 200000}
}

 

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

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
Em 24/03/2021 em 10:15, Vodkart disse:

muito comum... 

 

errado:


reward = {11316,1}

correto:


reward = {{11316,1}}

 

 

sua tabela refeita:

 


task_sys = {
	[1] = {name = "rat", start = 176201, monsters_list = {"rat","wolf"}, level = 8, count = 60, points = 0, gradrationPoints = 3, items = {}, reward = {{11312,1}}, exp = 2000, money = 2000},
	[2] = {name = "gamaden", start = 176202, monsters_list = {"gamaden","gamaden","gamaden"}, level = 150, count = 800, points = 0, gradrationPoints = 4, items = {}, reward = {{11313,1}}, exp = 2500, money = 3000},
	[3] = {name = "mutation", start = 176203, monsters_list = {"mutation creature"}, level = 200, count = 1100, points = 0, gradrationPoints = 5, items = {}, reward = {{11314,1}}, exp = 3000, money = 3000},
	[4] = {name = "morcego", start = 176204, monsters_list = {"morcego","morcego"}, level = 200, count = 1200, points = 1, gradrationPoints = 6, items = {}, reward = {{11315,1}}, exp = 10000, money = 5000},
	[5] = {name = "anbu Do Fogo", start = 176205, monsters_list = {"anbu do fogo"}, level = 300, count = 1250, points = 1, gradrationPoints = 7, items = {}, reward = {{11316,1}}, exp = 10000, money = 5000},
	[6] = {name = "renegade white", start = 176206, monsters_list = {"renegade white"}, level = 350, count = 1280, points = 2, gradrationPoints = 8, items = {}, reward = {{11317,1}}, exp = 10000, money = 5000},
	[7] = {name = "skeleto", start = 176207, monsters_list = {"skeleto"}, level = 400, count = 1290, points = 3, gradrationPoints = 9, items = {}, reward = {{11318,1}}, exp = 12000, money = 7000},
	[8] = {name = "orochimaru", start = 176208, monsters_list = {"orochimaru"}, level = 36, count = 1300, points = 3, gradrationPoints = 10, items = {}, reward = {{11319,1}}, exp = 8000, money = 8000},
	[9] = {name = "raikage Bracelet", start = 176209, monsters_list = {"gamahiro"}, level = 450, count = 1350, points = 2, gradrationPoints = 11, items = {}, reward = {{11454,1}}, exp = 12000, money = 8200},
	[10] = {name = "samehada", start = 176210, monsters_list = {"gaara sc2"}, level = 500, count = 1380, points = 3, gradrationPoints = 12, items = {}, reward = {{2440,1}}, exp = 0, money = 0},
	[11] = {name = "skin sasuke", start = 176211, monsters_list = {"great bison"}, level = 550, count = 1400, points = 2, gradrationPoints = 13, items = {}, reward = {{11336,1}}, exp = 8000, money = 8500},
	[12] = {name = "madara", start = 176212, monsters_list = {"madara","madara"}, level = 560, count = 1500, points = 1, gradrationPoints = 14, items = {}, reward = {{11320,1}}, exp = 9000, money = 9000},
	[13] = {name = "gunbai" ,start = 176213, monsters_list = {"madara"}, level = 570, count = 1600, points = 3, gradrationPoints = 15, items = {}, reward = {{2511,1}}, exp = 20000, money = 15000},
	[14] = {name = "pain boss" ,start = 176214, monsters_list = {"pain boss"}, level = 580, count = 1700, points = 3, gradrationPoints = 16, items = {}, reward = {{11454,1}}, exp = 25000, money = 11000},
	[15] = {name = "katon element" ,start = 176215, monsters_list = {"skeleto"}, level = 590, count = 1800, points = 0, gradrationPoints = 17, items = {}, reward = {{11427,1}}, exp = 20000, money = 32000},
	[16] = {name = "suiton element" ,start = 176216, monsters_list = {"renegade"}, level = 600, count = 1900, points = 3, gradrationPoints = 18, items = {}, reward = {{11429,1}}, exp = 22000, money = 15000},
	[17] = {name = "raiton element" ,start = 176217, monsters_list = {"mutation creature"}, level = 610, count = 2000, points = 3, gradrationPoints = 19, items = {}, reward = {{11430,1}}, exp = 25000, money = 18000},
	[17] = {name = "doton element" ,start = 176218, monsters_list = {"electro"}, level = 620, count = 2100, points = 3, gradrationPoints = 20, items = {}, reward = {{11430,1}}, exp = 25000, money = 15000}
}
daily_task = {
	[1] = {name = "daily ogres" ,monsters_list = {"ogres"}, count = 900, taskPoints = 1, gradrationPoints = 15, reward = {{1960,1}}, exp = 5000, money = 10000},
	[2] = {name = "daily suiton element" ,monsters_list = {"tigre"}, count = 1200, taskPoints = 1, gradrationPoints = 15, reward = {{11428,1}}, exp = 9000, money = 12000},
	[3] = {name = "daily esqueleto" ,monsters_list = {"esqueleto"}, count = 600, taskPoints = 2, gradrationPoints = 15, reward = {{11429,1}}, exp = 9000, money = 15000},
	[4] = {name = "daily fuuton element" ,monsters_list = {"false zetsu","false zetsu"}, count = 1000, taskPoints = 20, gradrationPoints = 16, reward = {{11429,1}}, exp = 2000, money = 10000},
	[5] = {name = "daily raiton element" ,monsters_list = {"gamahiro"}, count = 1500, taskPoints = 1, gradrationPoints = 20, reward = {{11430,1}}, exp = 20000, money = 25000},
	[6] = {name = "daily doton element" ,monsters_list = {"salamandra"}, count = 2000, taskPoints =1, gradrationPoints = 20, reward = {{11431,1}}, exp = 100000, money = 160000},
	[7] = {name = "daily jya" ,monsters_list = {"jya"}, count = 700, taskPoints = 1, gradrationPoints = 25, reward = {}, exp = 130000, money = 200000},
	[8] = {name = "daily skin kaneki" ,monsters_list = {"demoniac"}, count = 600, taskPoints = 1, gradrationPoints = 25, reward = {{11330,1}}, exp = 130000, money = 200000},
	[9] = {name = "daily skin zoro" ,monsters_list = {"strong"}, count = 500, taskPoints = 1, gradrationPoints = 25, reward = {{11342,1}}, exp = 140000, money = 200000},
	[10] = {name = "daily skin natsu" ,monsters_list = {"squartou brock"}, count = 550, taskPoints = 1, gradrationPoints = 30, reward = {{11332,1}}, exp = 130000, money = 200000},
	[11] = {name = "daily skin lee sin" ,monsters_list = {"squartou hatch"}, count = 500, taskPoints = 1, gradrationPoints = 30, reward = {{11334,1}}, exp = 120000, money = 200000},
	[12] = {name = "daily skin luffy" ,monsters_list = {"squartou"}, count = 500, taskPoints = 1, gradrationPoints = 30, reward = {{11341,1}}, exp = 110000, money = 200000},
	[13] = {name = "daily skin ichigo" ,monsters_list = {"raposa"}, count = 1, taskPoints = 1, gradrationPoints = 35, reward = {{11333,1}}, exp = 100000, money = 200000},
	[14] = {name = "daily otsutsuki part1" ,monsters_list = {"demoniac"}, count = 1000, taskPoints = 1, gradrationPoints = 35, reward = {{11325,1}}, exp = 100000, money = 200000},
	[15] = {name = "daily otsutsuki part2" ,monsters_list = {"squartou"}, count = 1100, taskPoints = 1, gradrationPoints = 35, reward = {{11326,1}}, exp = 100000, money = 200000},
	[16] = {name = "daily otsutsuki part3" ,monsters_list = {"squartou hatch"}, count = 1200, taskPoints = 1, gradrationPoints = 35, reward = {{11327,1}}, exp = 100000, money = 200000},
	[17] = {name = "daily otsutsuki part4" ,monsters_list = {"squartou brock"}, count = 1300, taskPoints = 1, gradrationPoints = 35, reward = {{11328,1}}, exp = 100000, money = 200000},
	[18] = {name = "daily otsutsuki part5" ,monsters_list = {"strong"}, count = 1400, taskPoints = 1, gradrationPoints = 35, reward = {{11329,1}}, exp = 100000, money = 200000}
}

 

 

 

DEU ERRO DNOVO COLOQUEI AS TAG Q VC PASSOU MANO, SERÁ QUE NÃO É ESSE GRADRATIOB POINTS? Q TA BUGANDO? TIPO ELA ANTES TAVA FUNCIONANDO DAI CHEGO NA TASK NUMERO 9 PAIN BOSS PARO DE FUNCIONAR DESDE ENTÃO NÃO PEGA, MAIS ESSE GRAD POINTS FOI COLOCADO POR UM AMIGO MEU NÃO TINHA NO SEU SISTEMA GRADRATION É POINTS NO MEU JOGO TENDEU.

 

 

 

 

5151.png

Link para o post
Compartilhar em outros sites
2 horas atrás, KR33 disse:

 

 

DEU ERRO DNOVO COLOQUEI AS TAG Q VC PASSOU MANO, SERÁ QUE NÃO É ESSE GRADRATIOB POINTS? Q TA BUGANDO? TIPO ELA ANTES TAVA FUNCIONANDO DAI CHEGO NA TASK NUMERO 9 PAIN BOSS PARO DE FUNCIONAR DESDE ENTÃO NÃO PEGA, MAIS ESSE GRAD POINTS FOI COLOCADO POR UM AMIGO MEU NÃO TINHA NO SEU SISTEMA GRADRATION É POINTS NO MEU JOGO TENDEU.

 

 

 

 

5151.png

rapaz nem vi esse graduation points é vdd kkkk vc que alterou o sistema?

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
2 horas atrás, Vodkart disse:

rapaz nem vi esse graduation points é vdd kkkk vc que alterou o sistema?

 nn foi um amigo que fez pra mim, agora começo bugar não consigo colocar novas task antes funcionava somente 8 agr nenhuma, tipo tem como alterar esse task points por pontos grad?

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 cloudrun2023
      CloudRun - Sua Melhor Escolha para Hospedagem de OTServer!
      Você está procurando a solução definitiva para hospedar seu OTServer com desempenho imbatível e segurança inigualável? Não procure mais! Apresentamos a CloudRun, sua parceira confiável em serviços de hospedagem na nuvem.
       
      Recursos Exclusivos - Proteção DDoS Avançada:
      Mantenha seu OTServer online e seguro com nossa robusta proteção DDoS, garantindo uma experiência de jogo ininterrupta para seus jogadores.
       
      Servidores Ryzen 7 Poderosos: Desfrute do poder de processamento superior dos servidores Ryzen 7 para garantir um desempenho excepcional do seu OTServer. Velocidade e estabilidade garantidas!
       
      Armazenamento NVMe de Alta Velocidade:
      Reduza o tempo de carregamento do jogo com nosso armazenamento NVMe ultrarrápido. Seus jogadores vão adorar a rapidez com que podem explorar o mundo do seu OTServer.
       
      Uplink de até 1GB:
      Oferecemos uma conexão de alta velocidade com até 1GB de largura de banda, garantindo uma experiência de jogo suave e livre de lag para todos os seus jogadores, mesmo nos momentos de pico.
       
      Suporte 24 Horas:
      Estamos sempre aqui para você! Nossa equipe de suporte está disponível 24 horas por dia, 7 dias por semana, para resolver qualquer problema ou responder a qualquer pergunta que você possa ter. Sua satisfação é a nossa prioridade.
       
      Fácil e Rápido de Começar:
      Configurar seu OTServer na CloudRun é simples e rápido. Concentre-se no desenvolvimento do seu jogo enquanto cuidamos da hospedagem.
       
      Entre em Contato Agora!
      Website: https://central.cloudrun.com.br/index.php?rp=/store/cloud-ryzen-brasil
      Email: [email protected]
      Telefone: (47) 99902-5147

      Não comprometa a qualidade da hospedagem do seu OTServer. Escolha a CloudRun e ofereça aos seus jogadores a melhor experiência de jogo possível. Visite nosso site hoje mesmo para conhecer nossos planos e começar!
       
      https://central.cloudrun.com.br/index.php?rp=/store/cloud-ryzen-brasil
       
      CloudRun - Onde a Velocidade Encontra a Confiabilidade!
       

    • Por FeeTads
      SALVE rapaziada do TK, esses dias vim pensando em novos scripts pro meu OT, e em um deles eu precisava que determinada area não contasse frag pro player que matasse outros, PORÉM eu precisava que os players que morressem nessa area ainda assim tivessem as penalidades da sua morte, procurei por ai, achei alguns scripts que apenas tiravam o SKULL e não realmente o FRAG do player.

      **script atualizado 22/10/2023** - melhorado e otimizado, levei o script pra puxar as infos por .lua / creatureScripts

      vou disponibilizar o code aqui, e o que fazer pra determinada area não contar frag.

      SOURCE OTX 2 / TFS 0.x, Funciona em TFS 1.x mudando as tags e ajeitando as sintaxes.

      vá em creatureevent.cpp

      procure por:
      else if(type == "preparedeath") _type = CREATURE_EVENT_PREPAREDEATH;
      Adiciona abaixo:
      else if(type == "nocountfrag") _type = CREATURE_EVENT_NOCOUNTFRAG;

      procure por:
      case CREATURE_EVENT_PREPAREDEATH: return "onPrepareDeath";  
      Adicione abaixo: 
      case CREATURE_EVENT_NOCOUNTFRAG: return "noCountFragArea";

      procure por:
      case CREATURE_EVENT_PREPAREDEATH: return "cid, deathList";
      Adicione abaixo:
      case CREATURE_EVENT_NOCOUNTFRAG: return "cid, target";

      agora no mesmo arquivo, vá até o final do arquivo e adicione essa função:
      uint32_t CreatureEvent::executeNoCountFragArea(Creature* creature, Creature* target) { //noCountFragArea(cid, target) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { env->setRealPos(creature->getPosition()); std::ostringstream scriptstream; scriptstream << "local cid = " << env->addThing(creature) << std::endl; scriptstream << "local target = " << env->addThing(target) << std::endl; if(m_scriptData) scriptstream << *m_scriptData; bool result = true; if(m_interface->loadBuffer(scriptstream.str())) { lua_State* L = m_interface->getState(); result = m_interface->getGlobalBool(L, "_result", true); } m_interface->releaseEnv(); return result; } else { #ifdef __DEBUG_LUASCRIPTS__ std::ostringstream desc; desc << creature->getName(); env->setEvent(desc.str()); #endif env->setScriptId(m_scriptId, m_interface); env->setRealPos(creature->getPosition()); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(creature)); lua_pushnumber(L, env->addThing(target)); bool result = m_interface->callFunction(2); m_interface->releaseEnv(); return result; } } else { std::clog << "[Error - CreatureEvent::noCountFragArea] Call stack overflow." << std::endl; return 0; } }

      agora vá em creatureevent.h

      procure por:
      CREATURE_EVENT_PREPAREDEATH
      adicione abaixo:
      CREATURE_EVENT_NOCOUNTFRAG

      procure por:
      uint32_t executePrepareDeath(Creature* creature, DeathList deathList);
      Adicione abaixo:
      uint32_t executeNoCountFragArea(Creature* creature, Creature* target);

      agora vá em player.cpp

      procure por:
      bool Player::onKilledCreature(Creature* target, DeathEntry& entry)
      abaixo de:
      War_t enemy; if(targetPlayer->getEnemy(this, enemy)) { if(entry.isLast()) IOGuild::getInstance()->updateWar(enemy); entry.setWar(enemy); }
      Adicione o seguinte código:
      if (targetPlayer){ CreatureEventList killEvents = getCreatureEvents(CREATURE_EVENT_NOCOUNTFRAG); for (const auto &event : killEvents) { if (!event->executeNoCountFragArea(this, target)) { return true; } } }

      //

      Feito isso, tudo completo na sua source, agora é necessário adicionar o creaturescript dentro do servidor

      vá até creaturescripts/scripts
      crie um arquivo chamado, "noCountFragInArea.lua"
      e dentro dele cole o código:
       
      --[[ script feito por feetads / TibiaKing ]]-- --[[ discord: feetads / FeeTads#0246 ]]-- -- Add positions here for which you do not want to count frags local areas = { [1] = {from = {x = 91, y = 122, z = 7}, to = {x = 98, y = 127, z = 7}}, -- from = area superior esquerda / to = area inferior direita (formando um quadrado) } local onlyKillerInArea = false -- only killer need to be in area? function noCountFragArea(cid, target) if not isCreature(cid) or not isCreature(target) then return true end local posKiller = getPlayerPosition(cid) local posTarget = getPlayerPosition(target) for i = 1, #areas do local area = areas[i] if isInArea(posKiller, area.from, area.to) then if onlyKillerInArea then return false elseif isInArea(posTarget, area.from, area.to) then return false end end end return true end
      agora em creaturescripts.xml
      <event type="nocountfrag" name="fragarea" event="script" value="noCountFragInArea.lua"/>
      agora em creaturescripts/scripts/login.lua
       procure por OU semelhante a esse:
      registerCreatureEvent(cid, "AdvanceSave")
      e abaixo adicione:
      registerCreatureEvent(cid, "fragarea")

      //


      Agora tudo certo, quando quiser adiciona uma area que não pega frag, vá até o script e apenas coloque a area, igual o demonstrado no script

      Exemplo:
      local areas = { [1] = {from = {x = 91, y = 122, z = 7}, to = {x = 98, y = 127, z = 7}}, [2] = {from = {x = 1000, y = 1000, z = 7}, to = {x = 1100, y = 1100, z = 7}}, }
      assim somente colocando a area no script e abrindo o server ou dando /reload, já funcionará a area como não pegar frag.
      Esse sistema pode ser bom pra areas de pvp ativo, onde você ainda quer que o player que morrer perca os atributos, como se fosse uma morte normal, porém não conta frag pra quem matar.
      Bom pra sistemas tipo castle 48h (guild war), onde há diversas mortes e risco de pegar red, atrapalhando a war.

      Façam bom proveito dos scripts, e deixem os créditos no script rsrs

      **Eu fiz as alterações e o simples código por isso vim disponibilizar, créditos meus**
    • Por Muvuka
      Abri canal a força creaturescript acho que funcione no creaturescript cria script creaturescript
       
      <channel id="9" name="HELP" logged="yes"/>
      <channel id="12" name="Report Bugs" logged="yes"/>
      <channel id="13" name="Loot" logged="yes"/>
      <channel id="14" name="Report Character Rules Tibia Rules" logged="yes"/>
      <channel id="15" name="Death Channel"/>
      <channel id="6548" name="DexSoft" level="1"/>
      <channel id="7" name="Reports" logged="yes"/>
       
      antes de 
              if(lastLogin > 0) then adicione isso:
                      doPlayerOpenChannel(cid, CHANNEL_HELP) doPlayerOpenChannel(cid, 1,  2, 3) = 1,2 ,3 Channels, entendeu? NÃO FUNCIONA EU QUERO UM MEIO DE ABRI SEM USA A SOURCE
       
      EU NÃO CONSEGUI ABRI EU NÃO TENHO SOURCE
       
       
    • Por bolachapancao
      Rapaziada seguinte preciso de um script que ao utilizar uma alavanca para até 4 jogadores.
      Os jogadores serão teleportados para hunt durante uma hora e depois de uma hora os jogadores serão teleportados de volta para o templo.
       
      Observação: caso o jogador morra ou saia da hunt o evento hunt é cancelado.

      Estou a base canary
      GitHub - opentibiabr/canary: Canary Server 13.x for OpenTibia community.
       
    • Por RAJADAO
      .Qual servidor ou website você utiliza como base? 
      Sabrehaven 8.0
      Qual o motivo deste tópico? 
      Ajuda com novos efeitos
       
      Olá amigos, gostaria de ajuda para introduzir os seguintes efeitos no meu servidor (usando o Sabrehaven 8.0 como base), adicionei algumas runas novas (avalanche, icicle, míssil sagrado, stoneshower & Thunderstorm) e alguns novos feitiços (exevo mas san, exori san, exori tera, exori frigo, exevo gran mas frigo, exevo gran mas tera, exevo tera hur, exevo frigo hur) mas nenhum dos efeitos dessas magias parece existir no servidor, alguém tem um link para um tutorial ou algo assim para que eu possa fazer isso funcionar?
      Desculpe pelo mau inglês, sou brasileiro.

      Obrigado!


      AVALANCHE RUNE id:3161 \/
      (COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_ICEAREA)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)

      STONESHOWER RUNE id:3175 \/
      (COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_STONES)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH)

      THUNDERSTORM RUNE id:3202 \/
      (COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_E NERGYHIT)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYBALL)

      ICICLE RUNE id:3158 \/
      COMBAT_ICEDAMAGE
      CONST_ME_ICEAREA
      CONST_ANI_ICE

      SANTO MÍSSIL RUNA id:3182 \/
      (COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)

      CONST_ME_PLANTATTACK (exevo gran mas tera)
      CONST_ME_ICETORNADO (exevo gran mas frigo)
      CONST_ME_SMALLPLANTS (exevo tera hur)
      CONST_ME_ICEAREA (exevo frigo hur)
      CONST_ME_ICEATTACK (exori frigo)
      CONST_ME_CARNIPHILA (exori tera)

      EXORI SAN \/
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLHOLY)
      CONST_ME_HOLYDAM IDADE

      EXEVO MAS SAN \/
      CONST_ME_HOLYAREA
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo