public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 0: { m_Spawn = reader.ReadItem() as ChampionSpawn; if (m_Spawn == null) { Delete(); } break; } } if (Hue == 0) { Hue = 0x455; } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 1: m_Instance = reader.ReadItem() as PrimevalLichPuzzle; m_Altar = reader.ReadItem() as ChampionSpawn; m_Key = reader.ReadLong(); m_Successful = reader.ReadMobile(); m_Levers = reader.ReadStrongItemList <PrimevalLichPuzzleLever>(); break; } if (null == m_Levers) { m_Levers = new List <PrimevalLichPuzzleLever>(); } // if ( null != m_Instance && m_Instance.Deleted && this == m_Instance ) // { // m_Instance = null; // return; // } // // remove if no altar exists // if ( null == m_Altar ) // Timer.DelayCall( TimeSpan.FromSeconds( 0.0 ), new TimerCallback( Delete ) ); // ResetLevers(); }
public IdolOfTheChampion(ChampionSpawn spawn) : base(0x1F18) { m_Spawn = spawn; Name = "Idol of the Champion"; Movable = false; }
public ChampionPlatform(ChampionSpawn spawn) { m_Spawn = spawn; for (int x = -2; x <= 2; ++x) { for (int y = -2; y <= 2; ++y) { AddComponent(0x3EE, x, y, -5); } } for (int x = -1; x <= 1; ++x) { for (int y = -1; y <= 1; ++y) { AddComponent(0x3EE, x, y, 0); } } for (int i = -1; i <= 1; ++i) { AddComponent(0x3EF, i, 2, 0); AddComponent(0x3F0, 2, i, 0); AddComponent(0x3F1, i, -2, 0); AddComponent(0x3F2, -2, i, 0); } AddComponent(0x03F7, -2, -2, 0); AddComponent(0x03F8, 2, 2, 0); AddComponent(0x03F9, -2, 2, 0); AddComponent(0x03FA, 2, -2, 0); }
public ChampionPlatform(ChampionSpawn spawn) { m_Spawn = spawn; for (int x = -2; x <= 2; ++x) { for (int y = -2; y <= 2; ++y) { AddComponent(0x750, x, y, -5); } } for (int x = -1; x <= 1; ++x) { for (int y = -1; y <= 1; ++y) { AddComponent(0x750, x, y, 0); } } for (int i = -1; i <= 1; ++i) { AddComponent(0x751, i, 2, 0); AddComponent(0x752, 2, i, 0); AddComponent(0x753, i, -2, 0); AddComponent(0x754, -2, i, 0); } AddComponent(0x759, -2, -2, 0); AddComponent(0x75A, 2, 2, 0); AddComponent(0x75B, -2, 2, 0); AddComponent(0x75C, 2, -2, 0); }
private static void ChampGen_OnCommand(CommandEventArgs e) { /* * //We take the assumption that we are spawning managed champions * for ( int i = CannedEvilTimer.DungeonSpawns.Count-1;i >= 0; i-- ) * CannedEvilTimer.DungeonSpawns[i].Delete(); * * for ( int i = CannedEvilTimer.LLSpawns.Count-1;i >= 0; i-- ) * CannedEvilTimer.LLSpawns[i].Delete(); */ //We assume that all champion spawns are generated here. List <ChampionSpawn> spawns = new List <ChampionSpawn>(); foreach (Item item in World.Items.Values) { ChampionSpawn spawn = item as ChampionSpawn; if (spawn != null) { spawns.Add(spawn); } } for (int i = spawns.Count - 1; i >= 0; i--) { spawns[i].Delete(); } Process(DungeonLocations); Process(LLLocations); //ProcessIlshenar(); //ProcessTokuno(); }
// Constructor public PrimevalLichPuzzle(Mobile m) : base(0x1BC3) { if (null == m || null != m_Instance) { this.Delete(); if (m_Instance.Deleted) { m_Instance = null; } return; } this.Movable = false; this.Visible = false; m_Instance = this; this.MoveToWorld(controlLoc, Map.Felucca); this.m_Levers = new List <PrimevalLichPuzzleLever>(); this.m_Altar = this.FindAltar(); if (null == this.m_Altar) { m.SendMessage(33, "Primeval Lich champion spawn not found."); this.Delete(); } else { this.UpdatePuzzleState(this.m_Altar); } }
protected override void OnTarget(Mobile from, object targ) { if (from == null || from.AccessLevel < AccessLevel.Administrator) { return; } ChampionSpawn spawn = targ switch { ChampionSpawn championSpawn => championSpawn, IdolOfTheChampion champion => champion.Spawn, ChampionAltar altar => altar.Spawn, ChampionPlatform platform => platform.Spawn, _ => null }; if (spawn == null) { from.SendMessage("That is not a valid target. Please target the champion, altar, platform, or idol."); } spawn?.DeleteCreatures(); spawn?.Champion?.Delete(); } }
public PrimevalLichPuzzle(Mobile m) : base(0x1BC3) { if (null == m || null != m_Instance) { Delete(); //Probably not needed, OnAfterDelete sets it null anyway if (m_Instance != null && m_Instance.Deleted) { m_Instance = null; } return; } Movable = false; Visible = false; m_Instance = this; MoveToWorld(controlLoc, Map.Felucca); m_Levers = new List <PrimevalLichPuzzleLever>(); m_Altar = FindAltar(); if (null == m_Altar) { m.SendMessage(33, "Primeval Lich champion spawn not found."); Delete(); } else { UpdatePuzzleState(m_Altar); } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 2: case 1: case 0: { m_Spawn = reader.ReadItem() as ChampionSpawn; if (m_Spawn == null) { Delete(); } break; } } if (version < 2) { Timer.DelayCall(TimeSpan.FromSeconds(10), FixComponents); } }
public ChampionPlatform( ChampionSpawn spawn ) { m_Spawn = spawn; // Base for ( int x = -2; x <= 2; ++x ) for ( int y = -2; y <= 2; ++y ) AddComponent( 0x3EE, 0x452, x, y, -5 ); // Base Superior for ( int x = -1; x <= 1; ++x ) for ( int y = -1; y <= 1; ++y ) AddComponent( 0x3EE, 0x454, x, y, 0 ); // Escalones for ( int i = -1; i <= 1; ++i ) { AddComponent( 0x3EF, 0x452, i, 2, 0 ); AddComponent( 0x3F0, 0x452, 2, i, 0 ); AddComponent( 0x3F1, 0x452, i, -2, 0 ); AddComponent( 0x3F2, 0x452, -2, i, 0 ); } // Esquinas AddComponent( 0x3F7, 0x452, -2, -2, 0 ); AddComponent( 0x3F8, 0x452, 2, 2, 0 ); AddComponent( 0x3F9, 0x452, -2, 2, 0 ); AddComponent( 0x3FA, 0x452, 2, -2, 0 ); }
public ChampionPlatform(ChampionSpawn spawn) { m_Spawn = spawn; for (var x = -2; x <= 2; ++x) for (var y = -2; y <= 2; ++y) AddComponent(0x750, x, y, -5); for (var x = -1; x <= 1; ++x) for (var y = -1; y <= 1; ++y) AddComponent(0x750, x, y, 0); for (var i = -1; i <= 1; ++i) { AddComponent(0x751, i, 2, 0); AddComponent(0x752, 2, i, 0); AddComponent(0x753, i, -2, 0); AddComponent(0x754, -2, i, 0); } AddComponent(0x759, -2, -2, 0); AddComponent(0x75A, 2, 2, 0); AddComponent(0x75B, -2, 2, 0); AddComponent(0x75C, 2, -2, 0); }
public ChampionPlatform(ChampionSpawn spawn) { this.m_Spawn = spawn; for (int x = -2; x <= 2; ++x) for (int y = -2; y <= 2; ++y) this.AddComponent(0x750, x, y, -5); for (int x = -1; x <= 1; ++x) for (int y = -1; y <= 1; ++y) this.AddComponent(0x750, x, y, 0); for (int i = -1; i <= 1; ++i) { this.AddComponent(0x751, i, 2, 0); this.AddComponent(0x752, 2, i, 0); this.AddComponent(0x753, i, -2, 0); this.AddComponent(0x754, -2, i, 0); } this.AddComponent(0x759, -2, -2, 0); this.AddComponent(0x75A, 2, 2, 0); this.AddComponent(0x75B, -2, 2, 0); this.AddComponent(0x75C, 2, -2, 0); }
public ChampionIdol( ChampionSpawn spawn ) : base( 0x1F18 ) { m_Spawn = spawn; Name = "Idol of Champion"; Movable = false; }
private static void Rotate() { Dictionary <string, List <ChampionSpawn> > groups = new Dictionary <string, List <ChampionSpawn> >(); m_LastRotate = DateTime.UtcNow; for (var index = 0; index < m_AllSpawns.Count; index++) { ChampionSpawn spawn = m_AllSpawns[index]; if (spawn != null && !spawn.Deleted) { List <ChampionSpawn> group; if (spawn.GroupName == null) { spawn.AutoRestart = true; if (!spawn.Active) { spawn.Active = true; } continue; } if (!groups.TryGetValue(spawn.GroupName, out group)) { group = new List <ChampionSpawn>(); groups.Add(spawn.GroupName, group); } group.Add(spawn); } } foreach (string key in groups.Keys) { List <ChampionSpawn> group = groups[key]; for (var index = 0; index < group.Count; index++) { ChampionSpawn spawn = group[index]; spawn.AutoRestart = false; } ChampionSpawn s = group[Utility.Random(group.Count)]; s.AutoRestart = true; if (!s.Active) { s.Active = true; } } }
public ChampionSpawnInfoGump(ChampionSpawn spawn) : base(40, 40) { m_Spawn = spawn; AddBackground(0, 0, gWidth, gBoarder * 2 + gRowHeight * (8 + spawn.m_DamageEntries.Count), 0x13BE); int top = gBoarder; AddLabel(gBoarder, top, gFontHue, "Champion Spawn Info Gump"); top += gRowHeight; AddLabel(gTab[1], top, gFontHue, "Kills"); AddLabel(gTab[2], top, gFontHue, spawn.Kills.ToString()); top += gRowHeight; AddLabel(gTab[1], top, gFontHue, "Max Kills"); AddLabel(gTab[2], top, gFontHue, spawn.MaxKills.ToString()); top += gRowHeight; AddLabel(gTab[1], top, gFontHue, "Level"); AddLabel(gTab[2], top, gFontHue, spawn.Level.ToString()); top += gRowHeight; AddLabel(gTab[1], top, gFontHue, "Rank"); AddLabel(gTab[2], top, gFontHue, spawn.Rank.ToString()); top += gRowHeight; AddLabel(gTab[1], top, gFontHue, "Active"); AddLabel(gTab[2], top, gFontHue, spawn.Active.ToString()); top += gRowHeight; AddLabel(gTab[1], top, gFontHue, "Auto Restart"); AddLabel(gTab[2], top, gFontHue, spawn.AutoRestart.ToString()); top += gRowHeight; List <Damager> damagers = new List <Damager>(); foreach (Mobile mob in spawn.m_DamageEntries.Keys) { damagers.Add(new Damager(mob, spawn.m_DamageEntries[mob])); } damagers = damagers.OrderByDescending(x => x.Damage).ToList <Damager>(); foreach (Damager damager in damagers) { AddLabelCropped(gTab[1], top, 100, gRowHeight, gFontHue, damager.Mobile.RawName); AddLabelCropped(gTab[2], top, 80, gRowHeight, gFontHue, damager.Damage.ToString()); top += gRowHeight; } AddButton(gWidth - (gBoarder + 30), top, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0); AddLabel(gWidth - (gBoarder + 100), top, gFontHue, "Refresh"); }
public ChampionSystemGump() : base(40, 40) { List <ChampionSpawn> list = new List <ChampionSpawn>(); for (var index = 0; index < m_AllSpawns.Count; index++) { var spawn = m_AllSpawns[index]; if (spawn != null && !spawn.Deleted) { list.Add(spawn); } } Spawners = list; AddBackground(0, 0, gWidth, gBoarder * 2 + Spawners.Count * gRowHeight + gRowHeight * 2, 0x13BE); int top = gBoarder; AddLabel(gBoarder, top, gFontHue, "Champion Spawn System Gump"); top += gRowHeight; AddLabel(gTab[1], top, gFontHue, "Spawn Name"); AddLabel(gTab[2], top, gFontHue, "Spawn Group"); AddLabel(gTab[3], top, gFontHue, "X"); AddLabel(gTab[4], top, gFontHue, "Y"); AddLabel(gTab[5], top, gFontHue, "Z"); AddLabel(gTab[6], top, gFontHue, "Map"); AddLabel(gTab[7], top, gFontHue, "Active"); AddLabel(gTab[8], top, gFontHue, "Auto"); AddLabel(gTab[9], top, gFontHue, "Go"); AddLabel(gTab[10], top, gFontHue, "Info"); top += gRowHeight; for (int i = 0; i < Spawners.Count; i++) { ChampionSpawn spawn = Spawners[i]; AddLabel(gTab[1], top, gFontHue, spawn.SpawnName); AddLabel(gTab[2], top, gFontHue, spawn.GroupName != null ? spawn.GroupName : "None"); AddLabel(gTab[3], top, gFontHue, spawn.X.ToString()); AddLabel(gTab[4], top, gFontHue, spawn.Y.ToString()); AddLabel(gTab[5], top, gFontHue, spawn.Z.ToString()); AddLabel(gTab[6], top, gFontHue, spawn.Map == null ? "null" : spawn.Map.ToString()); AddLabel(gTab[7], top, gFontHue, spawn.Active ? "Y" : "N"); AddLabel(gTab[8], top, gFontHue, spawn.AutoRestart ? "Y" : "N"); AddButton(gTab[9], top, 0xFA5, 0xFA7, 1 + i, GumpButtonType.Reply, 0); AddButton(gTab[10], top, 0xFA5, 0xFA7, 1001 + i, GumpButtonType.Reply, 0); top += gRowHeight; } }
private void Generate() { int i = 0; for (i = 0; i < m_Dungeons.Length; i++) { ChampionSpawn cs = CreateAltar(m_Dungeons[i], Map.Felucca, true); m_AllSpawn.Add(cs); m_DungeonsSpawn.Add(cs); } for (i = 0; i < m_LostLands.Length; i++) { ChampionSpawn cs = CreateAltar(m_LostLands[i], Map.Felucca, true); m_AllSpawn.Add(cs); m_LostLandsSpawn.Add(cs); } for (i = 0; i < m_Ilshenar.Length; i++) { ChampionSpawn cs = CreateAltar(m_Ilshenar[i], Map.Ilshenar, false); m_IlshenarSpawn.Add(cs); m_AllSpawn.Add(cs); } for (i = 0; i < m_Tokuno.Length; i++) { ChampionSpawn cs = CreateAltar(m_Tokuno[i], Map.Tokuno, false); m_TokunoSpawn.Add(cs); m_AllSpawn.Add(cs); } for (i = 0; i < m_Malas.Length; i++) { ChampionSpawn cs = CreateAltar(m_Malas[i], Map.Malas, true); m_MalasSpawn.Add(cs); m_AllSpawn.Add(cs); } for (i = 0; i < m_TerMur.Length; i++) { ChampionSpawn cs = CreateAltar(m_TerMur[i], Map.TerMur, true); m_TerMurSpawn.Add(cs); m_AllSpawn.Add(cs); } }
public static void Initialize() { foreach (Item item in World.Instance.Items) { if (item is ChampionSpawn) { ChampionSpawn spawn = (ChampionSpawn)item; EventSink.Instance.Login += new LoginEventHandler(spawn.OnLogin); EventSink.Instance.Logout += new LogoutEventHandler(spawn.OnLogout); } } }
// internal code to update the puzzle state private void UpdatePuzzleState(ChampionSpawn altar) { if (!Deleted && null != altar && altar == m_Altar) { if (ChampionSpawnType.Infuse != m_Altar.Type || !Active) { RemovePuzzleLevers(); } else if (0 == m_Levers.Count) { CreatePuzzleLevers(); } } }
// static hook for the ChampionSpawn code to update the puzzle state public static void Update(ChampionSpawn altar) { if (null != m_Instance) { if (m_Instance.Deleted) { m_Instance = null; } else if (m_Instance.ChampionAltar == altar) { m_Instance.UpdatePuzzleState(altar); } } }
private ChampionSpawn CreateAltar(SpawnRecord r, Map m, bool restartdisable) { ChampionSpawn cs = new ChampionSpawn(); Point3D loc = new Point3D(r.x, r.y, r.z); if (r.type == 0xff) { cs.RandomizeType = true; switch (Utility.Random(5)) { case 0: cs.Type = ChampionSpawnType.VerminHorde; break; case 1: cs.Type = ChampionSpawnType.UnholyTerror; break; case 2: cs.Type = ChampionSpawnType.ColdBlood; break; case 3: cs.Type = ChampionSpawnType.Abyss; break; case 4: cs.Type = ChampionSpawnType.Arachnid; break; } } else { cs.RandomizeType = false; cs.Type = (ChampionSpawnType)r.type; } // Prevent autorestart of felucca & t2a the spawns if (restartdisable) { cs.RestartDelay = TimeSpan.FromDays(9999); } cs.MoveToWorld(loc, m); return(cs); }
// search for Primeval Lich altar within 10 spaces of the expected location private ChampionSpawn FindAltar() { foreach (Item item in Map.Felucca.GetItemsInRange(altarLoc, 10)) { if (item is ChampionSpawn) { ChampionSpawn champ = (ChampionSpawn)item; if (ChampionSpawnType.Infuse == champ.Type) { return(champ); } } } return(null); }
public static bool CheckValor( ChampionSpawn spawn, Mobile from ) { VirtueLevel level = VirtueHelper.GetLevel( from, VirtueName.Valor ); if ( spawn != null && VirtueHelper.HasAny( from, VirtueName.Valor ) ) { if ( level >= VirtueLevel.Seeker && spawn.Level < 5 ) return true; else if ( level >= VirtueLevel.Follower && spawn.Level < 10 ) return true; else if ( level >= VirtueLevel.Knight ) return true; } return false; }
public static void RemoveSpawns() { if (m_AllSpawns != null && m_AllSpawns.Count > 0) { for (var index = 0; index < m_AllSpawns.Count; index++) { ChampionSpawn s = m_AllSpawns[index]; if (s != null && !s.Deleted) { s.Delete(); } } m_AllSpawns.Clear(); } }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 0: { m_Spawn = reader.ReadItem() as ChampionSpawn; if ( m_Spawn == null ) Delete(); break; } } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 0: { this.m_Spawn = reader.ReadItem() as ChampionSpawn; if (this.m_Spawn == null) { this.Delete(); } break; } } }
public override void Deserialize(IGenericReader reader) { base.Deserialize(reader); var version = reader.ReadInt(); switch (version) { case 0: { Spawn = reader.ReadEntity <ChampionSpawn>(); if (Spawn == null) { Delete(); } break; } } }
public ChampionSystemGump() : base(40, 40) { AddBackground(0, 0, gWidth, gBoarder * 2 + m_AllSpawns.Count * gRowHeight + gRowHeight * 2, 0x13BE); int top = gBoarder; AddLabel(gBoarder, top, gFontHue, "Champion Spawn System Gump"); top += gRowHeight; AddLabel(gTab[1], top, gFontHue, "Spawn Name"); AddLabel(gTab[2], top, gFontHue, "Spawn Group"); AddLabel(gTab[3], top, gFontHue, "X"); AddLabel(gTab[4], top, gFontHue, "Y"); AddLabel(gTab[5], top, gFontHue, "Z"); AddLabel(gTab[6], top, gFontHue, "Map"); AddLabel(gTab[7], top, gFontHue, "Active"); AddLabel(gTab[8], top, gFontHue, "Auto"); AddLabel(gTab[9], top, gFontHue, "Go"); AddLabel(gTab[10], top, gFontHue, "Info"); top += gRowHeight; for (int i = 0; i < m_AllSpawns.Count; ++i) { ChampionSpawn spawn = m_AllSpawns[i]; AddLabel(gTab[1], top, gFontHue, spawn.SpawnName); AddLabel(gTab[2], top, gFontHue, spawn.GroupName != null ? spawn.GroupName : "None"); AddLabel(gTab[3], top, gFontHue, spawn.X.ToString()); AddLabel(gTab[4], top, gFontHue, spawn.Y.ToString()); AddLabel(gTab[5], top, gFontHue, spawn.Z.ToString()); AddLabel(gTab[6], top, gFontHue, spawn.Map.ToString()); AddLabel(gTab[7], top, gFontHue, spawn.Active ? "Y" : "N"); AddLabel(gTab[8], top, gFontHue, spawn.AutoRestart ? "Y" : "N"); AddButton(gTab[9], top, 0xFA5, 0xFA7, 1 + i, GumpButtonType.Reply, 0); AddButton(gTab[10], top, 0xFA5, 0xFA7, 1001 + i, GumpButtonType.Reply, 0); top += gRowHeight; } }
public ChampionPlatform(ChampionSpawn spawn) { m_Spawn = spawn; // Base for (int x = -2; x <= 2; ++x) { for (int y = -2; y <= 2; ++y) { AddComponent(0x3EE, 0x452, x, y, -5); } } // Base Superior for (int x = -1; x <= 1; ++x) { for (int y = -1; y <= 1; ++y) { AddComponent(0x3EE, 0x454, x, y, 0); } } // Escalones for (int i = -1; i <= 1; ++i) { AddComponent(0x3EF, 0x452, i, 2, 0); AddComponent(0x3F0, 0x452, 2, i, 0); AddComponent(0x3F1, 0x452, i, -2, 0); AddComponent(0x3F2, 0x452, -2, i, 0); } // Esquinas AddComponent(0x3F7, 0x452, -2, -2, 0); AddComponent(0x3F8, 0x452, 2, 2, 0); AddComponent(0x3F9, 0x452, -2, 2, 0); AddComponent(0x3FA, 0x452, 2, -2, 0); }
private static void Process(ChampionEntry[] entries) { for (int i = 0; i < entries.Length; i++) { ChampionEntry entry = entries[i]; try { ChampionSpawn spawn = Activator.CreateInstance(entry.m_ChampType) as ChampionSpawn; spawn.RandomizeType = entry.m_RandomizeType; spawn.Type = entry.m_Type; spawn.MoveToWorld(entry.m_SignLocation, entry.m_Map); if (spawn.AlwaysActive) { spawn.ReadyToActivate = true; } } catch { Console.WriteLine("World: Failed to generate champion spawn {0} at {1} ({2}).", entry.m_ChampType.FullName, entry.m_SignLocation, entry.m_Map); } } }
public RestartTimer( ChampionSpawn spawn, TimeSpan delay ) : base( delay ) { m_Spawn = spawn; }
public ChampionAltar( ChampionSpawn spawn ) { m_Spawn = spawn; }
public static void Initialize() { CommandSystem.Register("ChampionInfo", AccessLevel.GameMaster, new CommandEventHandler(ChampionInfo_OnCommand)); if (!m_Enabled) { foreach (ChampionSpawn s in m_AllSpawns) { s.Delete(); } m_Initialized = false; return; } m_Timer = new InternalTimer(); if (m_Initialized) return; Utility.PushColor(ConsoleColor.White); Console.WriteLine("Generating Champion Spawns"); Utility.PopColor(); ChampionSpawn spawn; XmlDocument doc = new XmlDocument(); doc.Load(m_ConfigPath); foreach (XmlNode node in doc.GetElementsByTagName("championSystem")[0].ChildNodes) { if (node.Name.Equals("spawn")) { spawn = new ChampionSpawn(); spawn.SpawnName = GetAttr(node, "name", "Unamed Spawner"); string value = GetAttr(node, "type", null); if(value == null) spawn.RandomizeType = true; else spawn.Type = (ChampionSpawnType)Enum.Parse(typeof(ChampionSpawnType), value); value = GetAttr(node, "spawnMod", "1.0"); spawn.SpawnMod = double.Parse(value); value = GetAttr(node, "killsMod", "1.0"); spawn.KillsMod = double.Parse(value); foreach(XmlNode child in node.ChildNodes) { if (child.Name.Equals("location")) { int x = int.Parse(GetAttr(child, "x", "0")); int y = int.Parse(GetAttr(child, "y", "0")); int z = int.Parse(GetAttr(child, "z", "0")); int r = int.Parse(GetAttr(child, "radius", "0")); string mapName = GetAttr(child, "map", "Felucca"); Map map = Map.Parse(mapName); spawn.SpawnRadius = r; spawn.MoveToWorld(new Point3D(x, y, z), map); } } spawn.GroupName = GetAttr(node, "group", null); m_AllSpawns.Add(spawn); } } Rotate(); m_Initialized = true; }
public ChampionSpawnInfoGump(ChampionSpawn spawn) : base(40, 40) { m_Spawn = spawn; AddBackground(0, 0, gWidth, gBoarder * 2 + gRowHeight * (8 + spawn.m_DamageEntries.Count), 0x13BE); int top = gBoarder; AddLabel(gBoarder, top, gFontHue, "Champion Spawn Info Gump"); top += gRowHeight; AddLabel(gTab[1], top, gFontHue, "Kills"); AddLabel(gTab[2], top, gFontHue, spawn.Kills.ToString()); top += gRowHeight; AddLabel(gTab[1], top, gFontHue, "Max Kills"); AddLabel(gTab[2], top, gFontHue, spawn.MaxKills.ToString()); top += gRowHeight; AddLabel(gTab[1], top, gFontHue, "Level"); AddLabel(gTab[2], top, gFontHue, spawn.Level.ToString()); top += gRowHeight; AddLabel(gTab[1], top, gFontHue, "Rank"); AddLabel(gTab[2], top, gFontHue, spawn.Rank.ToString()); top += gRowHeight; AddLabel(gTab[1], top, gFontHue, "Active"); AddLabel(gTab[2], top, gFontHue, spawn.Active.ToString()); top += gRowHeight; AddLabel(gTab[1], top, gFontHue, "Auto Restart"); AddLabel(gTab[2], top, gFontHue, spawn.AutoRestart.ToString()); top += gRowHeight; List<Damager> damagers = new List<Damager>(); foreach (Mobile mob in spawn.m_DamageEntries.Keys) { damagers.Add(new Damager(mob, spawn.m_DamageEntries[mob])); } damagers = damagers.OrderByDescending(x => x.Damage).ToList<Damager>(); foreach (Damager damager in damagers) { AddLabelCropped(gTab[1], top, 100, gRowHeight, gFontHue, damager.Mobile.RawName); AddLabelCropped(gTab[2], top, 80, gRowHeight, gFontHue, damager.Damage.ToString()); top += gRowHeight; } AddButton(gWidth - (gBoarder + 30), top, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0); AddLabel(gWidth - (gBoarder + 100), top, gFontHue, "Refresh"); }
public RestartTimer(ChampionSpawn spawn, TimeSpan delay) : base(delay) { m_Spawn = spawn; Priority = TimerPriority.FiveSeconds; }
public ChampionSpawnRegion(ChampionSpawn spawn) : base(null, spawn.Map, Region.Find(spawn.Location, spawn.Map), spawn.SpawnArea) { m_Spawn = spawn; }
// Constructor public PrimevalLichPuzzle(Mobile m) : base(0x1BC3) { if (null == m || null != m_Instance) { this.Delete(); if (m_Instance.Deleted) m_Instance = null; return; } this.Movable = false; this.Visible = false; m_Instance = this; this.MoveToWorld(controlLoc, Map.Felucca); this.m_Levers = new List<PrimevalLichPuzzleLever>(); this.m_Altar = this.FindAltar(); if (null == this.m_Altar) { m.SendMessage(33, "Primeval Lich champion spawn not found."); this.Delete(); } else { this.UpdatePuzzleState(this.m_Altar); } }
// static hook for the ChampionSpawn code to update the puzzle state public static void Update(ChampionSpawn altar) { if (null != m_Instance) { if (m_Instance.Deleted) m_Instance = null; else if (m_Instance.ChampionAltar == altar) m_Instance.UpdatePuzzleState(altar); } }
public SliceTimer(ChampionSpawn spawn) : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0)) { m_Spawn = spawn; Priority = TimerPriority.OneSecond; }
public SliceTimer( ChampionSpawn spawn ) : base( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ) ) { m_Spawn = spawn; }
public IdolOfTheChampion(ChampionSpawn spawn) : base(0x1F18) { this.m_Spawn = spawn; this.Movable = false; }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch ( version ) { case 1: m_Instance = reader.ReadItem() as PrimevalLichPuzzle; this.m_Altar = reader.ReadItem() as ChampionSpawn; this.m_Key = reader.ReadLong(); this.m_Successful = reader.ReadMobile(); this.m_Levers = reader.ReadStrongItemList<PrimevalLichPuzzleLever>(); break; } if (null == this.m_Levers) this.m_Levers = new List<PrimevalLichPuzzleLever>(); // if ( null != m_Instance && m_Instance.Deleted && this == m_Instance ) // { // m_Instance = null; // return; // } // // remove if no altar exists // if ( null == m_Altar ) // Timer.DelayCall( TimeSpan.FromSeconds( 0.0 ), new TimerCallback( Delete ) ); // ResetLevers(); }
public SliceTimer(ChampionSpawn spawn) : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0)) { this.m_Spawn = spawn; this.Priority = TimerPriority.OneSecond; }
public static Mobile GETCHAMPREWARDMOB(TriggerObject trigObject, ChampionSpawn champSpawn) { return champSpawn == null ? null : GETCHAMPREWARDMOB(trigObject, champSpawn, false); }
public IdolOfTheChampion(ChampionSpawn spawn) : base(0x1F18) { m_Spawn = spawn; Movable = false; }
public static Mobile GETCHAMPREWARDMOB(TriggerObject trigObject, ChampionSpawn champSpawn, bool removeFromList) { if (champSpawn == null) { return null; } var scores = champSpawn.Scores; if (scores == null) { return null; } Mobile value = null; // first find all eligible receivers var eligibleMobs = new List<Mobile>(); var eligibleMobScores = new List<double>(); double totalScores = 0.0; foreach (var pair in scores) { if (pair.Key == null) { continue; } Mobile mob = pair.Key; bool eligible = champSpawn.IsEligible(mob); if (!eligible) { continue; } eligibleMobs.Add(mob); eligibleMobScores.Add(pair.Value); totalScores += pair.Value; } double currentTestValue = 0.0; double roll = Utility.RandomDouble() * totalScores; for (int i = 0; i < eligibleMobScores.Count; i++) { currentTestValue += eligibleMobScores[i]; if (!(roll <= currentTestValue)) { continue; } value = eligibleMobs[i]; break; } if (value != null && removeFromList) { scores.Remove(value); } return value; }
private ChampionSpawn CreateAltar( SpawnRecord r, Map m, bool restartdisable ) { ChampionSpawn cs = new ChampionSpawn(); Point3D loc = new Point3D( r.x, r.y, r.z ); if ( r.type == 0xff ) { cs.RandomizeType = true; switch ( Utility.Random( 5 ) ) { case 0: cs.Type = ChampionSpawnType.VerminHorde; break; case 1: cs.Type = ChampionSpawnType.UnholyTerror; break; case 2: cs.Type = ChampionSpawnType.ColdBlood; break; case 3: cs.Type = ChampionSpawnType.Abyss; break; case 4: cs.Type = ChampionSpawnType.Arachnid; break; } } else { cs.RandomizeType = false; cs.Type = (ChampionSpawnType)r.type; } // Prevent autorestart of felucca & t2a the spawns if ( restartdisable ) cs.RestartDelay = TimeSpan.FromDays( 9999 ); cs.MoveToWorld( loc, m ); return cs; }
// internal code to update the puzzle state private void UpdatePuzzleState(ChampionSpawn altar) { if (!this.Deleted && null != altar && altar == this.m_Altar) { if (ChampionSpawnType.Infuse != this.m_Altar.Type || !this.Active) this.RemovePuzzleLevers(); else if (0 == this.m_Levers.Count) this.CreatePuzzleLevers(); } }
public ChampionAltar(ChampionSpawn spawn) => m_Spawn = spawn;
public ChampionAltar( ChampionSpawn spawn ) { m_Spawn = spawn; Hue = 0x455; }
// internal code to update the puzzle state private void UpdatePuzzleState( ChampionSpawn altar) { if ( !Deleted && null != altar && altar == m_Altar ) { if ( ChampionSpawnType.LichLand != m_Altar.Type || !Active ) RemovePuzzleLevers(); else if ( 0 == m_Levers.Count ) CreatePuzzleLevers(); } }