Sporo czasu zajęło mi tłumaczenie tego z angielskiego, więc mam nadzieję, że się komuś przyda
Będę objaśniać tylko jedną profesję, resztę robicie tak samo jak tę pierwszą.
Najpierw: otwórz vocations.xml, następnie znajdź profesje w nim.
Kod:
<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>
Kod:
<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>
3rd Job
Tylko skopiuj i wklej tego NPC od promocji:
Kod:
<?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>
Kod:
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
if getPlayerVocation(cid) > 8 then
Then-- elseif getPlayerLevel(cid) < 180 then -- napisz tutaj poziom.
Finally -- doPlayerSetVocation(cid, getPlayerVocation(cid)+4)-- tutaj nie zmieniaj nic;]
To wszystko i NPC działa
Jeżeli nic nie rozumiecie z mojego tłumaczenia poprostu skopiujcie to i będzie działać
Objaśnię to:
Vocation ID: 1 Sorcerer
Vocation ID: 2 Druid
Vocation ID: 3 Paladin
Vocation ID: 4 Knight
Wiele ludzi ma problem z tym: "(cid, getPlayerVocation(cid)+4)"
To bardzo łatwe ..(cid)+4) znaczy, że jeżeli masz sorcerera - ID 1 to +4 będzie ID 5, więc master sorcerer. Itd Itd, tak z każdą profesją
Jeśli (.(cid)+4)) byłby 4, ale byłby tym: (cid)+5) voc. id zmieni się jak voc. sorcerera - 1 plus 5(1+5) będzie 6(master sorcerer)
Vocation ID: 5 Master Sorcerer ( pierwsze voc id 1 + (cid, getPlayerVocation(cid)+4) -- 1+4 jest to 5 albo master sorcerer's voc id.
Vocation ID: 6 ElderDruid
Vocation ID: 7 Royal Paladin
Vocation ID: 8 Elite Knight
Teraz weź te 4 voc. tak samo jak te:
Vocation ID: 9 Priest
Vocation ID: 10 Cleric
Vocation ID: 11 Sniper
Vocation ID: 12 Dark Dragon
Pytanie: Czemu voc. ID 9?
Odp: bo jeżeli ms = 5 to + 4 będzie to 9
Pytanie: jak zrobić 4 rodzaj profesji?
Odp: tak samo
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)
Podziękowania dla słownika języka angielskiego
Zakładki