Ir para conteúdo

Posts Recomendados

fmz manos ??? tipo eu queria q esse scrip do reset funfava pelo !reset e ali aonde mostra q com 3 resets tu vire squire q tbm fosse virando uma classe nova ou so virado a classe nova aew no debaixo a msm coisa a cada 3 reset fora q ja foram acumulados os de cima q virasse outra classe pra eu poder configurar magias mega forte entendeu ?? flws fmz

 

--[[

((OTBR RESET SYSTEM))

Author : LsM

Version : v1.0

Informations : This system was made by LsM to ######. You can get more information at [Retirado].

]]--

 

--[[

///// INÍCIO DE CONFIGS /////

Here you can change that you know what are you doing.

]]--

 

--Do not forget to include the external file :

dofile("data/npc/lib/reset-lib.lua")

 

-- Level config

local toLevel = 8 -- Return to level.

local focuses = {} -- do not change

 

-- Config

local showInDescription = TRUE -- change it to FALSE if you don't want the system make changes in player description.

local teleportToTemple = TRUE -- change it to FALSE if you don't want the system teleport player to temple after reset.

 

-- You can change and add new values in the table, but do not change the number in [brackets].

local tbl = {

[0] = {premiumLevel = 350, freeLevel = 360, description = "Squire", class = 3},

[1] = {premiumLevel = 360, freeLevel = 370, description = "Count", class = 3},

[2] = {premiumLevel = 370, freeLevel = 380, description = "Celestial", class = 3},

[3] = {premiumLevel = 380, freeLevel = 390, description = "Lord", class = 3},

[4] = {premiumLevel = 390, freeLevel = 400, description = "Emperor", class = 3},

[5] = {premiumLevel = 400, freeLevel = 420, description = "Cerberus", class = 100} -- Is necessary a higher number in the last class.

}

 

function onCreatureSay(cid, type, msg)

-- Database configurations

local dtb_player = getPlayerGUID(cid)

local db_actions = {

-- Set Informations

setR_Id = "UPDATE `players` SET `resetid` = "..(getResetId(dtb_player) + 1).." WHERE `id`= " .. dtb_player .. ";",

setR_Class_Reset = "UPDATE `players` SET `reset_class` = '0' WHERE `id`= " .. dtb_player .. ";",

setR_Class_Add = "UPDATE `players` SET `reset_class` = "..(getResetClass(dtb_player) + 1).." WHERE `id`= " .. dtb_player .. ";",

setDesc_0 = "UPDATE `players` SET `description` = '. ".. getSexName(dtb_player) .." is ".. tbl[getResetId(dtb_player)].description .." [Nv. 0]' WHERE `id`= " .. dtb_player .. ";",

setDesc_Plus = "UPDATE `players` SET `description` = '. ".. getSexName(dtb_player) .." is ".. tbl[getResetId(dtb_player)].description .." [Nv. ".. getResetClass(dtb_player) .."]' WHERE `id`= " .. dtb_player .. ";",

}

 

-- Talk npc configurations

local t_config = {

--PlayerSay = "Npc say"

Hi = "Hello ".. getCreatureName(cid) ..", I work with resets, do you want to be reseted?",

Yes_1 = "Ok, but before I cannot forget to warn you: You will return to level ".. toLevel ..", your skills, attack, magic power will not be change and YOU CANNOT RECOVER YOUR LEVEL AFTER IT. Do you really want to reset your character?",

No = "Ok, then.",

Bye = "Good bye ".. getCreatureName(cid) ..".",

Player_withBattle = "You cannot reset because you are in fight.",

NoLevel = "Sorry, but you do not have level to reset now, you need to advance to level {".. tbl[getResetId(dtb_player)].freeLevel .."}. But if you are premium, you can reset at level {".. tbl[getResetId(dtb_player)].premiumLevel .."}."

}

 

--[[

///// FIM DE CONFIGS /////

Do not change anyThing Below.

]]--

 

-- Início de Main()

local cid_Say = msg:lower()

if ((cid_Say == "hi") and not (isFocused(cid, focuses))) then

selfSay(t_config.Hi, cid)

addFocus(cid, focuses)

selfFocus(cid)

talk_step = 1

elseif ((cid_Say == "yes") and (talk_step == 1)) then

selfSay(t_config.Yes_1, cid)

talk_step = 2

elseif ((cid_Say == "yes") and (talk_step == 2)) then

if (isPlayerPzLocked(cid) == FALSE) then

if (isPlayer(cid)) then -- Be shure he is online

if (((getPlayerLevel(cid) >= tbl[getResetId(dtb_player)].premiumLevel) and (isPremium(cid) == TRUE)) or ((getPlayerLevel(cid) >= tbl[getResetId(dtb_player)].freeLevel) and (isPremium(cid) == FALSE))) then

if (teleportToTemple) then

doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

end

if (isInArray(tbl[getResetId(dtb_player)].class, getResetClass(dtb_player))) then

resetPlayer(cid, db_actions, 1)

else

resetPlayer(cid, db_actions, 0)

end

if (showInDescription) then

setDescription(dtb_player, tbl, db_actions)

end

else

selfSay(t_config.NoLevel, cid)

end

else

print("RESET ERROR: Player not found when request (isPlayer). System Paused, no changes in player.")

return 0

end

else

selfSay(t_config.Player_withBattle, cid)

removeFocus(cid, focuses)

end

elseif ((cid_Say == "no") and (isInArray({1,2}, talk_step))) then

selfSay(t_config.No, cid)

removeFocus(cid, focuses)

elseif (cid_Say == "bye") then

selfSay(t_config.Bye, cid)

removeFocus(cid, focuses)

end

end

 

function onThink()

for _, focus in pairs(focuses) do

if not isCreature(focus) then

removeFocus(focus, focuses)

else

local distance = getDistanceTo(focus) or 5

if distance > 4 then

selfSay("Hmpf!", focus)

removeFocus(focus, focuses)

end

end

end

setFocus(focuses)

end

Link para o comentário
https://xtibia.com/forum/topic/163857-complementacao-script/
Compartilhar em outros sites

×
×
  • Criar Novo...