From b7481331c65a08d54d5e2ae286923627195076ce Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Mon, 26 Oct 2009 21:27:26 +0100 Subject: Added optional optimal level mechanic which reduces exp gain of certain sources after a certain skill level. --- src/scripting/lua.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/scripting/lua.cpp') diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp index fc505eb4..fe777a0c 100644 --- a/src/scripting/lua.cpp +++ b/src/scripting/lua.cpp @@ -1192,7 +1192,12 @@ static int chr_give_exp(lua_State *s) int exp = lua_tointeger(s, 3); - c->receiveExperience(skill, exp); + int optimalLevel = 0; + if (lua_isnumber(s, 4)) + { + optimalLevel = lua_tointeger(s, 4); + } + c->receiveExperience(skill, exp, optimalLevel); return 0; } -- cgit v1.2.3-70-g09d2