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

Vocation Npc

Dyker

New Member
Joined
Sep 12, 2008
Messages
97
Reaction score
1
Hi people, i want to make a server which exist 27 vocations. But i need an script for an Npc which could change the vocation of a char paying 2k like a promotion but i would like that he have to choose into 2 differnets vocs. Example: If you starts with a Warrior, when you reach lvl 20 you can go to this Npc and pay 2k for promote into Light Warrior or Heavy Warrior.

And also an Npc that when you reach lvl 40, this npc ask a quest to players for go to click an oracle. When the player had clicked the oracle had to go to talk to npc and he will be able to choose to another 2 vocations more. For example: If you are Heavy Warrior you can choose into Berserker or Great Knight. If you are Light Warrior you could choose into Spell Knight or Assassin.

ty rep++
 
try this

LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)			npcHandler:onCreatureAppear(cid)			end
function onCreatureDisappear(cid)		npcHandler:onCreatureDisappear(cid)			end
function onCreatureSay(cid, type, msg)		npcHandler:onCreatureSay(cid, type, msg)		end
function onThink()				npcHandler:onThink()					end

local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})   node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, promotion = 1, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})   node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, promotion = 2, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = 20, promotion = 3, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = 20, promotion = 4, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 5, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 6, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 7, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 8, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 9, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 10, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 11, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 12, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 13, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 14, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 15, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 16, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 17, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 18, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 19, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 20, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 21, text = 'Congratulations! You are now promoted.'})                                                                                                                                                                   node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = 20, promotion = 1, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 22, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})   node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 23, text = 'Congratulations! You are now promoted.'})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})   node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 24, text = 'Congratulations! You are now promoted.'})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})   node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 25, text = 'Congratulations! You are now promoted.'})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})   node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 26, text = 'Congratulations! You are now promoted.'})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})   node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = how much?, level = level, promotion = 27, text = 'Congratulations! You are now promoted.'})


--[[   edit this line
local node2 = keywordHandler:addKeyword({'epic'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can epicize you for 200000 gold coins. Do you want me to epicize you?'})
	node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 200000, level = 120, promotion = 2, text = 'Congratulations! You are now epicized.'})
	node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})
]]--  

npcHandler:addModule(FocusModule:new())

edit comments and price..
 
Uhmm i don't think it is what i want, mmmm when you starts to playing you can choose into 3 vocs, you starts with Warrior(0), Mage(1) or Archer(2). And if its posible could be for an especific vocation?. However i have to change anythink more or just vocations.xml, i'm using tfs 0.3.6 ---> 8.54
 
Not really this, i would like some npc which changes the vocation not promotes. Someone who says for example if player is (vocation num=1) can go there and say

Player: hi
Npc: Hi player you want's to enter to our guild?
Player: yes
Npc: And what you want's to become {Light Warrior}(vocation num=4) or {Heavy Warrior}(vocation num=5)
Player: Light Warrior
Npc: Congratulations you are now a {Light Warrior}!

And if player is not (vocation num=1) say: Sorry this is not your place.
 
actually I cant post it but it's easy just put the numebers. If you can make it i will change the numbers easily
 
Branches:

archerxi.jpg
magef.jpg
warriori.jpg

Vocation.xml

