Postado Janeiro 26, 2021 4 anos kd o topico principal? ta voltando para esse achei... local config = { minlevel = 150, --- level inical para resetar price = 10000, --- preço inicial para resetar newlevel = 20, --- level após reset priceByReset = 0, --- preço acrescentado por reset percent = 100, ---- porcentagem da vida/mana que você terá ao resetar (em relação à sua antiga vida total) maxresets = 50, levelbyreset = 0 --- quanto de level vai precisar a mais no próximo reset } local function getResets(cid) local query = db.getResult("SELECT `resets` FROM `players` WHERE `id`= "..getPlayerGUID(cid)) return query:getDataInt("resets") <= 0 and 0 or query:getDataInt("resets") end local function addReset(cid) doRemoveConditions(cid, false) local resets = getResets(cid) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) local hp = getCreatureMaxHealth(cid) local resethp = hp*(config.percent/100) setCreatureMaxHealth(cid, resethp) local differencehp = (hp - resethp) doCreatureAddHealth(cid, -differencehp) local mana = getCreatureMaxMana(cid) local resetmana = mana*(config.percent/100) setCreatureMaxMana(cid, resetmana) local differencemana = (mana - resetmana) doCreatureAddMana(cid, -differencemana) local guid = getPlayerGUID(cid) doRemoveCreature(cid) local description = resets+1 db.executeQuery("UPDATE `players` SET `description` = ' [Reset: "..description.."]', `level` = "..config.newlevel..", `experience`= 0, `resets`= "..description.." WHERE `players`.`id`= ".. guid) return true end function onSay(cid, words, param, channel) local var = getResets(cid) local newPrice = config.price + (var * config.priceByReset) local newminlevel = config.minlevel + (var * config.levelbyreset) if param == "quantity" then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have a total of '..var..' reset(s).') end if var >= config.maxresets then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,'You already have reached the maximum of '.. config.maxresets.. ' resets!') elseif getCreatureCondition(cid, CONDITION_INFIGHT) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este comando só pode ser usado fora de combate.") elseif not getTilePzInfo(getCreaturePosition(cid)) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"você precisa estar em protection zone pra poder teleportar.") elseif getPlayerMoney(cid) < newPrice then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,'Its necessary to have at least '..newPrice..' gp\'s for reseting!') elseif getPlayerLevel(cid) < newminlevel then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,'The minimum level for reseting is '..newminlevel..'!') end doPlayerRemoveMoney(cid,newPrice) doCreatureSetNoMove(cid, true) -- ele n vai andar addEvent(function() if isCreature(cid) and isPlayer(cid) then addReset(cid) end end, 3000) local number = var+1 local msg ="---[Reset: "..number.."]-- You have reseted! You'll be disconnected in 3 seconds." doPlayerPopupFYI(cid, msg) return true end Editado Janeiro 26, 2021 4 anos por Vodkart (veja o histórico de edições) [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Janeiro 27, 2021 4 anos Autor Pode explicar as mudanças? É muito bom aprender com os bugs que ocorrem, aos poucos vamos indo! rep+ Editado Janeiro 27, 2021 4 anos por Rogex Joyz (veja o histórico de edições) mídias sociais talk to me vídeos
Postado Janeiro 27, 2021 4 anos Em 27/01/2021 em 03:39, Rogex Joyz disse: Pode explicar as mudanças? É muito bom aprender com os bugs que ocorrem, aos poucos vamos indo! rep+ Mas funcionou essa mudança? [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.