mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Scripts: Added script hook to execute actions after completing an achievement (#27718)
This commit is contained in:
@@ -66,6 +66,7 @@ class WorldSocket;
|
||||
class WorldObject;
|
||||
class WorldSession;
|
||||
|
||||
struct AchievementEntry;
|
||||
struct AreaTriggerEntry;
|
||||
struct AuctionPosting;
|
||||
struct ConditionSourceInfo;
|
||||
@@ -622,6 +623,18 @@ class TC_GAME_API TransportScript : public ScriptObject, public UpdatableScript<
|
||||
virtual void OnRelocate(Transport* /*transport*/, uint32 /*waypointId*/, uint32 /*mapId*/, float /*x*/, float /*y*/, float /*z*/) { }
|
||||
};
|
||||
|
||||
class TC_GAME_API AchievementScript : public ScriptObject
|
||||
{
|
||||
protected:
|
||||
|
||||
AchievementScript(char const* name);
|
||||
|
||||
public:
|
||||
|
||||
// Called when an achievement is completed.
|
||||
virtual void OnCompleted(Player* /*player*/, AchievementEntry const* /*achievement*/) { }
|
||||
};
|
||||
|
||||
class TC_GAME_API AchievementCriteriaScript : public ScriptObject
|
||||
{
|
||||
protected:
|
||||
@@ -1085,6 +1098,10 @@ class TC_GAME_API ScriptMgr
|
||||
void OnTransportUpdate(Transport* transport, uint32 diff);
|
||||
void OnRelocate(Transport* transport, uint32 waypointId, uint32 mapId, float x, float y, float z);
|
||||
|
||||
public: /* AchievementScript */
|
||||
|
||||
void OnAchievementCompleted(Player* player, AchievementEntry const* achievement);
|
||||
|
||||
public: /* AchievementCriteriaScript */
|
||||
|
||||
bool OnCriteriaCheck(uint32 scriptId, Player* source, Unit* target);
|
||||
|
||||
Reference in New Issue
Block a user