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

Solved Creat new Vocation

Code:
<vocation id="12" name="NEW VOCATION" description="a NEW VOCATION" gaincap="25" gainhp="15" gainmana="5" gainhpticks="3" gainhpamount="35" gainmanaticks="3" gainmanaamount="35" manamultiplier="3.0" attackspeed="800" soulmax="200" gainsoulticks="15" fromvoc="5"> 
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
		<skill id="0" multiplier="1.1"/>
		<skill id="1" multiplier="1.1"/>
		<skill id="2" multiplier="1.1"/>
		<skill id="3" multiplier="1.1"/>
		<skill id="4" multiplier="1.4"/>
		<skill id="5" multiplier="1.1"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>

Example:
Code:
	<vocation id="12" name="a mage" description="a mage" gaincap="25" gainhp="15" gainmana="5" gainhpticks="3" gainhpamount="35" gainmanaticks="3" gainmanaamount="35" manamultiplier="3.0" attackspeed="800" soulmax="200" gainsoulticks="15" fromvoc="5"> 
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
		<skill id="0" multiplier="1.1"/>
		<skill id="1" multiplier="1.1"/>
		<skill id="2" multiplier="1.1"/>
		<skill id="3" multiplier="1.1"/>
		<skill id="4" multiplier="1.4"/>
		<skill id="5" multiplier="1.1"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>
</vocations>

Rep++
 
...
And in lib folder ?
vocation.lua
function isSorcerer(cid)
return isInArray({1, 5}, getPlayerVocation(cid))
end

function isDruid(cid)
return isInArray({2, 6}, getPlayerVocation(cid))
end

function isPaladin(cid)
return isInArray({3, 7}, getPlayerVocation(cid))
end

function isKnight(cid)
return isInArray({4, 8}, getPlayerVocation(cid))
end

function isRookie(cid)
return isInArray({0}, getPlayerVocation(cid))
end
 
Well change the id to a number to 15 in XML

and put this in LIB

function isNEWVOCNAME(cid)
return isInArray({10, 14}, getPlayerVocation(cid))
end


It should work.
 
there's no need to add that code into de lib
the vocations.xml already comes with 4 custom vocations..
just edit them
and TFS already comes with the npc to promote players to those vocations
 
I will need to try this again but I still failed to get it to work.

function onSay(cid, words, param)
if getPlayerGroupId(cid) >= 4 then
if param ~= "" then
local commapos = string.find(param,",")
local name = string.sub(param,1,commapos-1)
local int = string.sub(param,commapos+1,string.len(param))

local player= getPlayerByName(name)
doPlayerSendCancel(cid, name .. " has been set to vocation id " .. int .. "")
doPlayerSetVocation(player, int)

function isnecromancer(cid)
return isInArray({vocation 13, vocation promo id (if u have one)}, getPlayerVocation(cid))
end
end
end
end

<vocation id="13" name="Necromancer" description="a warlock" needpremium="0" gaincap="18" gainhp="23" gainmana=17" gainhpticks="8" gainhpamount="10" gainmanaticks="4" gainmanaamount="10" manamultiplier="1.5" attackspeed="700" soulmax="200" gainsoulticks="15" fromvoc="13" lessloss="50">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" armor="1.0"/>
<skill id="0" multiplier="1.5"/>
<skill id="1" multiplier="2.0"/>
<skill id="2" multiplier="2.0"/>
<skill id="3" multiplier="2.0"/>
<skill id="4" multiplier="2.0"/>
<skill id="5" multiplier="1.5"/>
<skill id="6" multiplier="1.1"/>
</vocation>

Could also use help knowing how to make it pickable from the site also.

Unless vocations.lua has two files and I had the wrong one...
 
Okay I changed the way I was going about the new class and made it where the Sorcerer promotes into it. I have the class in the vocations.xml like above and have it on vocation ID 9 fromvoc 1 and when I promote it says I have no class...
 
add this to data/xml/vocations.xml:

Lua:
    <vocation id="9" name="Ninja" description="a ninja" needpremium="1" gaincap="25" gainhp="15" gainmana="10" gainhpticks="2" gainhpamount="1000" gainmanaticks="2" gainmanaamount="1000" manamultiplier="1.8" attackspeed="300" soulmax="200" gainsoulticks="35" fromvoc="9">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="10" name="Hokage" description="a hokage" needpremium="1" gaincap="25" gainhp="15" gainmana="10" gainhpticks="2" gainhpamount="1000" gainmanaticks="2" gainmanaamount="1000" manamultiplier="1.8" attackspeed="300" soulmax="200" gainsoulticks="35" fromvoc="9" lessloss="50">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>

then go to data/lib/vocations and add this:
Lua:
function isSorcerer(cid)
	return isInArray({1, 5}, getPlayerVocation(cid))
end

function isDruid(cid)
	return isInArray({2, 6}, getPlayerVocation(cid))
end

function isPaladin(cid)
	return isInArray({3, 7}, getPlayerVocation(cid))
end

function isKnight(cid)
	return isInArray({4, 8}, getPlayerVocation(cid))
end


function isKnight(cid)
	return isInArray({9, 10}, getPlayerVocation(cid))
end

function isRookie(cid)
	return isInArray({0}, getPlayerVocation(cid))
end

that's just an example, edit it as you want
 
Can you just add like this?
function isKnight(cid)
return isInArray({10}, getPlayerVocation(cid))
end
Cus if you make like 6 new vocs that has from id 9 to 15, and you set between array 9-10 then both ids is a knight?
 
Back
Top