scriptdev2 / scriptdev2-cata

ScriptDev2 for Cataclysm

Home Page:http://www.scriptdev2.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Puzzle Box of Yogg-Saron

opened this issue · comments

http://www.wowhead.com/npc=49634/puzzle-box-of-yogg-saron
http://www.wowhead.com/item=64482/puzzle-box-of-yogg-saron
On spawn should whisper text player (urand 0, 26).

commit 4b9d039774e4ac46cccf29284a629c8d10ad9a82
Author: FollowerAI <FollowerAI@cataclysm.com>
Date:   Mon Jun 8 08:58:13 2015 +0600

    Puzzle box whisper script support.

diff --git a/scripts/world/npcs_special.cpp b/scripts/world/npcs_special.cpp
index 2bf7580..2026822 100644
--- a/scripts/world/npcs_special.cpp
+++ b/scripts/world/npcs_special.cpp
@@ -39,6 +39,7 @@ npc_doctor              100%    Gustaf Vanhowzen and Gregory Victor, quest 6622
 npc_innkeeper            25%    ScriptName not assigned. Innkeepers in general.
 npc_spring_rabbit         1%    Used for pet "Spring Rabbit" of Noblegarden
 npc_redemption_target   100%    Used for the paladin quests: 1779,1781,9600,9685
