diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2013-09-14 09:07:20 +0200 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2013-09-14 09:07:20 +0200 |
commit | 4f4a517b369443c7b5860265e2a958543fc5a350 (patch) | |
tree | a4c9e0dfe7a8a10c98df1efcf99a843d8cc20f3d /src/scripting | |
parent | 66a98a3a0df795761328d62ef2ad07f81e383f9e (diff) | |
download | manaserv-4f4a517b369443c7b5860265e2a958543fc5a350.tar.gz manaserv-4f4a517b369443c7b5860265e2a958543fc5a350.tar.bz2 manaserv-4f4a517b369443c7b5860265e2a958543fc5a350.tar.xz manaserv-4f4a517b369443c7b5860265e2a958543fc5a350.zip |
Allow to set the kill count again
We later need to check wether we still need this logic or whether we
rather want to remove it in favor of the quest system. But we need this
for sourceoftales for now.
Diffstat (limited to 'src/scripting')
-rw-r--r-- | src/scripting/lua.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp index ad699187..a999744e 100644 --- a/src/scripting/lua.cpp +++ b/src/scripting/lua.cpp @@ -2014,6 +2014,25 @@ static int entity_set_hair_style(lua_State *s) return 0; } +/** LUA entity:increment_kill_count (being) + * entity:increment_kill_count(int monsterId) + * entity:increment_kill_count(string monsterName) + * entity:increment_kill_count(MonsterClass monsterClass) + ** + * Valid only for character entities. + * + * Increments the kill count by one. + */ +static int entity_increment_kill_count(lua_State *s) +{ + + Entity *c = checkCharacter(s, 1); + MonsterClass *monster = checkMonsterClass(s, 2); + + c->getComponent<CharacterComponent>()->incrementKillCount(monster->getId()); + return 0; +} + /** LUA entity:kill_count (being) * entity:kill_count(int monsterId) * entity:kill_count(string monsterName) @@ -3526,6 +3545,7 @@ LuaScript::LuaScript(): { "set_hair_color", entity_set_hair_color }, { "hair_style", entity_get_hair_style }, { "set_hair_style", entity_set_hair_style }, + { "increment_kill_count", entity_increment_kill_count }, { "kill_count", entity_get_kill_count }, { "rights", entity_get_rights }, { "kick", entity_kick }, |