Heroid
Active Member
- Joined
- Mar 7, 2011
- Messages
- 330
- Solutions
- 11
- Reaction score
- 34
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local outfits = {
[1] = {male = 145, female = 149}, --
[2] = {male = 725, female = 724}, --
[3] = {male = 129, female = 137}, --
[4] = {male = 131, female = 139}, --
}
local voc = player:getVocation():getId()
local pVoc = getPlayerVocation(player)
local outfit = player:getOutfit()
for k in pairs(outfits) do
if k == pVoc then
if voc <= 8 and voc >= 5 and player:getSex() == PLAYERSEX_FEMALE then
player:addOutfitAddon(outfits[k].female, 2)
player:setOutfit({lookType = outfits[k].female, lookHead = outfit.lookHead, lookBody= outfit.lookBody, lookLegs = outfit.lookLegs, lookFeet= outfit.lookFeet, lookAddons = 2})
item:remove(1)
player:setVocation(voc+4)
player:sendTextMessage(MESSAGE_INFO_DESCR, "You have been promoted to a " .. player:getVocation():getName() .. "!")
player:getPosition():sendMagicEffect(27)
elseif voc >= 5 and voc <= 8 and player:getSex() == PLAYERSEX_MALE then
player:addOutfitAddon(outfits[k].male, 2)
player:setOutfit({lookType = outfits[k].male, lookHead = outfit.lookHead, lookBody= outfit.lookBody, lookLegs = outfit.lookLegs, lookFeet= outfit.lookFeet, lookAddons = 2})
item:remove(1)
player:setVocation(voc+4)
player:sendTextMessage(MESSAGE_INFO_DESCR, "You have been promoted to a " .. player:getVocation():getName() .. "!")
player:getPosition():sendMagicEffect(27)
end
return true
end
end
Nothing happens when I click the item, although if I change
Lua:
elseif voc >= 5 and voc <= 8 and player:getSex() == PLAYERSEX_MALE then
Lua:
elseif voc <= 4 and voc ~= 0 and player:getSex() == PLAYERSEX_MALE then
But if I do it on a Master Sorcerer for example and confirm in database the vocation id is 5, nothing happens.
And I did add new promotions after the normal ones.
TFS 1.2
Last edited: