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

NPC gives proffession

XXXMASTER

New Member
Joined
Jul 13, 2010
Messages
19
Reaction score
0
Heya all i was searching a lot but i did'nt find that npc

ok, so i need npc which can change proffession at lvl 8 , and when u get lvl 20 you can choose one of four next proffesions , and on lvl 50 you can get new promo, and on 90 lvl next promo

example:

player -hi
npc - hello
p -profession
n - are you rly want to be mage?
(you need lvl 8 to get the prof)
p - yes
n- now you are mage
------bye-----

ok now player get the lvl 20


p-hi
n-hi
p- upgrade prof
n- Hi, are you want to be Wizard1 , Wizard2, Wizard3 or Wizard4?
(you need lvl 20)
p- Wizard 3
n- you now the wizard 3
p-bye


ok , now player get the lvl 50

p - hi
n - hi
p - upgrade prof
n - are you rly want to be Archmage3?
p-yes
n- now you are Archmge3 good luck
p- bye



and change next proffesion like up on 90 lvl


Can anyone make it for me? it's very important :)
 
PHP:
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)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
local prom = getPlayerPromotionLevel(cid)
local lvl = getPlayerLevel(cid)
if(msgcontains(msg, 'hi')) then
	selfSay('Hello', cid)
	talkState[talkUser] = 1
if(msgcontains(msg, 'profession')) and (talkState[talkUser] == 1) then
	selfSay('are you rly want to be blablabla', cid)
	talkState[talkUser] = 2
if(msgcontains(msg, 'yes')) and (talkState[talkUser] == 2) then
		if (lvl >= 8) and (prom == 1) then
			setPlayerPromotionLevel(cid, 2)
		elseif (lvl >= 20) (prom == 2) then
			setPlayerPromotionLevel(cid, 3)
		elseif (lvl >= 50) (prom == 3) then
			setPlayerPromotionLevel(cid, 4)
		elseif (lvl >= 90) (prom == 4) then
			setPlayerPromotionLevel(cid, 5)
		else
		selfSay('You don\'t enough lvl or promotion.', cid)
		end
else
	selfSay('What u want?')
	end

return true
end	
	
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

you have to add profesions in vocations.xml
 
i cant choose proffesion in your scirpt :/, look

Player on 8 lvl go to the npc and get the mage [ok]

ok now he is mage and he get the lvl 20 and go again to this npc


-hi
-hello
-proffession
-Are you want to be {Wizard Ice}, {Wizard Fire}, {Wizard death} or {Druid}
(you need lvl 20)
-Wizard Ice
-Wizard ice is mage who uses ice magic bla bla bla, are you rly want to become Wizard Ice?
-yes
-Ok you now the Wizard ice
-bye


ok now player get the lvl 50 at the wizard ice and go again for next proffesion to npc , and he gets "Archmage Ice" and go again on 90 lvl and get "Mega Mage Ice"




but.... when he choose on lvl 20 that he wants to be Wizard Fire, he can on lvl 50 get tthe Archmage Fire and on lvl 90 Mega mage fire. Understand? :) I know its so hard to understand and to make a scirpt but its very important for me :/

take the id of vocations

Mage - 1
Wizard Fire - 11 Archmage Fire -111 Mega mage Fire - 201
Wizard Ice- 10 Archmage Ice - 110 Mega mage ice - 200
Wizard death - 12 Archmage death - 112 mega mage death -202
Druid - 13 next prof druid -113 last prof druid -203

Now the full name of vocations is secret before start my server.
I can give some pacc days or any rare item for person who can make for me that script :)
 
my friend who make server with me , was making Vocations.xml , he did all vocations but he said its bugged or something with "fromvoc". So i need only change vocations not promote them.
 
I would not show my vocation.xml before my server start

Cant you make script using this?
Mage - 1
Wizard Fire - 11 Archmage Fire -111 Mega mage Fire - 201
Wizard Ice- 10 Archmage Ice - 110 Mega mage ice - 200
Wizard death - 12 Archmage death - 112 mega mage death -202
Druid - 13 next prof druid -113 last prof druid -203

