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

sizaro wanted more serious and i want more crazy
i want mroe animations how to do this
 
Can u write it on TFS 0.3.1 (RC1) patch 2 ? ? ?
 
Last edited:
Do i have to restart my server? Coz nothing happens when i reload creaturescripts. I've got RC1.
 
dont work :(

dontworkcki0.png
 
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. :)
 
Its works with 0.3.1 and 0.3.2 (Crying Damson)!!! Stop saying that doesnt work when it does!

Ive already posted in this from the third time how to setup your script in creaturescripts!
 
Back
Top