public CustomGumpItem(String label, String message, BaseGame game, PlayerMobile player) { Game = game; Player = player; Label = label; Message = message; }
public GameInfoGump(Mobile m, BaseGame game, bool endgame) : base(200, 200) { m_Game = game; m_User = m; if (m_User.HasGump(this.GetType())) { m_User.CloseGump(this.GetType()); } MakeGump(endgame); }
public GameAdminGump(Mobile m, BaseGame game) : base(200, 200) { m_Game = game; m_User = m; if (m_User == null) return; if (m_User.HasGump(this.GetType())) { m_User.CloseGump(this.GetType()); } MakeGump(); }
private static void ScoreEvent_Command(CommandEventArgs e) { BaseGame Game = ((PlayerMobile)e.Mobile).CurrentEvent; if (Game != null) { Game.AnnounceScore(e.Mobile); } else if (PvpCore.IsInDeathmatch(e.Mobile)) { PvpCore.TryShowScoreBoard(e.Mobile); } else { e.Mobile.SendAsciiMessage("You are not in an event."); } }
public GameAdminGump(Mobile m, BaseGame game) : base(200, 200) { m_Game = game; m_User = m; if (m_User == null) { return; } if (m_User.HasGump(this.GetType())) { m_User.CloseGump(this.GetType()); } MakeGump(); }
private static void ShowScore_Target(Mobile from, object o) { if (o is PlayerMobile) { PlayerMobile pm = o as PlayerMobile; BaseGame Game = pm.CurrentEvent; if (Game != null) { Game.AnnounceScore(from); } else if (PvpCore.IsInDeathmatch(pm)) { DMStone s = PvpCore.GetPlayerStone(pm); if (s != null) { s.ShowScore(from); } } else { from.BeginTarget(-1, false, TargetFlags.None, ShowScore_Target); from.SendMessage("Target a player in a game or a deathmatch stone"); } } else if (o is DMStone) { DMStone game = (DMStone)o; if (game.Started) { game.ShowScore(from); } else { from.SendAsciiMessage("This deathmatch is not running"); } } else { from.BeginTarget(-1, false, TargetFlags.None, ShowScore_Target); from.SendMessage("Target a player in a game or a deathmatch stone"); } }
private static void SendScore_Target(Mobile from, object o) { if (o is PlayerMobile) { PlayerMobile pm = o as PlayerMobile; BaseGame Game = pm.CurrentEvent; if (Game != null) { Game.AnnounceScore(); } else { from.BeginTarget(-1, false, TargetFlags.None, ShowScore_Target); from.SendMessage("Target a player in a game"); } } else { from.BeginTarget(-1, false, TargetFlags.None, ShowScore_Target); from.SendMessage("Target a player in a game"); } }
private static void StartEvent_Target(Mobile from, object o, object state) { if (o is BaseGame) { BaseGame game = (BaseGame)o; if (game.Open) { try { game.StartCommand(from); } catch (EventException e) { from.SendMessage(e.ToString()); } } else { from.SendMessage("You have to open the game first."); } } else if (o is DMStone) { DMStone game = (DMStone)o; game.Started = true; } else if (o is TournamentStone) { TournamentStone game = (TournamentStone)o; game.Started = true; } else { from.BeginTarget(-1, false, TargetFlags.None, new TargetStateCallback(StartEvent_Target), false); from.SendMessage("Target the game stone."); } }
public GameInfoGump(Mobile m, BaseGame game) : base(200, 200) { m_Game = game; m_User = m; if (m_User.HasGump(this.GetType())) { m_User.CloseGump(this.GetType()); } if (m is PlayerMobile) { PlayerMobile user = m as PlayerMobile; if (user.GameInfoGumpType == GameInfoGumpType.Extended) MakeGump(false); else if (user.GameInfoGumpType == GameInfoGumpType.Compact) MakeCompactGump(); } else { MakeGump(false); } }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 44: { AntiMacroGump = reader.ReadBool(); goto case 43; } case 43: { ShowTipsOnLogin = reader.ReadBool(); goto case 42; } case 42: { AllowMulti = reader.ReadBool(); goto case 41; } case 41: { GameInfoGumpType = (GameInfoGumpType)reader.ReadInt(); goto case 40; } case 40: { m_EventType = (EventType)reader.ReadByte(); m_CurrentEvent = reader.ReadItem() as BaseGame; goto case 39; } case 39: { TempCheck = reader.ReadBool(); goto case 38; } case 38: { m_AutoStabled = reader.ReadStrongMobileList(); m_AnkhNextUse = reader.ReadDateTime(); m_PeacedUntil = reader.ReadDateTime(); goto case 37; } case 37: { ShowArriveMsg = reader.ReadBool(); goto case 36; } case 36: { m_Rating = reader.ReadInt(); m_TournamentRating = reader.ReadInt(); m_CurrentEvent = null; goto case 35; } case 35: { m_Snoopers = reader.ReadStrongMobileList(); goto case 34; } case 34: m_HasStartingSkillBoost = reader.ReadBool(); goto case 33; case 33: { m_OriginalHairHue = reader.ReadInt(); m_OriginalHairItemID = reader.ReadInt(); m_OriginalHue = reader.ReadInt(); m_HasCustomRace = reader.ReadBool(); goto case 32; } case 32: VirtualArmor = reader.ReadInt(); goto case 31; case 31: m_PlayerGuildGameTime = reader.ReadTimeSpan(); goto case 30; case 30: m_AlwaysMurderer = reader.ReadBool(); goto case 29; case 29: m_Imported = reader.ReadBool(); goto case 28; case 28: /*Item nullItem = reader.ReadItem(); goto case 27;*/ case 27: m_Stoned = reader.ReadBool(); goto case 26; case 26: UseUnicodeSpeech = reader.ReadBool(); goto case 25; case 25: { int recipeCount = reader.ReadInt(); if( recipeCount > 0 ) { m_AcquiredRecipes = new Dictionary<int, bool>(); for( int i = 0; i < recipeCount; i++ ) { int r = reader.ReadInt(); if( reader.ReadBool() ) //Don't add in recipies which we haven't gotten or have been removed m_AcquiredRecipes.Add( r, true ); } } goto case 24; } case 24: { m_LastHonorLoss = reader.ReadDeltaTime(); goto case 23; } case 23: { m_ChampionTitles = new ChampionTitleInfo( reader ); goto case 22; } case 22: { m_LastValorLoss = reader.ReadDateTime(); goto case 21; } case 21: { m_ToTItemsTurnedIn = reader.ReadEncodedInt(); m_ToTTotalMonsterFame = reader.ReadInt(); goto case 20; } case 20: { AllianceMessageHue = reader.ReadEncodedInt(); GuildMessageHue = reader.ReadEncodedInt(); goto case 19; } case 19: { int rank = reader.ReadEncodedInt(); int maxRank = RankDefinition.Ranks.Length -1; if( rank > maxRank ) rank = maxRank; m_GuildRank = RankDefinition.Ranks[rank]; LastOnline = reader.ReadDateTime(); goto case 18; } case 18: { m_SolenFriendship = (SolenFriendship) reader.ReadEncodedInt(); goto case 17; } case 17: // changed how DoneQuests is serialized case 16: { m_Quest = QuestSerializer.DeserializeQuest( reader ); if ( m_Quest != null ) m_Quest.From = this; int count = reader.ReadEncodedInt(); if ( count > 0 ) { m_DoneQuests = new List<QuestRestartInfo>(); for ( int i = 0; i < count; ++i ) { Type questType = QuestSerializer.ReadType( QuestSystem.QuestTypes, reader ); DateTime restartTime; if ( version < 17 ) restartTime = DateTime.MaxValue; else restartTime = reader.ReadDateTime(); m_DoneQuests.Add( new QuestRestartInfo( questType, restartTime ) ); } } Profession = reader.ReadEncodedInt(); goto case 15; } case 15: { m_LastCompassionLoss = reader.ReadDeltaTime(); goto case 14; } case 14: { m_CompassionGains = reader.ReadEncodedInt(); if ( m_CompassionGains > 0 ) m_NextCompassionDay = reader.ReadDeltaTime(); goto case 13; } case 13: // just removed m_PayedInsurance list case 12: { m_BOBFilter = new BOBFilter( reader ); goto case 11; } case 11: { if ( version < 13 ) { List<Item> payed = reader.ReadStrongItemList(); for ( int i = 0; i < payed.Count; ++i ) payed[i].PayedInsurance = true; } goto case 10; } case 10: { if ( reader.ReadBool() ) { m_HairModID = reader.ReadInt(); m_HairModHue = reader.ReadInt(); m_BeardModID = reader.ReadInt(); m_BeardModHue = reader.ReadInt(); } goto case 9; } case 9: { SavagePaintExpiration = reader.ReadTimeSpan(); if ( SavagePaintExpiration > TimeSpan.Zero ) { BodyMod = ( Female ? 184 : 183 ); HueMod = 0; } goto case 8; } case 8: { NpcGuild = (NpcGuild)reader.ReadInt(); NpcGuildJoinTime = reader.ReadDateTime(); NpcGuildGameTime = reader.ReadTimeSpan(); goto case 7; } case 7: { m_PermaFlags = reader.ReadStrongMobileList(); goto case 6; } case 6: { NextTailorBulkOrder = reader.ReadTimeSpan(); goto case 5; } case 5: { NextSmithBulkOrder = reader.ReadTimeSpan(); goto case 4; } case 4: { m_LastJusticeLoss = reader.ReadDeltaTime(); m_JusticeProtectors = reader.ReadStrongMobileList(); goto case 3; } case 3: { m_LastSacrificeGain = reader.ReadDeltaTime(); m_LastSacrificeLoss = reader.ReadDeltaTime(); m_AvailableResurrects = reader.ReadInt(); goto case 2; } case 2: { m_Flags = (PlayerFlag)reader.ReadInt(); goto case 1; } case 1: { m_LongTermElapse = reader.ReadTimeSpan(); m_ShortTermElapse = reader.ReadTimeSpan(); m_GameTime = reader.ReadTimeSpan(); goto case 0; } case 0: { if (version < 43) ShowTipsOnLogin = true; if (version < 38) m_AutoStabled = new List<Mobile>(); break; } } // Professions weren't verified on 1.0 RC0 if ( !CharacterCreation.VerifyProfession( Profession ) ) Profession = 0; if ( m_PermaFlags == null ) m_PermaFlags = new List<Mobile>(); if ( m_Snoopers == null) m_Snoopers = new List<Mobile>(); if ( m_JusticeProtectors == null ) m_JusticeProtectors = new List<Mobile>(); if ( m_BOBFilter == null ) m_BOBFilter = new BOBFilter(); if( m_GuildRank == null ) m_GuildRank = RankDefinition.Member; //Default to member if going from older verstion to new version (only time it should be null) if( LastOnline == DateTime.MinValue && Account != null ) LastOnline = ((Account)Account).LastLogin; if( m_ChampionTitles == null ) m_ChampionTitles = new ChampionTitleInfo(); if (AccessLevel > AccessLevel.Player) m_IgnoreMobiles = true; List<Mobile> list = Stabled; for ( int i = 0; i < list.Count; ++i ) { BaseCreature bc = list[i] as BaseCreature; if ( bc != null ) bc.IsStabled = true; } CheckAtrophies( this ); if( Hidden ) //Hiding is the only buff where it has an effect that's serialized. AddBuff( new BuffInfo( BuffIcon.HidingAndOrStealth, 1075655 ) ); }
public EndGameEventArgs(BaseGame game) { m_Game = game; }
public static void RemoveCustomMessage(BaseGame game, CustomGumpItem item) { if (m_CustomGameFields.ContainsKey(game)) m_CustomGameFields[game].Remove(item); game.SendPlayerGumps(); }
public static void AddCustomMessage(BaseGame game, CustomGumpItem item) { if (m_CustomGameFields.ContainsKey(game)) m_CustomGameFields[game].Add(item); else { List<CustomGumpItem> list = new List<CustomGumpItem>(); list.Add(item); m_CustomGameFields.Add(game, list); } game.SendPlayerGumps(); }
public BaseGameTeam(BaseGame game, string name) { m_Game = game; m_Name = name; }
public GameGumpTimer(BaseGame g) : base(TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(30)) { m_Game = g; }
public CustomGumpItem(String label, String message, BaseGame game) { Label = label; Message = message; Game = game; }
public GameTimer(BaseGame game) : base(TimeSpan.Zero, TimeSpan.FromSeconds(30)) { m_Game = game; }
public ScoreTimer(BaseGame g) : base(TimeSpan.FromMinutes(2.0), TimeSpan.FromMinutes(2.0)) { m_Game = g; }