public void Enter(Bull bull) { _bull = bull; _bull.sleepyFX.Play(); _bull.isSleepState = true; _bull._navMeshAgent.speed = 0; }
public override bool CheckEnableOut() { double minRate = (double)this.ChipCount / this.CommSetting.Odds; //double midRate = (double)this.ChipCount / 10; //double maxRate = 2 * midRate - minRate; double lastVal = this.RateDic[this.LastUseData().LastData.Expect]; //进行布林线验证 Bull bull = null; double[][] res = null; if (!this.UseMainGuides().ContainsKey(this.LastUseData().LastData.Expect)) { bull = new Bull(this.RateDic.Values.ToArray <double>(), 20); res = bull.getLastData(); this.UseMainGuides().Add(this.LastUseData().LastData.Expect, bull); } else { bull = this.UseMainGuides()[this.LastUseData().LastData.Expect] as Bull; res = bull.BuffData; } if (lastVal > 100 * minRate) //如果大于保本的最小值,返回真 { return(true); } int bullCnt = res[0].Length; if (lastVal > res[1][bullCnt - 1])//当前值上穿上布林线,出场 { return(true); } return(false); }
public ActionResult DeleteConfirmed(int id) { Bull bull = db.Bulls.Find(id); db.Bulls.Remove(bull); db.SaveChanges(); return(RedirectToAction("Index")); }
static void Main(string[] args) { int i = 5; Bull b = new Bull(); b.WriteMessage(i); Console.ReadLine(); }
public ActionResult Edit([Bind(Include = "Id,Name,Description,PurchasedFrom,Status")] Bull bull) { if (ModelState.IsValid) { db.Entry(bull).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(bull)); }
public ActionResult Create([Bind(Include = "Id,Name,Description,PurchasedFrom,Status")] Bull bull) { if (ModelState.IsValid) { db.Bulls.Add(bull); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(bull)); }
// GET: Bulls/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Bull bull = db.Bulls.Find(id); if (bull == null) { return(HttpNotFound()); } return(View(bull)); }
public override bool CheckEnableIn() { double minRate = (double)this.ChipCount / this.CommSetting.Odds; double midRate = (double)this.ChipCount / 10; double maxRate = 2 * midRate - minRate; double lastVal = this.RateDic[this.LastUseData().LastData.Expect]; if (this.RateDic.Count == 1) { return(false); } double preval = this.RateDic[string.Format("{0}", Int32.Parse(this.LastUseData().LastData.Expect) - 1)]; //布林线验证 Bull bull = null; double[][] res = null; double[][] preres = null; if (this.UseMainGuides() == null || !this.UseMainGuides().ContainsKey(this.LastUseData().LastData.Expect)) { bull = new Bull(this.RateDic.Values.ToArray <double>(), 20); res = bull.getLastData(); preres = bull.Ref(1); if (this.UseMainGuides() == null) { this.SetUseMainGuides(new Dictionary <string, MGuide>()); } this.UseMainGuides().Add(this.LastUseData().LastData.Expect, bull); } else { bull = this.UseMainGuides()[this.LastUseData().LastData.Expect] as Bull; res = bull.getLastData(); preres = bull.Ref(1); } if (lastVal > 100 * maxRate) //如果大于允许进入的最大值,返回否 { return(false); } int bullCnt = res[0].Length; if (lastVal > res[2][0] && preval < preres[2][0])//当前值上穿下布林线,入场 { return(true); } return(false); }
public void LoadBullet() { var textAsset = Resources.Load <TextAsset>("Res/Data/Bullet").text.ToString(); var Data = JsonMapper.ToObject(textAsset); for (int i = 0; i < Data.Count; i++) { string Name = Data[i]["Name"].ToString(); float Speed = float.Parse(Data[i]["Speed"].ToString()); int attack = (int)Data[i]["attack"]; if (!bullet.ContainsKey(Name)) { bullet[Name] = new Bull(Speed, attack); } } }
protected async override Task AddAsync(FarmingEntities db, BullViewModel model) { var bull = new Bull() { Location = model.Location, OtherId = model.OtherId }; db.Bulls.Add(bull); await db.SaveChangesAsync(); model.Id = bull.Id; Models.Add(model); }
public void TestWinnerOutcome() { Bull.StartingPosition1 = 0; Bull.RacetrackLength1 = 50; int BettingAmount = 50; int BullNumber = 1; int expectedWin = 100; int expectedLose = 0; Bulls[0] = new Bull() { BullPictureBox = null }; Bulls[1] = new Bull() { BullPictureBox = null }; Hartej = objFactory.getPunter("Hartej", null, null); Hartej.money = BettingAmount; Hartej.PlaceBet((int)BettingAmount, BullNumber); bool nowin = true; int win = -1; while (nowin) { for (int i = 0; i < Bulls.Length; i++) { if (Bull.Run(Bulls[i])) { win = i + 1; Hartej.Collect(win); nowin = false; } } } if (Hartej.gamble.BullNum == win) { Assert.AreEqual(expectedWin, Hartej.money, "Account not credited correctly"); } if (Hartej.gamble.BullNum != win) { Assert.AreEqual(expectedLose, Hartej.money, "Account not debited correctly"); } }
public override AnimalINPC GetAnimal(AnimalNPCType animalType) { switch (animalType) { case AnimalNPCType.Horse: AnimalINPC horse = new Horse(); return(horse); case AnimalNPCType.Bull: AnimalINPC bull = new Bull(); return(bull); case AnimalNPCType.WienerDog: AnimalINPC wienerDog = new WienerDog(); return(wienerDog); } return(null); }
//GET: Bulls/Calves/5 public ActionResult Calves(int?id, int page = 1) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Bull bull = db.Bulls.Find(id); if (bull == null) { return(HttpNotFound()); } string bullname = bull.Name; List <CalfListViewModel> listCalves = new List <CalfListViewModel>(); listCalves = _db.Query <Cow>() .Where(r => r.Sire == bull.Name) .OrderByDescending(r => r.DOB) .Select(r => new CalfListViewModel { Id = r.Id, ParentName = bullname, ParentSex = "M", Name = r.Name, DOB = r.DOB, tagNumber = r.tagNumber, Sex = r.Sex, Status = r.Status, Owner = r.Owner, Dam = r.Dam }).ToList(); var model = listCalves.ToPagedList(page, 10); return(View(model)); }
public void Enter(Bull bull) { _bull = bull; _bull.isDeathState = true; _bull._navMeshAgent.enabled = false; }
public void Enter(Bull bull) { _bull = bull; _bull.isIdleState = true; _bull._navMeshAgent.speed = 0;// }
public override void Damage(Mobile m) { base.Damage(m); if (m.Alive) { Item item = m.FindItemOnLayer(Layer.OuterTorso); if (item is GMRobe) { AOS.Damage(m, 0, 0, 0, 0, 0, 0); } else if (item is GMRobeExplosion) { AOS.Damage(m, 0, 0, 0, 0, 0, 0); m.PlaySound(Utility.RandomList(0x307, 0x308)); } else if (item is GMRobeHoly) { AOS.Damage(m, 0, 0, 0, 0, 0, 0); m.FixedParticles(0x375A, 1, 30, 9966, 88, 2, EffectLayer.Head); m.FixedParticles(0x37B9, 1, 30, 9502, 85, 3, EffectLayer.Head); m.FixedParticles(0x376A, 1, 31, 9961, 80, 0, EffectLayer.Waist); m.FixedParticles(0x37C4, 1, 31, 9502, 88, 2, EffectLayer.Waist); } else if (item is GMRobeFarts) { AOS.Damage(m, 0, 0, 0, 0, 0, 0); m.PlaySound(Utility.RandomList(792, 1064)); } else if (item is GMRobeTrailfire) { AOS.Damage(m, 0, 0, 0, 0, 0, 0); m.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot); } else { if (m.Title == "the Running Pants") { if (m.Str <= 100) { if (Utility.RandomDouble() < 0.0003) { m.Str += 1; m.BoltEffect(0x480); m.PlaySound(0x5CE); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } } } // Wind if (Utility.RandomDouble() < 0.002) { m.PlaySound(Utility.RandomList(0x014, 0x15, 0x016, 0x5C7)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } if (Utility.RandomDouble() < 0.002) { m.PlaySound(Utility.RandomList(0x014, 0x15, 0x016, 0x5C7)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } if (m.Kills >= 5) { // Wasteland Mercenary Ambush if (Utility.RandomDouble() < 0.005) { if (m.Map == Map.Malas) { int x1 = m.X + 20; int y1 = m.Y + 20; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseCreature wastelandmercenary = new WastelandMercenary(); wastelandmercenary.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); wastelandmercenary.Combatant = m; wastelandmercenary.PlaySound(0x220); // Earthquake m.PlaySound(0x5CE); wastelandmercenary.BoltEffect(0x480); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(30.0), new TimerStateCallback(DeleteWastelandMercenary), wastelandmercenary); } } // Wasteland Mercenary 2 if (Utility.RandomDouble() < 0.005) { if (m.Map == Map.Malas) { int x2 = m.X - 20; int y2 = m.Y - 20; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseCreature wastelandmercenary = new WastelandMercenary(); wastelandmercenary.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); wastelandmercenary.Combatant = m; wastelandmercenary.PlaySound(0x220); // Earthquake m.PlaySound(0x5CE); wastelandmercenary.BoltEffect(0x480); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(30.0), new TimerStateCallback(DeleteWastelandMercenary), wastelandmercenary); } } } } } // Dragon Encounter 1 if (Utility.RandomDouble() < 0.0001) { if (m.Map == Map.Malas) { int x1 = m.X + 15; int y1 = m.Y + 15; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseCreature dragonencounter; switch (Utility.Random(2)) { default: case 0: dragonencounter = new BlackDragon(); break; case 1: dragonencounter = new BlackDragon(); break; } dragonencounter.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); dragonencounter.Combatant = m; m.PlaySound(0x656); // risingColossus AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(30.0), new TimerStateCallback(DeleteDragonEncounter), dragonencounter); } } } // Dragon Encounter 2 if (Utility.RandomDouble() < 0.0001) { if (m.Map == Map.Malas) { int x2 = m.X - 12; int y2 = m.Y - 12; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseCreature dragonencounter; switch (Utility.Random(8)) { default: case 0: dragonencounter = new BlackDragon(); break; case 1: dragonencounter = new BlackDragon(); break; } dragonencounter.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); dragonencounter.Combatant = m; m.PlaySound(0x656); // risingColossus AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(30.0), new TimerStateCallback(DeleteDragonEncounter), dragonencounter); } } } // Random Encounter 1 if (Utility.RandomDouble() < 0.00002) { if (m.Map == Map.Malas) { int x1 = m.X + 12; int y1 = m.Y + 12; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseCreature encountera; switch (Utility.Random(15)) { default: case 0: encountera = new Almiraj(); break; case 1: encountera = new BlackAntAmbusher(); break; case 2: encountera = new FaerieBeetleCollector(); break; case 3: encountera = new GazerLarva(); break; case 4: encountera = new Gizzard(); break; case 5: encountera = new GreenSlime(); break; case 6: encountera = new HordeMinion(); break; case 7: encountera = new Mongbat(); break; case 8: encountera = new Orc(); break; case 9: encountera = new Ratman(); break; case 10: encountera = new StreamingWisp(); break; case 11: encountera = new SwampVine(); break; case 12: encountera = new Tokoloshe(); break; case 13: encountera = new VerdantSprite(); break; case 14: encountera = new WaterLizard(); break; } encountera.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteEncounterA), encountera); } } } // Random Encounter 2 if (Utility.RandomDouble() < 0.00002) { if (m.Map == Map.Malas) { int x2 = m.X - 12; int y2 = m.Y - 12; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseCreature encountera; switch (Utility.Random(15)) { default: case 0: encountera = new Almiraj(); break; case 1: encountera = new BlackAntAmbusher(); break; case 2: encountera = new FaerieBeetleCollector(); break; case 3: encountera = new GazerLarva(); break; case 4: encountera = new Gizzard(); break; case 5: encountera = new GreenSlime(); break; case 6: encountera = new HordeMinion(); break; case 7: encountera = new Mongbat(); break; case 8: encountera = new Orc(); break; case 9: encountera = new Ratman(); break; case 10: encountera = new StreamingWisp(); break; case 11: encountera = new SwampVine(); break; case 12: encountera = new Tokoloshe(); break; case 13: encountera = new VerdantSprite(); break; case 14: encountera = new WaterLizard(); break; } encountera.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteEncounterA), encountera); } } } // Tamable Encounter 1 if (Utility.RandomDouble() < 0.00002) { if (m.Map == Map.Malas) { int x1 = m.X + 12; int y1 = m.Y + 12; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseCreature tameable; switch (Utility.Random(23)) { default: case 0: tameable = new Bird(); break; case 1: tameable = new Boar(); break; case 2: tameable = new BrownBear(); break; case 3: tameable = new Bull(); break; case 4: tameable = new Chicken(); break; case 5: tameable = new Cow(); break; case 6: tameable = new ForestBat(); break; case 7: tameable = new Goat(); break; case 8: tameable = new GreatHart(); break; case 9: tameable = new GreenSlime(); break; case 10: tameable = new GreySquirrel(); break; case 11: tameable = new GreyWolfPup(); break; case 12: tameable = new Hind(); break; case 13: tameable = new Horse(); break; case 14: tameable = new LargeFrog(); break; case 15: tameable = new Ogumo(); break; case 16: tameable = new Panther(); break; case 17: tameable = new Pig(); break; case 18: tameable = new Rabbit(); break; case 19: tameable = new Rat(); break; case 20: tameable = new RhinoBeetle(); break; case 21: tameable = new RunningPants(); break; case 22: tameable = new Sheep(); break; } tameable.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteTameable), tameable); } } } // Tamable Encounter 2 if (Utility.RandomDouble() < 0.00002) { if (m.Map == Map.Malas) { int x2 = m.X - 12; int y2 = m.Y - 12; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseCreature tameable; switch (Utility.Random(23)) { default: case 0: tameable = new Bird(); break; case 1: tameable = new Boar(); break; case 2: tameable = new BrownBear(); break; case 3: tameable = new Bull(); break; case 4: tameable = new Chicken(); break; case 5: tameable = new Cow(); break; case 6: tameable = new ForestBat(); break; case 7: tameable = new Goat(); break; case 8: tameable = new GreatHart(); break; case 9: tameable = new GreenSlime(); break; case 10: tameable = new GreySquirrel(); break; case 11: tameable = new GreyWolfPup(); break; case 12: tameable = new Hind(); break; case 13: tameable = new Horse(); break; case 14: tameable = new LargeFrog(); break; case 15: tameable = new Ogumo(); break; case 16: tameable = new Panther(); break; case 17: tameable = new Pig(); break; case 18: tameable = new Rabbit(); break; case 19: tameable = new Rat(); break; case 20: tameable = new RhinoBeetle(); break; case 21: tameable = new RunningPants(); break; case 22: tameable = new Sheep(); break; } tameable.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteTameable), tameable); } } } // Random Adventurer 1 if (Utility.RandomDouble() < 0.00002) { if (m.Map == Map.Malas) { int x1 = m.X + 15; int y1 = m.Y + 15; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseCreature friendlyencounter; switch (Utility.Random(2)) { default: case 0: friendlyencounter = new ZaythalorHuman(); break; case 1: friendlyencounter = new ZaythalorSunElf(); break; case 2: friendlyencounter = new ZaythalorMoonElf(); break; } friendlyencounter.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteFriendlyEncounter), friendlyencounter); } } } // Random Adventurer 2 if (Utility.RandomDouble() < 0.00002) { if (m.Map == Map.Malas) { int x2 = m.X - 15; int y2 = m.Y - 15; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseCreature friendlyencounter; switch (Utility.Random(2)) { default: case 0: friendlyencounter = new ZaythalorHuman(); break; case 1: friendlyencounter = new ZaythalorSunElf(); break; case 2: friendlyencounter = new ZaythalorMoonElf(); break; } friendlyencounter.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteFriendlyEncounter), friendlyencounter); } } } // Random Treasure Chest 1 if (Utility.RandomDouble() < 0.0005) { if (m.Map == Map.Malas) { int x1 = m.X + 12; int y1 = m.Y + 12; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseContainer treasurechest; if (m.Skills.Tracking.Base > 4.9) { switch (Utility.Random(2)) { default: case 0: treasurechest = new ZaythalorForestTreasureChest1(); break; case 1: treasurechest = new ZaythalorForestTreasureChest1(); break; } treasurechest.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteTreasureChest), treasurechest); } } } } // Random Treasure Chest 2 if (Utility.RandomDouble() < 0.0005) { if (m.Map == Map.Malas) { int x2 = m.X - 12; int y2 = m.Y - 12; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseContainer treasurechest; if (m.Skills.Tracking.Base > 4.9) { switch (Utility.Random(2)) { default: case 0: treasurechest = new ZaythalorForestTreasureChest1(); break; case 1: treasurechest = new ZaythalorForestTreasureChest1(); break; } treasurechest.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteTreasureChest), treasurechest); } } } } // Random Dead Body 1 if (Utility.RandomDouble() < 0.0003) { if (m.Map == Map.Malas) { int x1 = m.X + 10; int y1 = m.Y + 10; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseContainer deadbody; switch (Utility.Random(4)) { default: case 0: deadbody = new UnknownBardSkeletonZaythalor(); break; case 1: deadbody = new UnknownMageSkeletonZaythalor(); break; case 2: deadbody = new UnknownRogueSkeletonZaythalor(); break; case 3: deadbody = new UnknownRogueSkeletonZaythalor(); break; } deadbody.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteDeadBody), deadbody); } } } // Random Dead Body 2 if (Utility.RandomDouble() < 0.0003) { if (m.Map == Map.Malas) { int x2 = m.X - 10; int y2 = m.Y - 10; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseContainer deadbody; switch (Utility.Random(4)) { default: case 0: deadbody = new UnknownBardSkeletonZaythalor(); break; case 1: deadbody = new UnknownMageSkeletonZaythalor(); break; case 2: deadbody = new UnknownRogueSkeletonZaythalor(); break; case 3: deadbody = new UnknownRogueSkeletonZaythalor(); break; } deadbody.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteDeadBody), deadbody); } } } PlayerMobile player1 = m as PlayerMobile; QuestSystem qs1 = player1.Quest; if (qs1 is StolenNecklaceQuest) { if (qs1.IsObjectiveInProgress(typeof(ReturnStolenNecklaceObjective))) { m.Send(Network.PlayMusic.GetInstance(MusicName.StygianAbyss)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } } PlayerMobile player = m as PlayerMobile; QuestSystem qs = player.Quest; if (qs is StolenNecklaceQuest) { if (qs.IsObjectiveInProgress(typeof(ReturnStolenNecklaceObjective))) { // Brigand Ambush if (Utility.RandomDouble() < 0.015) { if (m.Map == Map.Malas) { int x1 = m.X + 20; int y1 = m.Y + 20; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseCreature brigandmale = new BrigandMaleQuest(); brigandmale.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); brigandmale.Combatant = m; m.Send(Network.PlayMusic.GetInstance(MusicName.StygianAbyss)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(2.0), new TimerStateCallback(DeleteBrigandMale), brigandmale); } } } // Brigand Ambush 2 if (Utility.RandomDouble() < 0.015) { if (m.Map == Map.Malas) { int x2 = m.X - 20; int y2 = m.Y - 20; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseCreature brigandfemale = new BrigandFemaleQuest(); brigandfemale.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); brigandfemale.Combatant = m; m.Send(Network.PlayMusic.GetInstance(MusicName.StygianAbyss)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(2.0), new TimerStateCallback(DeleteBrigandFemale), brigandfemale); } } } } } else if (qs is StaffOfFlyingMonkeysQuest) { if (qs.IsObjectiveInProgress(typeof(EscapeObjective))) { // Mongbat Ambush if (Utility.RandomDouble() < 0.015) { if (m.Map == Map.Malas) { int x1 = m.X + 20; int y1 = m.Y + 20; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseCreature cavernmongbatberserker = new CavernMongbatBerserkerQuest(); cavernmongbatberserker.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); cavernmongbatberserker.Combatant = m; m.Send(Network.PlayMusic.GetInstance(MusicName.Medieval)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(2.0), new TimerStateCallback(DeleteCavernMongbatBerserkerQuest), cavernmongbatberserker); } } } // Mongbat Ambush 2 if (Utility.RandomDouble() < 0.015) { if (m.Map == Map.Malas) { int x2 = m.X - 20; int y2 = m.Y - 20; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseCreature cavernmongbatberserker = new CavernMongbatBerserkerQuest(); cavernmongbatberserker.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); cavernmongbatberserker.Combatant = m; m.Send(Network.PlayMusic.GetInstance(MusicName.Medieval)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(2.0), new TimerStateCallback(DeleteCavernMongbatBerserkerQuest), cavernmongbatberserker); } } } } } } } }
public void Enter(Bull bull) { _bull = bull; _bull.isAwakenState = true; }
public void Enter(Bull bull) { _bull = bull; _bull._navMeshAgent.speed = _bull.animalStats.chaseSpeed; _bull.isChaseState = true; }
public void Enter(Bull bull) { _bull = bull; _bull._navMeshAgent.speed = 0; _bull.isAttackState = true; }
public void Enter(Bull bull) { _bull = bull; _bull.isPatrolState = true; _bull._navMeshAgent.speed = _bull.animalStats.patrolSpeed; }
public override void Damage(Mobile m) { base.Damage(m); if (m.Alive) { Item item = m.FindItemOnLayer(Layer.OuterTorso); if (item is GMRobe) { AOS.Damage(m, 0, 0, 0, 0, 0, 0); } else { // Forest noises if (Utility.RandomDouble() < 0.008) { m.PlaySound(Utility.RandomList(0x000, 0x001, 0x002)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } // Bird chirps if (Utility.RandomDouble() < 0.002) { m.PlaySound(Utility.RandomList(0x094, 0x095, 0x096, 0x097, 0x0D1, 0x0D2)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } // Cricket noises if (Utility.RandomDouble() < 0.003) { m.PlaySound(Utility.RandomList(0x00A, 0x00B)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } // Turdy Encounter 1 if (Utility.RandomDouble() < 0.002) { if (m.Map == Map.Malas) { int x1 = m.X + 8; int y1 = m.Y + 8; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseCreature turdyencounter; switch (Utility.Random(2)) { default: case 0: turdyencounter = new Turdy(); break; case 1: turdyencounter = new Turdy(); break; } turdyencounter.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); turdyencounter.Combatant = m; AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteTurdyEncounter), turdyencounter); } } } // Turdy Encounter 2 if (Utility.RandomDouble() < 0.002) { if (m.Map == Map.Malas) { int x2 = m.X - 8; int y2 = m.Y - 8; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseCreature turdyencounter; switch (Utility.Random(2)) { default: case 0: turdyencounter = new Turdy(); break; case 1: turdyencounter = new Turdy(); break; } turdyencounter.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); turdyencounter.Combatant = m; AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteTurdyEncounter), turdyencounter); } } } // Random Encounter 1 if (Utility.RandomDouble() < 0.0002) { if (m.Map == Map.Malas) { int x1 = m.X + 8; int y1 = m.Y + 8; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseCreature encounterb; switch (Utility.Random(2)) { default: case 0: encounterb = new AutumnwoodAdventurer(); break; case 1: encounterb = new AutumnwoodAdventurer(); break; } encounterb.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteEncounterB), encounterb); } } } // Random Encounter 2 if (Utility.RandomDouble() < 0.0002) { if (m.Map == Map.Malas) { int x2 = m.X - 8; int y2 = m.Y - 8; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseCreature encounterb; switch (Utility.Random(2)) { default: case 0: encounterb = new AutumnwoodAdventurer(); break; case 1: encounterb = new AutumnwoodAdventurer(); break; } encounterb.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteEncounterB), encounterb); } } } // Tamable Encounter 1 if (Utility.RandomDouble() < 0.002) { if (m.Map == Map.Malas) { int x1 = m.X + 8; int y1 = m.Y + 8; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseCreature tameable; switch (Utility.Random(23)) { default: case 0: tameable = new Bird(); break; case 1: tameable = new Boar(); break; case 2: tameable = new BlackBear(); break; case 3: tameable = new Bull(); break; case 4: tameable = new Chicken(); break; case 5: tameable = new Cow(); break; case 6: tameable = new ForestBat(); break; case 7: tameable = new Goat(); break; case 8: tameable = new GreatHart(); break; case 9: tameable = new GreenSlime(); break; case 10: tameable = new GreySquirrel(); break; case 11: tameable = new GreyWolfPup(); break; case 12: tameable = new Hind(); break; case 13: tameable = new Horse(); break; case 14: tameable = new LargeFrog(); break; case 15: tameable = new Ogumo(); break; case 16: tameable = new Panther(); break; case 17: tameable = new Pig(); break; case 18: tameable = new Rabbit(); break; case 19: tameable = new Rat(); break; case 20: tameable = new RhinoBeetle(); break; case 21: tameable = new RunningPants(); break; case 22: tameable = new Sheep(); break; } tameable.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteTameable), tameable); } } } // Tamable Encounter 2 if (Utility.RandomDouble() < 0.002) { if (m.Map == Map.Malas) { int x2 = m.X - 8; int y2 = m.Y - 8; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseCreature tameable; switch (Utility.Random(23)) { default: case 0: tameable = new Bird(); break; case 1: tameable = new Boar(); break; case 2: tameable = new BlackBear(); break; case 3: tameable = new Bull(); break; case 4: tameable = new Chicken(); break; case 5: tameable = new Cow(); break; case 6: tameable = new ForestBat(); break; case 7: tameable = new Goat(); break; case 8: tameable = new GreatHart(); break; case 9: tameable = new GreenSlime(); break; case 10: tameable = new GreySquirrel(); break; case 11: tameable = new GreyWolfPup(); break; case 12: tameable = new Hind(); break; case 13: tameable = new Horse(); break; case 14: tameable = new LargeFrog(); break; case 15: tameable = new Ogumo(); break; case 16: tameable = new Panther(); break; case 17: tameable = new Pig(); break; case 18: tameable = new Rabbit(); break; case 19: tameable = new Rat(); break; case 20: tameable = new RhinoBeetle(); break; case 21: tameable = new RunningPants(); break; case 22: tameable = new Sheep(); break; } tameable.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteTameable), tameable); } } } // Random Treasure Chest 1 if (Utility.RandomDouble() < 0.0005) { if (m.Map == Map.Malas) { int x1 = m.X + 12; int y1 = m.Y + 12; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseContainer treasurechest; if (m.Skills.Tracking.Base > 14.9) { switch (Utility.Random(2)) { default: case 0: treasurechest = new AutumnwoodTreasureChest1(); break; case 1: treasurechest = new AutumnwoodTreasureChest1(); break; } treasurechest.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteTreasureChest), treasurechest); } } } } // Random Treasure Chest 2 if (Utility.RandomDouble() < 0.0005) { if (m.Map == Map.Malas) { int x2 = m.X - 12; int y2 = m.Y - 12; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseContainer treasurechest; if (m.Skills.Tracking.Base > 14.9) { switch (Utility.Random(2)) { default: case 0: treasurechest = new AutumnwoodTreasureChest1(); break; case 1: treasurechest = new AutumnwoodTreasureChest1(); break; } treasurechest.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteTreasureChest), treasurechest); } } } } } } }
public void Enter(Bull bull) { _bull = bull; _bull.isDrinkState = true; }