示例#1
0
 public override void Reset()
 {
     SetCombatMovement(false);
     KillCount = 0;
     PlayerGUID.Clear();
     Summons.DespawnAll();
 }
示例#2
0
 public override void JustSummoned(Creature summoned)
 {
     // This is the best I can do because AttackStart does nothing
     summoned.GetMotionMaster().MovePoint(1, me.GetPositionX(), me.GetPositionY(), me.GetPositionZ());
     // summoned.AI().AttackStart(me);
     Summons.Summon(summoned);
 }
示例#3
0
        public override void JustDied(Unit killer)
        {
            Talk(TextIds.SayDeath);

            instance.SetBossState(DataTypes.HeraldVolazj, EncounterState.Done);

            Summons.DespawnAll();
            ResetPlayersPhase();
        }
示例#4
0
        public override void UpdateAI(uint diff)
        {
            //Return since we have no target
            if (!UpdateVictim())
            {
                return;
            }

            if (insanityHandled != 0)
            {
                if (!Summons.Empty())
                {
                    return;
                }

                insanityHandled = 0;
                me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
                me.SetControlled(false, UnitState.Stunned);
                me.RemoveAurasDueToSpell(SpellIds.InsanityVisual);
            }

            if (uiMindFlayTimer <= diff)
            {
                DoCastVictim(SpellIds.MindFlay);
                uiMindFlayTimer = 20 * Time.InMilliseconds;
            }
            else
            {
                uiMindFlayTimer -= diff;
            }

            if (uiShadowBoltVolleyTimer <= diff)
            {
                DoCastVictim(SpellIds.ShadowBoltVolley);
                uiShadowBoltVolleyTimer = 5 * Time.InMilliseconds;
            }
            else
            {
                uiShadowBoltVolleyTimer -= diff;
            }

            if (uiShiverTimer <= diff)
            {
                Unit target = SelectTarget(SelectAggroTarget.Random, 0);
                if (target)
                {
                    DoCast(target, SpellIds.Shiver);
                }
                uiShiverTimer = 15 * Time.InMilliseconds;
            }
            else
            {
                uiShiverTimer -= diff;
            }

            DoMeleeAttackIfReady();
        }
示例#5
0
 public void ModifiedHP()
 {
     if (PrimaryStats.HP == 0)
     {
         loseEXP();
         PrimaryStats.Reset(true);
         Summons.RemoveAllSummons();
     }
 }
示例#6
0
        private void FinishChangeMap(Map prevMap, Map newMap)
        {
            TryActivateHide();
            MapPacket.SendChangeMap(this);

            if (newMap.PQPortalOpen == true)
            {
                MapPacket.PortalEffect(Field, 2, "gate");
            }
            newMap.AddPlayer(this);
            Summons.MigrateSummons(prevMap, newMap);
            Server.Instance.CenterConnection.PlayerUpdateMap(this);
            PartyHPUpdate();
        }
示例#7
0
        public void TestSummonsIsValid()
        {
            var testSubject = new Summons
            {
                Court               = new FederalCourt("district"),
                IsSigned            = lp => true,
                GetAssertion        = lp => new ExampleCauseForAction(),
                GetDateOfAppearance = lp => DateTime.Today.AddDays(30),
            };

            var testResult = testSubject.IsValid(new ExamplePlaintiff(), new ExampleDefendant());

            Console.WriteLine(testSubject.ToString());
            Assert.IsTrue(testResult);
        }
示例#8
0
        protected virtual void NetFuncUnSummon(PackedUInt objectId)
        {
            var index = this.IndexOfSummon(objectId);

            if (index < 0)
            {
                return;
            }

            var summon = Summons[index];

            if (summon.type != SummonType.Pet)
            {
                return;
            }

            Summons.RemoveAt(index);
            summon.UnSummon(this);
        }
示例#9
0
        public override void Reset()
        {
            Initialize();

            instance.SetBossState(DataTypes.HeraldVolazj, EncounterState.NotStarted);
            instance.DoStopCriteriaTimer(CriteriaTimedTypes.Event, Misc.AchievQuickDemiseStartEvent);

            // Visible for all players in insanity
            me.SetInPhase(169, true, true);
            for (uint i = 173; i <= 177; ++i)
            {
                me.SetInPhase(i, true, true);
            }

            ResetPlayersPhase();

            // Cleanup
            Summons.DespawnAll();
            me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
            me.SetControlled(false, UnitState.Stunned);
        }