HTML:
<?xml version="1.0" encoding="UTF-8"?>
<vocations>
	<vocation id="0" name="None" description="none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no">
		<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.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="1" name="Warrior" description="a warrior" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="12" gainhpamount="4" gainmanaticks="3" gainmanaamount="1" manamultiplier="1.0" attackspeed="100" soulmax="100" gainsoulticks="120" fromvoc="1">
		<formula meleeDamage="1.2" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.3" magDefense="1.0" armor="1.3"/>
		<skill fist="1.4" club="1.5" sword="1.5" axe="1.5" distance="1.0" shielding="1.3" fishing="1.3" experience="1.0"/>
	</vocation>
	<vocation id="2" name="Mage" description="a mage" needpremium="0" gaincap="10" gainhp="5" gainmana="20" gainhpticks="12" gainhpamount="3" gainmanaticks="3" gainmanaamount="6" manamultiplier="1.7" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="2">
		<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.3" magHealingDamage="1.1" defense="1.0" magDefense="1.1" armor="1.0"/>
		<skill fist="1.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.3" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="3" name="Archer" description="an archer" needpremium="0" gaincap="15" gainhp="10" gainmana="15" gainhpticks="8" gainhpamount="3" gainmanaticks="4" gainmanaamount="3" manamultiplier="1.3" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="3">
		<formula meleeDamage="1.2" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
		<skill fist="1.0" club="1.0" sword="1.0" axe="1.0" distance="1.7" shielding="1.1" fishing="1.1" experience="1.0"/>
	</vocation>	
	<vocation id="4" name="Light Warrior" description="a light warrior" needpremium="0" gaincap="25" gainhp="15" gainmana="6" gainhpticks="6" gainhpamount="4" gainmanaticks="6" gainmanaamount="3" manamultiplier="1.3" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="4">
		<formula meleeDamage="1.2" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.3" magDefense="1.0" armor="1.3"/>
		<skill fist="1.1" club="1.6" sword="1.8" axe="1.6" distance="1.0" shielding="1.3" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="5" name="Heavy Warrior" description="a heavy warrior" needpremium="1" gaincap="30" gainhp="20" gainmana="7" gainhpticks="12" gainhpamount="6" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="5" lessloss="30">
		<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.0" club="1.8" sword="1.8" axe="1.8" distance="1.0" shielding="1.5" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="6" name="Sniper" description="a sniper" needpremium="1" gaincap="15" gainhp="15" gainmana="17" gainhpticks="12" gainhpamount="5" gainmanaticks="2" gainmanaamount="6" manamultiplier="1.3" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="6" lessloss="30">
		<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.3" club="1.0" sword="1.0" axe="1.0" distance="2.0" shielding="1.3" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="7" name="Shooter" description="a shooter" needpremium="1" gaincap="20" gainhp="15" gainmana="15" gainhpticks="6" gainhpamount="7" gainmanaticks="3" gainmanaamount="4" manamultiplier="1.2" attackspeed="700" soulmax="200" gainsoulticks="15" fromvoc="7" lessloss="30">
		<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.2" club="1.0" sword="1.0" axe="1.0" distance="1.7" shielding="1.3" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="8" name="White Magician" description="a white magician" needpremium="1" gaincap="25" gainhp="10" gainmana="30" gainhpticks="4" gainhpamount="5" gainmanaticks="10" gainmanaamount="8" manamultiplier="1.7" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="8" lessloss="30">
		<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.3" magDamage="1.3" magHealingDamage="1.5" defense="1.0" magDefense="1.0" armor="1.0"/>
		<skill fist="1.1" club="1.0" sword="1.0" axe="1.0" distance="1.3" shielding="1.1" fishing="1.3" experience="1.0"/>
	</vocation>
	<vocation id="9" name="Dark Magician" description="a dark magician" needpremium="0" gaincap="10" gainhp="5" gainmana="35" gainhpticks="12" gainhpamount="3" gainmanaticks="13" gainmanaamount="2" manamultiplier="2.0" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="9" lessloss="50">
		<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.5" magDamage="1.5" magHealingDamage="1.2" defense="1.0" magDefense="1.0" armor="1.0"/>
		<skill fist="1.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.5" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="10" name="Great Knight" description="a great knight" needpremium="0" gaincap="35" gainhp="30" gainmana="8" gainhpticks="12" gainhpamount="11" gainmanaticks="7" gainmanaamount="4" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="10" 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.0" club="2.0" sword="2.0" axe="2.0" distance="1.0" shielding="2.3" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="11" name="Berserker" description="a berserker" needpremium="0" gaincap="30" gainhp="30" gainmana="8" gainhpticks="3" gainhpamount="11" gainmanaticks="2" gainmanaamount="4" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="11" 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.0" club="2.3" sword="2.3" axe="2.3" distance="1.1" shielding="2.0" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="12" name="Elemental Sniper" description="an elemental sniper" needpremium="0" gaincap="25" gainhp="15" gainmana="7" gainhpticks="2" gainhpamount="8" gainmanaticks="6" gainmanaamount="8" manamultiplier="1.6" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="12" lessloss="50">
		<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.4" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
		<skill fist="1.0" club="1.0" sword="1.0" axe="1.0" distance="2.3" shielding="1.1" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="13" name="Sharp Sniper" description="a sharp sniper" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="8" gainmanaticks="6" gainmanaamount="8" manamultiplier="1.3" attackspeed="2000" 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" magDefense="1.0" armor="1.0"/>
		<skill fist="1.0" club="1.0" sword="1.0" axe="1.0" distance="2.8" shielding="1.1" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="14" name="Summoner" description="a summoner" needpremium="0" gaincap="25" gainhp="10" gainmana="30" gainhpticks="2" gainhpamount="5" gainmanaticks="6" gainmanaamount="15" manamultiplier="2.0" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="14" lessloss="50">
		<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.8" magDamage="1.5" magHealingDamage="1.3" defense="1.0" magDefense="1.0" armor="1.0"/>
		<skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="15" name="Spellcaster" description="a spellcaster" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="5" gainmanaticks="6" gainmanaamount="18" manamultiplier="2.4" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="15" lessloss="50">
		<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.8" magDamage="1.8" magHealingDamage="1.3" defense="1.0" magDefense="1.0" armor="1.0"/>
		<skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="16" name="Alchemist" description="an alchemist" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="2.0" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="16" 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.4" shielding="1.1" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="17" name="Biomage" description="a biomage" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="2.0" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="17" 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.4" shielding="1.1" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="18" name="Great Lord" description="a great lord" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="18" 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="2.3" sword="2.3" axe="2.3" distance="1.4" shielding="2.3" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="19" name="Archimage" description="an archimage" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="2.4" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="19" 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.4" shielding="1.1" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="20" name="Dark Assassin" description="a dark assassin" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="1.5" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="20" 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.6" sword="2.0" axe="1.6" distance="1.1" shielding="1.3" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="21" name="Spellknight" description="a spellknight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="1.5" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="21" 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.6" sword="1.8" axe="1.6" distance="1.1" shielding="1.3" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="22" name="Assassin" description="an assassin" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="1.3" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="22" 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.6" sword="2.2" axe="1.6" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="23" name="Elder Sage" description="an elder sage" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="2.0" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="23" 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.4" shielding="1.1" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="24" name="Royal Hunter" description="a royal hunter" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="24" 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.4" shielding="1.1" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="25" name="Master Archer" description="a master archer" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="1.6" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="25" 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.4" shielding="1.1" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="26" name="Hunter" description="a hunter" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="26" 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.4" shielding="1.1" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="27" name="Fast Shooter" description="a fast shooter" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="27" 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.4" shielding="1.1" fishing="1.1" experience="1.0"/>
	</vocation>
</vocations>
 
I done you the archers one, this took me quite some time so i hope you appreciate it. You can copy it and do it yourself for the rest of the branches.

LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid)                          npcHandler:onCreatureAppear(cid)                        end
function onCreatureDisappear(cid)                       npcHandler:onCreatureDisappear(cid)                     end
function onCreatureSay(cid, type, msg)                  npcHandler:onCreatureSay(cid, type, msg)                end
function onThink()                                      npcHandler:onThink()                                    end
function creatureSayCallback(cid, type, msg)
	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	local first = {
		archer = 3
	}
	local second = {
		sniper = 6,
		shooter = 7
	}
	local thirdSniper = {
		sharpSniper = 13,
		elementalSniper = 12
	}
	local thirdShooter = {
		fastShooter = 27,
		hunter = 26
	}
	local final = {
		masterArcher = 25, 
		royalHunter = 24
	}

-- end of config, start of script	
	if(msgcontains(msg, 'first promotion') and getPlayerVocation(cid, first.archer)) == true then
			npcHandler:say("Would you like to be promoted to {sniper} or {shooter}?", cid)
			talkState[talkUser] = 1
		elseif(msgcontains(msg, 'shooter') and talkState[talkUser] == 1) then
			if getPlayerVocation(cid, first.archer) == true then
			npcHandler:say("Would you like to be promoted to {shooter}", cid)
			talkState[talkUser] = 2
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 2) then
			doPlayerSetVocation(cid, second.shooter) 
			npcHandler:say("You have been promoted to {shooter}", cid)
	elseif(msgcontains(msg, 'sniper') and talkState[talkUser] == 1) then
			npcHandler:say("Would you like to be promoted to {sniper}", cid)
			talkState[talkUser] = 3
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 3) then
			doPlayerSetVocation(cid, second.sniper) 
			npcHandler:say("You have been promoted to {sniper}", cid)
	elseif(msgcontains(msg, 'second promotion') and getPlayerVocation(cid, second.sniper)) == true then
	npcHandler:say("Would you like to be promoted to {Sharp sniper} or {elemental sniper}", cid)
			talkState[talkUser] = 4
	elseif(msgcontains(msg, 'sharp sniper') and talkState[talkUser] == 4) then
			if getPlayerVocation(cid, second.sniper) == true then
			npcHandler:say("Would you like to be promoted to {Sharp sniper}", cid)
			talkState[talkUser] = 5
			elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 5) then
			doPlayerSetVocation(cid, thirdSniper.sharpSniper) 
	elseif(msgcontains(msg, 'elemental sniper') and talkState[talkUser] == 4) then
			if getPlayerVocation(cid, second.sniper) == true then
			npcHandler:say("Would you like to be promoted to {Elemental sniper}", cid)
			talkState[talkUser] = 6
			elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 6) then
			doPlayerSetVocation(cid, thirdSniper.elementalSniper)
	elseif(msgcontains(msg, 'second promotion') and getPlayerVocation(cid, second.shooter)) == true then
	npcHandler:say("Would you like to be promoted to {Fast shooter} or {hunter}", cid)
			talkState[talkUser] = 7
	elseif(msgcontains(msg, 'fast shooter') and talkState[talkUser] == 7) then
			if getPlayerVocation(cid, second.shooter) == true then
			npcHandler:say("Would you like to be promoted to {fast shooter}", cid)
			talkState[talkUser] = 8
			elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 8) then
			doPlayerSetVocation(cid, thirdShooter.fastShooter) 
	elseif(msgcontains(msg, 'hunter') and talkState[talkUser] == 7) then
			if getPlayerVocation(cid, second.shooter) == true then
			npcHandler:say("Would you like to be promoted to {hunter}", cid)
			talkState[talkUser] = 9
			elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 9) then
			doPlayerSetVocation(cid, thirdShooter.hunter)
	elseif(msgcontains(msg, 'third promotion') and getPlayerVocation(cid, thirdShooter.fastShooter) or getPlayerVocation(cid, thirdShooter.hunter)) == true then
		npcHandler:say("Would you like to be promoted to {Master archer}", cid)
		talkState[talkUser] = 10
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 10) then
			doPlayerSetVocation(cid, final.masterArcher) 
	elseif(msgcontains(msg, 'third promotion') and getPlayerVocation(cid, thirdSniper.sharpSniper) or getPlayerVocation(cid, thirdSniper.elementalSniper))  == true then
		npcHandler:say("Would you like to be promoted to {Royal hunter}", cid)
		talkState[talkUser] = 11
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 11) then
			doPlayerSetVocation(cid, final.royalHunter) 
	elseif(msgcontains(msg, 'no') and talkState[talkUser] > 0) then
		npcHandler:say("Then not.", cid)
		talkState[talkUser] = 0
	end
	end
	end
	end
	end
	end
	return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Ummmm This is exactly what I want but when I ask to NPC he don't answer :S

Code:
[04/09/2011 17:17:28] [Error - Npc interface] 
[04/09/2011 17:17:28] data/npc/scripts/vocation.lua:onCreatureSay
[04/09/2011 17:17:28] Description: 
[04/09/2011 17:17:28] (internalGetPlayerInfo) Player not found when requesting player info #6

Appears that in console
 
Last edited:
could someone make me an npc.xml for that? I think I need it becouse i doesn't find any error on script but it doesn't works. When I say first promotion he dont tell me nothing. :S and appears that in console.

Code:
[06/09/2011 16:52:23] [Error - Npc interface] 
[06/09/2011 16:52:23] data/npc/scripts/vocation.lua:onCreatureSay
[06/09/2011 16:52:23] Description: 
[06/09/2011 16:52:23] (internalGetPlayerInfo) Player not found when requesting player info #6

HELP
 
Maybe i think on Npc handler on some lib from there becouse i can summon the npc, but when i ask he dont tell me nothing
 
Back
Top