public static void Initialize() { EventSink.DeleteRequest += new DeleteRequestEventHandler( EventSink_DeleteRequest ); EventSink.AccountLogin += new AccountLoginEventHandler( EventSink_AccountLogin ); EventSink.GameLogin += new GameLoginEventHandler( EventSink_GameLogin ); if ( PasswordCommandEnabled ) CommandSystem.Register( "Password", AccessLevel.Player, new CommandEventHandler( Password_OnCommand ) ); if ( Core.AOS ) { CityInfo haven = new CityInfo( "Haven", "Uzeraan's Mansion", 3618, 2591, 0 ); StartingCities[StartingCities.Length - 1] = haven; } }
public override void OnResponse( NetState state, RelayInfo info ) { Mobile from = state.Mobile; switch( info.ButtonID ) { case 1: CityInfo city = new CityInfo( "Britain", "Town Center", 1475, 1645, 20 ); from.MoveToWorld( city.Location, Map.Felucca ); break; case 2: CityInfo city1 = new CityInfo( "Britain", "Town Center", 1475, 1645, 20 ); from.MoveToWorld( city1.Location, Map.Trammel ); break; case 3: CityInfo city2 = new CityInfo( "Lakeshire", "Town Center", 1203, 1124, -25 ); from.MoveToWorld( city2.Location, Map.Ilshenar ); break; case 4: CityInfo city3 = new CityInfo( "Luna", "Town Center", 989, 519, -50 ); from.MoveToWorld( city3.Location, Map.Malas ); break; case 5: CityInfo city4 = new CityInfo( "Zento", "Town Center", 735, 1257, 30 ); from.MoveToWorld( city4.Location, Map.Tokuno ); break; case 6: CityInfo city5 = new CityInfo( "Test", "Test", 852, 3526, -43 ); from.MoveToWorld( city5.Location, Map.TerMur ); break; } }
private static void EventSink_CharacterCreated( CharacterCreatedEventArgs args ) { if ( !VerifyProfession( args.Profession ) ) args.Profession = 0; NetState state = args.State; if ( state == null ) return; Mobile newChar = CreateMobile( args.Account as Account ); if ( newChar == null ) { Console.WriteLine( "Login: {0}: Character creation failed, account full", state );/////////////////////// return; } args.Mobile = newChar; m_Mobile = newChar; newChar.Player = true; newChar.AccessLevel = args.Account.AccessLevel; newChar.Female = args.Female; //newChar.Body = newChar.Female ? 0x191 : 0x190; if( Core.Expansion >= args.Race.RequiredExpansion ) newChar.Race = args.Race; //Sets body else newChar.Race = Race.DefaultRace; //newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000; newChar.Hue = newChar.Race.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000; newChar.Hunger = 20; newChar.Skills.Cap = (10000); newChar.StatCap = 300; bool young = false; if ( newChar is PlayerMobile ) { PlayerMobile pm = (PlayerMobile) newChar; pm.Profession = args.Profession; #region NeoLevelSystem // Neo's Level SYstem pm.Exp = -1000; pm.Level = 0; #endregion // End of Neo's Level System if ( pm.AccessLevel == AccessLevel.Player && ((Account)pm.Account).Young ) young = pm.Young = true; } SetName( newChar, args.Name ); AddBackpack( newChar ); SetStats( newChar, state, args.Str, args.Dex, args.Int ); //SetStats( newChar, args.Str, args.Dex, args.Int ); SetSkills( newChar, args.Skills, args.Profession ); Race race = newChar.Race; if( race.ValidateHair( newChar, args.HairID ) ) { newChar.HairItemID = args.HairID; newChar.HairHue = race.ClipHairHue( args.HairHue & 0x3FFF ); } if( race.ValidateFacialHair( newChar, args.BeardID ) ) { newChar.FacialHairItemID = args.BeardID; newChar.FacialHairHue = race.ClipHairHue( args.BeardHue & 0x3FFF ); } if ( args.Profession <= 3 ) { AddShirt( newChar, args.ShirtHue ); AddPants( newChar, args.PantsHue ); AddShoes( newChar ); } //if( TestCenter.Enabled ) FillBankbox( newChar ); /*if ( young ) { NewPlayerTicket ticket = new NewPlayerTicket(); ticket.Owner = newChar; newChar.BankBox.DropItem( ticket ); }*/ // CityInfo city = GetStartLocation( args, young ); CityInfo city = new CityInfo( "New Player Castle", "New Player Castle", 885, 1408,-84, Map.Malas ); newChar.MoveToWorld( city.Location, city.Map ); Console.WriteLine( "Login: {0}: New character being created (account={1})", state, args.Account.Username );///////////// Console.WriteLine( " - Character: {0} (serial={1})", newChar.Name, newChar.Serial ); Console.WriteLine( " - Started: {0} {1} in {2}", city.City, city.Location, city.Map.ToString() ); new WelcomeTimer( newChar ).Start(); newChar.StatCap = 300; newChar.SkillsCap = 10000; }
private static void EventSink_CharacterCreated(CharacterCreatedEventArgs args) { NetState state = args.State; var acct = args.Account as Account; Mobile newChar = CreateMobile(acct); if (newChar == null) { Console.WriteLine("Login: {0}: Character creation failed, account full", args.State); return; } args.Mobile = newChar; m_Mobile = newChar; newChar.Player = true; newChar.AccessLevel = args.Account.AccessLevel; bool young = false; if (newChar is PlayerMobile) { var pm = (PlayerMobile)newChar; if (pm.AccessLevel == AccessLevel.Player && ((Account)pm.Account).Young) { young = pm.Young = true; } } //CityInfo city = GetStartLocation(args, young); var city = new CityInfo("Britain", "Forever", 1495, 1628, 10, Map.Felucca); if (!VerifyProfession(args.Profession, city.Map.Expansion)) { args.Profession = 0; } if (newChar is PlayerMobile) { ((PlayerMobile)newChar).Profession = args.Profession; } newChar.Female = args.Female; //newChar.Body = newChar.Female ? 0x191 : 0x190; newChar.Race = city.Map.Expansion >= args.Race.RequiredExpansion ? args.Race : Race.DefaultRace; //newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000; newChar.Hue = newChar.Race.ClipSkinHue(args.Hue & 0x3FFF) | 0x8000; newChar.Hunger = 20; newChar.Thirst = 20; //NameResultMessage result = SetName(newChar, args.Name); SetName(newChar, args.Name); AddBackpack(newChar, city.Map.Expansion); SetStats(newChar, state, args.Str, args.Dex, args.Int); SetSkills(newChar, city.Map.Expansion, args.Skills, args.Profession); Race race = newChar.Race; if (race.ValidateHair(newChar, args.HairID)) { newChar.HairItemID = args.HairID; newChar.HairHue = race.ClipHairHue(args.HairHue & 0x3FFF); } if (race.ValidateFacialHair(newChar, args.BeardID)) { newChar.FacialHairItemID = args.BeardID; newChar.FacialHairHue = race.ClipHairHue(args.BeardHue & 0x3FFF); } if (args.Profession <= 3) { AddShirt(newChar, args.ShirtHue, city.Map.Expansion); AddPants(newChar, args.PantsHue, city.Map.Expansion); AddShoes(newChar, city.Map.Expansion); } BankBox bank = newChar.BankBox; bool needstartpack = acct != null && String.IsNullOrEmpty(acct.GetTag("startpack")); if (needstartpack /*|| TestCenter.Enabled*/) { Container startpack = new StarterPack(); bank.DropItem(startpack); /* Item housedeed = new SmallBrickHouseDeed(); housedeed.Name = "a beta tester's small brick house deed"; startpack.DropItem(housedeed); housedeed.X = 23; housedeed.Y = 53; Item startercheck = new BankCheck(10000); startpack.DropItem(startercheck); startercheck.X = 52; startercheck.Y = 36; */ acct.SetTag("startpack", "true"); } if (young) { bank.DropItem( new NewPlayerTicket { Owner = newChar }); } newChar.MoveToWorld(city.Location, city.Map); LogIPAccess(args.State.Address, acct, newChar); Console.WriteLine("Login: {0}: New character being created (account={1})", args.State, args.Account.Username); Console.WriteLine(" - Character: {0} (serial={1})", newChar.Name, newChar.Serial); Console.WriteLine(" - Started: {0} {1} in {2}", city.City, city.Location, city.Map); new WelcomeTimer(newChar).Start(); /*if (result != NameResultMessage.Allowed) { newChar.SendGump(new NameChangeGump(newChar, result, args.Name)); }*/ }
public CharacterCreatedEventArgs( NetState state, IAccount a, string name, bool female, int hue, int str, int dex, int intel, CityInfo city, SkillNameValue[] skills, int shirtHue, int pantsHue, int hairID, int hairHue, int beardID, int beardHue, int profession, Race race) : this(state, a, name, female, hue, str, dex, intel, city, skills, shirtHue, pantsHue, hairID, hairHue, beardID, beardHue, profession, race, 0, 0) { }
public CharacterList(IAccount a, CityInfo[] info) : base(0xA9) { EnsureCapacity(11 + (a.Length * 60) + (info.Length * 89)); int highSlot = -1; for (int i = 0; i < a.Length; ++i) { if (a[i] != null) { highSlot = i; } } int count = Math.Max(Math.Max(highSlot + 1, a.Limit), 5); m_Stream.Write((byte)count); for (int i = 0; i < count; ++i) { if (a[i] != null) { m_Stream.WriteAsciiFixed(a[i].Name, 30); m_Stream.Fill(30); // password } else { m_Stream.Fill(60); } } m_Stream.Write((byte)info.Length); for (int i = 0; i < info.Length; ++i) { CityInfo ci = info[i]; m_Stream.Write((byte)i); m_Stream.WriteAsciiFixed(ci.City, 32); m_Stream.WriteAsciiFixed(ci.Building, 32); m_Stream.Write(ci.X); m_Stream.Write(ci.Y); m_Stream.Write(ci.Z); m_Stream.Write(ci.Map.MapID); m_Stream.Write(ci.Description); m_Stream.Write(0); } CharacterListFlags flags = ExpansionInfo.CurrentExpansion.CharacterListFlags; if (count > 6) { flags |= (CharacterListFlags.SeventhCharacterSlot | CharacterListFlags.SixthCharacterSlot); } else if (count == 6) { flags |= CharacterListFlags.SixthCharacterSlot; // 6th Character Slot } else if (a.Limit == 1) { flags |= (CharacterListFlags.SlotLimit & CharacterListFlags.OneCharacterSlot); // Limit Characters & One Character } m_Stream.Write((int)(flags | m_AdditionalFlags)); // Additional Flags m_Stream.Write((short)-1); ThirdPartyFeature disabled = FeatureProtection.DisabledFeatures; if (disabled != 0) { if (m_MD5Provider == null) { m_MD5Provider = new MD5CryptoServiceProvider(); } m_Stream.UnderlyingStream.Flush(); byte[] hashCode = m_MD5Provider.ComputeHash( m_Stream.UnderlyingStream.GetBuffer(), 0, (int)m_Stream.UnderlyingStream.Length); var buffer = new byte[28]; for (int i = 0; i < count; ++i) { Utility.RandomBytes(buffer); m_Stream.Seek(35 + (i * 60), SeekOrigin.Begin); m_Stream.Write(buffer, 0, buffer.Length); } m_Stream.Seek(35, SeekOrigin.Begin); m_Stream.Write((int)((long)disabled >> 32)); m_Stream.Write((int)disabled); m_Stream.Seek(95, SeekOrigin.Begin); m_Stream.Write(hashCode, 0, hashCode.Length); } }
// Genova: suporte ao UO:KR. public CharacterList(IAccount a, CityInfo[] info, bool IsKrClient) : base(0xA9) { this.EnsureCapacity(9 + (a.Length * 60) + (info.Length * 63)); int highSlot = -1; for (int i = 0; i < a.Length; ++i) { if (a[i] != null) highSlot = i; } int count = Math.Max(Math.Max(highSlot + 1, a.Limit), 5); m_Stream.Write((byte)count); for (int i = 0; i < count; ++i) { if (a[i] != null) { m_Stream.WriteAsciiFixed(a[i].Name, 30); m_Stream.Fill(30); // password } else { m_Stream.Fill(60); } } m_Stream.Write((byte)info.Length); for (int i = 0; i < info.Length; ++i) { CityInfo ci = info[i]; m_Stream.Write((byte)i); m_Stream.WriteAsciiFixed(ci.City, 31); m_Stream.WriteAsciiFixed(ci.Building, 31); } /* int flags = 0x08; //Context Menus if ( Core.SE ) flags |= 0xA0; //SE & AOS else if ( Core.AOS ) flags |= 0x20; //AOS * */ int flags = ExpansionInfo.CurrentExpansion.CharacterListFlags; if (count >= 6) flags |= 0x40; // 6th character slot else if (a.Limit == 1) flags |= 0x14; // Limit characters & one character // Genova: suporte ao UO:KR. // Is KR Client if (IsKrClient) flags |= 0x600; // Still dont know. KR Flags. m_Stream.Write((int)(flags | m_AdditionalFlags)); // flags }
public CharacterListOld( IAccount a, CityInfo[] info ) : base(0xA9) { this.EnsureCapacity( 9 + (a.Length * 60) + (info.Length * 63) ); int highSlot = -1; for ( int i = 0; i < a.Length; ++i ) { if ( a[i] != null ) highSlot = i; } int count = Math.Max( Math.Max( highSlot + 1, a.Limit ), 5 ); m_Stream.Write( (byte) count ); for ( int i = 0; i < count; ++i ) { if ( a[i] != null ) { m_Stream.WriteAsciiFixed( a[i].Name, 30 ); m_Stream.Fill( 30 ); // password } else { m_Stream.Fill( 60 ); } } m_Stream.Write( (byte) info.Length ); for ( int i = 0; i < info.Length; ++i ) { CityInfo ci = info[i]; m_Stream.Write( (byte) i ); m_Stream.WriteAsciiFixed( ci.City, 31 ); m_Stream.WriteAsciiFixed( ci.Building, 31 ); } CharacterListFlags flags = ExpansionInfo.CurrentExpansion.CharacterListFlags; if ( count > 6 ) flags |= (CharacterListFlags.SeventhCharacterSlot | CharacterListFlags.SixthCharacterSlot); // 7th Character Slot - TODO: Is SixthCharacterSlot Required? else if ( count == 6 ) flags |= CharacterListFlags.SixthCharacterSlot; // 6th Character Slot else if ( a.Limit == 1 ) flags |= (CharacterListFlags.SlotLimit & CharacterListFlags.OneCharacterSlot); // Limit Characters & One Character m_Stream.Write( (int)(flags | CharacterList.AdditionalFlags) ); // Additional Flags ThirdPartyFeature disabled = FeatureProtection.DisabledFeatures; if ( disabled != 0 ) { if ( m_MD5Provider == null ) m_MD5Provider = new System.Security.Cryptography.MD5CryptoServiceProvider(); m_Stream.UnderlyingStream.Flush(); byte[] hashCode = m_MD5Provider.ComputeHash( m_Stream.UnderlyingStream.GetBuffer(), 0, (int) m_Stream.UnderlyingStream.Length ); byte[] buffer = new byte[28]; for ( int i = 0; i < count; ++i ) { Utility.RandomBytes( buffer ); m_Stream.Seek( 35 + ( i * 60 ), SeekOrigin.Begin ); m_Stream.Write( buffer, 0, buffer.Length ); } m_Stream.Seek( 35, SeekOrigin.Begin ); m_Stream.Write( (int) ((long)disabled>>32) ); m_Stream.Write( (int) disabled ); m_Stream.Seek( 95, SeekOrigin.Begin ); m_Stream.Write( hashCode, 0, hashCode.Length ); } }
// UOSA: suporte ao UO:KR. public CharacterList(IAccount a, CityInfo[] info, bool IsKrClient) : base(0xA9) { this.EnsureCapacity( 11 + (a.Length * 60) + (info.Length * 89) ); int highSlot = -1; for ( int i = 0; i < a.Length; ++i ) { if ( a[i] != null ) highSlot = i; } int count = Math.Max( Math.Max( highSlot + 1, a.Limit ), 5 ); m_Stream.Write( (byte) count ); for ( int i = 0; i < count; ++i ) { if ( a[i] != null ) { m_Stream.WriteAsciiFixed( a[i].Name, 30 ); m_Stream.Fill( 30 ); // password } else { m_Stream.Fill( 60 ); } } m_Stream.Write( (byte) info.Length ); for ( int i = 0; i < info.Length; ++i ) { CityInfo ci = info[i]; m_Stream.Write( (byte) i ); m_Stream.WriteAsciiFixed( ci.City, 32 ); m_Stream.WriteAsciiFixed( ci.Building, 32 ); m_Stream.Write( (int) ci.X ); m_Stream.Write( (int) ci.Y ); m_Stream.Write( (int) ci.Z ); m_Stream.Write( (int) ci.Map.MapID ); m_Stream.Write( (int) ci.Description ); m_Stream.Write( (int) 0 ); } CharacterListFlags flags = ExpansionInfo.CurrentExpansion.CharacterListFlags; if ( count > 6 ) flags |= (CharacterListFlags.SeventhCharacterSlot | CharacterListFlags.SixthCharacterSlot); // 7th Character Slot - TODO: Is SixthCharacterSlot Required? else if ( count == 6 ) flags |= CharacterListFlags.SixthCharacterSlot; // 6th Character Slot else if ( a.Limit == 1 ) flags |= (CharacterListFlags.SlotLimit & CharacterListFlags.OneCharacterSlot); // Limit Characters & One Character // Genova: suporte ao UO:KR. // Is KR Client if (IsKrClient) flags |= CharacterListFlags.KR; // Still dont know. KR Flags. m_Stream.Write( (int)(flags | m_AdditionalFlags) ); // Additional Flags }
public CharacterList( IAccount a, CityInfo[] info ) : base(0xA9) { this.EnsureCapacity( 9 + (a.Length * 60) + (info.Length * 63) ); int highSlot = -1; for ( int i = 0; i < a.Length; ++i ) { if ( a[i] != null ) highSlot = i; } int count = Math.Max( Math.Max( highSlot + 1, a.Limit ), 5 ); m_Stream.Write( (byte) count ); for ( int i = 0; i < count; ++i ) { if ( a[i] != null ) { m_Stream.WriteAsciiFixed( a[i].Name, 30 ); m_Stream.Fill( 30 ); // password } else { m_Stream.Fill( 60 ); } } m_Stream.Write( (byte) info.Length ); for ( int i = 0; i < info.Length; ++i ) { CityInfo ci = info[i]; m_Stream.Write( (byte) i ); m_Stream.WriteAsciiFixed( ci.City, 31 ); m_Stream.WriteAsciiFixed( ci.Building, 31 ); } /* int flags = 0x08; //Context Menus if ( Core.SE ) flags |= 0xA0; //SE & AOS else if ( Core.AOS ) flags |= 0x20; //AOS * */ int flags = ExpansionInfo.CurrentExpansion.CharacterListFlags; if ( count >= 6 ) flags |= 0x40; // 6th character slot else if ( a.Limit == 1 ) flags |= 0x14; // Limit characters & one character m_Stream.Write( (int)(flags | m_AdditionalFlags) ); // flags ThirdPartyFeature disabled = FeatureProtection.DisabledFeatures; if ( disabled != 0 ) { if ( m_MD5Provider == null ) m_MD5Provider = new System.Security.Cryptography.MD5CryptoServiceProvider(); m_Stream.UnderlyingStream.Flush(); byte[] hashCode = m_MD5Provider.ComputeHash( m_Stream.UnderlyingStream.GetBuffer(), 0, (int) m_Stream.UnderlyingStream.Length ); Random rnd = new Random(); byte[] buffer = new byte[29]; for ( int i = 0; i < count; ++i ) { rnd.NextBytes( buffer ); m_Stream.Seek( 34 + ( i * 60 ), SeekOrigin.Begin ); m_Stream.Write( buffer, 0, buffer.Length ); } m_Stream.Seek( 35, SeekOrigin.Begin ); m_Stream.Write( (int) ((long)disabled>>32) ); m_Stream.Write( (int) disabled ); m_Stream.Seek( 95, SeekOrigin.Begin ); m_Stream.Write( hashCode, 0, hashCode.Length ); } }
private static void EventSink_CharacterCreated( CharacterCreatedEventArgs args ) { if ( !VerifyProfession( args.Profession ) ) args.Profession = 0; Mobile newChar = CreateMobile( args.Account as Account ); if ( newChar == null ) { Console.WriteLine( "Login: {0}: Character creation failed, account full", args.State ); return; } args.Mobile = newChar; m_Mobile = newChar; newChar.Player = true; newChar.AccessLevel = args.Account.AccessLevel; newChar.Female = args.Female; //newChar.Body = newChar.Female ? 0x191 : 0x190; if( Core.Expansion >= args.Race.RequiredExpansion ) newChar.Race = args.Race; //Sets body else newChar.Race = Race.DefaultRace; //newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000; newChar.Hue = newChar.Race.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000; newChar.Hunger = 20; bool young = false; if ( newChar is PlayerMobile ) { PlayerMobile pm = (PlayerMobile) newChar; pm.Profession = args.Profession; if ( pm.AccessLevel == AccessLevel.Player && ((Account)pm.Account).Young ) young = pm.Young = true; } SetName( newChar, args.Name ); AddBackpack( newChar ); SetStats( newChar, args.Str, args.Dex, args.Int ); SetSkills( newChar, args.Skills, args.Profession ); Race race = newChar.Race; if( race.ValidateHair( newChar, args.HairID ) ) { newChar.HairItemID = args.HairID; newChar.HairHue = race.ClipHairHue( args.HairHue & 0x3FFF ); } if( race.ValidateFacialHair( newChar, args.BeardID ) ) { newChar.FacialHairItemID = args.BeardID; newChar.FacialHairHue = race.ClipHairHue( args.BeardHue & 0x3FFF ); } if ( args.Profession <= 3 ) { AddShirt( newChar, args.ShirtHue ); AddPants( newChar, args.PantsHue ); AddShoes( newChar ); } if( TestCenter.Enabled ) FillBankbox( newChar ); if ( young ) { NewPlayerTicket ticket = new NewPlayerTicket(); ticket.Owner = newChar; newChar.BankBox.DropItem( ticket ); } //Because Malas is the only real map :D CityInfo city = new CityInfo("Luna", "Starting Point", 883, 532, -90, Map.Malas); //CityInfo city = GetStartLocation( args, young ); //CityInfo city = new CityInfo( "Britain", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca ); newChar.MoveToWorld( city.Location, city.Map ); Console.WriteLine( "Login: {0}: New character being created (account={1})", args.State, args.Account.Username ); Console.WriteLine( " - Character: {0} (serial={1})", newChar.Name, newChar.Serial ); Console.WriteLine( " - Started: {0} {1} in {2}", city.City, city.Location, city.Map.ToString() ); new WelcomeTimer( newChar ).Start(); }
public static void Initialize() { //#warning This should be get rid off when the shard goes live //LockdownLevel = AccessLevel.GameMaster; EventSink.DeleteRequest += new DeleteRequestEventHandler( EventSink_DeleteRequest ); EventSink.AccountLogin += new AccountLoginEventHandler( EventSink_AccountLogin ); EventSink.GameLogin += new GameLoginEventHandler( EventSink_GameLogin ); if ( PasswordCommandEnabled ) Server.Commands.CommandSystem.Register( "Password", AccessLevel.Player, new Server.Commands.CommandEventHandler( Password_OnCommand ) ); if ( Core.AOS ) { CityInfo haven = new CityInfo( "Haven", "Uzeraan's Mansion", 3618, 2591, 0 ); StartingCities[StartingCities.Length - 1] = haven; } }
public static void Initialize() { EventSink.DeleteRequest += new DeleteRequestEventHandler( EventSink_DeleteRequest ); EventSink.AccountLogin += new AccountLoginEventHandler( EventSink_AccountLogin ); EventSink.GameLogin += new GameLoginEventHandler( EventSink_GameLogin ); if ( PasswordCommandEnabled ) CommandSystem.Register( "Password", AccessLevel.Player, new CommandEventHandler( Password_OnCommand ) ); if ( Core.AOS ) { //CityInfo haven = new CityInfo( "Haven", "Uzeraan's Mansion", 3618, 2591, 0 ); CityInfo haven = new CityInfo( "Haven", "Uzeraan's Mansion", 3503, 2574, 14 ); StartingCities[StartingCities.Length - 1] = haven; } // added for login server to let players in heh. PacketHandlers.ClientVerification = false; // end ------ }
public CharacterListHS( IAccount a, CityInfo[] info ) : base(0xA9) { this.EnsureCapacity( 311 + ( info.Length * 89 ) ); int highSlot = -1; for ( int i = 0; i < a.Length; ++i ) { if ( a[i] != null ) highSlot = i; } int slotCount = Math.Max( Math.Max( highSlot + 1, a.Limit ), 5 ); m_Stream.Write( (byte) slotCount ); for ( int i = 0; i < slotCount; ++i ) { if ( a[i] != null ) { m_Stream.WriteAsciiFixed( a[i].Name, 30 ); m_Stream.Fill( 30 ); // password } else { m_Stream.Fill( 60 ); } } m_Stream.Write( (byte) info.Length ); for ( int i = 0; i < info.Length; ++i ) { CityInfo ci = info[i]; m_Stream.Write( (byte) i ); m_Stream.WriteAsciiFixed( ci.City, 32 ); m_Stream.WriteAsciiFixed( ci.Building, 32 ); m_Stream.Write( (int) ci.X ); m_Stream.Write( (int) ci.Y ); m_Stream.Write( (int) ci.Z ); m_Stream.Write( (int) ci.Map.MapID ); m_Stream.Write( (int) ci.Cliloc ); m_Stream.Write( (int) 0 ); } m_Stream.Write( (int) ( CharacterList.GetFlags( slotCount ) ) ); // flags m_Stream.Write( (short) -1 ); }
private static void EventSink_CharacterCreated( CharacterCreatedEventArgs args ) { if ( !VerifyProfession( args.Profession ) ) args.Profession = 0; Mobile newChar = CreateMobile( args.Account as Account ); if ( newChar == null ) { Console.WriteLine( "Login: {0}: Character creation failed, account full", args.State ); return; } args.Mobile = newChar; m_Mobile = newChar; // newChar.Player = true; newChar.AccessLevel = ((Account)args.Account).AccessLevel; newChar.Female = args.Female; newChar.Body = newChar.Female ? 0x191 : 0x190; newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000; newChar.Hunger = 20; bool young = false; if ( newChar is PlayerMobile ) { PlayerMobile pm = (PlayerMobile) newChar; pm.Profession = args.Profession; if ( pm.AccessLevel == AccessLevel.Player && ((Account)pm.Account).Young ) young = pm.Young = true; } SetName( newChar, args.Name ); AddBackpack( newChar ); SetStats( newChar, args.Str, args.Dex, args.Int ); SetSkills( newChar, args.Skills, args.Profession ); AddHair( newChar, args.HairID, Utility.ClipHairHue( args.HairHue & 0x3FFF ) ); AddBeard( newChar, args.BeardID, Utility.ClipHairHue( args.BeardHue & 0x3FFF ) ); if ( args.Profession <= 3 ) { AddShirt( newChar, args.ShirtHue ); AddPants( newChar, args.PantsHue ); AddShoes( newChar ); } if( TestCenter.Enabled ) FillBankbox( newChar ); if ( young ) { PackItem( new NewPlayerBook() ); } if ( young && newChar.BankBox != null ) { NewerPlayerTicket ticket = new NewerPlayerTicket(); ticket.Owner = newChar; newChar.BankBox.DropItem( new Spellbook( UInt64.MaxValue ) );//Al: Fix for unblessed spellbook newChar.BankBox.DropItem( ticket ); newChar.BankBox.DropItem( MakeNewbie( new BlackPearl( 30 ) ) ); newChar.BankBox.DropItem( MakeNewbie( new Bloodmoss( 30 ) ) ); newChar.BankBox.DropItem( MakeNewbie( new Garlic( 30 ) ) ); newChar.BankBox.DropItem( MakeNewbie( new Ginseng( 30 ) ) ); newChar.BankBox.DropItem( MakeNewbie( new MandrakeRoot( 30 ) ) ); newChar.BankBox.DropItem( MakeNewbie( new Nightshade( 30 ) ) ); newChar.BankBox.DropItem( MakeNewbie( new SulfurousAsh( 30 ) ) ); newChar.BankBox.DropItem( MakeNewbie( new SpidersSilk( 30 ) ) ); } //Al: personalized skill/statsball for wiped veteran accounts if ( newChar.Account is Account && ((Account)newChar.Account).CharacterCount == 1 && (DateTime.Now - ((Account)newChar.Account).Created) >= TimeSpan.FromDays(10000) ) { int skillballsReceived; try { skillballsReceived = Int32.Parse(((Account)newChar.Account).GetTag("WelcomeBackSkillballsReceived")); } catch { skillballsReceived = 0; } if (skillballsReceived < MAXIMUM_WELCOME_BACK_SKILLBALLS) { ((Account)newChar.Account).SetTag("WelcomeBackSkillballsReceived", (++skillballsReceived).ToString()); newChar.AddToBackpack(new WelcomeBackSkillball(newChar)); newChar.AddToBackpack(new NewPlayerStatsBall(newChar)); } } //CityInfo city = GetStartLocation( args, young ); � CityInfo city = new CityInfo( "Young Town", "Young Town Entrance", 1243, 1193, -29, Map.Ilshenar ); // Added 2011-Feb-06 //CityInfo city = new CityInfo( "Britain", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca ); //**** ADDED FOR 1ST MARCH SPECIAL //if (newChar.Account.Count <= 1 /*|| (GetSharedAccounts((newChar.Account as Account).LoginIPs)).Count <= 1*/) //{ // city = new CityInfo("Newbie City", "Start room", 5738, 797, 0, Map.Felucca); //} //**** END 1ST MARCH SPECIAL newChar.MoveToWorld( city.Location, city.Map ); Console.WriteLine( "Login: {0}: New character being created (account={1})", args.State, ((Account)args.Account).Username ); Console.WriteLine( " - Character: {0} (serial={1})", newChar.Name, newChar.Serial ); Console.WriteLine( " - Started: {0} {1} in {2}", city.City, city.Location, city.Map.ToString() ); //new WelcomeTimer( newChar ).Start(); //This has to be done here and not in a separate CharacterCreated-Event to get a reference to the new PlayerMobile //Player can set the email address till exactly 24 hours after account creation. if ( newChar.Account is Account && (DateTime.Now - ((Account)newChar.Account).Created <= TimeSpan.FromHours(24))) Timer.DelayCall(TimeSpan.FromSeconds(5), new TimerStateCallback(EmailSystem.SendEmailGump), newChar as PlayerMobile); }
private CityInfo getLocalizacao(string nomeLocal) { CityInfo local; if (nomeLocal == "padrao") { local = new CityInfo("Ouro Branco", "Barco", 1385, 579, 32, Map.Malas); } else if (nomeLocal == "ouroBranco") { local = new CityInfo("Ouro Branco", "Igreja", 1652, 591, 6, Map.Malas); } else if (nomeLocal == "loboLeite") { local = new CityInfo("Lobo leite", "Barco", 1385, 579, 32, Map.Malas); } else { local = new CityInfo("Ouro Branco", "Barco", 1385, 579, 32, Map.Malas); } return local; }
public CharacterCreatedEventArgs( NetState state, IAccount a, string name, bool female, int hue, int str, int dex, int intel, CityInfo city, SkillNameValue[] skills, int shirtHue, int pantsHue, int hairID, int hairHue, int beardID, int beardHue, int profession, Race race ) { m_State = state; m_Account = a; m_Name = name; m_Female = female; m_Hue = hue; m_Str = str; m_Dex = dex; m_Int = intel; m_City = city; m_Skills = skills; m_ShirtHue = shirtHue; m_PantsHue = pantsHue; m_HairID = hairID; m_HairHue = hairHue; m_BeardID = beardID; m_BeardHue = beardHue; m_Profession = profession; m_Race = race; }
private static void EventSink_CharacterCreated( CharacterCreatedEventArgs args ) { Mobile newChar = CreateMobile( args.Account as Account ); if ( newChar == null ) { Console.WriteLine( "Login: {0}: Character creation failed, account full", args.State ); return; } args.Mobile = newChar; m_Mobile = newChar; newChar.Player = true; newChar.AccessLevel = ((Account)args.Account).AccessLevel; newChar.Female = args.Female; newChar.Body = newChar.Female ? 0x191 : 0x190; newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000; newChar.Hunger = 20; if ( newChar is PlayerMobile ) ((PlayerMobile)newChar).Profession = args.Profession; //Pix: default to warrior if chosen is paladin, necro, etc. if( ((PlayerMobile)newChar).Profession > 3 ) ((PlayerMobile)newChar).Profession = 1; SetName( newChar, args.Name ); AddBackpack( newChar ); SetStats( newChar, args.Str, args.Dex, args.Int ); SetSkills( newChar, args.Skills, args.Profession ); AddHair( newChar, args.HairID, Utility.ClipHairHue( args.HairHue & 0x3FFF ) ); AddBeard( newChar, args.BeardID, Utility.ClipHairHue( args.BeardHue & 0x3FFF ) ); if ( !Core.AOS || (args.Profession != 4 && args.Profession != 5) ) { AddShirt( newChar, args.ShirtHue ); AddPants( newChar, args.PantsHue ); AddShoes( newChar ); } if (TestCenter.Enabled) FillBankbox( newChar ); /* * Our numbers have been so low lately (< 50), it's once again important * to concentrate playerss so that they do not log into what seems to be an empty shard. * We can stem the griefing by: * 1. Changing the look of starting players (remove noob look) * 2. Have a wider entry area * 3. Have them 'Recall in' so they look like they've been here for a while * 4. Give them a 1 minute 'young' status? */ //Comment out the following line to let the player choose where to start. CityInfo city; // = args.City; Map spawnMap = Map.Felucca; //Comment out the following line to have them always start at Brit Inn //CityInfo city = new CityInfo( "Britain", "Sweet Dreams Inn", 1496, 1628, 10 ); // this NewPlayerStartingArea probably needs to be based on IP address and account age etc. if (CoreAI.IsDynamicFeatureSet(CoreAI.FeatureBits.NewPlayerStartingArea)) { city = new CityInfo("New Player Starting Area", "Starting Area", 5731, 953, 0); spawnMap = Map.Trammel; } else { //if( city.City == "Britain" ) { Point3D p = NewCharacterSpawnLocation(); city = new CityInfo("Britain", "West Brit Bank", p.X, p.Y, p.Z ); } } newChar.MoveToWorld(city.Location, spawnMap); Console.WriteLine( "Login: {0}: New character being created (account={1})", args.State, ((Account)args.Account).Username ); Console.WriteLine( " - Character: {0} (serial={1})", newChar.Name, newChar.Serial ); Console.WriteLine( " - Started: {0} {1}", city.City, city.Location ); new WelcomeTimer( newChar ).Start(); }
public CharacterListOld( IAccount a, CityInfo[] info ) : base(0xA9) { this.EnsureCapacity( 9 + (a.Length * 60) + (info.Length * 63) ); int highSlot = -1; for ( int i = 0; i < a.Length; ++i ) { if ( a[i] != null ) highSlot = i; } int count = Math.Max( Math.Max( highSlot + 1, a.Limit ), 5 ); m_Stream.Write( (byte) count ); for ( int i = 0; i < count; ++i ) { if ( a[i] != null ) { m_Stream.WriteAsciiFixed( a[i].Name, 30 ); m_Stream.Fill( 30 ); // password } else { m_Stream.Fill( 60 ); } } m_Stream.Write( (byte) info.Length ); for ( int i = 0; i < info.Length; ++i ) { CityInfo ci = info[i]; m_Stream.Write( (byte) i ); m_Stream.WriteAsciiFixed( ci.City, 31 ); m_Stream.WriteAsciiFixed( ci.Building, 31 ); } CharacterListFlags flags = ExpansionInfo.CurrentExpansion.CharacterListFlags; if ( count > 6 ) flags |= (CharacterListFlags.SeventhCharacterSlot | CharacterListFlags.SixthCharacterSlot); // 7th Character Slot - TODO: Is SixthCharacterSlot Required? else if ( count == 6 ) flags |= CharacterListFlags.SixthCharacterSlot; // 6th Character Slot else if ( a.Limit == 1 ) flags |= (CharacterListFlags.SlotLimit & CharacterListFlags.OneCharacterSlot); // Limit Characters & One Character m_Stream.Write( (int)(flags | CharacterList.AdditionalFlags) ); // Additional Flags }
private static void EventSink_CharacterCreated( CharacterCreatedEventArgs args ) { if( !VerifyProfession( args.Profession ) ) args.Profession = 0; NetState state = args.State; if (state == null) return; Mobile newChar = CreateMobile( args.Account as Account ); if( newChar == null ) { Console.WriteLine("Login: {0}: Character creation failed, account full", state); return; } args.Mobile = newChar; m_Mobile = newChar; newChar.Player = true; newChar.AccessLevel = args.Account.AccessLevel; newChar.Female = args.Female; //newChar.Body = newChar.Female ? 0x191 : 0x190; if( Core.Expansion >= args.Race.RequiredExpansion ) newChar.Race = args.Race; //Sets body else newChar.Race = Race.DefaultRace; //newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000; newChar.Hue = newChar.Race.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000; newChar.Hunger = 20; bool young = false; PlayerMobile pm = null; if( newChar is PlayerMobile ) { pm = (PlayerMobile)newChar; pm.Profession = args.Profession; if( pm.AccessLevel == AccessLevel.Player && ((Account)pm.Account).Young ) young = pm.Young = true; #region Nasir - Set Original Values For RaceReset pm.OriginalHairHue = args.HairHue; pm.OriginalHairItemID = args.HairID; pm.OriginalHue = args.Hue; #endregion } SetName( newChar, args.Name ); //We use player backpacks on INX Container pB = new PlayerBackpack(newChar); pB.Movable = false; newChar.AddItem(pB); AddBackpack( newChar ); //SetStats(newChar, state, 100, 100, 100); //SetSkills( newChar, args.Skills, args.Profession ); // Max stats newChar.Str = 100; newChar.Int = 100; newChar.Dex = 100; newChar.Hits = 100; newChar.Mana = 100; newChar.Stam = 100; Race race = newChar.Race; if( race.ValidateHair( newChar, args.HairID ) ) { newChar.HairItemID = args.HairID; newChar.HairHue = race.ClipHairHue( args.HairHue & 0x3FFF ); } if( race.ValidateFacialHair( newChar, args.BeardID ) ) { newChar.FacialHairItemID = args.BeardID; newChar.FacialHairHue = race.ClipHairHue( args.BeardHue & 0x3FFF ); } /* if( args.Profession <= 3 ) { AddShirt( newChar, args.ShirtHue ); AddPants( newChar, args.PantsHue ); AddShoes( newChar ); } */ if( TestCenter.Enabled ) FillBankbox( newChar ); if( young) { NewPlayerTicket ticket = new NewPlayerTicket(); ticket.Owner = newChar; newChar.BankBox.DropItem( ticket ); } //IN:X Settings newChar.EquipItem( new XtremePlateChest()); newChar.EquipItem( new XtremePlateArms()); newChar.EquipItem( new XtremePlateGloves()); newChar.EquipItem( new XtremePlateGorget()); newChar.EquipItem( new XtremePlateHelm()); newChar.EquipItem( new XtremePlateLegs()); newChar.EquipItem( new Bardicheofvanquishing()); newChar.EquipItem( new Doublet(0x47e)); newChar.EquipItem( new Skirt(0x47e)); newChar.EquipItem( new HalfApron(2535)); newChar.StatCap = 300; newChar.SkillsCap = 54000; //Iza - changed from 52000 to 54000 for proper all skills cap. Server.Skills skills = newChar.Skills; for ( int i = 0; i < skills.Length; ++i ) skills[i].Base = 100f; //CityInfo city = GetStartLocation( args, false ); CityInfo city = new CityInfo("Green Acres", "Duel Pit", 5705, 1131, 0, Map.Felucca); newChar.MoveToWorld( city.Location, city.Map ); pB.Movable = false; newChar.AddItem(pB); /* AddShirt(newChar, args.ShirtHue); AddPants(newChar, args.PantsHue); AddShoes(newChar); AddBackpack(newChar); */ //if ((newChar.Account).AccessLevel <= AccessLevel.GameMaster) //{ // (newChar).AccessLevel = AccessLevel.GameMaster; // (newChar.Account).AccessLevel = AccessLevel.GameMaster; //} //Unicode//ASCII speech Account acct = newChar.Account as Account; if( pm != null && acct != null && acct.HardwareInfo != null ) { string lang = acct.HardwareInfo.Language.ToUpper(); //Ugliness...list.Contains()? if( lang.Equals( "ENG" ) || lang.Equals( "ENA" ) || lang.Equals( "ENC" ) || lang.Equals( "ENZ" ) || lang.Equals( "ENT" ) || lang.Equals( "ENU" ) || lang.Equals( "ENI" ) || lang.Equals( "ENW" ) || lang.Equals( "ENI" ) || lang.Equals( "ENS" ) || lang.Equals( "ENJ" ) || lang.Equals( "ENB" ) || lang.Equals( "ENL" ) || lang.Equals( "ENP" ) ) pm.UseUnicodeSpeech = false; else pm.UseUnicodeSpeech = true; } else if( pm != null ) pm.UseUnicodeSpeech = true; Console.WriteLine("Login: {0}: New character being created (account={1})", state, args.Account.Username); Console.WriteLine(" - Character: {0} (serial={1})", newChar.Name, newChar.Serial); Console.WriteLine( " - Started: {0} {1} in {2}", city.City, city.Location, city.Map ); // BetaChar( newChar ); // new WelcomeTimer( newChar ).Start(); }
public CharacterList( IAccount a, CityInfo[] info ) : base(0xA9) { this.EnsureCapacity( 309 + (info.Length * 63) ); int highSlot = -1; for ( int i = 0; i < a.Length; ++i ) { if ( a[i] != null ) highSlot = i; } int count = Math.Max( Math.Max( highSlot + 1, a.Limit ), 5 ); m_Stream.Write( (byte) count ); for ( int i = 0; i < count; ++i ) { if ( a[i] != null ) { m_Stream.WriteAsciiFixed( a[i].Name, 30 ); m_Stream.Fill( 30 ); // password } else { m_Stream.Fill( 60 ); } } m_Stream.Write( (byte) info.Length ); for ( int i = 0; i < info.Length; ++i ) { CityInfo ci = info[i]; m_Stream.Write( (byte) i ); m_Stream.WriteAsciiFixed( ci.City, 31 ); m_Stream.WriteAsciiFixed( ci.Building, 31 ); } int flags = 0x08; //Context Menus if ( Core.SE ) flags |= 0xA0; //SE & AOS else if ( Core.AOS ) flags |= 0x20; //AOS if ( count >= 6 ) flags |= 0x40; // 6th character slot else if ( count == 1 ) flags |= 0x14; // Limit characters & one character m_Stream.Write( (int)(flags | m_AdditionalFlags) ); // flags }
private void teleportarParaCidade() { CityInfo cidadeInicial = new CityInfo( "Ouro Branco", "Estrada real", 1605, 672, 0, Map.Malas ); jogador.MoveToWorld( cidadeInicial.Location, cidadeInicial.Map ); }