-- Hello staff, I'm here because it takes a lot of help from you, I roll on my server, a system ROOK, but to break the head and not know why this script does not work.
-- Here the Script:
-- The problem is that when CHAR is taken to ROOK, he does not lose the skills, ML, LEVEL, EXP but lose the items and other things, please help me fix this problem, i'm using TFS 0.3.4-pl2... Thank you all ...
HEY MODERATOR CLOSE THIS QUESTION, IM NOW FIX THIS.... MANY THX AND SORRY FOR THIS.....
-- Here the Script:
Lua:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if getPlayerExperience(cid) <= 2450 and getPlayerVocation(cid) ~= 0 then
local rookTownID = 12
local rookedGUID = getPlayerGUID(cid)
local deathPos = getCreaturePosition(cid)
for i = 1, 10 do
local slotItem = getPlayerSlotItem(cid, i)
if slotItem.itemid > 0 then
doRemoveItem(slotItem.uid)
end
end
doPlayerAddItem(cid, 2050, 1)
doPlayerAddItem(cid, 2382, 1)
doPlayerAddItem(cid, 1987, 1)
local rookedCorpseFem = doCreateItemEx(3065)
local rookedCorpseMale = doCreateItemEx(3058)
if getPlayerSex(cid) == 0 then
doPlayerAddItem(cid, 2651, 1)
else
doPlayerAddItem(cid, 2650, 1)
end
doPlayerSetVocation(cid, 0)
doPlayerSetTown(cid, rookTownID)
doTeleportThing(cid, getTownTemplePosition(rookTownID))
db.executeQuery("UPDATE `players` SET `level` = '1', `experience` = '0', `health` = '150', `healthmax` = '150', `mana` = '0', `manamax` = '0', `maglevel` = '0', `manaspent` = '0' WHERE `id` = " .. rookedGUID .. " LIMIT 1;")
db.executeQuery("UPDATE `player_skills` SET `value` = '10', `count` = '0' WHERE `player_id` = " .. rookedGUID .. " LIMIT 7;")
local conditions = {CONDITION_POISON, CONDITION_FIRE, CONDITION_ENERGY, CONDITION_PHYSICAL, CONDITION_HASTE, CONDITION_PARALYZE, CONDITION_OUTFIT, CONDITION_INVISIBLE, CONDITION_LIGHT, CONDITION_MANASHIELD, CONDITION_INFIGHT, CONDITION_DRUNK, CONDITION_EXHAUST, CONDITION_FOOD, CONDITION_REGENERATION, CONDITION_SOUL, CONDITION_DROWN, CONDITION_MUTED, CONDITION_ATTRIBUTES, CONDITION_FREEZING, CONDITION_DAZZLED, CONDITION_CURSED, CONDITION_PACIFIED}
for c = 1, #conditions do
doRemoveCondition(cid, conditions[c])
end
doPlayerPopupFYI(cid, "Você foi ROOKADO seu noob da porra!!!")
doRemoveCreature(cid)
return FALSE
else
return TRUE
end
end
-- The problem is that when CHAR is taken to ROOK, he does not lose the skills, ML, LEVEL, EXP but lose the items and other things, please help me fix this problem, i'm using TFS 0.3.4-pl2... Thank you all ...
HEY MODERATOR CLOSE THIS QUESTION, IM NOW FIX THIS.... MANY THX AND SORRY FOR THIS.....
Last edited: