Keraxel
Ω Obfuscator Ω
It's shorter than yours and he remove one loop
Last edited:
function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
for i = PLAYERLOSS_EXPERIENCE, PLAYERLOSS_ITEMS do
doPlayerSetLossPercent(cid, i, getConfigValue('deathLostPercent'))
end
end
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "advance")
return TRUE
end
--Script made by Pitufo/Haifurer!
local config = {
[0] = { "Fist skill Up", 30}, -- 30 = variable[2] -- Animation effect
[1] = { "Club skill Up", 30}, -- 30 = variable[2] -- Animation effect
[2] = { "Sword skill Up", 30}, -- 30 = variable[2] -- Animation effect
[3] = { "Axe skill Up", 30}, -- 30 = variable[2] -- Animation effect
[4] = { "Distance Up", 30}, -- 30 = variable[2] -- Animation effect
[5] = { "Shielding Up", 30}, -- 30 = variable[2] -- Animation effect
[6] = { "Fishing Up", 30}, -- 30 = variable[2] -- Animation effect
[7] = { "Magic Up", 30}, -- 30 = variable[2] -- Animation effect
[8] = { "Level Up", 30} -- 30 = variable[2] -- Animation effect
}
function onAdvance(cid, skill, oldlevel, newlevel)
local pos = getPlayerPosition(cid)
local positions = {
{x=pos.x+1,y=pos.y-1,z=pos.z},
{x=pos.x-1,y=pos.y-1,z=pos.z},
{x=pos.x+1,y=pos.y+1,z=pos.z},
{x=pos.x-1,y=pos.y+1,z=pos.z},
{x=pos.x+1,y=pos.y,z=pos.z},
{x=pos.x-1,y=pos.y,z=pos.z},
{x=pos.x,y=pos.y+1,z=pos.z},
{x=pos.x,y=pos.y-1,z=pos.z}}
for type, variable in pairs(config) do
if skill == type then
doCreatureSay(cid, ""..variable[1].."", TALKTYPE_ORANGE_1)
for i = 1, table.maxn(positions) do
doSendMagicEffect(positions[i],variable[2])
end
end
end
return TRUE
end
<event type="advance" name="advance" script="advance.lua"/>