Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 9.33 KB | None | 0 0
  1.  
  2. /*######
  3. ## npc_daegarn
  4. ######*/
  5.  
  6. enum
  7. {
  8.     QUEST_DEFEAT_AT_RING            = 11300,
  9.  
  10.     NPC_FIRJUS                      = 24213,
  11.     NPC_JLARBORN                    = 24215,
  12.     NPC_YOROS                       = 24214,
  13.     NPC_OLUF                        = 23931,
  14.  
  15.     NPC_PRISONER_1                  = 24253,                // looks the same but has different abilities
  16.     NPC_PRISONER_2                  = 24254,
  17.     NPC_PRISONER_3                  = 24255,
  18. };
  19.  
  20. const POSITION afSummon[] =
  21. {
  22. {838.81f, -4678.06f, -94.182f}
  23. };
  24. const POSITION afCenter[] =
  25. {
  26. {801.88f, -4721.87f, -96.143f}
  27. };
  28.  
  29. class npc_daegarn : public CreatureScript
  30. {
  31. public:
  32.     npc_daegarn() : CreatureScript("npc_daegarn") { }
  33.    
  34.     bool OnQuestAccept(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
  35.     {
  36.     IF (pQuest->GetQuestId() == QUEST_DEFEAT_AT_RING)
  37.     {
  38.         IF (npc_daegarnAI* pDaegarnAI = CAST_AI(npc_daegarn::npc_daegarnAI, pCreature->AI()))
  39.             pDaegarnAI->StartEvent(pPlayer);
  40.     }
  41.  
  42.     RETURN TRUE;
  43.    }
  44.    
  45. struct npc_daegarnAI : public ScriptedAI
  46. // TODO: make prisoners help (unclear IF summoned OR USING npc's from surrounding cages (summon inside small cages?))
  47. {  
  48.    npc_daegarnAI(Creature *pCreature) : ScriptedAI(pCreature)
  49.     {
  50.     Reset();
  51.     }
  52.  
  53.    bool m_bEventInProgress;
  54.    uint64 uiPlayerGUID;
  55.  
  56.    void Reset()
  57.    {
  58.        m_bEventInProgress = false;
  59.        uiPlayerGUID = 0;
  60.    }
  61.  
  62.    void StartEvent(Player* pPlayer)
  63.    {
  64.        if (m_bEventInProgress)
  65.            return;
  66.  
  67.        uiPlayerGUID = pPlayer->GetGUID();
  68.  
  69.        SummonGladiator(NPC_FIRJUS);
  70.    }
  71.  
  72.    void JustSummoned(Creature* pSummon)
  73.    {
  74.        if (Player* pPlayer = me->GetPlayer(*me, uiPlayerGUID))
  75.        {
  76.            if (pPlayer->isAlive())
  77.            {
  78.                pSummon->RemoveUnitMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION);
  79.                pSummon->GetMotionMaster()->MovePoint(0, afCenter[0]);
  80.                return;
  81.            }
  82.        }
  83.  
  84.        Reset();
  85.    }
  86.  
  87.    void SummonGladiator(uint32 uiEntry)
  88.    {
  89.         me->SummonCreature(uiEntry, afSummon[0], TEMPSUMMON_CORPSE_DESPAWN, 3000);
  90.    }
  91.  
  92.    void SummonedMovementInform(Creature* pSummoned, uint32 uiMotionType, uint32 uiPointId)
  93.    {
  94.       Player* pPlayer = me->GetPlayer(*me, uiPlayerGUID);
  95.  
  96.        // could be group, so need additional here.
  97.        if (!pPlayer || !pPlayer->isAlive())
  98.        {
  99.            Reset();
  100.            return;
  101.        }
  102.  
  103.        if (pSummoned->IsWithinDistInMap(pPlayer, 75.0f))   // ~the radius of the ring
  104.            pSummoned->AI()->AttackStart(pPlayer);
  105.    }
  106.  
  107.    void SummonedCreatureDespawn(Creature* pSummoned)
  108.    {
  109.        uint32 uiEntry = 0;
  110.  
  111.        // will eventually reset the event if something goes wrong
  112.        switch(pSummoned->GetEntry())
  113.        {
  114.            case NPC_FIRJUS:    uiEntry = NPC_JLARBORN; break;
  115.            case NPC_JLARBORN:  uiEntry = NPC_YOROS;    break;
  116.            case NPC_YOROS:     uiEntry = NPC_OLUF;     break;
  117.            case NPC_OLUF:      Reset()                 return;
  118.        }
  119.  
  120.        SummonGladiator(uiEntry);
  121.    }
  122. };
  123.    CreatureAI *GetAI(Creature *creature) const
  124.    {
  125.        return new npc_daegarnAI(creature);
  126.    }
  127.  
  128. };
  129.  
  130. UPDATE creature_template SET ScriptName='npc_daegarn' WHERE entry=24151;
  131. -- Firjus the Soul Crusher
  132. SET @ENTRYF:=24213;
  133. UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRYF;
  134. DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRYF;
  135. INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
  136. (@ENTRYF,0,0,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Firjus the Soul Crusher - Yell ON Aggro'),
  137. (@ENTRYF,0,1,0,0,0,100,0,3000,4000,5000,6000,11,15284,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Firjus the Soul Crusher - CAST Cleave'),
  138. (@ENTRYF,0,2,0,0,0,75,0,5000,6000,7000,8000,11,43348,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Firjus the Soul Crusher - CAST Head Crush');
  139.  
  140. DELETE FROM `creature_text` WHERE `entry`=@ENTRYF;
  141. INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
  142. (@ENTRYF,0,0, 'Firjus fears nothing! Release the combatants!',1,0,100,0,0,0, 'Firjus the Soul Crusher yell');
  143.  
  144. -- Jlarborn the Strategist
  145. SET @ENTRYJ:=24215;
  146. UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRYJ;
  147. DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRYJ;
  148. INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
  149. (@ENTRYJ,0,0,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Jlarborn the Strategist - Yell ON Aggro'),
  150. (@ENTRYJ,0,1,0,9,0,100,0,8,25,20000,25000,11,15749,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Jlarborn the Strategist - CAST Shield Charge'),
  151. (@ENTRYJ,0,2,0,0,0,75,0,2000,2000,6000,6000,11,8374,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Jlarborn the Strategist - CAST Arcing Smash'),
  152. (@ENTRYJ,0,3,0,13,0,75,0,1000,6000,0,0,11,38233,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Jlarborn the Strategist - CAST Shield Bash'),
  153. (@ENTRYJ,0,4,0,0,0,100,0,7000,11000,11000,18000,11,12169,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Jlarborn the Strategist - CAST Shield Block');
  154.  
  155. DELETE FROM `creature_text` WHERE `entry`=@ENTRYJ;
  156. INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
  157. (@ENTRYJ,0,0, 'Firjus was unworthy! Test your battle prowess against a TRUE soldier OF the Lich King!',1,0,100,0,0,0, 'Jlarborn the Strategist');
  158.  
  159. -- Yorus the Flesh Harvester
  160. SET @ENTRYY:=24214;
  161. UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRYY;
  162. DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRYY;
  163. INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
  164. (@ENTRYY,0,0,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Yorus the Flesh Harvester - Yell ON Aggro'),
  165. (@ENTRYY,0,1,0,0,0,100,0,3000,4000,5000,6000,11,15284,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Yorus the Flesh Harvester - CAST Cleave'),
  166. (@ENTRYY,0,2,0,0,0,75,0,15000,15000,30000,30000,11,41056,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Yorus the Flesh Harvester - CAST Whirlwind');
  167.  
  168. DELETE FROM `creature_text` WHERE `entry`=@ENTRYY;
  169. INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
  170. (@ENTRYY,0,0,'Good... More flesh FOR the harvest...',1,0,100,0,0,0, 'Yorus the Flesh Harvester yell');
  171.  
  172. -- Oluf the Violent
  173. SET @ENTRYO:=23931;
  174. UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRYO;
  175. DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRYO;
  176. INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
  177. (@ENTRYO,0,0,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Oluf the Violent - Yell ON Aggro'),
  178. (@ENTRYO,0,1,0,0,0,100,0,3000,5000,5000,7000,11,15284,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Oluf the Violent - CAST Cleave'),
  179. (@ENTRYO,0,2,0,0,0,100,0,4000,4000,17200,25200,11,13730,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Oluf the Violent - CAST Demoralizing Shout'),
  180. (@ENTRYO,0,3,0,0,0,100,0,15000,15000,30000,30000,11,41056,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Oluf the Violent - CAST Whirlwind'),
  181. (@ENTRYO,0,4,0,9,0,100,0,10,20,1000,1000,11,6533,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Oluf the Violent - CAST Net'),
  182. (@ENTRYO,0,5,0,9,0,100,0,15,30,2000,2000,11,42870,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Oluf the Violent - CAST Throw Dragonflayer Harpoon'),
  183. (@ENTRYO,0,6,0,6,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Oluf the Violent - Notify'),
  184. (@ENTRYO,0,7,0,6,0,100,0,0,0,0,0,11,43326,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Oluf the Violent - Spawn Ancient Cipher');
  185.  
  186. DELETE FROM `creature_text` WHERE `entry`=@ENTRYO;
  187. INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
  188. (@ENTRYO,0,0, 'The ring will overflow WITH the blood OF the interlopers! Oluf has come!',1,0,100,0,0,0, 'Oluf the Violent yell');
  189. (@ENTRYO,1,0, 'The ancient cipher falls ON the ground.',3,0,100,0,0,0, 'Oluf the Violent notify');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement