Eluna Classic Support for Honor things (GetHonorStoredKills, GetRankPoints, GetHonorLastWeekStandingPos, SetHonorStoredKills, SetRankPoints, SetHonorLastWeekStandingPos, UpdateHonor, ResetHonor, ClearHonorInfo)

This commit is contained in:
Salja
2014-03-23 22:50:28 +02:00
committed by Foereaper
parent 3b8d4cbc02
commit f07521a1aa
2 changed files with 84 additions and 0 deletions

View File

@@ -163,6 +163,28 @@ namespace LuaPlayer
}
#endif
#ifdef CLASSIC
int GetHonorStoredKills(lua_State* L, Player* player)
{
bool honorable = sEluna->CHECKVAL<bool>(L, 2, true);
sEluna->Push(L, player->GetHonorStoredKills(honorable));
return 0;
}
int GetRankPoints(lua_State* L, Player* player)
{
sEluna->Push(L, player->GetRankPoints());
return 1;
}
int GetHonorLastWeekStandingPos(lua_State* L, Player* player)
{
sEluna->Push(L, player->GetHonorLastWeekStandingPos());
return 1;
}
#endif
int IsInWater(lua_State* L, Player* player)
{
sEluna->Push(L, player->IsInWater());
@@ -175,6 +197,26 @@ namespace LuaPlayer
return 1;
}
#ifdef CLASSIC
int UpdateHonor(lua_State* L, Player* player)
{
player->UpdateHonor();
return 0;
}
int ResetHonor(lua_State* L, Player* player)
{
player->ResetHonor();
return 0;
}
int ClearHonorInfo(lua_State* L, Player* player)
{
player->ClearHonorInfo();
return 0;
}
#endif
#ifndef CLASSIC
int IsFlying(lua_State* L, Player* player) // enable for unit when mangos support it
{
@@ -1177,6 +1219,33 @@ namespace LuaPlayer
#endif
#endif
#ifdef CLASSIC
int SetHonorStoredKills(lua_State* L, Player* player)
{
uint32 kills = sEluna->CHECKVAL<uint32>(L, 2);
bool honorable = sEluna->CHECKVAL<bool>(L, 3, true);
player->SetHonorStoredKills(kills, honorable);
return 0;
}
int SetRankPoints(lua_State* L, Player* player)
{
float rankPoints = sEluna->CHECKVAL<float>(L, 2);
player->SetRankPoints(rankPoints);
return 0;
}
int SetHonorLastWeekStandingPos(lua_State* L, Player* player)
{
int32 standingPos = sEluna->CHECKVAL<int32>(L, 2);
player->SetHonorLastWeekStandingPos(standingPos);
return 0;
}
#endif
int SetLifetimeKills(lua_State* L, Player* player)
{
uint32 val = sEluna->CHECKVAL<uint32>(L, 2);