summaryrefslogtreecommitdiff
path: root/src/scripting/lua.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <crush@themanaworld.org>2009-10-26 21:27:26 +0100
committerPhilipp Sehmisch <crush@themanaworld.org>2009-10-26 21:28:18 +0100
commitb7481331c65a08d54d5e2ae286923627195076ce (patch)
tree62e9a7391f074913652d8d2dedc1cdc28cb53124 /src/scripting/lua.cpp
parentecefeb60244e6ad9c5d043f8bdf086ac89889b9e (diff)
downloadmanaserv-b7481331c65a08d54d5e2ae286923627195076ce.tar.gz
manaserv-b7481331c65a08d54d5e2ae286923627195076ce.tar.bz2
manaserv-b7481331c65a08d54d5e2ae286923627195076ce.tar.xz
manaserv-b7481331c65a08d54d5e2ae286923627195076ce.zip
Added optional optimal level mechanic which reduces exp gain of certain sources after a certain skill level.
Diffstat (limited to 'src/scripting/lua.cpp')
-rw-r--r--src/scripting/lua.cpp7
1 files changed, 6 insertions, 1 deletions
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;
}