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

Close Theard, Remove Theard!

Status
Not open for further replies.

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,780
Solutions
31
Reaction score
2,299
Location
Sweden?
Close Theard, Remove Theard!
 
Last edited:
<_< at setup, obviously

level1 = required minimum level for 1st promotion
level2 = required minimum level for 2nd promotion
outfit1 = outfit that player will get at 1st promotion
outfit2 = outfit that player will get at 2nd promotion
weapon1 = required weapon for 1st promotion
weapon2 = required weapon for 2nd promotion
weapon3 = weapon you get at 2nd promotion

LUA:
local setup = {
    [1] = { --sorc
        level1 = 20,   --req level for 1st promo 
        level2 = 40,   --req level for 2nd promo
        outfit1 = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
        outfit2 = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
        weapon1 = 2392, --1st req wep(no promo)
        weapon2 = 2400, --2nd req wep(1st promo)
        weapon3 = 2390 --3rd wep(2nd promo)
    },
    [4] = { --knight
        level1 = 20,
        level2 = 40,
        outfit1 = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
        outfit2 = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
        weapon1 = 2392, --firesword 
        weapon2 = 2400, --magicsword
        weapon3 = 2390 --magiclongsword
    }
}
 
You should edit this like this, everything its right only the vocation edit is the problem: if you can do it like i writed then its PERFECT!

local setup = {
[4] = { --knight - first promotion
level1 = 20, - Voc 8 - elite knight
level2 = 40, - Voc 12 - ultra knight
outfit1 = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0}, - ELITE KNIGHT
outfit2 = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0}, - ULTRA KNIGHT
weapon1 = 2392, --firesword - KNIGHT
weapon2 = 2400, --magicsword - ELITE KNIGHT
weapon3 = 2390 --magiclongsword - ULTRA KNIGHT
 
You should edit this like this, everything its right only the vocation edit is the problem: if you can do it like i writed then its PERFECT!

local setup = {
[4] = { --knight - first promotion
level1 = 20, - Voc 8 - elite knight
level2 = 40, - Voc 12 - ultra knight

outfit1 = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0}, - ELITE KNIGHT
outfit2 = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0}, - ULTRA KNIGHT
weapon1 = 2392, --firesword - KNIGHT
weapon2 = 2400, --magicsword - ELITE KNIGHT
weapon3 = 2390 --magiclongsword - ULTRA KNIGHT
if you add those uncommented lines the script will debug your ots <_<

and I added info at the script so you knew what was each line for <_< this can be understood by simple common sense too, I thought I hadn't have to explain you everything <_<
 
the vocation i dont know how i can edit it, Knight its right then elite knight and ultra knight where is thier id?
 
the vocation i dont know how i can edit it, Knight its right then elite knight and ultra knight where is thier id?

I already told you that at TFS 0.3/4 promoted vocations change their promotion level instead of vocation ID like in 0.2
 
on tfs 0.3.6 where it it 0.2 i saw this on lib should i edit there?:

function isKnight(cid)
return isInArray({4, 8}, getPlayerVocation(cid))
end

function isRookie(cid)
return isInArray({0}, getPlayerVocation(cid))
end
 
I dont have TFS 0.3/4, i use tfs 0.3.6 so i dont understand about vocation editing
 
