hello Guys
It is possible every time I use it (!reset) Be with me items or scrolls like that
Until I can use it everytime in
otx-8.60
It is possible every time I use it (!reset) Be with me items or scrolls like that
Until I can use it everytime in
otx-8.60
<talkaction access="0-4" words="!reset" event="script" value="reset_system_talk.lua"/>
Lua:
function onSay(cid, words, param, channel)
if (param:lower() == "info") then
local message = "~~~~~~~~~~Reset Infos ~~~~~~~~~~\n"
local resetsCount = ResetSystem:getCount(cid)
message = message .. "\nNúmero de Resets: " .. resetsCount .. "."
local level = getPlayerLevel(cid)
local vocationInfo = getVocationInfo(getPlayerVocation(cid))
local baseHealth, extraHealth
local baseMana, extraMana
local resetBonus = ResetSystem:getCurrentBonus(cid)
if (resetBonus and vocationInfo) then
baseHealth = vocationInfo.healthGain * level
extraHealth = getCreatureMaxHealth(cid) - baseHealth
baseMana = vocationInfo.manaGain * level
extraMana = getCreatureMaxMana(cid) - baseMana
else
baseHealth, extraHealth = getCreatureMaxHealth(cid), 0
baseMana, extraMana = getCreatureMaxMana(cid), 0
end
message = message .. "\nVida normal: " .. baseHealth .. " + " .. extraHealth .. "."
message = message .. "\nMana normal: " .. baseMana .. " + " .. extraMana .. "."
message = message .. "\nExp Stage Bonús: " .. getExperienceStage(level) .. "x + " .. ((resetBonus and resetBonus.experiencePercent) or "0") .. "%."
message = message .. "\nDamage Bonús: " .. ((resetBonus and resetBonus.damagePercent) or "0") .. "%."
message = message .. "\nProximo Reset: Lv" .. (resetsCount < ResetSystem.max_count and ((resetsCount + 1) * ResetSystem.needed_level_per_reset) or "0") .. "."
doShowTextDialog(cid, 8983, message)
else
local position = getThingPosition(cid)
local tileInfo = getTileInfo(position)
if (tileInfo and not tileInfo.protection) then
doPlayerSendCancel(cid, "Você só pode usar esse comando em protection zone.")
doSendMagicEffect(position, CONST_ME_POFF)
return true
end
local resetsCount = ResetSystem:getCount(cid)
if (resetsCount >= ResetSystem.max_count) then
doPlayerSendCancel(cid, "Você já atingiu o nível máximo de resets.")
doSendMagicEffect(position, CONST_ME_POFF)
return true
end
local levelNeeded = (resetsCount + 1) * ResetSystem.needed_level_per_reset
if (levelNeeded > getPlayerLevel(cid)) then
doPlayerSendCancel(cid, "Você precisa ser level " .. levelNeeded .. " ou maior.")
doSendMagicEffect(position, CONST_ME_POFF)
return true
end
ResetSystem:execute(cid)
doSendMagicEffect(position, CONST_ME_TELEPORT)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT)
end
return true
end