private void Unbuff(object state) { object[] states = (object[])state; SummonedOboruJumpingSpider toDebuff = (SummonedOboruJumpingSpider)states[0]; toDebuff.EndAction(typeof(OborunianDrowSpiderTrainer)); if (toDebuff.Deleted) { return; } toDebuff.HitsMaxSeed = (int)states[1]; toDebuff.RawStr = (int)states[2]; toDebuff.RawDex = (int)states[3]; toDebuff.Hits = toDebuff.Hits; toDebuff.Stam = toDebuff.Stam; }
public override void OnThink() { if (DateTime.Now >= m_NextAbilityTime) { SummonedOboruJumpingSpider toBuff = null; foreach (Mobile m in this.GetMobilesInRange(8)) { if (m is SummonedOboruJumpingSpider && IsFriend(m) && m.Combatant != null && CanBeBeneficial(m) && m.CanBeginAction(typeof(OborunianDrowSpiderTrainer)) && InLOS(m)) { toBuff = (SummonedOboruJumpingSpider)m; break; } } if (toBuff != null) { if (CanBeBeneficial(toBuff) && toBuff.BeginAction(typeof(OborunianDrowSpiderTrainer))) { m_NextAbilityTime = DateTime.Now + TimeSpan.FromSeconds(Utility.RandomMinMax(30, 60)); toBuff.Say(true, "Oooga Booga!"); this.Say(true, "Purge this jungle of the uncleansed!"); DoBeneficial(toBuff); object[] state = new object[] { toBuff, toBuff.HitsMaxSeed, toBuff.RawStr, toBuff.RawDex }; SpellHelper.Turn(this, toBuff); int toScale = toBuff.HitsMaxSeed; if (toScale > 0) { toBuff.HitsMaxSeed += AOS.Scale(toScale, 100); toBuff.Hits += AOS.Scale(toScale, 100); } toScale = toBuff.RawStr; if (toScale > 0) { toBuff.RawStr += AOS.Scale(toScale, 10); } toScale = toBuff.RawDex; if (toScale > 0) { toBuff.RawDex += AOS.Scale(toScale, 10); toBuff.Stam += AOS.Scale(toScale, 100); } toBuff.Hits = toBuff.Hits; toBuff.Stam = toBuff.Stam; toBuff.FixedParticles(0x375A, 10, 15, 5017, EffectLayer.Waist); toBuff.PlaySound(0x1EE); Timer.DelayCall(TimeSpan.FromSeconds(20.0), new TimerStateCallback(Unbuff), state); } } else { m_NextAbilityTime = DateTime.Now + TimeSpan.FromSeconds(Utility.RandomMinMax(2, 5)); } } base.OnThink(); }
public void SpawnMobiles(Mobile target) { Map map = this.Map; if (map == null) { return; } int red = 0; foreach (Mobile m in this.GetMobilesInRange(10)) { if (m is SummonedOboruJumpingSpider) { ++red; } } if (red < 5) { PlaySound(0x51A); int newblue = Utility.RandomMinMax(1, 2); for (int i = 0; i < newblue; ++i) { BaseCreature yellow; switch (Utility.Random(2)) { default: case 0: yellow = new SummonedOboruJumpingSpider(); break; case 1: yellow = new SummonedOboruJumpingSpider(); break; } yellow.Team = this.Team; bool validLocation = false; Point3D loc = this.Location; for (int j = 0; !validLocation && j < 10; ++j) { int x = X + Utility.Random(3) - 1; int y = Y + Utility.Random(3) - 1; int z = map.GetAverageZ(x, y); if (validLocation = map.CanFit(x, y, this.Z, 16, false, false)) { loc = new Point3D(x, y, Z); } else if (validLocation = map.CanFit(x, y, z, 16, false, false)) { loc = new Point3D(x, y, z); } } yellow.MoveToWorld(loc, map); yellow.Combatant = target; } } }