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

Lvlup = Nice effects

ugurdrahs

New Member
Joined
May 6, 2010
Messages
555
Reaction score
2
Location
Netherland
Hello,

How to make so when someone is level up there are more effects than only one.
This script is only one effect.

PHP:
function onAdvance(cid, skill, oldlevel, newlevel)
local pos = getCreaturePosition(cid)
if skill == SKILL__LEVEL then
	doSendAnimatedText(pos, "Level Up!", 150)
       doSendMagicEffect(pos, 6) 
end
return true
end
 
Last edited:
I tryed

PHP:
function onAdvance(cid, skill, oldlevel, newlevel)
local pos = getCreaturePosition(cid)
if skill == SKILL__LEVEL then
    doSendAnimatedText(pos, "Level Up!", 150)
       doSendMagicEffect(pos, 6,7,8,9,) 
end
return true
end

but it didnt work :S
 
i have this:


Lua:
--[[ / / / / / / / / / / / / / / / / / / / / / /
               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
 
You could use Stewie's suggestion, or try this other version of the same script:

Lua:
--[[ / / / / / / / / / / / / / / / / / / / / / /
		Advanced OnAdvance Fancy Edition
	   The Best OnAdvance Creaturescript
			Scripted by Cybermaster
/ / / / / / / / / / / / / / / / / / / / / / ]]--
 
local area, data = 
{
	{0, 1, 1, 1, 0},
	{1, 1, 1, 1, 1},
	{1, 1, 1, 1, 1},
	{1, 1, 1, 1, 1},
	{0, 1, 1, 1, 0}
},
{
	[SKILL_FIST] = 'FIST UP!',
	[SKILL_CLUB] = 'CLUB UP!',
	[SKILL_SWORD] = 'SWORD UP!',
	[SKILL_AXE] = 'AXE UP!',
	[SKILL_DISTANCE] = 'DIST UP!',
	[SKILL_SHIELD] = 'SHIELDUP!',
	[SKILL_FISHING] = 'FISH UP!',
	[SKILL__MAGLEVEL] = 'MAGIC UP!',
	[SKILL__LEVEL] = 'LEVEL UP!'
}
 
function onAdvance(cid, skill, oldLevel, newLevel)
    doPlayerSave(cid)
	local center, data = {}, data[skill] --function doSendMagicEffectInArea of Mock
    center.y = math.floor(table.getn(area)/2)+1
    for y = 1, table.getn(area) do
        for x = 1, table.getn(area[y]) do
            if area[y][x] > 0 then
                center.x = math.floor(table.getn(area[y])/2)+1
                doSendMagicEffect({x=getThingPos(cid).x+x-center.x,y=getThingPos(cid).y+y-center.y,z= getThingPos(cid).z},math.random(28,30),cid)
            end
        end
    end	
    for i = 1, #data do
		addEvent(doSendAnimatedText, i*150, getThingPos(cid), data:sub(i,i), i%2 == 0 and TEXTCOLOR_RED or TEXTCOLOR_ORANGE)
    end
    return true
end

And ultimately, with some tweaking, you can get the final result you want. Just a matter of preference.
 
Last edited:
Back
Top