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

CreatureEvent Start Skills TFS 1.x

HeberPcL

[PowerOT.com.br]
Joined
Aug 21, 2007
Messages
1,292
Reaction score
51
Location
Brazil
GitHub
heberpcl
Hey...

Today updated the @Ratser script for last TFS.

Version Tested: The Forgotten Server - Version 1.2
Code:
local firstStorage = 56364
local firstSkills = {
    [1] = {
        {    amount = 55        }
    },
    [2] = {
        {   amount = 55        }
    },
    [3] = {
        {   skillid = SKILL_DISTANCE,   skillLevel = 70        },
        {   skillid = SKILL_SHIELD,     skillLevel = 70           },
        {   amount  = 20    }
    },
    [4] = {
        {   skillid = SKILL_CLUB,        skillLevel = 70            },
        {   skillid = SKILL_SWORD,        skillLevel = 70        },
        {   skillid = SKILL_AXE,        skillLevel = 70              },
        {   skillid = SKILL_SHIELD,        skillLevel = 70        },
        {   amount = 8                                        }
    },
    [5] = {
        {   amount = 55        }
    },
    [6] = {
        {   amount = 55        }
    },
    [7] = {
        {   skillid = SKILL_DISTANCE,   skillLevel = 70        },
        {   skillid = SKILL_SHIELD,     skillLevel = 70     },
        {   amount  = 20    }
    },
    [8] = {
        {   skillid = SKILL_CLUB,       skillLevel = 70        },
        {   skillid = SKILL_SWORD,     skillLevel = 70        },
        {   skillid = SKILL_AXE,       skillLevel = 70        },
        {   skillid = SKILL_SHIELD,     skillLevel = 70        },
        {   amount = 8        }
    }
}

function onLogin(player)
    local player = Player(player)
    local playerVoc = firstSkills[player:getVocation():getId()]
    if (not playerVoc) then
        return true
    end
    if (player:getStorageValue(firstStorage) == -1) then
        for i = 1, #playerVoc do
            if (playerVoc[i].skillid) then
                local skillNeed = playerVoc[i].skillLevel - player:getSkillLevel(playerVoc[i].skillid)
                player:addSkillTries(playerVoc[i].skillid, 60, false)
            end

            if (playerVoc[i].amount) then
                local magicNeed = ( playerVoc[i].amount - player:getMagicLevel() )
                player:addManaSpent(player:getVocation():getRequiredManaSpent(player:getBaseMagicLevel() + magicNeed) - player:getManaSpent())
            end
        end
        player:setStorageValue(firstStorage, 1)
    end
    return true
end
 
Last edited:
Hey...

Today updated the @Ratser script for last TFS.

Version Tested: The Forgotten Server - Version 1.2
Code:
local firstSkills = {
    [1] = {
        {   amount = 55     }
    },
    [2] = {
        {   amount = 55     }
    },
    [3] = {
        {   skillid = SKILL_DISTANCE,   skillLevel = 70 },
        {   skillid = SKILL_SHIELD,     skillLevel = 70 },
        {   amount  = 20    }
    },
    [4] = {
        {   skillid = SKILL_CLUB,   skillLevel = 70     },
        {   skillid = SKILL_SWORD,  skillLevel = 70     },
        {   skillid = SKILL_AXE,    skillLevel = 70     },
        {   skillid = SKILL_SHIELD, skillLevel = 70     },
        {   amount = 8          }
    },
    [5] = {
        {   amount = 55         }
    },
    [6] = {
        {   amount = 55         }
    },
    [7] = {
        {   skillid = SKILL_DISTANCE,   skillLevel = 70 },
        {   skillid = SKILL_SHIELD,     skillLevel = 70 },
        {   amount  = 20}
    },
    [8] = {
        {   skillid = SKILL_CLUB,   skillLevel = 70     },
        {   skillid = SKILL_SWORD,  skillLevel = 70     },
        {   skillid = SKILL_AXE,    skillLevel = 70     },
        {   skillid = SKILL_SHIELD, skillLevel = 70     },
        {   amount = 8  }
    }
}

function onLogin(player)
    local player = Player(player)
    local playerVoc = firstSkills[player:getVocation():getId()]
    if (not playerVoc) then
        return true
    end
    local skillStor = 56364
    if (player:getStorageValue(skillStor) == -1) then
        for i = 1, #playerVoc do
            if (playerVoc[i].skillid) then
                local skillNeed = playerVoc[i].skillLevel - player:getSkillLevel(playerVoc[i].skillid)
                player:addSkillTries(playerVoc[i].skillid, 60, false)
            end

            if (playerVoc[i].amount) then
                local magicNeed = ( playerVoc[i].amount - player:getMagicLevel() )
                player:addManaSpent(player:getVocation():getRequiredManaSpent(player:getBaseMagicLevel() + magicNeed) - player:getManaSpent())
            end
        end
        player:setStorageValue(skillStor, 1)
    end
    return true
end
please retab the script
the tables are horribly tabbed and look weird
function onLogin(player) local player = Player(player)
why are you making player userdata again when it's already in the login argument?
 
Back
Top