Docurl
جستجوي سند
نوشته هاي اخير
boss_meathook
  1. /*
  2.  * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
  3.  *
  4.  * This program is free software; you can redistribute it and/or modify it
  5.  * under the terms of the GNU General Public License as published by the
  6.  * Free Software Foundation; either version 2 of the License, or (at your
  7.  * option) any later version.
  8.  *
  9.  * This program is distributed in the hope that it will be useful, but WITHOUT
  10.  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11.  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12.  * more details.
  13.  *
  14.  * You should have received a copy of the GNU General Public License along
  15.  * with this program. If not, see <http://www.gnu.org/licenses/>.
  16.  */
  17.  
  18. #include "ScriptMgr.h"
  19. #include "ScriptedCreature.h"
  20. #include "culling_of_stratholme.h"
  21.  
  22. enum Spells
  23. {
  24.     SPELL_CONSTRICTING_CHAINS                   = 52696, //Encases the targets in chains, dealing 1800 Physical damage every 1 sec. and stunning the target for 5 sec.
  25.     SPELL_DISEASE_EXPULSION                     = 52666, //Meathook belches out a cloud of disease, dealing 1710 to 1890 Nature damage and interrupting the spell casting of nearby enemy targets for 4 sec.
  26.     SPELL_FRENZY                                = 58841 //Increases the caster's Physical damage by 10% for 30 sec.
  27. };
  28.  
  29. enum Yells
  30. {
  31.     SAY_AGGRO                                   = 0,
  32.     SAY_SLAY                                    = 1,
  33.     SAY_SPAWN                                   = 2,
  34.     SAY_DEATH                                   = 3
  35. };
  36.  
  37. enum Events
  38. {
  39.     EVENT_CHAIN                                 = 1,
  40.     EVENT_DISEASE,
  41.     EVENT_FRENZY
  42. };
  43.  
  44. class boss_meathook : public CreatureScript
  45. {
  46.     public:
  47.         boss_meathook() : CreatureScript("boss_meathook") { }
  48.  
  49.         struct boss_meathookAI : public BossAI
  50.         {
  51.             boss_meathookAI(Creature* creature) : BossAI(creature, DATA_MEATHOOK)
  52.             {
  53.                 Talk(SAY_SPAWN);
  54.             }
  55.  
  56.             void EnterCombat(Unit* /*who*/) override
  57.             {
  58.                 Talk(SAY_AGGRO);
  59.                 _EnterCombat();
  60.                 events.ScheduleEvent(EVENT_CHAIN, urand(12000, 17000));
  61.                 events.ScheduleEvent(EVENT_DISEASE, urand(2000, 4000));
  62.                 events.ScheduleEvent(EVENT_FRENZY, urand(21000, 26000));
  63.             }
  64.  
  65.             void ExecuteEvent(uint32 eventId) override
  66.             {
  67.                 switch (eventId)
  68.                 {
  69.                     case EVENT_CHAIN:
  70.                         if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
  71.                             DoCast(target, SPELL_CONSTRICTING_CHAINS);
  72.                         events.ScheduleEvent(EVENT_CHAIN, urand(2000, 4000));
  73.                         break;
  74.                     case EVENT_DISEASE:
  75.                         DoCastAOE(SPELL_DISEASE_EXPULSION);
  76.                         events.ScheduleEvent(EVENT_DISEASE, urand(1500, 4000));
  77.                         break;
  78.                     case EVENT_FRENZY:
  79.                         DoCast(me, SPELL_FRENZY);
  80.                         events.ScheduleEvent(EVENT_FRENZY, urand(21000, 26000));
  81.                         break;
  82.                     default:
  83.                         break;
  84.                 }
  85.             }
  86.  
  87.             void JustDied(Unit* /*killer*/) override
  88.             {
  89.                 Talk(SAY_DEATH);
  90.                 _JustDied();
  91.             }
  92.  
  93.             void KilledUnit(Unit* victim) override
  94.             {
  95.                 if (victim->GetTypeId() == TYPEID_PLAYER)
  96.                     Talk(SAY_SLAY);
  97.             }
  98.         };
  99.  
  100.         CreatureAI* GetAI(Creature* creature) const override
  101.         {
  102.             return GetInstanceAI<boss_meathookAI>(creature);
  103.         }
  104. };
  105.  
  106. void AddSC_boss_meathook()
  107. {
  108.     new boss_meathook();
  109. }
  110.  
تجزیه شده در 0.022 ثانیه
محتویات سند

GoStats provides website analytics

اولین مرجع اشتراک گذاری متن و اسکریپت - قدرت گرفته از Docurl