By me i will explain only one vocation. The others you have to do the same. like vocation id 9 the other 10...
First: Open the vocations.xml then search for all vocations inside.
Code :
<vocation id="5" name="Master Sorcerer" description="a master sorcerer" gaincap="60" gainhp="5" gainmana="30" gainhpticks="2" gainhpamount="150" gainmanaticks="2" gainmanaamount="300" gainsoulticks="15" gainsoulamount="1" maxsoul="200" manamultiplier="1.2" attackspeed="450" prevoc="1" basespeed="220">
<diepercent experience="4" magic="4" skill="4" equipment="4" container="100"/>
<formula damage="1.2" defense="1.1" armor="1.1"/>
<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>
Then you have to make your own vocation like that
Code :
<vocation id="9" name="Priest" description="a priest" gaincap="70" gainhp="10" gainmana="35" gainhpticks="2" gainhpamount="150" gainmanaticks="2" gainmanaamount="300" gainsoulticks="15" gainsoulamount="1" maxsoul="300" manamultiplier="1.3" attackspeed="400" prevoc="5" basespeed="320">
<diepercent experience="3" magic="3" skill="3" equipment="3" container="100"/>
<formula damage="1.2" defense="1.2" armor="1.2"/>
<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>
well.. thats is all for the vocation now go with the npc.
NPC 3rd Job
only copy and paste the npc who sell the promotion. like that
Code :
<?xml version="1.0"?>
<npc name="3rd Job" script="data/npc/scripts/promote2.lua" access="3" lookdir="2">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="133" head="114" body="119" legs="132" feet="114"/>
</npc>
Go to scrpits and the file promote.lua and copy too. Changue the name to promote2.lua
Code :
local focus = 0
local talk_start = 0
local target = 0
local days = 0
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hello ' .. creatureGetName(cid) .. '! I sell the 2nd promotions.')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'promotion') or msgcontains(msg, 'promote') then
if getPlayerVocation(cid) > 8 then
selfSay('Sorry, you are already promoted.')
talk_state = 0
elseif getPlayerLevel(cid) < 180 then
selfSay('Sorry, you need level 180 to buy the second promotion.')
talk_state = 0
elseif not getPlayerPremium(cid) then
selfSay('Sorry, you must have the first promotion to buy the second promotion.')
talk_state = 0
else
selfSay('Do you want to buy promotion for 500k?')
talk_state = 1
end
elseif talk_state == 1 then
if msgcontains(msg, 'yes') then
if pay(cid,500000) then
doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
selfSay('You are now promoted!')
else
selfSay('Sorry, you do not have enough money.')
end
end
talk_state = 0
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end
In promote2 the line of -- if getPlayerVocation(cid) > 4 then-- changue the 4 for 8 .
if getPlayerVocation(cid) > 8 then
Then-- elseif getPlayerLevel(cid) < 180 then -- write the lvl here.
Finally -- doPlayerSetVocation(cid, getPlayerVocation(cid)+4)-- here dont changue nothing =).
That is all and the npc is working.
Guyz Sorry for my English im speak spanish and very bad in English.
If dont understand this. only copy that are good Im test it on my
server =)
If any member of otfans can explain it differently and better than it does please.
Thx and good Bye
PD: Im sorry for my English =)
Explain this :
Vocation ID: 1 Sorcerer
Vocation ID: 2 Druid
Vocation ID: 3 Paladin
Vocation ID: 4 Knight
I saw the next page and many ppl have problem with this "(cid, getPlayerVocation(cid)+4)"
that is very easy the ..(cid)+4) means when u make new vocation u have to plus the voc id like sorcerer 1 plus 4 and that is equal to 5 (master sorcerer)
if this (.(cid)+4)) were not 4 and were this .(cid)+5) the voc id changue like voc id sorcerer 1 plus 5 (1+5) equals 6 (master sorcerer)
Vocation ID: 5 Master Sorcerer ( first voc id 1 + (cid, getPlayerVocation(cid)+4) -- 1+4 is equals to 5 or master sorcerer's voc id.
Vocation ID: 6 ElderDruid
Vocation ID: 7 Royal Paladin
Vocation ID: 8 Elite Knight
Now to make your 3rd vocation have to do the same
Vocation ID: 9 Priest
Vocation ID: 10 Cleric
Vocation ID: 11 Sniper
Vocation ID: 12 Dark Dragon
question:
Why vocatio ID: 9? A: Because if u plus 5 (master sorcerer) by 4 is equals to 9 ( Priest ID)
How i can make the 4th vocation?
A: The same
Vocation ID: 9+4=13 Black Demon (voc id 13)
Vocation ID: 10+4=14 Elven Wizard (voc id 14)
Vocation ID: 11+4=15 Hermit (voc id 15)
Vocation ID: 12+4=16 White Chapion (voc id 16)
Credits KrixXx
Only Helping
First: Open the vocations.xml then search for all vocations inside.
Code :
<vocation id="5" name="Master Sorcerer" description="a master sorcerer" gaincap="60" gainhp="5" gainmana="30" gainhpticks="2" gainhpamount="150" gainmanaticks="2" gainmanaamount="300" gainsoulticks="15" gainsoulamount="1" maxsoul="200" manamultiplier="1.2" attackspeed="450" prevoc="1" basespeed="220">
<diepercent experience="4" magic="4" skill="4" equipment="4" container="100"/>
<formula damage="1.2" defense="1.1" armor="1.1"/>
<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>
Then you have to make your own vocation like that
Code :
<vocation id="9" name="Priest" description="a priest" gaincap="70" gainhp="10" gainmana="35" gainhpticks="2" gainhpamount="150" gainmanaticks="2" gainmanaamount="300" gainsoulticks="15" gainsoulamount="1" maxsoul="300" manamultiplier="1.3" attackspeed="400" prevoc="5" basespeed="320">
<diepercent experience="3" magic="3" skill="3" equipment="3" container="100"/>
<formula damage="1.2" defense="1.2" armor="1.2"/>
<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>
well.. thats is all for the vocation now go with the npc.
NPC 3rd Job
only copy and paste the npc who sell the promotion. like that
Code :
<?xml version="1.0"?>
<npc name="3rd Job" script="data/npc/scripts/promote2.lua" access="3" lookdir="2">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="133" head="114" body="119" legs="132" feet="114"/>
</npc>
Go to scrpits and the file promote.lua and copy too. Changue the name to promote2.lua
Code :
local focus = 0
local talk_start = 0
local target = 0
local days = 0
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hello ' .. creatureGetName(cid) .. '! I sell the 2nd promotions.')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'promotion') or msgcontains(msg, 'promote') then
if getPlayerVocation(cid) > 8 then
selfSay('Sorry, you are already promoted.')
talk_state = 0
elseif getPlayerLevel(cid) < 180 then
selfSay('Sorry, you need level 180 to buy the second promotion.')
talk_state = 0
elseif not getPlayerPremium(cid) then
selfSay('Sorry, you must have the first promotion to buy the second promotion.')
talk_state = 0
else
selfSay('Do you want to buy promotion for 500k?')
talk_state = 1
end
elseif talk_state == 1 then
if msgcontains(msg, 'yes') then
if pay(cid,500000) then
doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
selfSay('You are now promoted!')
else
selfSay('Sorry, you do not have enough money.')
end
end
talk_state = 0
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end
In promote2 the line of -- if getPlayerVocation(cid) > 4 then-- changue the 4 for 8 .
if getPlayerVocation(cid) > 8 then
Then-- elseif getPlayerLevel(cid) < 180 then -- write the lvl here.
Finally -- doPlayerSetVocation(cid, getPlayerVocation(cid)+4)-- here dont changue nothing =).
That is all and the npc is working.
Guyz Sorry for my English im speak spanish and very bad in English.
If dont understand this. only copy that are good Im test it on my
server =)
If any member of otfans can explain it differently and better than it does please.
Thx and good Bye
PD: Im sorry for my English =)
Explain this :
Vocation ID: 1 Sorcerer
Vocation ID: 2 Druid
Vocation ID: 3 Paladin
Vocation ID: 4 Knight
I saw the next page and many ppl have problem with this "(cid, getPlayerVocation(cid)+4)"
that is very easy the ..(cid)+4) means when u make new vocation u have to plus the voc id like sorcerer 1 plus 4 and that is equal to 5 (master sorcerer)
if this (.(cid)+4)) were not 4 and were this .(cid)+5) the voc id changue like voc id sorcerer 1 plus 5 (1+5) equals 6 (master sorcerer)
Vocation ID: 5 Master Sorcerer ( first voc id 1 + (cid, getPlayerVocation(cid)+4) -- 1+4 is equals to 5 or master sorcerer's voc id.
Vocation ID: 6 ElderDruid
Vocation ID: 7 Royal Paladin
Vocation ID: 8 Elite Knight
Now to make your 3rd vocation have to do the same
Vocation ID: 9 Priest
Vocation ID: 10 Cleric
Vocation ID: 11 Sniper
Vocation ID: 12 Dark Dragon
question:
Why vocatio ID: 9? A: Because if u plus 5 (master sorcerer) by 4 is equals to 9 ( Priest ID)
How i can make the 4th vocation?
A: The same
Vocation ID: 9+4=13 Black Demon (voc id 13)
Vocation ID: 10+4=14 Elven Wizard (voc id 14)
Vocation ID: 11+4=15 Hermit (voc id 15)
Vocation ID: 12+4=16 White Chapion (voc id 16)
Credits KrixXx
Only Helping
Last edited: