public static void InvokeCharacterCreated(CharacterCreatedEventArgs e) { if (CharacterCreated != null) { CharacterCreated(e); } }
/// 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)); } } }
private static void EventSink_CharacterCreated(CharacterCreatedEventArgs e) { int page = 0; int xselect_var = 0; SpellBarScroll scroll = (SpellBarScroll)XmlAttach.FindAttachment(e.Mobile, typeof(SpellBarScroll)); if ( scroll == null ) { XmlAttach.AttachTo(e.Mobile, new SpellBarScroll()); //e.Mobile.SendGump(new Test_Gump(attachment)); return; } if ( scroll.Open == 1 & scroll != null ) { e.Mobile.SendGump(new SpellBarGump.SpellBar_BarGump( e.Mobile, scroll, scroll.xo, scroll.yo )); } }
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)); } } } }
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 *** } }
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; }
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(); }
public static void InvokeCharacterCreated(CharacterCreatedEventArgs e) => CharacterCreated?.Invoke(e);
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(); }
private static void EventSink_CharacterCreated(CharacterCreatedEventArgs args) { if (!VerifyProfession(args.Profession)) args.Profession = 0; Mobile newChar = CreateMobile(args.Account as Account); if (newChar == null) { Console.WriteLine("Login: {0}: Character creation failed, account full", args.State); return; } args.Mobile = newChar; m_Mobile = newChar; newChar.Player = true; newChar.AccessLevel = args.Account.AccessLevel; newChar.Female = args.Female; //newChar.Body = newChar.Female ? 0x191 : 0x190; if (Core.Expansion >= args.Race.RequiredExpansion) newChar.Race = args.Race; //Sets body else newChar.Race = Race.DefaultRace; //newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000; newChar.Hue = newChar.Race.ClipSkinHue(args.Hue & 0x3FFF) | 0x8000; #region GeNova: KR Support newChar.FaceHue = newChar.Hue; #endregion newChar.Hunger = 20; bool young = false; if (newChar is PlayerMobile) { PlayerMobile pm = (PlayerMobile)newChar; pm.Profession = args.Profession; if (pm.AccessLevel == AccessLevel.Player && ((Account)pm.Account).Young) young = pm.Young = true; } SetName(newChar, args.Name); AddBackpack(newChar); SetStats(newChar, args.Str, args.Dex, args.Int); SetSkills(newChar, args.Skills, args.Profession); Race race = newChar.Race; if (race.ValidateHair(newChar, args.HairID)) { newChar.HairItemID = args.HairID; newChar.HairHue = race.ClipHairHue(args.HairHue & 0x3FFF); } if (race.ValidateFacialHair(newChar, args.BeardID)) { newChar.FacialHairItemID = args.BeardID; newChar.FacialHairHue = race.ClipHairHue(args.BeardHue & 0x3FFF); } #region GeNova: KR Supports if (race.ValidateFace(newChar, args.FaceID)) { newChar.FaceItemID = args.FaceID; newChar.FaceHue = args.FaceHue; } #endregion if (args.Profession <= 3) { #region GeNova: KR Supports if (args.ShirtHue.Equals(0) && args.PantsHue.Equals(0)) { /*in UO: KR is not possible to choose a colour of the items below.*/ int clothesHue = Utility.RandomDyedHue(); AddShirt(newChar, clothesHue); AddPants(newChar, clothesHue); } #endregion else { AddShirt(newChar, args.ShirtHue); AddPants(newChar, args.PantsHue); } AddShoes(newChar); } if (TestCenter.Enabled) FillBankbox(newChar); if (young) { NewPlayerTicket ticket = new NewPlayerTicket(); ticket.Owner = newChar; newChar.BankBox.DropItem(ticket); } CityInfo city = GetStartLocation(args, young); //CityInfo city = new CityInfo( "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()); // GeNova: setando nome do personagem para PersonagemDesconhecido.NomePadrao. SetName(newChar, PersonagemDesconhecido.NomePadrao); new WelcomeTimer(newChar).Start(); }
private static void EventSink_CharacterCreated( CharacterCreatedEventArgs args ) { if ( !VerifyProfession( args.Profession ) ) args.Profession = 0; Mobile newChar = CreateMobile( args.Account as Account ); if ( newChar == null ) { Console.WriteLine( "Login: {0}: Character creation failed, account full", args.State ); return; } args.Mobile = newChar; m_Mobile = newChar; newChar.Player = true; newChar.AccessLevel = args.Account.AccessLevel; newChar.Female = args.Female; //newChar.Body = newChar.Female ? 0x191 : 0x190; if( Core.Expansion >= args.Race.RequiredExpansion ) newChar.Race = args.Race; //Sets body else newChar.Race = Race.DefaultRace; //newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000; newChar.Hue = newChar.Race.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000; newChar.Hunger = 20; newChar.Skills.Cap = 61100; //na85 - 47 skills * 130 pts per skill = 6110 plus an extra zero for the 0.x //should this be 47*150? Need to look into AOS.cs and obeycap boolean's behaviour SetAllSkillcaps( newChar, 130.0 ); //na85 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 = false; //na85 - disables Young player status because it's easymode bullshit } SetName( newChar, args.Name ); AddBackpack( newChar ); SetStats( newChar, args.Str, args.Dex, args.Int ); SetSkills( newChar, args.Skills, args.Profession ); Race race = newChar.Race; if( race.ValidateHair( newChar, args.HairID ) ) { newChar.HairItemID = args.HairID; newChar.HairHue = race.ClipHairHue( args.HairHue & 0x3FFF ); } if( race.ValidateFacialHair( newChar, args.BeardID ) ) { newChar.FacialHairItemID = args.BeardID; newChar.FacialHairHue = race.ClipHairHue( args.BeardHue & 0x3FFF ); } if ( args.Profession <= 3 ) { AddShirt( newChar, args.ShirtHue ); AddPants( newChar, args.PantsHue ); AddShoes( newChar ); } if( TestCenter.Enabled ) FillBankbox( newChar ); if ( young ) { NewPlayerTicket ticket = new NewPlayerTicket(); ticket.Owner = newChar; newChar.BankBox.DropItem( ticket ); } 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(); }
private static void EventSink_CharacterCreated( CharacterCreatedEventArgs args ) { if ( !VerifyProfession( args.Profession ) ) args.Profession = 0; Mobile newChar = CreateMobile( args.Account as Account ); if ( newChar == null ) { Console.WriteLine( "Login: {0}: Character creation failed, account full", args.State ); return; } args.Mobile = newChar; m_Mobile = newChar; newChar.Player = true; newChar.AccessLevel = args.Account.AccessLevel; newChar.Female = args.Female; //newChar.Body = newChar.Female ? 0x191 : 0x190; if( Core.Expansion >= args.Race.RequiredExpansion ) newChar.Race = args.Race; //Sets body else newChar.Race = Race.DefaultRace; //newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000; newChar.Hue = newChar.Race.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000; newChar.Hunger = 20; newChar.Skills.Cap = 58000; newChar.BonusMaxWeight = 1374; bool young = false; if ( newChar is PlayerMobile ) { PlayerMobile pm = (PlayerMobile) newChar; pm.Profession = args.Profession; if ( pm.AccessLevel == AccessLevel.Player && ((Account)pm.Account).Young ) young = pm.Young = true; } SetName( newChar, args.Name ); AddBackpack( newChar ); SetStats( newChar, args.Str, args.Dex, args.Int ); SetSkills( newChar, args.Skills, args.Profession ); Race race = newChar.Race; if( race.ValidateHair( newChar, args.HairID ) ) { newChar.HairItemID = args.HairID; newChar.HairHue = race.ClipHairHue( args.HairHue & 0x3FFF ); } if( race.ValidateFacialHair( newChar, args.BeardID ) ) { newChar.FacialHairItemID = args.BeardID; newChar.FacialHairHue = race.ClipHairHue( args.BeardHue & 0x3FFF ); } if ( args.Profession <= 3 ) { AddShirt( newChar, args.ShirtHue ); AddPants( newChar, args.PantsHue ); AddShoes( newChar ); } //STUFFIADDED { Container cont = new WoodenBox(); Container bank = newChar.BankBox; cont.ItemID = 0xE7D; cont.Hue = 0x489; cont.Name = "Money Box"; PlaceItemIn( cont, 16, 51, new BankCheck( 4000 ) ); PlaceItemIn( bank, 26, 1, cont ); PlaceItemIn( bank, 36, 5, new Bandage( 50 ) ); PlaceItemIn( bank, 46, 10, new BagOfReagents() ); } //StuffIAdded if( TestCenter.Enabled ) FillBankbox( newChar ); if ( young ) { NewPlayerTicket ticket = new NewPlayerTicket(); ticket.Owner = newChar; newChar.BankBox.DropItem( ticket ); } CityInfo city = GetStartLocation( args, young ); //CityInfo city = new CityInfo( "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(); }
private static CityInfo GetStartLocation(CharacterCreatedEventArgs args, bool isYoung) { if (args.City != null) return args.City; else return new CityInfo("Britain", "Sweet Dreams Inn", 1496, 1628, 10, 0, Map.Felucca); //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; }
private static void EventSink_CharacterCreated( CharacterCreatedEventArgs args ) { if ( !VerifyProfession( args.Profession ) ) args.Profession = 0; Mobile newChar = CreateMobile( args.Account as Account ); if ( newChar == null ) { Console.WriteLine( "Login: {0}: Character creation failed, account full", args.State ); return; } args.Mobile = newChar; m_Mobile = newChar; // newChar.Player = true; newChar.AccessLevel = ((Account)args.Account).AccessLevel; newChar.Female = args.Female; newChar.Body = newChar.Female ? 0x191 : 0x190; newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000; newChar.Hunger = 20; bool young = false; if ( newChar is PlayerMobile ) { PlayerMobile pm = (PlayerMobile) newChar; pm.Profession = args.Profession; if ( pm.AccessLevel == AccessLevel.Player && ((Account)pm.Account).Young ) young = pm.Young = true; } SetName( newChar, args.Name ); AddBackpack( newChar ); SetStats( newChar, args.Str, args.Dex, args.Int ); SetSkills( newChar, args.Skills, args.Profession ); AddHair( newChar, args.HairID, Utility.ClipHairHue( args.HairHue & 0x3FFF ) ); AddBeard( newChar, args.BeardID, Utility.ClipHairHue( args.BeardHue & 0x3FFF ) ); if ( args.Profession <= 3 ) { AddShirt( newChar, args.ShirtHue ); AddPants( newChar, args.PantsHue ); AddShoes( newChar ); } if( TestCenter.Enabled ) FillBankbox( newChar ); if ( young ) { PackItem( new NewPlayerBook() ); } if ( young && newChar.BankBox != null ) { NewerPlayerTicket ticket = new NewerPlayerTicket(); ticket.Owner = newChar; newChar.BankBox.DropItem( new Spellbook( UInt64.MaxValue ) );//Al: Fix for unblessed spellbook newChar.BankBox.DropItem( ticket ); newChar.BankBox.DropItem( MakeNewbie( new BlackPearl( 30 ) ) ); newChar.BankBox.DropItem( MakeNewbie( new Bloodmoss( 30 ) ) ); newChar.BankBox.DropItem( MakeNewbie( new Garlic( 30 ) ) ); newChar.BankBox.DropItem( MakeNewbie( new Ginseng( 30 ) ) ); newChar.BankBox.DropItem( MakeNewbie( new MandrakeRoot( 30 ) ) ); newChar.BankBox.DropItem( MakeNewbie( new Nightshade( 30 ) ) ); newChar.BankBox.DropItem( MakeNewbie( new SulfurousAsh( 30 ) ) ); newChar.BankBox.DropItem( MakeNewbie( new SpidersSilk( 30 ) ) ); } //Al: personalized skill/statsball for wiped veteran accounts if ( newChar.Account is Account && ((Account)newChar.Account).CharacterCount == 1 && (DateTime.Now - ((Account)newChar.Account).Created) >= TimeSpan.FromDays(10000) ) { int skillballsReceived; try { skillballsReceived = Int32.Parse(((Account)newChar.Account).GetTag("WelcomeBackSkillballsReceived")); } catch { skillballsReceived = 0; } if (skillballsReceived < MAXIMUM_WELCOME_BACK_SKILLBALLS) { ((Account)newChar.Account).SetTag("WelcomeBackSkillballsReceived", (++skillballsReceived).ToString()); newChar.AddToBackpack(new WelcomeBackSkillball(newChar)); newChar.AddToBackpack(new NewPlayerStatsBall(newChar)); } } //CityInfo city = GetStartLocation( args, young ); � CityInfo city = new CityInfo( "Young Town", "Young Town Entrance", 1243, 1193, -29, Map.Ilshenar ); // Added 2011-Feb-06 //CityInfo city = new CityInfo( "Britain", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca ); //**** ADDED FOR 1ST MARCH SPECIAL //if (newChar.Account.Count <= 1 /*|| (GetSharedAccounts((newChar.Account as Account).LoginIPs)).Count <= 1*/) //{ // city = new CityInfo("Newbie City", "Start room", 5738, 797, 0, Map.Felucca); //} //**** END 1ST MARCH SPECIAL newChar.MoveToWorld( city.Location, city.Map ); Console.WriteLine( "Login: {0}: New character being created (account={1})", args.State, ((Account)args.Account).Username ); Console.WriteLine( " - Character: {0} (serial={1})", newChar.Name, newChar.Serial ); Console.WriteLine( " - Started: {0} {1} in {2}", city.City, city.Location, city.Map.ToString() ); //new WelcomeTimer( newChar ).Start(); //This has to be done here and not in a separate CharacterCreated-Event to get a reference to the new PlayerMobile //Player can set the email address till exactly 24 hours after account creation. if ( newChar.Account is Account && (DateTime.Now - ((Account)newChar.Account).Created <= TimeSpan.FromHours(24))) Timer.DelayCall(TimeSpan.FromSeconds(5), new TimerStateCallback(EmailSystem.SendEmailGump), newChar as PlayerMobile); }
public static void InvokeCharacterCreated(CharacterCreatedEventArgs e) { if (CharacterCreated != null) { foreach (CharacterCreatedEventHandler currentDelegate in CharacterCreated.GetInvocationList()) { try { currentDelegate.Invoke(e); } catch (Exception ex) { // Log an exception EventSink.InvokeLogException(new LogExceptionEventArgs(ex)); } } } }
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; } newChar.Race = Race.Human; 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.RequiredExpasnion ) 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; } SetName( newChar, args.Name ); AddBackpack( newChar ); SetStats( newChar, args.Str, args.Dex, args.Int ); SetSkills( newChar, args.Skills, args.Profession ); Race race = newChar.Race; if( race.ValidateHair( newChar, args.HairID ) ) { newChar.HairItemID = args.HairID; newChar.HairHue = race.ClipHairHue( args.HairHue & 0x3FFF ); } if( race.ValidateFacialHair( newChar, args.BeardID ) ) { newChar.FacialHairItemID = args.BeardID; newChar.FacialHairHue = race.ClipHairHue( args.BeardHue & 0x3FFF ); } AddShirt( newChar, args.ShirtHue ); AddPants( newChar, args.PantsHue ); AddShoes( newChar ); if( newChar.BankBox != null ) { BankBox bankbox = newChar.FindItemOnLayer( Layer.Bank ) as BankBox; bankbox.Delete(); } PlayerBankBox pbb = new PlayerBankBox( newChar ); newChar.AddItem( pbb ); newChar.Blessed = true; CityInfo city = GetStartLocation( args, false ); //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(); }
private static CityInfo GetStartLocation( CharacterCreatedEventArgs args, bool isYoung ) { bool useHaven = isYoung; int flags = args.State == null ? 0 : args.State.Flags; Mobile m = args.Mobile; return new CityInfo( "Creation", "Creation Chamber", 5449, 1238, -95, Map.Felucca ); }
public void EventSink_CharacterCreated(CharacterCreatedEventArgs e) { TryGift(e.Mobile); }
private static void EventSink_CharacterCreated(CharacterCreatedEventArgs obj) { SendService.SendCharacterCreated(obj.Name); }
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 ); } } }
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); }
private static void EventSink_CharacterCreated( CharacterCreatedEventArgs args ) { if ( !VerifyProfession( args.Profession ) ) args.Profession = 0; Mobile newChar = CreateMobile( args.Account as Account ); if ( newChar == null ) { Console.WriteLine( "Login: {0}: Character creation failed, account full", args.State ); return; } args.Mobile = newChar; m_Mobile = newChar; newChar.Player = true; newChar.AccessLevel = args.Account.AccessLevel; newChar.Female = args.Female; //newChar.Body = newChar.Female ? 0x191 : 0x190; if( Core.Expansion >= args.Race.RequiredExpasnion ) newChar.Race = args.Race; //Sets body else newChar.Race = Race.DefaultRace; //newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000; newChar.Hue = newChar.Race.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000; newChar.Hunger = 20; newChar.Skills.Cap = 108000; newChar.FollowersMax = 10; newChar.Skills[SkillName.Alchemy].Cap = 2000; newChar.Skills[SkillName.Anatomy].Cap = 2000; newChar.Skills[SkillName.AnimalLore].Cap = 2000; newChar.Skills[SkillName.ItemID].Cap = 2000; newChar.Skills[SkillName.ArmsLore].Cap = 2000; newChar.Skills[SkillName.Parry].Cap = 2000; newChar.Skills[SkillName.Begging].Cap = 2000; newChar.Skills[SkillName.Blacksmith].Cap = 2000; newChar.Skills[SkillName.Fletching].Cap = 2000; newChar.Skills[SkillName.Peacemaking].Cap = 2000; newChar.Skills[SkillName.Camping].Cap = 2000; newChar.Skills[SkillName.Carpentry].Cap = 2000; newChar.Skills[SkillName.Cartography].Cap = 2000; newChar.Skills[SkillName.Cooking].Cap = 2000; newChar.Skills[SkillName.DetectHidden].Cap = 2000; newChar.Skills[SkillName.Discordance].Cap = 2000; newChar.Skills[SkillName.EvalInt].Cap = 2000; newChar.Skills[SkillName.Healing].Cap = 2000; newChar.Skills[SkillName.Fishing].Cap = 2000; newChar.Skills[SkillName.Forensics].Cap = 2000; newChar.Skills[SkillName.Herding].Cap = 2000; newChar.Skills[SkillName.Hiding].Cap = 2000; newChar.Skills[SkillName.Provocation].Cap = 2000; newChar.Skills[SkillName.Inscribe].Cap = 2000; newChar.Skills[SkillName.Lockpicking].Cap = 2000; newChar.Skills[SkillName.Magery].Cap = 2000; newChar.Skills[SkillName.MagicResist].Cap = 2000; newChar.Skills[SkillName.Tactics].Cap = 2000; newChar.Skills[SkillName.Snooping].Cap = 2000; newChar.Skills[SkillName.Musicianship].Cap = 2000; newChar.Skills[SkillName.Poisoning].Cap = 2000; newChar.Skills[SkillName.Archery].Cap = 2000; newChar.Skills[SkillName.SpiritSpeak].Cap = 2000; newChar.Skills[SkillName.Stealing].Cap = 2000; newChar.Skills[SkillName.Tailoring].Cap = 2000; newChar.Skills[SkillName.AnimalTaming].Cap = 2000; newChar.Skills[SkillName.TasteID].Cap = 2000; newChar.Skills[SkillName.Tinkering].Cap = 2000; newChar.Skills[SkillName.Tracking].Cap = 2000; newChar.Skills[SkillName.Veterinary].Cap = 2000; newChar.Skills[SkillName.Swords].Cap = 2000; newChar.Skills[SkillName.Macing].Cap = 2000; newChar.Skills[SkillName.Fencing].Cap = 2000; newChar.Skills[SkillName.Wrestling].Cap = 2000; newChar.Skills[SkillName.Lumberjacking].Cap = 2000; newChar.Skills[SkillName.Mining].Cap = 2000; newChar.Skills[SkillName.Meditation].Cap = 2000; newChar.Skills[SkillName.Stealth].Cap = 2000; newChar.Skills[SkillName.RemoveTrap].Cap = 2000; newChar.Skills[SkillName.Necromancy].Cap = 2000; newChar.Skills[SkillName.Focus].Cap = 2000; newChar.Skills[SkillName.Chivalry].Cap = 2000; newChar.StatCap = 9000; bool young = false; if ( newChar is PlayerMobile ) { PlayerMobile pm = (PlayerMobile) newChar; pm.Profession = args.Profession; if ( pm.AccessLevel == AccessLevel.Player && ((Account)pm.Account).Young ) young = pm.Young = true; } SetName( newChar, args.Name ); AddBackpack( newChar ); SetStats( newChar, args.Str, args.Dex, args.Int ); SetSkills( newChar, args.Skills, args.Profession ); Race race = newChar.Race; if( race.ValidateHair( newChar, args.HairID ) ) { newChar.HairItemID = args.HairID; newChar.HairHue = race.ClipHairHue( args.HairHue & 0x3FFF ); } if( race.ValidateFacialHair( newChar, args.BeardID ) ) { newChar.FacialHairItemID = args.BeardID; newChar.FacialHairHue = race.ClipHairHue( args.BeardHue & 0x3FFF ); } if ( args.Profession <= 3 ) { AddShirt( newChar, args.ShirtHue ); AddPants( newChar, args.PantsHue ); AddShoes( newChar ); } if( TestCenter.Enabled ) FillBankbox( newChar ); if ( young && 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 ); 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(); // mod to attach the MobFactions attachment automatically to new chars XmlAttach.AttachTo(newChar, new XmlMobFactions()); // mod to attach the XmlPoints attachment automatically to new chars XmlAttach.AttachTo(newChar, new XmlPoints()); }
public static void InvokeCharacterCreated( CharacterCreatedEventArgs e ) { if ( CharacterCreated != null ) CharacterCreated( e ); }
private static CityInfo GetStartLocation( CharacterCreatedEventArgs args, bool isYoung ) { bool useHaven = isYoung; int flags = args.State == null ? 0 : args.State.Flags; Mobile m = args.Mobile; switch ( args.Profession ) { case 4: //Necro { if ( (flags & 0x8) != 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 new CityInfo( "Haven", "Uzeraan's Mansion", 3578, 2589, 0, Map.Trammel ); } case 6: //Samurai { if ( (flags & 0x10) != 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 & 0x10) != 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 new CityInfo( "Haven", "Uzeraan's Mansion", 3582, 2587, 0, Map.Trammel ); else return args.City; }
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; } } }
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 ) { 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; 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(); }
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.StatCap = 225; newChar.Player = true; newChar.AccessLevel = ((Account)args.Account).AccessLevel; if ( newChar.AccessLevel != AccessLevel.Player ) newChar.Hidden = true; newChar.Female = args.Female; newChar.Body = newChar.Female ? 0x191 : 0x190; newChar.Hue = Utility.ClipSkinHue( args.Hue & 0x3FFF ) | 0x8000; newChar.Hunger = 20; newChar.FollowersMax = 0; SetName( newChar, args.Name ); AddBackpack( newChar ); PackItem( new Gold( 100 ) ); 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 != 4 && args.Profession != 5 ) { AddShirt( newChar, args.ShirtHue ); AddPants( newChar, args.PantsHue ); AddShoes( newChar ); } //CityInfo city = new CityInfo( "Jail", "Cell 9", 5273, 1185, 0 ); //CityInfo city = new CityInfo( "Britain", "Sweet Dreams Inn", 1496, 1628, 10 ); //newChar.Location = city.Location; newChar.MoveToWorld( args.City.Location, Map.Felucca ); //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 ); Console.WriteLine( "Login: {0}: ({3}) New Char '{1}' (serial={2})", args.State, newChar.Name, newChar.Serial, args.Account ); /* Meditation = 46, Stealth = 47, RemoveTrap = 48, Necromancy = 49, Focus = 50, Chivalry = 51 */ for (int i = 0; i < newChar.Skills.Length; ++i) { if (i < (int)SkillName.Meditation) { newChar.Skills[i].Cap = 100; } else { newChar.Skills[i].Base = 0; newChar.Skills[i].Cap = 0; } newChar.Skills[i].SetLockNoRelay(SkillLock.Locked); } newChar.IntLock = StatLockType.Locked; newChar.StrLock = StatLockType.Locked; newChar.DexLock = StatLockType.Locked; new WelcomeTimer( newChar ).Start(); }