• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Wodbo vocation changing when the player die

Sunny

New Member
Joined
Nov 17, 2016
Messages
4
Reaction score
0
Hi guysssss
I have a wodbo server here in brazil, and i tried to create a new vocationnamed BILLS to the server
So, all works fine
He transforms, all looktype is fine etc
But when the player dies with this vocation
he return level 1 and with other vocation like a Trunks Reborn
The sample in database is the same as others! WIth save =1
I have tried so much...
Edited revert, transform, niwdeath and the reborn npc and nothing solved this, plz help-meeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
Sorry for my bad english...
 
Without any scripts its hard to tell whats going on; but check your creaturescripts for ondeath or onlogin events that check vocations. For example, some servers will check if under level 20, and depromote vocation on login if they were previously level 20+ and promoted. Maybe theres a script like this that is causing problems due to a coding issue.

Again, cant really help without seeing a script.
 
Onkill.lua
--__LVL 100 AO 199__--
local config1 = {
-- level menor
{250000,2160,1},
-- mesmo level
{500000,2160,2},
-- level maior
{1000000,2160,3},
}
--__LVL 200 AO 399__--
local config2 = {
-- level menor
{1000000,2160,1},
-- mesmo level
{1500000,2160,3},
-- level maior
{2000000,2160,5},
}
--__LVL 400 AO 600__--
local config3 = {
-- level menor
{2500000,2160,3},
-- mesmo level
{3000000,2160,5},
-- level maior
{3500000,2160,10},
}
--__LVL 600 EM DIANTE__--
local config4 = {
-- level menor
{4000000,2160,3},
-- mesmo level
{4500000,2160,5},
-- level maior
{5000000,2160,10},
}

function onKill(cid, target)
if isPlayer(cid) and isPlayer(target) then
if (getTileInfo(getThingPos(cid)).hardcore and getTileInfo(getThingPos(target)).hardcore) then return true end
if getPlayerIp(cid) == getPlayerIp(target) then return true end
if (getPlayerLevel(cid) > getPlayerLevel(target)+25) then
return true
else
if getPlayerLevel(cid) >= 100 and getPlayerLevel(cid) < 200 then
if (getPlayerLevel(target) < getPlayerLevel(cid)) then
doPlayerAddItem(cid, config1[1][2], config1[1][3])
doPlayerAddExp(cid, config1[1][1])
doPlayerSendCancel(cid, "Voce recebeu "..config1[1][1].." de exp.")
elseif (getPlayerLevel(target) == getPlayerLevel(cid)) then
doPlayerAddItem(cid, config1[2][2], config1[2][3])
doPlayerAddExp(cid, config1[2][1])
doPlayerSendCancel(cid, "Voce recebeu "..config1[2][1].." de exp.")
elseif (getPlayerLevel(target) > getPlayerLevel(cid)) then
doPlayerAddItem(cid, config1[3][2], config1[3][3])
doPlayerAddExp(cid, config1[3][1])
doPlayerSendCancel(cid, "Voce recebeu "..config1[3][1].." de exp.")
end
elseif getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) < 400 then
if (getPlayerLevel(target) < getPlayerLevel(cid)) then
doPlayerAddItem(cid, config2[1][2], config2[1][3])
doPlayerAddExp(cid, config2[1][1])
doPlayerSendCancel(cid, "Voce recebeu "..config2[1][1].." de exp.")
elseif (getPlayerLevel(target) == getPlayerLevel(cid)) then
doPlayerAddItem(cid, config2[2][2], config2[2][3])
doPlayerAddExp(cid, config2[2][1])
doPlayerSendCancel(cid, "Voce recebeu "..config2[2][1].." de exp.")
elseif (getPlayerLevel(target) > getPlayerLevel(cid)) then
doPlayerAddItem(cid, config2[3][2], config2[3][3])
doPlayerAddExp(cid, config2[3][1])
doPlayerSendCancel(cid, "Voce recebeu "..config2[3][1].." de exp.")
end
elseif getPlayerLevel(cid) >= 400 and getPlayerLevel(cid) < 600 then
if (getPlayerLevel(target) < getPlayerLevel(cid)) then
doPlayerAddItem(cid, config3[1][2], config3[1][3])
doPlayerAddExp(cid, config3[1][1])
doPlayerSendCancel(cid, "Voce recebeu "..config3[1][1].." de exp.")
elseif (getPlayerLevel(target) == getPlayerLevel(cid)) then
doPlayerAddItem(cid, config3[2][2], config3[2][3])
doPlayerAddExp(cid, config3[2][1])
doPlayerSendCancel(cid, "Voce recebeu "..config3[2][1].." de exp.")
elseif (getPlayerLevel(target) > getPlayerLevel(cid)) then
doPlayerAddItem(cid, config3[3][2], config3[3][3])
doPlayerAddExp(cid, config3[3][1])
doPlayerSendCancel(cid, "Voce recebeu "..config3[3][1].." de exp.")
end
elseif getPlayerLevel(cid) >= 600 then
if (getPlayerLevel(target) < getPlayerLevel(cid)) then
doPlayerAddItem(cid, config4[1][2], config4[1][3])
doPlayerAddExp(cid, config4[1][1])
doPlayerSendCancel(cid, "Voce recebeu "..config4[1][1].." de exp.")
elseif (getPlayerLevel(target) == getPlayerLevel(cid)) then
doPlayerAddItem(cid, config4[2][2], config4[2][3])
doPlayerAddExp(cid, config4[2][1])
doPlayerSendCancel(cid, "Voce recebeu "..config4[2][1].." de exp.")
elseif (getPlayerLevel(target) > getPlayerLevel(cid)) then
doPlayerAddItem(cid, config4[3][2], config4[3][3])
doPlayerAddExp(cid, config4[3][1])
doPlayerSendCancel(cid, "Voce recebeu "..config4[3][1].." de exp.")
end
end
end
end
return true
end
Playerdeath.lua
local config = {
deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')),
sqlType = getConfigInfo('sqlType'),
maxDeathRecords = getConfigInfo('maxDeathRecords')
}

