
Tudo que Vodkart postou
-
(Resolvido)Kill, Death, VIP, Critical, Dodge, Look.
mas teu vip é os.time() ou só joga storage 13540? se der me mostra o script onde adc vip no seu ot.
-
Ancient Scarab Lair | Cave Hunt | 8.60
Parabéns, seu tópico de conteúdo foi aprovado! Muito obrigado pela sua contribuição, nós do Tibia King agradecemos. Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP.
-
(Resolvido)Kill, Death, VIP, Critical, Dodge, Look.
MODS use assim: <?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 = "Trolls", start = 176201, monsters_list = {"Troll","Troll champion"}, level = 8, count = 120, points = 2, items = {{2448,1}}, reward = {{2645,1}}, exp = 100000, money = 20000}, [2] = {name = "rotworms", start = 176202, monsters_list = {"rotworm","carrion worm","Rotworm Queen"}, level = 8, count = 150, points = 2, items = {{2530,1}}, reward = {{2520,1}}, exp = 100000, money = 30000}, [3] = {name = "cyclops", start = 176203, monsters_list = {"cyclops","cyclops smith","cyclops drone"}, level = 8, count = 130, points = 2, items = {{2490,1}}, reward = {{2466,1}}, exp = 100000, money = 40000}, [4] = {name = "Dragon", start = 176204, monsters_list = {"dragon"}, level = 8, count = 150, points = 3, items = {{2397,1}}, reward = {{2195,1}}, exp = 150000, money = 50000}, [5] = {name = "Dragon Lord", start = 176205, monsters_list = {"Dragon Lord"}, level = 300, count = 200, points = 3, items = {{2528,3}}, reward = {{2470,1}}, exp = 150000, money = 60000}, [6] = {name = "Behemoth", start = 176206, monsters_list = {"Behemoth"}, level = 8, count = 150, points = 3, items = {{5930,3}}, reward = {{8889,1}}, exp = 150000, money = 70000}, [7] = {name = "Lizard Dragons" ,start = 176220, monsters_list = {"Lizard Chosen","Lizard Dragon Priest","Lizard High Guard","Lizard Legionnaire", "Lizard Zaogun"}, level = 8, count = 350, points = 3, items = {{11297,3}}, reward = {{2493,1}}, exp = 150000, money = 80000}, [8] = {name = "Defiler", start = 176208, monsters_list = {"Defiler"}, level = 8, count = 300, points = 3, items = {{6500,4}}, reward = {{2494,1}}, exp = 150000, money = 90000}, [9] = {name = "Hellfire Fighter", start = 176209, monsters_list = {"Hellfire Fighter"}, level = 8, count = 350, points = 4, items = {{2136,4}}, reward = {{2538,1}}, exp = 250000, money = 100000}, [10] = {name = "Hydra", start = 176210, monsters_list = {"Hydra"}, level = 100, count = 600, points = 4, items = {{4850,5}}, reward = {{6391,1}}, exp = 250000, money = 100000}, [11] = {name = "Medusa", start = 176211, monsters_list = {"Medusa"}, level = 100, count = 650, points = 5, items = {{2536,5}}, reward = {{2517,1}}, exp = 250000, money = 150000}, [12] = {name = "Frost Dragon", start = 176212, monsters_list = {"Frost Dragon"}, level = 100, count = 800, points = 5, items = {{1976,7}}, reward = {{1992,1}}, exp = 250000, money = 150000}, [13] = {name = "Warlock" ,start = 176213, monsters_list = {"Warlock"}, level = 200, count = 800, points = 5, items = {{2656,7}}, reward = {{2343,1}}, exp = 350000, money = 200000}, [14] = {name = "Grim Reaper" ,start = 176214, monsters_list = {"Grim Reaper"}, level = 250, count = 700, points = 6, items = {{2521,9}}, reward = {{2499,1}}, exp = 350000, money = 200000}, [15] = {name = "Demon" ,start = 176215, monsters_list = {"Demon"}, level = 300, count = 1000, points = 6, items = {{5954,9}}, reward = {{2644,1}}, exp = 450000, money = 300000}, [16] = {name = "Medusa Vip" ,start = 176216, monsters_list = {"Medusa Vip"}, level = 350, count = 1200, points = 6, items = {{7887,11}}, reward = {{6132,1}}, exp = 450000, money = 300000}, [17] = {name = "Hydra Vip" ,start = 176217, monsters_list = {"Hydra Vip"}, level = 350, count = 1200, points = 6, items = {{2498,11}}, reward = {{2527,1}}, exp = 550000, money = 400000}, [18] = {name = "Grim Reaper Vip" ,start = 176218, monsters_list = {"Grim Reaper Vip"}, level = 350, count = 1200, points = 8, items = {{6300,15}}, reward = {{2518,1}}, exp = 550000, money = 400000}, [19] = {name = "Warlock Vip" ,start = 176219, monsters_list = {"Warlock Vip"}, level = 350, count = 1200, points = 8, items = {{2466,15}}, reward = {{2519,1}}, exp = 650000, money = 500000}, [20] = {name = "Frost Dragon Vip" ,start = 176220, monsters_list = {"Frost Dragon Vip"}, level = 350, count = 1200, points = 8, items = {{2492,19}}, reward = {{8932,1}}, exp = 650000, money = 500000}, [21] = {name = "Demon Vip" ,start = 176221, monsters_list = {"Demon Vip"}, level = 350, count = 2000, points = 10, items = {{2418,19}}, reward = {{8926,1}}, exp = 750000, money = 600000}, [22] = {name = "Dragon Lord Vip II" ,start = 176222, monsters_list = {"Dragon Lord Vip II"}, level = 450, count = 1500, points = 10, items = {{2414,25}}, reward = {{2444,1}}, exp = 750000, money = 600000}, [23] = {name = "Frost Dragon Vip II" ,start = 176223, monsters_list = {"Frost Dragon Vip II"}, level = 450, count = 1500, points = 10, items = {{7290,25}}, reward = {{7367,1}}, exp = 850000, money = 700000}, [24] = {name = "Grim Reaper Vip II" ,start = 176224, monsters_list = {"Grim Reaper Vip II"}, level = 450, count = 1500, points = 10, items = {{5909,30}}, reward = {{7367,1}}, exp = 850000, money = 700000}, [25] = {name = "Hydra Vip II" ,start = 176225, monsters_list = {"Hydra Vip II"}, level = 450, count = 1500, points = 10, items = {{2476,30}}, reward = {{7414,1}}, exp = 2500000, money = 1000000}, [26] = {name = "Medusa Vip II" ,start = 176226, monsters_list = {"Medusa Vip II"}, level = 450, count = 1500, points = 10, items = {{2143,75}}, reward = {{2495,1},{2471,1}}, exp = 2500000, money = 1000000}, [27] = {name = "Lord Of Demon" ,start = 176227, monsters_list = {"Lord Of Demon"}, level = 500, count = 6666, points = 10, items = {{2462,120}}, reward = {{9969,5},{2366,1}}, exp = 10000000, money = 1000000}, [28] = {name = "Bossing Of Baiak" ,start = 176228, monsters_list = {"Bossing Of Baiak"}, level = 500, count = 30, points = 10, items = {{5903,5}}, reward = {{9969,5},{2366,1}}, exp = 20000000, money = 3000000}, [29] = {name = "Arabian" ,start = 176229, monsters_list = {"Arabian"}, level = 500, count = 30, points = 10, items = {{10521,10}}, reward = {{2523,1},{2263,1}}, exp = 20000000, money = 3000000}, [30] = {name = "Shadow Warrior" ,start = 176230, monsters_list = {"Shadow Warrior"}, level = 500, count = 70, points = 10, items = {{5875,25}}, reward = {{2298,1},{11114,1}}, exp = 20000000, money = 3000000}, [31] = {name = "Castle Guardian" ,start = 176231, monsters_list = {"Castle Guardian"}, level = 600, count = 25, points = 25, items = {{2520,100}}, reward = {{9969,15},{2366,2}}, exp = 20000000, money = 5000000} } daily_task = { [1] = {name = "Hydra Vip" ,monsters_list = {"Hydra Vip"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000}, [2] = {name = "Grim Reaper Vip" ,monsters_list = {"Grim Reaper Vip"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000}, [3] = {name = "Grim Reaper Vip II" ,monsters_list = {"Grim Reaper Vip II"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000}, [4] = {name = "Frost Dragon Vip" ,monsters_list = {"Frost Dragon Vip"}, count = 750, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000}, [5] = {name = "Dragon Lord Vip II" ,monsters_list = {"Dragon Lord Vip II"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000}, [6] = {name = "Frost Dragon Vip II" ,monsters_list = {"Frost Dragon Vip II"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000}, [7] = {name = "Frost Dragon" ,monsters_list = {"Frost Dragon"}, count = 300, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000}, [8] = {name = "Hydra" ,monsters_list = {"Hydra"}, count = 700, points = 3, reward = {{9969,1}}, exp = 3000000, money = 3000000}, [9] = {name = "Demon Vip" ,monsters_list = {"Demon Vip"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000}, [10] = {name = "Hydra Vip II" ,monsters_list = {"Hydra Vip II"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000}, [11] = {name = "Medusa Vip" ,monsters_list = {"Medusa Vip"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000}, [12] = {name = "Warlock Vip" ,monsters_list = {"Warlock Vip"}, count = 700, points = 4, reward = {{9969,1}}, exp = 3000000, money = 3000000} } task_sys_storages = {176601, 176602, 176603, 176604, 176605, 176606, 176607, 176608} -- task, points, 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,100}] = {1,3}, [{101,200}] = {4,6}, [{201,300}] = {7,9}, [{301,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 = { [{0, 40}] = "Leite com Pera", [{41, 80}] = "Iniciante", [{81, 120}] = "Intermediario", [{121, 200}] = "Fodao", [{201, math.huge}] = "Supremo Lord" } 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 function getDeathsAndKills(cid, type) -- by vodka local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0 if (query:getID() ~= -1) then repeat d = d+1 until not query:next() query:free() end return d end ]]></config> <event type="login" name="TaskLogin" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "KillTask") registerCreatureEvent(cid, "TaskLook") 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].points.."\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).."\nReward Points: "..task_sys[task].points.."\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="60001;60002;60003;60004" event="script"><![CDATA[ domodlib('task_func') function onUse(cid, item, frompos, item2, topos) local t = {[60001] = 20, [60002] = 40, [60003] = 100, [60004] = 200} if not t[item.actionid] then return true end if getTaskPoints(cid) < t[item.actionid] then return doPlayerSendTextMessage(cid,22,"Você só pode passar se tiver " .. t[item.actionid] .. " Task Points.") end doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, topos, true) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Welcome, Task Hunter!") return true end]]></action> </mod> EXCLUA TOSOS OS SCRIPTS ANTERIORES DE DESCRIÇÃO DE LOOK EM CREATURESCRIPT E use somente esse: domodlib('task_func') LimiteQuestCount = 30 -- coloque de acordo com a quantidade de quests existente no seu servidr QuestCountSystem = 123419 -- é a storage da system, lembre-se, não deve existe outra igual function getQuestCompletCount(uid, storage) if isPlayer(uid) then if getPlayerStorageValue(uid, storage) == -1 then return 0 end return getPlayerStorageValue(uid, storage) end end function getPlayerFrags(cid) local time = os.time() local times = {today = (time - 86400), week = (time - (7 * 86400))} local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC") if(result:getID() ~= -1) then repeat local content = {date = result:getDataInt("date")} if(content.date > times.today) then table.insert(contents.day, content) elseif(content.date > times.week) then table.insert(contents.week, content) else table.insert(contents.month, content) end until not result:next() result:free() end local size = { day = table.maxn(contents.day), week = table.maxn(contents.week), month = table.maxn(contents.month) } return size.day + size.week + size.month end function onLogin(cid) registerCreatureEvent(cid, "fraglook") return true end function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) and thing.uid ~= cid then doPlayerSetSpecialDescription(thing.uid,' [Frags: '..getPlayerFrags(thing.uid)..']['..(getPlayerPremiumDays(thing.uid) > 0 and 'VIP' or 'FREE')..'], [Critical: '..math.max(0,(tonumber(getCreatureStorage(thing.uid,48913)) or 0))..'], [Dodge: '..math.max(0,(tonumber(getCreatureStorage(thing.uid,48902)) or 0))..']\nQuests Completas: ['..getQuestCompletCount(thing.uid, QuestCountSystem)..'/'..LimiteQuestCount..']\n'..(getPlayerSex(thing.uid) == 0 and 'She' or 'He')..' is a '..GetRankTask(thing.uid)) return true elseif thing.uid == cid then doPlayerSetSpecialDescription(cid,' [Frags: '..getPlayerFrags(cid)..']['..(getPlayerPremiumDays(cid) > 0 and 'VIP' or 'FREE')..'], [Critical: '..math.max(0,(tonumber(getCreatureStorage(cid,48913)) or 0))..'], [Dodge: '..math.max(0,(tonumber(getCreatureStorage(cid,48902)) or 0))..']\nQuests Completas: ['..getQuestCompletCount(cid, QuestCountSystem)..'/'..LimiteQuestCount..']\n'..(getPlayerSex(cid) == 0 and 'She' or 'He')..' is a '..GetRankTask(cid)) local string = 'You see yourself.' if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then string = string..' You are '.. getPlayerGroupName(cid) ..'.' elseif getPlayerVocation(cid) ~= 0 then string = string..' You are '.. getPlayerVocationName(cid) ..'.' else string = string..' You have no vocation.' end string = string..getPlayerSpecialDescription(cid)..'' if getPlayerNameByGUID(getPlayerPartner(cid), false, false) ~= nil then string = string..' You are '.. (getPlayerSex(cid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(cid)) ..'.' end if getPlayerGuildId(cid) > 0 then string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid) string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then string = string..'\nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].' string = string..'\nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then string = string..'\nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].' end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string) return false end return true end
-
[8.6] Task System 4.0! (Task system + Daily Task System)
tenta deixar assim então: if isPlayer(cid) and ehMonstro(target) then
-
[8.6] Task System 4.0! (Task system + Daily Task System)
sim, deixa assim: if isPlayer(cid) and isMonster(target) then
-
(Resolvido)Ajuda Cave Super Up
local function filtrateString(str) if type(str) ~= "string" then return false end local first, last = 0, 0 local second, final = 0, #str for i = 1, #str do if string.byte(str:sub(i,i)) == string.byte('a') then first = i + 2 for t = first, #str do if string.byte(str:sub(t,t)) == string.byte(' ') then last = t - 1 break end end end if string.byte(str:sub(i,i)) == string.byte('b') then second = i + 2 end end return {str:sub(first, last), str:sub(second, final)} end function doPlayerHaveCave(cid) local count = 0 for i = 822081, 822116 do if tonumber(filtrateString(getGlobalStorageValue(i))[1]) == getPlayerAccountId(cid) and tonumber(filtrateString(getGlobalStorageValue(i))[2]) - os.time() > 0 then count = count + 1 end end return count end function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerLevel(cid) > 600 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce e maior que level 600, porem nao pode usar a cave exclusiva.") return false elseif doPlayerHaveCave(cid) > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce ja possui uma cave propria.") return false end if tonumber(filtrateString(getGlobalStorageValue(822081))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822081, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 1 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822082))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822082, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 2 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822083))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822083, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 3 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822084))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822084, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 4 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822085))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822085, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 5 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822086))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822086, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 6 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822087))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822087, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 7 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822088))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822088, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 8 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822089))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822089, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 9 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822090))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822090, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 10 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822091))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822091, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 11 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822092))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822092, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 12 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822093))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822093, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 13 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822094))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822094, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 14 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822095))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822095, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 15 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822096))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822096, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 16 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822097))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822097, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 17 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822098))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822098, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 18 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822099))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822099, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 19 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822100))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822100, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 20 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822101))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822101, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 21 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822102))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822102, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 22 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822103))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822103, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 23 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822104))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822104, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 24 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822105))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822105, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 25 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822106))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822106, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 26 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822822))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822822, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 27 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822108))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822108, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 28 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822109))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822109, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 29 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822110))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822110, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 30 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822111))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822111, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 31 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822112))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822112, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 32 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822113))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822113, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 33 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822114))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822114, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 34 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822115))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822115, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 35 e pode upar lá por 4 horas.") elseif tonumber(filtrateString(getGlobalStorageValue(822116))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822116, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 36 e pode upar lá por 4 horas.") else doPlayerSendCancel(cid, "Todas as caves já estão com dono no momento. Tente mais tarde.") end return true end
-
(Resolvido)Ajuda Cave Super Up
local function filtrateString(str) if type(str) ~= "string" then return false end local first, last = 0, 0 local second, final = 0, #str local limitedeuso = 49015 local textofinal1 = "Voce ja esta sob efeito da pot de experiencia espere o efeito acabar." for i = 1, #str do if string.byte(str:sub(i,i)) == string.byte('a') then first = i + 2 for t = first, #str do if string.byte(str:sub(t,t)) == string.byte(' ') then last = t - 1 break end end end if string.byte(str:sub(i,i)) == string.byte('b') then second = i + 2 end end return {str:sub(first, last), str:sub(second, final)} end function doPlayerHaveCave(cid) local count = 0 for i = 822081, 822098 do if tonumber(filtrateString(getGlobalStorageValue(i))[1]) == getPlayerAccountId(cid) and tonumber(filtrateString(getGlobalStorageValue(i))[2]) - os.time() > 0 then count = count + 1 end end return count end function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerLevel(cid) > 15000 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce e maior que level 15000, porem nao pode usar a cave exclusiva.") return false elseif doPlayerHaveCave(cid) > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce ja possui uma cave propria.") return false end if tonumber(filtrateString(getGlobalStorageValue(822081))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822081, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 1 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822082))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822082, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 2 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822083))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822083, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 3 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822084))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822084, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 4 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822085))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822085, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 5 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822086))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822086, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 6 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822087))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822087, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 7 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822088))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822088, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 8 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822089))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822089, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 9 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822090))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822090, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 10 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822091))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822091, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 11 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822092))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822092, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 12 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822093))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822093, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 13 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822094))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822094, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 14 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822095))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822095, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 15 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822096))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822096, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 16 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822097))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822097, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 17 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822098))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822098, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 18 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) else doPlayerSendCancel(cid, "Todas as caves já estão com dono no momento. Tente mais tarde.") end return true end tenta assim
-
(Resolvido)Ajuda Cave Super Up
local function filtrateString(str) if type(str) ~= "string" then return false end local first, last = 0, 0 local second, final = 0, #str local limitedeuso = 49015 local textofinal1 = "Voce ja esta sob efeito da pot de experiencia espere o efeito acabar." for i = 1, #str do if string.byte(str:sub(i,i)) == string.byte('a') then first = i + 2 for t = first, #str do if string.byte(str:sub(t,t)) == string.byte(' ') then last = t - 1 break end end end if string.byte(str:sub(i,i)) == string.byte('b') then second = i + 2 end end return {str:sub(first, last), str:sub(second, final)} end function doPlayerHaveCave(cid) local count = 0 for i = 822081, 822098 do if getGlobalStorageValue(i) == getPlayerAccountId(cid) and tonumber(filtrateString(getGlobalStorageValue(i))[2]) - os.time() > 0 then count = count + 1 end end return count end function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerLevel(cid) > 15000 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce e maior que level 15000, porem nao pode usar a cave exclusiva.") return false elseif doPlayerHaveCave(cid) > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce ja possui uma cave propria.") return false end if tonumber(filtrateString(getGlobalStorageValue(822081))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822081, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 1 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822082))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822082, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 2 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822083))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822083, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 3 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822084))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822084, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 4 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822085))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822085, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 5 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822086))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822086, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 6 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822087))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822087, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 7 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822088))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822088, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 8 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822089))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822089, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 9 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822090))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822090, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 10 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822091))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822091, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 11 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822092))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822092, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 12 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822093))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822093, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 13 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822094))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822094, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 14 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822095))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822095, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 15 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822096))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822096, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 16 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822097))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822097, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 17 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) elseif tonumber(filtrateString(getGlobalStorageValue(822098))[2]) < os.time() then doRemoveItem(item.uid) setGlobalStorageValue(822098, "a "..getPlayerAccountId(cid).." b ".. os.time() + (3600 * 4)) doPlayerSendTextMessage(cid, 25, "Agora você é o dono da cave 18 e pode upar lá por 4 horas.") elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) else doPlayerSendCancel(cid, "Todas as caves já estão com dono no momento. Tente mais tarde.") end return true end
-
[8.6] Task System 4.0! (Task system + Daily Task System)
como assim não funciona? no caso quando você mata um monstro não conta na task? ou é só o comando mesmo?
-
(Resolvido)Spell
function onCastSpell(creature, variant) local combat = Combat() combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_DEATH) function onGetFormulaValues(player, level, maglevel) if player:getVocation() >= 1 or player:getVocation() <= 4 then min = (level / 5) + (maglevel * 1.4) + 8 max = (level / 5) + (maglevel * 2.2) + 14 elseif player:getVocation() >= 5 or player:getVocation() <= 8 then min = (level / 50) + (maglevel * 10.4) + 80 max = (level / 50) + (maglevel * 20.2) + 140 end return -min, -max end combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") return combat:execute(creature, variant) end
-
(Resolvido)Spell
function onCastSpell(creature, variant) if getPlayerVocation(cid) >= 1 or getPlayerVocation(cid) <= 4 then combat = Combat() combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_DEATH) function onGetFormulaValues(player, level, maglevel) local min = (level / 5) + (maglevel * 1.4) + 8 local max = (level / 5) + (maglevel * 2.2) + 14 return -min, -max end combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") elseif getPlayerVocation(cid) >= 5 or getPlayerVocation(cid) <= 8 then combat = Combat() combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_DEATH) function onGetFormulaValues(player, level, maglevel) local min = (level / 50) + (maglevel * 10.4) + 80 local max = (level / 50) + (maglevel * 20.2) + 140 return -min, -max end combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") end return combat:execute(creature, variant) end
-
kick depois de x segundos
ex: function onUse(cid, item, fromPosition, itemEx, toPosition, isHotkey) addEvent(function(playerid) local player = Player(playerid) if not player then return false end player:remove() end, 10000, cid) return true end
-
Player.lua com Problema!
-- Internal Use STONE_SKIN_AMULET = 2197 GOLD_POUNCH = 26377 -- No move items with actionID 8000 NOT_MOVEABLE_ACTION = 8000 -- Players cannot throw items on teleports if set to true local blockTeleportTrashing = true titles = { {storageID = 14960, title = " Scout"}, {storageID = 14961, title = " Sentinel"}, {storageID = 14962, title = " Steward"}, {storageID = 14963, title = " Warden"}, {storageID = 14964, title = " Squire"}, {storageID = 14965, title = " Warrior"}, {storageID = 14966, title = " Keeper"}, {storageID = 14967, title = " Guardian"}, {storageID = 14968, title = " Sage"}, {storageID = 14969, title = " Tutor"}, {storageID = 14970, title = " Senior Tutor"}, {storageID = 14971, title = " King"}, } function getTitle(uid) local player = Player(uid) if not player then return false end for i = #titles, 1, -1 do if player:getStorageValue(titles[i].storageID) == 1 then return titles[i].title end end return false end function Player:onBrowseField(position) return true end function getHours(seconds) return math.floor((seconds/60)/60) end function getMinutes(seconds) return math.floor(seconds/60) end function getTime(seconds) local hours, minutes = getHours(seconds), getMinutes(seconds) if (minutes > 59) then minutes = minutes-hours*60 end if (minutes < 10) then minutes = "0" ..minutes end return hours..":"..minutes.. "h" end function Player:onLook(thing, position, distance) local description = "You see " if thing:isItem() then if thing.actionid == 5640 then description = description .. "a honeyflower patch." elseif thing.actionid == 5641 then description = description .. "a banana palm." elseif thing.itemid >= ITEM_HEALTH_CASK_START and thing.itemid <= ITEM_HEALTH_CASK_END or thing.itemid >= ITEM_MANA_CASK_START and thing.itemid <= ITEM_MANA_CASK_END or thing.itemid >= ITEM_SPIRIT_CASK_START and thing.itemid <= ITEM_SPIRIT_CASK_END or thing.itemid >= ITEM_KEG_START and thing.itemid <= ITEM_KEG_END then description = description .. thing:getDescription(distance) local charges = thing:getCharges() if charges then description = string.format("%s\nIt has %d refillings left.", description, charges) end else description = description .. thing:getDescription(distance) end local itemType = thing:getType() if (itemType and itemType:getImbuingSlots() > 0) then local imbuingSlots = "Imbuements: (" for i = 1, itemType:getImbuingSlots() do local specialAttr = thing:getSpecialAttribute(i) local time = 0 if (thing:getSpecialAttribute(i+3)) then time = getTime(thing:getSpecialAttribute(i+3)) end if (specialAttr and specialAttr ~= 0) then if (i ~= itemType:getImbuingSlots()) then imbuingSlots = imbuingSlots.. "" ..specialAttr.." " ..time..", " else imbuingSlots = imbuingSlots.. "" ..specialAttr.." " ..time..")." end else if (i ~= itemType:getImbuingSlots()) then imbuingSlots = imbuingSlots.. "Empty Slot, " else imbuingSlots = imbuingSlots.. "Empty Slot)." end end end description = string.gsub(description, "It weighs", imbuingSlots.. "\nIt weighs") end else description = description .. thing:getDescription(distance) end if self:getGroup():getAccess() then if thing:isItem() then description = string.format("%s\nItem ID: %d", description, thing:getId()) local actionId = thing:getActionId() if actionId ~= 0 then description = string.format("%s, Action ID: %d", description, actionId) end local uniqueId = thing:getAttribute(ITEM_ATTRIBUTE_UNIQUEID) if uniqueId > 0 and uniqueId < 65536 then description = string.format("%s, Unique ID: %d", description, uniqueId) end local itemType = thing:getType() local transformEquipId = itemType:getTransformEquipId() local transformDeEquipId = itemType:getTransformDeEquipId() if transformEquipId ~= 0 then description = string.format("%s\nTransforms to: %d (onEquip)", description, transformEquipId) elseif transformDeEquipId ~= 0 then description = string.format("%s\nTransforms to: %d (onDeEquip)", description, transformDeEquipId) end local decayId = itemType:getDecayId() if decayId ~= -1 then description = string.format("%s\nDecays to: %d", description, decayId) end elseif thing:isCreature() then local str = "%s\nHealth: %d / %d" if thing:isPlayer() and thing:getMaxMana() > 0 then str = string.format("%s, Mana: %d / %d", str, thing:getMana(), thing:getMaxMana()) end description = string.format(str, description, thing:getHealth(), thing:getMaxHealth()) .. "." end local position = thing:getPosition() description = string.format( "%s\nPosition: %d, %d, %d", description, position.x, position.y, position.z ) if thing:isCreature() then if thing:isPlayer() then description = string.format("%s\nIP: %s.", description, Game.convertIpToString(thing:getIp())) end end end self:sendTextMessage(MESSAGE_INFO_DESCR, description) end function Player:onLookInBattleList(creature, distance) local description = "You see " .. creature:getDescription(distance) if self:getGroup():getAccess() then local str = "%s\nHealth: %d / %d" if creature:isPlayer() and creature:getMaxMana() > 0 then str = string.format("%s, Mana: %d / %d", str, creature:getMana(), creature:getMaxMana()) end description = string.format(str, description, creature:getHealth(), creature:getMaxHealth()) .. "." local position = creature:getPosition() description = string.format( "%s\nPosition: %d, %d, %d", description, position.x, position.y, position.z ) if creature:isPlayer() then description = string.format("%s\nIP: %s", description, Game.convertIpToString(creature:getIp())) end end self:sendTextMessage(MESSAGE_INFO_DESCR, description) end function Player:onLookInTrade(partner, item, distance) self:sendTextMessage(MESSAGE_INFO_DESCR, "You see " .. item:getDescription(distance)) end function Player:onLookInShop(itemType, count) return true end config = { maxItemsPerSeconds = 1, exhaustTime = 2000, } if not pushDelay then pushDelay = { } end function antiPush(self, item, count, fromPosition, toPosition, fromCylinder, toCylinder) if toPosition.x == CONTAINER_POSITION then return true end local tile = Tile(toPosition) if not tile then self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) return false end local cid = self:getId() if not pushDelay[cid] then pushDelay[cid] = {items = 0, time = 0} end pushDelay[cid].items = pushDelay[cid].items + 1 local currentTime = os.mtime() if pushDelay[cid].time == 0 then pushDelay[cid].time = currentTime elseif pushDelay[cid].time == currentTime then pushDelay[cid].items = pushDelay[cid].items + 1 elseif currentTime > pushDelay[cid].time then pushDelay[cid].time = 0 pushDelay[cid].items = 0 end if pushDelay[cid].items > config.maxItemsPerSeconds then pushDelay[cid].time = currentTime + config.exhaustTime end if pushDelay[cid].time > currentTime then self:sendCancelMessage("You can't move that item so fast.") return false end return true end function Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder, toCylinder) -- No move if item count > 20 items local tile = Tile(toPosition) if tile and tile:getItemCount() > 20 then self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) return false end -- SSA exhaust local exhaust = { } if toPosition.x == CONTAINER_POSITION and toPosition.y == CONST_SLOT_NECKLACE and item:getId() == STONE_SKIN_AMULET then local pid = self:getId() if exhaust[pid] then self:sendCancelMessage(RETURNVALUE_YOUAREEXHAUSTED) return false else exhaust[pid] = true addEvent(function() exhaust[pid] = false end, 2000, pid) return true end end -- Store Inbox local containerIdFrom = fromPosition.y - 64 local containerFrom = self:getContainerById(containerIdFrom) if (containerFrom) then if (containerFrom:getId() == ITEM_STORE_INBOX and toPosition.y >= 1 and toPosition.y <= 11 and toPosition.y ~= 3) then self:sendCancelMessage(RETURNVALUE_CONTAINERNOTENOUGHROOM) return false end end local containerTo = self:getContainerById(toPosition.y-64) if (containerTo) then if (containerTo:getId() == ITEM_STORE_INBOX) then self:sendCancelMessage(RETURNVALUE_CONTAINERNOTENOUGHROOM) return false end -- Gold Pounch if (containerTo:getId() == GOLD_POUNCH) then if (not (item:getId() == ITEM_CRYSTAL_COIN or item:getId() == ITEM_PLATINUM_COIN or item:getId() == ITEM_GOLD_COIN)) then self:sendCancelMessage("You can move only money to this container.") return false end end end -- No move gold pounch if item:getId() == GOLD_POUNCH then self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) return false end -- No move items with actionID 8000 if item:getActionId() == NOT_MOVEABLE_ACTION then self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) return false end -- Check two-handed weapons if toPosition.x ~= CONTAINER_POSITION then return true end if item:getTopParent() == self and bit.band(toPosition.y, 0x40) == 0 then local itemType, moveItem = ItemType(item:getId()) if bit.band(itemType:getSlotPosition(), SLOTP_TWO_HAND) ~= 0 and toPosition.y == CONST_SLOT_LEFT then moveItem = self:getSlotItem(CONST_SLOT_RIGHT) elseif itemType:getWeaponType() == WEAPON_SHIELD and toPosition.y == CONST_SLOT_RIGHT then moveItem = self:getSlotItem(CONST_SLOT_LEFT) if moveItem and bit.band(ItemType(moveItem:getId()):getSlotPosition(), SLOTP_TWO_HAND) == 0 then return true end end if moveItem then local parent = item:getParent() if parent:getSize() == parent:getCapacity() then self:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_CONTAINERNOTENOUGHROOM)) return false else return moveItem:moveTo(parent) end end end -- Reward System if toPosition.x == CONTAINER_POSITION then local containerId = toPosition.y - 64 local container = self:getContainerById(containerId) if not container then return true end -- Do not let the player insert items into either the Reward Container or the Reward Chest local itemId = container:getId() if itemId == ITEM_REWARD_CONTAINER or itemId == ITEM_REWARD_CHEST then self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) return false end local tile = Tile(container:getPosition()) for _, item in ipairs(tile:getItems() or { }) do if item:getAttribute(ITEM_ATTRIBUTE_CORPSEOWNER) == 2^31 - 1 and item:getName() == container:getName() then self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) return false end end end -- Do not let the player move the boss corpse. if item:getAttribute(ITEM_ATTRIBUTE_CORPSEOWNER) == 2^31 - 1 then self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) return false end -- Players cannot throw items on reward chest local tile = Tile(toPosition) if tile and tile:getItemById(ITEM_REWARD_CHEST) then self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) self:getPosition():sendMagicEffect(CONST_ME_POFF) return false end -- Players cannot throw items on teleports if blockTeleportTrashing and toPosition.x ~= CONTAINER_POSITION then local thing = Tile(toPosition):getItemByType(ITEM_TYPE_TELEPORT) if thing then self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) self:getPosition():sendMagicEffect(CONST_ME_POFF) return false end end -- No move parcel very heavy if item:getWeight() > 90000 and item:getId() == ITEM_PARCEL then self:sendCancelMessage('YOU CANNOT MOVE PARCELS TOO HEAVY.') return false end if tile and tile:getItemById(370) then -- Trapdoor self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) self:getPosition():sendMagicEffect(CONST_ME_POFF) return false end --- LIONS ROCK START if self:getStorageValue(lionrock.storages.playerCanDoTasks) - os.time() < 0 then local p, i = lionrock.positions, lionrock.items local checkPr = false if item:getId() == lionrock.items.ruby and toPosition.x == p.ruby.x and toPosition.y == p.ruby.y and toPosition.z == p.ruby.z then -- Ruby self:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You place the ruby on the small socket. A red flame begins to burn.") checkPr = true if lionrock.taskactive.ruby ~= true then lionrock.taskactive.ruby = true end local tile = Tile(p.ruby) if tile:getItemCountById(i.redflame) < 1 then Game.createItem(i.redflame, 1, p.ruby) end end if item:getId() == lionrock.items.sapphire and toPosition.x == p.sapphire.x and toPosition.y == p.sapphire.y and toPosition.z == p.sapphire.z then -- Sapphire self:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You place the sapphire on the small socket. A blue flame begins to burn.") checkPr = true if lionrock.taskactive.sapphire ~= true then lionrock.taskactive.sapphire = true end local tile = Tile(p.sapphire) if tile:getItemCountById(i.blueflame) < 1 then Game.createItem(i.blueflame, 1, p.sapphire) end end if item:getId() == lionrock.items.amethyst and toPosition.x == p.amethyst.x and toPosition.y == p.amethyst.y and toPosition.z == p.amethyst.z then -- Amethyst self:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You place the topaz on the small socket. A yellow flame begins to burn.") checkPr = true if lionrock.taskactive.amethyst ~= true then lionrock.taskactive.amethyst = true end local tile = Tile(p.amethyst) if tile:getItemCountById(i.yellowflame) < 1 then Game.createItem(i.yellowflame, 1, p.amethyst) end end if item:getId() == lionrock.items.topaz and toPosition.x == p.topaz.x and toPosition.y == p.topaz.y and toPosition.z == p.topaz.z then -- Topaz self:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You place the amethyst on the small socket. A violet flame begins to burn.") checkPr = true if lionrock.taskactive.topaz ~= true then lionrock.taskactive.topaz = true end local tile = Tile(p.topaz) if tile:getItemCountById(i.violetflame) < 1 then Game.createItem(i.violetflame, 1, p.topaz) end end if checkPr == true then -- Adding the Fountain which gives present if lionrock.taskactive.ruby == true and lionrock.taskactive.sapphire == true and lionrock.taskactive.amethyst == true and lionrock.taskactive.topaz == true then local fountain = Game.createItem(i.rewardfountain, 1, { x=33073, y=32300, z=9}) fountain:setActionId(41357) local stone = Tile({ x=33073, y=32300, z=9}):getItemById(3608) if stone ~= nil then stone:remove() end self:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Something happens at the centre of the room ..."); end -- Removing Item item:remove(1) end end ---- LIONS ROCK END if not antiPush(self, item, count, fromPosition, toPosition, fromCylinder, toCylinder) then return false end return true end function Player:onMoveCreature(creature, fromPosition, toPosition) return true end function hasPendingReport(name, targetName, reportType) local f = io.open(string.format("data/reports/players/%s-%s-%d.txt", name, targetName, reportType), "r") if f then io.close(f) return true else return false end end function Player:onReportRuleViolation(targetName, reportType, reportReason, comment, translation) local name = self:getName() if hasPendingReport(name, targetName, reportType) then self:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your report is being processed.") return end local file = io.open(string.format("data/reports/players/%s-%s-%d.txt", name, targetName, reportType), "a") if not file then self:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There was an error when processing your report, please contact a gamemaster.") return end io.output(file) io.write("------------------------------\n") io.write("Reported by: " .. name .. "\n") io.write("Target: " .. targetName .. "\n") io.write("Type: " .. reportType .. "\n") io.write("Reason: " .. reportReason .. "\n") io.write("Comment: " .. comment .. "\n") if reportType ~= REPORT_TYPE_BOT then io.write("Translation: " .. translation .. "\n") end io.write("------------------------------\n") io.close(file) self:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("Thank you for reporting %s. Your report will be processed by %s team as soon as possible.", targetName, configManager.getString(configKeys.SERVER_NAME))) return end function Player:onReportBug(message, position, category) local name = self:getName() local file = io.open("data/reports/bugs/" .. name .. " report.txt", "a") if not file then self:sendTextMessage(MESSAGE_EVENT_DEFAULT, "There was an error when processing your report, please contact a gamemaster.") return true end io.output(file) io.write("------------------------------\n") io.write("Name: " .. name) if category == BUG_CATEGORY_MAP then io.write(" [Map position: " .. position.x .. ", " .. position.y .. ", " .. position.z .. "]") end local playerPosition = self:getPosition() io.write(" [Player Position: " .. playerPosition.x .. ", " .. playerPosition.y .. ", " .. playerPosition.z .. "]\n") io.write("Comment: " .. message .. "\n") io.close(file) self:sendTextMessage(MESSAGE_EVENT_DEFAULT, "Your report has been sent to " .. configManager.getString(configKeys.SERVER_NAME) .. ".") return true end function Player:onTurn(direction) if self:getGroup():getAccess() and self:getDirection() == direction then local nextPosition = self:getPosition() nextPosition:getNextPosition(direction) self:teleportTo(nextPosition, true) end return true end function Player:onTradeRequest(target, item) return true end function Player:onTradeAccept(target, item, targetItem) return true end soulCondition = Condition(CONDITION_SOUL, CONDITIONID_DEFAULT) soulCondition:setTicks(4 * 60 * 1000) soulCondition:setParameter(CONDITION_PARAM_SOULGAIN, 1) function useStaminaImbuing(playerId, itemuid) local player = Player(playerId) if not player then return false end local item = Item(itemuid) if not item then return false end for i = 1, item:getType():getImbuingSlots() do if (item:isActiveImbuement(i+3)) then local staminaMinutes = item:getSpecialAttribute(i+3)/60 if (staminaMinutes > 0) then local currentTime = os.time() local timePassed = currentTime - item:getSpecialAttribute(i+6) if timePassed > 0 then if timePassed > 60 then if staminaMinutes > 2 then staminaMinutes = staminaMinutes - 2 else staminaMinutes = 0 end item:setSpecialAttribute(i+6, currentTime + 120) else staminaMinutes = staminaMinutes - 1 item:setSpecialAttribute(i+6, currentTime + 60) end end item:setSpecialAttribute(i+3, staminaMinutes*60) if (staminaMinutes <= 0) then player:removeCondition(CONDITION_HASTE, item:getId() + i) player:removeCondition(CONDITION_ATTRIBUTES, item:getId() + i) item:setSpecialAttribute(i, 0, i+3, 0, i+6, 0) end end end end end function useStamina(player) local staminaMinutes = player:getStamina() if staminaMinutes == 0 then return end local playerId = player:getId() local currentTime = os.time() local timePassed = currentTime - nextUseStaminaTime[playerId] if timePassed <= 0 then return end if timePassed > 60 then if staminaMinutes > 2 then staminaMinutes = staminaMinutes - 2 else staminaMinutes = 0 end nextUseStaminaTime[playerId] = currentTime + 120 else staminaMinutes = staminaMinutes - 1 nextUseStaminaTime[playerId] = currentTime + 60 end player:setStamina(staminaMinutes) end function useStaminaXp(player) local staminaMinutes = player:getExpBoostStamina() / 60 if staminaMinutes == 0 then return end local playerId = player:getId() local currentTime = os.time() local timePassed = currentTime - nextUseXpStamina[playerId] if timePassed <= 0 then return end if timePassed > 60 then if staminaMinutes > 2 then staminaMinutes = staminaMinutes - 2 else staminaMinutes = 0 end nextUseXpStamina[playerId] = currentTime + 120 else staminaMinutes = staminaMinutes - 1 nextUseXpStamina[playerId] = currentTime + 60 end player:setExpBoostStamina(staminaMinutes * 60) end -- useStaminaPrey function useStaminaPrey(player, name) for i = 1, 3 do if (player:isActiveByName(i-1, name)) then local staminaMinutes = player:getPreyStamina(i-1)/60 if (staminaMinutes > 0) then local playerId = player:getId()+i local currentTime = os.time() local timePassed = currentTime - nextUseStaminaPrey[playerId].Time if timePassed > 0 then if timePassed > 60 then if staminaMinutes > 2 then staminaMinutes = staminaMinutes - 2 else staminaMinutes = 0 end nextUseStaminaPrey[playerId].Time = currentTime + 120 else staminaMinutes = staminaMinutes - 1 nextUseStaminaPrey[playerId].Time = currentTime + 60 end end player:setPreyStamina(i-1, staminaMinutes*60) player:sendPreyTimeLeft(i-1, staminaMinutes*60) end end end end function Player:onUseWeapon(normalDamage, elementType, elementDamage) -- Imbuement local weapon = self:getSlotItem(CONST_SLOT_LEFT) if not weapon or weapon:getType():getWeaponType() == WEAPON_SHIELD then weapon = self:getSlotItem(CONST_SLOT_RIGHT) if not weapon or weapon:getType():getWeaponType() == WEAPON_SHIELD then weapon = nil end end for slot = 1, 10 do local nextEquip = self:getSlotItem(slot) if nextEquip and nextEquip:getType():getImbuingSlots() > 0 then for i = 1, nextEquip:getType():getImbuingSlots() do local slotEnchant = nextEquip:getSpecialAttribute(i) if (slotEnchant and type(slotEnchant) == 'string') then local percentDamage, enchantPercent = 0, nextEquip:getImbuementPercent(slotEnchant) local typeEnchant = nextEquip:getImbuementType(i) or "" if (typeEnchant ~= "" and typeEnchant ~= "skillShield" and not typeEnchant:find("absorb") and typeEnchant ~= "speed") then useStaminaImbuing(self:getId(), nextEquip:getUniqueId()) end if (typeEnchant ~= "hitpointsleech" and typeEnchant ~= "manapointsleech" and typeEnchant ~= "criticaldamage" and typeEnchant ~= "skillShield" and typeEnchant ~= "magiclevelpoints" and not typeEnchant:find("absorb") and typeEnchant ~= "speed") then local weaponType = nextEquip:getType():getWeaponType() if weaponType ~= WEAPON_NONE and weaponType ~= WEAPON_SHIELD and weaponType ~= WEAPON_AMMO then percentDamage = normalDamage*(enchantPercent/100) normalDamage = normalDamage - percentDamage elementDamage = nextEquip:getType():getAttack()*(enchantPercent/100) end end if (typeEnchant == "hitpointsleech") then local healAmountHP = normalDamage*(enchantPercent/100) self:addHealth(math.abs(healAmountHP)) elseif (typeEnchant == "manapointsleech") then local healAmountMP = normalDamage*(enchantPercent/100) self:addMana(math.abs(healAmountMP)) end if (typeEnchant == "firedamage") then elementType = COMBAT_FIREDAMAGE elseif (typeEnchant == "earthdamage") then elementType = COMBAT_EARTHDAMAGE elseif (typeEnchant == "icedamage") then elementType = COMBAT_ICEDAMAGE elseif (typeEnchant == "energydamage") then elementType = COMBAT_ENERGYDAMAGE elseif (typeEnchant == "deathdamage") then elementType = COMBAT_DEATHDAMAGE end end end end end return normalDamage, elementType, elementDamage end function Player:onCombatSpell(normalDamage, elementDamage, elementType, changeDamage) -- Imbuement local weapon = self:getSlotItem(CONST_SLOT_LEFT) if not weapon or weapon:getType():getWeaponType() == WEAPON_SHIELD then weapon = self:getSlotItem(CONST_SLOT_RIGHT) if not weapon or weapon:getType():getWeaponType() == WEAPON_SHIELD then weapon = nil end end if normalDamage < 0 then for slot = 1, 10 do local nextEquip = self:getSlotItem(slot) if nextEquip and nextEquip:getType():getImbuingSlots() > 0 then for i = 1, nextEquip:getType():getImbuingSlots() do local slotEnchant = nextEquip:getSpecialAttribute(i) if (slotEnchant and type(slotEnchant) == 'string') then local percentDamage, enchantPercent = 0, nextEquip:getImbuementPercent(slotEnchant) local typeEnchant = nextEquip:getImbuementType(i) or "" if (typeEnchant ~= "" and typeEnchant ~= "skillShield" and not typeEnchant:find("absorb") and typeEnchant ~= "speed") then useStaminaImbuing(self:getId(), nextEquip:getUniqueId()) end if (typeEnchant == "firedamage" or typeEnchant == "earthdamage" or typeEnchant == "icedamage" or typeEnchant == "energydamage" or typeEnchant == "deathdamage") then local weaponType = nextEquip:getType():getWeaponType() if weaponType ~= WEAPON_NONE and weaponType ~= WEAPON_SHIELD and weaponType ~= WEAPON_AMMO then percentDamage = normalDamage*(enchantPercent/100) normalDamage = normalDamage - percentDamage elementDamage = nextEquip:getType():getAttack()*(enchantPercent/100) end end if (typeEnchant == "firedamage") then elementType = COMBAT_FIREDAMAGE elseif (typeEnchant == "earthdamage") then elementType = COMBAT_EARTHDAMAGE elseif (typeEnchant == "icedamage") then elementType = COMBAT_ICEDAMAGE elseif (typeEnchant == "energydamage") then elementType = COMBAT_ENERGYDAMAGE elseif (typeEnchant == "deathdamage") then elementType = COMBAT_DEATHDAMAGE end end end end end end return normalDamage, elementDamage, elementType, changeDamage end function Player:onMove() local haveImbuingBoots = self:getSlotItem(CONST_SLOT_FEET) and self:getSlotItem(CONST_SLOT_FEET):getType():getImbuingSlots() or 0 if haveImbuingBoots > 0 then local bootsItem = self:getSlotItem(CONST_SLOT_FEET) for slot = 1, haveImbuingBoots do local slotEnchant = bootsItem:getSpecialAttribute(slot) if (slotEnchant and type(slotEnchant) == 'string') then local typeEnchant = bootsItem:getImbuementType(slot) or "" if (typeEnchant == "speed") then useStaminaImbuing(self:getId(), bootsItem:getUniqueId()) end end end end return true end function Player:onEquipImbuement(item) local itemType = item:getType() for i = 1, itemType:getImbuingSlots() do local slotEnchant = item:getSpecialAttribute(i) if (slotEnchant and type(slotEnchant) == 'string') then conditionHaste = Condition(CONDITION_HASTE, item:getId() + i) conditionSkill = Condition(CONDITION_ATTRIBUTES, item:getId() + i) local skillValue = item:getImbuementPercent(slotEnchant) local typeEnchant = item:getImbuementType(i) or "" if (typeEnchant == "skillSword") then conditionSkill:setParameter(CONDITION_PARAM_TICKS, -1) conditionSkill:setParameter(CONDITION_PARAM_SKILL_SWORD, skillValue) self:addCondition(conditionSkill) elseif (typeEnchant == "skillAxe") then conditionSkill:setParameter(CONDITION_PARAM_TICKS, -1) conditionSkill:setParameter(CONDITION_PARAM_SKILL_AXE, skillValue) self:addCondition(conditionSkill) elseif (typeEnchant == "skillClub") then conditionSkill:setParameter(CONDITION_PARAM_TICKS, -1) conditionSkill:setParameter(CONDITION_PARAM_SKILL_CLUB, skillValue) self:addCondition(conditionSkill) elseif (typeEnchant == "skillDist") then conditionSkill:setParameter(CONDITION_PARAM_TICKS, -1) conditionSkill:setParameter(CONDITION_PARAM_SKILL_DISTANCE, skillValue) self:addCondition(conditionSkill) elseif (typeEnchant == "skillShield") then conditionSkill:setParameter(CONDITION_PARAM_TICKS, -1) conditionSkill:setParameter(CONDITION_PARAM_SKILL_SHIELD, skillValue) self:addCondition(conditionSkill) elseif (typeEnchant == "magiclevelpoints") then conditionSkill:setParameter(CONDITION_PARAM_TICKS, -1) conditionSkill:setParameter(CONDITION_PARAM_STAT_MAGICPOINTS, skillValue) self:addCondition(conditionSkill) elseif (typeEnchant == "speed") then conditionHaste:setParameter(CONDITION_PARAM_TICKS, -1) conditionHaste:setParameter(CONDITION_PARAM_SPEED, self:getSpeed() * (skillValue/100)) self:addCondition(conditionHaste) elseif (typeEnchant == "criticaldamage") then conditionSkill:setParameter(CONDITION_PARAM_TICKS, -1) conditionSkill:setParameter(CONDITION_PARAM_SKILL_CRITICAL_HIT_CHANCE, 10) conditionSkill:setParameter(CONDITION_PARAM_SKILL_CRITICAL_HIT_DAMAGE, skillValue) self:addCondition(conditionSkill) elseif (typeEnchant == "hitpointsleech") then conditionSkill:setParameter(CONDITION_PARAM_TICKS, -1) conditionSkill:setParameter(CONDITION_PARAM_SKILL_LIFE_LEECH_CHANCE, 100) conditionSkill:setParameter(CONDITION_PARAM_SKILL_LIFE_LEECH_AMOUNT, skillValue) self:addCondition(conditionSkill) elseif (typeEnchant == "manapointsleech") then conditionSkill:setParameter(CONDITION_PARAM_TICKS, -1) conditionSkill:setParameter(CONDITION_PARAM_SKILL_MANA_LEECH_CHANCE, 100) conditionSkill:setParameter(CONDITION_PARAM_SKILL_MANA_LEECH_AMOUNT, skillValue) self:addCondition(conditionSkill) end end end return true end function Player:onDeEquipImbuement(item) for i = 1, item:getType():getImbuingSlots() do self:removeCondition(CONDITION_HASTE, item:getId() + i) self:removeCondition(CONDITION_ATTRIBUTES, item:getId() + i) end return true end function Player:onGainExperience(source, exp, rawExp) if not source or source:isPlayer() then return exp end -- Soul regeneration local vocation = self:getVocation() if self:getSoul() < vocation:getMaxSoul() and exp >= self:getLevel() then soulCondition:setParameter(CONDITION_PARAM_SOULTICKS, vocation:getSoulGainTicks() * 1000) self:addCondition(soulCondition) end -- Apply experience stage multiplier exp = exp * Game.getExperienceStage(self:getLevel()) for i = 1, 3 do if (self:isActive(i-1)) then local bonusInfo = self:getBonusInfo(i-1) if (bonusInfo.Type == 2 and source:getName() == bonusInfo.Name) then exp = exp + math.floor(exp * (bonusInfo.Value/100)) break end end end if (self:getExpBoostStamina() <= 0 and self:getStoreXpBoost() > 0) then self:setStoreXpBoost(0) -- reset xp boost to 0 end -- More compact, after checking before (reset) it only of xp if you have if (self:getStoreXpBoost() > 0) then exp = exp + (exp * (self:getStoreXpBoost()/100)) -- Exp Boost end local party = self:getParty() if (party) then if (party:isSharedExperienceActive() and party:isSharedExperienceEnabled()) then local tableVocs = {} local count = 0 local totalCount = 0 local leaderId = party:getLeader():getVocation():getId() if (leaderId) then tableVocs[leaderId] = 1 count = count + 1 totalCount = totalCount + 1 end for i, v in pairs(party:getMembers()) do local vocId = v:getVocation():getId() if (tableVocs[vocId] == nil) then tableVocs[vocId] = 1 count = count + 1 end totalCount = totalCount + 1 end if (totalCount <= 10 and count >= 4) then exp = exp * 2 end end end -- Prey Stamina Modifier useStaminaPrey(self, source:getName()) -- Exp Boost Modifier useStaminaXp(self) -- Exp stats local staminaMinutes = self:getStamina() local Boost = self:getExpBoostStamina() if staminaMinutes > 2400 and self:isPremium() and Boost > 0 then self:setBaseXpGain(200) -- 200 = 1.0x, 200 = 2.0x, ... premium account elseif staminaMinutes > 2400 and self:isPremium() and Boost <= 0 then self:setBaseXpGain(150) -- 150 = 1.0x, 150 = 1.5x, ... premium account elseif staminaMinutes <= 2400 and staminaMinutes > 840 and self:isPremium() and Boost > 0 then self:setBaseXpGain(150) -- 150 = 1.5x premium account elseif staminaMinutes > 840 and Boost > 0 then self:setBaseXpGain(150) -- 150 = 1.5x free account elseif staminaMinutes <= 840 and Boost > 0 then self:setBaseXpGain(100) -- 50 = 0.5x all players elseif staminaMinutes <= 840 then self:setBaseXpGain(50) -- 50 = 0.5x all players end -- Stamina modifier if configManager.getBoolean(configKeys.STAMINA_SYSTEM) then useStamina(self) local staminaMinutes = self:getStamina() if staminaMinutes > 2400 and self:isPremium() then exp = exp * 1.5 elseif staminaMinutes <= 840 then exp = exp * 0.5 end end return exp end function Player:onLoseExperience(exp) return exp end function Player:onGainSkillTries(skill, tries) if APPLY_SKILL_MULTIPLIER == false then return tries end if skill == SKILL_MAGLEVEL then return tries * configManager.getNumber(configKeys.RATE_MAGIC) end return tries * configManager.getNumber(configKeys.RATE_SKILL) end
-
(Resolvido)ajuda error script tp
o problema está na estruturação do código. function onStepIn(cid, item, position, fromPosition) local pos = {x=397, y=1056, z=7} if getPlayerStorageValue(cid, 8000) == 112 then setPlayerStorageValue(cid, 8000, 113) doPlayerAddExperience(cid, 10000) elseif getPlayerStorageValue(cid, 8000) == 114 then doTeleportThing(cid, pos) end return true end
-
(Resolvido)EXHAUSTION SCRIPT
function onUse(cid, item, frompos, item2, topos) local store,exausted = 986532,2 if item2.itemid == 2739 then doTransformItem(item2.uid,2737) doDecayItem(item2.uid) doCreateItem(2694,1,topos) elseif item2.itemid == 5471 then doTransformItem(item2.uid,5463) doDecayItem(item2.uid) doCreateItem(5467,1,topos) elseif item2.itemid == 806 then if math.random(1,5) == 1 and getPlayerStorageValue(cid, store) - os.time() <= 0 then doSummonCreature("Rotworm", topos) return setPlayerStorageValue(cid, store, os.time()+exausted) else return doSendMagicEffect(topos, 2) end end return true end
-
(Resolvido)Como coloco um math.random nesse script?
mto estranho, testei aqui e funcionou. Teste assim: -- CONFIGURAÇÕES aurastr = 25950 -- storage da aura estr = 25951 -- storage para o exhaust porcentagem = 50 -- chance de curar em cada volta da aura, em porcentagem quantheal = 1 -- porcentagem do hp máximo que cada cura irá curar. (No caso, irá curar 10% do hp máximo cada cura) tempo = 1180 -- tempo para dar uma volta no player (este tempo foi o que achei mais agradável visualmente, é recomendável não mudar) efeitocura = 28 -- número do efeito quando a cura chega ao player (efeito de posição fixa, pode ser identificado com /z no jogo) -- Função que chama a aura function efeitosAura(i,tm,cid) if(isCreature(cid)) then tipoaura = getPlayerStorageValue(cid, 789635) <= 0 and 37 or getPlayerStorageValue(cid, 789635) local atual = getCreaturePosition(cid) local posaura = { {x=(atual.x)-1, y=(atual.y)-1, z=atual.z}, {x=atual.x, y=(atual.y)-1, z=atual.z}, {x=(atual.x)+1, y=(atual.y)-1, z=atual.z}, {x=(atual.x)+1, y=atual.y, z=atual.z}, {x=(atual.x)+1, y=(atual.y)+1, z=atual.z}, {x=atual.x, y=(atual.y)+1, z=atual.z}, {x=(atual.x)-1, y=(atual.y)+1, z=atual.z}, {x=(atual.x)-1, y=atual.y, z=atual.z}, } local chances = math.random(100) if(chances<=porcentagem/8 and getCreatureHealth(cid)<getCreatureMaxHealth(cid)) then if(i<=8 and i>1) then doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, atual, tipoaura) else doSendDistanceShoot({x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, atual, tipoaura) end doSendMagicEffect(atual, efeitocura) end if(i==8) then doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, {x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, tipoaura) elseif(i<8) then doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, {x=posaura[i+1].x, y=posaura[i+1].y, z=posaura[i+1].z}, tipoaura) end if(i<=8 and getPlayerStorageValue(cid, aurastr)==2) then i = i+1 tm = tempo/8 return addEvent(efeitosAura,tm,i,tm,cid) elseif(i>8 and getPlayerStorageValue(cid, aurastr)==2) then return efeitosAura(1,0,cid) else return TRUE end else return TRUE end end -- Função principal function onLogin(cid) if isPremium(cid) == true and getPlayerGroupId(cid) < 4 then if getPlayerStorageValue(cid, estr) > os.time() then doPlayerSendCancel(cid, "Espere "..(getPlayerStorageValue(cid, estr) - os.time()).." segundos para poder habilitar aura novamente.") elseif(getPlayerStorageValue(cid, aurastr)==-1) and getPlayerPremiumDays(cid) >= 1 then doPlayerSendCancel(cid,"Aura ligada!") setPlayerStorageValue(cid, aurastr, 2) efeitosAura(1,tempo/8,cid) elseif(getPlayerStorageValue(cid, aurastr)==-1) and isPremium(cid) == false then doPlayerSendCancel(cid,"Voce nao tem VIP") end end return TRUE end
-
(Resolvido)Como coloco um math.random nesse script?
testa com uma conta diferente e me avisa
-
(Resolvido)Como coloco um math.random nesse script?
escolheu o efeito da aura pelo comando?
-
(Resolvido)Como coloco um math.random nesse script?
hmm ok, erro meu kk -- CONFIGURAÇÕES aurastr = 25950 -- storage da aura estr = 25951 -- storage para o exhaust porcentagem = 50 -- chance de curar em cada volta da aura, em porcentagem quantheal = 1 -- porcentagem do hp máximo que cada cura irá curar. (No caso, irá curar 10% do hp máximo cada cura) tempo = 1180 -- tempo para dar uma volta no player (este tempo foi o que achei mais agradável visualmente, é recomendável não mudar) efeitocura = 28 -- número do efeito quando a cura chega ao player (efeito de posição fixa, pode ser identificado com /z no jogo) -- Função que chama a aura function efeitosAura(i,tm,cid) if(isCreature(cid)) then local tipoaura = getPlayerStorageValue(cid, 789635) <= 0 and 37 or getPlayerStorageValue(cid, 789635) local atual = getCreaturePosition(cid) local posaura = { {x=(atual.x)-1, y=(atual.y)-1, z=atual.z}, {x=atual.x, y=(atual.y)-1, z=atual.z}, {x=(atual.x)+1, y=(atual.y)-1, z=atual.z}, {x=(atual.x)+1, y=atual.y, z=atual.z}, {x=(atual.x)+1, y=(atual.y)+1, z=atual.z}, {x=atual.x, y=(atual.y)+1, z=atual.z}, {x=(atual.x)-1, y=(atual.y)+1, z=atual.z}, {x=(atual.x)-1, y=atual.y, z=atual.z}, } local chances = math.random(100) if(chances<=porcentagem/8 and getCreatureHealth(cid)<getCreatureMaxHealth(cid)) then if(i<=8 and i>1) then doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, atual, tipoaura) else doSendDistanceShoot({x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, atual, tipoaura) end doSendMagicEffect(atual, efeitocura) end if(i==8) then doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, {x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, tipoaura) elseif(i<8) then doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, {x=posaura[i+1].x, y=posaura[i+1].y, z=posaura[i+1].z}, tipoaura) end if(i<=8 and getPlayerStorageValue(cid, aurastr)==2) then i = i+1 tm = tempo/8 return addEvent(efeitosAura,tm,i,tm,cid) elseif(i>8 and getPlayerStorageValue(cid, aurastr)==2) then return efeitosAura(1,0,cid) else return TRUE end else return TRUE end end -- Função principal function onLogin(cid) if isPremium(cid) == true and getPlayerGroupId(cid) < 4 then if getPlayerStorageValue(cid, estr) > os.time() then doPlayerSendCancel(cid, "Espere "..(getPlayerStorageValue(cid, estr) - os.time()).." segundos para poder habilitar aura novamente.") elseif(getPlayerStorageValue(cid, aurastr)==-1) and getPlayerPremiumDays(cid) >= 1 then doPlayerSendCancel(cid,"Aura ligada!") setPlayerStorageValue(cid, aurastr, 2) efeitosAura(1,tempo/8,cid) elseif(getPlayerStorageValue(cid, aurastr)==-1) and isPremium(cid) == false then doPlayerSendCancel(cid,"Voce nao tem VIP") end end return TRUE end
-
(Resolvido)Como coloco um math.random nesse script?
eu dei um exemplo não fiz a talk. mas está aqui: function onSay(cid, words, param, channel) if not param or not tonumber(param) then doPlayerSendCancel(cid, "escolha somente um numero.") return true elseif tonumber(param) <= 0 or tonumber(param) > 41 then doPlayerSendCancel(cid, "escolha um efeito de 1 a 47.") return true end setPlayerStorageValue(cid, 789635, tonumber(param)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Você escolheu o efeito número "..param..", relogue!.") return true end e o seu script(onLogin) fica assim: -- CONFIGURAÇÕES aurastr = 25950 -- storage da aura estr = 25951 -- storage para o exhaust porcentagem = 50 -- chance de curar em cada volta da aura, em porcentagem quantheal = 1 -- porcentagem do hp máximo que cada cura irá curar. (No caso, irá curar 10% do hp máximo cada cura) tempo = 1180 -- tempo para dar uma volta no player (este tempo foi o que achei mais agradável visualmente, é recomendável não mudar) tipoaura = getPlayerStorageValue(cid, 789635) <= 0 and 37 or getPlayerStorageValue(cid, 789635) -- caso o jogador nao tenha escolhido um efeito ainda pelo comando o oroginal sera 37 efeitocura = 28 -- número do efeito quando a cura chega ao player (efeito de posição fixa, pode ser identificado com /z no jogo) -- Função que chama a aura function efeitosAura(i,tm,cid) if(isCreature(cid)) then local atual = getCreaturePosition(cid) local posaura = { {x=(atual.x)-1, y=(atual.y)-1, z=atual.z}, {x=atual.x, y=(atual.y)-1, z=atual.z}, {x=(atual.x)+1, y=(atual.y)-1, z=atual.z}, {x=(atual.x)+1, y=atual.y, z=atual.z}, {x=(atual.x)+1, y=(atual.y)+1, z=atual.z}, {x=atual.x, y=(atual.y)+1, z=atual.z}, {x=(atual.x)-1, y=(atual.y)+1, z=atual.z}, {x=(atual.x)-1, y=atual.y, z=atual.z}, } local chances = math.random(100) if(chances<=porcentagem/8 and getCreatureHealth(cid)<getCreatureMaxHealth(cid)) then if(i<=8 and i>1) then doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, atual, tipoaura) else doSendDistanceShoot({x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, atual, tipoaura) end doSendMagicEffect(atual, efeitocura) end if(i==8) then doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, {x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, tipoaura) elseif(i<8) then doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, {x=posaura[i+1].x, y=posaura[i+1].y, z=posaura[i+1].z}, tipoaura) end if(i<=8 and getPlayerStorageValue(cid, aurastr)==2) then i = i+1 tm = tempo/8 return addEvent(efeitosAura,tm,i,tm,cid) elseif(i>8 and getPlayerStorageValue(cid, aurastr)==2) then return efeitosAura(1,0,cid) else return TRUE end else return TRUE end end -- Função principal function onLogin(cid) if isPremium(cid) == true and getPlayerGroupId(cid) < 4 then if getPlayerStorageValue(cid, estr) > os.time() then doPlayerSendCancel(cid, "Espere "..(getPlayerStorageValue(cid, estr) - os.time()).." segundos para poder habilitar aura novamente.") elseif(getPlayerStorageValue(cid, aurastr)==-1) and getPlayerPremiumDays(cid) >= 1 then doPlayerSendCancel(cid,"Aura ligada!") setPlayerStorageValue(cid, aurastr, 2) efeitosAura(1,tempo/8,cid) elseif(getPlayerStorageValue(cid, aurastr)==-1) and isPremium(cid) == false then doPlayerSendCancel(cid,"Voce nao tem VIP") end end return TRUE end ,
-
(Resolvido)Como coloco um math.random nesse script?
vc pode salvar o número do efeito que o jogador escolher em uma storage, quando logar vai chegar essa storage, exemplo: tipoaura = getPlayerStorageValue(cid, 789635) <= 0 and 37 or getPlayerStorageValue(cid, 789635) ai na talk quando jogador escolher a efeito, salva assim: if not param or not tonumber(param) then doPlayerSendCancel(cid, "You must choose an number.") return true elseif tonumber(param) <= 0 or tonumber(param) > 65 then -- 65 limit do effect no /x n sei se eh esse msm doPlayerSendCancel(cid, "chosse 1 - 65 effect.") return true end setPlayerStorageValue(cid, 789635, tonumber(param))
-
(Resolvido)Task System
vdd fiz na pressa, valeu por avisar! boa observação!
-
(Resolvido)ERRO GUILD POINTS Query
executa no seu banco de dados ALTER TABLE `accounts` ADD `guild_points` INTEGER(11) NOT NULL DEFAULT 0; ALTER TABLE `accounts` ADD `guild_points_stats` INT NOT NULL DEFAULT '0'; ALTER TABLE `guilds` ADD `last_execute_points` INT NOT NULL DEFAULT '0'; CREATE TABLE `z_shopguild_offer` ( `id` int(11) NOT NULL auto_increment, `points` int(11) NOT NULL default '0', `itemid1` int(11) NOT NULL default '0', `count1` int(11) NOT NULL default '0', `itemid2` int(11) NOT NULL default '0', `count2` int(11) NOT NULL default '0', `offer_type` varchar(255) default NULL, `offer_description` text NOT NULL, `offer_name` varchar(255) NOT NULL, `pid` INT(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`)) CREATE TABLE `z_shopguild_history_item` ( `id` int(11) NOT NULL auto_increment, `to_name` varchar(255) NOT NULL default '0', `to_account` int(11) NOT NULL default '0', `from_nick` varchar(255) NOT NULL, `from_account` int(11) NOT NULL default '0', `price` int(11) NOT NULL default '0', `offer_id` int(11) NOT NULL default '0', `trans_state` varchar(255) NOT NULL, `trans_start` int(11) NOT NULL default '0', `trans_real` int(11) NOT NULL default '0', PRIMARY KEY (`id`)) CREATE TABLE `z_shopguild_history_pacc` ( `id` int(11) NOT NULL auto_increment, `to_name` varchar(255) NOT NULL default '0', `to_account` int(11) NOT NULL default '0', `from_nick` varchar(255) NOT NULL, `from_account` int(11) NOT NULL default '0', `price` int(11) NOT NULL default '0', `pacc_days` int(11) NOT NULL default '0', `trans_state` varchar(255) NOT NULL, `trans_start` int(11) NOT NULL default '0', `trans_real` int(11) NOT NULL default '0', PRIMARY KEY (`id`))
-
(Resolvido)Task System
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 System] Parabéns, agora você está participando da Task do "..task_sys[task].name.." e deverá 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 está na task "..task_sys[task].name..". Você pode {entregar} caso já tenha terminado.", cid) end else npcHandler:say("Desculpe, Mas por enquanto não 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 até "..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ê não 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 System] Parabéns, agora você está participando da Task Diaria do "..dtask.name.." e deverá matar "..dtask.count.." monstros desta lista: "..getMonsterFromList(dtask.monsters_list).." até "..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ê também 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.points > 0 then setPlayerStorageValue(cid, task_sys_storages[2], (getTaskPoints(cid)+v.points)) str = str.."".. (str == "" and "" or ", ") .." + "..v.points.."task 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)) if not task_sys[getTaskMission(cid)] then -- end all mission setPlayerStorageValue(cid, 89745, 6) local vocs = { -- [vocation] and outfit [1] = {[0] = 136, [1] = 128}, -- sex 0 female outfit, sex 1 male outfit [2] = {[0] = 142, [1] = 134}, [3] = {[0] = 139, [1] = 129}, [4] = {[0] = 141, [1] = 133} { doPlayerAddOutfit(cid, vocs[getPlayerVocation(cid)][getPlayerSex(cid)], 3) npcHandler:say("Parabens! Você completou todas as quest e recebeu uma outfit nova!", cid) end else npcHandler:say("Desculpe, Mas você ainda não 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, v.exp) rst = rst.."".. (rst == "" and "" or ", ") .." "..k.exp.." de exp" end if k.points > 0 then setPlayerStorageValue(cid, task_sys_storages[2], (getTaskPoints(cid)+k.points)) rst = rst.."".. (rst == "" and "" or ", ") .." + "..k.points.."task 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 não 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())
-
Contagem de membros...
Banido até 3011.