Created hooks for first login and LFGMgr

This commit is contained in:
Matteo
2017-05-07 13:00:05 +02:00
committed by Yehonal
parent abc01d62f6
commit bd4ec74318
3 changed files with 31 additions and 1 deletions

View File

@@ -419,6 +419,9 @@ void LFGMgr::InitializeLockedDungeons(Player* player, uint8 level /* = 0 */)
lockData = LFG_LOCKSTATUS_MISSING_ITEM;
}
sScriptMgr->OnInitializeLockedDungeons(player, level, lockData);
/* TODO VoA closed if WG is not under team control (LFG_LOCKSTATUS_RAID_LOCKED)
lockData = LFG_LOCKSTATUS_TOO_LOW_GEAR_SCORE;
lockData = LFG_LOCKSTATUS_TOO_HIGH_GEAR_SCORE;
@@ -429,6 +432,9 @@ void LFGMgr::InitializeLockedDungeons(Player* player, uint8 level /* = 0 */)
if (lockData)
lock[dungeon->Entry()] = lockData;
}
sScriptMgr->OnAfterInitializeLockedDungeons(player);
SetLockedDungeons(guid, lock);
}
@@ -713,7 +719,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
*/
void LFGMgr::LeaveLfg(uint64 guid)
{
;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::Leave: [" UI64FMTD "]", guid);
//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::LeaveLfg: [" UI64FMTD "]", guid);
uint64 gguid = IS_GROUP_GUID(guid) ? guid : GetGroup(guid);
LfgState state = GetState(guid);

View File

@@ -1379,6 +1379,11 @@ void ScriptMgr::OnQuestRewardItem(Player* player, Item* item, uint32 count)
FOREACH_SCRIPT(PlayerScript)->OnQuestRewardItem(player, item, count);
}
void ScriptMgr::OnFirstLogin(Player* player)
{
FOREACH_SCRIPT(PlayerScript)->OnFirstLogin(player);
}
// Guild
void ScriptMgr::OnGuildAddMember(Guild* guild, Player* player, uint8& plRank)
{
@@ -1495,6 +1500,16 @@ void ScriptMgr::OnBeforeDropAddItem(Player const* player, Loot& loot, LootStoreI
FOREACH_SCRIPT(GlobalScript)->OnBeforeDropAddItem(player, loot, LootStoreItem);
}
void ScriptMgr::OnInitializeLockedDungeons(Player* player, uint8& level, uint32& lockData)
{
FOREACH_SCRIPT(GlobalScript)->OnInitializeLockedDungeons(player, level, lockData);
}
void ScriptMgr::OnAfterInitializeLockedDungeons(Player* player)
{
FOREACH_SCRIPT(GlobalScript)->OnAfterInitializeLockedDungeons(player);
}
uint32 ScriptMgr::DealDamage(Unit* AttackerUnit, Unit *pVictim, uint32 damage, DamageEffectType damagetype)
{
FOR_SCRIPTS_RET(UnitScript, itr, end, damage)

View File

@@ -906,6 +906,8 @@ class PlayerScript : public ScriptObject
virtual void OnAfterUpdateAttackPowerAndDamage(Player* /*player*/, float& /*level*/, float& /*base_attPower*/, float& /*attPowerMod*/, float& /*attPowerMultiplier*/, bool /*ranged*/) { }
virtual void OnBeforeInitTalentForLevel(Player* /*player*/, uint8& /*level*/, uint32& /*talentPointsForLevel*/) { }
virtual void OnFirstLogin(Player* /*player*/) { }
};
class GuildScript : public ScriptObject
@@ -991,6 +993,9 @@ class GlobalScript : public ScriptObject
virtual void OnMirrorImageDisplayItem(const Item* /*item*/, uint32& /*display*/) { }
virtual void OnAfterRefCount(LootStoreItem* /*LootStoreItem*/, uint32& /*maxcount*/) { }
virtual void OnBeforeDropAddItem(Player const* /*player*/, Loot& /*loot*/, LootStoreItem* /*LootStoreItem*/) { }
virtual void OnInitializeLockedDungeons(Player* /*player*/, uint8& /*level*/, uint32& /*lockData*/) { }
virtual void OnAfterInitializeLockedDungeons(Player* /*player*/) { }
// On Before arena points distribution
virtual void OnBeforeUpdateArenaPoints(ArenaTeam* /*at*/, std::map<uint32, uint32> & /*ap*/) { }
@@ -1225,6 +1230,7 @@ class ScriptMgr
void OnBeforeUpdateAttackPowerAndDamage(Player* player, float& level, float& val2, bool ranged);
void OnAfterUpdateAttackPowerAndDamage(Player* player, float& level, float& base_attPower, float& attPowerMod, float& attPowerMultiplier, bool ranged);
void OnBeforeInitTalentForLevel(Player* player, uint8& level, uint32& talentPointsForLevel);
void OnFirstLogin(Player* player);
public: /* GuildScript */
@@ -1255,6 +1261,9 @@ class ScriptMgr
void OnBeforeUpdateArenaPoints(ArenaTeam* at, std::map<uint32, uint32> &ap);
void OnAfterRefCount(LootStoreItem* LootStoreItem, uint32 &maxcount);
void OnBeforeDropAddItem(Player const* player, Loot& loot, LootStoreItem* LootStoreItem);
void OnInitializeLockedDungeons(Player* player, uint8& level, uint32& lockData);
void OnAfterInitializeLockedDungeons(Player* player);
public: /* Scheduled scripts */