Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/core_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ jobs:
with:
module_repo: ${{ github.event.repository.name }}
module_path: server-side/mod-bg-slaveryvalley
module_data: https://github.com/Helias/mod-bg-slaveryvalley/releases/download/1.0/server-data.zip
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,22 @@ INSERT INTO `battleground_template` (`ID`, `MinPlayersPerTeam`, `MaxPlayersPerTe

-- creature_template
DELETE FROM `creature_template` WHERE `entry` IN (129999, 130000, 130001);
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `dmgschool`, `DamageModifier`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, `RangeVariance`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `spell_school_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES
(129999, 0, 0, 0, 0, 0, 'Developer Snoopzz', NULL, NULL, 5, 1, 1, 0, 35, 1, 1, 1, 1, 0, 0, 1, 2000, 2000, 1, 1, 8, 32768, 2048, 0, 0, 0, 0, 0, 0, 7, 4096, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, '', 12340),
(130000, 0, 0, 0, 0, 0, 'Manakos', 'Slave Driver', '', 0, 71, 80, 0, 84, 1, 1, 1.14286, 1.5, 3, 0, 35, 2500, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 'SmartAI', 0, 1, 50, 50, 1, 0, 0, 1, 208607, 0, 0, '', 12340),
(130001, 0, 0, 0, 0, 0, 'Garog', 'Slave Driver', '', 0, 71, 80, 0, 83, 1, 1, 1.14286, 1.5, 3, 0, 35, 2500, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 'SmartAI', 0, 1, 50, 50, 1, 0, 0, 1, 208607, 0, 0, '', 12340);
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `rank`, `dmgschool`, `DamageModifier`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, `RangeVariance`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `CreatureImmunitiesId`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES
(129999, 0, 0, 0, 0, 0, 'Developer Snoopzz', NULL, NULL, 5, 1, 1, 0, 35, 1, 1, 1, 0, 0, 1, 2000, 2000, 1, 1, 8, 32768, 2048, 0, 0, 7, 4096, 0, 0, 0, 0, 0, 0, 0, '', 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, '', 12340),
(130000, 0, 0, 0, 0, 0, 'Manakos', 'Slave Driver', '', 0, 71, 80, 0, 84, 1, 1, 1.14286, 3, 0, 35, 2500, 1, 1, 1, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 'SmartAI', 0, 1, 50, 50, 1, 0, 0, 1, 130000, 0, '', 12340),
(130001, 0, 0, 0, 0, 0, 'Garog', 'Slave Driver', '', 0, 71, 80, 0, 83, 1, 1, 1.14286, 3, 0, 35, 2500, 1, 1, 1, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 'SmartAI', 0, 1, 50, 50, 1, 0, 0, 1, 130000, 0, '', 12340);

--Creature_template_model
-- creature_immunities
DELETE FROM `creature_immunities` WHERE `ID` = 130000;
INSERT INTO `creature_immunities` (`ID`, `SchoolMask`, `DispelTypeMask`, `MechanicsMask`, `Effects`, `Auras`, `ImmuneAoE`, `ImmuneChain`, `Comment`) VALUES
(130000, 0, 0, 417214, '', '', 0, 0, 'mech=0x65DBE(CHARM|DISORIENTED|DISARM|DISTRACT|FEAR|ROOT|SLOW_ATTACK|SLEEP|SNARE|STUN|KNOCKOUT|POLYMORPH|BANISH)');

-- creature_template_model
DELETE FROM `creature_template_model` WHERE `CreatureID` IN (129999, 130000, 130001);
INSERT INTO `creature_template_model` (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`, `VerifiedBuild`) VALUES
(129999, 0, 11353, 1, 1, 12340),
(130000, 0, 22054, 1, 1, 12340),
(130001, 0, 22147, 1, 1, 12340);
(130000, 0, 22054, 1.5, 1, 12340),
(130001, 0, 22147, 1.5, 1, 12340);

-- creatture_template_movement
DELETE FROM `creature_template_movement` WHERE `CreatureId` IN (129999, 130000, 130001);
Expand Down
37 changes: 28 additions & 9 deletions server-side/mod-bg-slaveryvalley/src/BattlegroundSV.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "BattlegroundSV.h"
#include "Battleground.h"
#include "BattlegroundMgr.h"
#include "Chat.h"
#include "GameGraveyard.h"
#include "GameObject.h"
#include "Language.h"
Expand Down Expand Up @@ -245,15 +246,15 @@ void BattlegroundSV::HandleAreaTrigger(Player * /* player */, uint32 /* trigger
return;
}

void BattlegroundSV::FillInitialWorldStates(WorldPacket &data)
void BattlegroundSV::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{
// set score
data << uint32(BG_SV_WS_ALLIANCE_SCORE) << uint32(TeamScore[TEAM_ALLIANCE]);
data << uint32(BG_SV_WS_HORDE_SCORE) << uint32(TeamScore[TEAM_HORDE]);
packet.Worldstates.emplace_back(BG_SV_WS_ALLIANCE_SCORE, TeamScore[TEAM_ALLIANCE]);
packet.Worldstates.emplace_back(BG_SV_WS_HORDE_SCORE, TeamScore[TEAM_HORDE]);

// set world states on the map
for (uint8 i = 0; i < BG_SV_MAX_NODE_TYPES; ++i)
data << uint32(nodePoint[i].worldStates[nodePoint[i].nodeState]) << uint32(1);
packet.Worldstates.emplace_back(nodePoint[i].worldStates[nodePoint[i].nodeState], 1);
}

bool BattlegroundSV::SetupBattleground()
Expand Down Expand Up @@ -298,6 +299,24 @@ bool BattlegroundSV::SetupBattleground()
return true;
}

// acore_string entries use printf-style %s placeholders, filled with other acore_string entries
void BattlegroundSV::SendMessage2ToAll(uint32 entry, ChatMsg type, Player const* source, uint32 arg1, uint32 arg2)
{
for (auto const& [guid, player] : GetPlayers())
{
LocaleConstant locale = player->GetSession()->GetSessionDbLocaleIndex();
std::string arg1Str = arg1 ? sObjectMgr->GetAcoreString(arg1, locale) : "";
std::string arg2Str = arg2 ? sObjectMgr->GetAcoreString(arg2, locale) : "";

char text[2048];
snprintf(text, sizeof(text), sObjectMgr->GetAcoreString(entry, locale).c_str(), arg1Str.c_str(), arg2Str.c_str());

WorldPacket data;
ChatHandler::BuildChatPacket(data, type, LANG_UNIVERSAL, source, source, text);
player->SendDirectMessage(&data);
}
}

void BattlegroundSV::SpawnBoss()
{
if (BgCreatures[BG_SV_NPC_BOSS_A])
Expand Down Expand Up @@ -478,14 +497,14 @@ void BattlegroundSV::EventPlayerClickedOnFlag(Player *player, GameObject *target

if (nodePoint[i].nodeType != NODE_TYPE_PRISON)
{
RelocateDeadPlayers(BgCreatures[BG_SV_NPC_SPIRIT_GUIDE_1 + nodePoint[i].nodeType - 2]);
RelocateDeadPlayers(BgCreatures[BG_SV_NPC_SPIRIT_GUIDE_1 + uint32(nodePoint[i].nodeType) - 2]);
}

// if we are here means that the point has been lost, or it is the first capture

if (nodePoint[i].nodeType != NODE_TYPE_PRISON)
if (BgCreatures[BG_SV_NPC_SPIRIT_GUIDE_1 + (nodePoint[i].nodeType) - 2])
DelCreature(BG_SV_NPC_SPIRIT_GUIDE_1 + (nodePoint[i].nodeType) - 2);
if (BgCreatures[BG_SV_NPC_SPIRIT_GUIDE_1 + uint32(nodePoint[i].nodeType) - 2])
DelCreature(BG_SV_NPC_SPIRIT_GUIDE_1 + uint32(nodePoint[i].nodeType) - 2);

SendMessage2ToAll(LANG_BG_SV_ASSAULTED, teamId == TEAM_ALLIANCE ? CHAT_MSG_BG_SYSTEM_ALLIANCE : CHAT_MSG_BG_SYSTEM_HORDE, player, nodePoint[i].string);
PlaySoundToAll(nodePoint[i].faction == TEAM_ALLIANCE ? BG_SV_SOUND_NODE_ASSAULTED_ALLIANCE : BG_SV_SOUND_NODE_ASSAULTED_HORDE);
Expand Down Expand Up @@ -601,7 +620,7 @@ void BattlegroundSV::BG_SV_HandleCapturedNodes(BG_SV_NodePoint *node, bool /* re
{
if (node->nodeType != NODE_TYPE_FIX && node->nodeType != NODE_TYPE_PRISON)
{
if (!AddSpiritGuide(BG_SV_NPC_SPIRIT_GUIDE_1 + node->nodeType - 2, BG_SV_SpiritGuidePos[node->nodeType].m_positionX, BG_SV_SpiritGuidePos[node->nodeType].m_positionY, BG_SV_SpiritGuidePos[node->nodeType].m_positionZ, BG_SV_SpiritGuidePos[node->nodeType].m_orientation, node->faction))
if (!AddSpiritGuide(BG_SV_NPC_SPIRIT_GUIDE_1 + uint32(node->nodeType) - 2, BG_SV_SpiritGuidePos[node->nodeType].m_positionX, BG_SV_SpiritGuidePos[node->nodeType].m_positionY, BG_SV_SpiritGuidePos[node->nodeType].m_positionZ, BG_SV_SpiritGuidePos[node->nodeType].m_orientation, node->faction))
LOG_INFO("module", "Slavery Valley Failed to spawn spirit guide! point: {}, team: {}, ", node->nodeType, node->faction);
}

Expand Down Expand Up @@ -699,7 +718,7 @@ GraveyardStruct const *BattlegroundSV::GetClosestGraveyard(Player *player)
if (nodePoint[i].captured == true && nodePoint[i].faction == teamIndex)
nodes.push_back(i);

GraveyardStruct const *entry = sGraveyard->GetGraveyard(BG_SV_GraveyardIds[teamIndex + BG_SV_MAX_NODE_TYPES]);
GraveyardStruct const *entry = sGraveyard->GetGraveyard(BG_SV_GraveyardIds[teamIndex + uint32(BG_SV_MAX_NODE_TYPES)]);
GraveyardStruct const *nearestEntry = entry;

// If so, select the closest node to place ghost on
Expand Down
3 changes: 2 additions & 1 deletion server-side/mod-bg-slaveryvalley/src/BattlegroundSV.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ class BattlegroundSV : public Battleground
GraveyardStruct const* GetClosestGraveyard(Player* player);

/* Scorekeeping */
void FillInitialWorldStates(WorldPacket& data);
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet);

void HandlePlayerResurrect(Player* player);

Expand All @@ -357,6 +357,7 @@ class BattlegroundSV : public Battleground
void BG_SV_HandleContestedNodes(BG_SV_NodePoint* node);
void BG_SV_StartRoot(Player* player);
void BG_SV_RemoveRoot(Player* player);
void SendMessage2ToAll(uint32 entry, ChatMsg type, Player const* source, uint32 arg1 = 0, uint32 arg2 = 0);

bool HordeCaptured;
bool AllianceCaptured;
Expand Down
Loading