Advertisement
Guest User

Untitled

a guest
May 25th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.98 KB | None | 0 0
  1. diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp
  2. index 18f69ff2..d820c2d8 100644
  3. --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp
  4. +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp
  5. @@ -1706,9 +1706,32 @@ public:
  6.          {
  7.              me->CastSpell(me, SPELL_DEATH_RAY_WARNING, true);
  8.              _startTimer = 1;
  9. +            moving = true;
  10.          }
  11.  
  12.          uint32 _startTimer;
  13. +        bool moving;
  14. +
  15. +        void DoRandomMove()
  16. +        {
  17. +            Position pos;
  18. +            me->GetNearPoint2D(pos.m_positionX, pos.m_positionY, 10, float(2 * M_PI*rand_norm()));
  19. +            pos.m_positionZ = me->GetPositionZ();
  20. +            pos.m_positionZ = me->GetMap()->GetHeight(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), true, 50.0f);
  21. +            me->SetWalk(true);
  22. +            me->GetMotionMaster()->MovePoint(1, pos);
  23. +        }
  24. +
  25. +        void MovementInform(uint32 type, uint32 id) override
  26. +        {
  27. +            if (type != POINT_MOTION_TYPE)
  28. +                return;
  29. +
  30. +            if (id != 1)
  31. +                return;
  32. +
  33. +            moving = false;
  34. +        }
  35.  
  36.          void UpdateAI(uint32 diff)
  37.          {
  38. @@ -1723,9 +1746,16 @@ public:
  39.                      _startTimer = 0;
  40.                      me->SetSpeedRate(MOVE_WALK, 2);
  41.                      me->SetSpeedRate(MOVE_RUN, 2);
  42. -                    me->GetMotionMaster()->MoveRandom(20.0f);
  43. +                    moving = false;
  44. +                    //me->GetMotionMaster()->MoveRandom(20.0f);
  45.                  }
  46.              }
  47. +
  48. +            if (!moving)
  49. +            {
  50. +                DoRandomMove();
  51. +                moving = true;
  52. +            }
  53.          }
  54.      };
  55.  };
  56.  
  57.  
  58. warning: LF will be replaced by CRLF in src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp.
  59. The file will have its original line endings in your working directory.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement