• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Skill UP message!

It work for me in 0.3.3 lol..
You guys just have to change in creaturescript.xml
Code:
<event type="advance" name="advance" script="advance.lua"/>

to
Code:
<event type="advance" name="advance" event="script" value="advance.lua"/>
 
It work for me in 0.3.3 lol..
You guys just have to change in creaturescript.xml
Code:
<event type="advance" name="advance" script="advance.lua"/>

to
Code:
<event type="advance" name="advance" event="script" value="advance.lua"/>

didnt work for me :huh:
 
works fine on TFS0.31 + 0.32. Just read the thread and figure it out. I did.

edit: actually, here.

Login.lua (in creature scripts)
PHP:
function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		for i = PLAYERLOSS_EXPERIENCE, PLAYERLOSS_ITEMS do
			doPlayerSetLossPercent(cid, i, getConfigValue('deathLostPercent'))
		end
	end

    registerCreatureEvent(cid, "GuildMotd")
    registerCreatureEvent(cid, "PlayerDeath")
    registerCreatureEvent(cid, "advance")
    return TRUE
end

advance.lua (in creaturescripts)
PHP:
--Script made by Pitufo/Haifurer!
local config = {
    [0] = { "Fist skill Up", 30}, -- 30 = variable[2]  -- Animation effect
    [1] = { "Club skill Up", 30}, -- 30 = variable[2]  -- Animation effect
    [2] = { "Sword skill Up", 30}, -- 30 = variable[2]  -- Animation effect
    [3] = { "Axe skill Up", 30}, -- 30 = variable[2]  -- Animation effect
    [4] = { "Distance Up", 30}, -- 30 = variable[2]  -- Animation effect
    [5] = { "Shielding Up", 30}, -- 30 = variable[2]  -- Animation effect
    [6] = { "Fishing Up", 30}, -- 30 = variable[2]  -- Animation effect
    [7] = { "Magic Up", 30}, -- 30 = variable[2]  -- Animation effect
    [8] = { "Level Up", 30} -- 30 = variable[2]  -- Animation effect
}
function onAdvance(cid, skill, oldlevel, newlevel)
local pos = getPlayerPosition(cid)
local positions = {
        {x=pos.x+1,y=pos.y-1,z=pos.z},
        {x=pos.x-1,y=pos.y-1,z=pos.z},
        {x=pos.x+1,y=pos.y+1,z=pos.z},
        {x=pos.x-1,y=pos.y+1,z=pos.z},
        {x=pos.x+1,y=pos.y,z=pos.z},
        {x=pos.x-1,y=pos.y,z=pos.z},
        {x=pos.x,y=pos.y+1,z=pos.z},
        {x=pos.x,y=pos.y-1,z=pos.z}}
        
    for type, variable in pairs(config) do
        if skill == type then
            doCreatureSay(cid, ""..variable[1].."", TALKTYPE_ORANGE_1)
            for i = 1, table.maxn(positions) do
                    doSendMagicEffect(positions[i],variable[2])
            end
        end
    end    
return TRUE
end

creaturescripts.xml (in creaturescripts, obviously.)
PHP:
	<event type="advance" name="advance" script="advance.lua"/>


Enjoy. Hardly, very slightly edited to make it work for you kids. I take no credit.




But rep is nice too. :)

Yea this works.
Thanks man!
 
Me toooo, but a bit shortened version :D (And without magic effect [; )
Code:
function onAdvance(cid, skill, oldLevel, newLevel)
	doCreatureSay(cid, SKILLS[skill]:gsub("%a", string.upper, 1) .. " UP [" .. newLevel .. "]", TALKTYPE_ORANGE_1)
	return TRUE
end
 
Can someone make this if someone get lvl 100 this will show him not for all lvls when advance?
 
Back
Top