mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Add quest add and remove commands and make questcomplete try satisfy the requirements and act like quest complete command. Merge SetLevel and GiveLevel for player methods.
This commit is contained in:
@@ -1431,8 +1431,23 @@ namespace LuaUnit
|
||||
*/
|
||||
int SetLevel(Eluna* /*E*/, lua_State* L, Unit* unit)
|
||||
{
|
||||
uint8 newLevel = Eluna::CHECKVAL<uint8>(L, 2);
|
||||
unit->SetLevel(newLevel);
|
||||
uint8 newlevel = Eluna::CHECKVAL<uint8>(L, 2);
|
||||
|
||||
if (newlevel < 1)
|
||||
return 0;
|
||||
|
||||
if (newlevel > STRONG_MAX_LEVEL)
|
||||
newlevel = STRONG_MAX_LEVEL;
|
||||
|
||||
if (Player* player = unit->ToPlayer())
|
||||
{
|
||||
player->GiveLevel(newlevel);
|
||||
player->InitTalentForLevel();
|
||||
player->SetUInt32Value(PLAYER_XP, 0);
|
||||
}
|
||||
else
|
||||
unit->SetLevel(newlevel);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user