diff --git a/Hooks.h b/Hooks.h index 24aeee8..279ddd2 100644 --- a/Hooks.h +++ b/Hooks.h @@ -136,10 +136,10 @@ namespace Hooks WEATHER_EVENT_ON_CHANGE = 25, // (event, zoneId, state, grade) // Auction house - AUCTION_EVENT_ON_ADD = 26, // (event, AHObject) - AUCTION_EVENT_ON_REMOVE = 27, // (event, AHObject) - AUCTION_EVENT_ON_SUCCESSFUL = 28, // (event, AHObject) // Not Implemented - AUCTION_EVENT_ON_EXPIRE = 29, // (event, AHObject) // Not Implemented + AUCTION_EVENT_ON_ADD = 26, // (event, auctionHouseEntry, player, item, bid, buyout, etime) + AUCTION_EVENT_ON_REMOVE = 27, // (event, auctionHouseEntry, player, item) + AUCTION_EVENT_ON_SUCCESSFUL = 28, // (event, auctionHouseEntry) // Not Implemented + AUCTION_EVENT_ON_EXPIRE = 29, // (event, auctionHouseEntry) // Not Implemented // AddOns ADDON_EVENT_ON_MESSAGE = 30, // (event, sender, type, prefix, msg, target) - target can be nil/whisper_target/guild/group/channel. Can return false diff --git a/LuaEngine.h b/LuaEngine.h index f106a70..83a6cb2 100644 --- a/LuaEngine.h +++ b/LuaEngine.h @@ -442,10 +442,10 @@ public: void OnChange(Weather* weather, uint32 zone, WeatherState state, float grade); /* Auction House */ - void OnAdd(AuctionHouseObject* auctionHouse); - void OnRemove(AuctionHouseObject* auctionHouse); - void OnSuccessful(AuctionHouseObject* auctionHouse); - void OnExpire(AuctionHouseObject* auctionHouse); + void OnAdd(AuctionHouseEntry const* auctionHouseEntry, Player* pPlayer, Item* pItem, uint32 bid, uint32 buyout, uint32 etime); + void OnRemove(AuctionHouseEntry const* auctionHouseEntry, Player* pPlayer, Item* pItem); + void OnSuccessful(AuctionHouseEntry const* auctionHouseEntry); + void OnExpire(AuctionHouseEntry const* auctionHouseEntry); /* Guild */ void OnAddMember(Guild* guild, Player* player, uint32 plRank); diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index afc807f..791e013 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -1218,7 +1218,7 @@ ElunaRegister CorpseMethods[] = { NULL, NULL } }; -ElunaRegister AuctionMethods[] = +ElunaRegister AuctionMethods[] = { { NULL, NULL } }; @@ -1380,8 +1380,8 @@ void RegisterFunctions(Eluna* E) ElunaTemplate::Register(E, "Map"); ElunaTemplate::SetMethods(E, MapMethods); - ElunaTemplate::Register(E, "AuctionHouseObject"); - ElunaTemplate::SetMethods(E, AuctionMethods); + ElunaTemplate::Register(E, "AuctionHouseEntry"); + ElunaTemplate::SetMethods(E, AuctionMethods); ElunaTemplate::Register(E, "BattleGround"); ElunaTemplate::SetMethods(E, BattleGroundMethods); diff --git a/ServerHooks.cpp b/ServerHooks.cpp index 6391556..0de14b8 100644 --- a/ServerHooks.cpp +++ b/ServerHooks.cpp @@ -82,43 +82,50 @@ void Eluna::OnChange(Weather* weather, uint32 zone, WeatherState state, float gr } // Auction House -void Eluna::OnAdd(AuctionHouseObject* ah) +void Eluna::OnAdd(AuctionHouseEntry const* auctionHouseEntry, Player* pPlayer, Item* pItem, uint32 bid, uint32 buyout, uint32 etime) { if (!ServerEventBindings->HasEvents(AUCTION_EVENT_ON_ADD)) return; LOCK_ELUNA; - Push(ah); + Push(auctionHouseEntry); + Push(pPlayer); + Push(pItem); + Push(bid); + Push(buyout); + Push(etime); CallAllFunctions(ServerEventBindings, AUCTION_EVENT_ON_ADD); } -void Eluna::OnRemove(AuctionHouseObject* ah) +void Eluna::OnRemove(AuctionHouseEntry const* auctionHouseEntry, Player* pPlayer, Item* pItem) { if (!ServerEventBindings->HasEvents(AUCTION_EVENT_ON_REMOVE)) return; LOCK_ELUNA; - Push(ah); + Push(auctionHouseEntry); + Push(pPlayer); + Push(pItem); CallAllFunctions(ServerEventBindings, AUCTION_EVENT_ON_REMOVE); } -void Eluna::OnSuccessful(AuctionHouseObject* ah) +void Eluna::OnSuccessful(AuctionHouseEntry const* auctionHouseEntry) { if (!ServerEventBindings->HasEvents(AUCTION_EVENT_ON_SUCCESSFUL)) return; LOCK_ELUNA; - Push(ah); + Push(auctionHouseEntry); CallAllFunctions(ServerEventBindings, AUCTION_EVENT_ON_SUCCESSFUL); } -void Eluna::OnExpire(AuctionHouseObject* ah) +void Eluna::OnExpire(AuctionHouseEntry const* auctionHouseEntry) { if (!ServerEventBindings->HasEvents(AUCTION_EVENT_ON_EXPIRE)) return; LOCK_ELUNA; - Push(ah); + Push(auctionHouseEntry); CallAllFunctions(ServerEventBindings, AUCTION_EVENT_ON_EXPIRE); }