public override void Reset() { SetCombatMovement(false); KillCount = 0; PlayerGUID.Clear(); Summons.DespawnAll(); }
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); }
public override void JustDied(Unit killer) { Talk(TextIds.SayDeath); instance.SetBossState(DataTypes.HeraldVolazj, EncounterState.Done); Summons.DespawnAll(); ResetPlayersPhase(); }
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(); }
public void ModifiedHP() { if (PrimaryStats.HP == 0) { loseEXP(); PrimaryStats.Reset(true); Summons.RemoveAllSummons(); } }
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(); }
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); }
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); }
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); }
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); } } }
//-------------------------------------------------- /// <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); } }
public override void JustSummoned(Creature summon) { Summons.Summon(summon); }
public override void SummonedCreatureDies(Creature summoned, Unit who) { Summons.Despawn(summoned); ++KillCount; }
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; } } }