config.sqlType = config.sqlType == "sqlite" and DATABASE_ENGINE_SQLITE or DATABASE_ENGINE_MYSQL

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
if(config.deathListEnabled ~= TRUE) then
return
end

local hitKillerName = "field item"
local damageKillerName = ""
if(lastHitKiller ~= FALSE) then
if(isPlayer(lastHitKiller) == TRUE) then
hitKillerName = getPlayerGUID(lastHitKiller)
else
hitKillerName = getCreatureName(lastHitKiller)
end

if(mostDamageKiller ~= FALSE and mostDamageKiller ~= lastHitKiller and getCreatureName(mostDamageKiller) ~= getCreatureName(lastHitKiller)) then
if(isPlayer(mostDamageKiller) == TRUE) then
damageKillerName = getPlayerGUID(mostDamageKiller)
else
damageKillerName = getCreatureName(mostDamageKiller)
end
end
end

db.query("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(hitKillerName) .. ", " .. db.escapeString(damageKillerName) .. ");")
local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";")
if(rows:getID() ~= -1) then
local amount = rows:getRows(true) - config.maxDeathRecords
if(amount > 0) then
if(config.sqlType == DATABASE_ENGINE_SQLITE) then
for i = 1, amount do
db.query("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);")
end
else
db.query("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT " .. amount .. ";")
end
end
end
end
Login.lua
local config = {
deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')),
sqlType = getConfigInfo('sqlType'),
maxDeathRecords = getConfigInfo('maxDeathRecords')
}

config.sqlType = config.sqlType == "sqlite" and DATABASE_ENGINE_SQLITE or DATABASE_ENGINE_MYSQL

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
if(config.deathListEnabled ~= TRUE) then
return
end

local hitKillerName = "field item"
local damageKillerName = ""
if(lastHitKiller ~= FALSE) then
if(isPlayer(lastHitKiller) == TRUE) then
hitKillerName = getPlayerGUID(lastHitKiller)
else
hitKillerName = getCreatureName(lastHitKiller)
end

if(mostDamageKiller ~= FALSE and mostDamageKiller ~= lastHitKiller and getCreatureName(mostDamageKiller) ~= getCreatureName(lastHitKiller)) then
if(isPlayer(mostDamageKiller) == TRUE) then
damageKillerName = getPlayerGUID(mostDamageKiller)
else
damageKillerName = getCreatureName(mostDamageKiller)
end
end
end

db.query("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(hitKillerName) .. ", " .. db.escapeString(damageKillerName) .. ");")
local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";")
if(rows:getID() ~= -1) then
local amount = rows:getRows(true) - config.maxDeathRecords
if(amount > 0) then
if(config.sqlType == DATABASE_ENGINE_SQLITE) then
for i = 1, amount do
db.query("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);")
end
else
db.query("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT " .. amount .. ";")
end
end
end
end
Ondeath.lua
function onDeath(cid)
setZombiesToSpawnCount(getZombiesToSpawnCount() + 2)
doCreatureSay(cid, "Eu voltarei!", 19)
return true
end

@Extrodus
Dont have Onlogin...
Thats all the "Death" scripts i can identify
The thing is, when the player dies, in players tabel (database) the vocation id changes from 490 to 78
Trunks vocation id is 71, buts the reborn version is 78
-----------------------------------------------------------------------
I got it fixedddddddddddddddddddddddddddddddddddd thank u guysssssssssssssss kissus :***
it was one id in vocation hahahahahaha
Now im crying of happiness ;)
 
Last edited:
Onkill.lua
--__LVL 100 AO 199__--
local config1 = {
-- level menor
{250000,2160,1},
-- mesmo level
{500000,2160,2},
-- level maior
{1000000,2160,3},
}
--__LVL 200 AO 399__--
local config2 = {
-- level menor
{1000000,2160,1},
-- mesmo level
{1500000,2160,3},
-- level maior
{2000000,2160,5},
}
--__LVL 400 AO 600__--
local config3 = {
-- level menor
{2500000,2160,3},
-- mesmo level
{3000000,2160,5},
-- level maior
{3500000,2160,10},
}
--__LVL 600 EM DIANTE__--
local config4 = {
-- level menor
{4000000,2160,3},
-- mesmo level
{4500000,2160,5},
-- level maior
{5000000,2160,10},
}

function onKill(cid, target)
if isPlayer(cid) and isPlayer(target) then
if (getTileInfo(getThingPos(cid)).hardcore and getTileInfo(getThingPos(target)).hardcore) then return true end
if getPlayerIp(cid) == getPlayerIp(target) then return true end
if (getPlayerLevel(cid) > getPlayerLevel(target)+25) then
return true
else
if getPlayerLevel(cid) >= 100 and getPlayerLevel(cid) < 200 then
if (getPlayerLevel(target) < getPlayerLevel(cid)) then
doPlayerAddItem(cid, config1[1][2], config1[1][3])
doPlayerAddExp(cid, config1[1][1])
doPlayerSendCancel(cid, "Voce recebeu "..config1[1][1].." de exp.")
elseif (getPlayerLevel(target) == getPlayerLevel(cid)) then
doPlayerAddItem(cid, config1[2][2], config1[2][3])
doPlayerAddExp(cid, config1[2][1])
doPlayerSendCancel(cid, "Voce recebeu "..config1[2][1].." de exp.")
elseif (getPlayerLevel(target) > getPlayerLevel(cid)) then
doPlayerAddItem(cid, config1[3][2], config1[3][3])
doPlayerAddExp(cid, config1[3][1])
doPlayerSendCancel(cid, "Voce recebeu "..config1[3][1].." de exp.")
end
elseif getPlayerLevel(cid) >= 200 and getPlayerLevel(cid) < 400 then
if (getPlayerLevel(target) < getPlayerLevel(cid)) then
doPlayerAddItem(cid, config2[1][2], config2[1][3])
doPlayerAddExp(cid, config2[1][1])
doPlayerSendCancel(cid, "Voce recebeu "..config2[1][1].." de exp.")
elseif (getPlayerLevel(target) == getPlayerLevel(cid)) then
doPlayerAddItem(cid, config2[2][2], config2[2][3])
doPlayerAddExp(cid, config2[2][1])
doPlayerSendCancel(cid, "Voce recebeu "..config2[2][1].." de exp.")
elseif (getPlayerLevel(target) > getPlayerLevel(cid)) then
doPlayerAddItem(cid, config2[3][2], config2[3][3])
doPlayerAddExp(cid, config2[3][1])
doPlayerSendCancel(cid, "Voce recebeu "..config2[3][1].." de exp.")
end
elseif getPlayerLevel(cid) >= 400 and getPlayerLevel(cid) < 600 then
if (getPlayerLevel(target) < getPlayerLevel(cid)) then
doPlayerAddItem(cid, config3[1][2], config3[1][3])
doPlayerAddExp(cid, config3[1][1])
doPlayerSendCancel(cid, "Voce recebeu "..config3[1][1].." de exp.")
elseif (getPlayerLevel(target) == getPlayerLevel(cid)) then
doPlayerAddItem(cid, config3[2][2], config3[2][3])
doPlayerAddExp(cid, config3[2][1])
doPlayerSendCancel(cid, "Voce recebeu "..config3[2][1].." de exp.")
elseif (getPlayerLevel(target) > getPlayerLevel(cid)) then
doPlayerAddItem(cid, config3[3][2], config3[3][3])
doPlayerAddExp(cid, config3[3][1])
doPlayerSendCancel(cid, "Voce recebeu "..config3[3][1].." de exp.")
end
elseif getPlayerLevel(cid) >= 600 then
if (getPlayerLevel(target) < getPlayerLevel(cid)) then
doPlayerAddItem(cid, config4[1][2], config4[1][3])
doPlayerAddExp(cid, config4[1][1])
doPlayerSendCancel(cid, "Voce recebeu "..config4[1][1].." de exp.")
elseif (getPlayerLevel(target) == getPlayerLevel(cid)) then
doPlayerAddItem(cid, config4[2][2], config4[2][3])
doPlayerAddExp(cid, config4[2][1])
doPlayerSendCancel(cid, "Voce recebeu "..config4[2][1].." de exp.")
elseif (getPlayerLevel(target) > getPlayerLevel(cid)) then
doPlayerAddItem(cid, config4[3][2], config4[3][3])
doPlayerAddExp(cid, config4[3][1])
doPlayerSendCancel(cid, "Voce recebeu "..config4[3][1].." de exp.")
end
end
end
end
return true
end
Playerdeath.lua
local config = {
deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')),
sqlType = getConfigInfo('sqlType'),
maxDeathRecords = getConfigInfo('maxDeathRecords')
}

