LucasFerraz
Systems Analyst
The most part of OTs reset because of players reaching higher levels.
This way they will still have their power because of ML and skills intact.
The unique disadvantage of reset to players will be level for using spells.
But it will be a great advantage to your OT because it will create a new rank(resets) and no EXTREME power of players.
No more resets in houses, items, guilds ..
PS.: Reseting will not enable quests made to be done again. Because it makes no sense lol.
data/creaturescripts/creaturescripts.xml
data/creaturescripts/scripts/reset.lua
The reason of:
Maybe you have higher exp/stages in your server so if a player jump level 300 he/she will reset anyway.
This way they will still have their power because of ML and skills intact.
The unique disadvantage of reset to players will be level for using spells.
But it will be a great advantage to your OT because it will create a new rank(resets) and no EXTREME power of players.
No more resets in houses, items, guilds ..
PS.: Reseting will not enable quests made to be done again. Because it makes no sense lol.
Code:
Features:
- Only players WITHOUT PzLocked or Skulls(White, Red or Black) can reset.
Example: If Player Example reach level 300(configurable) and got a skull or PzLocked then He/She will have to reach level 300(configurable) or higher WITHOUT PzLocked or skull.
- When reseting player will be teleported to temple, He/She will be removed battle state, He/She will back to level 8(configurable).
SQL:
ALTER TABLE `players` ADD `resets` INT( 11 ) NOT NULL DEFAULT '0';
data/creaturescripts/creaturescripts.xml
XML:
<event type="advance" name="addReset" event="script" value="reset.lua"/>
data/creaturescripts/scripts/reset.lua
Lua:
local function getPlayerResets(cid)
local pid = getPlayerGUID(cid)
local resetresult = db.getResult("SELECT `resets` FROM `players` WHERE `id` = "..pid.." ;")
return resetresult:getID() ~= -1 and resetresult:getDataInt("resets") or false
end
local function doPlayerAddResets(cid)
local pid = getPlayerGUID(cid)
local gr = getPlayerResets(cid)
return = db.executeQuery("UPDATE `players` SET `resets` = ".. gr + 1 .." WHERE `id` ="..pid.."")
end
function onAdvance(cid, type, oldlevel, newlevel)
local config =
{
blevel = 300 -- Level before reset
alevel = 8 -- Level after reset
}
if (oldlevel ~= newlevel and type == SKILL__LEVEL) then
if (newlevel >= config.blevel) then
if (not isPlayerPzLocked(cid)) then
if ((getCreatureSkullType(cid) ~= SKULL_WHITE) or (getCreatureSkullType(cid) ~= SKULL_RED) or (getCreatureSkullType(cid) ~= SKULL_BLACK)) then
doPlayerAddResets(cid)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You have reached level 300 and you have been reseted.')
doPlayerSetSpecialDescription(cid, (getPlayerSex(cid) == 0 and ".\nShe" or ".\nHe") .." have "..getPlayerResets(cid).." resets.")
doPlayerAddExperience(cid, (getExperienceForLevel(config.alevel) - getPlayerExperience(cid)))
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCondition(cid, CONDITION_INFIGHT)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You couldn\'t be reseted due you got a skull.')
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You couldn\'t be reseted due you got blood in your hands.')
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You couldn\'t be reseted due you don\'t have enough level.')
end
end
return true
end
The reason of:
Lua:
if (newlevel >= 300) then
Last edited: