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
}
}
if you add those uncommented lines the script will debug your ots <_<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
the vocation i dont know how i can edit it, Knight its right then elite knight and ultra knight where is thier id?
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
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