mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Merge pull request #324 from iThorgrim-Hub/master
Add SetAchievement to Eluna
This commit is contained in:
@@ -600,6 +600,7 @@ ElunaRegister<Player> PlayerMethods[] =
|
|||||||
// {"HasPendingBind", &LuaPlayer::HasPendingBind}, // :HasPendingBind() - UNDOCUMENTED - Returns true if the player has a pending instance bind
|
// {"HasPendingBind", &LuaPlayer::HasPendingBind}, // :HasPendingBind() - UNDOCUMENTED - Returns true if the player has a pending instance bind
|
||||||
#if (!defined(TBC) && !defined(CLASSIC))
|
#if (!defined(TBC) && !defined(CLASSIC))
|
||||||
{ "HasAchieved", &LuaPlayer::HasAchieved },
|
{ "HasAchieved", &LuaPlayer::HasAchieved },
|
||||||
|
{ "SetAchievement", &LuaPlayer::SetAchievement },
|
||||||
#endif
|
#endif
|
||||||
{ "CanUninviteFromGroup", &LuaPlayer::CanUninviteFromGroup },
|
{ "CanUninviteFromGroup", &LuaPlayer::CanUninviteFromGroup },
|
||||||
{ "IsRested", &LuaPlayer::IsRested },
|
{ "IsRested", &LuaPlayer::IsRested },
|
||||||
|
|||||||
@@ -2057,6 +2057,22 @@ namespace LuaPlayer
|
|||||||
player->SetTitle(t, false);
|
player->SetTitle(t, false);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the specified achievement to the [Player]s
|
||||||
|
*
|
||||||
|
* @param uint32 achievementid
|
||||||
|
*/
|
||||||
|
int SetAchievement(lua_State* L, Player* player)
|
||||||
|
{
|
||||||
|
uint32 id = Eluna::CHECKVAL<uint32>(L, 2);
|
||||||
|
AchievementEntry const* t = sAchievementStore.LookupEntry(id);
|
||||||
|
if (t)
|
||||||
|
player->CompletedAchievement(t);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined TRINITY && !AZEROTHCORE
|
#if !defined TRINITY && !AZEROTHCORE
|
||||||
|
|||||||
Reference in New Issue
Block a user