public virtual void BEvent(Mobile from) // code that creates the gates, starts delete timers, and broadcasts via world broadcast { int listcount = Server.Items.EGCPersi.EGCPers.Count; Point3D endloc = Server.Items.EGCPersi.EGCDest; Map endmap = Server.Items.EGCPersi.EGCMap; int times = Server.Items.EGCPersi.EGCDur.Minutes; if (from is PlayerMobile && listcount > 0 && endloc != Point3D.Zero) // make sure the list is not empty before we start { foreach (EGEntry entry in Server.Items.EGCPersi.EGCPers) { Moongate firstGate = new Moongate(endloc, endmap); firstGate.Name = "Event Moongate"; firstGate.Hue = 999; firstGate.MoveToWorld(entry.Location, entry.Map); Timer gdel = Timer.DelayCall(TimeSpan.FromMinutes(times), new TimerCallback(((Moongate)firstGate).Delete)); } Console.WriteLine("endloc is " + Server.Items.EGCPersi.EGCDest.ToString() + ", endmap is " + Server.Items.EGCPersi.EGCMap.ToString() + ", eglist count is " + listcount.ToString() + "."); World.Broadcast(0x22, true, "An event is beginning now! Brought to you by {0}", from.Name.ToString()); //World.Broadcast( 0x22, true, "World Gates will be open for {0} minutes.", Server.Items.EGCPersi.EGCDur.Minutes.ToString() ); } else { from.SendMessage("The location list for entrance gates is empty!"); } }
public InternalTimer(BlackGateDemon owner) : base(TimeSpan.FromSeconds(0)) { Delay = TimeSpan.FromSeconds(1800); Priority = TimerPriority.OneSecond; m_MoonGate = new Moongate(); m_MoonGate.MoveToWorld(new Point3D(owner.X, owner.Y, owner.Z), owner.Map); m_MoonGate.Target = new Point3D(5963, 3967, 10); m_MoonGate.TargetMap = owner.Map; m_MoonGate.ItemID = 0x1FD4; }
public InternalTimer(Mangar owner) : base(TimeSpan.FromSeconds(0)) { Delay = TimeSpan.FromSeconds(1800); Priority = TimerPriority.OneSecond; m_MoonGate = new Moongate(); m_MoonGate.MoveToWorld(new Point3D(6426, 1498, 0), Map.Felucca); m_MoonGate.Name = "Mangar's Gate"; m_MoonGate.Target = new Point3D(2830, 1874, 95); m_MoonGate.TargetMap = Map.Trammel; m_MoonGate.ItemID = 0x1FD4; }
private void Effect(Point3D loc, Map map, bool checkMulti) { if (map == null || Caster.Map != map) { Caster.SendFailureMessage(1005569); // You can not recall to another facet. return; } if (!SpellHelper.CheckTravel(Caster, TravelCheckType.GateFrom)) { return; } if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.GateTo)) { return; } if (!map.CanSpawnMobile(loc.X, loc.Y, loc.Z)) { Caster.SendFailureMessage(501942); // That location is blocked. return; } if (checkMulti && loc.GetMulti(map)?.IsMultiFriend(Caster) == false) { Caster.SendFailureMessage(501942); // That location is blocked. return; } Caster.SendSuccessMessage(501024); // You open a magical gate to another location Effects.PlaySound(Caster.Location, Caster.Map, 0x20E); var firstGate = new Moongate(loc, map) { Dispellable = true }; firstGate.MoveToWorld(Caster.Location, Caster.Map); Effects.PlaySound(loc, map, 0x20E); var secondGate = new Moongate(Caster.Location, Caster.Map) { Dispellable = true }; secondGate.MoveToWorld(loc, map); CloseGatesAfterDelay(TimeSpan.FromSeconds(30.0), firstGate, secondGate); }
private void Anim_Continue(AnimInfo info) { Mobile from = info.From; IEntity entity = info.Entity; Moongate gate = new Moongate(false); gate.Hue = 0; gate.MoveToWorld(entity.Location, entity.Map); gate.TargetMap = Map.Internal; Timer.DelayCall <Mobile>(TimeSpan.FromSeconds(1.0), new TimerStateCallback <Mobile>(ChangeHide), from); Timer.DelayCall <Moongate>(TimeSpan.FromSeconds(3.0), new TimerStateCallback <Moongate>(KillGate), gate); }
private void OpenGate() { if (m_Gate != null) { Effects.PlaySound(Location, Map, 0x20E); m_Gate.Dispellable = false; m_Gate.MoveToWorld(Location, Map); Timer.DelayCall(TimeSpan.FromSeconds(30), new TimerCallback(RemoveGate)); } else { Console.WriteLine("Error in the TravelGuide script, m_Gate is null when it should have been assigned."); } }
public override void OnDeath(Container corpse) { //change the line below to the coords and map you want /////////////////////// Mongbat Hideout Entrance /////////////////////// Moongate gate = new Moongate(new Point3D(1341, 1198, 0), Map.Malas); if (gate != null && !gate.Deleted && corpse != null && !corpse.Deleted) { gate.MoveToWorld(corpse.Location, corpse.Map); //set how long you want the gate to stay open by changing the TimeSpan.FromSeconds in the line below Timer.DelayCall(TimeSpan.FromSeconds(10.0), new TimerCallback(gate.Delete)); } base.OnDeath(corpse); }
public override void OnRead() { PlayerMobile pm = System.From; Moongate gate = new Moongate(new Point3D(1629, 1880, 5), Map.Malas); // Skaddria Naddheim Bank gate.Name = "Skaddria Naddheim Bank"; gate.MoveToWorld(pm.Location, pm.Map); Timer.DelayCall(TimeSpan.FromSeconds(10.0), new TimerCallback(gate.Delete)); // woohoo! pm.PlaySound(0x5B8); // satyrpipe_use_well pm.PlaySound(pm.Female ? 783 : 1054); pm.Say("Yahoo!"); pm.AddToBackpack(new Gold(3500)); pm.AddToBackpack(new SkillSlotDeedQuestReward()); pm.AddToBackpack(new WeightIncreaseDeed()); pm.Exp += 1000; pm.KillExp += 1000; pm.SendMessage("You've gained 1000 exp."); if (pm.Exp >= pm.LevelAt && pm.Level != pm.LevelCap) { Actions.DoLevel(pm, new Setup()); } pm.TotalQuestsDone += 1; BaseJewel jewel = new RingOfMinorRevigoration(); if (Core.AOS) { BaseRunicTool.ApplyAttributesTo(jewel, 2, 5, 10); } jewel.Attributes.Luck = 200; jewel.LootType = LootType.Blessed; pm.AddToBackpack(jewel); System.Complete(); }
public override bool OnBeforeDeath() { // spawn the item Item item = (Item)Activator.CreateInstance(typeof(Moongate)); Moongate moon = (Moongate)item; moon.TargetMap = Map.Trammel; //or map moon.Target = new Point3D(1422, 1697, 0); // Set map X,Y,Z location here // Map map = Map.Trammel; Point3D pnt = GetSpawnLocation(); moon.MoveToWorld(pnt, this.Map); Timer m_timer = new MobileDeleteTime(item); m_timer.Start(); return(base.OnBeforeDeath()); }
public static void SetupDespise_OnCommand(CommandEventArgs e) { if (DespiseController.Instance == null) { DespiseController controller = new DespiseController(); WeakEntityCollection.Add("despise", controller); controller.MoveToWorld(new Point3D(5571, 626, 30), Map.Trammel); DespiseAnkh ankh = new DespiseAnkh(Alignment.Good); WeakEntityCollection.Add("despise", ankh); ankh.MoveToWorld(new Point3D(5474, 525, 79), Map.Trammel); ankh = new DespiseAnkh(Alignment.Evil); WeakEntityCollection.Add("despise", ankh); ankh.MoveToWorld(new Point3D(5472, 754, 10), Map.Trammel); Moongate gate1 = new Moongate(false); Moongate gate2 = new Moongate(false); WeakEntityCollection.Add("despise", gate1); WeakEntityCollection.Add("despise", gate2); //Gate1 gate1.MoveToWorld(new Point3D(5475, 735, 5), Map.Trammel); gate2.MoveToWorld(new Point3D(5458, 610, 50), Map.Trammel); HueGates(gate1, gate2); LinkGates(gate1, gate2); gate1 = new Moongate(false); gate2 = new Moongate(false); WeakEntityCollection.Add("despise", gate1); WeakEntityCollection.Add("despise", gate2); //Gate2 gate1.MoveToWorld(new Point3D(5459, 674, 20), Map.Trammel); gate2.MoveToWorld(new Point3D(5454, 522, 60), Map.Trammel); HueGates(gate1, gate2); LinkGates(gate1, gate2); gate1 = new Moongate(false); gate2 = new Moongate(false); WeakEntityCollection.Add("despise", gate1); WeakEntityCollection.Add("despise", gate2); //Gate3 gate1.MoveToWorld(new Point3D(5388, 753, 5), Map.Trammel); gate2.MoveToWorld(new Point3D(5387, 628, 30), Map.Trammel); HueGates(gate1, gate2); LinkGates(gate1, gate2); //Teleporters IPooledEnumerable eable = Map.Trammel.GetItemsInRange(new Point3D(5588, 631, 30), 2); DespiseTeleporter tele = null; //Wisp MysteriousWisp wisp = new MysteriousWisp(); WeakEntityCollection.Add("despise", wisp); wisp.MoveToWorld(new Point3D(1303, 1088, 0), Map.Trammel); foreach (Item item in eable) { if (item is Teleporter) { Teleporter old = (Teleporter)item; tele = new DespiseTeleporter(); WeakEntityCollection.Add("despise", tele); tele.PointDest = old.PointDest; tele.MapDest = old.MapDest; tele.MoveToWorld(old.Location, old.Map); old.Delete(); } } eable.Free(); e.Mobile.SendMessage("Despise setup complete"); } else { e.Mobile.SendMessage("Despise appears to already be setup"); } }
public static void SetupDespise_OnCommand(CommandEventArgs e) { if (DespiseController.Instance == null) { foreach (Region region in Region.Regions) { if (region.Name == "Despise" && region.Map == Map.Trammel) { foreach (Sector sector in region.Sectors) { List <Item> list = new List <Item>(sector.Items); foreach (Item item in list) { if (item is XmlSpawner) { ((XmlSpawner)item).DoReset = true; } } list.Clear(); } } } CommandEventArgs args = new CommandEventArgs(e.Mobile, null, null, new string[] { @"Data\Monsters\NewDespise" }); XmlSpawner.Load_OnCommand(args); DespiseController controller = new DespiseController(); controller.MoveToWorld(new Point3D(5571, 626, 30), Map.Trammel); DespiseAnkh ankh = new DespiseAnkh(Alignment.Good); ankh.MoveToWorld(new Point3D(5474, 525, 79), Map.Trammel); ankh = new DespiseAnkh(Alignment.Evil); ankh.MoveToWorld(new Point3D(5472, 754, 10), Map.Trammel); Moongate gate1 = new Moongate(false); Moongate gate2 = new Moongate(false); //Gate1 gate1.MoveToWorld(new Point3D(5475, 735, 5), Map.Trammel); gate2.MoveToWorld(new Point3D(5458, 610, 50), Map.Trammel); HueGates(gate1, gate2); LinkGates(gate1, gate2); gate1 = new Moongate(false); gate2 = new Moongate(false); //Gate2 gate1.MoveToWorld(new Point3D(5459, 674, 20), Map.Trammel); gate2.MoveToWorld(new Point3D(5454, 522, 60), Map.Trammel); HueGates(gate1, gate2); LinkGates(gate1, gate2); gate1 = new Moongate(false); gate2 = new Moongate(false); //Gate3 gate1.MoveToWorld(new Point3D(5388, 753, 5), Map.Trammel); gate2.MoveToWorld(new Point3D(5387, 628, 30), Map.Trammel); HueGates(gate1, gate2); LinkGates(gate1, gate2); //Teleporters IPooledEnumerable eable = Map.Trammel.GetItemsInRange(new Point3D(5588, 631, 30), 2); DespiseTeleporter tele = null; //Wisp MysteriousWisp wisp = new MysteriousWisp(); wisp.MoveToWorld(new Point3D(1303, 1088, 0), Map.Trammel); foreach (Item item in eable) { if (item is Teleporter) { Teleporter old = (Teleporter)item; tele = new DespiseTeleporter(); tele.PointDest = old.PointDest; tele.MapDest = old.MapDest; tele.MoveToWorld(old.Location, old.Map); old.Delete(); } } eable.Free(); e.Mobile.SendMessage("Despise Revamped setup! Don't forget to setup mob spawners an activate it!"); } else { e.Mobile.SendMessage("This has already been setup."); } }
public static void InitializeDuel(Duel duel) { if (duel.Attacker == null || duel.Defender == null) { CancelDuel(duel); return; } List <DuelArena> open = new List <DuelArena>(); for (int i = 0; i < m_Arenas.Count; ++i) { if (m_Arenas[i].Usable) { open.Add(m_Arenas[i]); } } if (open.Count == 0) { duel.Attacker.SendMessage("There were no available arenas to duel in. Please try again later."); duel.Defender.SendMessage("There were no available arenas to duel in. Please try again later."); CancelDuel(duel); return; } DuelArena arena = open[Utility.Random(open.Count)]; //Random open arena arena.Duel = duel; duel.Arena = arena; PrepareFighter(duel.Attacker, duel); PrepareFighter(duel.Defender, duel); GetInfo(duel.Attacker).Last = duel.Attacker.Location; GetInfo(duel.Defender).Last = duel.Defender.Location; Moongate gate = new Moongate(duel.Arena.Home, duel.Arena.Map); gate.Dispellable = false; gate.Hue = 1015; gate.Name = "a spectator gate"; gate.MoveToWorld(duel.Attacker.Location, Map.Felucca); Timer.DelayCall(TimeSpan.FromSeconds(15.0), new TimerStateCallback(delegate(object state) { if (gate != null && !gate.Deleted) { gate.Delete(); } }), null); duel.Attacker.MoveToWorld(arena.GetAttackerLocation(), arena.Map); duel.Defender.MoveToWorld(arena.GetDefenderLocation(), arena.Map); duel.Attacker.Blessed = true; duel.Defender.Blessed = true; duel.Attacker.Frozen = true; duel.Defender.Frozen = true; WallOfStoneEast wall = new WallOfStoneEast(); wall.MoveToWorld(arena.GetCenter(), arena.Map); duel.Attacker.SendMessage("The duel will start in 10 seconds."); duel.Defender.SendMessage("The duel will start in 10 seconds."); duel.State = DuelState.Duel; Timer.DelayCall(TimeSpan.FromSeconds(10.0), new TimerStateCallback(FinalizeDuel), new object[] { wall, duel }); }
public static void Generate() { if (Carey.Instance == null) { Carey.Instance = new Carey(); Carey.Instance.MoveToWorld(Carey.SpawnLocation, Map.Malas); Carey.Instance.Home = Carey.SpawnLocation; Carey.Instance.RangeHome = 2; } if (Elizabeth.Instance == null) { Elizabeth.Instance = new Elizabeth(); Elizabeth.Instance.MoveToWorld(Elizabeth.SpawnLocation, Map.Malas); Elizabeth.Instance.Home = Elizabeth.SpawnLocation; Elizabeth.Instance.RangeHome = 2; } if (Owain.Instance == null) { Owain.Instance = new Owain(); Owain.Instance.MoveToWorld(Owain.SpawnLocation, Map.Malas); Owain.Instance.Home = Owain.SpawnLocation; Owain.Instance.RangeHome = 10; } if (VaseSpawner.Instance == null) { VaseSpawner.Instance = new VaseSpawner(); } VaseSpawner.Instance.CheckVases(); Point3D p = new Point3D(395, 220, -18); if (Map.Malas.FindItem <DoomPlaque>(p) == null) { DoomPlaque plaque = new DoomPlaque(); plaque.MoveToWorld(p, Map.Malas); } p = new Point3D(388, 221, -20); if (Map.Malas.FindItem <DoomSign>(p) == null) { DoomSign plaque = new DoomSign(); plaque.MoveToWorld(p, Map.Malas); } p = new Point3D(66, 223, -1); if (Map.Malas.FindItem <Moongate>(p) == null) { Moongate moongate = new Moongate(); moongate.ItemID = 0x4BCB; moongate.Hue = 2676; moongate.Dispellable = false; moongate.Target = new Point3D(396, 220, -20); moongate.TargetMap = Map.Malas; moongate.MoveToWorld(p, Map.Malas); } }