Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config.maxLevel for NPC #690

Open
anatoliy-savchak opened this issue Jul 25, 2022 · 2 comments
Open

config.maxLevel for NPC #690

anatoliy-savchak opened this issue Jul 25, 2022 · 2 comments

Comments

@anatoliy-savchak
Copy link
Contributor

anatoliy-savchak commented Jul 25, 2022

My NPC in KoTS Commander Karef failed to be configured to level 20, as the check won't allow him.
npc.make_class(toee.stat_level_fighter, 20) # 20 is max

python_object.cpp:

static PyObject * PyObjHandle_MakeClass(PyObject* obj, PyObject* args) {
	auto self = GetSelf(obj);
	int level;
	Stat statClass = stat_level_barbarian;
	if (!PyArg_ParseTuple(args, "ii", &statClass, &level)) {
		return nullptr;
	}

	if (level <= 0 || (uint32_t) level > config.maxLevel){
		return PyInt_FromLong(0);
	}

I think this limit should be applied to PC only. But let NPC to be as designed.

@DudeMcDude
Copy link
Contributor

Heh, it's just an ancient cheat code I used to test high level features. I think it's harmless to set the upper bound to 30 or something like that (I guess the limit would be XPTABLE_MAXLEVEL-3).
Note that the code is simple enough that you could do it in python anyway...

@anatoliy-savchak
Copy link
Contributor Author

"Note that the code is simple enough that you could do it in python anyway..." - sure. I just accidently caught that.

Default value btw is 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants