finish knight melee damage calculation todo hits with paladin

This commit is contained in:
ErikasKontenis
2020-10-14 22:42:42 +03:00
parent 8de51cb8ea
commit b0b93edcb4
4 changed files with 169 additions and 0 deletions

View File

@@ -1684,6 +1684,9 @@ void LuaScriptInterface::registerFunctions()
registerEnumIn("configKeys", ConfigManager::BLOCK_HEIGHT)
registerEnumIn("configKeys", ConfigManager::DROP_ITEMS)
registerEnumIn("configKeys", ConfigManager::CLIENT_VERSION)
// random
registerMethod("os", "rand", LuaScriptInterface::luaRandomRand);
// os
registerMethod("os", "mtime", LuaScriptInterface::luaSystemTime);
@@ -2348,6 +2351,7 @@ void LuaScriptInterface::registerFunctions()
registerMethod("MonsterType", "getMaxSummons", LuaScriptInterface::luaMonsterTypeGetMaxSummons);
registerMethod("MonsterType", "getArmor", LuaScriptInterface::luaMonsterTypeGetArmor);
registerMethod("MonsterType", "getSkill", LuaScriptInterface::luaMonsterTypeGetSkill);
registerMethod("MonsterType", "getDefense", LuaScriptInterface::luaMonsterTypeGetDefense);
registerMethod("MonsterType", "getOutfit", LuaScriptInterface::luaMonsterTypeGetOutfit);
registerMethod("MonsterType", "getRace", LuaScriptInterface::luaMonsterTypeGetRace);
@@ -3888,6 +3892,14 @@ int LuaScriptInterface::luaRawGetMetatable(lua_State* L)
return 1;
}
// random
int LuaScriptInterface::luaRandomRand(lua_State* L)
{
// random.rand()
lua_pushnumber(L, rand());
return 1;
}
// os
int LuaScriptInterface::luaSystemTime(lua_State* L)
{
@@ -11225,6 +11237,19 @@ int LuaScriptInterface::luaMonsterTypeGetArmor(lua_State* L)
return 1;
}
int LuaScriptInterface::luaMonsterTypeGetSkill(lua_State* L)
{
// monsterType:getSkill()
MonsterType* monsterType = getUserdata<MonsterType>(L, 1);
if (monsterType) {
lua_pushnumber(L, monsterType->info.skill);
}
else {
lua_pushnil(L);
}
return 1;
}
int LuaScriptInterface::luaMonsterTypeGetDefense(lua_State* L)
{
// monsterType:getDefense()

View File

@@ -520,6 +520,9 @@ class LuaScriptInterface
static int luaIsType(lua_State* L);
static int luaRawGetMetatable(lua_State* L);
// random
static int luaRandomRand(lua_State* L);
// os
static int luaSystemTime(lua_State* L);
@@ -1161,6 +1164,7 @@ class LuaScriptInterface
static int luaMonsterTypeGetMaxSummons(lua_State* L);
static int luaMonsterTypeGetArmor(lua_State* L);
static int luaMonsterTypeGetSkill(lua_State* L);
static int luaMonsterTypeGetDefense(lua_State* L);
static int luaMonsterTypeGetOutfit(lua_State* L);
static int luaMonsterTypeGetRace(lua_State* L);