• 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 Advance Script

kokorec

Tavon Online - Soon
Joined
May 3, 2008
Messages
287
Reaction score
0
Location
Turkey
Hi,
it is work with TFS 0.3+

Create new lua and add this:
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
skillnames={'Fist','Club','Sword','Axe','Distance','Shield','Fishing','Magic','Level'}

	 doSendAnimatedText(getCreaturePosition(cid), '' ..skillnames[skill+1].. ' Up!', math.random(1,254))
doSendMagicEffect(getCreaturePosition(cid),29)
end

then add login.lua under fuction onLogin:
Code:
	registerCreatureEvent(cid, "playeradvance")

and creaturescripts.xml
Code:
	<event type="advance" name="playeradvance" script="advance.lua"/>
 
i am not try TFS 0.3.1(RC1)yet but when i go home i will write it.
 
oh. Yea it works... thanks ;d

Can u edit it: when u advance it uses 3 effects at once(28 then 29 and 30) or uses 1 effect but randomly(sometimes 29, sometimes 30)

and when it says "Level Up" can u add to this something like "Level Up [101]" or "Raised Level to 101."; "Raised sword fighting to 75."
 
lol something doubled my post :/ S0rry...


Here is my 2 scripts remake in one but not working perfectly. When u advance in skill uses only one effect, always the same and the animated text is cuted... it says "Raised Le" or "Raised Sw", it should say "Raised level to xxx." idk why it happen ;p
Code:
local config = {
    [0] = { "Fist Fighting", 30}, -- 30 = variable[2]  -- Animation effect
    [1] = { "Club Fighting", 30}, -- 30 = variable[2]  -- Animation effect
    [2] = { "Sword Fighting", 30}, -- 30 = variable[2]  -- Animation effect
    [3] = { "Axe Fighting", 30}, -- 30 = variable[2]  -- Animation effect
    [4] = { "Distance Fighting", 30}, -- 30 = variable[2]  -- Animation effect
    [5] = { "Shielding", 30}, -- 30 = variable[2]  -- Animation effect
    [6] = { "Fishing", 30}, -- 30 = variable[2]  -- Animation effect
    [7] = { "Magic Level", 30}, -- 30 = variable[2]  -- Animation effect
    [8] = { "Level", 30} -- 30 = variable[2]  -- Animation effect
}
function onAdvance(cid, skill, oldlevel, newlevel)
local pos = getPlayerPosition(cid)
local positions = {
        {x=pos.x,y=pos.y,z=pos.z}}

        
    for type, variable in pairs(config) do
        if skill == type then
            doSendAnimatedText(getCreaturePosition(cid), 'Raised '..variable[1]..' to ['..newlevel..'].', math.random(1,254))
            for i = 1, table.maxn(positions) do
                    doSendMagicEffect(positions[i],variable[2])
            end

            
        end
    end    
return TRUE
end
 
Last edited:
lol something doubled my post :/ S0rry...


Here is my 2 scripts remake in one but not working perfectly. When u advance in skill uses only one effect, always the same and the animated text is cuted... it says "Raised Le" or "Raised Sw", it should say "Raised level to xxx." idk why it happen ;p
Code:
local config = {
    [0] = { "Fist Fighting", 30}, -- 30 = variable[2]  -- Animation effect
    [1] = { "Club Fighting", 30}, -- 30 = variable[2]  -- Animation effect
    [2] = { "Sword Fighting", 30}, -- 30 = variable[2]  -- Animation effect
    [3] = { "Axe Fighting", 30}, -- 30 = variable[2]  -- Animation effect
    [4] = { "Distance Fighting", 30}, -- 30 = variable[2]  -- Animation effect
    [5] = { "Shielding", 30}, -- 30 = variable[2]  -- Animation effect
    [6] = { "Fishing", 30}, -- 30 = variable[2]  -- Animation effect
    [7] = { "Magic Level", 30}, -- 30 = variable[2]  -- Animation effect
    [8] = { "Level", 30} -- 30 = variable[2]  -- Animation effect
}
function onAdvance(cid, skill, oldlevel, newlevel)
local pos = getPlayerPosition(cid)
local positions = {
        {x=pos.x,y=pos.y,z=pos.z}}

        
    for type, variable in pairs(config) do
        if skill == type then
            doSendAnimatedText(getCreaturePosition(cid), 'Raised '..variable[1]..' to ['..newlevel..'].', math.random(1,254))
            for i = 1, table.maxn(positions) do
                    doSendMagicEffect(positions[i],variable[2])
            end

            
        end
    end    
return TRUE
end

Because animated text is limited to few characters and this is not your script :(
http://otland.net/f82/skill-up-message-20774/
 
Back
Top