• 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!

TFS 1.2 Transform System

Lopaskurwa

Active Member
Joined
Oct 6, 2017
Messages
873
Solutions
2
Reaction score
49
Hi i was searching around google and i found this transform system
Transform system [table included]
But i stuck with first part, he didn't included where should i create that lua
Code:
{["voc"] = 1, ["newVoc"] = 2, ["looktype"] = 5, ["revertLooktype"] = 4, ["level"] = 50, ["rage"] = 3, ["kiToTrans"] = 10, ["addHp"] = 200, ["addKi"] = 150, ["effectOn"] = 236, ["aura"] = 0, ["constant"] = false},
 
Solution
Global
Lua:
exhaust_transform = {}

transform = {
[1] = {voc = 1, newVoc = 5, from_looktype = 55, looktype = 99, level = 50, rage = 3, mana = 10, addHealth = 200, addMana = 150, effect = CONST_ME_SMOKE, aura = nil, constant = false}
}

Tranform
Lua:
function onSay(player, words, param, channel)
    local pid = player:getId()

    if exhaust_transform[pid] ~= nil then
        return false
    end

    local TRANS = transform[player:getVocation():getId()]

    if not TRANS then return player:sendCancelMessage("You cannot transform.") end
    if player:getLevel() < TRANS.level then return player:sendCancelMessage("You must reach level "..TRANS.level.." to transform.") end
    if player:getSoul() < TRANS.rage then return...
Okay, assuming you set the vocation promotions up like this: 1, 5, 9 // 2, 6, 10 // 3, 7, 11 // 4, 8, 12 then this will work:

Lua:
function onSay(player, words, param, channel)
    local pid = player:getId()

    if exhaust_transform[pid] ~= nil then
        return false
    end

    local TRANS = transform[player:getVocation():getId() - 4]

    if not TRANS then return player:sendCancelMessage("You cannot revert.") end

    local outfit = player:getOutfit()
    outfit.lookType = TRANS.looktype

    if TRANS.constant then
        player:setOutfit(outfit)
    else
        player:setOutfit(outfit, false)
    end

    exhaust_transform[pid] = 1
    player:setMaxHealth(TRANS.addHealth)
    player:setMaxMana(TRANS.mana)
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You have reverted!")
    player:setVocation(TRANS.voc)
    player:save()
    addEvent(removeExhaust, 5 * 1000, pid)
return true
end
Yes it work. But skin doesnt change when i revert but probably i have to add revertLooktype. But i have last question, is it possible to make when i revert my added hp goes back. Like example i i have 250hp then i transform and this transform add 2500hp so totally 2750 so when i revert i go back to 250hp.
 
Global
Lua:
exhaust_transform = {}

transform = {
[1] = {voc = 1, newVoc = 5, from_looktype = 55, looktype = 99, level = 50, rage = 3, mana = 10, addHealth = 200, addMana = 150, effect = CONST_ME_SMOKE, aura = nil, constant = false}
}

Tranform
Lua:
function onSay(player, words, param, channel)
    local pid = player:getId()

    if exhaust_transform[pid] ~= nil then
        return false
    end

    local TRANS = transform[player:getVocation():getId()]

    if not TRANS then return player:sendCancelMessage("You cannot transform.") end
    if player:getLevel() < TRANS.level then return player:sendCancelMessage("You must reach level "..TRANS.level.." to transform.") end
    if player:getSoul() < TRANS.rage then return player:sendCancelMessage("You need "..TRANS.rage.." to transform.") end
    if player:getMana() < TRANS.mana then return player:sendCancelMessage("You need "..TRANS.mana.." to transform.") end

    local outfit = player:getOutfit()
    outfit.lookType = TRANS.looktype

    if TRANS.constant then
        player:setOutfit(outfit)
    else
        player:setOutfit(outfit, false)
    end
 
    exhaust_transform[pid] = 1
    player:addSoul(-TRANS.rage)
    player:setMaxHealth(player:getMaxHealth() + TRANS.addHealth)
    player:setMaxMana(player:getMaxMana() + TRANS.addMana)
    player:addHealth(TRANS.addHealth)
    player:addMana(TRANS.addMana)
    player:getPosition():sendMagicEffect(TRANS.effect)
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You have transformed!")
    player:setVocation(TRANS.newVoc)
    player:save()
    addEvent(removeExhaust, 5 * 1000, pid)
