• 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 [onAdvance] Pick a vocation

4220niller

XHTML / CSS Coder
Joined
Jul 4, 2007
Messages
127
Reaction score
1
Location
Denmark, Korsør
This script teleports you to a given location at level 8, where you can pick your vocation, if you dont have a vocation ofcourse :) (vocation chooser/oracle is not included)

data/creaturescripts/scripts/advances/level.lua
Code:
--onAdvance system by 4220niller

function onAdvance(cid, oldlevel, newlevel)
	local oracleCords = {x=95, y=117, z=7} --This is the position that the player is teleported at level 8, in this room there needs to be a way of choosing vocation
	if newlevel == 8 and getPlayerVocation(cid) == 0 then
		doSendMagicEffect(getPlayerPosition(cid),10)
		doTeleportThing(cid,oracleCords,0)
		doSendMagicEffect(oracleCords,10)
		doPlayerSendTextMessage(cid, 22, "Congratulations! You can now pick a vocation!")
	end
end


This script shows a magic effect when you advance in magic level:
data/creaturescripts/scripts/advances/maglevel.lua
Code:
--onAdvance system by 4220niller

function onAdvance(cid, oldlevel, newlevel)
	local voc = getPlayerVocation(cid)
	local effect = math.random(CONST_ME_FIREWORK_YELLOW,CONST_ME_FIREWORK_BLUE)
	doSendMagicEffect(getPlayerPosition(cid),effect)
end

The link to my onAdvance system is: http://otland.net/showthread.php?t=1607
 
Last edited:
So, as soon as you see the message 'You advanced from level 7 to level 8', you get teleported to That coordenates. How do you choose the new vocation? Or you only get teleported and you see the orcale next to you?
 
So, as soon as you see the message 'You advanced from level 7 to level 8', you get teleported to That coordenates. How do you choose the new vocation? Or you only get teleported and you see the orcale next to you?

You'll only get teleported
 
Looks good, why do you check there voc in the second voc?

could you make so when you advance to level 100 you get 100 spelt out in firework animations?
 
@Komic
ill get right to that :)

EDIT:
It will send either the red, blue or yellow effect.. it is randomized. (to edit this just change local effect)

data\creaturescripts\scripts\advances/level.lua
Code:
--onAdvance system by 4220niller

function onAdvance(cid, oldlevel, newlevel)
	if newlevel == 100 then
		local ppos = getPlayerPosition(cid)
		local positions = {
			{x=ppos.x-3, y=ppos.y-1, z=ppos.z},
			{x=ppos.x-1, y=ppos.y-1, z=ppos.z},
			{x=ppos.x, y=ppos.y-1, z=ppos.z},
			{x=ppos.x+1, y=ppos.y-1, z=ppos.z},
			{x=ppos.x+3, y=ppos.y-1, z=ppos.z},
			{x=ppos.x+4, y=ppos.y-1, z=ppos.z},
			{x=ppos.x+5, y=ppos.y-1, z=ppos.z},
			
			{x=ppos.x-3, y=ppos.y, z=ppos.z},
			{x=ppos.x-1, y=ppos.y, z=ppos.z},
			{x=ppos.x+1, y=ppos.y, z=ppos.z},
			{x=ppos.x+3, y=ppos.y, z=ppos.z},
			{x=ppos.x+5, y=ppos.y, z=ppos.z},
			
			{x=ppos.x-3, y=ppos.y+1, z=ppos.z},
			{x=ppos.x-1, y=ppos.y+1, z=ppos.z},
			{x=ppos.x, y=ppos.y+1, z=ppos.z},
			{x=ppos.x+1, y=ppos.y+1, z=ppos.z},
			{x=ppos.x+3, y=ppos.y+1, z=ppos.z},
			{x=ppos.x+4, y=ppos.y+1, z=ppos.z},
			{x=ppos.x+5, y=ppos.y+1, z=ppos.z},
		}
		local effect = math.random(CONST_ME_FIREWORK_YELLOW,CONST_ME_FIREWORK_BLUE)
		for i = 1, table.getn(positions) do
			doSendMagicEffect(positions[i],effect)
		end
	end
end
 
Last edited:
@Komic
ill get right to that :)

EDIT:
It will send either the red, blue or yellow effect.. it is randomized. (to edit this just change local effect)

data\creaturescripts\scripts\advances/level.lua
Code:
--onAdvance system by 4220niller

function onAdvance(cid, oldlevel, newlevel)
	if newlevel == 100 then
		local ppos = getPlayerPosition(cid)
		local positions = {
			{x=ppos.x-3, y=ppos.y-1, z=ppos.z},
			{x=ppos.x-1, y=ppos.y-1, z=ppos.z},
			{x=ppos.x, y=ppos.y-1, z=ppos.z},
			{x=ppos.x+1, y=ppos.y-1, z=ppos.z},
			{x=ppos.x+3, y=ppos.y-1, z=ppos.z},
			{x=ppos.x+4, y=ppos.y-1, z=ppos.z},
			{x=ppos.x+5, y=ppos.y-1, z=ppos.z},
			
			{x=ppos.x-3, y=ppos.y, z=ppos.z},
			{x=ppos.x-1, y=ppos.y, z=ppos.z},
			{x=ppos.x+1, y=ppos.y, z=ppos.z},
			{x=ppos.x+3, y=ppos.y, z=ppos.z},
			{x=ppos.x+5, y=ppos.y, z=ppos.z},
			
			{x=ppos.x-3, y=ppos.y+1, z=ppos.z},
			{x=ppos.x-1, y=ppos.y+1, z=ppos.z},
			{x=ppos.x, y=ppos.y+1, z=ppos.z},
			{x=ppos.x+1, y=ppos.y+1, z=ppos.z},
			{x=ppos.x+3, y=ppos.y+1, z=ppos.z},
			{x=ppos.x+4, y=ppos.y+1, z=ppos.z},
			{x=ppos.x+5, y=ppos.y+1, z=ppos.z},
		}
		local effect = math.random(CONST_ME_FIREWORK_YELLOW,CONST_ME_FIREWORK_BLUE)
		for i = 1, table.getn(positions) do
			doSendMagicEffect(positions[i],effect)
		end
	end
end

Thats a nice and usefull script =O!
 
VERY nice work! I'm looking forward for some new cool creaturescripts from you! :) Keep it up!
 
@up
well i was kinda hoping that others would start doing onAdvance scripts too, since its kinda boring being the only one.

Well, i would you guys out there to come up with some requests! ;)
 
I'll reply to you as soon as I come up with some idea. ;) I'm not really that great on any scripts, haven't taken the time to sit down and learn to script yet. But I think I'm gonna learn how to code in C++ soon.
 
Scripts are not in C++...
if you know code in some language i think that you can do scripts. Of course you will need learn some functions, but it's fast.
 
Thank you for scripts! It really help me. Now im useing it on my OTS. REP+
 
What if you die and get to lvl 7 again, and then reach lvl 8 the 2nd time? You better use a storagevalue? :p
 
Back
Top