TrinityCore
ScriptMgr.h
Go to the documentation of this file.
1 /*
2  * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation; either version 2 of the License, or (at your
7  * option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef SC_SCRIPTMGR_H
19 #define SC_SCRIPTMGR_H
20 
21 #include "Common.h"
22 #include "ObjectGuid.h"
23 #include "Tuples.h"
24 #include "Types.h"
25 #include <vector>
26 
27 class AccountMgr;
28 class AreaTrigger;
29 class AreaTriggerAI;
30 class AuctionHouseObject;
31 class Aura;
32 class AuraScript;
33 class Battlefield;
34 class Battleground;
35 class BattlegroundMap;
36 class Channel;
37 class Conversation;
38 class Creature;
39 class CreatureAI;
40 class DynamicObject;
41 class GameObject;
42 class GameObjectAI;
43 class Guild;
44 class GridMap;
45 class Group;
46 class InstanceMap;
47 class InstanceScript;
48 class Item;
49 class Map;
50 class ModuleReference;
51 class OutdoorPvP;
52 class Player;
53 class Quest;
54 class ScriptMgr;
55 class Spell;
56 class SpellInfo;
57 class SpellScript;
58 class SpellCastTargets;
59 class Transport;
60 class Unit;
61 class Vehicle;
62 class Weather;
63 class WorldPacket;
64 class WorldSocket;
65 class WorldObject;
66 class WorldSession;
67 
68 struct AchievementEntry;
69 struct AreaTriggerEntry;
70 struct AuctionPosting;
71 struct ConditionSourceInfo;
72 struct Condition;
73 struct CreatureTemplate;
74 struct CreatureData;
75 struct ItemTemplate;
76 struct MapEntry;
77 struct Position;
78 struct QuestObjective;
79 struct SceneTemplate;
80 struct WorldStateTemplate;
81 
82 namespace Trinity::ChatCommands { struct ChatCommandBuilder; }
83 
85 enum Difficulty : uint8;
86 enum DuelCompleteType : uint8;
87 enum Emote : uint32;
88 enum QuestStatus : uint8;
89 enum RemoveMethod : uint8;
91 enum ShutdownMask : uint32;
92 enum SpellEffIndex : uint8;
93 enum WeatherState : uint32;
94 enum XPColorChar : uint8;
95 
96 #define VISIBLE_RANGE 166.0f //MAX visible range (size of grid)
97 
98 /*
99  @todo Add more script type classes.
100 
101  MailScript
102  SessionScript
103  CollisionScript
104  ArenaTeamScript
105 
106 */
107 
108 /*
109  Standard procedure when adding new script type classes:
110 
111  First of all, define the actual class, and have it inherit from ScriptObject, like so:
112 
113  class MyScriptType : public ScriptObject
114  {
115  uint32 _someId;
116 
117  private:
118 
119  void RegisterSelf();
120 
121  protected:
122 
123  MyScriptType(char const* name, uint32 someId)
124  : ScriptObject(name), _someId(someId)
125  {
126  ScriptRegistry<MyScriptType>::AddScript(this);
127  }
128 
129  public:
130 
131  // If a virtual function in your script type class is not necessarily
132  // required to be overridden, just declare it virtual with an empty
133  // body. If, on the other hand, it's logical only to override it (i.e.
134  // if it's the only method in the class), make it pure virtual, by adding
135  // = 0 to it.
136  virtual void OnSomeEvent(uint32 someArg1, std::string& someArg2) { }
137 
138  // This is a pure virtual function:
139  virtual void OnAnotherEvent(uint32 someArg) = 0;
140  }
141 
142  Next, you need to add a specialization for ScriptRegistry. Put this in the bottom of
143  ScriptMgr.cpp:
144 
145  template class ScriptRegistry<MyScriptType>;
146 
147  Now, add a cleanup routine in ScriptMgr::~ScriptMgr:
148 
149  SCR_CLEAR(MyScriptType);
150 
151  Now your script type is good to go with the script system. What you need to do now
152  is add functions to ScriptMgr that can be called from the core to actually trigger
153  certain events. For example, in ScriptMgr.h:
154 
155  void OnSomeEvent(uint32 someArg1, std::string& someArg2);
156  void OnAnotherEvent(uint32 someArg);
157 
158  In ScriptMgr.cpp:
159 
160  void ScriptMgr::OnSomeEvent(uint32 someArg1, std::string& someArg2)
161  {
162  FOREACH_SCRIPT(MyScriptType)->OnSomeEvent(someArg1, someArg2);
163  }
164 
165  void ScriptMgr::OnAnotherEvent(uint32 someArg)
166  {
167  FOREACH_SCRIPT(MyScriptType)->OnAnotherEvent(someArg1, someArg2);
168  }
169 
170  Now you simply call these two functions from anywhere in the core to trigger the
171  event on all registered scripts of that type.
172 */
173 
175 {
176  friend class ScriptMgr;
177 
178  public:
179 
180  ScriptObject(ScriptObject const& right) = delete;
181  ScriptObject(ScriptObject&& right) = delete;
182  ScriptObject& operator=(ScriptObject const& right) = delete;
183  ScriptObject& operator=(ScriptObject&& right) = delete;
184 
185  const std::string& GetName() const { return _name; }
186 
187  protected:
188 
189  ScriptObject(char const* name);
190  virtual ~ScriptObject();
191 
192  private:
193 
194  const std::string _name;
195 };
196 
197 template<class TObject> class UpdatableScript
198 {
199  protected:
200 
202  {
203  }
204 
205  virtual ~UpdatableScript() { }
206 
207  public:
208 
209  UpdatableScript(UpdatableScript const& right) = delete;
210  UpdatableScript(UpdatableScript&& right) = delete;
211  UpdatableScript& operator=(UpdatableScript const& right) = delete;
212  UpdatableScript& operator=(UpdatableScript&& right) = delete;
213 
214  virtual void OnUpdate(TObject* /*obj*/, uint32 /*diff*/) { }
215 };
216 
218 {
219  protected:
220 
221  SpellScriptLoader(char const* name);
222 
223  public:
224 
225  // Should return a fully valid SpellScript pointer.
226  virtual SpellScript* GetSpellScript() const { return nullptr; }
227 
228  // Should return a fully valid AuraScript pointer.
229  virtual AuraScript* GetAuraScript() const { return nullptr; }
230 };
231 
233 {
234  protected:
235 
236  ServerScript(char const* name);
237 
238  public:
239 
240  ~ServerScript();
241 
242  // Called when reactive socket I/O is started (WorldTcpSessionMgr).
243  virtual void OnNetworkStart() { }
244 
245  // Called when reactive I/O is stopped.
246  virtual void OnNetworkStop() { }
247 
248  // Called when a remote socket establishes a connection to the server. Do not store the socket object.
249  virtual void OnSocketOpen(std::shared_ptr<WorldSocket> /*socket*/) { }
250 
251  // Called when a socket is closed. Do not store the socket object, and do not rely on the connection
252  // being open; it is not.
253  virtual void OnSocketClose(std::shared_ptr<WorldSocket> /*socket*/) { }
254 
255  // Called when a packet is sent to a client. The packet object is a copy of the original packet, so reading
256  // and modifying it is safe.
257  virtual void OnPacketSend(WorldSession* /*session*/, WorldPacket& /*packet*/) { }
258 
259  // Called when a (valid) packet is received by a client. The packet object is a copy of the original packet, so
260  // reading and modifying it is safe. Make sure to check WorldSession pointer before usage, it might be null in case of auth packets
261  virtual void OnPacketReceive(WorldSession* /*session*/, WorldPacket& /*packet*/) { }
262 };
263 
265 {
266  protected:
267 
268  WorldScript(char const* name);
269 
270  public:
271 
272  ~WorldScript();
273 
274  // Called when the open/closed state of the world changes.
275  virtual void OnOpenStateChange(bool /*open*/) { }
276 
277  // Called after the world configuration is (re)loaded.
278  virtual void OnConfigLoad(bool /*reload*/) { }
279 
280  // Called before the message of the day is changed.
281  virtual void OnMotdChange(std::string& /*newMotd*/) { }
282 
283  // Called when a world shutdown is initiated.
284  virtual void OnShutdownInitiate(ShutdownExitCode /*code*/, ShutdownMask /*mask*/) { }
285 
286  // Called when a world shutdown is cancelled.
287  virtual void OnShutdownCancel() { }
288 
289  // Called on every world tick (don't execute too heavy code here).
290  virtual void OnUpdate(uint32 /*diff*/) { }
291 
292  // Called when the world is started.
293  virtual void OnStartup() { }
294 
295  // Called when the world is actually shut down.
296  virtual void OnShutdown() { }
297 };
298 
300 {
301  protected:
302 
303  FormulaScript(char const* name);
304 
305  public:
306 
307  ~FormulaScript();
308 
309  // Called after calculating honor.
310  virtual void OnHonorCalculation(float& /*honor*/, uint8 /*level*/, float /*multiplier*/) { }
311 
312  // Called after gray level calculation.
313  virtual void OnGrayLevelCalculation(uint8& /*grayLevel*/, uint8 /*playerLevel*/) { }
314 
315  // Called after calculating experience color.
316  virtual void OnColorCodeCalculation(XPColorChar& /*color*/, uint8 /*playerLevel*/, uint8 /*mobLevel*/) { }
317 
318  // Called after calculating zero difference.
319  virtual void OnZeroDifferenceCalculation(uint8& /*diff*/, uint8 /*playerLevel*/) { }
320 
321  // Called after calculating base experience gain.
322  virtual void OnBaseGainCalculation(uint32& /*gain*/, uint8 /*playerLevel*/, uint8 /*mobLevel*/) { }
323 
324  // Called after calculating experience gain.
325  virtual void OnGainCalculation(uint32& /*gain*/, Player* /*player*/, Unit* /*unit*/) { }
326 
327  // Called when calculating the experience rate for group experience.
328  virtual void OnGroupRateCalculation(float& /*rate*/, uint32 /*count*/, bool /*isRaid*/) { }
329 };
330 
331 template<class TMap>
332 class MapScript : public UpdatableScript<TMap>
333 {
335 
336  protected:
337 
338  MapScript(MapEntry const* mapEntry) : _mapEntry(mapEntry) { }
339 
340  public:
341 
342  // Gets the MapEntry structure associated with this script. Can return NULL.
343  MapEntry const* GetEntry() { return _mapEntry; }
344 
345  // Called when the map is created.
346  virtual void OnCreate(TMap* /*map*/) { }
347 
348  // Called just before the map is destroyed.
349  virtual void OnDestroy(TMap* /*map*/) { }
350 
351  // Called when a grid map is loaded.
352  virtual void OnLoadGridMap(TMap* /*map*/, GridMap* /*gmap*/, uint32 /*gx*/, uint32 /*gy*/) { }
353 
354  // Called when a grid map is unloaded.
355  virtual void OnUnloadGridMap(TMap* /*map*/, GridMap* /*gmap*/, uint32 /*gx*/, uint32 /*gy*/) { }
356 
357  // Called when a player enters the map.
358  virtual void OnPlayerEnter(TMap* /*map*/, Player* /*player*/) { }
359 
360  // Called when a player leaves the map.
361  virtual void OnPlayerLeave(TMap* /*map*/, Player* /*player*/) { }
362 };
363 
365 {
366  protected:
367 
368  WorldMapScript(char const* name, uint32 mapId);
369 
370  public:
371 
372  ~WorldMapScript();
373 };
374 
376  : public ScriptObject, public MapScript<InstanceMap>
377 {
378  protected:
379 
380  InstanceMapScript(char const* name, uint32 mapId);
381 
382  public:
383 
385 
386  // Gets an InstanceScript object for this instance.
387  virtual InstanceScript* GetInstanceScript(InstanceMap* /*map*/) const { return nullptr; }
388 };
389 
390 class TC_GAME_API BattlegroundMapScript : public ScriptObject, public MapScript<BattlegroundMap>
391 {
392  protected:
393 
394  BattlegroundMapScript(char const* name, uint32 mapId);
395 
396  public:
397 
399 };
400 
402 {
403  protected:
404 
405  ItemScript(char const* name);
406 
407  public:
408 
409  ~ItemScript();
410 
411  // Called when a player accepts a quest from the item.
412  virtual bool OnQuestAccept(Player* /*player*/, Item* /*item*/, Quest const* /*quest*/) { return false; }
413 
414  // Called when a player uses the item.
415  virtual bool OnUse(Player* /*player*/, Item* /*item*/, SpellCastTargets const& /*targets*/, ObjectGuid /*castId*/) { return false; }
416 
417  // Called when the item expires (is destroyed).
418  virtual bool OnExpire(Player* /*player*/, ItemTemplate const* /*proto*/) { return false; }
419 
420  // Called when the item is destroyed.
421  virtual bool OnRemove(Player* /*player*/, Item* /*item*/) { return false; }
422 
423  // Called before casting a combat spell from this item (chance on hit spells of item template, can be used to prevent cast if returning false)
424  virtual bool OnCastItemCombatSpell(Player* /*player*/, Unit* /*victim*/, SpellInfo const* /*spellInfo*/, Item* /*item*/) { return true; }
425 };
426 
428 {
429  protected:
430 
431  UnitScript(char const* name);
432 
433  public:
434 
435  ~UnitScript();
436 
437  // Called when a unit deals healing to another unit
438  virtual void OnHeal(Unit* /*healer*/, Unit* /*reciever*/, uint32& /*gain*/) { }
439 
440  // Called when a unit deals damage to another unit
441  virtual void OnDamage(Unit* /*attacker*/, Unit* /*victim*/, uint32& /*damage*/) { }
442 
443  // Called when DoT's Tick Damage is being Dealt
444  virtual void ModifyPeriodicDamageAurasTick(Unit* /*target*/, Unit* /*attacker*/, uint32& /*damage*/) { }
445 
446  // Called when Melee Damage is being Dealt
447  virtual void ModifyMeleeDamage(Unit* /*target*/, Unit* /*attacker*/, uint32& /*damage*/) { }
448 
449  // Called when Spell Damage is being Dealt
450  virtual void ModifySpellDamageTaken(Unit* /*target*/, Unit* /*attacker*/, int32& /*damage*/, SpellInfo const* /*spellInfo*/) { }
451 };
452 
454 {
455  protected:
456 
457  CreatureScript(char const* name);
458 
459  public:
460 
461  ~CreatureScript();
462 
463  // Called when a CreatureAI object is needed for the creature.
464  virtual CreatureAI* GetAI(Creature* /*creature*/) const = 0;
465 };
466 
468 {
469  protected:
470 
471  GameObjectScript(char const* name);
472 
473  public:
474 
475  ~GameObjectScript();
476 
477  // Called when a GameObjectAI object is needed for the gameobject.
478  virtual GameObjectAI* GetAI(GameObject* /*go*/) const = 0;
479 };
480 
482 {
483  protected:
484 
485  AreaTriggerScript(char const* name);
486 
487  public:
488 
490 
491  // Called when the area trigger is activated by a player.
492  virtual bool OnTrigger(Player* /*player*/, AreaTriggerEntry const* /*trigger*/) { return false; }
493 
494  // Called when the area trigger is left by a player.
495  virtual bool OnExit(Player* /*player*/, AreaTriggerEntry const* /*trigger*/) { return false; }
496 };
497 
499 {
501 
502  public:
503 
505 
506  bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) final;
507 
508  protected:
509  // returns true if the trigger was successfully handled, false if we should try again next time
510  virtual bool TryHandleOnce(Player* /*player*/, AreaTriggerEntry const* /*trigger*/) = 0;
511  void ResetAreaTriggerDone(InstanceScript* /*instance*/, uint32 /*triggerId*/);
512  void ResetAreaTriggerDone(Player const* /*player*/, AreaTriggerEntry const* /*trigger*/);
513 };
514 
516 {
517  protected:
518 
519  BattlefieldScript(char const* name);
520 
521  public:
522 
524 
525  virtual Battlefield* GetBattlefield() const = 0;
526 };
527 
529 {
530  protected:
531 
532  BattlegroundScript(char const* name);
533 
534  public:
535 
537 
538  // Should return a fully valid Battleground object for the type ID.
539  virtual Battleground* GetBattleground() const = 0;
540 };
541 
543 {
544  protected:
545 
546  OutdoorPvPScript(char const* name);
547 
548  public:
549 
550  ~OutdoorPvPScript();
551 
552  // Should return a fully valid OutdoorPvP object for the type ID.
553  virtual OutdoorPvP* GetOutdoorPvP() const = 0;
554 };
555 
557 {
558  protected:
559 
560  CommandScript(char const* name);
561 
562  public:
563 
564  ~CommandScript();
565 
566  // Should return a pointer to a valid command table (ChatCommand array) to be used by ChatHandler.
567  virtual std::vector<Trinity::ChatCommands::ChatCommandBuilder> GetCommands() const = 0;
568 };
569 
570 class TC_GAME_API WeatherScript : public ScriptObject, public UpdatableScript<Weather>
571 {
572  protected:
573 
574  WeatherScript(char const* name);
575 
576  public:
577 
578  ~WeatherScript();
579 
580  // Called when the weather changes in the zone this script is associated with.
581  virtual void OnChange(Weather* /*weather*/, WeatherState /*state*/, float /*grade*/) { }
582 };
583 
585 {
586  protected:
587 
588  AuctionHouseScript(char const* name);
589 
590  public:
591 
593 
594  // Called when an auction is added to an auction house.
595  virtual void OnAuctionAdd(AuctionHouseObject* /*ah*/, AuctionPosting* /*auction*/) { }
596 
597  // Called when an auction is removed from an auction house.
598  virtual void OnAuctionRemove(AuctionHouseObject* /*ah*/, AuctionPosting* /*auction*/) { }
599 
600  // Called when an auction was succesfully completed.
601  virtual void OnAuctionSuccessful(AuctionHouseObject* /*ah*/, AuctionPosting* /*auction*/) { }
602 
603  // Called when an auction expires.
604  virtual void OnAuctionExpire(AuctionHouseObject* /*ah*/, AuctionPosting* /*auction*/) { }
605 };
606 
608 {
609  protected:
610 
611  ConditionScript(char const* name);
612 
613  public:
614 
615  ~ConditionScript();
616 
617  // Called when a single condition is checked for a player.
618  virtual bool OnConditionCheck(Condition const* /*condition*/, ConditionSourceInfo& /*sourceInfo*/) { return true; }
619 };
620 
622 {
623  protected:
624 
625  VehicleScript(char const* name);
626 
627  public:
628 
629  ~VehicleScript();
630 
631  // Called after a vehicle is installed.
632  virtual void OnInstall(Vehicle* /*veh*/) { }
633 
634  // Called after a vehicle is uninstalled.
635  virtual void OnUninstall(Vehicle* /*veh*/) { }
636 
637  // Called when a vehicle resets.
638  virtual void OnReset(Vehicle* /*veh*/) { }
639 
640  // Called after an accessory is installed in a vehicle.
641  virtual void OnInstallAccessory(Vehicle* /*veh*/, Creature* /*accessory*/) { }
642 
643  // Called after a passenger is added to a vehicle.
644  virtual void OnAddPassenger(Vehicle* /*veh*/, Unit* /*passenger*/, int8 /*seatId*/) { }
645 
646  // Called after a passenger is removed from a vehicle.
647  virtual void OnRemovePassenger(Vehicle* /*veh*/, Unit* /*passenger*/) { }
648 };
649 
650 class TC_GAME_API DynamicObjectScript : public ScriptObject, public UpdatableScript<DynamicObject>
651 {
652  protected:
653 
654  DynamicObjectScript(char const* name);
655 
656  public:
657 
659 };
660 
661 class TC_GAME_API TransportScript : public ScriptObject, public UpdatableScript<Transport>
662 {
663  protected:
664 
665  TransportScript(char const* name);
666 
667  public:
668 
669  ~TransportScript();
670 
671  // Called when a player boards the transport.
672  virtual void OnAddPassenger(Transport* /*transport*/, Player* /*player*/) { }
673 
674  // Called when a creature boards the transport.
675  virtual void OnAddCreaturePassenger(Transport* /*transport*/, Creature* /*creature*/) { }
676 
677  // Called when a player exits the transport.
678  virtual void OnRemovePassenger(Transport* /*transport*/, Player* /*player*/) { }
679 
680  // Called when a transport moves.
681  virtual void OnRelocate(Transport* /*transport*/, uint32 /*mapId*/, float /*x*/, float /*y*/, float /*z*/) { }
682 };
683 
685 {
686  protected:
687 
688  AchievementScript(char const* name);
689 
690  public:
691 
693 
694  // Called when an achievement is completed.
695  virtual void OnCompleted(Player* /*player*/, AchievementEntry const* /*achievement*/) { }
696 };
697 
699 {
700  protected:
701 
702  AchievementCriteriaScript(char const* name);
703 
704  public:
705 
707 
708  // Called when an additional criteria is checked.
709  virtual bool OnCheck(Player* source, Unit* target) = 0;
710 };
711 
713 {
714  protected:
715 
716  PlayerScript(char const* name);
717 
718  public:
719 
720  ~PlayerScript();
721 
722  // Called when a player kills another player
723  virtual void OnPVPKill(Player* /*killer*/, Player* /*killed*/) { }
724 
725  // Called when a player kills a creature
726  virtual void OnCreatureKill(Player* /*killer*/, Creature* /*killed*/) { }
727 
728  // Called when a player is killed by a creature
729  virtual void OnPlayerKilledByCreature(Creature* /*killer*/, Player* /*killed*/) { }
730 
731  // Called when a player's level changes (after the level is applied)
732  virtual void OnLevelChanged(Player* /*player*/, uint8 /*oldLevel*/) { }
733 
734  // Called when a player's free talent points change (right before the change is applied)
735  virtual void OnFreeTalentPointsChanged(Player* /*player*/, uint32 /*points*/) { }
736 
737  // Called when a player's talent points are reset (right before the reset is done)
738  virtual void OnTalentsReset(Player* /*player*/, bool /*noCost*/) { }
739 
740  // Called when a player's money is modified (before the modification is done)
741  virtual void OnMoneyChanged(Player* /*player*/, int64& /*amount*/) { }
742 
743  // Called when a player's money is at limit (amount = money tried to add)
744  virtual void OnMoneyLimit(Player* /*player*/, int64 /*amount*/) { }
745 
746  // Called when a player gains XP (before anything is given)
747  virtual void OnGiveXP(Player* /*player*/, uint32& /*amount*/, Unit* /*victim*/) { }
748 
749  // Called when a player's reputation changes (before it is actually changed)
750  virtual void OnReputationChange(Player* /*player*/, uint32 /*factionId*/, int32& /*standing*/, bool /*incremental*/) { }
751 
752  // Called when a duel is requested
753  virtual void OnDuelRequest(Player* /*target*/, Player* /*challenger*/) { }
754 
755  // Called when a duel starts (after 3s countdown)
756  virtual void OnDuelStart(Player* /*player1*/, Player* /*player2*/) { }
757 
758  // Called when a duel ends
759  virtual void OnDuelEnd(Player* /*winner*/, Player* /*loser*/, DuelCompleteType /*type*/) { }
760 
761  // The following methods are called when a player sends a chat message.
762  virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string& /*msg*/) { }
763 
764  virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string& /*msg*/, Player* /*receiver*/) { }
765 
766  virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string& /*msg*/, Group* /*group*/) { }
767 
768  virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string& /*msg*/, Guild* /*guild*/) { }
769 
770  virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string& /*msg*/, Channel* /*channel*/) { }
771 
772  // Both of the below are called on emote opcodes.
773  virtual void OnClearEmote(Player* /*player*/) { }
774 
775  virtual void OnTextEmote(Player* /*player*/, uint32 /*textEmote*/, uint32 /*emoteNum*/, ObjectGuid /*guid*/) { }
776 
777  // Called in Spell::Cast.
778  virtual void OnSpellCast(Player* /*player*/, Spell* /*spell*/, bool /*skipCheck*/) { }
779 
780  // Called when a player logs in.
781  virtual void OnLogin(Player* /*player*/, bool /*firstLogin*/) { }
782 
783  // Called when a player logs out.
784  virtual void OnLogout(Player* /*player*/) { }
785 
786  // Called when a player is created.
787  virtual void OnCreate(Player* /*player*/) { }
788 
789  // Called when a player is deleted.
790  virtual void OnDelete(ObjectGuid /*guid*/, uint32 /*accountId*/) { }
791 
792  // Called when a player delete failed
793  virtual void OnFailedDelete(ObjectGuid /*guid*/, uint32 /*accountId*/) { }
794 
795  // Called when a player is about to be saved.
796  virtual void OnSave(Player* /*player*/) { }
797 
798  // Called when a player is bound to an instance
799  virtual void OnBindToInstance(Player* /*player*/, Difficulty /*difficulty*/, uint32 /*mapId*/, bool /*permanent*/, uint8 /*extendState*/) { }
800 
801  // Called when a player switches to a new zone
802  virtual void OnUpdateZone(Player* /*player*/, uint32 /*newZone*/, uint32 /*newArea*/) { }
803 
804  // Called when a player changes to a new map (after moving to new map)
805  virtual void OnMapChanged(Player* /*player*/) { }
806 
807  // Called after a player's quest status has been changed
808  virtual void OnQuestStatusChange(Player* /*player*/, uint32 /*questId*/) { }
809 
810  // Called when a player presses release when he died
811  virtual void OnPlayerRepop(Player* /*player*/) { }
812 
813  // Called when a player completes a movie
814  virtual void OnMovieComplete(Player* /*player*/, uint32 /*movieId*/) { }
815 
816  // Called when a player choose a response from a PlayerChoice
817  virtual void OnPlayerChoiceResponse(Player* /*player*/, uint32 /*choiceId*/, uint32 /*responseId*/) { }
818 };
819 
821 {
822  protected:
823 
824  AccountScript(char const* name);
825 
826  public:
827 
828  ~AccountScript();
829 
830  // Called when an account logged in succesfully
831  virtual void OnAccountLogin(uint32 /*accountId*/) {}
832 
833  // Called when an account login failed
834  virtual void OnFailedAccountLogin(uint32 /*accountId*/) {}
835 
836  // Called when Email is successfully changed for Account
837  virtual void OnEmailChange(uint32 /*accountId*/) {}
838 
839  // Called when Email failed to change for Account
840  virtual void OnFailedEmailChange(uint32 /*accountId*/) {}
841 
842  // Called when Password is successfully changed for Account
843  virtual void OnPasswordChange(uint32 /*accountId*/) {}
844 
845  // Called when Password failed to change for Account
846  virtual void OnFailedPasswordChange(uint32 /*accountId*/) {}
847 };
848 
850 {
851  protected:
852 
853  GuildScript(char const* name);
854 
855  public:
856 
857  ~GuildScript();
858 
859  // Called when a member is added to the guild.
860  virtual void OnAddMember(Guild* /*guild*/, Player* /*player*/, uint8 /*plRank*/) { }
861 
862  // Called when a member is removed from the guild.
863  virtual void OnRemoveMember(Guild* /*guild*/, ObjectGuid /*guid*/, bool /*isDisbanding*/, bool /*isKicked*/) { }
864 
865  // Called when the guild MOTD (message of the day) changes.
866  virtual void OnMOTDChanged(Guild* /*guild*/, const std::string& /*newMotd*/) { }
867 
868  // Called when the guild info is altered.
869  virtual void OnInfoChanged(Guild* /*guild*/, const std::string& /*newInfo*/) { }
870 
871  // Called when a guild is created.
872  virtual void OnCreate(Guild* /*guild*/, Player* /*leader*/, const std::string& /*name*/) { }
873 
874  // Called when a guild is disbanded.
875  virtual void OnDisband(Guild* /*guild*/) { }
876 
877  // Called when a guild member withdraws money from a guild bank.
878  virtual void OnMemberWitdrawMoney(Guild* /*guild*/, Player* /*player*/, uint64& /*amount*/, bool /*isRepair*/) { }
879 
880  // Called when a guild member deposits money in a guild bank.
881  virtual void OnMemberDepositMoney(Guild* /*guild*/, Player* /*player*/, uint64& /*amount*/) { }
882 
883  // Called when a guild member moves an item in a guild bank.
884  virtual void OnItemMove(Guild* /*guild*/, Player* /*player*/, Item* /*pItem*/, bool /*isSrcBank*/, uint8 /*srcContainer*/, uint8 /*srcSlotId*/,
885  bool /*isDestBank*/, uint8 /*destContainer*/, uint8 /*destSlotId*/) { }
886 
887  virtual void OnEvent(Guild* /*guild*/, uint8 /*eventType*/, ObjectGuid::LowType /*playerGuid1*/, ObjectGuid::LowType /*playerGuid2*/, uint8 /*newRank*/) { }
888 
889  virtual void OnBankEvent(Guild* /*guild*/, uint8 /*eventType*/, uint8 /*tabId*/, ObjectGuid::LowType /*playerGuid*/, uint64 /*itemOrMoney*/, uint16 /*itemStackCount*/, uint8 /*destTabId*/) { }
890 };
891 
893 {
894  protected:
895 
896  GroupScript(char const* name);
897 
898  public:
899 
900  ~GroupScript();
901 
902  // Called when a member is added to a group.
903  virtual void OnAddMember(Group* /*group*/, ObjectGuid /*guid*/) { }
904 
905  // Called when a member is invited to join a group.
906  virtual void OnInviteMember(Group* /*group*/, ObjectGuid /*guid*/) { }
907 
908  // Called when a member is removed from a group.
909  virtual void OnRemoveMember(Group* /*group*/, ObjectGuid /*guid*/, RemoveMethod /*method*/, ObjectGuid /*kicker*/, char const* /*reason*/) { }
910 
911  // Called when the leader of a group is changed.
912  virtual void OnChangeLeader(Group* /*group*/, ObjectGuid /*newLeaderGuid*/, ObjectGuid /*oldLeaderGuid*/) { }
913 
914  // Called when a group is disbanded.
915  virtual void OnDisband(Group* /*group*/) { }
916 };
917 
919 {
920  protected:
921 
922  AreaTriggerEntityScript(char const* name);
923 
924  public:
925 
927 
928  // Called when a AreaTriggerAI object is needed for the areatrigger.
929  virtual AreaTriggerAI* GetAI(AreaTrigger* /*at*/) const { return nullptr; }
930 };
931 
933 {
934  protected:
935  ConversationScript(char const* name);
936 
937  public:
938 
940 
941  // Called when Conversation is created but not added to Map yet.
942  virtual void OnConversationCreate(Conversation* /*conversation*/, Unit* /*creator*/) { }
943 
944  // Called when player sends CMSG_CONVERSATION_LINE_STARTED with valid conversation guid
945  virtual void OnConversationLineStarted(Conversation* /*conversation*/, uint32 /*lineId*/, Player* /*sender*/) { }
946 };
947 
949 {
950  protected:
951 
952  SceneScript(char const* name);
953 
954  public:
955 
956  ~SceneScript();
957 
958  // Called when a player start a scene
959  virtual void OnSceneStart(Player* /*player*/, uint32 /*sceneInstanceID*/, SceneTemplate const* /*sceneTemplate*/) { }
960 
961  // Called when a player receive trigger from scene
962  virtual void OnSceneTriggerEvent(Player* /*player*/, uint32 /*sceneInstanceID*/, SceneTemplate const* /*sceneTemplate*/, std::string const& /*triggerName*/) { }
963 
964  // Called when a scene is canceled
965  virtual void OnSceneCancel(Player* /*player*/, uint32 /*sceneInstanceID*/, SceneTemplate const* /*sceneTemplate*/) { }
966 
967  // Called when a scene is completed
968  virtual void OnSceneComplete(Player* /*player*/, uint32 /*sceneInstanceID*/, SceneTemplate const* /*sceneTemplate*/) { }
969 };
970 
972 {
973  protected:
974 
975  QuestScript(char const* name);
976 
977  public:
978 
979  ~QuestScript();
980 
981  // Called when a quest status change
982  virtual void OnQuestStatusChange(Player* /*player*/, Quest const* /*quest*/, QuestStatus /*oldStatus*/, QuestStatus /*newStatus*/) { }
983 
984  // Called for auto accept quests when player closes quest UI after seeing initial quest details
985  virtual void OnAcknowledgeAutoAccept(Player* /*player*/, Quest const* /*quest*/) { }
986 
987  // Called when a quest objective data change
988  virtual void OnQuestObjectiveChange(Player* /*player*/, Quest const* /*quest*/, QuestObjective const& /*objective*/, int32 /*oldAmount*/, int32 /*newAmount*/) { }
989 };
990 
992 {
993  protected:
994 
995  WorldStateScript(char const* name);
996 
997  public:
998 
999  ~WorldStateScript();
1000 
1001  // Called when worldstate changes value, map is optional
1002  virtual void OnValueChange([[maybe_unused]] int32 worldStateId, [[maybe_unused]] int32 oldValue, [[maybe_unused]] int32 newValue, [[maybe_unused]] Map const* map) { }
1003 };
1004 
1005 // Manages registration, loading, and execution of scripts.
1007 {
1008  friend class ScriptObject;
1009 
1010  private:
1011  ScriptMgr();
1012  ~ScriptMgr();
1013 
1014  ScriptMgr(ScriptMgr const& right) = delete;
1015  ScriptMgr(ScriptMgr&& right) = delete;
1016  ScriptMgr& operator=(ScriptMgr const& right) = delete;
1017  ScriptMgr& operator=(ScriptMgr&& right) = delete;
1018 
1019  void FillSpellSummary();
1020  void LoadDatabase();
1021 
1022  void IncreaseScriptCount() { ++_scriptCount; }
1023  void DecreaseScriptCount() { --_scriptCount; }
1024 
1025  public: /* Initialization */
1026  static ScriptMgr* instance();
1027 
1028  void Initialize();
1029 
1030  uint32 GetScriptCount() const { return _scriptCount; }
1031 
1032  typedef void(*ScriptLoaderCallbackType)();
1033 
1036  void SetScriptLoader(ScriptLoaderCallbackType script_loader_callback)
1037  {
1038  _script_loader_callback = script_loader_callback;
1039  }
1040 
1041  public: /* Updating script ids */
1043  void NotifyScriptIDUpdate();
1045  void SyncScripts();
1046 
1047  public: /* Script contexts */
1051  void SetScriptContext(std::string const& context);
1053  std::string const& GetCurrentScriptContext() const { return _currentContext; }
1056  void ReleaseScriptContext(std::string const& context);
1060  void SwapScriptContext(bool initialize = false);
1061 
1063  static std::string const& GetNameOfStaticContext();
1064 
1068  std::shared_ptr<ModuleReference> AcquireModuleReferenceOfScriptName(
1069  std::string const& scriptname) const;
1070 
1071  public: /* Unloading */
1072 
1073  void Unload();
1074 
1075  public: /* SpellScriptLoader */
1076 
1077  void CreateSpellScripts(uint32 spellId, std::vector<SpellScript*>& scriptVector, Spell* invoker) const;
1078  void CreateAuraScripts(uint32 spellId, std::vector<AuraScript*>& scriptVector, Aura* invoker) const;
1079  SpellScriptLoader* GetSpellScriptLoader(uint32 scriptId);
1080 
1081  public: /* ServerScript */
1082 
1083  void OnNetworkStart();
1084  void OnNetworkStop();
1085  void OnSocketOpen(std::shared_ptr<WorldSocket> socket);
1086  void OnSocketClose(std::shared_ptr<WorldSocket> socket);
1087  void OnPacketReceive(WorldSession* session, WorldPacket const& packet);
1088  void OnPacketSend(WorldSession* session, WorldPacket const& packet);
1089 
1090  public: /* WorldScript */
1091 
1092  void OnOpenStateChange(bool open);
1093  void OnConfigLoad(bool reload);
1094  void OnMotdChange(std::string& newMotd);
1095  void OnShutdownInitiate(ShutdownExitCode code, ShutdownMask mask);
1096  void OnShutdownCancel();
1097  void OnWorldUpdate(uint32 diff);
1098  void OnStartup();
1099  void OnShutdown();
1100 
1101  public: /* FormulaScript */
1102 
1103  void OnHonorCalculation(float& honor, uint8 level, float multiplier);
1104  void OnGrayLevelCalculation(uint8& grayLevel, uint8 playerLevel);
1105  void OnColorCodeCalculation(XPColorChar& color, uint8 playerLevel, uint8 mobLevel);
1106  void OnZeroDifferenceCalculation(uint8& diff, uint8 playerLevel);
1107  void OnBaseGainCalculation(uint32& gain, uint8 playerLevel, uint8 mobLevel);
1108  void OnGainCalculation(uint32& gain, Player* player, Unit* unit);
1109  void OnGroupRateCalculation(float& rate, uint32 count, bool isRaid);
1110 
1111  public: /* MapScript */
1112 
1113  void OnCreateMap(Map* map);
1114  void OnDestroyMap(Map* map);
1115  void OnLoadGridMap(Map* map, GridMap* gmap, uint32 gx, uint32 gy);
1116  void OnUnloadGridMap(Map* map, GridMap* gmap, uint32 gx, uint32 gy);
1117  void OnPlayerEnterMap(Map* map, Player* player);
1118  void OnPlayerLeaveMap(Map* map, Player* player);
1119  void OnMapUpdate(Map* map, uint32 diff);
1120 
1121  public: /* InstanceMapScript */
1122 
1123  InstanceScript* CreateInstanceData(InstanceMap* map);
1124 
1125  public: /* ItemScript */
1126 
1127  bool OnQuestAccept(Player* player, Item* item, Quest const* quest);
1128  bool OnItemUse(Player* player, Item* item, SpellCastTargets const& targets, ObjectGuid castId);
1129  bool OnItemExpire(Player* player, ItemTemplate const* proto);
1130  bool OnItemRemove(Player* player, Item* item);
1131  bool OnCastItemCombatSpell(Player* player, Unit* victim, SpellInfo const* spellInfo, Item* item);
1132 
1133  public: /* CreatureScript */
1134 
1135  bool CanCreateCreatureAI(uint32 scriptId) const;
1136  CreatureAI* GetCreatureAI(Creature* creature);
1137 
1138  public: /* GameObjectScript */
1139 
1140  bool CanCreateGameObjectAI(uint32 scriptId) const;
1141  GameObjectAI* GetGameObjectAI(GameObject* go);
1142 
1143  public: /* AreaTriggerScript */
1144 
1145  bool OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger, bool entered);
1146 
1147  public: /* BattlefieldScript */
1148 
1149  Battlefield* CreateBattlefield(uint32 scriptId);
1150 
1151  public: /* BattlegroundScript */
1152 
1153  Battleground* CreateBattleground(BattlegroundTypeId typeId);
1154 
1155  public: /* OutdoorPvPScript */
1156 
1157  OutdoorPvP* CreateOutdoorPvP(uint32 scriptId);
1158 
1159  public: /* CommandScript */
1160 
1161  std::vector<Trinity::ChatCommands::ChatCommandBuilder> GetChatCommands();
1162 
1163  public: /* WeatherScript */
1164 
1165  void OnWeatherChange(Weather* weather, WeatherState state, float grade);
1166  void OnWeatherUpdate(Weather* weather, uint32 diff);
1167 
1168  public: /* AuctionHouseScript */
1169 
1170  void OnAuctionAdd(AuctionHouseObject* ah, AuctionPosting* auction);
1171  void OnAuctionRemove(AuctionHouseObject* ah, AuctionPosting* auction);
1172  void OnAuctionSuccessful(AuctionHouseObject* ah, AuctionPosting* auction);
1173  void OnAuctionExpire(AuctionHouseObject* ah, AuctionPosting* auction);
1174 
1175  public: /* ConditionScript */
1176 
1177  bool OnConditionCheck(Condition const* condition, ConditionSourceInfo& sourceInfo);
1178 
1179  public: /* VehicleScript */
1180 
1181  void OnInstall(Vehicle* veh);
1182  void OnUninstall(Vehicle* veh);
1183  void OnReset(Vehicle* veh);
1184  void OnInstallAccessory(Vehicle* veh, Creature* accessory);
1185  void OnAddPassenger(Vehicle* veh, Unit* passenger, int8 seatId);
1186  void OnRemovePassenger(Vehicle* veh, Unit* passenger);
1187 
1188  public: /* DynamicObjectScript */
1189 
1190  void OnDynamicObjectUpdate(DynamicObject* dynobj, uint32 diff);
1191 
1192  public: /* TransportScript */
1193 
1194  void OnAddPassenger(Transport* transport, Player* player);
1195  void OnAddCreaturePassenger(Transport* transport, Creature* creature);
1196  void OnRemovePassenger(Transport* transport, Player* player);
1197  void OnTransportUpdate(Transport* transport, uint32 diff);
1198  void OnRelocate(Transport* transport, uint32 mapId, float x, float y, float z);
1199 
1200  public: /* AchievementScript */
1201 
1202  void OnAchievementCompleted(Player* player, AchievementEntry const* achievement);
1203 
1204  public: /* AchievementCriteriaScript */
1205 
1206  bool OnCriteriaCheck(uint32 scriptId, Player* source, Unit* target);
1207 
1208  public: /* PlayerScript */
1209 
1210  void OnPVPKill(Player* killer, Player* killed);
1211  void OnCreatureKill(Player* killer, Creature* killed);
1212  void OnPlayerKilledByCreature(Creature* killer, Player* killed);
1213  void OnPlayerLevelChanged(Player* player, uint8 oldLevel);
1214  void OnPlayerFreeTalentPointsChanged(Player* player, uint32 newPoints);
1215  void OnPlayerTalentsReset(Player* player, bool noCost);
1216  void OnPlayerMoneyChanged(Player* player, int64& amount);
1217  void OnPlayerMoneyLimit(Player* player, int64 amount);
1218  void OnGivePlayerXP(Player* player, uint32& amount, Unit* victim);
1219  void OnPlayerReputationChange(Player* player, uint32 factionID, int32& standing, bool incremental);
1220  void OnPlayerDuelRequest(Player* target, Player* challenger);
1221  void OnPlayerDuelStart(Player* player1, Player* player2);
1222  void OnPlayerDuelEnd(Player* winner, Player* loser, DuelCompleteType type);
1223  void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg);
1224  void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Player* receiver);
1225  void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Group* group);
1226  void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Guild* guild);
1227  void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Channel* channel);
1228  void OnPlayerClearEmote(Player* player);
1229  void OnPlayerTextEmote(Player* player, uint32 textEmote, uint32 emoteNum, ObjectGuid guid);
1230  void OnPlayerSpellCast(Player* player, Spell* spell, bool skipCheck);
1231  void OnPlayerLogin(Player* player, bool firstLogin);
1232  void OnPlayerLogout(Player* player);
1233  void OnPlayerCreate(Player* player);
1234  void OnPlayerDelete(ObjectGuid guid, uint32 accountId);
1235  void OnPlayerFailedDelete(ObjectGuid guid, uint32 accountId);
1236  void OnPlayerSave(Player* player);
1237  void OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapid, bool permanent, uint8 extendState);
1238  void OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newArea);
1239  void OnQuestStatusChange(Player* player, uint32 questId);
1240  void OnPlayerRepop(Player* player);
1241  void OnMovieComplete(Player* player, uint32 movieId);
1242  void OnPlayerChoiceResponse(Player* player, uint32 choiceId, uint32 responseId);
1243 
1244  public: /* AccountScript */
1245 
1246  void OnAccountLogin(uint32 accountId);
1247  void OnFailedAccountLogin(uint32 accountId);
1248  void OnEmailChange(uint32 accountId);
1249  void OnFailedEmailChange(uint32 accountId);
1250  void OnPasswordChange(uint32 accountId);
1251  void OnFailedPasswordChange(uint32 accountId);
1252 
1253  public: /* GuildScript */
1254 
1255  void OnGuildAddMember(Guild* guild, Player* player, uint8 plRank);
1256  void OnGuildRemoveMember(Guild* guild, ObjectGuid guid, bool isDisbanding, bool isKicked);
1257  void OnGuildMOTDChanged(Guild* guild, const std::string& newMotd);
1258  void OnGuildInfoChanged(Guild* guild, const std::string& newInfo);
1259  void OnGuildCreate(Guild* guild, Player* leader, const std::string& name);
1260  void OnGuildDisband(Guild* guild);
1261  void OnGuildMemberWitdrawMoney(Guild* guild, Player* player, uint64 &amount, bool isRepair);
1262  void OnGuildMemberDepositMoney(Guild* guild, Player* player, uint64 &amount);
1263  void OnGuildItemMove(Guild* guild, Player* player, Item* pItem, bool isSrcBank, uint8 srcContainer, uint8 srcSlotId,
1264  bool isDestBank, uint8 destContainer, uint8 destSlotId);
1265  void OnGuildEvent(Guild* guild, uint8 eventType, ObjectGuid::LowType playerGuid1, ObjectGuid::LowType playerGuid2, uint8 newRank);
1266  void OnGuildBankEvent(Guild* guild, uint8 eventType, uint8 tabId, ObjectGuid::LowType playerGuid, uint64 itemOrMoney, uint16 itemStackCount, uint8 destTabId);
1267 
1268  public: /* GroupScript */
1269 
1270  void OnGroupAddMember(Group* group, ObjectGuid guid);
1271  void OnGroupInviteMember(Group* group, ObjectGuid guid);
1272  void OnGroupRemoveMember(Group* group, ObjectGuid guid, RemoveMethod method, ObjectGuid kicker, char const* reason);
1273  void OnGroupChangeLeader(Group* group, ObjectGuid newLeaderGuid, ObjectGuid oldLeaderGuid);
1274  void OnGroupDisband(Group* group);
1275 
1276  public: /* UnitScript */
1277 
1278  void OnHeal(Unit* healer, Unit* reciever, uint32& gain);
1279  void OnDamage(Unit* attacker, Unit* victim, uint32& damage);
1280  void ModifyPeriodicDamageAurasTick(Unit* target, Unit* attacker, uint32& damage);
1281  void ModifyMeleeDamage(Unit* target, Unit* attacker, uint32& damage);
1282  void ModifySpellDamageTaken(Unit* target, Unit* attacker, int32& damage, SpellInfo const* spellInfo);
1283 
1284  public: /* AreaTriggerEntityScript */
1285 
1286  bool CanCreateAreaTriggerAI(uint32 scriptId) const;
1287  AreaTriggerAI* GetAreaTriggerAI(AreaTrigger* areaTrigger);
1288 
1289  public: /* ConversationScript */
1290 
1291  void OnConversationCreate(Conversation* conversation, Unit* creator);
1292  void OnConversationLineStarted(Conversation* conversation, uint32 lineId, Player* sender);
1293 
1294  public: /* SceneScript */
1295 
1296  void OnSceneStart(Player* player, uint32 sceneInstanceID, SceneTemplate const* sceneTemplate);
1297  void OnSceneTrigger(Player* player, uint32 sceneInstanceID, SceneTemplate const* sceneTemplate, std::string const& triggerName);
1298  void OnSceneCancel(Player* player, uint32 sceneInstanceID, SceneTemplate const* sceneTemplate);
1299  void OnSceneComplete(Player* player, uint32 sceneInstanceID, SceneTemplate const* sceneTemplate);
1300 
1301  public: /* QuestScript */
1302 
1303  void OnQuestStatusChange(Player* player, Quest const* quest, QuestStatus oldStatus, QuestStatus newStatus);
1304  void OnQuestAcknowledgeAutoAccept(Player* player, Quest const* quest);
1305  void OnQuestObjectiveChange(Player* player, Quest const* quest, QuestObjective const& objective, int32 oldAmount, int32 newAmount);
1306 
1307  public: /* WorldStateScript */
1308 
1309  void OnWorldStateValueChange(WorldStateTemplate const* worldStateTemplate, int32 oldValue, int32 newValue, Map const* map);
1310 
1311  private:
1314 
1315  ScriptLoaderCallbackType _script_loader_callback;
1316 
1317  std::string _currentContext;
1318 };
1319 
1321 {
1322  template<typename T>
1323  using is_SpellScript = std::is_base_of<SpellScript, T>;
1324 
1325  template<typename T>
1326  using is_AuraScript = std::is_base_of<AuraScript, T>;
1327 }
1328 
1329 template <typename... Ts>
1331 {
1335 
1336 public:
1337  GenericSpellAndAuraScriptLoader(char const* name, ArgsType&& args) : SpellScriptLoader(name), _args(std::move(args)) { }
1338 
1339 private:
1340  SpellScript* GetSpellScript() const override
1341  {
1342  if constexpr (!std::is_same_v<SpellScriptType, Trinity::find_type_end>)
1343  return Trinity::new_from_tuple<SpellScriptType>(_args);
1344  else
1345  return nullptr;
1346  }
1347 
1348  AuraScript* GetAuraScript() const override
1349  {
1350  if constexpr (!std::is_same_v<AuraScriptType, Trinity::find_type_end>)
1351  return Trinity::new_from_tuple<AuraScriptType>(_args);
1352  else
1353  return nullptr;
1354  }
1355 
1357 };
1358 
1359 #define RegisterSpellScriptWithArgs(spell_script, script_name, ...) new GenericSpellAndAuraScriptLoader<spell_script, decltype(std::make_tuple(__VA_ARGS__))>(script_name, std::make_tuple(__VA_ARGS__))
1360 #define RegisterSpellScript(spell_script) RegisterSpellScriptWithArgs(spell_script, #spell_script)
1361 #define RegisterSpellAndAuraScriptPairWithArgs(script_1, script_2, script_name, ...) new GenericSpellAndAuraScriptLoader<script_1, script_2, decltype(std::make_tuple(__VA_ARGS__))>(script_name, std::make_tuple(__VA_ARGS__))
1362 #define RegisterSpellAndAuraScriptPair(script_1, script_2) RegisterSpellAndAuraScriptPairWithArgs(script_1, script_2, #script_1)
1363 
1364 template <class AI>
1366 {
1367  public:
1368  GenericCreatureScript(char const* name) : CreatureScript(name) { }
1369  CreatureAI* GetAI(Creature* me) const override { return new AI(me); }
1370 };
1371 #define RegisterCreatureAI(ai_name) new GenericCreatureScript<ai_name>(#ai_name)
1372 
1373 template <class AI, AI* (*AIFactory)(Creature*)>
1375 {
1376  public:
1377  FactoryCreatureScript(char const* name) : CreatureScript(name) { }
1378  CreatureAI* GetAI(Creature* me) const override { return AIFactory(me); }
1379 };
1380 #define RegisterCreatureAIWithFactory(ai_name, factory_fn) new FactoryCreatureScript<ai_name, &factory_fn>(#ai_name)
1381 
1382 template <class AI>
1384 {
1385  public:
1386  GenericGameObjectScript(char const* name) : GameObjectScript(name) { }
1387  GameObjectAI* GetAI(GameObject* go) const override { return new AI(go); }
1388 };
1389 #define RegisterGameObjectAI(ai_name) new GenericGameObjectScript<ai_name>(#ai_name)
1390 
1391 template <class AI, AI* (*AIFactory)(GameObject*)>
1393 {
1394  public:
1395  FactoryGameObjectScript(char const* name) : GameObjectScript(name) { }
1396  GameObjectAI* GetAI(GameObject* me) const override { return AIFactory(me); }
1397 };
1398 #define RegisterGameObjectAIWithFactory(ai_name, factory_fn) new FactoryGameObjectScript<ai_name, &factory_fn>(#ai_name)
1399 
1400 template <class AI>
1402 {
1403  public:
1405  AreaTriggerAI* GetAI(AreaTrigger* at) const override { return new AI(at); }
1406 };
1407 #define RegisterAreaTriggerAI(ai_name) new GenericAreaTriggerEntityScript<ai_name>(#ai_name)
1408 
1409 #define sScriptMgr ScriptMgr::instance()
1410 
1411 #endif
virtual void OnOpenStateChange(bool)
Definition: ScriptMgr.h:275
virtual void OnSpellCast(Player *, Spell *, bool)
Definition: ScriptMgr.h:778
Definition: CreatureData.h:582
virtual void OnZeroDifferenceCalculation(uint8 &, uint8)
Definition: ScriptMgr.h:319
virtual void OnChat(Player *, uint32, uint32, std::string &, Channel *)
Definition: ScriptMgr.h:770
virtual void OnAuctionSuccessful(AuctionHouseObject *, AuctionPosting *)
Definition: ScriptMgr.h:601
virtual void OnGiveXP(Player *, uint32 &, Unit *)
Definition: ScriptMgr.h:747
Definition: ScriptMgr.h:401
Difficulty
Definition: DBCEnums.h:664
Definition: ScriptMgr.h:453
virtual void OnChat(Player *, uint32, uint32, std::string &, Group *)
Definition: ScriptMgr.h:766
virtual void ModifyMeleeDamage(Unit *, Unit *, uint32 &)
Definition: ScriptMgr.h:447
Definition: ScriptMgr.h:375
Definition: ScriptMgr.h:264
Definition: ScriptMgr.h:197
virtual void OnLogout(Player *)
Definition: ScriptMgr.h:784
Definition: Vehicle.h:30
GenericCreatureScript(char const *name)
Definition: ScriptMgr.h:1368
virtual void OnShutdownCancel()
Definition: ScriptMgr.h:287
int8_t int8
Definition: Define.h:141
virtual bool OnUse(Player *, Item *, SpellCastTargets const &, ObjectGuid)
Definition: ScriptMgr.h:415
virtual void OnBindToInstance(Player *, Difficulty, uint32, bool, uint8)
Definition: ScriptMgr.h:799
virtual void OnPlayerRepop(Player *)
Definition: ScriptMgr.h:811
virtual void OnGrayLevelCalculation(uint8 &, uint8)
Definition: ScriptMgr.h:313
virtual InstanceScript * GetInstanceScript(InstanceMap *) const
Definition: ScriptMgr.h:387
Definition: QuestDef.h:478
virtual void OnDuelRequest(Player *, Player *)
Definition: ScriptMgr.h:753
virtual void OnUninstall(Vehicle *)
Definition: ScriptMgr.h:635
ScriptLoaderCallbackType _script_loader_callback
Definition: ScriptMgr.h:1315
Definition: ScriptMgr.h:971
virtual void OnChat(Player *, uint32, uint32, std::string &, Player *)
Definition: ScriptMgr.h:764
Definition: ConditionMgr.h:220
virtual void OnPacketReceive(WorldSession *, WorldPacket &)
Definition: ScriptMgr.h:261
virtual bool OnConditionCheck(Condition const *, ConditionSourceInfo &)
Definition: ScriptMgr.h:618
typename Trinity::find_type_if_t< Trinity::is_tuple, Ts... > ArgsType
Definition: ScriptMgr.h:1334
virtual bool OnTrigger(Player *, AreaTriggerEntry const *)
Definition: ScriptMgr.h:492
typename Trinity::find_type_if_t< Trinity::SpellScripts::is_SpellScript, Ts... > SpellScriptType
Definition: ScriptMgr.h:1332
Definition: AccountMgr.h:52
virtual void OnColorCodeCalculation(XPColorChar &, uint8, uint8)
Definition: ScriptMgr.h:316
int64_t int64
Definition: Define.h:138
Definition: SpellInfo.h:342
Definition: ScriptMgr.h:584
virtual void OnTextEmote(Player *, uint32, uint32, ObjectGuid)
Definition: ScriptMgr.h:775
virtual void OnBaseGainCalculation(uint32 &, uint8, uint8)
Definition: ScriptMgr.h:322
GameObjectAI * GetAI(GameObject *go) const override
Definition: ScriptMgr.h:1387
Definition: ScriptMgr.h:1006
Definition: ScriptMgr.h:332
Definition: ScriptMgr.h:849
Definition: ScriptMgr.h:299
virtual void OnChangeLeader(Group *, ObjectGuid, ObjectGuid)
Definition: ScriptMgr.h:912
virtual void OnConfigLoad(bool)
Definition: ScriptMgr.h:278
Definition: ScriptMgr.h:698
MapEntry const * GetEntry()
Definition: ScriptMgr.h:343
virtual void OnGainCalculation(uint32 &, Player *, Unit *)
Definition: ScriptMgr.h:325
virtual void OnMOTDChanged(Guild *, const std::string &)
Definition: ScriptMgr.h:866
Definition: QuestDef.h:393
virtual void OnInstallAccessory(Vehicle *, Creature *)
Definition: ScriptMgr.h:641
Definition: Map.h:131
uint64 LowType
Definition: ObjectGuid.h:269
virtual void OnMapChanged(Player *)
Definition: ScriptMgr.h:805
Definition: ScriptMgr.h:607
virtual void OnFailedPasswordChange(uint32)
Definition: ScriptMgr.h:846
const std::string & GetName() const
Definition: ScriptMgr.h:185
UpdatableScript()
Definition: ScriptMgr.h:201
virtual void OnDuelStart(Player *, Player *)
Definition: ScriptMgr.h:756
virtual void OnSocketOpen(std::shared_ptr< WorldSocket >)
Definition: ScriptMgr.h:249
Definition: ScriptMgr.h:542
virtual void OnDestroy(TMap *)
Definition: ScriptMgr.h:349
virtual void OnMovieComplete(Player *, uint32)
Definition: ScriptMgr.h:814
virtual void OnUpdate(TObject *, uint32)
Definition: ScriptMgr.h:214
Definition: SpellScript.h:224
virtual void OnSocketClose(std::shared_ptr< WorldSocket >)
Definition: ScriptMgr.h:253
virtual bool OnExit(Player *, AreaTriggerEntry const *)
Definition: ScriptMgr.h:495
virtual void OnQuestStatusChange(Player *, Quest const *, QuestStatus, QuestStatus)
Definition: ScriptMgr.h:982
Definition: DB2Structure.h:2488
STL namespace.
AreaTriggerScript(char const *name)
Definition: ScriptMgr.cpp:2470
virtual void OnCreate(TMap *)
Definition: ScriptMgr.h:346
Definition: AreaTriggerAI.h:26
virtual bool OnExpire(Player *, ItemTemplate const *)
Definition: ScriptMgr.h:418
Definition: ScriptMgr.h:1374
std::string _currentContext
Definition: ScriptMgr.h:1317
Definition: Transport.h:29
virtual void OnUnloadGridMap(TMap *, GridMap *, uint32, uint32)
Definition: ScriptMgr.h:355
ScriptMgr & operator=(ScriptMgr const &right)=delete
virtual void OnCompleted(Player *, AchievementEntry const *)
Definition: ScriptMgr.h:695
Definition: Object.h:430
Definition: Creature.h:69
virtual void OnChange(Weather *, WeatherState, float)
Definition: ScriptMgr.h:581
virtual void OnRelocate(Transport *, uint32, float, float, float)
Definition: ScriptMgr.h:681
virtual void OnChat(Player *, uint32, uint32, std::string &, Guild *)
Definition: ScriptMgr.h:768
Definition: ScriptMgr.h:232
virtual bool OnRemove(Player *, Item *)
Definition: ScriptMgr.h:421
Definition: ScriptMgr.h:1383
FactoryCreatureScript(char const *name)
Definition: ScriptMgr.h:1377
virtual void OnUpdateZone(Player *, uint32, uint32)
Definition: ScriptMgr.h:802
virtual void OnShutdown()
Definition: ScriptMgr.h:296
Definition: Channel.h:130
Definition: GameObjectAI.h:43
virtual void OnFailedAccountLogin(uint32)
Definition: ScriptMgr.h:834
Definition: ScriptMgr.h:948
virtual void OnBankEvent(Guild *, uint8, uint8, ObjectGuid::LowType, uint64, uint16, uint8)
Definition: ScriptMgr.h:889
virtual void OnSave(Player *)
Definition: ScriptMgr.h:796
Definition: ObjectMgr.h:847
SpellEffIndex
Definition: SharedDefines.h:27
virtual void OnAddMember(Group *, ObjectGuid)
Definition: ScriptMgr.h:903
virtual void OnChat(Player *, uint32, uint32, std::string &)
Definition: ScriptMgr.h:762
const std::string _name
Definition: ScriptMgr.h:194
Definition: ScriptMgr.h:991
virtual void OnDelete(ObjectGuid, uint32)
Definition: ScriptMgr.h:790
std::is_base_of< SpellScript, T > is_SpellScript
Definition: ScriptMgr.h:1323
virtual void OnInstall(Vehicle *)
Definition: ScriptMgr.h:632
virtual void OnPacketSend(WorldSession *, WorldPacket &)
Definition: ScriptMgr.h:257
virtual void ModifySpellDamageTaken(Unit *, Unit *, int32 &, SpellInfo const *)
Definition: ScriptMgr.h:450
Definition: DynamicObject.h:36
virtual void OnLogin(Player *, bool)
Definition: ScriptMgr.h:781
virtual void OnCreate(Player *)
Definition: ScriptMgr.h:787
Definition: ScriptMgr.h:556
virtual void OnPlayerKilledByCreature(Creature *, Player *)
Definition: ScriptMgr.h:729
ArgsType _args
Definition: ScriptMgr.h:1356
virtual void ModifyPeriodicDamageAurasTick(Unit *, Unit *, uint32 &)
Definition: ScriptMgr.h:444
virtual void OnValueChange([[maybe_unused]] int32 worldStateId, [[maybe_unused]] int32 oldValue, [[maybe_unused]] int32 newValue, [[maybe_unused]] Map const *map)
Definition: ScriptMgr.h:1002
virtual void OnClearEmote(Player *)
Definition: ScriptMgr.h:773
Definition: Map.h:945
Definition: DB2Structure.h:28
Definition: Map.h:988
Definition: Tuples.h:37
virtual void OnSceneStart(Player *, uint32, SceneTemplate const *)
Definition: ScriptMgr.h:959
virtual void OnInfoChanged(Guild *, const std::string &)
Definition: ScriptMgr.h:869
virtual void OnSceneComplete(Player *, uint32, SceneTemplate const *)
Definition: ScriptMgr.h:968
virtual void OnFailedDelete(ObjectGuid, uint32)
Definition: ScriptMgr.h:793
GameObjectAI * GetAI(GameObject *me) const override
Definition: ScriptMgr.h:1396
std::string const & GetCurrentScriptContext() const
Returns the current script context.
Definition: ScriptMgr.h:1053
virtual void OnQuestStatusChange(Player *, uint32)
Definition: ScriptMgr.h:808
virtual void OnAddPassenger(Transport *, Player *)
Definition: ScriptMgr.h:672
virtual void OnDamage(Unit *, Unit *, uint32 &)
Definition: ScriptMgr.h:441
virtual bool OnQuestAccept(Player *, Item *, Quest const *)
Definition: ScriptMgr.h:412
MapEntry const * _mapEntry
Definition: ScriptMgr.h:334
uint32 _scriptCount
Definition: ScriptMgr.h:1312
MapScript(MapEntry const *mapEntry)
Definition: ScriptMgr.h:338
Definition: ScriptMgr.h:515
Definition: Item.h:169
virtual void OnAuctionRemove(AuctionHouseObject *, AuctionPosting *)
Definition: ScriptMgr.h:598
FactoryGameObjectScript(char const *name)
Definition: ScriptMgr.h:1395
Definition: WorldSocket.h:85
virtual void OnNetworkStop()
Definition: ScriptMgr.h:246
virtual void OnDisband(Group *)
Definition: ScriptMgr.h:915
int32_t int32
Definition: Define.h:139
Definition: CreatureAI.h:58
virtual void OnAddMember(Guild *, Player *, uint8)
Definition: ScriptMgr.h:860
GenericGameObjectScript(char const *name)
Definition: ScriptMgr.h:1386
uint32_t uint32
Definition: Define.h:143
virtual void OnHonorCalculation(float &, uint8, float)
Definition: ScriptMgr.h:310
uint64_t uint64
Definition: Define.h:142
Definition: Battlefield.h:209
CreatureAI * GetAI(Creature *me) const override
Definition: ScriptMgr.h:1369
Definition: ScriptMgr.h:820
Definition: ChatCommand.h:41
Definition: ConditionMgr.h:211
uint16_t uint16
Definition: Define.h:144
SpellScript * GetSpellScript() const override
Definition: ScriptMgr.h:1340
Definition: ScriptMgr.h:1330
Definition: GameObject.h:125
Definition: ScriptMgr.h:364
virtual void OnRemovePassenger(Transport *, Player *)
Definition: ScriptMgr.h:678
virtual void OnReset(Vehicle *)
Definition: ScriptMgr.h:638
virtual void OnLoadGridMap(TMap *, GridMap *, uint32, uint32)
Definition: ScriptMgr.h:352
Definition: ScriptMgr.h:1320
bool _scriptIdUpdated
Definition: ScriptMgr.h:1313
friend class ScriptObject
Definition: ScriptMgr.h:1008
Definition: ScriptMgr.h:528
Definition: ScriptMgr.h:174
Definition: Map.h:264
Definition: SpellDefines.h:321
virtual void OnEvent(Guild *, uint8, ObjectGuid::LowType, ObjectGuid::LowType, uint8)
Definition: ScriptMgr.h:887
AuraScript * GetAuraScript() const override
Definition: ScriptMgr.h:1348
Definition: ScriptMgr.h:1401
virtual void OnCreatureKill(Player *, Creature *)
Definition: ScriptMgr.h:726
virtual void OnItemMove(Guild *, Player *, Item *, bool, uint8, uint8, bool, uint8, uint8)
Definition: ScriptMgr.h:884
Definition: ScriptMgr.h:481
virtual void OnLevelChanged(Player *, uint8)
Definition: ScriptMgr.h:732
Definition: ScriptMgr.h:621
virtual void OnAuctionExpire(AuctionHouseObject *, AuctionPosting *)
Definition: ScriptMgr.h:604
virtual void OnPasswordChange(uint32)
Definition: ScriptMgr.h:843
Definition: ScriptMgr.h:892
Definition: ScriptMgr.h:570
ShutdownExitCode
Definition: World.h:71
Definition: ScriptMgr.h:650
virtual void OnTalentsReset(Player *, bool)
Definition: ScriptMgr.h:738
virtual void OnHeal(Unit *, Unit *, uint32 &)
Definition: ScriptMgr.h:438
Definition: ScriptMgr.h:1392
friend class ScriptMgr
Definition: ScriptMgr.h:176
void DecreaseScriptCount()
Definition: ScriptMgr.h:1023
virtual ~UpdatableScript()
Definition: ScriptMgr.h:205
virtual void OnAuctionAdd(AuctionHouseObject *, AuctionPosting *)
Definition: ScriptMgr.h:595
virtual SpellScript * GetSpellScript() const
Definition: ScriptMgr.h:226
virtual void OnPVPKill(Player *, Player *)
Definition: ScriptMgr.h:723
void IncreaseScriptCount()
Definition: ScriptMgr.h:1022
Definition: OutdoorPvP.h:189
Definition: ItemTemplate.h:735
virtual void OnEmailChange(uint32)
Definition: ScriptMgr.h:837
BattlegroundTypeId
Definition: SharedDefines.h:6098
Definition: ScriptMgr.h:467
Definition: ScriptMgr.h:661
Definition: ScriptMgr.h:712
typename Trinity::find_type_if_t< Trinity::SpellScripts::is_AuraScript, Ts... > AuraScriptType
Definition: ScriptMgr.h:1333
virtual void OnPlayerLeave(TMap *, Player *)
Definition: ScriptMgr.h:361
virtual void OnRemoveMember(Guild *, ObjectGuid, bool, bool)
Definition: ScriptMgr.h:863
Definition: Conversation.h:29
#define TC_GAME_API
Definition: Define.h:124
virtual void OnDisband(Guild *)
Definition: ScriptMgr.h:875
Definition: ScriptMgr.h:1365
virtual void OnNetworkStart()
Definition: ScriptMgr.h:243
Definition: ScriptMgr.h:427
ScriptObject & operator=(ScriptObject const &right)=delete
virtual void OnReputationChange(Player *, uint32, int32 &, bool)
Definition: ScriptMgr.h:750
Emote
Definition: SharedDefines.h:3131
Definition: InstanceScript.h:149
virtual void OnGroupRateCalculation(float &, uint32, bool)
Definition: ScriptMgr.h:328
virtual void OnInviteMember(Group *, ObjectGuid)
Definition: ScriptMgr.h:906
uint8_t uint8
Definition: Define.h:145
Definition: Position.h:27
virtual void OnConversationCreate(Conversation *, Unit *)
Definition: ScriptMgr.h:942
virtual void OnSceneCancel(Player *, uint32, SceneTemplate const *)
Definition: ScriptMgr.h:965
Definition: WorldStateDefines.h:25
virtual void OnFreeTalentPointsChanged(Player *, uint32)
Definition: ScriptMgr.h:735
Definition: AuctionHouseMgr.h:277
virtual AuraScript * GetAuraScript() const
Definition: ScriptMgr.h:229
virtual void OnMoneyLimit(Player *, int64)
Definition: ScriptMgr.h:744
virtual void OnRemoveMember(Group *, ObjectGuid, RemoveMethod, ObjectGuid, char const *)
Definition: ScriptMgr.h:909
AreaTriggerAI * GetAI(AreaTrigger *at) const override
Definition: ScriptMgr.h:1405
Definition: ScriptMgr.h:217
Definition: Battleground.h:267
virtual void OnSceneTriggerEvent(Player *, uint32, SceneTemplate const *, std::string const &)
Definition: ScriptMgr.h:962
Definition: DB2Structure.h:172
virtual void OnShutdownInitiate(ShutdownExitCode, ShutdownMask)
Definition: ScriptMgr.h:284
void Initialize()
Definition: CreatureAIRegistry.cpp:35
Player session in the World.
Definition: WorldSession.h:958
virtual void OnMemberDepositMoney(Guild *, Player *, uint64 &)
Definition: ScriptMgr.h:881
virtual void OnPlayerChoiceResponse(Player *, uint32, uint32)
Definition: ScriptMgr.h:817
Definition: ObjectGuid.h:258
virtual void OnQuestObjectiveChange(Player *, Quest const *, QuestObjective const &, int32, int32)
Definition: ScriptMgr.h:988
Weather for one zone.
Definition: Weather.h:65
Definition: SpellScript.h:674
uint32 GetScriptCount() const
Definition: ScriptMgr.h:1030
Definition: ScriptMgr.h:390
XPColorChar
Definition: SharedDefines.h:6297
Definition: SpellAuras.h:121
GenericAreaTriggerEntityScript(char const *name)
Definition: ScriptMgr.h:1404
virtual void OnMotdChange(std::string &)
Definition: ScriptMgr.h:281
typename find_type_if< Check, Ts... >::type find_type_if_t
Definition: Types.h:65
std::is_base_of< AuraScript, T > is_AuraScript
Definition: ScriptMgr.h:1326
CreatureAI * GetAI(Creature *me) const override
Definition: ScriptMgr.h:1378
Definition: Guild.h:305
Definition: Unit.h:746
virtual AreaTriggerAI * GetAI(AreaTrigger *) const
Definition: ScriptMgr.h:929
QuestStatus
Definition: QuestDef.h:139
Definition: ScriptMgr.h:684
DuelCompleteType
Definition: SharedDefines.h:6345
Definition: ScriptMgr.h:932
virtual void OnRemovePassenger(Vehicle *, Unit *)
Definition: ScriptMgr.h:647
Definition: Player.h:1131
virtual void OnMemberWitdrawMoney(Guild *, Player *, uint64 &, bool)
Definition: ScriptMgr.h:878
ShutdownMask
Definition: World.h:64
Definition: WorldPacket.h:25
GenericSpellAndAuraScriptLoader(char const *name, ArgsType &&args)
Definition: ScriptMgr.h:1337
void SetScriptLoader(ScriptLoaderCallbackType script_loader_callback)
Definition: ScriptMgr.h:1036
virtual void OnAccountLogin(uint32)
Definition: ScriptMgr.h:831
Definition: CreatureData.h:397
WeatherState
Definition: Weather.h:45
virtual void OnStartup()
Definition: ScriptMgr.h:293
virtual void OnAddCreaturePassenger(Transport *, Creature *)
Definition: ScriptMgr.h:675
virtual void OnConversationLineStarted(Conversation *, uint32, Player *)
Definition: ScriptMgr.h:945
virtual void OnPlayerEnter(TMap *, Player *)
Definition: ScriptMgr.h:358
virtual bool OnCastItemCombatSpell(Player *, Unit *, SpellInfo const *, Item *)
Definition: ScriptMgr.h:424
virtual void OnDuelEnd(Player *, Player *, DuelCompleteType)
Definition: ScriptMgr.h:759
virtual void OnCreate(Guild *, Player *, const std::string &)
Definition: ScriptMgr.h:872
virtual void OnAddPassenger(Vehicle *, Unit *, int8)
Definition: ScriptMgr.h:644
Definition: Group.h:221
Definition: AreaTrigger.h:42
Definition: ScriptMgr.h:918
virtual void OnFailedEmailChange(uint32)
Definition: ScriptMgr.h:840
RemoveMethod
Definition: SharedDefines.h:6306
Definition: AuctionHouseMgr.h:235
virtual void OnAcknowledgeAutoAccept(Player *, Quest const *)
Definition: ScriptMgr.h:985
Definition: ScriptReloadMgr.h:34
Definition: ScriptMgr.h:498
virtual void OnMoneyChanged(Player *, int64 &)
Definition: ScriptMgr.h:741
virtual void OnUpdate(uint32)
Definition: ScriptMgr.h:290
Definition: Spell.h:238