public ExtEventMoongate( Point3D target, Map targetMap ) { Name = "Defiance Event Moongate"; Hue = 315; Target = target; TargetMap = targetMap; Light = LightType.Circle300; Movable = Dispellable = false; m_SkillName1 = m_SkillName2 = SkillName.Alchemy; m_Confirmation = String.Empty; m_Delay = TimeSpan.FromSeconds( 1.0 ); m_RestFlags = (EGRFlags)0x0; //Restrict nothing m_OptFlags = (EGateOptFlags)0xBF711; /* Active | RemoveGameRobe | HideWhenFull | StaffOverride CannotFleeFromBattle | RemoveFSL | TransportPets RemovePolymorph | RemoveIncognito | RemoveDisguise | CheckTollBackpack CheckTollBankBox */ }
public bool GetRestFlag( EGRFlags flag ) { return ( m_RestFlags & flag ) == flag; }
public void SetRestFlag( EGRFlags flag, bool value ) { if ( value ) m_RestFlags |= flag; else m_RestFlags &= ~flag; }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch( version ) { case 7: { m_RestFlags = (EGRFlags)PSerial.ReadEncodedLong( reader ); m_OptFlags = (EGateOptFlags)reader.ReadEncodedInt(); m_MaxPlayers = reader.ReadInt(); m_TollItem = Reflector.Deserialize( reader ); m_TollAmount = reader.ReadInt(); m_SkillName1 = (SkillName)reader.ReadInt(); m_SkillName2 = (SkillName)reader.ReadInt(); m_SkillValue1 = reader.ReadDouble(); m_SkillValue2 = reader.ReadDouble(); m_GMsNeeded = reader.ReadInt(); m_StrValue = reader.ReadInt(); m_IntValue = reader.ReadInt(); m_DexValue = reader.ReadInt(); m_Confirmation = reader.ReadString(); m_GameRobeHue = reader.ReadInt(); m_Delay = reader.ReadTimeSpan(); m_KarmaThreshold = reader.ReadInt(); break; } case 6: { switch ( reader.ReadInt() ) { case 0: TollLocation = TollOption.Backpack; break; case 1: TollLocation = TollOption.BankBox; break; case 2: TollLocation = TollOption.Both; break; } goto case 5; } case 5: { CannotFleeFromBattle = reader.ReadBool(); goto case 4; } case 4: { m_GameRobeHue = reader.ReadInt(); GiveGameRobe = !reader.ReadBool(); goto case 3; } case 3: { StaffOverride = !reader.ReadBool(); m_Confirmation = reader.ReadString(); StaffOnly = reader.ReadBool(); switch( reader.ReadInt() ) //Sex-Select { case 1: Gender = GenderOption.Male; break; case 2: Gender = GenderOption.Female; break; } int npcguild = reader.ReadInt(); if ( npcguild > 0 ) { SetRestFlag( EGRFlags.No_NPCGuilds, true ); SetRestFlag( (EGRFlags)(1ul<<(25+npcguild)), false ); } switch( reader.ReadInt() ) //Faction-Select { case 1: SetRestFlag( EGRFlags.No_Factions, true ); break; case 2: SetRestFlag( EGRFlags.No_Factionless, true ); break; case 3: SetRestFlag( EGRFlags.No_Minax | EGRFlags.No_Shadowlords | EGRFlags.No_TrueBrits, true ); break; case 4: SetRestFlag( EGRFlags.No_COM | EGRFlags.No_Shadowlords | EGRFlags.No_TrueBrits, true ); break; case 5: SetRestFlag( EGRFlags.No_COM | EGRFlags.No_Minax | EGRFlags.No_TrueBrits, true ); break; case 6: SetRestFlag( EGRFlags.No_COM | EGRFlags.No_Minax | EGRFlags.No_Shadowlords, true ); break; } switch( reader.ReadInt() ) //ChaosOrder-Select { case 1: SetRestFlag( EGRFlags.No_ChaosGuild | EGRFlags.No_OrderGuild, true ); break; case 2: SetRestFlag( EGRFlags.No_RegGuild | EGRFlags.No_Guildless, true ); break; case 3: SetRestFlag( EGRFlags.No_OrderGuild | EGRFlags.No_RegGuild | EGRFlags.No_Guildless, true ); break; case 4: SetRestFlag( EGRFlags.No_ChaosGuild | EGRFlags.No_RegGuild | EGRFlags.No_Guildless, true ); break; } goto case 2; } case 2: { switch( reader.ReadInt() ) //Young-Select { case 1: Veterans = VetOption.Veteran; break; case 2: Veterans = VetOption.Young; break; } switch( reader.ReadInt() ) //Factioners-Select { case 1: SetRestFlag( EGRFlags.No_Factions, true ); break; case 2: No_Factionless = true; break; } goto case 1; } case 1: { int stat = reader.ReadInt(); int amount = (int)reader.ReadDouble(); switch( stat ) { case 1: m_StrValue = amount; break; case 2: m_IntValue = amount; break; case 3: m_DexValue = amount; break; } reader.ReadString(); //obselete switch( reader.ReadInt() ) { case 1: SetRestFlag( EGRFlags.No_Ghosts, true ); break; case 2: SetRestFlag( EGRFlags.No_Living, true ); break; } ResGhosts = reader.ReadBool(); RemoveFSL = reader.ReadBool(); SetOptFlag( EGateOptFlags.StrMax | EGateOptFlags.IntMax | EGateOptFlags.DexMax, reader.ReadInt() == 0 ); reader.ReadInt(); //obselete m_MaxPlayers = reader.ReadInt(); HideWhenFull = reader.ReadBool(); switch( reader.ReadInt() ) { case 1: Mounted = MountOption.Unmounted; break; case 2: Mounted = MountOption.Mounted; break; } TransportPets = reader.ReadBool(); SetRestFlag( EGRFlags.No_Clothed, reader.ReadBool() ); SetRestFlag( EGRFlags.No_NonDonators, reader.ReadBool() ); switch( reader.ReadInt() ) { case 1: No_Murderer = true; break; case 2: No_BlueKarma = No_GrayKarma = No_Criminal = true; break; } m_TollItem = ScriptCompiler.FindTypeByFullName( reader.ReadString() ); m_TollAmount = reader.ReadInt(); FreeForDonators = reader.ReadBool(); m_SkillName1 = (SkillName)reader.ReadInt(); m_SkillValue1 = reader.ReadDouble(); reader.ReadString(); //obselete m_GMsNeeded = reader.ReadInt(); break; } } }