+npc_puzzle_box_yogg_saron 0%    Used for Archaeology. Placeholder.
 EndContentData */

 /*########
@@ -1357,6 +1358,110 @@ bool EffectDummyCreature_npc_redemption_target(Unit* pCaster, uint32 uiSpellId,
     return false;
 }

+/*######
+## npc_puzzle_box_yogg_saron
+######*/
+
+enum
+{
+    SAY_RANDOM_1        = -1004003,
+    SAY_RANDOM_2        = -1004004,
+    SAY_RANDOM_3        = -1004005,
+    SAY_RANDOM_4        = -1004006,
+    SAY_RANDOM_5        = -1004007,
+    SAY_RANDOM_6        = -1004008,
+    SAY_RANDOM_7        = -1004009,
+    SAY_RANDOM_8        = -1004010,
+    SAY_RANDOM_9        = -1004011,
+    SAY_RANDOM_10       = -1004012,
+    SAY_RANDOM_11       = -1004013,
+    SAY_RANDOM_12       = -1004014,
+    SAY_RANDOM_13       = -1004015,
+    SAY_RANDOM_14       = -1004016,
+    SAY_RANDOM_15       = -1004017,
+    SAY_RANDOM_16       = -1004018,
+    SAY_RANDOM_17       = -1004019,
+    SAY_RANDOM_18       = -1004020,
+    SAY_RANDOM_19       = -1004021,
+    SAY_RANDOM_20       = -1004022,
+    SAY_RANDOM_21       = -1004023,
+    SAY_RANDOM_22       = -1004024,
+    SAY_RANDOM_23       = -1004025,
+    SAY_RANDOM_24       = -1004026,
+    SAY_RANDOM_25       = -1004027,
+    SAY_RANDOM_26       = -1004028,
+
+};
+
+struct npc_puzzle_box_yogg_saronAI : public ScriptedAI
+{
+    npc_puzzle_box_yogg_saronAI(Creature* pCreature) : ScriptedAI(pCreature)
+    {
+        m_bWhisper = false;
+        Reset();
+    }
+
+    bool m_bWhisper;
+
+    void Reset() override { }
+
+    void AttackStart(Unit* /*pWho*/) override { }
+    void MoveInLineOfSight(Unit* /*pWho*/) override { }
+
+    void UpdateAI(const uint32 /*uiDiff*/) override
+    {
+        if (!m_bWhisper)
+        {
+            if (m_creature->IsTemporarySummon())
+            {
+                TemporarySummon* pTemporary = (TemporarySummon*)m_creature;
+
+                // Whisp player
+                if (Player* pSummoner = m_creature->GetMap()->GetPlayer(pTemporary->GetSummonerGuid()))
+                    
+                switch (urand(0, 26))
+                {
+                     case 0:  DoScriptText(SAY_RANDOM_1,  m_creature, pSummoner); break;
+                     case 1:  DoScriptText(SAY_RANDOM_2,  m_creature, pSummoner); break;
+                     case 2:  DoScriptText(SAY_RANDOM_3,  m_creature, pSummoner); break;
+                     case 3:  DoScriptText(SAY_RANDOM_4,  m_creature, pSummoner); break;
+                     case 4:  DoScriptText(SAY_RANDOM_5,  m_creature, pSummoner); break;
+                     case 5:  DoScriptText(SAY_RANDOM_6,  m_creature, pSummoner); break;
+                     case 6:  DoScriptText(SAY_RANDOM_7,  m_creature, pSummoner); break;
+                     case 7:  DoScriptText(SAY_RANDOM_8,  m_creature, pSummoner); break;
+                     case 8:  DoScriptText(SAY_RANDOM_9,  m_creature, pSummoner); break;
+                     case 9:  DoScriptText(SAY_RANDOM_10, m_creature, pSummoner); break;
+                     case 10: DoScriptText(SAY_RANDOM_11, m_creature, pSummoner); break;
+                     case 11: DoScriptText(SAY_RANDOM_12, m_creature, pSummoner); break;
+                     case 12: DoScriptText(SAY_RANDOM_13, m_creature, pSummoner); break;
+                     case 13: DoScriptText(SAY_RANDOM_14, m_creature, pSummoner); break;
+                     case 14: DoScriptText(SAY_RANDOM_15, m_creature, pSummoner); break;
+                     case 15: DoScriptText(SAY_RANDOM_16, m_creature, pSummoner); break;
+                     case 16: DoScriptText(SAY_RANDOM_17, m_creature, pSummoner); break;
+                     case 17: DoScriptText(SAY_RANDOM_18, m_creature, pSummoner); break;
+                     case 18: DoScriptText(SAY_RANDOM_19, m_creature, pSummoner); break;
+                     case 19: DoScriptText(SAY_RANDOM_20, m_creature, pSummoner); break;
+                     case 20: DoScriptText(SAY_RANDOM_21, m_creature, pSummoner); break;
+                     case 21: DoScriptText(SAY_RANDOM_22, m_creature, pSummoner); break;
+                     case 22: DoScriptText(SAY_RANDOM_22, m_creature, pSummoner); break;
+                     case 23: DoScriptText(SAY_RANDOM_23, m_creature, pSummoner); break;
+                     case 24: DoScriptText(SAY_RANDOM_24, m_creature, pSummoner); break;
+                     case 25: DoScriptText(SAY_RANDOM_25, m_creature, pSummoner); break;
+                     case 26: DoScriptText(SAY_RANDOM_26, m_creature, pSummoner); break;
+                }
+                    
+                m_creature->ForcedDespawn(5000);
+            }
+
+            m_bWhisper = true;
+        }
+    }
+};
+
+CreatureAI* GetAI_npc_puzzle_box_yogg_saron(Creature* pCreature)
+{
+    return new npc_puzzle_box_yogg_saronAI(pCreature);
+}
+
 void AddSC_npcs_special()
 {
     Script* pNewScript;
@@ -1415,4 +1520,9 @@ void AddSC_npcs_special()
     pNewScript->GetAI = &GetAI_npc_redemption_target;
     pNewScript->pEffectDummyNPC = &EffectDummyCreature_npc_redemption_target;
     pNewScript->RegisterSelf();
-}
+    
+    pNewScript = new Script;
+    pNewScript->Name = "npc_puzzle_box_yogg_saron";
+    pNewScript->GetAI = &GetAI_npc_puzzle_box_yogg_saron;
+    pNewScript->RegisterSelf();
+}
\ No newline at end of file
diff --git a/sql/scriptdev2_script_full.sql b/sql/scriptdev2_script_full.sql
index a394318..801018f 100644
--- a/sql/scriptdev2_script_full.sql
+++ b/sql/scriptdev2_script_full.sql
@@ -1291,7 +1291,34 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen
 INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
 (-1004000,'Yipe! Help Hogger!',0,1,0,0,'hogger SAY_CALL_HELP'),
 (-1004001,'Hogger is eating! Stop him!',0,5,0,0,'hogger WHISPER_EATING'),
