Jump to content

[fix] Random Heroic/Dungeon daily


Auntie Mangos

Recommended Posts

* What bug does the patch fix? What features does the patch add?

adds random Heroic/Dungeon dailys(and spawns Image of quest-target on the projector near quest start)

* For which repository revision was the patch created?

mangos 0.12

http://github.com/mangos/mangos/commit/6f44fd6b7913d3834eae75ebbba35f833107830c

* Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

Dont know

* Who has been writing this patch? Please include either forum user names or email addresses.

me. based on piroy1337´s worke here

http://getmangos.eu/community/viewtopic.php?id=13253

diff --git a/src/game/Player.h b/src/game/Player.h
diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h
index 5d837a7..be4c717 100644
--- a/src/game/SharedDefines.h
+++ b/src/game/SharedDefines.h
@@ -2427,6 +2427,42 @@ enum MailResponseResult
    MAIL_ERR_MAIL_ATTACHMENT_INVALID   = 19,
};

+enum RandomHeroicDungeon
+{
+    RandomDungeon_Daily_Quagmirran     = 100,
+    RandomDungeon_Daily_Warlord        = 101,
+    RandomDungeon_Daily_Stalker        = 102,
+    RandomDungeon_Daily_Exarch         = 103,
+    RandomDungeon_Daily_Ikiss          = 104,
+    RandomDungeon_Daily_Murmur         = 105,
+    RandomDungeon_Daily_Shaffar        = 106,
+    RandomDungeon_Daily_Skyriss        = 107,
+    RandomDungeon_Daily_Pathaleon      = 108,
+    RandomDungeon_Daily_Splinter       = 109,
+    RandomDungeon_Daily_Nazan          = 110,
+    RandomDungeon_Daily_Bladefist      = 111,
+    RandomDungeon_Daily_Feathered      = 112,
+    RandomDungeon_Daily_Aeonus         = 113,
+    RandomDungeon_Daily_Epoch          = 114,
+    RandomDungeon_Daily_Prince         = 115,
+ 
+};
+#define MAX_RANDOM_HEROIC_DAILY_EVENT      16
+
+enum RandomDungeon
+{
+    RandomDungeon_Daily_ArcatrazSentinels           = 116,
+    RandomDungeon_Daily_CoilfangMyrmidons           = 117,
+    RandomDungeon_Daily_MaliciousInstructors        = 118,
+    RandomDungeon_Daily_TempestForgeDestroyers      = 119,
+    RandomDungeon_Daily_ShatteredHandCenturions     = 120,
+    RandomDungeon_Daily_SunseekerChannelers         = 121,
+    RandomDungeon_Daily_RiftLords                   = 122,
+    RandomDungeon_Daily_SistersOfTorment          = 123
+ 
+};
+#define MAX_RANDOM_DUNGEON_DAILY_EVENT      8
+
// reasons for why pet tame may fail
// in fact, these are also used elsewhere
enum PetTameFailureReason
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 1e82661..442c1c0 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -1221,6 +1221,34 @@ void World::SetInitialWorldSettings()
    sLog.outString( "WORLD: World initialized" );
}

