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

Back With Transform System Problem Again

Lopaskurwa

Active Member
Joined
Oct 6, 2017
Messages
873
Solutions
2
Reaction score
49
So hi
i have again problems with transform system this so dumb. -_-
So i'll try to explain so i made more transforms and more problems poop up so everything is fine with this one
Code:
[1] = {voc = 1, newVoc = 5, from_looktype = 2, looktype = 3, level = 50, rage = 0, mana = 10, addHealth = 2500, addMana = 2500, effect = 79, aura = nil, constant = false},
then i create another transform for the same vocation and shits starts to happen. So i made these two more
Code:
[5] = {voc = 5, newVoc = 36, from_looktype = 5, looktype = 5, level = 100, rage = 0, mana = 10, addHealth = 2500, addMana = 2500, effect = 79, aura = nil, constant = false},
[36] = {voc = 36, newVoc = 37, from_looktype = 37, looktype = 5, level = 150, rage = 0, mana = 10, addHealth = 2500, addMana = 2500, effect = 78, aura = 86, constant = false}
So first problem is they cant revert dunno why second problem is that this one [5] = {voc = 5, gets after transform effect but as you can see aura is nil but somehow he gets [36] = {voc = 36, vocation effect with id 86 this is so stupid. To make it clear id 5 gets after transform effect even if aura is nil and id 36 doesnt get any effect but aura have effect id this is so fucked up.

vocations.xml
casual form without any forms
Code:
    <vocation id="1" name="Goku" description="Goku" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="5" manamultiplier="1.1" attackspeed="2000" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="1">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0" />
        <skill id="0" multiplier="1.5" />
        <skill id="1" multiplier="2.0" />
        <skill id="2" multiplier="2.0" />
        <skill id="3" multiplier="2.0" />
        <skill id="4" multiplier="2.0" />
        <skill id="5" multiplier="1.5" />
        <skill id="6" multiplier="1.1" />
    </vocation>
First form
Code:
    <vocation id="5" name="Goku SSJ" description="Goku" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="5" manamultiplier="1.1" attackspeed="1800" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="5">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0" />
        <skill id="0" multiplier="1.5" />
        <skill id="1" multiplier="2.0" />
        <skill id="2" multiplier="2.0" />
        <skill id="3" multiplier="2.0" />
        <skill id="4" multiplier="2.0" />
        <skill id="5" multiplier="1.5" />
        <skill id="6" multiplier="1.1" />
    </vocation>
Second form
Code:
    <vocation id="36" name="Goku SSJ" description="Goku" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="5" manamultiplier="1.1" attackspeed="1650" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="36">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0" />
        <skill id="0" multiplier="1.5" />
        <skill id="1" multiplier="2.0" />
        <skill id="2" multiplier="2.0" />
        <skill id="3" multiplier="2.0" />
        <skill id="4" multiplier="2.0" />
        <skill id="5" multiplier="1.5" />
        <skill id="6" multiplier="1.1" />
    </vocation>
last form
Code:
    <vocation id="37" name="Goku SSJ2" description="Goku" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="5" manamultiplier="1.1" attackspeed="1450" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="37">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0" />
        <skill id="0" multiplier="1.5" />
        <skill id="1" multiplier="2.0" />
        <skill id="2" multiplier="2.0" />
        <skill id="3" multiplier="2.0" />
        <skill id="4" multiplier="2.0" />
        <skill id="5" multiplier="1.5" />
        <skill id="6" multiplier="1.1" />
    </vocation>
Thanks to Itutorial for make such a perfect working system :D
 
I know nothing about your transform system, but maybe the repeated vocation name?
Lua:
<vocation id="5" name="Goku SSJ"
<vocation id="36" name="Goku SSJ"
 
So hi
i have again problems with transform system this so dumb. -_-
So i'll try to explain so i made more transforms and more problems poop up so everything is fine with this one
Code:
[1] = {voc = 1, newVoc = 5, from_looktype = 2, looktype = 3, level = 50, rage = 0, mana = 10, addHealth = 2500, addMana = 2500, effect = 79, aura = nil, constant = false},
then i create another transform for the same vocation and shits starts to happen. So i made these two more
Code:
[5] = {voc = 5, newVoc = 36, from_looktype = 5, looktype = 5, level = 100, rage = 0, mana = 10, addHealth = 2500, addMana = 2500, effect = 79, aura = nil, constant = false},
[36] = {voc = 36, newVoc = 37, from_looktype = 37, looktype = 5, level = 150, rage = 0, mana = 10, addHealth = 2500, addMana = 2500, effect = 78, aura = 86, constant = false}
So first problem is they cant revert dunno why second problem is that this one [5] = {voc = 5, gets after transform effect but as you can see aura is nil but somehow he gets [36] = {voc = 36, vocation effect with id 86 this is so stupid. To make it clear id 5 gets after transform effect even if aura is nil and id 36 doesnt get any effect but aura have effect id this is so fucked up.

vocations.xml
casual form without any forms
Code:
    <vocation id="1" name="Goku" description="Goku" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="5" manamultiplier="1.1" attackspeed="2000" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="1">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0" />
        <skill id="0" multiplier="1.5" />
        <skill id="1" multiplier="2.0" />
        <skill id="2" multiplier="2.0" />
        <skill id="3" multiplier="2.0" />
        <skill id="4" multiplier="2.0" />
        <skill id="5" multiplier="1.5" />
        <skill id="6" multiplier="1.1" />
    </vocation>
First form
Code:
    <vocation id="5" name="Goku SSJ" description="Goku" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="5" manamultiplier="1.1" attackspeed="1800" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="5">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0" />
        <skill id="0" multiplier="1.5" />
        <skill id="1" multiplier="2.0" />
        <skill id="2" multiplier="2.0" />
        <skill id="3" multiplier="2.0" />
        <skill id="4" multiplier="2.0" />
        <skill id="5" multiplier="1.5" />
        <skill id="6" multiplier="1.1" />
    </vocation>
Second form
Code:
    <vocation id="36" name="Goku SSJ" description="Goku" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="5" manamultiplier="1.1" attackspeed="1650" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="36">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0" />
        <skill id="0" multiplier="1.5" />
        <skill id="1" multiplier="2.0" />
        <skill id="2" multiplier="2.0" />
        <skill id="3" multiplier="2.0" />
        <skill id="4" multiplier="2.0" />
        <skill id="5" multiplier="1.5" />
        <skill id="6" multiplier="1.1" />
    </vocation>
last form
Code:
    <vocation id="37" name="Goku SSJ2" description="Goku" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="5" manamultiplier="1.1" attackspeed="1450" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="37">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0" />
        <skill id="0" multiplier="1.5" />
        <skill id="1" multiplier="2.0" />
        <skill id="2" multiplier="2.0" />
        <skill id="3" multiplier="2.0" />
        <skill id="4" multiplier="2.0" />
        <skill id="5" multiplier="1.5" />
        <skill id="6" multiplier="1.1" />
    </vocation>
Thanks to Itutorial for make such a perfect working system :D

you want the transformation to revert? Is that it? I don't think its possible.. since you can't "get back" in levels, unless you die a lot.
 
I know nothing about your transform system, but maybe the repeated vocation name?
Lua:
<vocation id="5" name="Goku SSJ"
<vocation id="36" name="Goku SSJ"
I think this system work with id's not with names.
you want the transformation to revert? Is that it? I don't think its possible.. since you can't "get back" in levels, unless you die a lot.
No revert is like you go back to regular looktype, power. Example you are 1id then you transform to 5id then you type revert you go back to 1id. It works only this one
Code:
[1] = {voc = 1, newVoc = 5, from_looktype = 2, looktype = 3, level = 50, rage = 0, mana = 10, addHealth = 2500, addMana = 2500, effect = 79, aura = nil, constant = false},
but for these two at the top doesnt work maybe i do something wrong in vocations.xml idk
 
I think this system work with id's not with names.

No revert is like you go back to regular looktype, power. Example you are 1id then you transform to 5id then you type revert you go back to 1id. It works only this one
Code:
[1] = {voc = 1, newVoc = 5, from_looktype = 2, looktype = 3, level = 50, rage = 0, mana = 10, addHealth = 2500, addMana = 2500, effect = 79, aura = nil, constant = false},
but for these two at the top doesnt work maybe i do something wrong in vocations.xml idk

Well.. try change constant = false to constant = true, I don't know if it will work though.
 
Well.. try change constant = false to constant = true, I don't know if it will work though.
canstat = false (revertible) constat = true (unrevertible) So i think there is no point to try because i said [1] = {voc = 1 work with constant = false but those two last doesnt work.
 
Rules for the Support board

#5

You haven't posted the actual code, so it's literally impossible to help you.
No one asked about transform.lua sorry about that then ;D
This is full transform system
Code:
exhaust_transform = {}

transform = {
[1] = {voc = 1, newVoc = 5, from_looktype = 2, looktype = 3, level = 50, rage = 3, mana = 10, addHealth = 200, addMana = 150, effect = 79, aura = nil, constant = false},
[5] = {voc = 5, newVoc = 36, from_looktype = 5, looktype = 5, level = 100, rage = 0, mana = 10, addHealth = 2500, addMana = 2500, effect = 79, aura = nil, constant = false},
[36] = {voc = 36, newVoc = 37, from_looktype = 37, looktype = 5, level = 150, rage = 0, mana = 10, addHealth = 2500, addMana = 2500, effect = 78, aura = 86, constant = false}
}
Code:
function onThink(interval)
    local players = Game.getPlayers()
    for i, v in ipairs(players) do
        player = Player(v)
        if player then
            TRANS = transform[player:getVocation():getId()]
            if TRANS then
                if TRANS.aura ~= nil then
                    player:getPosition():sendMagicEffect(TRANS.aura)
                end
            end
        end
    end
return true
end
Code:
function onSay(player, words, param)
    local kurwa_gdzie_jest_efekt = Position(player:getPosition().x + 1, player:getPosition().y, player:getPosition().z)
    local pid = player:getId()

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

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

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

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

    player:addSoul(-TRANS.rage)
    player:setMaxHealth(player:getMaxHealth() + TRANS.addHealth)
    player:setMaxMana(player:getMaxMana() + TRANS.addMana)
    kurwa_gdzie_jest_efekt:sendMagicEffect(TRANS.effect)
    player:setVocation(TRANS.newVoc)
    player:save()
    return false
end
Code:
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
    player:sendCancelMessage("You cannot revert.")
    return false
    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:setVocation(TRANS.voc)
    player:save()
    addEvent(removeExhaust, 5 * 1000, pid)
return false
end
function removeExhaust(pid)
    exhaust_transform[pid] = nil
end
Problem described in the description. I really need to fix this system because i stuck with transform system about for 2-3 months and still cant fix it.
 
No one asked about transform.lua sorry about that then ;D
This is full transform system
Code:
exhaust_transform = {}

transform = {
[1] = {voc = 1, newVoc = 5, from_looktype = 2, looktype = 3, level = 50, rage = 3, mana = 10, addHealth = 200, addMana = 150, effect = 79, aura = nil, constant = false},
[5] = {voc = 5, newVoc = 36, from_looktype = 5, looktype = 5, level = 100, rage = 0, mana = 10, addHealth = 2500, addMana = 2500, effect = 79, aura = nil, constant = false},
[36] = {voc = 36, newVoc = 37, from_looktype = 37, looktype = 5, level = 150, rage = 0, mana = 10, addHealth = 2500, addMana = 2500, effect = 78, aura = 86, constant = false}
}
Code:
function onThink(interval)
    local players = Game.getPlayers()
    for i, v in ipairs(players) do
        player = Player(v)
        if player then
            TRANS = transform[player:getVocation():getId()]
            if TRANS then
                if TRANS.aura ~= nil then
                    player:getPosition():sendMagicEffect(TRANS.aura)
                end
            end
        end
    end
return true
end
Code:
function onSay(player, words, param)
    local kurwa_gdzie_jest_efekt = Position(player:getPosition().x + 1, player:getPosition().y, player:getPosition().z)
    local pid = player:getId()

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

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

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

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

    player:addSoul(-TRANS.rage)
    player:setMaxHealth(player:getMaxHealth() + TRANS.addHealth)
    player:setMaxMana(player:getMaxMana() + TRANS.addMana)
    kurwa_gdzie_jest_efekt:sendMagicEffect(TRANS.effect)
    player:setVocation(TRANS.newVoc)
    player:save()
    return false
end
Code:
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
    player:sendCancelMessage("You cannot revert.")
    return false
    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:setVocation(TRANS.voc)
    player:save()
    addEvent(removeExhaust, 5 * 1000, pid)
return false
end
function removeExhaust(pid)
    exhaust_transform[pid] = nil
end
Problem described in the description. I really need to fix this system because i stuck with transform system about for 2-3 months and still cant fix it.
Maybe it's some problem with not using a local? I don't see any reason why this shouldn't be working correctly though.
Lua:
function onThink(interval)
    local players = Game.getPlayers()
    for i, v in ipairs(players) do
        local player = Player(v)
        if player then
            TRANS = transform[player:getVocation():getId()]
            if TRANS then
                if TRANS.aura ~= nil then
                    player:getPosition():sendMagicEffect(TRANS.aura)
                end
            end
        end
    end
    return true
end
 
Rules for the Support board

#5

You haven't posted the actual code, so it's literally impossible to help you.
This is so weird. I doesnt change anything.
Code:
exhaust_transform = {}

transform = {
[1] = {voc = 1, newVoc = 5, from_looktype = 2, looktype = 3, level = 50, rage = 3, mana = 10, addHealth = 200, addMana = 150, effect = 79, aura = nil, constant = false},
[5] = {voc = 5, newVoc = 36, from_looktype = 2, looktype = 5, level = 100, rage = 3, mana = 10, addHealth = 200, addMana = 150, effect = 79, aura = nil, constant = false},
[36] = {voc = 36, newVoc = 37, from_looktype = 2, looktype = 5, level = 150, rage = 3, mana = 10, addHealth = 200, addMana = 150, effect = 79, aura = 86, constant = false}
}
Transform for 50level works perfect i can revert everything if i transform to 100level i get 150level transform effect, i have no idea why it apply effect if i transform to second from that require 100lvl and doesnt have any aura and if i transform to 150lvl, aura disappears but as you can see it should apply effect because its aura = 86 not nil. And second think i cant revert with those two forms 100,150lvl, but there is funny think i can revert with first form that require 50lvl so its messy
 
Thanks to Xikini

Code:
exhaust_transform = {}

transform = {
[1] =  {transform = 0, fromVoc = 0, newVoc = 5,  from_looktype = 2, looktype = 3, level = 50,  rage = 3, addHealth = 200, addMana = 150, effect = 79, aura = nil, constant = false},
[5] =  {transform = 1, fromVoc = 1, newVoc = 36, from_looktype = 2, looktype = 5, level = 100, rage = 3, addHealth = 200, addMana = 150, effect = 79, aura = nil, constant = false}, 
[36] = {transform = 2, fromVoc = 5, newVoc = 37, from_looktype = 2, looktype = 5, level = 150, rage = 3, addHealth = 200, addMana = 150, effect = 79, aura = nil, constant = false},
[37] = {transform = 3, fromVoc = 36, newVoc = 0, from_looktype = 2, looktype = 5, level = 0,   rage = 0, addHealth = 0,   addMana = 0,   effect = 0,  aura = 86,  constant = false} 
}
Code:
local function removeExhaust(pid)
    exhaust_transform[pid] = nil
end

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
        player:sendCancelMessage("TRANSFORM ERROR 11. Vocation = " .. player:getVocation():getId() .. "") -- VOCATION NOT IN GLOBAL TABLE
        return false
    end
   
    if TRANS.fromVoc == 0 then
        player:sendCancelMessage("You cannot revert.")
        return false
    end

    for i = 1, TRANS.transform do
        player:setVocation(TRANS.fromVoc)
        TRANS = transform[player:getVocation():getId()]
        local outfit = player:getOutfit()
        outfit.lookType = TRANS.from_looktype
        if TRANS.constant then
            player:setOutfit(outfit)
        else
            player:setOutfit(outfit, false)
        end
        player:setMaxHealth(player:getMaxHealth() - TRANS.addHealth)
        player:setMaxMana(player:getMaxMana() - TRANS.addMana)
    end
    player:save()
   
    exhaust_transform[pid] = 1   
    addEvent(removeExhaust, 5 * 1000, pid)
    return false
end
Code:
function onSay(player, words, param)
    local kurwa_gdzie_jest_efekt = Position(player:getPosition().x + 1, player:getPosition().y, player:getPosition().z)
    local pid = player:getId()

    local TRANS = transform[player:getVocation():getId()]
   
    if not TRANS then
        player:sendCancelMessage("TRANSFORM ERROR 11. Vocation = " .. player:getVocation():getId() .. "") -- VOCATION NOT IN GLOBAL TABLE
        return false
    end
   
    if TRANS.newVoc == 0 then
        player:sendCancelMessage("You cannot transform.")
        return false
    end
   
    if player:getLevel() < TRANS.level then
        player:sendCancelMessage("You must reach level "..TRANS.level.." to transform.")
        return false
    end
    if player:getSoul() < TRANS.rage then
        player:sendCancelMessage("You need "..TRANS.rage.." to transform.")
        return false
    end

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

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

    player:addSoul(-TRANS.rage)
    player:setMaxHealth(player:getMaxHealth() + TRANS.addHealth)
    player:setMaxMana(player:getMaxMana() + TRANS.addMana)
    kurwa_gdzie_jest_efekt:sendMagicEffect(TRANS.effect)
    player:setVocation(TRANS.newVoc)
    player:save()
    return false
end
Code:
function onThink(interval)
    local players = Game.getPlayers()
    for i, v in ipairs(players) do
        local player = Player(v)
        if player then
            --print(player:getVocation():getId())
            TRANS = transform[player:getVocation():getId()]
            if TRANS then
                if TRANS.aura ~= nil then
                    player:getPosition():sendMagicEffect(TRANS.aura)
                end
            end
        end
    end
    return true
end
Use it if u want it :)
 
Back
Top