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

Theard Closed! Remove Theard!

Status
Not open for further replies.

pokeot

New Member
Joined
Oct 8, 2010
Messages
69
Reaction score
1
I need promotion by clicking on a item!

Promotion = Level
Promotion = You have been promoted to a ...vocname...
Promotion = You are alredy promoted!
Promotion = Promotion Knight = voc 4 to voc 8 if you have more voc then voc 12!
Promotion = Knight = Elite Knight = Ultimate Knight! you need level 20 to elite knight level 40 to ultimate knight!

You get a message, you have reach level 20 now you can use promotion

Rep+++
Please comment if you dont understand!
 
Last edited:
LUA:
local setup = {vocation = 4,promo1 = 1,promo2 = 2,level1 = 20,level2 = 40}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerVocation(cid) ~= setup.vocation then
        doPlayerSendCancel(cid, 'You need to be a knight in order to use this item.')
        return true
    end
 
    if getPlayerPromotionLevel(cid) >= setup.promo2 then
        doPlayerSendCancel(cid, 'You can\'t get more promotions.')
        return true
    end
 
    if getPlayerPromotionLevel(cid) < setup.promo1 then
        if getPlayerLevel(cid) < setup.level1 then
            doPlayerSendCancel(cid, 'You need to be at least level '..setup.level1..' to be promoted.')
            return true
        else
            doRemoveItem(item.uid, 1)
            doPlayerSetPromotionLevel(cid, setup.promo1)
            doSendMagicEffect(fromPosition, CONST_ME_FIREWORK_YELLOW)
            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have been promoted to '..getPlayerVocationName(cid)..'!!')
            doPlayerSave(cid)
        end
    elseif getPlayerPromotionLevel(cid) > setup.promo1 then
        if getPlayerLevel(cid) < setup.level2 then
            doPlayerSendCancel(cid, 'You need to be at least level '..setup.level2..' to be promoted.')
            return true
        else
            doRemoveItem(item.uid, 1)
            doPlayerSetPromotionLevel(cid, setup.promo2)
            doSendMagicEffect(fromPosition, CONST_ME_FIREWORK_YELLOW)
            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have been promoted to '..getPlayerVocationName(cid)..'!!')
            doPlayerSave(cid)
        end
    end
    return true
end
 
local setup = {vocation = 4,promo1 = 1,promo2 = 2,level1 = 20,level2 = 40}

its hard to understand please explain it
 
ok first of all, this script works only for 0.3/0.4 distros

vocation > script will only work for player who has that vocation(in this case it's knight)
promo1 = 1st promotion level or first promotion of knight(Elite Knight)
promo2 = 2nd promotion level or second promotion of knight(Ultimate Knight)
level1 = required level for first promotion
level2 = required level for second promotion
 
Status
Not open for further replies.
Back
Top