Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- else
- {
- if (flankingMoguGuid[indx].IsEmpty())
- indx = indx > 6 ? indx - 6 : indx + 6;
- float dist = 13.5f;
- float angle = M_PI / 2;
- Position alignmentPos; //The position regarding which we will align the Flanking Mogu
- Position alignmentPosList[6];
- ObjectGuid leaderGuid = flankingMoguGuid[indx + 3];
- if (auto leader = me->GetCreature(*me, leaderGuid))
- {
- leader->GetNearPosition(alignmentPos, 3.0f, 0.0f);
- for (uint8 i = 0; i < 6; ++i)
- if (auto flanking = me->GetCreature(*me, flankingMoguGuid[indx + i]))
- {
- alignmentPos.SimplePosXYRelocationByAngle(alignmentPosList[i], abs(dist), angle);
- dist = dist != 0 ? dist - 4.5 : -4.5f;
- if (i == 2)
- angle = 3 * M_PI / 2;
- flanking->RemoveAura(SPELL_GHOSTLY_VISUAL);
- flanking->CastSpell(flanking, SPELL_OVERHAND_STRIKE);
- flanking->AddDelayedEvent(2100, [=]()-> void
- {
- flanking->GetMotionMaster()->MovePoint(1, alignmentPosList[i], false);
- flanking->AddDelayedEvent(1500, [=]()-> void
- {
- Position movePos;
- GetPositionWithDistInOrientation(flanking, 85.0f, flankingSumPos[indx + 3].GetOrientation(), movePos.m_positionX, movePos.m_positionY);
- movePos.m_positionZ = flanking->GetPositionZ();
- flanking->GetMotionMaster()->MovePoint(1, movePos, false);
- flanking->DespawnOrUnsummon(13000);
- });
- });
- //Spawn a new one to remplace the old one
- flankingMoguGuid[indx + i].Clear();
- me->AddDelayedEvent(20000, [=]()-> void {SummonOrActivateFlankingMogu(indx + i, true); });
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement