mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +00:00
feat(Core/Hooks): added collection of hooks to extends AC (#3047)
This collection of hooks comes from the Maelstrom project. It allows to release modules such as : - 3v3-soloqueue - 1v1 arena - pvestats and many others
This commit is contained in:
@@ -15,22 +15,12 @@
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "PetitionMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SocialMgr.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
#define CHARTER_DISPLAY_ID 16161
|
||||
|
||||
// Charters ID in item_template
|
||||
enum CharterItemIDs
|
||||
{
|
||||
GUILD_CHARTER = 5863,
|
||||
ARENA_TEAM_CHARTER_2v2 = 23560,
|
||||
ARENA_TEAM_CHARTER_3v3 = 23561,
|
||||
ARENA_TEAM_CHARTER_5v5 = 23562
|
||||
};
|
||||
|
||||
void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
@@ -136,6 +126,8 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData)
|
||||
}
|
||||
}
|
||||
|
||||
sScriptMgr->PetitionBuy(_player, creature, charterid, cost, type);
|
||||
|
||||
if (type == GUILD_CHARTER_TYPE)
|
||||
{
|
||||
if (sGuildMgr->GetGuildByName(name))
|
||||
@@ -880,38 +872,65 @@ void WorldSession::SendPetitionShowList(uint64 guid)
|
||||
WorldPacket data(SMSG_PETITION_SHOWLIST, 8 + 1 + 4 * 6);
|
||||
data << guid; // npc guid
|
||||
|
||||
// For guild default
|
||||
uint32 CharterEntry = GUILD_CHARTER;
|
||||
uint32 CharterDispayID = CHARTER_DISPLAY_ID;
|
||||
uint32 CharterCost = sWorld->getIntConfig(CONFIG_CHARTER_COST_GUILD);
|
||||
|
||||
if (creature->IsTabardDesigner())
|
||||
{
|
||||
sScriptMgr->PetitionShowList(_player, creature, CharterEntry, CharterDispayID, CharterCost);
|
||||
|
||||
data << uint8(1); // count
|
||||
data << uint32(1); // index
|
||||
data << uint32(GUILD_CHARTER); // charter entry
|
||||
data << uint32(CHARTER_DISPLAY_ID); // charter display id
|
||||
data << uint32(sWorld->getIntConfig(CONFIG_CHARTER_COST_GUILD)); // charter cost
|
||||
data << CharterEntry; // charter entry
|
||||
data << CharterDispayID; // charter display id
|
||||
data << CharterCost; // charter cost
|
||||
data << uint32(0); // unknown
|
||||
data << uint32(sWorld->getIntConfig(CONFIG_MIN_PETITION_SIGNS)); // required signs
|
||||
}
|
||||
else
|
||||
{
|
||||
data << uint8(3); // count
|
||||
// For 2v2 default
|
||||
CharterEntry = ARENA_TEAM_CHARTER_2v2;
|
||||
CharterDispayID = CHARTER_DISPLAY_ID;
|
||||
CharterCost = sWorld->getIntConfig(CONFIG_CHARTER_COST_ARENA_2v2);
|
||||
|
||||
// 2v2
|
||||
data << uint8(3); // count
|
||||
sScriptMgr->PetitionShowList(_player, creature, CharterEntry, CharterDispayID, CharterCost);
|
||||
data << uint32(1); // index
|
||||
data << uint32(ARENA_TEAM_CHARTER_2v2); // charter entry
|
||||
data << uint32(CHARTER_DISPLAY_ID); // charter display id
|
||||
data << uint32(sWorld->getIntConfig(CONFIG_CHARTER_COST_ARENA_2v2)); // charter cost
|
||||
data << CharterEntry; // charter entry
|
||||
data << CharterDispayID; // charter display id
|
||||
data << CharterCost; // charter cost
|
||||
data << uint32(2); // unknown
|
||||
data << uint32(2); // required signs?
|
||||
|
||||
// For 3v3 default
|
||||
CharterEntry = ARENA_TEAM_CHARTER_3v3;
|
||||
CharterDispayID = CHARTER_DISPLAY_ID;
|
||||
CharterCost = sWorld->getIntConfig(CONFIG_CHARTER_COST_ARENA_3v3);
|
||||
|
||||
// 3v3
|
||||
sScriptMgr->PetitionShowList(_player, creature, CharterEntry, CharterDispayID, CharterCost);
|
||||
data << uint32(2); // index
|
||||
data << uint32(ARENA_TEAM_CHARTER_3v3); // charter entry
|
||||
data << uint32(CHARTER_DISPLAY_ID); // charter display id
|
||||
data << uint32(sWorld->getIntConfig(CONFIG_CHARTER_COST_ARENA_3v3)); // charter cost
|
||||
data << CharterEntry; // charter entry
|
||||
data << CharterDispayID; // charter display id
|
||||
data << CharterCost; // charter cost
|
||||
data << uint32(3); // unknown
|
||||
data << uint32(3); // required signs?
|
||||
|
||||
// For 3v3 default
|
||||
CharterEntry = ARENA_TEAM_CHARTER_5v5;
|
||||
CharterDispayID = CHARTER_DISPLAY_ID;
|
||||
CharterCost = sWorld->getIntConfig(CONFIG_CHARTER_COST_ARENA_5v5);
|
||||
|
||||
// 5v5
|
||||
sScriptMgr->PetitionShowList(_player, creature, CharterEntry, CharterDispayID, CharterCost);
|
||||
data << uint32(3); // index
|
||||
data << uint32(ARENA_TEAM_CHARTER_5v5); // charter entry
|
||||
data << uint32(CHARTER_DISPLAY_ID); // charter display id
|
||||
data << uint32(sWorld->getIntConfig(CONFIG_CHARTER_COST_ARENA_5v5)); // charter cost
|
||||
data << CharterEntry; // charter entry
|
||||
data << CharterDispayID; // charter display id
|
||||
data << CharterCost; // charter cost
|
||||
data << uint32(5); // unknown
|
||||
data << uint32(5); // required signs?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user