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

Change Vocation with Armillary Sphere

poopsiedoodle

Gibe moni plos
Joined
Nov 23, 2011
Messages
2,452
Reaction score
580
Location
Georgia
how do I make a script that changes your vocation to a knight/pally/sorc/druid if you have no vocation by using this?
Armillary_Sphere.gif
(ID: 9767)
 
Last edited:
It's four different towers. It's like Destiny Isle, but instead of talking to an NPC for it, you use the armillary sphere at the top of the tower.
 
Maybe something like this (untested):

Code:
<action uniqueid="5588" script="vocation_stone_sorcerer.lua"  />

Code:
function onUse(cid, item, frompos, item2, topos)
   	if  (getPlayerVocation(cid) == 0) then
                doPlayerSetVocation(cid, 1)	
                else
		doPlayerSendTextMessage(cid,22,"You already have a vocation.")
   	end
end

You can probably fit it all into one script so you don't have to make one for each voc.

Pazzur
 
something like this?
Lua:
local config = {
--	[actionid] = vocation
	[1234] = 1,
	[2345] = 2,
	[3456] = 3,
	[4567] = 4
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	for actionid, vocation in pairs(config) do
		if item.actionid == actionid and getPlayerVocation(cid) == 0 then
			doPlayerSetVocation(cid, vocation)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, now you are ".. getPlayerVocationName(cid))
		end
	end
	return true
end

actions.xml
XML:
<action actionid="1234;2345;3456;4567" script="NAME.OF.THE.LUA.FILE.lua"  />
 
Last edited:
it works...
also use this, and change the value on actions.xml
Lua:
local config = {
--	[actionid] = vocation
	[1234] = 1,
	[2345] = 2,
	[3456] = 3,
	[4567] = 4
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	for actionid, vocation in pairs(config) do
		if item.actionid == actionid and getPlayerVocation(cid) == 0 then
			doPlayerSetVocation(cid, vocation)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, now you are ".. getPlayerVocationName(cid)..".")
		else 
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can not pick a vocation.")
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		end
	end
	return true
end

XML:
	<action actionid="1234;2345;3456;4567" event="script" value="vocation.lua" />
 
Back
Top