public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int versao = reader.ReadInt(); raca = reader.ReadRace(); //recuperas as habilidades habilidades = new Dictionary<IdHabilidadeRacial, HabilidadeNode>(); int numHabilidade = reader.ReadInt(); for (int i = 0; i < numHabilidade; i++) { HabilidadeNode hn = new HabilidadeNode(); hn.Deserialize(reader); habilidades.Add((IdHabilidadeRacial)hn.Id, hn); } }
public RaceChangeConfirmGump( IRaceChanger owner, PlayerMobile from, Race targetRace ) : base( 50, 50 ) { from.CloseGump( Type ); m_Owner = owner; m_From = from; m_Race = targetRace; AddPage( 0 ); AddBackground( 0, 0, 240, 135, 0x2422 ); if ( targetRace == Race.Human ) AddHtmlLocalized( 15, 15, 210, 75, 1073643, 0, false, false ); // Are you sure you wish to embrace your humanity? else if ( targetRace == Race.Elf ) AddHtmlLocalized( 15, 15, 210, 75, 1073642, 0, false, false ); // Are you sure you want to follow the elven ways? else AddHtml( 15, 15, 210, 75, String.Format( "Are you sure you want to change your race to {0}?", targetRace.Name ), false, false ); AddButton( 160, 95, 0xF7, 0xF8, 1, GumpButtonType.Reply, 0 ); AddButton( 90, 95, 0xF2, 0xF1, 0, GumpButtonType.Reply, 0 ); }
protected override void OnRaceChange(Race oldRace) { ValidateEquipment(); UpdateResistances(); }
public static void RegisterRace( Race race ) { Race.Races[race.RaceIndex] = race; Race.AllRaces.Add( race ); }
public CharacterCreatedEventArgs( NetState state, IAccount a, string name, bool female, int hue, int str, int dex, int intel, CityInfo city, SkillNameValue[] skills, int shirtHue, int pantsHue, int hairID, int hairHue, int beardID, int beardHue, int profession, Race race ) { m_State = state; m_Account = a; m_Name = name; m_Female = female; m_Hue = hue; m_Str = str; m_Dex = dex; m_Int = intel; m_City = city; m_Skills = skills; m_ShirtHue = shirtHue; m_PantsHue = pantsHue; m_HairID = hairID; m_HairHue = hairHue; m_BeardID = beardID; m_BeardHue = beardHue; m_Profession = profession; m_Race = race; }
protected virtual void OnRaceChange( Race oldRace ) { }
public virtual void Deserialize( GenericReader reader ) { int version = reader.ReadInt(); switch ( version ) { case 36: case 35: case 34: { byte hairflag = reader.ReadByte(); if ( ( hairflag & 0x01 ) != 0 ) m_Hair = new HairInfo( reader ); if ( ( hairflag & 0x02 ) != 0 ) m_FacialHair = new FacialHairInfo( reader ); m_InstanceID = reader.ReadInt(); m_Race = reader.ReadRace(); if ( version < 36 ) reader.ReadDeltaTime(); m_TithingPoints = reader.ReadInt(); m_Corpse = reader.ReadItem() as Container; m_CreationTime = reader.ReadDateTime(); m_Stabled = reader.ReadStrongMobileList(); m_CantWalk = reader.ReadBool(); m_Virtues = new VirtueInfo( reader ); m_Thirst = reader.ReadInt(); m_BAC = reader.ReadInt(); m_ShortTermMurders = reader.ReadInt(); if ( version < 35 ) reader.ReadInt(); m_MagicDamageAbsorb = reader.ReadInt(); m_GuildFealty = reader.ReadMobile(); m_Guild = reader.ReadGuild(); m_DisplayGuildTitle = reader.ReadBool(); m_CanSwim = reader.ReadBool(); m_Squelched = reader.ReadBool(); m_Holding = reader.ReadItem(); m_BaseSoundID = reader.ReadInt(); m_DisarmReady = reader.ReadBool(); m_StunReady = reader.ReadBool(); m_StatCap = reader.ReadInt(); m_NameHue = reader.ReadInt(); m_Hunger = reader.ReadInt(); m_Location = reader.ReadPoint3D(); m_Body = new Body( reader.ReadInt() ); m_Name = reader.ReadString(); if ( m_Name != null ) m_Name = string.Intern( m_Name ); m_GuildTitle = reader.ReadString(); m_Criminal = reader.ReadBool(); m_Kills = reader.ReadInt(); m_SpeechHue = reader.ReadInt(); m_EmoteHue = reader.ReadInt(); m_WhisperHue = reader.ReadInt(); m_YellHue = reader.ReadInt(); m_Language = reader.ReadString(); if ( m_Language != null ) m_Language = string.Intern( m_Language ); m_Female = reader.ReadBool(); m_Warmode = reader.ReadBool(); m_Hidden = reader.ReadBool(); m_Direction = (Direction) reader.ReadByte(); m_Hue = reader.ReadInt(); m_Str = reader.ReadInt(); m_Dex = reader.ReadInt(); m_Int = reader.ReadInt(); m_Hits = reader.ReadInt(); m_Stam = reader.ReadInt(); m_Mana = reader.ReadInt(); m_Map = reader.ReadMap(); m_Blessed = reader.ReadBool(); m_Fame = reader.ReadInt(); m_Karma = reader.ReadInt(); m_AccessLevel = (AccessLevel) reader.ReadByte(); m_Skills = new Skills( this, reader ); int itemCount = reader.ReadInt(); m_EquippedItems = new List<Item>( itemCount ); for ( int i = 0; i < itemCount; ++i ) { Item item = reader.ReadItem(); if ( item != null ) m_EquippedItems.Add( item ); } m_IsPlayer = reader.ReadBool(); m_Title = reader.ReadString(); if ( m_Title != null ) m_Title = string.Intern( m_Title ); m_Profile = reader.ReadString(); m_ProfileLocked = reader.ReadBool(); m_AutoPageNotify = reader.ReadBool(); m_LogoutLocation = reader.ReadPoint3D(); m_LogoutMap = reader.ReadMap(); m_StrLock = (StatLockType) reader.ReadByte(); m_DexLock = (StatLockType) reader.ReadByte(); m_IntLock = (StatLockType) reader.ReadByte(); m_StatMods = new List<StatMod>(); if ( reader.ReadBool() ) { m_StuckMenuUses = new DateTime[reader.ReadInt()]; for ( int i = 0; i < m_StuckMenuUses.Length; ++i ) { m_StuckMenuUses[i] = reader.ReadDateTime(); } } else { m_StuckMenuUses = null; } if ( m_IsPlayer && m_Map != Map.Internal ) { m_LogoutLocation = m_Location; m_LogoutMap = m_Map; m_Map = Map.Internal; } if ( m_Map != null ) m_Map.OnEnter( this ); if ( m_Criminal ) { if ( m_ExpireCriminal == null ) m_ExpireCriminal = new ExpireCriminalTimer( this ); m_ExpireCriminal.Start(); } if ( ShouldCheckStatTimers ) CheckStatTimers(); UpdateRegion(); UpdateResistances(); break; } } }
public CharacterCreatedEventArgs( NetState state, IAccount a, string name, bool female, int hue, int str, int dex, int intel, CityInfo city, SkillNameValue[] skills, int shirtHue, int pantsHue, int hairID, int hairHue, int beardID, int beardHue, int profession, Race race) : this(state, a, name, female, hue, str, dex, intel, city, skills, shirtHue, pantsHue, hairID, hairHue, beardID, beardHue, profession, race, 0, 0) { }
public RaceChangeState( IRaceChanger owner, NetState ns, Race targetRace ) { m_Owner = owner; m_TargetRace = targetRace; m_Timeout = Timer.DelayCall<NetState>( m_TimeoutDelay, m_TimeoutCallback, ns ); }
public RaceChanger( bool female, Race targetRace ) : base( 0xBF ) { EnsureCapacity( 7 ); m_Stream.Write( (short)0x2A ); m_Stream.Write( (byte)( female ? 1 : 0 ) ); m_Stream.Write( (byte)( targetRace.RaceID + 1 ) ); }
private static bool CanChange( PlayerMobile from, Race targetRace ) { if ( from.Deleted ) return false; if ( from.Race == targetRace ) from.SendLocalizedMessage( 1111918 ); // You are already that race. else if ( !MondainsLegacy.CheckML( from, false ) ) from.SendLocalizedMessage( 1073651 ); // You must have Mondain's Legacy before proceeding... else if ( !from.Alive ) from.SendLocalizedMessage( 1073646 ); // Only the living may proceed... else if ( from.Mounted ) from.SendLocalizedMessage( 1073647 ); // You may not continue while mounted... else if ( !from.CanBeginAction( typeof( PolymorphSpell ) ) || DisguiseTimers.IsDisguised( from ) || AnimalForm.UnderTransformation( from ) || !from.CanBeginAction( typeof( IncognitoSpell ) ) || from.IsBodyMod ) // TODO: Does this cover everything? from.SendLocalizedMessage( 1073648 ); // You may only proceed while in your original state... else if ( from.Spell != null && from.Spell.IsCasting ) from.SendLocalizedMessage( 1073649 ); // One may not proceed while embracing magic... else if ( from.Poisoned ) from.SendLocalizedMessage( 1073652 ); // You must be healthy to proceed... else if ( IsWearingEquipment( from ) ) from.SendLocalizedMessage( 1073650 ); // To proceed you must be unburdened by equipment... else return true; return false; }
private static void Offer( IRaceChanger owner, PlayerMobile from, Race targetRace ) { NetState ns = from.NetState; if ( ns == null || !CanChange( from, targetRace ) ) return; CloseCurrent( ns ); m_Pending[ns] = new RaceChangeState( owner, ns, targetRace ); ns.Send( new RaceChanger( from.Female, targetRace ) ); }
public CharacterCreatedEventArgs(NetState state, IAccount a, string name, bool female, int hue, int str, int dex, int intel, CityInfo city, SkillNameValue[] skills, int shirtHue, int pantsHue, int hairID, int hairHue, int beardID, int beardHue, int profession, Race race, int faceID, int faceHue) { m_State = state; m_Account = a; m_Name = name; m_Female = female; m_Hue = hue; m_Str = str; m_Dex = dex; m_Int = intel; m_City = city; m_Skills = skills; m_ShirtHue = shirtHue; m_PantsHue = pantsHue; m_HairID = hairID; m_HairHue = hairHue; m_BeardID = beardID; m_BeardHue = beardHue; m_Profession = profession; m_Race = race; //UOSA m_Face = faceID; m_FaceHue = faceHue; }
public CharacterCreatedEventArgs(NetState state, IAccount a, string name, bool female, int hue, int str, int dex, int intel, CityInfo city, SkillNameValue[] skills, int shirtHue, int pantsHue, int hairID, int hairHue, int beardID, int beardHue, int profession, Race race) : this(state, a, name, female, hue, str, dex, intel, city, skills, shirtHue, pantsHue, hairID, hairHue, beardID, beardHue, profession, race, 0, 0) { }
/** * Atribui os valores da raca ao jogador. */ public void aplicarRaca(Race raca) { bool feminino = jogador.Female; int cabeloCor = raca.RandomHairHue(); int PeleCor = raca.RandomSkinHue(); int barba = raca.RandomFacialHair(feminino); int cabelo = raca.RandomHair(feminino); //atribui o cabelo jogador.HairItemID = cabelo; jogador.HairHue = cabeloCor; //atribui a barba jogador.FacialHairItemID = barba; jogador.FacialHairHue = cabeloCor; //se tiver a barba de orc, remove e pode adicionar novamente abaixo. Item barbaItem = jogador.FindItemOnLayer(Layer.FacialHair); if (barbaItem is OrcMascaraBarba) { jogador.RemoveItem(barbaItem); } //adiciona a barba padrão para os orcs if (raca is MeioOrc) { jogador.AddItem(new OrcMascaraBarba(PeleCor)); } //atribui o corpo jogador.BodyValue = raca.AliveBody(feminino); //atribui a cor da pelo jogador.Hue = PeleCor; //atribui no modulo de raca a raca escolhida RacaModule rm = getRacaModule(); rm.Raca = raca; jogador.SendMessage("Você acaba de se tornar um {0}", raca.Name); }
public abstract void Write(Race value);