This is on TFS 1.1. Got a vocation specific outfit colors script working through events/scripts/creature.lua with other parts in login and logout but this part I have a problem with when players change their outfit color on something that isn't allowed it won't accept the color but then it bugs the mount so you can't use it until you relog. Wondering if there is maybe a function that could totally cancel the function so it would set to the previous outfit choices(which is what i have in login and logout)?
Code:
function Creature:onChangeOutfit(outfit)
local VOC_WATER = {9,10,11,12,25,26,27,28}
local VOC_EARTH = {13,14,15,16,29,30,31,32}
local VOC_AIR = {5,6,7,8,21,22,23,24}
local VOC_FIRE = {1,2,3,4,17,18,19,20}
local outp = {outfit.lookFeet, outfit.lookLegs, outfit.lookBody, outfit.lookHead, outfit.lookMount}
if self == nil then
return true
end
if self:isPlayer() then
if isInArray(VOC_WATER, self:getVocation():getId()) then
if outp[1] ~= 68 or outp[2] ~= 0 or outp[3] ~= 68 or outp[4] ~= outfit.lookHead or outp[5] ~= outfit.lookMount then
return false
end
end
end
if self:isPlayer() then
if isInArray(VOC_EARTH, self:getVocation():getId()) then
if outp[1] ~= 119 or outp[2] ~= 59 or outp[3] ~= 119 or outp[4] ~= outfit.lookHead or outp[5] ~= outfit.lookMount then
return false
end
end
end
if self:isPlayer() then
if isInArray(VOC_AIR, self:getVocation():getId()) then
if outp[1] ~= 79 or outp[2] ~= 77 or outp[3] ~= 77 or outp[4] ~= outfit.lookHead or outp[5] ~= outfit.lookMount then
return false
end
end
end
if self:isPlayer() then
if isInArray(VOC_FIRE, self:getVocation():getId()) then
if outp[1] ~= 132 or outp[2] ~= 114 or outp[3] ~= 132 or outp[4] ~= outfit.lookHead or outp[5] ~= outfit.lookMount then
return false
end
end
end
return true
end