I have a script to change the corpse of vocations, but I wanted to change that part of checking the vocation to start checking a storage that the player has, and so change his body!
local table = {
[1] = 3058,
[2] = 2820,
[3] = 2945,
[4] = 2960,
[5] = 3058,
[6] = 3058,
[7] = 3058,
[8] = 3058,
[9] = 14050,
[10] = 14052,
[11] = 2945,
[12] = 2945,
[13] = 14060,
[14] = 2960,
[15] = 3058,
[16] = 2960,
[17] = 3058,
[18] = 3058,
[19] = 14054,
[20] = 14046,
[21] = 14056,
[22] = 14058,
[23] = 3058,
[24] = 14062,
[25] = 5931,
[26] = 3058,
[27] = 14035,
[28] = 3058,
[29] = 3058,
[30] = 3058,
[31] = 14038,
[32] = 14040,
[33] = 3058,
[34] = 3058,
[35] = 14032,
[36] = 14029,
[37] = 14026
}
local function transform(pos, id, voc)
local item = getTileItemById(pos, id)
if item and item.uid > 1 then
item:transform(item.uid, table[voc])
item:decay()
end
end
function onDeath(player, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
if not player or not table[player:getVocation():getId()] then return true end
addEvent(transform, 15, getThingPos(player), corpse.itemid, player:getVocation():getId())
return true
end
[1] = 3058,
[2] = 2820,
[3] = 2945,
[4] = 2960,
[5] = 3058,
[6] = 3058,
[7] = 3058,
[8] = 3058,
[9] = 14050,
[10] = 14052,
[11] = 2945,
[12] = 2945,
[13] = 14060,
[14] = 2960,
[15] = 3058,
[16] = 2960,
[17] = 3058,
[18] = 3058,
[19] = 14054,
[20] = 14046,
[21] = 14056,
[22] = 14058,
[23] = 3058,
[24] = 14062,
[25] = 5931,
[26] = 3058,
[27] = 14035,
[28] = 3058,
[29] = 3058,
[30] = 3058,
[31] = 14038,
[32] = 14040,
[33] = 3058,
[34] = 3058,
[35] = 14032,
[36] = 14029,
[37] = 14026
}
local function transform(pos, id, voc)
local item = getTileItemById(pos, id)
if item and item.uid > 1 then
item:transform(item.uid, table[voc])
item:decay()
end
end
function onDeath(player, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
if not player or not table[player:getVocation():getId()] then return true end
addEvent(transform, 15, getThingPos(player), corpse.itemid, player:getVocation():getId())
return true
end
local config = {
[2] = 5,
[3] = 62,
[4] = 69
}
function onLogin(player)
if(player:getStorageValue(10005) > 0 or not config[player:getVocation():getId()]) then
return TRUE
end
if player:getGroup():getId() >= 3 then -- 1 = Players, 2 = Tutors, 3 = Sr. Tutor, 4 = GM, 5 = GOD
return TRUE
end
local outfit = player:getOutfit()
outfit.lookType = config[player:getVocation():getId()]
player:setOutfit(outfit)
player:setStorageValue(10005,1)
return TRUE
end
[2] = 5,
[3] = 62,
[4] = 69
}
function onLogin(player)
if(player:getStorageValue(10005) > 0 or not config[player:getVocation():getId()]) then
return TRUE
end
if player:getGroup():getId() >= 3 then -- 1 = Players, 2 = Tutors, 3 = Sr. Tutor, 4 = GM, 5 = GOD
return TRUE
end
local outfit = player:getOutfit()
outfit.lookType = config[player:getVocation():getId()]
player:setOutfit(outfit)
player:setStorageValue(10005,1)
return TRUE
end
Last edited: