mirror of
https://github.com/silviu20092/mod-reforging
synced 2025-11-29 16:38:15 +08:00
Update for latest AC
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
#include "Tokenize.h"
|
#include "Tokenize.h"
|
||||||
#include "StringConvert.h"
|
#include "StringConvert.h"
|
||||||
#include "SpellMgr.h"
|
#include "SpellMgr.h"
|
||||||
|
#include "WorldSessionMgr.h"
|
||||||
#include "item_reforge.h"
|
#include "item_reforge.h"
|
||||||
|
|
||||||
ItemReforge::ItemReforge()
|
ItemReforge::ItemReforge()
|
||||||
@@ -805,8 +806,8 @@ void ItemReforge::HandleReload(Player* player, bool apply) const
|
|||||||
|
|
||||||
void ItemReforge::HandleReload(bool apply) const
|
void ItemReforge::HandleReload(bool apply) const
|
||||||
{
|
{
|
||||||
const SessionMap& sessions = sWorld->GetAllSessions();
|
const WorldSessionMgr::SessionMap& sessions = sWorldSessionMgr->GetAllSessions();
|
||||||
SessionMap::const_iterator itr;
|
WorldSessionMgr::SessionMap::const_iterator itr;
|
||||||
for (itr = sessions.begin(); itr != sessions.end(); ++itr)
|
for (itr = sessions.begin(); itr != sessions.end(); ++itr)
|
||||||
if (itr->second && itr->second->GetPlayer() && itr->second->GetPlayer()->IsInWorld())
|
if (itr->second && itr->second->GetPlayer() && itr->second->GetPlayer()->IsInWorld())
|
||||||
HandleReload(itr->second->GetPlayer(), apply);
|
HandleReload(itr->second->GetPlayer(), apply);
|
||||||
|
|||||||
@@ -37,23 +37,23 @@ public:
|
|||||||
PLAYERHOOK_ON_APPLY_ITEM_MODS_BEFORE
|
PLAYERHOOK_ON_APPLY_ITEM_MODS_BEFORE
|
||||||
}) {}
|
}) {}
|
||||||
|
|
||||||
void OnAfterMoveItemFromInventory(Player* player, Item* it, uint8 /*bag*/, uint8 /*slot*/, bool /*update*/) override
|
void OnPlayerAfterMoveItemFromInventory(Player* player, Item* it, uint8 /*bag*/, uint8 /*slot*/, bool /*update*/) override
|
||||||
{
|
{
|
||||||
sItemReforge->RemoveReforge(player, it, true);
|
sItemReforge->RemoveReforge(player, it, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnDeleteFromDB(CharacterDatabaseTransaction trans, uint32 guid) override
|
void OnPlayerDeleteFromDB(CharacterDatabaseTransaction trans, uint32 guid) override
|
||||||
{
|
{
|
||||||
trans->Append("DELETE FROM character_reforging WHERE guid = {}", guid);
|
trans->Append("DELETE FROM character_reforging WHERE guid = {}", guid);
|
||||||
sItemReforge->HandleCharacterRemove(guid);
|
sItemReforge->HandleCharacterRemove(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnLogin(Player* player) override
|
void OnPlayerLogin(Player* player) override
|
||||||
{
|
{
|
||||||
new SendReforgePackets(player);
|
new SendReforgePackets(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnApplyItemModsBefore(Player* player, uint8 slot, bool apply, uint8 itemProtoStatNumber, uint32 statType, int32& val) override
|
void OnPlayerApplyItemModsBefore(Player* player, uint8 slot, bool apply, uint8 itemProtoStatNumber, uint32 statType, int32& val) override
|
||||||
{
|
{
|
||||||
Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot);
|
Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot);
|
||||||
if (!item)
|
if (!item)
|
||||||
|
|||||||
Reference in New Issue
Block a user