mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 07:06:23 +00:00
Updated ScriptMgr with new function to favorite transmog module
This commit is contained in:
@@ -1323,6 +1323,11 @@ void ScriptMgr::OnPlayerBeingCharmed(Player* player, Unit* charmer, uint32 oldFa
|
||||
FOREACH_SCRIPT(PlayerScript)->OnBeingCharmed(player, charmer, oldFactionId, newFactionId);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnAfterPlayerSetVisibleItemSlot(Player* player, uint8 slot, Item *item)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnAfterSetVisibleItemSlot(player, slot,item);
|
||||
}
|
||||
|
||||
// Guild
|
||||
void ScriptMgr::OnGuildAddMember(Guild* guild, Player* player, uint8& plRank)
|
||||
{
|
||||
@@ -1411,6 +1416,19 @@ void ScriptMgr::OnGroupDisband(Group* group)
|
||||
FOREACH_SCRIPT(GroupScript)->OnDisband(group);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnGlobalItemDelFromDB(SQLTransaction& trans, uint32 itemGuid)
|
||||
{
|
||||
ASSERT(trans);
|
||||
ASSERT(itemGuid);
|
||||
|
||||
FOREACH_SCRIPT(GlobalScript)->OnItemDelFromDB(trans,itemGuid);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnGlobalMirrorImageDisplayItem(const Item *item, uint32 &display)
|
||||
{
|
||||
FOREACH_SCRIPT(GlobalScript)->OnMirrorImageDisplayItem(item,display);
|
||||
}
|
||||
|
||||
SpellScriptLoader::SpellScriptLoader(const char* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
@@ -1555,6 +1573,12 @@ GroupScript::GroupScript(const char* name)
|
||||
ScriptRegistry<GroupScript>::AddScript(this);
|
||||
}
|
||||
|
||||
GlobalScript::GlobalScript(const char* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
ScriptRegistry<GlobalScript>::AddScript(this);
|
||||
}
|
||||
|
||||
// Instantiate static members of ScriptRegistry.
|
||||
template<class TScript> std::map<uint32, TScript*> ScriptRegistry<TScript>::ScriptPointerList;
|
||||
template<class TScript> std::vector<TScript*> ScriptRegistry<TScript>::ALScripts;
|
||||
@@ -1585,6 +1609,7 @@ template class ScriptRegistry<AchievementCriteriaScript>;
|
||||
template class ScriptRegistry<PlayerScript>;
|
||||
template class ScriptRegistry<GuildScript>;
|
||||
template class ScriptRegistry<GroupScript>;
|
||||
template class ScriptRegistry<GlobalScript>;
|
||||
|
||||
// Undefine utility macros.
|
||||
#undef GET_SCRIPT_RET
|
||||
|
||||
@@ -235,7 +235,7 @@ class WorldScript : public ScriptObject
|
||||
|
||||
// Called after the world configuration is (re)loaded.
|
||||
virtual void OnAfterConfigLoad(bool /*reload*/) { }
|
||||
|
||||
|
||||
// Called before the world configuration is (re)loaded.
|
||||
virtual void OnBeforeConfigLoad(bool /*reload*/) { }
|
||||
|
||||
@@ -303,7 +303,7 @@ template<class TMap> class MapScript : public UpdatableScript<TMap>
|
||||
public:
|
||||
void checkMap() {
|
||||
_mapEntry = sMapStore.LookupEntry(_mapId);
|
||||
|
||||
|
||||
if (!_mapEntry)
|
||||
sLog->outError("Invalid MapScript for %u; no such map ID.", _mapId);
|
||||
}
|
||||
@@ -783,8 +783,11 @@ class PlayerScript : public ScriptObject
|
||||
// Called when a player selects an option in a player gossip window
|
||||
virtual void OnGossipSelectCode(Player* /*player*/, uint32 /*menu_id*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/) { }
|
||||
|
||||
// On player getting charmed
|
||||
// On player getting charmed
|
||||
virtual void OnBeingCharmed(Player* /*player*/, Unit* /*charmer*/, uint32 /*oldFactionId*/, uint32 /*newFactionId*/) { }
|
||||
|
||||
// To change behaviour of set visible item slot
|
||||
virtual void OnAfterSetVisibleItemSlot(Player* /*player*/, uint8 /*slot*/, Item* /*item*/) { }
|
||||
};
|
||||
|
||||
class GuildScript : public ScriptObject
|
||||
@@ -856,6 +859,20 @@ class GroupScript : public ScriptObject
|
||||
virtual void OnDisband(Group* /*group*/) { }
|
||||
};
|
||||
|
||||
// following hooks can be used anywhere and are not db bounded
|
||||
class GlobalScript : public ScriptObject
|
||||
{
|
||||
protected:
|
||||
|
||||
GlobalScript(const char* name);
|
||||
|
||||
public:
|
||||
|
||||
// items
|
||||
virtual void OnItemDelFromDB(SQLTransaction& /*trans*/, uint32 /*itemGuid*/) { }
|
||||
virtual void OnMirrorImageDisplayItem(const Item* /*item*/, uint32& /*display*/) { }
|
||||
};
|
||||
|
||||
// Placed here due to ScriptRegistry::AddScript dependency.
|
||||
#define sScriptMgr ACE_Singleton<ScriptMgr, ACE_Null_Mutex>::instance()
|
||||
|
||||
@@ -1067,6 +1084,7 @@ class ScriptMgr
|
||||
void OnGossipSelect(Player* player, uint32 menu_id, uint32 sender, uint32 action);
|
||||
void OnGossipSelectCode(Player* player, uint32 menu_id, uint32 sender, uint32 action, const char* code);
|
||||
void OnPlayerBeingCharmed(Player* player, Unit* charmer, uint32 oldFactionId, uint32 newFactionId);
|
||||
void OnAfterPlayerSetVisibleItemSlot(Player* player, uint8 /*slot*/, Item *item);
|
||||
|
||||
public: /* GuildScript */
|
||||
|
||||
@@ -1091,6 +1109,10 @@ class ScriptMgr
|
||||
void OnGroupChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLeaderGuid);
|
||||
void OnGroupDisband(Group* group);
|
||||
|
||||
public: /* GlobalScript */
|
||||
void OnGlobalItemDelFromDB(SQLTransaction& trans, uint32 itemGuid);
|
||||
void OnGlobalMirrorImageDisplayItem(const Item *item, uint32 &display);
|
||||
|
||||
public: /* Scheduled scripts */
|
||||
|
||||
uint32 IncreaseScheduledScriptsCount() { return ++_scheduledScripts; }
|
||||
@@ -1147,7 +1169,7 @@ class ScriptRegistry
|
||||
static void AddALScripts() {
|
||||
for(ScriptVectorIterator it = ALScripts.begin(); it != ALScripts.end(); ++it) {
|
||||
TScript* const script = *it;
|
||||
|
||||
|
||||
script->checkValidity();
|
||||
|
||||
if (script->IsDatabaseBound()) {
|
||||
|
||||
Reference in New Issue
Block a user