Merge pull request #144 from ElunaLuaEngine/auctionshouse

Auctionshouse Hooks Updates
This commit is contained in:
Salja
2015-01-28 10:46:36 +01:00
4 changed files with 26 additions and 19 deletions

View File

@@ -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

View File

@@ -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);

View File

@@ -1218,7 +1218,7 @@ ElunaRegister<Corpse> CorpseMethods[] =
{ NULL, NULL }
};
ElunaRegister<AuctionHouseObject> AuctionMethods[] =
ElunaRegister<AuctionHouseEntry> AuctionMethods[] =
{
{ NULL, NULL }
};
@@ -1380,8 +1380,8 @@ void RegisterFunctions(Eluna* E)
ElunaTemplate<Map>::Register(E, "Map");
ElunaTemplate<Map>::SetMethods(E, MapMethods);
ElunaTemplate<AuctionHouseObject>::Register(E, "AuctionHouseObject");
ElunaTemplate<AuctionHouseObject>::SetMethods(E, AuctionMethods);
ElunaTemplate<AuctionHouseEntry>::Register(E, "AuctionHouseEntry");
ElunaTemplate<AuctionHouseEntry>::SetMethods(E, AuctionMethods);
ElunaTemplate<BattleGround>::Register(E, "BattleGround");
ElunaTemplate<BattleGround>::SetMethods(E, BattleGroundMethods);

View File

@@ -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);
}