You should post here a vocation evolution chart here so I can understand this better
what about this one?
LUA:
local setup = {
    --[[
    [0] = { <- vocation ID number
        level = 20, --required minimum level to obtain promotion
        outfit = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
        oldWeapon = 2392, --required weapon to obtain promotion
        newWeapon = 2400, --weapon you get after promotion
    },]]
    [1] = { --sorcerer
        level = 20, 
        outfit = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
        oldWeapon = 2392,
        newWeapon = 2400
    },
    [4] = { --knight
        level = 20, 
        outfit = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
        oldWeapon = 2392, 
        newWeapon = 2400
    },
    [6] = { --dark sorcerer/first sorcerer promotion
        level = 40, 
        outfit = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
        oldWeapon = 2392, 
        newWeapon = 2400
    },
    [8] = { --elite knight
        level = 40, 
        outfit = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
        oldWeapon = 2392, 
        newWeapon = 2400
    },
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local scroll = setup[getPlayerVocation(cid)]
    
    if not scroll then
        doPlayerSendCancel(cid, 'You do not have the required vocation.')
        return true
    end
 
    if getPlayerPromotionLevel(cid) >= 2 then
        doPlayerSendCancel(cid, 'You can\'t get more promotions.')
        return true
    end
 
    if getPlayerLevel(cid) < scroll.level then
        doPlayerSendCancel(cid, 'You need to be at least level '..scroll.level..' in order to be promoted.')
        return true
    end
 
    if getPlayerItemCount(cid, scroll.oldWeapon) == 1 then
        doTransformItem(getPlayerItemById(cid, true, scroll.oldWeapon).uid, scroll.newWeapon)
    else
        doPlayerSendCancel(cid, 'You need only 1 '.. getItemNameById(scroll.oldWeapon)..' to be promoted.')
        return true
    end
 
    if scroll.outfit then
        doCreatureChangeOutfit(cid, scroll.outfit)
    end
 
    doRemoveItem(item.uid, 1)
    doPlayerSetPromotionLevel(cid, getPlayerPromotionLevel(cid) == 0 and 1 or 2)
    doSendMagicEffect(fromPosition, CONST_ME_FIREWORK_YELLOW)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have just been promoted to '..getPlayerVocationName(cid)..'!!')
    doPlayerSave(cid)
    return true
end
 
nice!!! now i understand better Thx!!!!!

when you click on the scroll, its come nothing, You cannot use this object.

[15/11/2010 16:22:49] [Error - LuaScriptInterface::loadFile] data/actions/scripts/promo.lua:12: unexpected symbol near ','
[15/11/2010 16:22:49] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/promo.lua)
[15/11/2010 16:22:49] data/actions/scripts/promo.lua:12: unexpected symbol near ','
 
Last edited by a moderator:
oh it fixed thx

When i click its write you got promoted from ninja to Super Ninja then i click again i want to be promoted to ultra ninja its write you have been promoted to !!, then i got no vocation

This is my vocation!

ID 1: Ninja
ID 2: Super Ninja
ID 3: Ultra Ninja

ID 4: Assassin
ID 5: Super Assasin
ID 6: Ultra Assasin
 
Last edited by a moderator:
try this new one then, not based in promotion levels
LUA:
local setup = {
    --[[
    [0] = { <- vocation ID number
        level = 20, --required minimum level to obtain promotion
        outfit = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
        oldWeapon = 2392, --required weapon to obtain promotion
        newWeapon = 2400, --weapon you get after promotion
        newVocation = 2, --new vocation's ID that the player is promoted to
    },]]
    [1] = { --ninja
        level = 20, 
        outfit = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
        oldWeapon = 2392,
        newWeapon = 2400,
        newVocation = 2
    },
    [2] = { --super ninja
        level = 20, 
        outfit = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
        oldWeapon = 2392, 
        newWeapon = 2400,
        newVocation = 3
    },
    [4] = { --Assasin
        level = 20, 
        outfit = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
        oldWeapon = 2392,
        newWeapon = 2400,
        newVocation = 5
    },
    [5] = { --Super Assassin
        level = 20, 
        outfit = {lookType=123,lookHead=0,lookAddons=0,lookLegs=0,lookBody=0,lookFeet=0},
        oldWeapon = 2392, 
        newWeapon = 2400,
        newVocation = 6
    },
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local scroll = setup[getPlayerVocation(cid)]
 
    if not scroll then
        doPlayerSendCancel(cid, 'You do not have the required vocation.')
        return true
    end
  
    if getPlayerLevel(cid) < scroll.level then
        doPlayerSendCancel(cid, 'You need to be at least level '..scroll.level..' in order to be promoted.')
        return true
    end
 
    if getPlayerItemCount(cid, scroll.oldWeapon) == 1 then
        doTransformItem(getPlayerItemById(cid, true, scroll.oldWeapon).uid, scroll.newWeapon)
    else
        doPlayerSendCancel(cid, 'You need only 1 '.. getItemNameById(scroll.oldWeapon)..' in order to be promoted.')
        return true
    end
 
    if scroll.outfit then
        doCreatureChangeOutfit(cid, scroll.outfit)
    end
 
    doRemoveItem(item.uid, 1)
    doPlayerSetVocation(cid, scroll.newVocation)
    doSendMagicEffect(fromPosition, CONST_ME_FIREWORK_YELLOW)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have just been promoted to '..getPlayerVocationName(cid)..'!!')
    doPlayerSave(cid)
    return true
end
 
thx you very much!!! now it 100% work!!

Close Theard, Remove Theard!
 
Status
Not open for further replies.
Back
Top