local function getStats(cid, __this)
if __this == "health" then
return isKnight(cid) and getPlayerLevel(cid) * 15 + 65 or isPaladin(cid) and getPlayerLevel(cid) * 10 + 105 or (isSorcerer(cid) or isDruid(cid)) and getPlayerLevel(cid) * 5 + 145
elseif __this == "mana" then
return isKnight(cid) and getPlayerLevel(cid) * 5 - 5 or isPaladin(cid) and getPlayerLevel(cid) * 15 - 85 or (isSorcerer(cid) or isDruid(cid)) and getPlayerLevel(cid) * 30 - 205
end
end
local t = {
skull = "yes",
red = "yes",
prot = "yes",
bat = "yes",
exp = 4200,
lvl = 8,
level = 450
}
t.skulls = getBooleanFromString(t.skulls)
t.red = getBooleanFromString(t.red)
t.prot = getBooleanFromString(t.prot)
t.bat = getBooleanFromString(t.bat)
function onSay(cid, words, param, channel)
reset = 0
c = {}
for _, v in ipairs(getPlayersOnline()) do
if #v > 0 and not t.skulls and not t.red and not t.prot and not t.bat and getPlayerLevel(v) >= t.level then
db.executeQuery("UPDATE `players` SET `level` = " .. t.lvl .. ", `experience` = " .. t.exp .." WHERE `id` = " .. getPlayerGUID(v))
setCreatureMaxHealth(v, getStats(v, "health"))
setCreatureMaxMana(v, getStats(v, "mana"))
doCreatureAddHealth(v, getCreatureMaxHealth(v) - getCreatureHealth(v), false)
doCreatureAddMana(v, getCreatureMaxMana(v) - getCreatureMana(v), false)
setmetatable(c, {__index = _G})
setfenv(0, c)
_G.v = _G.v
reset = reset + #v
else
doPlayerSendTextMessage(cid, 27, "Theres no players online.")
break
end
end
return true
end