Skip to content

Commit c175aec

Browse files
authored
feat(PlayerMethods): Add Today/Yesterday Kills and Honor Points methods (#364)
1 parent c5efab3 commit c175aec

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

src/LuaEngine/LuaFunctions.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,11 @@ ALERegister<Player> PlayerMethods[] =
489489
{ "GetCompletedQuestsCount", &LuaPlayer::GetCompletedQuestsCount },
490490
{ "GetArenaPoints", &LuaPlayer::GetArenaPoints },
491491
{ "GetHonorPoints", &LuaPlayer::GetHonorPoints },
492+
{ "GetTodayHonorPoints", &LuaPlayer::GetTodayHonorPoints },
493+
{ "GetYesterdayHonorPoints", &LuaPlayer::GetYesterdayHonorPoints },
492494
{ "GetLifetimeKills", &LuaPlayer::GetLifetimeKills },
495+
{ "GetTodayKills", &LuaPlayer::GetTodayKills },
496+
{ "GetYesterdayKills", &LuaPlayer::GetYesterdayKills },
493497
{ "GetPlayerIP", &LuaPlayer::GetPlayerIP },
494498
{ "GetLevelPlayedTime", &LuaPlayer::GetLevelPlayedTime },
495499
{ "GetTotalPlayedTime", &LuaPlayer::GetTotalPlayedTime },

src/LuaEngine/methods/PlayerMethods.h

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,28 @@ namespace LuaPlayer
811811
return 1;
812812
}
813813

814+
/**
815+
* Returns the [Player]s today Honor points.
816+
*
817+
* @return uint32 todayHonorPoints
818+
*/
819+
int GetTodayHonorPoints(lua_State* L, Player* player)
820+
{
821+
ALE::Push(L, player->GetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION));
822+
return 1;
823+
}
824+
825+
/**
826+
* Returns the [Player]s yesterday Honor points.
827+
*
828+
* @return uint32 yesterdayHonorPoints
829+
*/
830+
int GetYesterdayHonorPoints(lua_State* L, Player* player)
831+
{
832+
ALE::Push(L, player->GetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION));
833+
return 1;
834+
}
835+
814836
/**
815837
* Returns the [Player]s current shield block value
816838
*
@@ -1494,6 +1516,28 @@ namespace LuaPlayer
14941516
return 1;
14951517
}
14961518

1519+
/**
1520+
* Returns the [Player]s today Honorable Kills
1521+
*
1522+
* @return uint32 todayKills
1523+
*/
1524+
int GetTodayKills(lua_State* L, Player* player)
1525+
{
1526+
ALE::Push(L, uint32(player->GetUInt16Value(PLAYER_FIELD_KILLS, 0)));
1527+
return 1;
1528+
}
1529+
1530+
/**
1531+
* Returns the [Player]s yesterday Honorable Kills
1532+
*
1533+
* @return uint32 yesterdayKills
1534+
*/
1535+
int GetYesterdayKills(lua_State* L, Player* player)
1536+
{
1537+
ALE::Push(L, uint32(player->GetUInt16Value(PLAYER_FIELD_KILLS, 1)));
1538+
return 1;
1539+
}
1540+
14971541
/**
14981542
* Returns the [Player]s IP address
14991543
*

0 commit comments

Comments
 (0)