示例#10
0
        public override void SummonedCreatureDespawn(Creature summon)
        {
            uint nextPhase = 0;

            Summons.Despawn(summon);

            // Check if all summons in this phase killed
            foreach (var guid in Summons)
            {
                Creature visage = ObjectAccessor.GetCreature(me, guid);
                if (visage)
                {
                    // Not all are dead
                    if (visage.IsInPhase(summon))
                    {
                        return;
                    }
                    else
                    {
                        nextPhase = visage.GetPhases().First();
                        break;
                    }
                }
            }

            // Roll Insanity
            var players = me.GetMap().GetPlayers();

            foreach (var player in players)
            {
                if (player)
                {
                    for (uint index = 0; index <= 4; ++index)
                    {
                        player.RemoveAurasDueToSpell(SpellIds.InsanityTarget + index);
                    }
                    player.CastSpell(player, SpellIds.InsanityTarget + nextPhase - 173, true);
                }
            }
        }
示例#11
0
        //--------------------------------------------------

        /// <summary>
        /// Updates all field objects.
        /// </summary>
        public virtual void Update()
        {
            Mobs.Update();

            Reactors.RedistributeLife();

            Drops.Update();

            if (tFieldTimerExpiration != DateTime.MinValue && tFieldTimerExpiration.SecondsUntilEnd() <= 0)
            {
                OnClockEnd();
            }

            foreach (var user in Users)
            {
                user.Update(this);
            }

            // less taxing to check item id cuz it gets reset when the effect is over
            if (CurrentWeather.nItemID > 0 && CurrentWeather.StartTime.AddedSecondsExpired(CurrentWeather.Duration))
            {
                CurrentWeather.Clear();
            }

            MiniRooms.Update();
            Kites.Update();
            TownPortals.Update();
            OpenGates1.Update();
            OpenGates2.Update();
            AffectedAreas.Update();
            Summons.Update();

            if (Template.DecHP > 0 || Template.DecMP > 0)
            {
                // TODO
                // CUserLocal::OnNotifyHPDecByField(this, iPacket);
            }
        }
示例#12
0
 public override void JustSummoned(Creature summon)
 {
     Summons.Summon(summon);
 }
示例#13
0
 public override void SummonedCreatureDies(Creature summoned, Unit who)
 {
     Summons.Despawn(summoned);
     ++KillCount;
 }
示例#14
0
        public MobSkillDataReference(WzImageProperty img)
        {
            if (!int.TryParse(img.Name, out var id))
            {
                return;
            }

            foreach (var node in img.WzProperties)
            {
                switch (node.Name)
                {
                case "affected":
                case "effect":
                case "mob":
                case "mob0":
                case "tile":
                    break;

                case "time":
                    Duration = node.GetShort();
                    break;

                case "mpCon":
                    MpCost = node.GetShort();
                    break;

                case "x":
                    ParameterA = node.GetInt();
                    break;

                case "y":
                    ParameterB = node.GetInt();
                    break;

                case "prop":
                    Chance = node.GetShort();
                    break;

                case "count":
                    TargetCount = node.GetShort();
                    break;

                case "interval":
                    Cooldown = node.GetShort();
                    break;

                case "lt":
                    Lt = node.GetPoint();
                    break;

                case "rb":
                    Rb = node.GetPoint();
                    break;

                case "hp":
                    PercentageLimitHp = node.GetShort();
                    break;

                case "limit":
                    SummonLimit = node.GetShort();
                    break;

                case "summonEffect":
                    SummonEffect = node.GetShort();
                    break;

                case { } summonId when int.TryParse(summonId, out _):
                    Summons.Add(node.GetInt());

                    break;

                default:
                    _log.Warning(
                        $"Unknown mob skill data node Skill={id} Name={node.Name} Value={node.WzValue}");
                    break;
                }
            }
        }