Solutions
-
Flavio S's post in (Resolvido)SCRIPT DESBUG AJUDA was marked as the answerTroque seu código por esse :
local time = 30 -- minutos function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, 5489) <= os.time() then if doPlayerRemoveMoney(cid,500000) == 1 and getPlayerLevel(cid) >= 200 then addLevel(cid,1) doSendMagicEffect(topos,14) doPlayerSay(cid,"Level Desbugado",16) setPlayerStorageValue(cid, 5489, (60*time) + os.time()) else doPlayerSay(cid,"Sorry Custa 50 Gold",16) doPlayerSendCancel(cid,"Sorry no have Lvl 500!") end else doPlayerSendCancel(cid,"Você tem que esperar" .. (getPlayerStorageValue(cid, 5489) - os.time()) / 60 .. "minuto(s) para desbugar novamente.") end return true end -
Flavio S's post in (Resolvido)Ajuda com Database Mysql was marked as the answerVersões tfs 1.0 + não aceita sqlite só mysql
-
Flavio S's post in (Resolvido)Setando storage por kill de monstro was marked as the answer^
A verificação isPlayer(cid) é desnecessária tendo em vista que um monstro não pode matar outro. E daria erro caso não existisse o monstro informado na tabela, quando fosse setar a storage ...
local tb = { -- ["MONSTER"] = STORAGE, não se esqueça da virgula que é essencial pra funcionar ... ["Rat"] = 4651, } function onKill(cid, target) if not isMonster(target) then return false end local monster = tb[getCreatureName(target)] if monster then setPlayerStorageValue(cid, monster, 1) end return true end function onLogin(cid) registerCreatureEvent(cid, "bossKill") return true end -
Flavio S's post in (Resolvido)fim de premium was marked as the answerSim funciona.
-
Flavio S's post in (Resolvido)Spell Teleporte distance was marked as the answerUsa assim :
local effect = 19 -- Effect que vai sair local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 10) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -5, -10, -5, -10) function onCastSpell(cid, var) local target = variantToNumber(var) doCombat(cid, combat, var) if not isPlayer(target) then doSendMagicEffect(getThingPos(target), effect) return true end doTeleportThing(cid, getThingPos(target)) doSendMagicEffect(getThingPos(target), effect) return true end no spells.xml coloca needtarget="1"
ensinamentos do lobo.
-
Flavio S's post in (Resolvido)Tile muda x item por segundos was marked as the answerlocal config = { time = 10 -- segundos pos = {x= xxx, y= xxx, z= x}, -- Local onde está a estatua id1 = 1182, -- estatua 1 id2 = 1183, -- estatua 2 storage = 45644 -- storage } function onStepIn(player) if not isPlayer(player) then return false end if getGlobalStorageValue(config.storage) < 1 then doTransformItem(getTileItemById(config.pos, config.id1).uid, config.id2) setGlobalStorageValue(config.storage, 1) addEvent(function() doTransformItem(getTileItemById(config.pos, config.id2).uid, config.id1) setGlobalStorageValue(config.storage, -1) -- body end, time*1000) end setPlayerStorageValue(player, config.storage, 2) return true end function onStepOut(player) if not isPlayer(player) then return false end setPlayerStorageValue(player, config.storage, -1) return true end <movevent type="StepIn" actionid="7777" event="script" value="arquivo.lua"/> <movevent type="StepOut" actionid="7777" event="script" value="arquivo.lua"/> Coloque o actiond 7777 no piso pelo rme.
-
Flavio S's post in (Resolvido)[Pedido] Rank reset was marked as the answerNa verdade o próprio wolf já fez o rank no próprio tópico : http://www.tibiaking.com/forum/topic/33179-sistema-de-reset-100/page-4
-
Flavio S's post in (Resolvido)[Ajuda] com sistem vip valendo rep+ was marked as the answerlocal price = 10 -- Diamond's local diamond = 2160 -- ID do diamond. -- Script System Vip 2.2 -- function onSay(cid, words, param) if(words == "!buyvip") then if doPlayerRemoveItem(cid, diamond, price) == TRUE then local days = 30 local daysvalue = days * 24 * 60 * 60 local storageplayer = getPlayerStorageValue(cid, 13540) local timenow = os.time() if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then time = timenow + daysvalue else time = storageplayer + daysvalue end if string.find(tostring(getCreatureName(cid)),"[[Vip]]") then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.") setPlayerStorageValue(cid, 13540, time) local quantity = math.floor((getPlayerStorageValue(cid, 13540) - timenow)/(24 * 60 * 60)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.") setPlayerStorageValue(cid, 13540, time) local name = getCreatureName(cid) db.executeQuery("UPDATE `players` SET `name` = '[Vip] "..name.."' WHERE `id` = "..getPlayerGUID(cid)..";") doRemoveCreature(cid) end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você precisa de "..price.." diamonds para colocar vip.") end elseif(words == "!buyvip60") then if doPlayerRemoveItem(cid, diamond, 18) == TRUE then local days = 60 local daysvalue = days * 24 * 60 * 60 local storageplayer = getPlayerStorageValue(cid, 13540) local timenow = os.time() if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then time = timenow + daysvalue else time = storageplayer + daysvalue end if string.find(tostring(getCreatureName(cid)),"[[Vip]]") then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.") setPlayerStorageValue(cid, 13540, time) local quantity = math.floor((getPlayerStorageValue(cid, 13540) - timenow)/(24 * 60 * 60)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.") setPlayerStorageValue(cid, 13540, time) local name = getCreatureName(cid) db.executeQuery("UPDATE `players` SET `name` = '[Vip] "..name.."' WHERE `id` = "..getPlayerGUID(cid)..";") doRemoveCreature(cid) end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você precisa de "..price.." diamonds para colocar vip.") end elseif(words == "!buyvip90") then if doPlayerRemoveItem(cid, diamond, 25) == TRUE then local days = 90 local daysvalue = days * 24 * 60 * 60 local storageplayer = getPlayerStorageValue(cid, 13540) local timenow = os.time() if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then time = timenow + daysvalue else time = storageplayer + daysvalue end if string.find(tostring(getCreatureName(cid)),"[[Vip]]") then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.") setPlayerStorageValue(cid, 13540, time) local quantity = math.floor((getPlayerStorageValue(cid, 13540) - timenow)/(24 * 60 * 60)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.") setPlayerStorageValue(cid, 13540, time) local name = getCreatureName(cid) db.executeQuery("UPDATE `players` SET `name` = '[Vip] "..name.."' WHERE `id` = "..getPlayerGUID(cid)..";") doRemoveCreature(cid) end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você precisa de "..price.." diamonds para colocar vip.") end elseif(words == "!vipdays") then local timenow = os.time() local quantity = math.floor((getPlayerStorageValue(cid, 13540) - timenow)/(24 * 60 * 60)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. (quantity < 0 and 0 or quantity) .." dias de VIP no seu character.") elseif(words == "/checkvip") then if getPlayerAccess(cid) == 5 then if not param then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") end local player = getPlayerByName(param) if not isPlayer(player) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player "..player.." not found.") end local timenow = os.time() local quantity = math.floor((getPlayerStorageValue(player, 13540) - timenow)/(24 * 60 * 60)) doPlayerPopupFYI(cid, "O jogador tem ".. (quantity < 0 and 0 or quantity) .." dias de VIP no character.") return false end elseif(words == "/addvip") then if getPlayerAccess(cid) == 5 then local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") end local player = getPlayerByName(t[1]) local name = getCreatureName(player) local days = t[2] local pid = getPlayerByNameWildcard(t[1]) if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return false end local daysvalue = days*3600*24 local storageplayer = getPlayerStorageValue(player, 13540) local timenow = os.time() local time = storageplayer <= 0 and (timenow + daysvalue) or (storageplayer + daysvalue) if string.find(tostring(getCreatureName(pid)),"[[Vip]]") then doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram adicionados "..days.." dias de VIP no seu character.") setPlayerStorageValue(player, 13540, time) local quantity = math.floor((getPlayerStorageValue(player,13540) - timenow)/(3600*24)) doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você tem "..quantity.." dias de VIP restantes.") else setPlayerStorageValue(player, 13540, time) db.executeQuery("UPDATE `players` SET `name` = '[Vip] "..name.."' WHERE `id` = "..getPlayerGUID(player)..";") doRemoveCreature(player) end end elseif(words == "/delvip") then if getPlayerAccess(cid) == 5 then local dec = MESSAGE_INFO_DESCR if(param == "") then return TRUE,doPlayerSendTextMessage(cid,18,"Command param required.")end local C,t = {},string.explode(param, ",") C.pos = getPlayerPosition(cid) C.uid = getCreatureByName(t[1]) C.time = ((tonumber(t[2]) == nil) and 1 or tonumber(t[2]))*3600*24 --Tempo da vip por dia. C.days = (tonumber(t[2]) == nil) and 1 or tonumber(t[2]) --Dias de vip. if(getPlayerStorageValue(C.uid,13540) < C.time)then doPlayerSendTextMessage(cid,dec,'O jogador '..t[1]..' não possui '..C.days..' dias de vip.') else doPlayerSendTextMessage(cid,dec,'Você removeu '..C.days..' dias de vip do player '..t[1]..'.') setPlayerStorageValue(C.uid,13540,getPlayerStorageValue(C.uid,13540)-C.time) end doSendMagicEffect(C.pos, math.random(28,30)) end end return false end !buyvip = 30 dias... 10 diamonds
!buyvip60 = 60 dias... 18 diamonds
!buyvip90 = 90 dias... 25 diamonds
-
Flavio S's post in (Resolvido)[AJUDA] Sair de rookguard e ganhar montaria was marked as the answerUse :
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local vocation = {} local town = {} local config = { towns = { ["venore"] = 1, ["thais"] = 2, ["carlin"] = 4 }, vocations = { ["sorcerer"] = { text = "A SORCERER! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!", vocationId = 1, --equipment spellbook, wand of vortex, magician's robe, mage hat, studded legs, leather boots, scarf {{2175, 1}, {2190, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}}, --container rope, shovel, mana potion {{2120, 1}, {2554, 1}, {7620, 1}} }, ["druid"] = { text = "A DRUID! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!", vocationId = 2, --equipment spellbook, snakebite rod, magician's robe, mage hat, studded legs, leather boots scarf {{2175, 1}, {2182, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}}, --container rope, shovel, mana potion {{2120, 1}, {2554, 1}, {7620, 1}} }, ["paladin"] = { text = "A PALADIN! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!", vocationId = 3, --equipment dwrven shield, 5 spear, ranger's cloak, ranger legs scarf, legion helmet {{2525, 1}, {2389, 5}, {2660, 1}, {8923, 1}, {2643, 1}, {2661, 1}, {2480, 1}}, --container rope, shovel, health potion, bow, 50 arrow {{2120, 1}, {2554, 1}, {7618, 1}, {2456, 1}, {2544, 50}} }, ["knight"] = { text = "A KNIGHT! ARE YOU SURE? THIS DECISION IS IRREVERSIBLE!", vocationId = 4, --equipment dwarven shield, steel axe, brass armor, brass helmet, brass legs scarf {{2525, 1}, {8601, 1}, {2465, 1}, {2460, 1}, {2478, 1}, {2643, 1}, {2661, 1}}, --container jagged sword, daramian mace, rope, shovel, health potion {{8602, 1}, {2439, 1}, {2120, 1}, {2554, 1}, {7618, 1}} } } } 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 local function greetCallback(cid) local player = Player(cid) local level = player:getLevel() if level < 8 then npcHandler:say("CHILD! COME BACK WHEN YOU HAVE GROWN UP!", cid) npcHandler:resetNpc(cid) return false elseif level > 31 then npcHandler:say(player:getName() ..", I CAN'T LET YOU LEAVE - YOU ARE TOO STRONG ALREADY! YOU CAN ONLY LEAVE WITH LEVEL 9 OR LOWER.", cid) npcHandler:resetNpc(cid) return false elseif player:getVocation():getId() > 0 then npcHandler:say("YOU ALREADY HAVE A VOCATION!", cid) npcHandler:resetNpc(cid) return false else npcHandler:setMessage(MESSAGE_GREET, player:getName() ..", ARE YOU PREPARED TO FACE YOUR DESTINY?") end return true end local function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local player = Player(cid) if npcHandler.topic[cid] == 0 then if msgcontains(msg, "yes") then npcHandler:say("IN WHICH TOWN DO YOU WANT TO LIVE: {CARLIN}, {THAIS}, OR {VENORE}?", cid) npcHandler.topic[cid] = 1 end elseif npcHandler.topic[cid] == 1 then local cityTable = config.towns[msg:lower()] if cityTable then town[cid] = cityTable npcHandler:say("IN ".. string.upper(msg) .."! AND WHAT PROFESSION HAVE YOU CHOSEN: {KNIGHT}, {PALADIN}, {SORCERER}, OR {DRUID}?", cid) npcHandler.topic[cid] = 2 else npcHandler:say("IN WHICH TOWN DO YOU WANT TO LIVE: {CARLIN}, {THAIS}, OR {VENORE}?", cid) end elseif npcHandler.topic[cid] == 2 then local vocationTable = config.vocations[msg:lower()] if vocationTable then npcHandler:say(vocationTable.text, cid) npcHandler.topic[cid] = 3 vocation[cid] = vocationTable.vocationId else npcHandler:say("{KNIGHT}, {PALADIN}, {SORCERER}, OR {DRUID}?", cid) end elseif npcHandler.topic[cid] == 3 then if msgcontains(msg, "yes") then npcHandler:say("SO BE IT!", cid) player:setVocation(Vocation(vocation[cid])) player:setTown(Town(town[cid])) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:addMount(38) player:teleportTo(Town(town[cid]):getTemplePosition()) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received a backpack with starting items for reaching the mainlands.") local targetVocation = config.vocations[Vocation(vocation[cid]):getName():lower()] for i = 1, #targetVocation[1] do player:addItem(targetVocation[1][i][1], targetVocation[1][i][2]) end local backpack = player:addItem(1988) for i = 1, #targetVocation[2] do backpack:addItem(targetVocation[2][i][1], targetVocation[2][i][2]) end else npcHandler:say("THEN WHAT? {KNIGHT}, {PALADIN}, {SORCERER}, OR {DRUID}?", cid) npcHandler.topic[cid] = 2 end end return true end local function onAddFocus(cid) town[cid] = 0 vocation[cid] = 0 end local function onReleaseFocus(cid) town[cid] = nil vocation[cid] = nil end npcHandler:setCallback(CALLBACK_ONADDFOCUS, onAddFocus) npcHandler:setCallback(CALLBACK_ONRELEASEFOCUS, onReleaseFocus) npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setMessage(MESSAGE_FAREWELL, "COME BACK WHEN YOU ARE PREPARED TO FACE YOUR DESTINY!") npcHandler:setMessage(MESSAGE_WALKAWAY, "COME BACK WHEN YOU ARE PREPARED TO FACE YOUR DESTINY!") npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) -
Flavio S's post in (Resolvido)3 Dias Premium ao Logar e Ao Avançar de Premium! was marked as the answerdata/creaturescripts/scripts/ crie : advancepremium.lua
local advance = { level = xxx, -- Level que vai ganhar a premium days = 5, -- quantos dias de premium vai ganhar storage = 45646, -- Não mecher } function onAdvance(player, skill, oldLevel, newLevel) if skill == SKILL_LEVEL and newLevel == advance.level and player:getStorageValue(advance.storage) < 1 then player:addPremiumDays(advance.days) player:setStorageValue(advance.storage, 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Congratulations! You won '.. advance.days ..'days of premium for advance to level '.. advance.level ..'!') end return true end function onLogin(player) player:registerEvent("AdvancePremium") return true end XML :
<event type="advance" name="AdvancePremium" script="advancepremium.lua" /> <event type="login" name="Verf_AdvancePremium" script="advancepremium.lua" /> Agora o de logar e ganhar 3 dias de premium por account.
Primeiro vai no seu phpmyadmin e use comando :
CREATE TABLE `account_storage` ( `account_id` int(11) NOT NULL default '0', `key` int(10) unsigned NOT NULL default '0', `value` varchar(255) NOT NULL default '0', UNIQUE KEY `account_id_2` (`account_id`,`key`), KEY `account_id` (`account_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; agora vá em data/creaturescripts/script crie firstloginpremium.lua :
function getAccountStorageValue(accid, key) local resultId = db.storeQuery("SELECT `account_id`, `key` FROM `account_storage` WHERE `account_id` = " .. accid .. " and `key` = " .. key) if resultId ~= false then return result.getNumber(resultId, 'key') else return -1 end return resultId:free() end function setAccountStorageValue(accid, key, value) local resultId = db.storeQuery("SELECT `value` FROM `account_storage` WHERE `account_id` = " .. accid .. " and `key` = " .. key) if resultId ~= false then db.query("UPDATE `account_storage` SET `value` = " .. accid .. " WHERE `key`=" .. key .. " LIMIT 1');") else db.query("INSERT INTO `account_storage` (`account_id`, `key`, `value`) VALUES (" .. accid .. ", " .. key .. ", '"..value.."');") end return true end function onLogin(player) local storage = 545465 local pid = player:getGuid() local query = db.storeQuery("SELECT `account_id` FROM `players` WHERE `id` = ".. pid) local value = result.getNumber(query, 'account_id') if getAccountStorageValue(value, storage) < 1 then player:addPremiumDays(3) setAccountStorageValue(value, storage, 1) end return true end XML :
<event type="login" name="FirstLoginPremium" script="firstloginpremium.lua" /> Créditos ao luanluciano93 por ter me ajudado com as query.
abrçs
-
Flavio S's post in (Resolvido)Mudar recompensa evento was marked as the answerbasta configurar em :
local reward = {{ITEMID, QUANTIDADE}} -- {ITEMID, QUANTIDADE}, local centeroffight = {x=24553,y=23720,z=7} local waitingplace = {x=24554,y=23720,z=6} local depotcenter = {x=32345,y=32223,z=7} local MinimumPlayers = 2 local reward = {{ITEMID, QUANTIDADE}} -- {ITEMID, QUANTIDADE}, local function lmsclosed1() -- broadcastMessage("Last Man Standing event will start in 1 minutes. Portal is opened in depot", MESSAGE_STATUS_WARNING) end local function lmsclosed() count = 0 local spectators = getSpectators(waitingplace, 10, 10, false) if spectators ~= nil then for _, spectator in ipairs(spectators) do if isPlayer(spectator) then count = count + 1 end end end if (count >= MinimumPlayers) then broadcastMessage("Last Man Standing event portal closed and event started!", MESSAGE_STATUS_WARNING) for _, pid in ipairs(getOnlinePlayers()) do if getPlayerStorageValue(pid, 25001) == 1 then local playerids = getPlayerByName(pid) doTeleportThing(playerids,centeroffight) doSendMagicEffect(center, CONST_ME_TELEPORT) end end else broadcastMessage("Not enough players to start Last man Standing event! Minimum: "..MinimumPlayers.." players. We have "..count.."!", MESSAGE_STATUS_WARNING) setGlobalStorageValue(25002, 0) for _, pid in ipairs(getOnlinePlayers()) do if getPlayerStorageValue(pid, 25001) == 1 then local playerids = getPlayerByName(pid) doTeleportThing(playerids,depotcenter) doSendMagicEffect(depotcenter, CONST_ME_TELEPORT) setPlayerStorageValue(pid, 25001, 0) end end end return true end local function lmscheck() count = 0 local spectators = getSpectators(centeroffight, 500, 500, false) if spectators ~= nil then for _, spectator in ipairs(spectators) do if isPlayer(spectator) then count = count + 1 end end end if count == 1 then for _, pid in ipairs(getOnlinePlayers()) do if getPlayerStorageValue(pid, 25001) == 1 then local playerids = getPlayerByName(pid) setPlayerStorageValue(playerids, 25001, 0) end end local spectators = getSpectators(centeroffight, 10, 10, false) if spectators ~= nil then for _, spectator in ipairs(spectators) do if isPlayer(spectator) then doTeleportThing(spectator,depotcenter) doSendMagicEffect(depotcenter, CONST_ME_TELEPORT) for x = 1, #reward do doPlayerAddItem(spectator, reward[x][1], reward[x][2]) end broadcastMessage("Last Man Standing ended winner is: "..getPlayerName(spectator)..".", MESSAGE_STATUS_WARNING) end end end for _, pid in ipairs(getOnlinePlayers()) do if getPlayerStorageValue(pid, 25001) == 1 then local playerids = getPlayerByName(pid) setPlayerStorageValue(pid, 25001, 0) end end stopEvent(lmscheck) else addEvent(lmscheck, 10*1000) end end local function lms() broadcastMessage("Last Man Standing event will start in 2 minutes. Portal is opened in depot", MESSAGE_STATUS_WARNING) portalwhere = {x= 32349, y=32222, z=7} local portal = doCreateItem(11796,1,portalwhere) doSetItemActionId(portal, 25001) doSendMagicEffect(portalwhere, CONST_ME_TELEPORT) iteminfo = {x= 32348, y=32222, z=7} local item = doCreateItem(1431,1,iteminfo) doSetItemActionId(item, 25002) doSendMagicEffect(iteminfo, CONST_ME_TELEPORT) addEvent(function() doRemoveItem(getTileItemById(portalwhere, 11796).uid) end, 120 * 1000) addEvent(function() doSendMagicEffect(portalwhere, CONST_ME_TELEPORT) end, 120 * 1000) addEvent(function() doRemoveItem(getTileItemById(iteminfo, 1431).uid) end, 120 * 1000) addEvent(function() doSendMagicEffect(iteminfo, CONST_ME_TELEPORT) end, 120 * 1000) addEvent(lmsclosed, 2*60*1000) addEvent(lmsclosed1, 1*60*1000) addEvent(lmscheck, 130*1000) return true end function onThink(interval) broadcastMessage("Last Man Standing event will start in 3 minutes.", MESSAGE_STATUS_WARNING) addEvent(lms, 60*1000) return true end -
Flavio S's post in (Resolvido)[Talkaction] Level Max was marked as the answermaximumlevel.lua
function onAdvance(cid, skill, oldLevel, newLevel) -- body local maximum = { player = getPlayerGUID(cid), lvlmax = (getPlayerLevel(cid) + 1), pos = {x= xxx, y= xxx, z= x}, -- Coordenadas do templo } local levels = {717217, 903637, 1034406, 1138511, 1226423, 1303269, 1371986, 1434433, 1491871, 1545196, 1595075, 1642016, 1686416, 1728594, 1768808, 1807272, 1844166, 1879639, 1913822, 1946825, 1978746, 2009669, 2039668, 2068810, 2097153, 2124751, 2151649, 2177891, 2203516, 2228558, 2253050} -- Level que o player vai usar o comando. if skill == 8 and isInArray(levels, getPlayerLevel(cid)) then doTeleportThing(cid, maximum.pos) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..maximum.lvlmax..", `experience` = 10000 WHERE `id` = "..maximum.player) end return true end function onLogin(cid) -- body registerCreatureEvent(cid, "MaxLevel") return true end creaturescripts.XML
<!-- Maximum Level --> <event type="advance" name="MaxLevel" event="script" value="maximumlevel.lua"/> <event type="login" name="r_MaxLevel" event="script" value="maximumlevel.lua"/>