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

System profesji?

marcinek99097

Banned User
Joined
Feb 6, 2010
Messages
588
Reaction score
4
Location
Poland/Dg
Witam , otóż "próbuje" stworzyć serwerek "ala" rpg.
I chodzi mi tu jak stworzyć taki system profesji

Przykład :

1-35 lvl - Druid
36-50 - Elder Druid
51-100 - Mistic Druid

Chciał bym aby to się dostawało automatycznie po przez advence lvl , lub npc , do tego chciał bym załonczyć nowe czary do poszczególnych profesji , jak się do tego zabrać ? a może jakiś gotowiec już jest do editu ?
 
w vocations.xml zrób sobie profesje, w creaturescripts zrób skrypt onAdvance z tabelą, która robi nowego voca, mniej wiecej
LUA:
local t = {
    [36] = 2,
    [51] = 3
}
function onAdvance(cid, skill, oldLevel, newLevel)
    if skill == SKILL__LEVEL and t[newLevel] and getPlayerVocation(cid) < t[newLevel] then
        doPlayerSetVocation(cid, t[newLevel])
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You advanced to " .. getVocationInfo(t[newLevel]).description)
    end
    return true
end

możliwe, że coś pojebałem, to ma Ci wskazać drogę tylko, nie zapomnij o zarejestrowaniu eventu w login.lua.

@EvulMastah
Dzięki, z pośpiechu tego nie zrobiłem :p, serio xd.
 
Last edited:
w vocations.xml zrób sobie profesje, w creaturescripts zrób skrypt onAdvance z tabelą, która robi nowego voca, mniej wiecej
LUA:
function onAdvance(cid, skill, oldLevel, newLevel)
    local t = {
        [36] = 2,
        [51] = 3
    }
    if skill == SKILL__LEVEL and t[newLevel] and getPlayerVocation(cid) < t[newLevel] then
        doPlayerSetVocation(cid, t[newLevel])
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You advanced to " .. getVocationInfo(t[newLevel]).description)
    end
    return true
end

możliwe, że coś pojebałem, to ma Ci wskazać drogę tylko, nie zapomnij o zarejestrowaniu eventu w login.lua.

daj tabele nad funkcje, niezle ramu zaoszczedzisz.
 
Back
Top