if u cant i can send u private msg with vocations :/
 
I hope this work.

PHP:
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)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
local prom = getPlayerPromotionLevel(cid)
local lvl = getPlayerLevel(cid)

	if(msgcontains(msg, 'first profession')) then
		selfSay('I can give you the first proffesion, you will want?', cid)
    talkState[talkUser] = 1
	
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
			if (lvl >= 8) and (prom == 0) then
            setPlayerPromotionLevel(cid, 1) -- YOU WILL BE A MAGE
			talkState[talkUser] = 0
			else
			selfSay('You don\'t have the right level or promotion.', cid)
			talkState[talkUser] = 0
			end
			
	elseif(msgcontains(msg, 'second profession')) then
		selfSay('I can give you the second proffesion, you will want?', cid)
    talkState[talkUser] = 2

	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 2) then	
				if (lvl >= 20) and (prom == 1) then
            setPlayerPromotionLevel(cid, 11) -- YOU WILL BE A WIZARD FIRE 
			talkState[talkUser] = 0
			else
			selfSay('You don\'t have the right level or promotion.', cid)
			talkState[talkUser] = 0
			end
		
	elseif(msgcontains(msg, 'third profession')) then
		selfSay('I can give you the third proffesion, you will want?', cid)
    talkState[talkUser] = 3
	
		elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 3) then	
				if (lvl >= 50) and (prom == 11) then
            setPlayerPromotionLevel(cid, 111) -- YOU WILL BE A  ARCHMAGE FIRE
			talkState[talkUser] = 0
			else
			selfSay('You don\'t have the right level or promotion.', cid)
			talkState[talkUser] = 0
			end	

	elseif(msgcontains(msg, 'fourth profession')) then
		selfSay('I can give you the fourth proffesion, you will want?', cid)
			talkState[talkUser] = 3
	
		elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 3) then	
				if (lvl >= 90) and (prom == 111) then
            setPlayerPromotionLevel(cid, 201) -- YOU WILL BE A  MEGA MAGE FIRE
			talkState[talkUser] = 0
			else
			selfSay('You don\'t have the right level or promotion.', cid)
			talkState[talkUser] = 0
			end
		end
	return true
end    
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Last edited:
In your script i cant choose second proffesion
example

only no vocation can gets new proffesion

lvl 8

p-hi
n-hello
p-Mage
n-are you rly want to be mage?
p-yes
n- ok you are now mage



--------- ok npc gives him first proffesion at lvl 8

now player gets lvl 20 and he is the mage

Only Mages can get next proffession

lvl 20

p-hi
n-hello
p-Proffesion
n-Hello are you want to be Wizard Fire, Wizard Ice , Wizard Death or Druid
p- (example) Wizard Ice
n-Are you really want to be Wizard Ice?
p- yes
n-You are now Wizard Ice


-----------------

Player now gets lvl 50 at Wizard Ice and go again to npc

player must be Wizard Ice

player must be lvl 50


p-h
n-hello
p-Proffesion
n-ahh you are Wizard Ice do you want to be Archmage Ice?
p-yes
n-ok you now Archmage Ice
p-bye


---------
Player gets lvl 90 at Archmage Ice and go again to npc


Player must be Archmage Ice

player must be lvl 90



p-hi
n-hi
p-proffesion
n-Oh you are Archmage Ice, are you want to be Mega Mage ice?
p-yes
n-you are now Mega mage ice
p-bye


---------------------

BUT!!!! WHEN HE CHOOSE ON LVL 20 , that he want be Wizard FIRE , then he on lvl 50 will be archmage FIRE , on lvl 90 MEGA mmage Fire, .... When he choose on lvl 20 Druid then He will be Mega Druid on lvl 50 and Ultra Druid on lvl 90 , and when he choose on lvl 20 that he want be Wizard death then he will be Archmage Death and on lvl 90 Megamage Death

Understand? :) I hope you all understand :D It's very important for me i will rep++++++++++++++ everyone who will help me
 
Back
Top