Exemplo n.º 1
0
        private static void EventSink_CharacterCreated(CharacterCreatedEventArgs args)
        {
            PlayerMobile pm = (PlayerMobile)args.Mobile;

            new WelcomeTimer(pm).Start();
            Timer.DelayCall(TimeSpan.FromSeconds(1.0), () => { FillBankbox(pm); });
        }
Exemplo n.º 2
0
        private static void EventSink_CharacterCreated(CharacterCreatedEventArgs args)
        {
            PlayerMobile pm = (PlayerMobile)args.Mobile;

            new WelcomeTimer(pm).Start();
            Timer.DelayCall(TimeSpan.FromSeconds(1.0), () => { FillBankbox(pm); });
        }
Exemplo n.º 3
0
        public static void NewPlayerItems(CharacterCreatedEventArgs e)
        {
            Mobile m_mobile = e.Mobile;

            m_mobile.BankBox.DropItem(new BankCheck(5000));
            m_mobile.BankBox.DropItem(new BagOfAllReagents(10));
        }
Exemplo n.º 4
0
        private static void EventSink_CharacterCreated(CharacterCreatedEventArgs args)
        {
            Mobile from = args.Mobile;

            if (from != null)
            {
                XmlAttach.AttachTo(from, new XmlReferralRewards());
            }
        }
Exemplo n.º 5
0
	    private static void EventSink_CharacterCreated(CharacterCreatedEventArgs args)
	    {
	        Mobile from = args.Mobile;

	        if (from != null)
	        {
                XmlAttach.AttachTo(from, new XmlReferralRewards());
	        }
	    }
Exemplo n.º 6
0
        private static CityInfo GetStartLocation(CharacterCreatedEventArgs args, bool isYoung)
        {
            bool useHaven = isYoung;

            ClientFlags flags = args.State == null ? ClientFlags.None : args.State.Flags;
            Mobile      m     = args.Mobile;

            return(args.City);
        }
Exemplo n.º 7
0
 /// Edit by Orbit Storm
 /// <summary>
 /// On new player login, broadcast a message.
 /// </summary>
 public static void EventSink_CharacterCreated(CharacterCreatedEventArgs e)
 {
     if (e.Mobile != null)
     {
         if (e.Mobile.AccessLevel == AccessLevel.Player)
         {
             CommandHandlers.BroadcastMessage(AccessLevel.Player, m_NewPlayerHue, String.Format(m_NewPlayerMessage, e.Mobile.Name));
         }
     }
 }
Exemplo n.º 8
0
        void GameServiceOnCharacterCreated(object sender, CharacterCreatedEventArgs e)
        {
            if (InvokeRequired)
            {
                Invoke((Action)(() => GameServiceOnCharacterCreated(sender, e)));
                return;
            }

            Reset();
        }
Exemplo n.º 9
0
 void EventSink_CharacterCreated(CharacterCreatedEventArgs e)
 {
     if (e.Mobile != null)
     {
         if (e.Mobile.AccessLevel == AccessLevel.Player)
         {
             connection.Sender.PublicMessage(chatChannel, String.Format("5{0} has just arrived in Comraich!", e.Mobile.RawName));
             CommandHandlers.BroadcastMessage(AccessLevel.Player, announcementHue, String.Format("{0} has just arrived in Comraich!", e.Mobile.RawName));
         }
     }
 }
Exemplo n.º 10
0
        private static void EventSink_CharacterCreated(CharacterCreatedEventArgs e)
        {
            Pause pauseatt = (Pause)XmlAttach.FindAttachment(e.Mobile, typeof(Pause));

            if (pauseatt == null)
            {
                XmlAttach.AttachTo(e.Mobile, new Pause());

                return;
            }
        }
        private static void EventSink_CharacterCreated(CharacterCreatedEventArgs args)
        {
            NetState state = args.State;

            if (state == null)
            {
                return;
            }

            HandleCharacterCreation(args);
        }
Exemplo n.º 12
0
        private void Game_CharacterCreated(object sender, CharacterCreatedEventArgs e)
        {
            if (!Config.Enabled)
            {
                return;
            }

            Logger.Info($"A new character was created. Auto splits enabled for {e.Character.Name}");
            ResetAutoSplits();
            keyService.TriggerHotkey(Config.ResetHotkey.ToKeys());
        }
Exemplo n.º 13
0
        private static void OnCreate(CharacterCreatedEventArgs args)
        {
            if (args.Mobile == null)
            {
                return;
            }

            Data data = Data.GetData(args.Mobile);

            foreach (Channel c in Channel.Channels)
            {
                if (c.NewChars)
                {
                    c.Join(args.Mobile);
                }
            }
        }
Exemplo n.º 14
0
        private static CityInfo GetStartLocation(CharacterCreatedEventArgs args, bool isYoung)
        {
            switch (args.Profession)
            {
            case 4:                     //Necro
            {
                return(new CityInfo("Umbra", "Mardoth's Tower", 2114, 1301, -50, Map.Malas));
            }

            case 5:                     //Paladin
            {
                return(new CityInfo("Haven", "Uzeraan's Mansion", 3578, 2589, 0, Map.Trammel));
            }

            case 6:                     //Samurai
            {
                return(new CityInfo("Samurai DE", "Haoti's Grounds", 368, 780, -1, Map.Malas));
            }

            case 7:                     //Ninja
            {
                return(new CityInfo("Ninja DE", "Enimo's Residence", 414, 823, -1, Map.Malas));
            }

            default:
            {
                if (isYoung)
                {
                    return(new CityInfo("Haven", "Uzeraan's Mansion", 3582, 2587, 0, Map.Trammel));
                }
                else
                {
                    return(args.City);
                }
            }
            }
        }
Exemplo n.º 15
0
        private static CityInfo GetStartLocation(CharacterCreatedEventArgs args, bool isYoung)
        {
            switch (args.Profession)
            {
            case 4:                     //Necro
            {
                return(new CityInfo("Britian", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca));
            }

            case 5:                     //Paladin
            {
                return(new CityInfo("Britian", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca));
            }

            case 6:                     //Samurai
            {
                return(new CityInfo("Britian", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca));
            }

            case 7:                     //Ninja
            {
                return(new CityInfo("Britian", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca));
            }

            default:
            {
                if (isYoung)
                {
                    return(new CityInfo("Britian", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca));
                }
                else
                {
                    return(new CityInfo("Britian", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca));
                }
            }
            }
        }
Exemplo n.º 16
0
        private static void EventSink_CharacterCreated(CharacterCreatedEventArgs args)
        {
            Mobile from = args.Mobile;

            //from.SendMessage("Welcome to our shard.");
            Account  acct = from.Account as Account;
            TimeSpan time = acct.TotalGameTime; //TotalGameTime from Account file.

            Console.WriteLine("WelcomeNewPlayer: Time: {0}", time.Minutes);

            if (time.Minutes <= 1) //test to see if this their first character.
            {
                foreach (NetState ns in NetState.Instances)
                {
                    Mobile m = ns.Mobile;

                    if (m != null && m.AccessLevel >= AccessLevel.Counselor) // && m.AutoPageNotify && m.LastMoveTime >= (DateTime.Now - TimeSpan.FromMinutes(10.0)))
                    {
                        m.SendMessage("Welcome {0} to our shard.", from.Name);
                        m.SendGump(new WelcomeNewPlayerGump(from.Name));
                    }
                }
            }
        }
Exemplo n.º 17
0
        private static void EventSink_CharacterCreated(CharacterCreatedEventArgs args)
        {
            Mobile from = args.Mobile;

            from.SendMessage("Welcome to " + ShardName + ", " + from.Name + ".");

            //Set custom starting point
            if (change_StartingLocation)
            {
                //CityInfo city = new CityInfo("Minoc", "Sweet Dreams Inn", 2493, 377, 0, Map.Felucca);
                from.MoveToWorld(city.Location, city.Map);
            }

            //This calls the items from the list below (see near line #143)
            GetListOfItems(from);

            //Add your custom extrnal startup code here
            if (enable_EmailCollector)
            {
                //Email Collector *** START ***
                new StartTimer(from).Start();  //http://www.runuo.com/forums/runuo-post-archive/41474-email-collector-2-0-a.html
                //Email Collector *** END   ***
            }
        }
        public static void HandleCharacterCreation(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;

            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.State, 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 {
                    Owner = newChar
                };
                newChar.BankBox.DropItem(ticket);
            }


            CityInfo city = GetStartLocation(args, young);

            newChar.MoveToWorld(city.Location, city.Map);
            if (args.State != null)
            {
                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, newChar.Map);

                new WelcomeTimer(newChar).Start();
            }
        }
Exemplo n.º 19
0
		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.Race = Race.DefaultRace;
			newChar.Hue = newChar.Race.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000;

			newChar.Hunger = 20;

			if ( newChar is PlayerMobile )
			{
				PlayerMobile pm = (PlayerMobile) newChar;
				pm.Profession = args.Profession;
			}

			SetName( newChar, args.Name );

			AddBackpack( newChar );

			SetStats( newChar, state, 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 );
			}

//			NewPlayerTicket ticket = new NewPlayerTicket();
//			ticket.Owner = newChar;
//			newChar.Backpack.DropItem( ticket );

            newChar.MoveToWorld(args.City.Location, args.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}", args.City.City, args.City.Location, args.City.Map.ToString() );

			new WelcomeTimer( newChar ).Start();
		}
Exemplo n.º 20
0
        private static CityInfo GetStartLocation(CharacterCreatedEventArgs args, bool isYoung)
        {
            if (Core.ML)
            {
                if ((!Core.SA || isYoung) && args.State != null && args.State.NewHaven)
                {
                    return(m_NewHavenInfo);
                }

                return(args.City);
            }

            //bool useHaven = isYoung;
            bool useHaven = false;

            ClientFlags flags = args.State == null ? ClientFlags.None : args.State.Flags;
            Mobile      m     = args.Mobile;

            switch (args.Profession)
            {
            case 4:                     //Necro
            {
                if ((flags & ClientFlags.Malas) != 0)
                {
                    return(new CityInfo("Umbra", "Mardoth's Tower", 2114, 1301, -50, Map.Malas));
                }
                else
                {
                    //useHaven = true;

                    new BadStartMessage(m, 1062205);

                    /*
                     * Unfortunately you are playing on a *NON-Age-Of-Shadows* game
                     * installation and cannot be transported to Malas.
                     * You will not be able to take your new player quest in Malas
                     * without an AOS client.  You are now being taken to the city of
                     * Haven on the Trammel facet.
                     * */
                }

                break;
            }

            case 5:                     //Paladin
            {
                return(m_NewHavenInfo);
            }

            case 6:                     //Samurai
            {
                if ((flags & ClientFlags.Tokuno) != 0)
                {
                    return(new CityInfo("Samurai DE", "Haoti's Grounds", 368, 780, -1, Map.Malas));
                }
                else
                {
                    //useHaven = true;

                    new BadStartMessage(m, 1063487);

                    /*
                     * Unfortunately you are playing on a *NON-Samurai-Empire* game
                     * installation and cannot be transported to Tokuno.
                     * You will not be able to take your new player quest in Tokuno
                     * without an SE client. You are now being taken to the city of
                     * Haven on the Trammel facet.
                     * */
                }

                break;
            }

            case 7:                     //Ninja
            {
                if ((flags & ClientFlags.Tokuno) != 0)
                {
                    return(new CityInfo("Ninja DE", "Enimo's Residence", 414, 823, -1, Map.Malas));
                }
                else
                {
                    //useHaven = true;

                    new BadStartMessage(m, 1063487);

                    /*
                     * Unfortunately you are playing on a *NON-Samurai-Empire* game
                     * installation and cannot be transported to Tokuno.
                     * You will not be able to take your new player quest in Tokuno
                     * without an SE client. You are now being taken to the city of
                     * Haven on the Trammel facet.
                     * */
                }

                break;
            }
            }

            if (useHaven)
            {
                return(m_NewHavenInfo);
            }
            else
            {
                return(args.City);
            }
        }
Exemplo n.º 21
0
 void OnCharacterCreated(object sender, CharacterCreatedEventArgs e) =>
 CharacterCreated?.Invoke(sender, e);
Exemplo n.º 22
0
        public static void CreateCharacter( NetState state, PacketReader pvSrc )
        {
            int unk1 = pvSrc.ReadInt32();
            int unk2 = pvSrc.ReadInt32();
            int unk3 = pvSrc.ReadByte();
            string name = pvSrc.ReadString( 30 );

            pvSrc.Seek( 2, SeekOrigin.Current );
            int flags = pvSrc.ReadInt32();
            pvSrc.Seek( 8, SeekOrigin.Current );
            int prof = pvSrc.ReadByte();
            pvSrc.Seek( 15, SeekOrigin.Current );

            bool female = pvSrc.ReadBoolean();
            int str = pvSrc.ReadByte();
            int dex = pvSrc.ReadByte();
            int intl= pvSrc.ReadByte();
            int is1 = pvSrc.ReadByte();
            int vs1 = pvSrc.ReadByte();
            int is2 = pvSrc.ReadByte();
            int vs2 = pvSrc.ReadByte();
            int is3 = pvSrc.ReadByte();
            int vs3 = pvSrc.ReadByte();
            int hue = pvSrc.ReadUInt16();
            int hairVal = pvSrc.ReadInt16();
            int hairHue = pvSrc.ReadInt16();
            int hairValf= pvSrc.ReadInt16();
            int hairHuef= pvSrc.ReadInt16();
            pvSrc.ReadByte();
            int cityIndex = pvSrc.ReadByte();
            int charSlot = pvSrc.ReadInt32();
            int clientIP = pvSrc.ReadInt32();
            int shirtHue = pvSrc.ReadInt16();
            int pantsHue = pvSrc.ReadInt16();

            CityInfo[] info = state.CityInfo;
            IAccount a = state.Account;

            if ( info == null || a == null || cityIndex < 0 || cityIndex >= info.Length )
            {
                Console.WriteLine( cityIndex );
                Console.WriteLine( info.Length );
                state.Dispose();
            }
            else
            {
                // Check if anyone is using this account
                for ( int i = 0; i < a.Length; ++i )
                {
                    Mobile check = a[i];

                    if ( check != null && check.Map != Map.Internal )
                    {
                        Console.WriteLine( "Login: {0}: Account in use", state );
                        state.Send( new PopupMessage( PMMessage.CharInWorld ) );
                        return;
                    }
                }

                state.Flags = flags;

                CharacterCreatedEventArgs args = new CharacterCreatedEventArgs(
                    state, a,
                    name, female, hue,
                    str, dex, intl,
                    info[cityIndex],
                    new SkillNameValue[3]
                    {
                        new SkillNameValue( (SkillName)is1, vs1 ),
                        new SkillNameValue( (SkillName)is2, vs2 ),
                        new SkillNameValue( (SkillName)is3, vs3 ),
                    },
                    shirtHue, pantsHue,
                    hairVal, hairHue,
                    hairValf, hairHuef,
                    prof );

                state.BlockAllPackets = true;

                EventSink.InvokeCharacterCreated( args );

                Mobile m = args.Mobile;

                if ( m != null )
                {
                    state.Mobile = m;
                    m.NetState = state;

                    state.BlockAllPackets = false;
                    DoLogin( state, m );
                }
                else
                {
                    state.BlockAllPackets = false;
                    state.Dispose();
                }
            }
        }
Exemplo n.º 23
0
        private static void EventSink_CharacterCreated(CharacterCreatedEventArgs args)
        {
            if (!VerifyProfession(args.Profession))
            {
                args.Profession = 0;
            }

            var state = args.State;

            if (state == null)
            {
                return;
            }

            var newChar = CreateMobile(args.Account as Account);

            if (newChar == null)
            {
                Utility.PushColor(ConsoleColor.Red);
                Console.WriteLine("Login: {0}: Character creation failed, account full", state);
                Utility.PopColor();
                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;

            //UOSI: Trying to disable races, but no matter what you pick you're getting a human
            //if (Core.Expansion >= args.Race.RequiredExpansion)
            //	newChar.Race = args.Race; //Sets body
            //else
            //	newChar.Race = Race.DefaultRace;

            newChar.Race = Race.DefaultRace; //UOSI see above

            newChar.Hue = args.Hue | 0x8000;

            newChar.Hunger = 18;
            newChar.Thirst = 18; //UOSI added for the hunger/thirst system

            var young = false;

            if (newChar is PlayerMobile)
            {
                var pm = (PlayerMobile)newChar;

                pm.AutoRenewInsurance = true;

                var skillcap = Config.Get("PlayerCaps.SkillCap", 1000.0d) / 10;

                if (skillcap != 100.0)
                {
                    for (var i = 0; i < Enum.GetNames(typeof(SkillName)).Length; ++i)
                    {
                        pm.Skills[i].Cap = skillcap;
                    }
                }

                pm.Profession = args.Profession;

                if (pm.IsPlayer() && pm.Account.Young && !Siege.SiegeShard)
                {
                    young = pm.Young = true;
                }
            }

            SetName(newChar, args.Name);

            AddBackpack(newChar);

            SetStats(newChar, state, args.Str, args.Dex, args.Int);
            SetSkills(newChar, args.Skills, args.Profession);

            var race = newChar.Race;

            if (race.ValidateHair(newChar, args.HairID))
            {
                newChar.HairItemID = args.HairID;
                newChar.HairHue    = args.HairHue;
            }

            if (race.ValidateFacialHair(newChar, args.BeardID))
            {
                newChar.FacialHairItemID = args.BeardID;
                newChar.FacialHairHue    = args.BeardHue;
            }

            var faceID = args.FaceID;

            if (faceID > 0 && race.ValidateFace(newChar.Female, faceID))
            {
                newChar.FaceItemID = faceID;
                newChar.FaceHue    = args.FaceHue;
            }
            else
            {
                newChar.FaceItemID = race.RandomFace(newChar.Female);
                newChar.FaceHue    = newChar.Hue;
            }

            if (args.Profession <= 3)
            {
                AddShirt(newChar, args.ShirtHue);
                AddPants(newChar, args.PantsHue);
                AddShoes(newChar);
            }

            if (TestCenter.Enabled)
            {
                TestCenter.FillBankbox(newChar);
            }

            //UOSI idk what this is for, so now its gone.
            //if (young)
            //{
            //	var ticket = new NewPlayerTicket
            //	{
            //		Owner = newChar
            //	};

            //	newChar.BankBox.DropItem(ticket);
            //}

            //UOSI Added starting items
            newChar.AddToBackpack(new Waterskin());
            //newChar.AddToBackpack(new PlayerGuide());

            //UOSI Override the starting city
            var tCity = new CityInfo("", "", 236, 265, 0, Map.Tokuno);

            var city = args.City;
            var map  = Siege.SiegeShard && city.Map == Map.Trammel ? Map.Felucca : city.Map;

            //UOSI Override the starting city
            //newChar.MoveToWorld(city.Location, map);
            newChar.MoveToWorld(tCity.Location, Map.Tokuno);
            newChar.Direction = Direction.South;

            Utility.PushColor(ConsoleColor.Green);
            Console.WriteLine("Login: {0}: New character being created (account={1})", state, args.Account.Username);
            Utility.PopColor();
            Utility.PushColor(ConsoleColor.DarkGreen);
            Console.WriteLine(" - Character: {0} (serial={1})", newChar.Name, newChar.Serial);
            Console.WriteLine(" - Started: {0} {1} in {2}", tCity.City, tCity.Location, tCity.Map);             //UOSI
            Utility.PopColor();

            new WelcomeTimer(newChar).Start();
        }
Exemplo n.º 24
0
 private static CityInfo GetStartLocation(CharacterCreatedEventArgs args, bool isYoung)
 {
     bool useHaven = Convert.ToBoolean(Shard.Xml("startloc/usehaven")); //isYoung;
     Map[] sm = new Map[] { Map.Felucca, Map.Trammel, Map.Ilshenar, Map.Malas, Map.Tokuno, Map.TerMur }; // array used to indicate map 0-5
     string[] sp = new string[] { "startloc/default", "startloc/warrior", "startloc/mage", "startloc/blacksmith", "startloc/necro", "startloc/paladin", "startloc/samurai", "startloc/ninja" };
     string[] sl = Shard.Xml(sp[0]).Split(','); // string array made of xml entry corresponding to chosen profession, or default
     ClientFlags flags = args.State == null ? ClientFlags.None : args.State.Flags;
     Mobile m = args.Mobile;
     if ((flags & ClientFlags.Malas) == 0 & args.Profession == 4) 
     {
         useHaven = true; 
         new BadStartMessage(m, 1062205);
         /*
         * Unfortunately you are playing on a *NON-Age-Of-Shadows* game 
         * installation and cannot be transported to Malas.  
         * You will not be able to take your new player quest in Malas 
         * without an AOS client.  You are now being taken to the city of 
         * Haven on the Trammel facet.
         * */
     }
     if ((flags & ClientFlags.Tokuno) == 0 & args.Profession >= 6)
     {
         useHaven = true;
         new BadStartMessage(m, 1063487);
         /*
         * Unfortunately you are playing on a *NON-Samurai-Empire* game 
         * installation and cannot be transported to Tokuno. 
         * You will not be able to take your new player quest in Tokuno 
         * without an SE client. You are now being taken to the city of 
         * Haven on the Trammel facet.
         * */
     }
     if (useHaven || isYoung) // if young or if usehaven is true, override chosen location and return default
     {
         sl = Shard.Xml(sp[0]).Split(',');
         return new CityInfo(sl[0], sl[1], Convert.ToInt32(sl[2]), Convert.ToInt32(sl[3]), Convert.ToInt32(sl[4]), sm[Convert.ToInt32(sl[5])]);
     }
     if ( args.Profession > 0 ) // if not young, and chose a profession, and passed flag check, return profession specific location
     {
         sl = Shard.Xml(sp[args.Profession]).Split(',');
         return new CityInfo(sl[0], sl[1], Convert.ToInt32(sl[2]), Convert.ToInt32(sl[3]), Convert.ToInt32(sl[4]), sm[Convert.ToInt32(sl[5])]);
     }			
     else // If not young and chose advanced, return chosen location from client gump
         return args.City;
 }
Exemplo n.º 25
0
		private static CityInfo GetStartLocation(CharacterCreatedEventArgs args, bool isYoung)
		{
			if (args.City.Map.Expansion >= Expansion.ML)
			{
				if ((args.City.Map.Expansion < Expansion.SA || isYoung) && args.State != null && args.State.NewHaven)
				{
					return m_NewHavenInfo;
				}

				return args.City;
			}

			//bool useHaven = isYoung;
			//bool useHaven = false;

			ClientFlags flags = args.State == null ? ClientFlags.None : args.State.Flags;
			Mobile m = args.Mobile;

			switch (args.Profession)
			{
				case 4: //Necro
					{
						if ((flags & ClientFlags.Malas) != 0)
						{
							return new CityInfo("Umbra", "Mardoth's Tower", 2114, 1301, -50, Map.Malas);
						}

						//useHaven = true;

						new BadStartMessage(m, 1062205);
						/*
						 * Unfortunately you are playing on a *NON-Age-Of-Shadows* game
						 * installation and cannot be transported to Malas.
						 * You will not be able to take your new player quest in Malas
						 * without an AOS client.  You are now being taken to the city of
						 * Haven on the Trammel facet.
						 */
					}
					break;
				case 5: //Paladin
					break;
				case 6: //Samurai
					{
						if ((flags & ClientFlags.Tokuno) != 0)
						{
							return new CityInfo("Samurai DE", "Haoti's Grounds", 368, 780, -1, Map.Malas);
						}

						//useHaven = true;

						new BadStartMessage(m, 1063487);
						/*
						 * Unfortunately you are playing on a *NON-Samurai-Empire* game
						 * installation and cannot be transported to Tokuno.
						 * You will not be able to take your new player quest in Tokuno
						 * without an SE client. You are now being taken to the city of
						 * Haven on the Trammel facet.
						 */
					}
					break;
				case 7: //Ninja
					{
						if ((flags & ClientFlags.Tokuno) != 0)
						{
							return new CityInfo("Ninja DE", "Enimo's Residence", 414, 823, -1, Map.Malas);
						}

						//useHaven = true;

						new BadStartMessage(m, 1063487);
						/*
						 * Unfortunately you are playing on a *NON-Samurai-Empire* game
						 * installation and cannot be transported to Tokuno.
						 * You will not be able to take your new player quest in Tokuno
						 * without an SE client. You are now being taken to the city of
						 * Haven on the Trammel facet.
						 */
					}
					break;
			}

			/*if (useHaven)
			{
				return m_NewHavenInfo;
			}*/

			return args.City;
		}
Exemplo n.º 26
0
        void GameServiceOnCharacterCreated(object sender, CharacterCreatedEventArgs e)
        {
            Logger.Info($"A new character was created. Auto splits enabled for {e.Character.Name}");

            ResetAutoSplits();
        }
Exemplo n.º 27
0
		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));
			}*/
		}
Exemplo n.º 28
0
        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.StatCap     = 250;
            newChar.Skills.Cap  = 10000;
            newChar.AccessLevel = args.Account.AccessLevel;
            newChar.Female      = args.Female;
            newChar.Race        = Race.Human;

            newChar.Hue = newChar.Race.ClipSkinHue(args.Hue & 0x3FFF) | 0x8000;

            if (newChar.Hue >= 33770)
            {
                newChar.Hue = newChar.Hue - 32768;
            }

            newChar.Hunger = 20;
            newChar.Thirst = 20;

            bool young = false;

            if (newChar is PlayerMobile)
            {
                PlayerMobile pm = (PlayerMobile)newChar;
                pm.PublicMyRunUO = true;
                young            = pm.Young = false;
            }

            SetName(newChar, args.Name);

            AddBackpack(newChar);

            SetStats(newChar, state, args.Str, args.Dex, args.Int);
            SetSkills(newChar, args.Skills, args.Profession);

            newChar.Mana = args.Int * 2;
            newChar.Hits = args.Str * 2;
            newChar.Stam = args.Dex * 2;

            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);
            }

            AddShirt(newChar, args.ShirtHue);
            AddPants(newChar, args.PantsHue);
            AddShoes(newChar);

            CityInfo city = new CityInfo("Sosaria", "Moongates", 3565, 3404, 5, Map.Sosaria);

            newChar.MoveToWorld(city.Location, city.Map);

            Console.WriteLine("Login: {0}: New character being created (account={1})", state, args.Account.Username);

            new WelcomeTimer(newChar).Start();
        }
Exemplo n.º 29
0
        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);

            args.Mobile = newChar;
            m_Mobile    = newChar;

            if (newChar == null)
            {
                Console.WriteLine("Login: {0}: Character creation failed, account full", state);
                return;
            }

            if (newChar is Player)
            {
                Player pm = (Player)newChar;
                pm.Profession = args.Profession;
            }

            newChar.Player      = true;
            newChar.AccessLevel = args.Account.AccessLevel;
            newChar.Female      = args.Female;
            newChar.Body        = newChar.Female ? 0x191 : 0x190;
            newChar.Hue         = Utility.ClipSkinHue(args.Hue & 0x3FFF) | 0x8000;
            newChar.Hunger      = 20;
            newChar.Thirst      = 20;
            newChar.SkillsCap   = 8000;
            newChar.StatCap     = 250;
            newChar.Name        = args.Name;

            ((Player)newChar).EoC += 20000;
            ((Player)newChar).Race = Race.Human;

            newChar.CantWalk = false;
            newChar.Frozen   = false;

            newChar.Hits = newChar.HitsMax;
            newChar.Mana = newChar.ManaMax;
            newChar.Stam = newChar.StamMax;

            AddBackpack(newChar);

            newChar.AddToBackpack(new Verite(150));

            Bag bag = new Bag();

            bag.Name = "A torn bag";
            bag.Hue  = Utility.RandomNeutralHue();
            newChar.AddToBackpack(bag);

            //bag.TryDropItem(newChar, new ShepherdsCrook(), false);
            //bag.TryDropItem(newChar, new Bandage(Utility.Random(20,30)), false);
            //bag.TryDropItem(newChar, new Kindling(15), false);
            //bag.TryDropItem(newChar, new Torch(), false);
            //bag.TryDropItem(newChar, new Dagger(), false);
            //bag.TryDropItem(newChar, new TotalRefreshPotion(), false);
            //bag.TryDropItem(newChar, new GreaterHealPotion(), false);
            //bag.TryDropItem(newChar, new GreaterCurePotion(), false);
            //bag.TryDropItem(newChar, new IDWand(Utility.Random(10,15)), false);
            //bag.TryDropItem(newChar, new Pitcher(BeverageType.Water), false);

            bag.AddItem(new Bandage(30));
            bag.AddItem(new Kindling(10));
            bag.AddItem(new Torch());
            bag.AddItem(new Dagger());
            bag.AddItem(new Scissors());
            bag.AddItem(new TotalRefreshPotion());
            bag.AddItem(new GreaterCurePotion());
            bag.AddItem(new GreaterHealPotion());
            bag.AddItem(new IDWand());
            bag.AddItem(new Pitcher());

            newChar.AddToBackpack(new SkillScroll());

            for (int i = 0; i < SkillInfo.Table.Length; i++)
            {
                newChar.Skills[i].Base = 0;

                if (SkillInfo.Table[i].SkillID > (int)SkillName.Ninjitsu)
                {
                    newChar.Skills[i].Cap = 0;
                }
                else
                {
                    newChar.Skills[i].Cap = 100;
                }
            }

            newChar.HairItemID       = args.HairID;
            newChar.FacialHairItemID = args.BeardID;

            newChar.HairHue       = Utility.ClipHairHue(args.HairHue & 0x3FFF);
            newChar.FacialHairHue = Utility.ClipHairHue(args.BeardHue & 0x3FFF);

            AddShirt(newChar, args.ShirtHue);
            AddPants(newChar, args.PantsHue);
            AddShoes(newChar);

            SetStats(newChar, state, args.Str, args.Dex, args.Int);
            SetSkills(newChar, args.Skills, args.Profession);

            newChar.MoveToWorld(new Point3D(2756, 3808, 50), Map.Felucca); /// Isle of Kesna'buir
            ((Player)newChar).RespawnLocation = (new Point3D(2756, 3808, 50));
            ((Player)newChar).RespawnMap      = Map.Felucca;

            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);
        }
 private static CityInfo GetStartLocation(CharacterCreatedEventArgs args, bool isYoung)
 {
     args.City.Map ??= Map.Felucca;
     return(args.City);
 }
Exemplo n.º 31
0
        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 static void CreateCharacter3D(NetState state, PacketReader pvSrc)
        {
            int size = pvSrc.Size;

            int unk1 = pvSrc.ReadInt32();
            int charSlot = pvSrc.ReadInt32();
            string name = pvSrc.ReadString(30);
            string unknown1 = pvSrc.ReadString(30);

            int prof = pvSrc.ReadByte();
            int flags = pvSrc.ReadByte();

            int gender = pvSrc.ReadByte();
            int genderRace = pvSrc.ReadByte();

            int str = pvSrc.ReadByte();
            int dex = pvSrc.ReadByte();
            int intl = pvSrc.ReadByte();

            int hue = pvSrc.ReadUInt16();
            int unk2 = pvSrc.ReadInt32();
            int unk3 = pvSrc.ReadInt32();

            int is1 = pvSrc.ReadByte();
            int vs1 = pvSrc.ReadByte();
            int is2 = pvSrc.ReadByte();
            int vs2 = pvSrc.ReadByte();
            int is3 = pvSrc.ReadByte();
            int vs3 = pvSrc.ReadByte();
            int is4 = pvSrc.ReadByte();
            int vs4 = pvSrc.ReadByte();

            string unknown2 = pvSrc.ReadString(25);
            int unk4 = pvSrc.ReadByte();

            int hairColor = pvSrc.ReadInt16();
            int hairID = pvSrc.ReadInt16();

            int unk5 = pvSrc.ReadByte();
            int unk6 = pvSrc.ReadInt32();
            int unk7 = pvSrc.ReadByte();
            int shirtColor = pvSrc.ReadInt16();
            int shirtID = pvSrc.ReadInt16();
            int unk8 = pvSrc.ReadByte();

            int faceColor = pvSrc.ReadInt16();
            int faceID = pvSrc.ReadInt16();
            int unk9 = pvSrc.ReadByte();

            int beardColor = pvSrc.ReadInt16();
            int beardID = pvSrc.ReadInt16();

            int cityIndex = 0;

            /*
            0x00, 0x01
            0x02, 0x03 -> Human Male, Human Female
            0x04, 0x05 -> Elf Male, Elf Female
            0x05, 0x06 -> Gargoyle Male, Gargoyle Female
            */

            bool female = (gender != 0);

            Race race = Race.Races[genderRace]; ;

            if (race == null)
                race = Race.DefaultRace;

            CityInfo[] info = state.CityInfo;
            IAccount a = state.Account;

            if (info == null || a == null || cityIndex < 0 || cityIndex >= info.Length)
            {
                state.Dispose();
            }
            else
            {
                // Check if anyone is using this account
                for (int i = 0; i < a.Length; ++i)
                {
                    Mobile check = a[i];

                    if (check != null && check.Map != Map.Internal)
                    {
                        Console.WriteLine("Login: {0}: Account in use", state);
                        state.Send(new PopupMessage(PMMessage.CharInWorld));
                        return;
                    }
                }

                state.Flags = (ClientFlags)flags;

                CharacterCreatedEventArgs args = new CharacterCreatedEventArgs(
                    state, a,
                    name, female, hue,
                    str, dex, intl, info[cityIndex],
                    new SkillNameValue[4]
                    {
                        new SkillNameValue( (SkillName)is1, vs1 ),
                        new SkillNameValue( (SkillName)is2, vs2 ),
                        new SkillNameValue( (SkillName)is3, vs3 ),
                        new SkillNameValue( (SkillName)is4, vs4 ),
                    },
                    shirtColor, shirtColor,
                    hairID, hairColor,
                    beardColor, beardColor,
                    prof, race,
                    faceID, faceColor
                    );

                state.Send(new ClientVersionReq());

                state.BlockAllPackets = true;

                EventSink.InvokeCharacterCreated(args);

                Mobile m = args.Mobile;

                if (m != null)
                {
                    state.Mobile = m;
                    m.NetState = state;
                    new LoginTimer(state, m).Start();
                }
                else
                {
                    state.BlockAllPackets = false;
                    state.Dispose();
                }
            }
        }
Exemplo n.º 33
0
        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)
            {
                Utility.PushColor(ConsoleColor.Red);
                Console.WriteLine("Login: {0}: Character creation failed, account full", state);
                Utility.PopColor();
                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.AutoRenewInsurance = true;
                double skillcap = Config.Get("PlayerCaps.SkillCap", 1000.0d) / 10;
                if (skillcap != 100.0)
                {
                    for (int i = 0; i < Enum.GetNames(typeof(SkillName)).Length; ++i)
                        pm.Skills[i].Cap = skillcap;
                }
                pm.Profession = args.Profession;

                if (pm.IsPlayer() && ((Account)pm.Account).Young)
                    young = pm.Young = true;
            }

            SetName(newChar, args.Name);

            AddBackpack(newChar);

            SetStats(newChar, state, 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)
                TestCenter.FillBankbox(newChar);

            if (young)
            {
                NewPlayerTicket ticket = new NewPlayerTicket();
                ticket.Owner = newChar;
                newChar.BankBox.DropItem(ticket);
            }

            CityInfo city = GetStartLocation(args, young);

            newChar.MoveToWorld(city.Location, city.Map);

            Utility.PushColor(ConsoleColor.Green);
            Console.WriteLine("Login: {0}: New character being created (account={1})", state, args.Account.Username);
            Utility.PopColor();
            Utility.PushColor(ConsoleColor.DarkGreen);
            Console.WriteLine(" - Character: {0} (serial={1})", newChar.Name, newChar.Serial);
            Console.WriteLine(" - Started: {0} {1} in {2}", city.City, city.Location, city.Map.ToString());
            Utility.PopColor();

            new WelcomeTimer(newChar).Start();

			if (XmlSpawner.PointsEnabled)
				XmlAttach.AttachTo(newChar, new XmlPoints());
			if(XmlSpawner.FactionsEnabled)
				XmlAttach.AttachTo(newChar, new XmlMobFactions());
        }
        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)
            {
                Utility.PushColor(ConsoleColor.Red);
                Console.WriteLine("Login: {0}: Character creation failed, account full", state);
                Utility.PopColor();
                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 = Config.Get("CharacterCreation.Hunger", 0);
            newChar.Thirst = Config.Get("CharacterCreation.Thirst", 0);
            newChar.SkillsCap = Config.Get("CharacterCreation.SkillCap", 0);
            newChar.StatCap = Config.Get("CharacterCreation.StatCap", 0);
            newChar.FollowersMax = Config.Get("CharacterCreation.FollowersMax", 0);

            bool young = false;

            if (newChar is PlayerMobile)
            {
                PlayerMobile pm = (PlayerMobile)newChar;

                pm.Profession = args.Profession;

                if (pm.IsPlayer() && ((Account)pm.Account).Young)
                {
                    young = pm.Young = Config.Get("CharacterCreation.YoungEnabled", true);
                }

                if (pm.Race == Race.Gargoyle) // Gargoyles start with 2000 loyalty points
                {
                    pm.Exp = Config.Get("CharacterCreation.GargoyleExp", 0);
                }
            }

            SetName(newChar, args.Name);

            AddBackpack(newChar);

            SetStats(newChar, state, 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);
            }
            #region Enhance Client
            if (race.ValidateFace(newChar, args.FaceID))
            {
                newChar.FaceItemID = args.FaceID;
                newChar.FaceHue = args.FaceHue;
            }
            #endregion

            if (args.Profession <= 3)
            {
                AddShirt(newChar, args.ShirtHue);
                AddPants(newChar, args.PantsHue);
                AddShoes(newChar);
            }

            if (young)
            {
                NewPlayerTicket ticket = new NewPlayerTicket();
                ticket.Owner = newChar;
                newChar.BankBox.DropItem(ticket);
            }

            CityInfo city = GetStartLocation(args, young);

            newChar.MoveToWorld(city.Location, city.Map);

            Utility.PushColor(ConsoleColor.Green);
            Console.WriteLine("Login: {0}: New character being created (account={1})", state, args.Account.Username);
            Utility.PopColor();
            Utility.PushColor(ConsoleColor.DarkGreen);
            Console.WriteLine(" - Character: {0} (serial={1})", newChar.Name, newChar.Serial);
            Console.WriteLine(" - Started: {0} {1} in {2}", city.City, city.Location, city.Map.ToString());
            Utility.PopColor();

            new WelcomeTimer(newChar).Start();

            if (XmlSpawner.PointsEnabled)
            {
                XmlAttach.AttachTo(newChar, new XmlPoints());
            }

            if (XmlSpawner.FactionsEnabled)
            {
                XmlAttach.AttachTo(newChar, new XmlMobFactions());
            }
        }
Exemplo n.º 35
0
        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;
            newChar.Hue = Utility.ClipSkinHue(args.Hue & 0x3FFF) | 0x8000;
            newChar.Hunger = 20;
            newChar.Thirst = 20;
            newChar.SkillsCap = 10000;
            newChar.StatCap = 300;
            newChar.Name = args.Name;
            newChar.RawInt = 50;
            newChar.RawDex = 50;
            newChar.RawStr = 50;

            ((Player)newChar).EoC += 20000;
            ((Player)newChar).Race = Race.Human;

            newChar.CantWalk = false;
            newChar.Frozen = false;

            newChar.Hits = newChar.HitsMax;
            newChar.Mana = newChar.ManaMax;
            newChar.Stam = newChar.StamMax;

            AddBackpack(newChar);

            newChar.AddToBackpack( new Silver(50) );
            newChar.AddToBackpack( new Copper(50) );

            newChar.AddToBackpack( new SkillScroll() );

            SkillName[] emptySkills = new SkillName[]
				{

                    #region SkillNames
                    SkillName.Alchemy,
                    SkillName.Anatomy,
                    SkillName.AnimalLore,
                    SkillName.ItemID,      
                    SkillName.ArmsLore,
                    SkillName.Parry,
                    SkillName.Begging,
                    SkillName.Blacksmith,
                    SkillName.Fletching,
                    SkillName.Peacemaking,
                    SkillName.Camping,
                    SkillName.Carpentry,
                    SkillName.Cartography,
                    SkillName.Cooking,
                    SkillName.DetectHidden,
                    SkillName.Discordance,
                    SkillName.EvalInt,
                    SkillName.Healing,
                    SkillName.Fishing,
                    SkillName.Forensics,
                    SkillName.Herding,
                    SkillName.Hiding,
                    SkillName.Provocation,
                    SkillName.Inscribe,
                    SkillName.Lockpicking,
                    SkillName.Magery,
                    SkillName.MagicResist,
                    SkillName.Tactics,
                    SkillName.Snooping,
                    SkillName.Musicianship,
                    SkillName.Poisoning,
                    SkillName.Archery,
                    SkillName.SpiritSpeak,
                    SkillName.Stealing,
                    SkillName.Tailoring,
                    SkillName.AnimalTaming,
                    SkillName.TasteID,
                    SkillName.Tinkering,
                    SkillName.Tracking,
                    SkillName.Veterinary,
                    SkillName.Swords,
                    SkillName.Macing,
                    SkillName.Fencing,
                    SkillName.Wrestling,
                    SkillName.Lumberjacking,
                    SkillName.Mining,
                    SkillName.Meditation,
                    SkillName.Stealth,
                    SkillName.RemoveTrap,
                    //SkillName.Necromancy,
                    SkillName.Focus,
                    //SkillName.Chivalry,
                    //SkillName.Bushido,
                    //SkillName.Ninjitsu,
                    //SkillName.Spellweaving,
                    //SkillName.Mysticism,
                    //SkillName.Imbuing,
                    //SkillName.Throwing
                    #endregion

				};

            for( int i = 0; i < SkillInfo.Table.Length; i++ )
            {
                newChar.Skills[i].Base = 0;

                if( Array.IndexOf<SkillName>(emptySkills, newChar.Skills[i].SkillName) > -1 )
                    newChar.Skills[i].Cap = 100;

                else
                    newChar.Skills[i].Cap = 0;
            }

            newChar.HairItemID = args.HairID;
            newChar.FacialHairItemID = args.BeardID;

            newChar.HairHue = Utility.ClipHairHue(args.HairHue & 0x3FFF);
            newChar.FacialHairHue = Utility.ClipHairHue(args.BeardHue & 0x3FFF);

            AddShirt(newChar, args.ShirtHue);
            AddPants(newChar, args.PantsHue);
            AddShoes(newChar);

            FillBankbox(newChar);

            newChar.MoveToWorld(StartingCity.Location, StartingCity.Map);

            ((Player)newChar).RespawnLocation = StartingCity.Location;
            ((Player)newChar).RespawnMap = StartingCity.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}", StartingCity.City, StartingCity.Location, StartingCity.Map.ToString());

            new WelcomeTimer(newChar).Start();
        }
Exemplo n.º 36
0
        // KR Client Character Creation
        public static void KRCreateCharacter(NetState state, PacketReader pvSrc)
        {
            int flags = 0;

            int length = pvSrc.Size;

            int unk1 = pvSrc.ReadInt32(); // Pattern
            int charSlot = pvSrc.ReadInt32();
            string name = pvSrc.ReadString(30);
            string unknown1 = pvSrc.ReadString(30); // "Unknow"

            int profession = pvSrc.ReadByte();
            int clientFlags = pvSrc.ReadByte();

            int gender = pvSrc.ReadByte();
            int genderRace = pvSrc.ReadByte();

            int str = pvSrc.ReadByte();
            int dex = pvSrc.ReadByte();
            int intel = pvSrc.ReadByte();

            int hue = pvSrc.ReadInt16();
            int unk5 = pvSrc.ReadInt32(); // 0x00 0x00 0x00 0x00
            int unk6 = pvSrc.ReadInt32(); // 0x00 0x00 0x00 0x00

            // isX = skill amount | vsX = skill
            int is1 = pvSrc.ReadByte();
            int vs1 = pvSrc.ReadByte();
            int is2 = pvSrc.ReadByte();
            int vs2 = pvSrc.ReadByte();
            int is3 = pvSrc.ReadByte();
            int vs3 = pvSrc.ReadByte();
            int is4 = pvSrc.ReadByte();
            int vs4 = pvSrc.ReadByte();

            string unknown2 = pvSrc.ReadString(25); // Pack of 0x00
            int unk7 = pvSrc.ReadByte(); // Another 0x00

            int hairColor = pvSrc.ReadInt16();
            int hairID = pvSrc.ReadInt16();

            int unk8 = pvSrc.ReadByte();
            int unk9 = pvSrc.ReadInt32();
            int unk10 = pvSrc.ReadByte();
            int shirtHue = pvSrc.ReadInt16();
            int shirtID = pvSrc.ReadInt16();
            int unk13 = pvSrc.ReadByte();

            int faceColor = pvSrc.ReadInt16();
            int faceID = pvSrc.ReadInt16();

            int unk14 = pvSrc.ReadByte();

            int beardColor = pvSrc.ReadInt16();
            int beardID = pvSrc.ReadInt16();

            int cityIndex = 0; // Obsolete
            int pantsHue = shirtHue; // Obsolete
            Race race = null;
            bool female = false;
            if (state.IsKRClient != true)
            {
                female = (gender != 0);
                race = Race.Races[(byte)(((genderRace - 1)))]; //SA client sends race packet one higher than KR, so this is neccesary
                if (race == null)
                    race = Race.DefaultRace;
            }
            else
            {
                female = (gender != 0);
                race = Race.Races[genderRace];
                if (race == null)
                    race = Race.DefaultRace;
            }

            CityInfo[] info = state.CityInfo;
            IAccount a = state.Account;

            if (clientFlags > 0)
                flags = clientFlags;

            if (info == null || a == null || cityIndex < 0 || cityIndex >= info.Length)
            {
                state.Dispose();
            }
            else
            {
                // Check if anyone is using this account
                for (int i = 0; i < a.Length; ++i)
                {
                    Mobile check = a[i];

                    if (check != null && check.Map != Map.Internal)
                    {
                        Console.WriteLine("Login: {0}: Account in use", state);
                        state.Send(new PopupMessage(PMMessage.CharInWorld));
                        return;
                    }
                }

                state.Flags = (ClientFlags)flags;

                CharacterCreatedEventArgs args = new CharacterCreatedEventArgs(
                    state,
                    a,
                    name,
                    female,
                    hue,
                    str,
                    dex,
                    intel,
                    info[cityIndex],
                    new SkillNameValue[4]
                    {
                        new SkillNameValue( (SkillName)is1, vs1 ),
                        new SkillNameValue( (SkillName)is2, vs2 ),
                        new SkillNameValue( (SkillName)is3, vs3 ),
                        new SkillNameValue( (SkillName)is4, vs4 ),
                    },
                    shirtHue,
                    pantsHue,
                    hairID,
                    hairColor,
                    beardID,
                    beardColor,
                    profession,
                    race,
                    faceID,
                    faceColor
                    );

                state.BlockAllPackets = true;

                EventSink.InvokeCharacterCreated(args);

                Mobile m = args.Mobile;

                if (m != null)
                {
                    state.Mobile = m;
                    m.NetState = state;

                    state.BlockAllPackets = false;
                    DoLogin(state, m);
                }
                else
                {
                    state.BlockAllPackets = false;
                    state.Dispose();
                }
            }
        }
Exemplo n.º 37
0
        private static void EventSink_CharacterCreated(CharacterCreatedEventArgs args)
        {
            if (!VerifyProfession(args.Profession))
            {
                args.Profession = 0;
            }

            NetState state = args.State;
            Account  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;
            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.Thirst = 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;
                }
            }

            /*NameResultMessage result =*/ SetName(newChar, args.Name);
            AddBackpack(newChar);

            SetStats(newChar, state, 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);
            }

            BankBox bank = newChar.BankBox;

            bool needstartpack = acct != null && String.IsNullOrEmpty(acct.GetTag("startpack"));

            if (needstartpack /*|| TestCenter.Enabled*/)
            {
                Container startpack = new StarterPack();
                bank.DropItem(startpack);

/*
 *                              if ( needstartpack )
 *                              {
 *                                      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)
            {
                NewPlayerTicket ticket = new NewPlayerTicket();
                ticket.Owner = newChar;
                bank.DropItem(ticket);
            }

            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();

            //if ( result != NameResultMessage.Allowed )
            //	newChar.SendGump( new NameChangeGump( newChar, result, args.Name ) );
        }
Exemplo n.º 38
0
        private static CityInfo GetStartLocation( CharacterCreatedEventArgs args, bool isYoung )
		{
			if( Core.ML )
			{
				//if( args.State != null && args.State.NewHaven )
				return m_NewHavenInfo;	//We don't get the client Version until AFTER Character creation

				//return args.City;  TODO: Uncomment when the old quest system is actually phased out
			}

			bool useHaven = isYoung;

			ClientFlags flags = args.State == null ? ClientFlags.None : args.State.Flags;
			Mobile m = args.Mobile;

			switch ( args.Profession )
			{
				case 4: //Necro
				{
					if ( (flags & ClientFlags.Malas) != 0 )
					{
						return new CityInfo( "Umbra", "Mardoth's Tower", 2114, 1301, -50, Map.Malas );
					}
					else
					{
						useHaven = true; 

						new BadStartMessage( m, 1062205 );
						/*
						 * Unfortunately you are playing on a *NON-Age-Of-Shadows* game 
						 * installation and cannot be transported to Malas.  
						 * You will not be able to take your new player quest in Malas 
						 * without an AOS client.  You are now being taken to the city of 
						 * Haven on the Trammel facet.
						 * */
					}

					break;
				}
				case 5:	//Paladin
				{
					return m_NewHavenInfo;
				}
				case 6:	//Samurai
				{
					if ( (flags & ClientFlags.Tokuno) != 0 )
					{
						return new CityInfo( "Samurai DE", "Haoti's Grounds", 368, 780, -1, Map.Malas );
					}
					else
					{
						useHaven = true;

						new BadStartMessage( m, 1063487 );
						/*
						 * Unfortunately you are playing on a *NON-Samurai-Empire* game 
						 * installation and cannot be transported to Tokuno. 
						 * You will not be able to take your new player quest in Tokuno 
						 * without an SE client. You are now being taken to the city of 
						 * Haven on the Trammel facet.
						 * */
					}

					break;
				}
				case 7:	//Ninja
				{
					if ( (flags & ClientFlags.Tokuno) != 0 )
					{
						return new CityInfo( "Ninja DE", "Enimo's Residence", 414,	823, -1, Map.Malas );
					}
					else
					{
						useHaven = true;

						new BadStartMessage( m, 1063487 );
						/*
						 * Unfortunately you are playing on a *NON-Samurai-Empire* game 
						 * installation and cannot be transported to Tokuno. 
						 * You will not be able to take your new player quest in Tokuno 
						 * without an SE client. You are now being taken to the city of 
						 * Haven on the Trammel facet.
						 * */
					}

					break;
				}
			}

			if( useHaven )
				return m_NewHavenInfo;
			else
				return args.City;
		}
Exemplo n.º 39
0
		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();
		}
Exemplo n.º 40
0
        private static void EventSink_CharacterCreated(CharacterCreatedEventArgs args)
        {
            if (!VerifyProfession(args.Profession))
            {
                args.Profession = 0;
            }

            Mobile newChar = CreateMobile(args.Account as Account);

            if (newChar == null)
            {
                log.Error(String.Format("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 && newChar.BankBox != null)
            {
                NewPlayerTicket ticket = new NewPlayerTicket();
                ticket.Owner = newChar;
                newChar.BankBox.DropItem(ticket);
            }

            CityInfo city = GetStartLocation(args, young);

            //CityInfo city = new CityInfo( "Britain", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca );

            newChar.MoveToWorld(city.Location, city.Map);

            log.Info(String.Format("Login: {0}: New character being created (account={1})",
                                   args.State, ((Account)args.Account).Username));
            log.Info(String.Format(" - Character: {0} (serial={1})",
                                   newChar.Name, newChar.Serial));
            log.Info(String.Format(" - Started: {0} {1} in {2}",
                                   city.City, city.Location, city.Map.ToString()));

            new WelcomeTimer(newChar).Start();
        }
Exemplo n.º 41
0
        private static void EventSink_CharacterCreated(CharacterCreatedEventArgs args)
        {
            if (!VerifyProfession(args.Profession))
            {
                args.Profession = 0;
            }

            var state = args.State;

            if (state == null)
            {
                return;
            }

            var newChar = CreateMobile(args.Account as Account);

            if (newChar == null)
            {
                Utility.PushColor(ConsoleColor.Red);
                Console.WriteLine("Login: {0}: Character creation failed, account full", state);
                Utility.PopColor();
                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 = args.Hue | 0x8000;

            newChar.Hunger = 20;

            var young = false;

            if (newChar is PlayerMobile)
            {
                var pm = (PlayerMobile)newChar;

                pm.AutoRenewInsurance = true;

                var skillcap = Initialization.Get("PlayerCaps.SkillCap", 1000.0d) / 10;

                if (skillcap != 100.0)
                {
                    for (var i = 0; i < Enum.GetNames(typeof(SkillName)).Length; ++i)
                    {
                        pm.Skills[i].Cap = skillcap;
                    }
                }

                pm.Profession = args.Profession;

                if (pm.IsPlayer() && pm.Account.Young && !Siege.SiegeShard)
                {
                    young = pm.Young = true;
                }
            }

            SetName(newChar, args.Name);

            AddBackpack(newChar);

            SetStats(newChar, state, args.Profession, args.Str, args.Dex, args.Int);
            SetSkills(newChar, args.Skills, args.Profession);

            var race = newChar.Race;

            if (race.ValidateHair(newChar, args.HairID))
            {
                newChar.HairItemID = args.HairID;
                newChar.HairHue    = args.HairHue;
            }

            if (race.ValidateFacialHair(newChar, args.BeardID))
            {
                newChar.FacialHairItemID = args.BeardID;
                newChar.FacialHairHue    = args.BeardHue;
            }

            var faceID = args.FaceID;

            if (faceID > 0 && race.ValidateFace(newChar.Female, faceID))
            {
                newChar.FaceItemID = faceID;
                newChar.FaceHue    = args.FaceHue;
            }
            else
            {
                newChar.FaceItemID = race.RandomFace(newChar.Female);
                newChar.FaceHue    = newChar.Hue;
            }

            if (args.Profession <= 3)
            {
                AddShirt(newChar, args.ShirtHue);
                AddPants(newChar, args.PantsHue);
                AddShoes(newChar);
            }

            if (TestCenter.Enabled)
            {
                TestCenter.FillBankbox(newChar);
            }

            if (young)
            {
                var ticket = new NewPlayerTicket
                {
                    Owner = newChar
                };

                newChar.BankBox.DropItem(ticket);
            }

            var city = args.City;
            var map  = Siege.SiegeShard && city.Map == Map.Trammel ? Map.Felucca : city.Map;

            newChar.MoveToWorld(city.Location, map);

            Utility.PushColor(ConsoleColor.Green);
            Console.WriteLine("Login: {0}: New character being created (account={1})", state, args.Account.Username);
            Utility.PopColor();
            Utility.PushColor(ConsoleColor.DarkGreen);
            Console.WriteLine(" - Character: {0} (serial={1})", newChar.Name, newChar.Serial);
            Console.WriteLine(" - Started: {0} {1} in {2}", city.City, city.Location, city.Map);
            Utility.PopColor();

            new WelcomeTimer(newChar).Start();
        }
		public static void CreateCharacter( NetState state, PacketReader pvSrc )
		{
			/*int unk1 = */pvSrc.ReadInt32();
			/*int unk2 = */pvSrc.ReadInt32();
			/*int unk3 = */pvSrc.ReadByte();
			string name = pvSrc.ReadString( 30 );

			pvSrc.Seek( 2, SeekOrigin.Current );
			int flags = pvSrc.ReadInt32();
			pvSrc.Seek( 8, SeekOrigin.Current );
			int prof = pvSrc.ReadByte();
			pvSrc.Seek( 15, SeekOrigin.Current );

			bool female = pvSrc.ReadByte() > 0 ? true : false;
			/*int genderRace = pvSrc.ReadByte();*/
			int str = pvSrc.ReadByte();
			int dex = pvSrc.ReadByte();
			int intl= pvSrc.ReadByte();
			int is1 = pvSrc.ReadByte();
			int vs1 = pvSrc.ReadByte();
			int is2 = pvSrc.ReadByte();
			int vs2 = pvSrc.ReadByte();
			int is3 = pvSrc.ReadByte();
			int vs3 = pvSrc.ReadByte();
			int hue = pvSrc.ReadUInt16();
			int hairVal = pvSrc.ReadInt16();
			int hairHue = pvSrc.ReadInt16();
			int hairValf= pvSrc.ReadInt16();
			int hairHuef= pvSrc.ReadInt16();
			pvSrc.ReadByte();
			int cityIndex = pvSrc.ReadByte();
			/*int charSlot = */pvSrc.ReadInt32();
			/*int clientIP = */pvSrc.ReadInt32();
			int shirtHue = pvSrc.ReadInt16();
			int pantsHue = pvSrc.ReadInt16();

			CityInfo[] info = state.CityInfo;
			IAccount a = state.Account;

			if ( info == null || a == null || cityIndex < 0 || cityIndex >= info.Length )
			{
				state.Dispose();
			}
			else
			{
				// Check if anyone is using this account
				for ( int i = 0; i < a.Length; ++i )
				{
					Mobile check = a[i];

					if ( check != null && check.Map != Map.Internal )
					{
						log.InfoFormat("Login: {0}: Account in use", state);
						state.Send( new PopupMessage( PMMessage.CharInWorld ) );
						return;
					}
				}

				state.Flags = flags;

				CharacterCreatedEventArgs args = new CharacterCreatedEventArgs(
					state, a,
					name, female, hue,
					str, dex, intl,
					info[cityIndex],
					new SkillNameValue[3]
					{
						new SkillNameValue( (SkillName)is1, vs1 ),
						new SkillNameValue( (SkillName)is2, vs2 ),
						new SkillNameValue( (SkillName)is3, vs3 ),
					},
					shirtHue, pantsHue,
					hairVal, hairHue,
					hairValf, hairHuef,
					prof );

				state.Send( new ClientVersionReq() );

				state.BlockAllPackets = true;

				try {
					EventSink.InvokeCharacterCreated(args);
				} catch (Exception ex) {
					log.Fatal(String.Format("Exception disarmed in CharacterCreated {0}",
											name), ex);
				}

				Mobile m = args.Mobile;

				if ( m != null )
				{
					state.Mobile = m;
					m.NetState = state;
					new LoginTimer( state, m ).Start();
				}
				else
				{
					state.BlockAllPackets = false;
					state.Dispose();
				}
			}
		}
Exemplo n.º 43
0
 public void InvokeCharacterCreated( CharacterCreatedEventArgs e )
 {
     if ( CharacterCreated != null )
         CharacterCreated( e );
 }
Exemplo n.º 44
0
		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 = 18;
            newChar.Thirst = 12;

            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, state, 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 );

			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();
		}
Exemplo n.º 45
0
 private static void OnCharacterCreated(CharacterCreatedEventArgs args)
 {
     Timer.DelayCall(TimeSpan.FromMinutes(1.5), new TimerStateCallback(SendGumpTo), args.Mobile);
 }
Exemplo n.º 46
0
        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;
            newChar.Hue         = Utility.ClipSkinHue(args.Hue & 0x3FFF) | 0x8000;
            newChar.Hunger      = 20;
            newChar.Thirst      = 20;
            newChar.SkillsCap   = 9000;
            newChar.StatCap     = 325;
            newChar.Name        = args.Name;
            newChar.RawInt      = 75;
            newChar.RawDex      = 75;
            newChar.RawStr      = 75;

            ((Player)newChar).EoC += 20000;
            ((Player)newChar).Race = Race.Human;

            newChar.CantWalk = false;
            newChar.Frozen   = false;

            newChar.Hits = newChar.HitsMax;
            newChar.Mana = newChar.ManaMax;
            newChar.Stam = newChar.StamMax;

            AddBackpack(newChar);

            newChar.AddToBackpack(new Silver(100));
            newChar.AddToBackpack(new Copper(500));

            newChar.AddToBackpack(new SkillScroll());

            SkillName[] emptySkills = new SkillName[]
            {
                #region SkillNames
                SkillName.Alchemy,
                SkillName.Anatomy,
                SkillName.AnimalLore,
                SkillName.ItemID,
                SkillName.ArmsLore,
                SkillName.Parry,
                SkillName.Begging,
                SkillName.Blacksmith,
                SkillName.Fletching,
                SkillName.Peacemaking,
                SkillName.Camping,
                SkillName.Carpentry,
                SkillName.Cartography,
                SkillName.Cooking,
                SkillName.DetectHidden,
                SkillName.Discordance,
                SkillName.EvalInt,
                SkillName.Healing,
                SkillName.Fishing,
                SkillName.Forensics,
                SkillName.Herding,
                SkillName.Hiding,
                SkillName.Provocation,
                SkillName.Inscribe,
                SkillName.Lockpicking,
                SkillName.Magery,
                SkillName.MagicResist,
                SkillName.Tactics,
                SkillName.Snooping,
                SkillName.Musicianship,
                SkillName.Poisoning,
                SkillName.Archery,
                SkillName.SpiritSpeak,
                SkillName.Stealing,
                SkillName.Tailoring,
                SkillName.AnimalTaming,
                SkillName.TasteID,
                SkillName.Tinkering,
                SkillName.Tracking,
                SkillName.Veterinary,
                SkillName.Swords,
                SkillName.Macing,
                SkillName.Fencing,
                SkillName.Wrestling,
                SkillName.Lumberjacking,
                SkillName.Mining,
                SkillName.Meditation,
                SkillName.Stealth,
                SkillName.RemoveTrap,
                SkillName.Necromancy,
                SkillName.Focus,
                //SkillName.Chivalry,
                //SkillName.Bushido,
                //SkillName.Ninjitsu,
                //SkillName.Spellweaving,
                //SkillName.Mysticism,
                //SkillName.Imbuing,
                //SkillName.Throwing
                #endregion
            };

            for (int i = 0; i < SkillInfo.Table.Length; i++)
            {
                newChar.Skills[i].Base = 0;

                if (Array.IndexOf <SkillName>(emptySkills, newChar.Skills[i].SkillName) > -1)
                {
                    newChar.Skills[i].Cap = 100;
                }

                else
                {
                    newChar.Skills[i].Cap = 0;
                }
            }

            newChar.HairItemID       = args.HairID;
            newChar.FacialHairItemID = args.BeardID;

            newChar.HairHue       = Utility.ClipHairHue(args.HairHue & 0x3FFF);
            newChar.FacialHairHue = Utility.ClipHairHue(args.BeardHue & 0x3FFF);

            AddShirt(newChar, args.ShirtHue);
            AddPants(newChar, args.PantsHue);
            AddShoes(newChar);

            FillBankbox(newChar);

            newChar.MoveToWorld(StartingCity.Location, StartingCity.Map);

            ((Player)newChar).RespawnLocation = StartingCity.Location;
            ((Player)newChar).RespawnMap      = StartingCity.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}", StartingCity.City, StartingCity.Location, StartingCity.Map.ToString());

            new WelcomeTimer(newChar).Start();
        }
Exemplo n.º 47
0
        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)
            {
                Utility.PushColor(ConsoleColor.Red);
                Console.WriteLine("Login: {0}: Character creation failed, account full", state);
                Utility.PopColor();
                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;
                double       skillcap = Config.Player.SkillCap / 10;
                if (skillcap != 100.0)
                {
                    for (int i = 0; i < Enum.GetNames(typeof(SkillName)).Length; ++i)
                    {
                        pm.Skills[i].Cap = skillcap;
                    }
                }
                pm.Profession = args.Profession;

                if (pm.IsPlayer() && ((Account)pm.Account).Young)
                {
                    young = pm.Young = true;
                }
            }

            SetName(newChar, args.Name);

            AddBackpack(newChar);

            SetStats(newChar, state, 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)
            {
                TestCenter.FillBankbox(newChar);
            }

            if (young)
            {
                NewPlayerTicket ticket = new NewPlayerTicket();
                ticket.Owner = newChar;
                newChar.BankBox.DropItem(ticket);
            }

            CityInfo city = GetStartLocation(args, young);

            if (Core.bEnforceExpansionClient && Core.LBR)
            {
                if (city == null)
                {
                    city = new CityInfo("Britain", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca);
                }
            }

            newChar.MoveToWorld(city.Location, city.Map);

            Utility.PushColor(ConsoleColor.Green);
            Console.WriteLine("Login: {0}: New character being created (account={1})", state, args.Account.Username);
            Utility.PopColor();
            Utility.PushColor(ConsoleColor.DarkGreen);
            Console.WriteLine(" - Character: {0} (serial={1})", newChar.Name, newChar.Serial);
            Console.WriteLine(" - Started: {0} {1} in {2}", city.City, city.Location, city.Map.ToString());
            Utility.PopColor();

            new WelcomeTimer(newChar).Start();
        }
Exemplo n.º 48
0
		public static void CreateCharacter70160( NetState state, PacketReader pvSrc )
		{
			int unk1 = pvSrc.ReadInt32();
			int unk2 = pvSrc.ReadInt32();
			int unk3 = pvSrc.ReadByte();
			string name = pvSrc.ReadString( 30 );

			pvSrc.Seek( 2, SeekOrigin.Current );
			int flags = pvSrc.ReadInt32();
			pvSrc.Seek( 8, SeekOrigin.Current );
			int prof = pvSrc.ReadByte();
			pvSrc.Seek( 15, SeekOrigin.Current );

			int genderRace = pvSrc.ReadByte();

			int str = pvSrc.ReadByte();
			int dex = pvSrc.ReadByte();
			int intl= pvSrc.ReadByte();
			int is1 = pvSrc.ReadByte();
			int vs1 = pvSrc.ReadByte();
			int is2 = pvSrc.ReadByte();
			int vs2 = pvSrc.ReadByte();
			int is3 = pvSrc.ReadByte();
			int vs3 = pvSrc.ReadByte();
			int is4 = pvSrc.ReadByte();
			int vs4 = pvSrc.ReadByte();

			int hue = pvSrc.ReadUInt16();
			int hairVal = pvSrc.ReadInt16();
			int hairHue = pvSrc.ReadInt16();
			int hairValf= pvSrc.ReadInt16();
			int hairHuef= pvSrc.ReadInt16();
			pvSrc.ReadByte();
			int cityIndex = pvSrc.ReadByte();
			int charSlot = pvSrc.ReadInt32();
			int clientIP = pvSrc.ReadInt32();
			int shirtHue = pvSrc.ReadInt16();
			int pantsHue = pvSrc.ReadInt16();

			/*
			0x00, 0x01
			0x02, 0x03 -> Human Male, Human Female
			0x04, 0x05 -> Elf Male, Elf Female
			0x05, 0x06 -> Gargoyle Male, Gargoyle Female
			*/

			bool female = ((genderRace % 2) != 0);

			Race race = null;

			byte raceID = (byte)(genderRace < 4 ? 0 : ((genderRace / 2) - 1));
			race = Race.Races[raceID];
		
			if( race == null )
				race = Race.DefaultRace;

			CityInfo[] info = state.CityInfo;
			IAccount a = state.Account;

			if ( info == null || a == null || cityIndex < 0 || cityIndex >= info.Length )
			{
				state.Dispose();
			}
			else
			{
				// Check if anyone is using this account
				for ( int i = 0; i < a.Length; ++i )
				{
					Mobile check = a[i];

					if ( check != null && check.Map != Map.Internal )
					{
						Console.WriteLine( "Login: {0}: Account in use", state );
						state.Send( new PopupMessage( PMMessage.CharInWorld ) );
						return;
					}
				}

				state.Flags = (ClientFlags)flags;

				CharacterCreatedEventArgs args = new CharacterCreatedEventArgs(
					state, a,
					name, female, hue,
					str, dex, intl,
					info[cityIndex],
					new SkillNameValue[4]
					{
						new SkillNameValue( (SkillName)is1, vs1 ),
						new SkillNameValue( (SkillName)is2, vs2 ),
						new SkillNameValue( (SkillName)is3, vs3 ),
						new SkillNameValue( (SkillName)is4, vs4 ),
					},
					shirtHue, pantsHue,
					hairVal, hairHue,
					hairValf, hairHuef,
					prof,
					race
					);

				state.Send( new ClientVersionReq() );

				state.BlockAllPackets = true;

				EventSink.InvokeCharacterCreated( args );

				Mobile m = args.Mobile;

				if ( m != null )
				{
					state.Mobile = m;
					m.NetState = state;
					new LoginTimer( state, m ).Start();
				}
				else
				{
					state.BlockAllPackets = false;
					state.Dispose();
				}
			}
		}
Exemplo n.º 49
0
        private static CityInfo GetStartLocation(CharacterCreatedEventArgs args, bool isYoung)
        {
            if (Core.ML)
            {
                //if( args.State != null && args.State.NewHaven )
                return(m_NewHavenInfo);  //We don't get the client Version until AFTER Character creation
                //return args.City;  TODO: Uncomment when the old quest system is actually phased out
            }

            bool useHaven = isYoung;

            ClientFlags flags = args.State == null ? ClientFlags.None : args.State.Flags;
            Mobile      m     = args.Mobile;

            /*
             * switch ( args.Profession )
             * {
             *  case 4: //Necro
             *      {
             *          if ((flags & ClientFlags.Malas) != 0)
             *          {
             *              return new CityInfo("Umbra", "Mardoth's Tower", 2114, 1301, -50, Map.Malas);
             *          }
             *          else
             *          {
             *              useHaven = true;
             *
             *              new BadStartMessage(m, 1062205);
             *
             *              // Unfortunately you are playing on a *NON-Age-Of-Shadows* game
             *              // installation and cannot be transported to Malas.
             *              // You will not be able to take your new player quest in Malas
             *              // without an AOS client.  You are now being taken to the city of
             *              // Haven on the Trammel facet.
             *
             *          }
             *
             *          break;
             *      }
             *  case 5:	//Paladin
             *      {
             *          return m_NewHavenInfo;
             *      }
             *  case 6:	//Samurai
             *      {
             *          if ((flags & ClientFlags.Tokuno) != 0)
             *          {
             *              return new CityInfo("Samurai DE", "Haoti's Grounds", 368, 780, -1, Map.Malas);
             *          }
             *          else
             *          {
             *              useHaven = true;
             *
             *              new BadStartMessage(m, 1063487);
             *
             *              // Unfortunately you are playing on a *NON-Samurai-Empire* game
             *              // installation and cannot be transported to Tokuno.
             *              // You will not be able to take your new player quest in Tokuno
             *              // without an SE client. You are now being taken to the city of
             *              // Haven on the Trammel facet.
             *
             *          }
             *
             *          break;
             *      }
             *  case 7:	//Ninja
             *      {
             *          if ((flags & ClientFlags.Tokuno) != 0)
             *          {
             *              return new CityInfo("Ninja DE", "Enimo's Residence", 414,	823, -1, Map.Malas);
             *          }
             *          else
             *          {
             *              useHaven = true;
             *
             *              new BadStartMessage(m, 1063487);
             *
             *              // Unfortunately you are playing on a *NON-Samurai-Empire* game
             *              // installation and cannot be transported to Tokuno.
             *              // You will not be able to take your new player quest in Tokuno
             *              // without an SE client. You are now being taken to the city of
             *              // Haven on the Trammel facet.
             *
             *          }
             *
             *          break;
             *      }
             * }
             */
            if (useHaven && (Core.ML))// (!Core.bEnforceExpansionClient)
            {
                return(m_NewHavenInfo);
            }
            else
            {
                return(args.City);
            }
        }