Core/Scripts: Added script hook to execute actions after completing an achievement

Port From (https://github.com/TrinityCore/TrinityCore/commit/27cba3f52309dad5be964fec11d80cd8cad128cf)
This commit is contained in:
hondacrx
2022-05-05 13:53:23 -04:00
parent add1e659bf
commit db6cfeca04
5 changed files with 92 additions and 3 deletions
+25 -1
View File
@@ -20,6 +20,7 @@ using Game.BattleGrounds;
using Game.BattleGrounds.Zones;
using Game.Entities;
using Game.Scripting;
using Game.DataStorage;
namespace Scripts.World.Achievements
{
@@ -43,7 +44,7 @@ namespace Scripts.World.Achievements
}
struct VehicleIds
{
{
//BgSA Artillery
public const uint AntiPersonnalCannon = 27894;
}
@@ -310,4 +311,27 @@ namespace Scripts.World.Achievements
return target && player.IsHonorOrXPTarget(target);
}
}
[Script] // 7433 - Newbie
class achievement_newbie : AchievementScript
{
public achievement_newbie() : base("achievement_newbie") { }
public override void OnCompleted(Player player, AchievementRecord achievement)
{
player.GetSession().GetBattlePetMgr().UnlockSlot(BattlePetSlots.Slot1);
// TODO: Unlock trap
}
}
[Script] // 6566 - Just a Pup
class achievement_just_a_pup : AchievementScript
{
public achievement_just_a_pup() : base("achievement_just_a_pup") { }
public override void OnCompleted(Player player, AchievementRecord achievement)
{
player.GetSession().GetBattlePetMgr().UnlockSlot(BattlePetSlots.Slot2);
}
}
}