Exemple #1
0
static int tolua_faction_renumber(lua_State * L)
{
    faction *self = (faction *)tolua_tousertype(L, 1, 0);
    int no = (int)tolua_tonumber(L, 2, 0);

    renumber_faction(self, no);
    return 0;
}
Exemple #2
0
faction *get_or_create_monsters(void)
{
    faction *f = findfaction(MONSTER_ID);
    if (!f) {
        const race *rc = rc_get_or_create("dragon");
        const char *email = config_get("monster.email");
        f = addfaction(email, NULL, rc, default_locale);
        renumber_faction(f, MONSTER_ID);
        faction_setname(f, "Monster");
        fset(f, FFL_NPC | FFL_NOIDLEOUT);
    }
    return f;
}
Exemple #3
0
static int tolua_faction_set_id(lua_State * L)
{
    faction *self = (faction *)tolua_tousertype(L, 1, 0);
    int id = (int)tolua_tonumber(L, 2, 0);
    if (findfaction(id) == NULL) {
        renumber_faction(self, id);
        lua_pushboolean(L, 1);
    }
    else {
        lua_pushboolean(L, 0);
    }
    return 1;
}
Exemple #4
0
faction *get_or_create_monsters(void)
{
    faction *f = findfaction(MONSTER_ID);
    if (!f) {
        const race *rc = rc_get_or_create("dragon");
        const char *email = get_param(global.parameters, "monster.email");
        f = addfaction(email ? email : "*****@*****.**", NULL, rc, default_locale, 0);
        renumber_faction(f, MONSTER_ID);
        faction_setname(f, "Monster");
        fset(f, FFL_NPC | FFL_NOIDLEOUT);
    }
    return f;
}