Skip to content

Commit

Permalink
Add missing Silithus PvP Event texts.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb committed Mar 4, 2025
1 parent 46a80a4 commit 01f4209
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
21 changes: 21 additions & 0 deletions sql/migrations/20250304201128_world.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
DROP PROCEDURE IF EXISTS add_migration;
DELIMITER ??
CREATE PROCEDURE `add_migration`()
BEGIN
DECLARE v INT DEFAULT 1;
SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20250304201128');
IF v = 0 THEN
INSERT INTO `migrations` VALUES ('20250304201128');
-- Add your query below.


-- Add texts to Silithus PvP Event.
UPDATE `broadcast_text` SET `chat_type`=1 WHERE `entry` IN (13469, 13470, 13476, 13477, 13478, 13479, 13480, 13481);


-- End of migration.
END IF;
END??
DELIMITER ;
CALL add_migration();
DROP PROCEDURE IF EXISTS add_migration;
46 changes: 46 additions & 0 deletions src/game/OutdoorPvP/OutdoorPvPSI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,30 @@ void OutdoorPvPSI::ResetResourceCount()
m_hordeDustBags.clear();
}

enum
{
NPC_ANNOUNCER_HORDE = 17079,
NPC_ANNOUNCER_ALLIANCE = 17080,

BCT_SILITHYST_HORDE_25 = 13476,
BCT_SILITHYST_HORDE_50 = 13477,
BCT_SILITHYST_HORDE_75 = 13478,
BCT_SILITHYST_HORDE_100 = 13469,

BCT_SILITHYST_ALLIANCE_25 = 13479,
BCT_SILITHYST_ALLIANCE_50 = 13480,
BCT_SILITHYST_ALLIANCE_75 = 13481,
BCT_SILITHYST_ALLIANCE_100 = 13470,
};

static void DoSilithystYell(Player* pPlayer, uint32 creatureId, uint32 textId)
{
if (Creature* pCreature = pPlayer->FindNearestCreature(creatureId, MAX_VISIBILITY_DISTANCE))
DoScriptText(textId, pCreature);
else
sLog.Out(LOG_SCRIPTS, LOG_LVL_ERROR, "Silithus PvP Event yeller npc %u not found!", creatureId);
}

bool OutdoorPvPSI::HandleAreaTrigger(Player* plr, uint32 trigger)
{
/** If the player doesn't have a silithyst */
Expand All @@ -149,6 +173,16 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player* plr, uint32 trigger)
if (plr->GetTeam() == ALLIANCE)
{
++ m_Gathered_A;

if (m_Gathered_A == (m_MaxRessources / 4))
DoSilithystYell(plr, NPC_ANNOUNCER_ALLIANCE, BCT_SILITHYST_ALLIANCE_25);
else if (m_Gathered_A == (m_MaxRessources / 2))
DoSilithystYell(plr, NPC_ANNOUNCER_ALLIANCE, BCT_SILITHYST_ALLIANCE_50);
else if (m_Gathered_A == (m_MaxRessources - (m_MaxRessources / 4)))
DoSilithystYell(plr, NPC_ANNOUNCER_ALLIANCE, BCT_SILITHYST_ALLIANCE_75);
else if (m_Gathered_A == m_MaxRessources)
DoSilithystYell(plr, NPC_ANNOUNCER_ALLIANCE, BCT_SILITHYST_ALLIANCE_100);

if (m_Gathered_A >= m_MaxRessources)
{
TeamApplyBuff(TEAM_ALLIANCE, SI_CENARION_FAVOR);
Expand All @@ -163,6 +197,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player* plr, uint32 trigger)
{
SpawnDustBags(m_Gathered_A, sAllianceDustBags, m_allianceDustBags);
}

// complete quest
plr->KilledMonsterCredit(SI_TURNIN_QUEST_CM_A, ObjectGuid());
}
Expand All @@ -173,6 +208,16 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player* plr, uint32 trigger)
if (plr->GetTeam() == HORDE)
{
++ m_Gathered_H;

if (m_Gathered_H == (m_MaxRessources / 4))
DoSilithystYell(plr, NPC_ANNOUNCER_HORDE, BCT_SILITHYST_HORDE_25);
else if (m_Gathered_H == (m_MaxRessources / 2))
DoSilithystYell(plr, NPC_ANNOUNCER_HORDE, BCT_SILITHYST_HORDE_50);
else if (m_Gathered_H == (m_MaxRessources - (m_MaxRessources / 4)))
DoSilithystYell(plr, NPC_ANNOUNCER_HORDE, BCT_SILITHYST_HORDE_75);
else if (m_Gathered_H == m_MaxRessources)
DoSilithystYell(plr, NPC_ANNOUNCER_HORDE, BCT_SILITHYST_HORDE_100);

if (m_Gathered_H >= m_MaxRessources)
{
TeamApplyBuff(TEAM_HORDE, SI_CENARION_FAVOR);
Expand All @@ -187,6 +232,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player* plr, uint32 trigger)
{
SpawnDustBags(m_Gathered_H, sHordeDustBags, m_hordeDustBags);
}

// complete quest
plr->KilledMonsterCredit(SI_TURNIN_QUEST_CM_H, ObjectGuid());
}
Expand Down

0 comments on commit 01f4209

Please sign in to comment.