Take all of this and set it outside of onLogin
Lua:
local manashield = Condition(CONDITION_MANASHIELD)
manashield:setTicks(-1)
Then inside of onLogin you place something like this.
Lua:
if isInArray({1}, player:getVocation():getId()) then
player:addCondition(manashield)
end
That {1} is a table, place all the vocation id's you want to have manashield when they login, for instance if i wanted a sorcerer and druid I would set the table to.
Lua:
if isInArray({1, 2}, player:getVocation():getId()) then
player:addCondition(manashield)
end