function checkPartyForAllVocations(player)
local arrays = {
[1] = {1, 5}, --sorcerer
[2] = {2, 6}, --druid
[3] = {3, 7}, --paladin
[4] = {4, 8} --knight
}
local sorcerer, druid, paladin, knight = 0, 0, 0, 0
--CHECK MC--
local ipList = {}
local party = player:getParty()
for i = 1, #party do
local tmpPlayer = party[i]
local ip = tmpPlayer:getIp()
if ip ~= 0 then
local list = ipList[ip]
if not list then
ipList[ip] = {}
list = ipList[ip]
end
list[#list + 1] = tmpPlayer
end
end
for ip, list in pairs(ipList) do
local listLength = #list
if listLength > 1 then
for i = 2, listLength do
tmpPlayer = list[i]
if isInArray(arrays[1], tmpPlayer[i]:getVocation():getId()) and sorcerer < 0 then
sorcerer = sorcerer - 1
elseif isInArray(arrays[2], tmpPlayer[i]:getVocation():getId()) and druid < 0 then
druid = druid - 1
elseif isInArray(arrays[3], tmpPlayer[i]:getVocation():getId()) and paladin < 0 then
paladin = paladin - 1
elseif isInArray(arrays[4], tmpPlayer[i]:getVocation():getId()) and knight < 0 then
knight = knight - 1
end
end
end
end
local sorcerer, druid, paladin, knight = 0, 0, 0, 0
--CHECK VOCATIONS--
if isInArray(arrays[1], player:getVocation():getId()) then
sorcerer = sorcerer + 1
elseif isInArray(arrays[2], player:getVocation():getId()) then
druid = druid + 1
elseif isInArray(arrays[3], player:getVocation():getId()) then
paladin = paladin + 1
elseif isInArray(arrays[4], player:getVocation():getId()) then
knight = knight + 1
end
for i = 1, #party do
if isInArray(arrays[1], party[i]:getVocation():getId()) and sorcerer < 0 then
sorcerer = sorcerer + 1
elseif isInArray(arrays[2], party[i]:getVocation():getId()) and druid < 0 then
druid = druid + 1
elseif isInArray(arrays[3], party[i]:getVocation():getId()) and paladin < 0 then
paladin = paladin + 1
elseif isInArray(arrays[4], party[i]:getVocation():getId()) and knight < 0 then
knight = knight + 1
end
end
if sorcerer > 0 and druid > 0 and paladin > 0 and knight > 0 then
return true
else
return false
end
end