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

Pitufo™

InfinityOT.com
Joined
Feb 14, 2008
Messages
1,438
Reaction score
10
Location
Mexico, Cuernavaca
How it works?
Well when you advance a skill it will show ontop of your head a message of the skill you advanced and the level of the skill, also it will send arounf your player animations!

Tested on TFS 0.3 Beta2
Script for 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 skill UP", 30}, -- 30 = variable[2]  -- Animation effect
    [5] = { "Shield skill UP", 30}, -- 30 = variable[2]  -- Animation effect
    [6] = { "Fishing skill UP", 30}, -- 30 = variable[2]  -- Animation effect
    [7] = { "Magic level 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].." ["..newlevel.."]", TALKTYPE_ORANGE_1)
            for i = 1, table.maxn(positions) do
                    doSendMagicEffect(positions[i],variable[2])
            end

            
        end
    end    
return TRUE
end

PHP:
<event type="advance" name="advance" script="advance.lua"/>

Image:
23012009174842sc1.png


Same script but in (serious) lol requested by Sizaro!
Here!
Enjoy it!
 
Last edited:
Why dont you add level and maglevel? ^^

( 7 & 8 )
 
If u make it more serious like


That would be cool xD

Serious, ok, LOL!

Serious script:

PHP:
--Script made by Pitufo/Haifurer!
local config = {
	[0] = { "Fist", 30}, -- 30 = variable[2]  -- Animation effect
	[1] = { "Club", 30}, -- 30 = variable[2]  -- Animation effect
	[2] = { "Sword", 30}, -- 30 = variable[2]  -- Animation effect
	[3] = { "Axe", 30}, -- 30 = variable[2]  -- Animation effect
	[4] = { "Distance", 30}, -- 30 = variable[2]  -- Animation effect
	[5] = { "Shield", 30}, -- 30 = variable[2]  -- Animation effect
	[6] = { "Fishing", 30}, -- 30 = variable[2]  -- Animation effect
	[7] = { "Magic", 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+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
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have raised your "..variable[1].." skill from "..oldlevel.." to "..newlevel..".")
			for i = 1, table.maxn(positions) do
					doSendMagicEffect(positions[i],variable[2])
			end
		end
	end	
return TRUE
end

Image:

23012009174057xa2.png



PD: Sorry for double post!
 
Last edited:
not fist, that sounds like you have rised your hand from 3 to 4, and use a dot in the end ...... ... ... . . . ... . .:::: ...
 
advance script only for TFS 0.3+ but visit niller's 0.2 advance function topic.
 
Back
Top