return true
end
function removeExhaust(pid)
    exhaust_transform[pid] = nil
end

Revert
Lua:
function onSay(player, words, param, channel)
    local pid = player:getId()

    if exhaust_transform[pid] ~= nil then
        return false
    end

    local TRANS = transform[player:getVocation():getId() - 4]

    if not TRANS then return player:sendCancelMessage("You cannot revert.") end

    local outfit = player:getOutfit()
    outfit.lookType = TRANS.from_looktype

    if TRANS.constant then
        player:setOutfit(outfit)
    else
        player:setOutfit(outfit, false)
    end

    exhaust_transform[pid] = 1
    player:setMaxHealth(player:getMaxHealth() - TRANS.addHealth)
    player:setMaxMana(player:getMaxMana() - TRANS.addMana)
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You have reverted!")
    player:setVocation(TRANS.voc)
    player:save()
    addEvent(removeExhaust, 5 * 1000, pid)
return true
end
function removeExhaust(pid)
    exhaust_transform[pid] = nil
end
 
Solution
Global
Lua:
exhaust_transform = {}

transform = {
[1] = {voc = 1, newVoc = 5, from_looktype = 55, looktype = 99, level = 50, rage = 3, mana = 10, addHealth = 200, addMana = 150, effect = CONST_ME_SMOKE, aura = nil, constant = false}
}

Tranform
Lua:
function onSay(player, words, param, channel)
    local pid = player:getId()

    if exhaust_transform[pid] ~= nil then
        return false
    end

    local TRANS = transform[player:getVocation():getId()]

    if not TRANS then return player:sendCancelMessage("You cannot transform.") end
    if player:getLevel() < TRANS.level then return player:sendCancelMessage("You must reach level "..TRANS.level.." to transform.") end
    if player:getSoul() < TRANS.rage then return player:sendCancelMessage("You need "..TRANS.rage.." to transform.") end
    if player:getMana() < TRANS.mana then return player:sendCancelMessage("You need "..TRANS.mana.." to transform.") end

    local outfit = player:getOutfit()
    outfit.lookType = TRANS.looktype

    if TRANS.constant then
        player:setOutfit(outfit)
    else
        player:setOutfit(outfit, false)
    end
 
    exhaust_transform[pid] = 1
    player:addSoul(-TRANS.rage)
    player:setMaxHealth(player:getMaxHealth() + TRANS.addHealth)
    player:setMaxMana(player:getMaxMana() + TRANS.addMana)
    player:addHealth(TRANS.addHealth)
    player:addMana(TRANS.addMana)
    player:getPosition():sendMagicEffect(TRANS.effect)
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You have transformed!")
    player:setVocation(TRANS.newVoc)
    player:save()
    addEvent(removeExhaust, 5 * 1000, pid)
return true
end
function removeExhaust(pid)
    exhaust_transform[pid] = nil
end

Revert
Lua:
function onSay(player, words, param, channel)
    local pid = player:getId()

    if exhaust_transform[pid] ~= nil then
        return false
    end

    local TRANS = transform[player:getVocation():getId() - 4]

    if not TRANS then return player:sendCancelMessage("You cannot revert.") end

    local outfit = player:getOutfit()
    outfit.lookType = TRANS.from_looktype

    if TRANS.constant then
        player:setOutfit(outfit)
    else
        player:setOutfit(outfit, false)
    end

    exhaust_transform[pid] = 1
    player:setMaxHealth(player:getMaxHealth() - TRANS.addHealth)
    player:setMaxMana(player:getMaxMana() - TRANS.addMana)
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You have reverted!")
    player:setVocation(TRANS.voc)
    player:save()
    addEvent(removeExhaust, 5 * 1000, pid)
return true
end
function removeExhaust(pid)
    exhaust_transform[pid] = nil
end
Very nice (y) 10/10
 
This system has very serious problem. When you transform and revert, then quickly log out and log in again, you are the transformed version but with reduced health and mana, so you can't transform, you can only revert but since you already have reduced health reverting again will kill you.
 
This system has very serious problem. When you transform and revert, then quickly log out and log in again, you are the transformed version but with reduced health and mana, so you can't transform, you can only revert but since you already have reduced health reverting again will kill you.
Yes you're right i though wtf is going on :D let's hope creator of this script will see this.
 
Back
Top