int32_t LuaScriptInterface::luaGetVocationInfo(lua_State* L)
{
//getVocationInfo(id)
uint32_t id = popNumber(L);
Vocation* voc = Vocations::getInstance()->getVocation(id);
if(!voc)
{
lua_pushboolean(L, false);
return 1;
}
lua_newtable(L);
setField(L, "id", voc->getId());
setField(L, "name", voc->getName().c_str());
setField(L, "description", voc->getDescription().c_str());
setField(L, "healthGain", voc->getGain(GAIN_HEALTH));
setField(L, "healthGainTicks", voc->getGainTicks(GAIN_HEALTH));
setField(L, "healthGainAmount", voc->getGainAmount(GAIN_HEALTH));
setField(L, "manaGain", voc->getGain(GAIN_MANA));
setField(L, "manaGainTicks", voc->getGainTicks(GAIN_MANA));
setField(L, "manaGainAmount", voc->getGainAmount(GAIN_MANA));
setField(L, "attackSpeed", voc->getAttackSpeed());
setField(L, "baseSpeed", voc->getBaseSpeed());
setField(L, "fromVocation", voc->getFromVocation());
setField(L, "promotedVocation", Vocations::getInstance()->getPromotedVocation(id));
setField(L, "soul", voc->getGain(GAIN_SOUL));
setField(L, "soulAmount", voc->getGainAmount(GAIN_SOUL));
setField(L, "soulTicks", voc->getGainTicks(GAIN_SOUL));
setField(L, "capacity", voc->getGainCap());
setFieldBool(L, "attackable", voc->isAttackable());
setFieldBool(L, "needPremium", voc->isPremiumNeeded());
setFieldFloat(L, "experienceMultiplier", voc->getExperienceMultiplier());
return 1;
}