+void World::SelectRandomHeroicDungeonDaily()
+{
+    //Delay all events
+    for(uint8 eventId = 0; eventId < MAX_RANDOM_HEROIC_DAILY_EVENT; ++eventId)
+    {
+        sGameEventMgr.StopEvent(RandomDungeon_Daily_Quagmirran+eventId);
+        WorldDatabase.PExecute("UPDATE game_event SET occurence = 5184000 WHERE entry = %u", RandomDungeon_Daily_Quagmirran+eventId);
+    }
+    //Start new event  
+    uint8 random = urand(0,(MAX_RANDOM_HEROIC_DAILY_EVENT-1));
+    sGameEventMgr.StartEvent(RandomDungeon_Daily_Quagmirran+random);
+    WorldDatabase.PExecute("UPDATE game_event SET occurence = 1400 WHERE entry = %u", RandomDungeon_Daily_Quagmirran+random);
+}
+
+void World::SelectRandomDungeonDaily()
+{
+    //Delay all events
+    for(uint8 eventId = 0; eventId < MAX_RANDOM_DUNGEON_DAILY_EVENT; ++eventId)
+    {
+        sGameEventMgr.StopEvent(RandomDungeon_Daily_ArcatrazSentinels+eventId);
+        WorldDatabase.PExecute("UPDATE game_event SET occurence = 5184000 WHERE entry = %u", RandomDungeon_Daily_ArcatrazSentinels+eventId);
+    }
+    //Start new event  
+    uint8 random = urand(0,(MAX_RANDOM_DUNGEON_DAILY_EVENT-1));
+    sGameEventMgr.StartEvent(RandomDungeon_Daily_ArcatrazSentinels+random);
+    WorldDatabase.PExecute("UPDATE game_event SET occurence = 1400 WHERE entry = %u", RandomDungeon_Daily_ArcatrazSentinels+random);
+}
+
void World::DetectDBCLang()
{
    uint32 m_lang_confid = sConfig.GetIntDefault("DBC.Locale", 255);
@@ -1282,7 +1310,11 @@ void World::Update(uint32 diff)

    /// Handle daily quests reset time
    if (m_gameTime > m_NextDailyQuestReset)
+    {
        ResetDailyQuests();
+        SelectRandomDungeonDaily();
+        SelectRandomHeroicDungeonDaily();
+    }

    /// <ul>[*] Handle auctions when the timer has passed
    if (m_timers[WUPDATE_AUCTIONS].Passed())
diff --git a/src/game/World.h b/src/game/World.h
index ba4642b..c5d2b79 100644
--- a/src/game/World.h
+++ b/src/game/World.h
@@ -511,6 +511,8 @@ class World
        static uint8 GetExitCode() { return m_ExitCode; }
        static void StopNow(uint8 exitcode) { m_stopEvent = true; m_ExitCode = exitcode; }
        static bool IsStopped() { return m_stopEvent; }
+        void SelectRandomHeroicDungeonDaily();
+        void SelectRandomDungeonDaily();

        void Update(uint32 diff);

INSERT INTO `game_event` VALUES
('100','2010-01-03 06:00:00','2020-01-03 09:00:00','1440','1440','0','Daily Hero: The Slave Pens!');
INSERT INTO `game_event` VALUES
('101','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Hero: The Steamvault!');
INSERT INTO `game_event` VALUES
('102','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Hero: The Underbog!');
INSERT INTO `game_event` VALUES
('103','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Hero: Auchenai Crypts!');
INSERT INTO `game_event` VALUES
('104','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Hero: Sethekk Halls!');
INSERT INTO `game_event` VALUES
('105','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Hero: Shadow Labyrinth!');
INSERT INTO `game_event` VALUES
('106','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Hero: Mana-Tombs!');
INSERT INTO `game_event` VALUES
('107','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Hero: The Arcatraz!');
INSERT INTO `game_event` VALUES
('108','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Hero: Mechanar!');
INSERT INTO `game_event` VALUES
('109','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Hero: The Botanica!');
INSERT INTO `game_event` VALUES
('110','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Hero: Hellfire Ramparts!');
INSERT INTO `game_event` VALUES
('111','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Hero: The Shattered Halls!');
INSERT INTO `game_event` VALUES
('112','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Hero: The Blood Furnace!');
INSERT INTO `game_event` VALUES
('113','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Hero: Caverns of Time: The Black Morass!');
INSERT INTO `game_event` VALUES
('114','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Hero: Caverns of Time: Old Hillsbrad Foothills!');
INSERT INTO `game_event` VALUES
('115','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Hero: Magisters Terrace!');

INSERT INTO `game_event` VALUES
('116','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Dungeon: Arcatraz!');
INSERT INTO `game_event` VALUES
('117','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Dungeon: Steamvault!');
INSERT INTO `game_event` VALUES
('118','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Dungeon: Shadow Labyrinth!');
INSERT INTO `game_event` VALUES
('119','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Dungeon: Mechanar!');
INSERT INTO `game_event` VALUES
('120','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Dungeon: Shattered Halls!');
INSERT INTO `game_event` VALUES
('121','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Dungeon: Botanica!');
INSERT INTO `game_event` VALUES
('122','2010-01-03 06:00:00','2020-01-03 09:00:00','5184000','1440','0','Daily Dungeon: Black Morass!');
INSERT INTO `game_event` VALUES
('123','2010-01-03 06:00:00','2020-01-03 09:00:00','1440','1440','0','Daily Dungeon: Magisters Terrace!');

DELETE FROM `creature_questrelation` WHERE quest IN (11382, 11378, 11368, 11370, 11369, 11374, 11372, 11375, 11373, 11388, 11386, 11384,11354,11363,11362,11499);
DELETE FROM `creature_questrelation` WHERE quest IN (11389,11371,11376,11383,11364,11500,11385,11387);


INSERT INTO `game_event_creature_quest` VALUES 
(24369, 11368, 100),
(24369, 11370, 101),
(24369, 11369, 102),
(24369, 11374, 103),
(24369, 11372, 104),
(24369, 11375, 105),
(24369, 11373, 106),
(24369, 11388, 107),
(24369, 11386, 108),
(24369, 11384, 109),
(24369, 11354, 110),
(24369, 11363, 111),
(24369, 11362, 112),
(24369, 11382, 113),
(24369, 11378, 114),
(24369, 11499, 115);

INSERT INTO `game_event_creature_quest` VALUES 
(24370, 11389, 116),
(24370, 11371, 117),
(24370, 11376, 118),
(24370, 11387, 119),
(24370, 11364, 120),
(24370, 11385, 121),
(24370, 11383, 122),
(24370, 11500, 123);

DELETE FROM `creature` WHERE `guid`=79464;
DELETE FROM `creature` WHERE `guid`=79462;

INSERT INTO `game_event_creature` VALUES
('667000', '100');
INSERT INTO `game_event_creature` VALUES
('667001', '101');
INSERT INTO `game_event_creature` VALUES
('667002', '102');
INSERT INTO `game_event_creature` VALUES
('667003', '103');
INSERT INTO `game_event_creature` VALUES
('667004', '104');
INSERT INTO `game_event_creature` VALUES
('667005', '105');
INSERT INTO `game_event_creature` VALUES
('667006', '106');
INSERT INTO `game_event_creature` VALUES
('667007', '107');
INSERT INTO `game_event_creature` VALUES
('667008', '108');
INSERT INTO `game_event_creature` VALUES
('667009', '109');
INSERT INTO `game_event_creature` VALUES
('667010', '110');
INSERT INTO `game_event_creature` VALUES
('667011', '111');
INSERT INTO `game_event_creature` VALUES
('667012', '112');
INSERT INTO `game_event_creature` VALUES
('667013', '113');
INSERT INTO `game_event_creature` VALUES
('667014', '114');
INSERT INTO `game_event_creature` VALUES
('667015', '115');

INSERT INTO `game_event_creature` VALUES
('667016', '116');
INSERT INTO `game_event_creature` VALUES
('667017', '117');
INSERT INTO `game_event_creature` VALUES
('667018', '118');
INSERT INTO `game_event_creature` VALUES
('667019', '119');
INSERT INTO `game_event_creature` VALUES
('667020', '120');
INSERT INTO `game_event_creature` VALUES
('667021', '121');
INSERT INTO `game_event_creature` VALUES
('667022', '122');
INSERT INTO `game_event_creature` VALUES
('667023', '123');


INSERT INTO `creature` VALUES
('667000', '24419', '530', '1', '0', '0', '-1787', '5158.15', '-39.3803', '2.3246', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667001', '24421', '530', '1', '0', '0', '-1787', '5158.15', '-39.3803', '2.3246', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667002', '24420', '530', '1', '0', '0', '-1787', '5158.15', '-39.3803', '2.3246', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667003', '24424', '530', '1', '0', '0', '-1787', '5158.15', '-39.3803', '2.3246', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667004', '24422', '530', '1', '0', '0', '-1787', '5158.15', '-39.3803', '2.3246', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667005', '24425', '530', '1', '0', '0', '-1787', '5158.15', '-39.3803', '2.3246', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667006', '24423', '530', '1', '0', '0', '-1787', '5158.15', '-39.3803', '2.3246', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667007', '24435', '530', '1', '0', '0', '-1787', '5158.15', '-39.3803', '2.3246', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667008', '21504', '530', '1', '0', '0', '-1787', '5158.15', '-39.3803', '2.3246', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667009', '24431', '530', '1', '0', '0', '-1787', '5158.15', '-39.3803', '2.3246', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667010', '24410', '530', '1', '0', '0', '-1787', '5158.15', '-39.3803', '2.3246', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667011', '24414', '530', '1', '0', '0', '-1787', '5158.15', '-39.3803', '2.3246', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667012', '24413', '530', '1', '0', '0', '-1787', '5158.15', '-39.3803', '2.3246', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667013', '24428', '530', '1', '0', '0', '-1787', '5158.15', '-39.3803', '2.3246', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667014', '24427', '530', '1', '0', '0', '-1787', '5158.15', '-39.3803', '2.3246', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667015', '24855', '530', '1', '0', '0', '-1787', '5158.15', '-39.3803', '2.3246', '25', '0', '0', '1', '0', '0', '0');

INSERT INTO `creature` VALUES
('667016', '24434', '530', '1', '0', '0', '-1801.67', '5144.32', '-39.3797', '2.19344', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667017', '24415', '530', '1', '0', '0', '-1801.67', '5144.32', '-39.3797', '2.19344', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667018', '24426', '530', '1', '0', '0', '-1801.67', '5144.32', '-39.3797', '2.19344', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667019', '24432', '530', '1', '0', '0', '-1801.67', '5144.32', '-39.3797', '2.19344', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667020', '24411', '530', '1', '0', '0', '-1801.67', '5144.32', '-39.3797', '2.19344', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667021', '24430', '530', '1', '0', '0', '-1801.67', '5144.32', '-39.3797', '2.19344', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667022', '24429', '530', '1', '0', '0', '-1801.67', '5144.32', '-39.3797', '2.19344', '25', '0', '0', '1', '0', '0', '0');
INSERT INTO `creature` VALUES
('667023', '24854', '530', '1', '0', '0', '-1801.67', '5144.32', '-39.3797', '2.19344', '25', '0', '0', '1', '0', '0', '0');


UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24419;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24421;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24420;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24424;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24422;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24425;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24423;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24435;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 21504;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24431;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24410;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24414;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24413;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24428;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24427;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24855;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24434;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24415;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24426;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24432;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24411;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24430;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24429;
UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 24854;

Link to comment
Share on other sites

  • 40 years later...

Hmm, I don't know - with wotlk there came so many more quests with such behaviour...

(Sholzar Basin 2*5q, cooking, BC, wotlk, fishing, Wintergrasp?, Wotlk Dungeons)

And to modell them all with game-events seem to be quite much source, so I think this will need a more generic idea

Link to comment
Share on other sites

  • 1 month later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use