• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

what getVocationInfo(id) returns?

andu

Sold 649 scripts, 25 maps and 9 events!
Joined
Aug 7, 2009
Messages
978
Solutions
17
Reaction score
375
GitHub
olrios
Twitch
jamagowy
what getVocationInfo(id) returns?
name? and?
mana per level too?
 
Solution
Code:
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...
Code:
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;
}

getVocationInfo(id).name returns vocation name, etc
 
Solution
Back
Top