public static void SupplyGear(Mobile m, EventSupplier eventSupplier) { //Supply the right type of gear SupplyType supplyType = eventSupplier.SupplyType; if (supplyType == SupplyType.MaxGear) { SupplyMaxGear(m, eventSupplier.ClothHue, eventSupplier.GearHue, eventSupplier.TeamName, eventSupplier.NewbieAllItems, eventSupplier.StayEquipped, eventSupplier.ConsumeItems); } else if (supplyType == SupplyType.RegularGear) { SupplyRegGear(m, eventSupplier.ClothHue, eventSupplier.GearHue, eventSupplier.TeamName, eventSupplier.NewbieAllItems, eventSupplier.StayEquipped, eventSupplier.ConsumeItems); } else if (supplyType == SupplyType.Custom) { if (!eventSupplier.CanUseCustomGear) { m.PublicOverheadMessage(MessageType.Regular, 906, true, "Custom setup error."); } //Copy all the items in our bags and make them to event items for (int i = 0; i < eventSupplier.ItemContaiers.Length; i++) { if (eventSupplier.ItemContaiers[i].Items.Count > 0) { SupplyCustomItems(eventSupplier.ItemContaiers[i].Items, m, eventSupplier.ItemContaiers[i].AcceptsType, eventSupplier.NewbieAllItems, eventSupplier.ClothHue, eventSupplier.GearHue, eventSupplier.TeamName, eventSupplier.StayEquipped, eventSupplier.ConsumeItems); } } } }
private void ReadyPlayer(Mobile m) { if (!ScoreTable.ContainsKey(m.Serial)) { ScoreTable.Add(m.Serial, new ScoreKeeper(m)); } if (EventSupplier != null) { EventSupplier.OnMoveOver(m); } Contestants.Add(m); m.MoveToWorld(JoinLocation, JoinMap); m.Blessed = true; if (m.NetState != null) { m.SendMessage(38, "You have joined a tournament"); } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); ScoreModifier = 1.0; switch (version) { case 3: { ScoringType = (Scoring)reader.ReadInt(); ScoreModifier = reader.ReadDouble(); goto case 2; } case 2: { m_EventSupplier = reader.ReadItem <EventSupplier>(); m_UseSphereRules = reader.ReadBool(); m_GiveHorses = reader.ReadBool(); goto case 1; } case 1: { m_MatchMin = reader.ReadInt(); m_LeaveLocation = reader.ReadPoint3D(); m_LeaveMap = reader.ReadMap(); goto case 0; } case 0: { Started = reader.ReadBool(); m_Active = reader.ReadBool(); m_AcceptingContestants = reader.ReadBool(); m_DMSpawnPoints = reader.ReadStrongItemList <DMSpawnPoint>(); #region Verify loaded spawn points List <DMSpawnPoint> removalList = new List <DMSpawnPoint>(); foreach (DMSpawnPoint dmSpawnPoint in m_DMSpawnPoints) { if (dmSpawnPoint.StoneLink != this) { removalList.Add(dmSpawnPoint); } } foreach (DMSpawnPoint dmSpawnPoint in removalList) { m_DMSpawnPoints.Remove(dmSpawnPoint); } #endregion m_MountCollection = ReadMountCollection(reader); break; } } m_Started = false; AcceptingContestants = false; Active = false; }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 5: { m_BeginGame = reader.ReadBool(); } goto case 4; case 4: { int count = reader.ReadInt(); for (int i = 0; i < count; ++i) { PlayerMobile player = reader.ReadMobile() as PlayerMobile; EquipmentStorage storage = reader.ReadItem() as EquipmentStorage; m_PlayerSupplies.Add(player, storage); } goto case 3; } case 3: { m_UseGump = reader.ReadBool(); m_GameName = reader.ReadString(); m_EventType = (EventType)reader.ReadInt(); int count = reader.ReadInt(); for (int i = 0; i < count; ++i) { m_PlayerScores.Add(reader.ReadMobile(), reader.ReadInt()); } goto case 2; } case 2: { Open = reader.ReadBool(); m_GiveSupplies = reader.ReadBool(); m_Supplier = reader.ReadItem() as EventSupplier; goto case 1; } case 1: { m_Players = reader.ReadStrongMobileList(); m_GameMaster = reader.ReadMobile(); m_MsgStaff = reader.ReadBool(); m_Running = reader.ReadBool(); m_StartTime = reader.ReadDateTime(); m_Length = reader.ReadTimeSpan(); m_MaxScore = reader.ReadInt(); m_Lobby = reader.ReadPoint3D(); m_LobbyMap = reader.ReadMap(); break; } } }