• 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 Skill Up message with nice effect!

Figaro

Banned User
Joined
Jun 25, 2008
Messages
275
Reaction score
0
Location
696E 2079 6F75 7220 6265 64
Hellou, this script is based to pitufo's script, and this is more advanced script =)

Tested on
0.3.5 (Crying Damson)


Advance.lua
Code:
--Script made by Pitufo/Haifurer, edited by figaro!
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 effectPositions = {
{x = pos.x, y = pos.y - 3, z = pos.z},
{x = pos.x, y = pos.y + 3, z = pos.z},
{x = pos.x - 3, y = pos.y, z = pos.z},
{x = pos.x + 3, y = pos.y, z = pos.z},
{x = pos.x - 2, y = pos.y - 2, z = pos.z},
{x = pos.x + 2, y = pos.y - 2, z = pos.z},
{x = pos.x + 2, y = pos.y + 2, z = pos.z},
{x = pos.x - 2, y = pos.y + 2, z = pos.z}
}

        
    for type, variable in pairs(config) do
        if skill == type then
            doCreatureSay(cid, ""..variable[1].." ["..newlevel.."]", TALKTYPE_ORANGE_1)
	for _, ePos in ipairs(effectPositions) do
		doSendDistanceShoot(pos, ePos, CONST_ANI_SMALLHOLY)
		doSendMagicEffect(ePos, CONST_ME_HOLYAREA)
            end

            
        end
    end    
return TRUE
end

creaturescripts.xml
Code:
	<event type="advance" name="advance" script="advance.lua"/>

To login.lua
Code:
	registerCreatureEvent(cid, "advance")

advancec.jpg


Rep++? :rolleyes:
 
On 0.3.4pl2 Not work, not print error log, only not work, i dont know why..

Sorry for my bad english.
 
nice man, but i can edit the effect to one less ''spammed''?

Lua:
--Script made by Pitufo/Haifurer, edited by figaro!
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)  
    for type, variable in pairs(config) do
        if skill == type then
            doCreatureSay(cid, ""..variable[1].." ["..newlevel.."]", TALKTYPE_ORANGE_1)
	    doSendMagicEffect(pos,variable[2])
        end
    end    
return TRUE
end
 
so this aint working for 0.3.6?
This is for 0.3/4
You can try mine, with more nice effects:
Code:
--[[ / / / / / / / / / / / / / / / / / / / / / /
               Advanced OnAdvance
        The Best OnAdvance Creaturescript
        Scripted by Cybermaster
         @The Forgotten Server
           OTLand.net
/ / / / / / / / / / / / / / / / / / / / / / ]]--
 
 
local config = 
    { 
        --message, distance shoot effect
        [0] = {'+Fist', 38},
        [1] = {'+Mace', 26},
        [2] = {'+Swrd', 24},
        [3] = {'+Axe', 25},
        [4] = {'+Dist', 2},
        [5] = {'+Def', 11},
        [6] = {'+Fish', 12},
        [7] = {'+ML', 35},
        [8] = {'+LvL', 37} 
    }
 
function onAdvance(cid, skill, oldlevel, newlevel)
    if skill == SKILL__LEVEL then
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
        doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
    end
 
    local p = getThingPos(cid)
    local positions = 
    { --do not touch
        [1] = {
            {x=p.x+1,y=p.y,z=p.z}, 100, 900
        },
        [2] = {
            {x=p.x+1,y=p.y+1,z=p.z}, 200, 980
        },
        [3] = {
            {x=p.x,y=p.y+1,z=p.z}, 300, 1060
        },
        [4] = {
            {x=p.x-1,y=p.y+1,z=p.z}, 400, 1140
        },
        [5] = {
            {x=p.x-1,y=p.y,z=p.z}, 500, 1220
        },
        [6] = {
            {x=p.x-1,y=p.y-1,z=p.z}, 600, 1300
        },
        [7] = {
            {x=p.x,y=p.y-1,z=p.z}, 700, 1380
        },
        [8] = {
            {x=p.x+1,y=p.y-1,z=p.z}, 800, 1460
        } 
    }
 
    for i = 1, 8 do
        addEvent(doSendDistanceShoot, positions[i][2], positions[i][1], p, config[skill][2])
        addEvent(doSendDistanceShoot, positions[i][3], positions[i][1], p, config[skill][2])
    end
 
    addEvent(doSendMagicEffect, 900, p, 49)
    doSendAnimatedText(p, config[skill][1]..'['..newlevel..']', math.random(255))
    doPlayerSave(cid, true)    
    return true
end
 
Back
Top