-(-1004002,'No hurt Hogger!',0,1,0,0,'hogger SAY_HOGGER_BEATEN');
+(-1004002,'No hurt Hogger!',0,1,0,0,'hogger SAY_HOGGER_BEATEN'),
+
+(-1004003,'At the bottom of the ocean even light must die.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_1'),
+(-1004004,'The silent, sleeping, staring houses in the backwoods always dream. It would be merciful to tear them down.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_2'),
+(-1004005,'There is no sharp distinction between the real and the unreal.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_3'),
+(-1004006,'Even death may die.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_4'),
+(-1004007,'There is a little lamb lost in dark woods.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_5'),
+(-1004008,'All places, all things have souls. All souls can be devoured.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_6'),
+(-1004009,'What can change the nature of a man?',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_7'),
+(-1004010,'The stars sweep chill currents that make men shiver in the dark.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_8'),
+(-1004011,'Do you dream while you sleep or is it an escape from the horrors of reality?',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_9'),
+(-1004012,'Look around. They will all betray you. Flee screaming into the black forest.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_10'),
+(-1004013,'In the land of Ny'alotha there is only sleep.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_11'),
+(-1004014,'In the sleeping city of Ny'alotha walk only mad things.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_12'),
+(-1004015,'Ny'alotha is a city of old, terrible, unnumbered crimes.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_13'),
+(-1004016,'Y'knath k'th'rygg k'yi mrr'ungha gr'mula.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_14'),
+(-1004017,'The void sucks at your soul. It is content to feast slowly.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_15'),
+(-1004018,'The drowned god's heart is black ice.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_16'),
+(-1004019,'It is standing right behind you. Do not move. Do not breathe.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_17'),
+(-1004020,'Have you had the dream again? A black goat with seven eyes that watches from the outside.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_18'),
+(-1004021,'In the sunken city, he lays dreaming.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_19'),
+(-1004022,'Open me! Open me! Open me! Then only will you know peace',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_20'),
+(-1004023,'You resist. You cling to your life as if it actually matters. You will learn.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_21'),
+(-1004024,'The tortured spirits of your ancestors cling to you, screaming in silence. Apparently they are quite numerous.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_22'),
+(-1004025,'The fish know all the secrets. They know the cold. They know the dark.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_23'),
+(-1004026,'The giant rook watches from the dead trees. Nothing breathes beneath his shadow.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_24'),
+(-1004027,'Beneath the shadow of the darkened spire, there is no light, no mercy, only void, and the chaos within.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_25'),
+(-1004028,'You will all be alone in the end.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_26');

 -- -1 033 000 SHADOWFANG KEEP
 INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
diff --git a/sql/updates/r3141_scriptdev2.sql b/sql/updates/r3141_scriptdev2.sql
new file mode 100644
index 0000000..cf2478d
--- /dev/null
+++ b/sql/updates/r3141_scriptdev2.sql
@@ -0,0 +1,28 @@
+DELETE FROM script_texts WHERE entry BETWEEN -1004003 AND -1004028;
+INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
+(-1004003,'At the bottom of the ocean even light must die.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_1'),
+(-1004004,'The silent, sleeping, staring houses in the backwoods always dream. It would be merciful to tear them down.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_2'),
+(-1004005,'There is no sharp distinction between the real and the unreal.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_3'),
+(-1004006,'Even death may die.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_4'),
+(-1004007,'There is a little lamb lost in dark woods.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_5'),
+(-1004008,'All places, all things have souls. All souls can be devoured.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_6'),
+(-1004009,'What can change the nature of a man?',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_7'),
+(-1004010,'The stars sweep chill currents that make men shiver in the dark.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_8'),
+(-1004011,'Do you dream while you sleep or is it an escape from the horrors of reality?',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_9'),
+(-1004012,'Look around. They will all betray you. Flee screaming into the black forest.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_10'),
+(-1004013,'In the land of Ny'alotha there is only sleep.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_11'),
+(-1004014,'In the sleeping city of Ny'alotha walk only mad things.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_12'),
+(-1004015,'Ny'alotha is a city of old, terrible, unnumbered crimes.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_13'),
+(-1004016,'Y'knath k'th'rygg k'yi mrr'ungha gr'mula.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_14'),
+(-1004017,'The void sucks at your soul. It is content to feast slowly.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_15'),
+(-1004018,'The drowned god's heart is black ice.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_16'),
+(-1004019,'It is standing right behind you. Do not move. Do not breathe.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_17'),
+(-1004020,'Have you had the dream again? A black goat with seven eyes that watches from the outside.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_18'),
+(-1004021,'In the sunken city, he lays dreaming.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_19'),
+(-1004022,'Open me! Open me! Open me! Then only will you know peace',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_20'),
+(-1004023,'You resist. You cling to your life as if it actually matters. You will learn.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_21'),
+(-1004024,'The tortured spirits of your ancestors cling to you, screaming in silence. Apparently they are quite numerous.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_22'),
+(-1004025,'The fish know all the secrets. They know the cold. They know the dark.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_23'),
+(-1004026,'The giant rook watches from the dead trees. Nothing breathes beneath his shadow.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_24'),
+(-1004027,'Beneath the shadow of the darkened spire, there is no light, no mercy, only void, and the chaos within.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_25'),
+(-1004028,'You will all be alone in the end.',0,4,0,0,'Puzzle Box of Yogg-Saron SAY_RANDOM_26');

Only Cataclysm. Archaeology.

I know FollowerAI deleted account, but if you will read - thank you for the script - works fine!

This is not my patch. About Puzzle Box