config.sqlType = config.sqlType == "sqlite" and DATABASE_ENGINE_SQLITE or DATABASE_ENGINE_MYSQL

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
if(config.deathListEnabled ~= TRUE) then
return
end

local hitKillerName = "field item"
local damageKillerName = ""
if(lastHitKiller ~= FALSE) then
if(isPlayer(lastHitKiller) == TRUE) then
hitKillerName = getPlayerGUID(lastHitKiller)
else
hitKillerName = getCreatureName(lastHitKiller)
end

if(mostDamageKiller ~= FALSE and mostDamageKiller ~= lastHitKiller and getCreatureName(mostDamageKiller) ~= getCreatureName(lastHitKiller)) then
if(isPlayer(mostDamageKiller) == TRUE) then
damageKillerName = getPlayerGUID(mostDamageKiller)
else
damageKillerName = getCreatureName(mostDamageKiller)
end
end
end

db.query("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(hitKillerName) .. ", " .. db.escapeString(damageKillerName) .. ");")
local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";")
if(rows:getID() ~= -1) then
local amount = rows:getRows(true) - config.maxDeathRecords
if(amount > 0) then
if(config.sqlType == DATABASE_ENGINE_SQLITE) then
for i = 1, amount do
db.query("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);")
end
else
db.query("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT " .. amount .. ";")
end
end
end
end
Login.lua
local config = {
deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')),
sqlType = getConfigInfo('sqlType'),
maxDeathRecords = getConfigInfo('maxDeathRecords')
}

config.sqlType = config.sqlType == "sqlite" and DATABASE_ENGINE_SQLITE or DATABASE_ENGINE_MYSQL

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
if(config.deathListEnabled ~= TRUE) then
return
end

local hitKillerName = "field item"
local damageKillerName = ""
if(lastHitKiller ~= FALSE) then
if(isPlayer(lastHitKiller) == TRUE) then
hitKillerName = getPlayerGUID(lastHitKiller)
else
hitKillerName = getCreatureName(lastHitKiller)
end

if(mostDamageKiller ~= FALSE and mostDamageKiller ~= lastHitKiller and getCreatureName(mostDamageKiller) ~= getCreatureName(lastHitKiller)) then
if(isPlayer(mostDamageKiller) == TRUE) then
damageKillerName = getPlayerGUID(mostDamageKiller)
else
damageKillerName = getCreatureName(mostDamageKiller)
end
end
end

db.query("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(hitKillerName) .. ", " .. db.escapeString(damageKillerName) .. ");")
local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";")
if(rows:getID() ~= -1) then
local amount = rows:getRows(true) - config.maxDeathRecords
if(amount > 0) then
if(config.sqlType == DATABASE_ENGINE_SQLITE) then
for i = 1, amount do
db.query("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);")
end
else
db.query("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT " .. amount .. ";")
end
end
end
end
Ondeath.lua
function onDeath(cid)
setZombiesToSpawnCount(getZombiesToSpawnCount() + 2)
doCreatureSay(cid, "Eu voltarei!", 19)
return true
end

@Extrodus
Dont have Onlogin...
Thats all the "Death" scripts i can identify
The thing is, when the player dies, in players tabel (database) the vocation id changes from 490 to 78
Trunks vocation id is 71, buts the reborn version is 78
I'm almost crying...
 
Yes, i know, but the ids in my server are random, not in sequence that's make me confused
what?
even if they are random you made the vocation yourself as you said
that means you made the vocation id
just change the fromVoc to that same id
 
Back
Top