Inheritance: IDictionary, ICollection, IEnumerable, ICloneable
コード例 #1
0
        public override void OnDoubleClick(Mobile m)
        {
            if (m.Backpack != null && m.Backpack.GetAmount(typeof(DonationFullSkillBall)) > 0)
            {
                m.SendMessage("Thanks for supporting UOSunrise.");


                Server.Skills skills = m.Skills;

                for (int i = 0; i < skills.Length; ++i)
                {
                    skills[i].Base = 100;
                }
                for (int i = 0; i < 55; ++i)
                {
                    m.Skills[i].Base = val;
                }

                this.Delete();
            }
            else
            {
                m.SendMessage(" You need to have the skill ball in your backpack.");
            }
        }
コード例 #2
0
ファイル: SkillBall.cs プロジェクト: Yeajimi/CustomUO
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile m = state.Mobile;

            switch (info.ButtonID)
            {
            case 0: { break; }

            case 1:
            {
                /*if (info.Switches.Length < switches)
                 * {
                 *  m.SendGump(new SkilllimPickGump(m_SkillBall, m));
                 *  m.SendMessage(0, "You must pick {0} more skills.", switches - info.Switches.Length);
                 *  break;
                 * }
                 * else if (info.Switches.Length > switches)
                 * {
                 *  m.SendGump(new SkilllimPickGump(m_SkillBall, m));
                 *  m.SendMessage(0, "Please get rid of {0} skills, you have exceeded the 7 skills that are allowed.", info.Switches.Length - switches);
                 *  break;
                 *
                 * }
                 *
                 * else
                 * {*/

                Server.Skills skills = m.Skills;

                for (int i = 0; i < skills.Length; ++i)
                {
                    skills[i].Base = 0;
                }
                for (int i = 0; i < skills.Length; ++i)
                {
                    if (info.IsSwitched(i))
                    {
                        m.Skills[i].Base = val;
                    }
                }

                //m_SkillBall.Delete();

                //}

                break;
            }
            }
        }
コード例 #3
0
 public override void OnDoubleClick(Mobile m)
 {
     if (!IsChildOf(m.Backpack))
     {
         m.SendLocalizedMessage(1042001);    // That must be in your pack for you to use it.
     }
     else
     {
         Server.Skills skills = m.Skills;
         for (int i = 0; i < skills.Length; ++i)
         {
             skills[i].Base = 120;
         }
         this.Delete();
     }
 }
コード例 #4
0
        public static void PrepareServerWar()
        {
            m_ServerWars = true;
            FactionReset();

            Map[] maps = Map.Maps;

            for (int i = 0; i < maps.Length; i++)
            {
                if (maps[i] != null)
                {
                    foreach (Region region in maps[i].Regions.Values)
                    {
                        if (region != null && region is GuardedRegion)
                        {
                            ((GuardedRegion)region).Disabled = true;
                        }
                    }
                }
            }

            for (int i = 0; i < m_RegStoneLocs.Length; i++)
            {
                new VendStone(1153, "BagOfReagents", "Bag of {0} Reagents (SERVER WARS)", 0, "100").MoveToWorld(m_RegStoneLocs[i], Map.Felucca);
            }

            foreach (NetState ns in NetState.Instances)
            {
                if (ns.Mobile != null && ns.Mobile.AccessLevel == AccessLevel.Player)
                {
                    ns.Mobile.BankBox.DropItem(new BankCheck(100000));
                    ns.Mobile.BankBox.DropItem(new BagOfReagents(10000));
                    Spellbook book = new Spellbook(ulong.MaxValue);
                    book.LootType = LootType.Blessed;
                    ns.Mobile.BankBox.DropItem(book);

                    Server.Skills skills = ns.Mobile.Skills;

                    for (int i = 0; i < skills.Length; ++i)
                    {
                        skills[i].BaseFixedPoint = 1000;
                    }
                }
            }
        }
コード例 #5
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Mobile)
                {
                    Mobile        targ   = (Mobile)targeted;
                    Server.Skills skills = targ.Skills;

                    for (int i = 0; i < skills.Length; ++i)
                    {
                        CommandLogging.LogChangeProperty(from, targ, String.Format("{0}.Base", skills[i].Name), skills[i].Base.ToString(), m_Value.ToString());
                        skills[i].Base = m_Value;
                    }
                }
                else
                {
                    from.SendMessage("That does not have skills!");
                }
            }
コード例 #6
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is PlayerMobile)
                {
                    Mobile        targ   = (Mobile)targeted;
                    Server.Skills skills = targ.Skills;

                    for (int i = 0; i < skills.Length; ++i)
                    {
                        skills[i].Cap = m_Value;
                    }

                    CommandLogging.LogChangeProperty(from, targ, "EverySkill.Cap", m_Value.ToString());
                }
                else
                {
                    from.SendMessage("That does not have skills!");
                }
            }
コード例 #7
0
        public static void FixPlayer(PlayerMobile mob)
        {
            if (mob != null)
            {
                Server.Skills skills = mob.Skills;

                int totalDecrease = 0;

                for (int i = 0; i < skills.Length; i++)
                {
                    Skill skill = skills[i];

                    if (skill.CapFixedPoint > 1000)
                    {
                        skill.CapFixedPoint = 1000;
                    }

                    if (skill.BaseFixedPoint > 1000)
                    {
                        totalDecrease       += skill.BaseFixedPoint - 1000;
                        skill.BaseFixedPoint = 1000;
                    }
                }

                mob.SkillsCap = 7000;

                int totalGiveSkill = Math.Min(totalDecrease, 7000 - skills.Total);

                if (totalGiveSkill > 0)
                {
                    EtherealSoulStone stone = new EtherealSoulStone(mob.Account.Username);
                    stone.SkillValue = (totalGiveSkill / 10.0);
                    mob.AddToBackpack(stone);
                }
            }
        }
コード例 #8
0
ファイル: Skills.cs プロジェクト: karliky/wowwow
 public static Skills Synchronized(Skills nonSync)
 {
     Skills sync = new Skills();
     sync.innerHash = Hashtable.Synchronized(nonSync.innerHash);
     return sync;
 }
コード例 #9
0
        public Skill(Skills owner, SkillInfo info, GenericReader reader)
        {
            Owner = owner;
            Info  = info;

            int version = reader.ReadByte();

            switch (version)
            {
            case 0:
            {
                m_Base = reader.ReadUShort();
                m_Cap  = reader.ReadUShort();
                Lock   = (SkillLock)reader.ReadByte();

                break;
            }

            case 0xFF:
            {
                m_Base = 0;
                m_Cap  = 1000;
                Lock   = SkillLock.Up;

                break;
            }

            default:
            {
                if ((version & 0xC0) == 0x00)
                {
                    if ((version & 0x1) != 0)
                    {
                        m_Base = reader.ReadUShort();
                    }

                    if ((version & 0x2) != 0)
                    {
                        m_Cap = reader.ReadUShort();
                    }
                    else
                    {
                        m_Cap = 1000;
                    }

                    if ((version & 0x4) != 0)
                    {
                        Lock = (SkillLock)reader.ReadByte();
                    }

                    if ((version & 0x8) != 0)
                    {
                        VolumeLearned = reader.ReadInt();
                    }

                    if ((version & 0x10) != 0)
                    {
                        NextGGSGain = reader.ReadDateTime();
                    }
                }

                break;
            }
            }

            if (Lock < SkillLock.Up || Lock > SkillLock.Locked)
            {
                Console.WriteLine("Bad skill lock -> {0}.{1}", owner.Owner, Lock);
                Lock = SkillLock.Up;
            }
        }
コード例 #10
0
ファイル: Mobile.cs プロジェクト: Ravenwolfe/xrunuo
 /// <summary>
 /// Initialize some fields when creating a fresh new Mobile. Otherwise these should be initialized by <see cref="Deserialize"/> method.
 /// </summary>
 private void DefaultMobileInit()
 {
     m_StatCap = 225;
     m_Skills = new Skills( this );
     m_EquippedItems = new List<Item>( 1 );
     m_StatMods = new List<StatMod>( 1 );
     Map = Map.Internal;
     m_AutoPageNotify = true;
     m_Virtues = new VirtueInfo();
     m_Stabled = new List<Mobile>( 1 );
     m_CreationTime = DateTime.Now;
 }
コード例 #11
0
ファイル: Skills.cs プロジェクト: karliky/wowwow
 public Skills Clone()
 {
     Skills clone = new Skills();
     clone.innerHash = (Hashtable) innerHash.Clone();
     return clone;
 }
コード例 #12
0
ファイル: Classe.cs プロジェクト: evildude807/kaltar
 /**
  * Atribui o valorMaximo para o Cap de todas as skills.
  */
 protected void skillsMaximoCap(Skills skills, double valorMaximo)
 {
     Skill skill;
     for (int i = 0; i < skills.Length; i++)
     {
         skill = skills[i];
         skill.Cap = valorMaximo;
     }
 }
コード例 #13
0
ファイル: Mobile.cs プロジェクト: Ravenwolfe/xrunuo
        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;
                    }
            }
        }
コード例 #14
0
ファイル: Skills.cs プロジェクト: AlcesAlces/UOsmart
        public Skill( Skills owner, SkillInfo info, GenericReader reader )
        {
            m_Owner = owner;
            m_Info = info;

            int version = reader.ReadByte();

            switch ( version )
            {
                case 0:
                {
                    m_Base = reader.ReadUShort();
                    m_Cap = reader.ReadUShort();
                    m_Lock = (SkillLock)reader.ReadByte();

                    break;
                }
                case 0xFF:
                {
                    m_Base = 0;
                    m_Cap = 1000;
                    m_Lock = SkillLock.Up;

                    break;
                }
                default:
                {
                    if ( (version & 0xC0) == 0x00 )
                    {
                        if ( (version & 0x1) != 0 )
                            m_Base = reader.ReadUShort();

                        if ( (version & 0x2) != 0 )
                            m_Cap = reader.ReadUShort();
                        else
                            m_Cap = 1000;

                        if ( (version & 0x4) != 0 )
                            m_Lock = (SkillLock)reader.ReadByte();
                    }

                    break;
                }
            }

            if ( m_Lock < SkillLock.Up || m_Lock > SkillLock.Locked )
            {
                Console.WriteLine( "Bad skill lock -> {0}.{1}", owner.Owner, m_Lock );
                m_Lock = SkillLock.Up;
            }
        }
コード例 #15
0
ファイル: Aldeao.cs プロジェクト: evildude807/kaltar
 private void adicionarSkillCap(Skills skills)
 {
     skillsMaximoCap(skills, 40.0);
 }
コード例 #16
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile m = state.Mobile;

            switch (info.ButtonID)
            {
            case 0: { break; }

            case 1:
            {
                if (info.Switches.Length < switches)
                {
                    m.SendGump(new SkillPickGump5x80());
                    m.SendMessage(0, "You must pick {0} more skills.", switches - info.Switches.Length);
                    break;
                }
                else if (info.Switches.Length > switches)
                {
                    m.SendGump(new SkillPickGump5x80());
                    m.SendMessage(0, "Please get rid of {0} skills, you have exceeded 7.", info.Switches.Length - switches);
                    break;
                }
                else
                {
                    Server.Skills skills = m.Skills;

                    for (int i = 0; i < skills.Length; ++i)
                    {
                        skills[i].Base = 0;
                    }
                    if (info.IsSwitched(1))
                    {
                        m.Skills[SkillName.Alchemy].Base = val;
                    }
                    if (info.IsSwitched(2))
                    {
                        m.Skills[SkillName.Anatomy].Base = val;
                    }
                    if (info.IsSwitched(3))
                    {
                        m.Skills[SkillName.AnimalLore].Base = val;
                    }
                    if (info.IsSwitched(4))
                    {
                        m.Skills[SkillName.AnimalTaming].Base = val;
                    }
                    if (info.IsSwitched(5))
                    {
                        m.Skills[SkillName.Archery].Base = val;
                    }
                    if (info.IsSwitched(6))
                    {
                        m.Skills[SkillName.ArmsLore].Base = val;
                    }
                    if (info.IsSwitched(7))
                    {
                        m.Skills[SkillName.Begging].Base = val;
                    }
                    if (info.IsSwitched(8))
                    {
                        m.Skills[SkillName.Bushido].Base = val;
                    }
                    if (info.IsSwitched(9))
                    {
                        m.Skills[SkillName.Blacksmith].Base = val;
                    }
                    if (info.IsSwitched(10))
                    {
                        m.Skills[SkillName.Chivalry].Base = val;
                    }
                    if (info.IsSwitched(11))
                    {
                        m.Skills[SkillName.Camping].Base = val;
                    }
                    if (info.IsSwitched(12))
                    {
                        m.Skills[SkillName.Fletching].Base = val;
                    }
                    if (info.IsSwitched(13))
                    {
                        m.Skills[SkillName.Carpentry].Base = val;
                    }
                    if (info.IsSwitched(14))
                    {
                        m.Skills[SkillName.Cooking].Base = val;
                    }
                    if (info.IsSwitched(15))
                    {
                        m.Skills[SkillName.Fishing].Base = val;
                    }
                    if (info.IsSwitched(16))
                    {
                        m.Skills[SkillName.Focus].Base = val;
                    }
                    if (info.IsSwitched(17))
                    {
                        m.Skills[SkillName.Healing].Base = val;
                    }
                    if (info.IsSwitched(18))
                    {
                        m.Skills[SkillName.Herding].Base = val;
                    }
                    if (info.IsSwitched(19))
                    {
                        m.Skills[SkillName.Lockpicking].Base = val;
                    }
                    if (info.IsSwitched(20))
                    {
                        m.Skills[SkillName.Lumberjacking].Base = val;
                    }
                    if (info.IsSwitched(21))
                    {
                        m.Skills[SkillName.Magery].Base = val;
                    }
                    if (info.IsSwitched(22))
                    {
                        m.Skills[SkillName.Meditation].Base = val;
                    }
                    if (info.IsSwitched(23))
                    {
                        m.Skills[SkillName.Mining].Base = val;
                    }
                    if (info.IsSwitched(24))
                    {
                        m.Skills[SkillName.Musicianship].Base = val;
                    }
                    if (info.IsSwitched(25))
                    {
                        m.Skills[SkillName.Necromancy].Base = val;
                    }
                    if (info.IsSwitched(26))
                    {
                        m.Skills[SkillName.Ninjitsu].Base = val;
                    }
                    if (info.IsSwitched(27))
                    {
                        m.Skills[SkillName.RemoveTrap].Base = val;
                    }
                    if (info.IsSwitched(28))
                    {
                        m.Skills[SkillName.MagicResist].Base = val;
                    }
                    if (info.IsSwitched(29))
                    {
                        m.Skills[SkillName.Snooping].Base = val;
                    }
                    if (info.IsSwitched(30))
                    {
                        m.Skills[SkillName.Spellweaving].Base = val;
                    }
                    if (info.IsSwitched(31))
                    {
                        m.Skills[SkillName.Stealing].Base = val;
                    }
                    if (info.IsSwitched(32))
                    {
                        m.Skills[SkillName.Stealth].Base = val;
                    }
                    if (info.IsSwitched(33))
                    {
                        m.Skills[SkillName.Tailoring].Base = val;
                    }
                    if (info.IsSwitched(34))
                    {
                        m.Skills[SkillName.Tinkering].Base = val;
                    }
                    if (info.IsSwitched(35))
                    {
                        m.Skills[SkillName.Veterinary].Base = val;
                    }
                    if (info.IsSwitched(36))
                    {
                        m.Skills[SkillName.Fencing].Base = val;
                    }
                    if (info.IsSwitched(37))
                    {
                        m.Skills[SkillName.Macing].Base = val;
                    }
                    if (info.IsSwitched(38))
                    {
                        m.Skills[SkillName.Parry].Base = val;
                    }
                    if (info.IsSwitched(39))
                    {
                        m.Skills[SkillName.Swords].Base = val;
                    }
                    if (info.IsSwitched(40))
                    {
                        m.Skills[SkillName.Tactics].Base = val;
                    }
                    if (info.IsSwitched(41))
                    {
                        m.Skills[SkillName.Wrestling].Base = val;
                    }
                    if (info.IsSwitched(42))
                    {
                        m.Skills[SkillName.Cartography].Base = val;
                    }
                    if (info.IsSwitched(43))
                    {
                        m.Skills[SkillName.DetectHidden].Base = val;
                    }
                    if (info.IsSwitched(44))
                    {
                        m.Skills[SkillName.Inscribe].Base = val;
                    }
                    if (info.IsSwitched(45))
                    {
                        m.Skills[SkillName.Peacemaking].Base = val;
                    }
                    if (info.IsSwitched(46))
                    {
                        m.Skills[SkillName.Poisoning].Base = val;
                    }
                    if (info.IsSwitched(47))
                    {
                        m.Skills[SkillName.Provocation].Base = val;
                    }
                    if (info.IsSwitched(48))
                    {
                        m.Skills[SkillName.SpiritSpeak].Base = val;
                    }
                    if (info.IsSwitched(49))
                    {
                        m.Skills[SkillName.Tracking].Base = val;
                    }
                    if (info.IsSwitched(50))
                    {
                        m.Skills[SkillName.EvalInt].Base = val;
                    }
                    if (info.IsSwitched(51))
                    {
                        m.Skills[SkillName.Forensics].Base = val;
                    }
                    if (info.IsSwitched(52))
                    {
                        m.Skills[SkillName.ItemID].Base = val;
                    }
                    if (info.IsSwitched(53))
                    {
                        m.Skills[SkillName.TasteID].Base = val;
                    }
                    if (info.IsSwitched(54))
                    {
                        m.Skills[SkillName.Discordance].Base = val;
                    }
                    if (info.IsSwitched(55))
                    {
                        m.Skills[SkillName.Hiding].Base = val;
                    }
                    if (info.IsSwitched(56))
                    {
                        m.Skills[SkillName.Throwing].Base = val;
                    }
                    if (info.IsSwitched(57))
                    {
                        m.Skills[SkillName.Mysticism].Base = val;
                    }
                    if (info.IsSwitched(58))
                    {
                        m.Skills[SkillName.Imbuing].Base = val;
                    }
                }
                break;
            }
            }
        }
コード例 #17
0
ファイル: Skills.cs プロジェクト: BackupTheBerlios/sunuo-svn
        public static Skill Deserialize( Skills owner, SkillInfo info, GenericReader reader )
        {
            int version = reader.ReadByte();

            ushort m_Base = 0;
            ushort m_Cap = 0;
            SkillLock m_Lock = SkillLock.Up;

            switch ( version )
            {
                case 0:
                {
                    m_Base = reader.ReadUShort();
                    m_Cap = reader.ReadUShort();
                    m_Lock = (SkillLock)reader.ReadByte();

                    break;
                }
                case 0xFF:
                    return null;

                default:
                {
                    if ( (version & 0xC0) == 0x00 )
                    {
                        if ( (version & 0x1) != 0 )
                            m_Base = reader.ReadUShort();

                        if ( (version & 0x2) != 0 )
                            m_Cap = reader.ReadUShort();
                        else
                            m_Cap = 1000;

                        if ( (version & 0x4) != 0 )
                            m_Lock = (SkillLock)reader.ReadByte();
                    }

                    break;
                }
            }

            return new Skill(owner, info, m_Base, m_Cap, m_Lock);
        }
コード例 #18
0
ファイル: Skills.cs プロジェクト: karliky/wowwow
 public Skills(Skills original)
 {
     innerHash = new Hashtable(original.innerHash);
 }
コード例 #19
0
ファイル: Skills.cs プロジェクト: BackupTheBerlios/sunuo-svn
        public Skill( Skills owner, SkillInfo info, GenericReader reader )
        {
            m_Owner = owner;
            m_Info = info;

            int version = reader.ReadByte();

            switch ( version )
            {
                case 0:
                {
                    m_Base = reader.ReadUShort();
                    m_Cap = reader.ReadUShort();
                    m_Lock = (SkillLock)reader.ReadByte();

                    break;
                }
                case 0xFF:
                {
                    m_Base = 0;
                    m_Cap = 1000;
                    m_Lock = SkillLock.Up;

                    break;
                }
                default:
                {
                    if ( (version & 0xC0) == 0x00 )
                    {
                        if ( (version & 0x1) != 0 )
                            m_Base = reader.ReadUShort();

                        if ( (version & 0x2) != 0 )
                            m_Cap = reader.ReadUShort();
                        else
                            m_Cap = 1000;

                        if ( (version & 0x4) != 0 )
                            m_Lock = (SkillLock)reader.ReadByte();
                    }

                    break;
                }
            }
        }
コード例 #20
0
ファイル: Skills.cs プロジェクト: karliky/wowwow
 internal SkillsEnumerator(Skills enumerable)
 {
     innerEnumerator = enumerable.InnerHash.GetEnumerator();
 }
コード例 #21
0
ファイル: Mobile.cs プロジェクト: BackupTheBerlios/sunuo-svn
        public void DefaultMobileInit()
        {
            m_StatCap = 225;
            m_FollowersMax = 5;
            m_Skills = new Skills( this );
            m_Items = new ArrayList( 1 );
            m_StatMods = null;
            Map = Map.Internal;
            m_AutoPageNotify = true;
            m_Aggressors = null;
            m_Aggressed = null;
            m_Virtues = null;
            m_Stabled = null;
            m_DamageEntries = new ArrayList( 1 );

            m_NextSkillTime = DateTime.MinValue;
            m_CreationTime = Core.Now;
        }
コード例 #22
0
ファイル: Mobile.cs プロジェクト: zerodowned/angelisland
		public virtual void Deserialize(GenericReader reader)
		{
			int version = reader.ReadInt();

			switch (version)
			{
				case 31:
					{
						m_STRBonusCap = reader.ReadInt();
						goto case 30;
					}
				case 30:
					{
						int size = reader.ReadInt32();
						FlyIDs = new int[size];

						for (int i = 0; i < size; i++)
						{
							FlyIDs[i] = reader.ReadInt();
						}
						goto case 29;
					}
				case 29:
					{
						m_CanFly = reader.ReadBool();
						goto case 28;
					}

				case 28:
					{
						m_LastStatGain = reader.ReadDeltaTime();

						goto case 27;
					}
				case 27:
					{
						m_Flags = (MobileFlags)reader.ReadInt32();

						goto case 26;
					}
				case 26:
				case 25:
				case 24:
					{
						m_Corpse = reader.ReadItem() as Container;

						goto case 23;
					}
				case 23:
					{
						m_CreationTime = reader.ReadDateTime();

						goto case 22;
					}
				case 22: // Just removed followers
				case 21:
					{
						m_Stabled = reader.ReadMobileList();

						goto case 20;
					}
				case 20:
					{
						m_CantWalk = reader.ReadBool();

						goto case 19;
					}
				case 19: // Just removed variables
				case 18:
					{
						m_Virtues = new VirtueInfo(reader);

						goto case 17;
					}
				case 17:
					{
						m_Thirst = reader.ReadInt32();
						m_BAC = reader.ReadInt32();

						goto case 16;
					}
				case 16:
					{
						m_ShortTermMurders = reader.ReadInt32();

						if (version <= 24)
						{
							reader.ReadDateTime();
							reader.ReadDateTime();
						}

						goto case 15;
					}
				case 15:
					{
						if (version < 22)
							reader.ReadInt(); // followers

						m_FollowersMax = reader.ReadInt32();

						goto case 14;
					}
				case 14:
					{
						m_MagicDamageAbsorb = reader.ReadInt32();

						goto case 13;
					}
				case 13:
					{
						m_GuildFealty = reader.ReadMobile();

						goto case 12;
					}
				case 12:
					{
						m_Guild = reader.ReadGuild();

						goto case 11;
					}
				case 11:
					{
						m_DisplayGuildTitle = reader.ReadBool();

						goto case 10;
					}
				case 10:
					{
						m_CanSwim = reader.ReadBool();

						goto case 9;
					}
				case 9:
					{
						m_Squelched = reader.ReadBool();

						goto case 8;
					}
				case 8:
					{
						m_Holding = reader.ReadItem();

						goto case 7;
					}
				case 7:
					{
						m_VirtualArmor = reader.ReadInt32();

						goto case 6;
					}
				case 6:
					{
						m_BaseSoundID = reader.ReadInt32();

						goto case 5;
					}
				case 5:
					{
						m_DisarmReady = reader.ReadBool();
						m_StunReady = reader.ReadBool();

						goto case 4;
					}
				case 4:
					{
						if (version <= 25)
						{
							Poison.Deserialize(reader);

							/*if ( m_Poison != null )
							{
								m_PoisonTimer = new PoisonTimer( this );
								m_PoisonTimer.Start();
							}*/
						}

						goto case 3;
					}
				case 3:
					{
						m_StatCap = reader.ReadInt32();

						goto case 2;
					}
				case 2:
					{
						m_NameHue = reader.ReadInt32();

						goto case 1;
					}
				case 1:
					{
						m_Hunger = reader.ReadInt32();

						goto case 0;
					}
				case 0:
					{
						if (version < 21)
							m_Stabled = new ArrayList();

						if (version < 18)
							m_Virtues = new VirtueInfo();

						if (version < 11)
							m_DisplayGuildTitle = true;

						if (version < 3)
							m_StatCap = 225;

						if (version < 15)
						{
							m_Followers = 0;
							m_FollowersMax = 5;
						}

						m_Location = reader.ReadPoint3D();
						m_Body = new Body(reader.ReadInt32());
						m_Name = reader.ReadString();
						m_GuildTitle = reader.ReadString();
						m_Criminal = reader.ReadBool();
						m_Kills = reader.ReadInt32();
						m_SpeechHue = reader.ReadInt32();
						m_EmoteHue = reader.ReadInt32();
						m_WhisperHue = reader.ReadInt32();
						m_YellHue = reader.ReadInt32();
						m_Language = reader.ReadString();
						m_Female = reader.ReadBool();
						m_Warmode = reader.ReadBool();
						m_Hidden = reader.ReadBool();
						m_Direction = (Direction)reader.ReadByte();
						m_Hue = reader.ReadInt32();
						m_Str = reader.ReadInt32();
						m_Dex = reader.ReadInt32();
						m_Int = reader.ReadInt32();
						m_Hits = reader.ReadInt32();
						m_Stam = reader.ReadInt32();
						m_Mana = reader.ReadInt32();
						m_Map = reader.ReadMap();
						m_Blessed = reader.ReadBool();
						m_Fame = reader.ReadInt32();
						m_Karma = reader.ReadInt32();
						m_AccessLevel = (AccessLevel)reader.ReadByte();

						// Convert old bonus caps to 'no cap'
						if (version < 31)
							m_STRBonusCap = 0;

						// Convert old access levels to new access levels
						if (version < 31)
						{
							switch (m_AccessLevel)
							{
								case (AccessLevel)0: //OldPlayer = 0,
									{
										m_AccessLevel = AccessLevel.Player;
										break;
									}
								case (AccessLevel)1: //OldCounselor = 1,
									{
										m_AccessLevel = AccessLevel.Counselor;
										break;
									}
								case (AccessLevel)2: //OldGameMaster = 2,
									{
										m_AccessLevel = AccessLevel.GameMaster;
										break;
									}
								case (AccessLevel)3: //OldSeer = 3,
									{
										m_AccessLevel = AccessLevel.Seer;
										break;
									}
								case (AccessLevel)4: //OldAdministrator = 4,
									{
										m_AccessLevel = AccessLevel.Administrator;
										break;
									}
							}
						}

						m_Skills = new Skills(this, reader);

						int itemCount = reader.ReadInt32();

						m_Items = new ArrayList(itemCount);

						for (int i = 0; i < itemCount; ++i)
						{
							Item item = reader.ReadItem();

							if (item != null)
								m_Items.Add(item);
						}

						m_Player = reader.ReadBool();
						m_Title = reader.ReadString();
						m_Profile = reader.ReadString();
						m_ProfileLocked = reader.ReadBool();
						if (version <= 18)
						{
							/*m_LightLevel =*/
							reader.ReadInt();
							/*m_TotalGold =*/
							reader.ReadInt();
							/*m_TotalWeight =*/
							reader.ReadInt();
						}
						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 ArrayList();

						if (reader.ReadBool())
						{
							m_StuckMenuUses = new DateTime[reader.ReadInt32()];

							for (int i = 0; i < m_StuckMenuUses.Length; ++i)
							{
								m_StuckMenuUses[i] = reader.ReadDateTime();
							}
						}
						else
						{
							m_StuckMenuUses = null;
						}

						if (m_Player && 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();

						if (!m_Player && m_Dex <= 100 && m_CombatTimer != null)
							m_CombatTimer.Priority = TimerPriority.FiftyMS;
						else if (m_CombatTimer != null)
							m_CombatTimer.Priority = TimerPriority.EveryTick;

						m_Region = Region.Find(m_Location, m_Map);

						m_Region.InternalEnter(this);

						//UpdateResistances();

						break;
					}
			}

			//Pix: special logic to ensure the DefensiveSpell lock in m_Actions exists if it should
			//Note protection is a different beast since there are timers that control
			// BeginAction/EndAction -- protection effects aren't serialized.
			if (MagicDamageAbsorb > 0 || MeleeDamageAbsorb > 0)
			{
				BeginAction(typeof(DefensiveSpell));
			}
		}
コード例 #23
0
ファイル: Mobile.cs プロジェクト: BackupTheBerlios/sunuo-svn
        public virtual void Deserialize( GenericReader reader )
        {
            int version = reader.ReadInt();

            switch ( version )
            {
                case 28:
                {
                    m_LastStatGain = reader.ReadDeltaTime();

                    goto case 27;
                }
                case 27:
                {
                    m_TithingPoints = reader.ReadInt();

                    goto case 26;
                }
                case 26:
                case 25:
                case 24:
                {
                    m_Corpse = reader.ReadItem() as Container;

                    goto case 23;
                }
                case 23:
                {
                    m_CreationTime = reader.ReadDateTime();

                    goto case 22;
                }
                case 22: // Just removed followers
                case 21:
                {
                    m_Stabled = reader.ReadMobileListOrNull();

                    goto case 20;
                }
                case 20:
                {
                    m_CantWalk = reader.ReadBool();

                    goto case 19;
                }
                case 19: // Just removed variables
                case 18:
                {
                    m_Virtues = VirtueInfo.Deserialize( reader );

                    goto case 17;
                }
                case 17:
                {
                    m_Thirst = reader.ReadInt();
                    m_BAC = reader.ReadInt();

                    goto case 16;
                }
                case 16:
                {
                    m_ShortTermMurders = reader.ReadInt();

                    if ( version <= 24 )
                    {
                        reader.ReadDateTime();
                        reader.ReadDateTime();
                    }

                    goto case 15;
                }
                case 15:
                {
                    if ( version < 22 )
                        reader.ReadInt(); // followers

                    m_FollowersMax = reader.ReadInt();

                    goto case 14;
                }
                case 14:
                {
                    m_MagicDamageAbsorb = reader.ReadInt();

                    goto case 13;
                }
                case 13:
                {
                    m_GuildFealty = reader.ReadMobile();

                    goto case 12;
                }
                case 12:
                {
                    m_Guild = reader.ReadGuild();

                    goto case 11;
                }
                case 11:
                {
                    m_DisplayGuildTitle = reader.ReadBool();

                    goto case 10;
                }
                case 10:
                {
                    m_CanSwim = reader.ReadBool();

                    goto case 9;
                }
                case 9:
                {
                    m_Squelched = reader.ReadBool();

                    goto case 8;
                }
                case 8:
                {
                    m_Holding = reader.ReadItem();

                    goto case 7;
                }
                case 7:
                {
                    m_VirtualArmor = reader.ReadInt();

                    goto case 6;
                }
                case 6:
                {
                    m_BaseSoundID = reader.ReadInt();

                    goto case 5;
                }
                case 5:
                {
                    m_DisarmReady = reader.ReadBool();
                    m_StunReady = reader.ReadBool();

                    goto case 4;
                }
                case 4:
                {
                    if ( version <= 25 )
                    {
                        Poison.Deserialize( reader );

                        /*if ( m_Poison != null )
                        {
                            m_PoisonTimer = new PoisonTimer( this );
                            m_PoisonTimer.Start();
                        }*/
                    }

                    goto case 3;
                }
                case 3:
                {
                    m_StatCap = reader.ReadInt();

                    goto case 2;
                }
                case 2:
                {
                    m_NameHue = reader.ReadInt();

                    goto case 1;
                }
                case 1:
                {
                    m_Hunger = reader.ReadInt();

                    goto case 0;
                }
                case 0:
                {
                    if ( version < 11 )
                        m_DisplayGuildTitle = true;

                    if ( version < 3 )
                        m_StatCap = 225;

                    if ( version < 15 )
                    {
                        m_Followers = 0;
                        m_FollowersMax = 5;
                    }

                    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_Items = new ArrayList( itemCount );

                    for ( int i = 0; i < itemCount; ++i )
                    {
                        Item item = reader.ReadItem();

                        if ( item != null )
                            m_Items.Add( item );
                    }

                    m_Player = reader.ReadBool();
                    m_Title = reader.ReadString();
                    if (m_Title != null)
                        m_Title = string.Intern(m_Title);
                    m_Profile = reader.ReadString();
                    m_ProfileLocked = reader.ReadBool();
                    if ( version <= 18 )
                    {
                        /*m_LightLevel =*/ reader.ReadInt();
                        /*m_TotalGold =*/ reader.ReadInt();
                        /*m_TotalWeight =*/ reader.ReadInt();
                    }
                    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();

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

                    if ( !m_Player && m_Dex <= 100 && m_CombatTimer != null )
                        m_CombatTimer.Priority = TimerPriority.FiftyMS;
                    else if ( m_CombatTimer != null )
                        m_CombatTimer.Priority = TimerPriority.EveryTick;

                    m_Region = Region.Find( m_Location, m_Map );

                    m_Region.InternalEnter( this );

                    UpdateResistances();

                    break;
                }
            }
        }
コード例 #24
0
ファイル: Skills.cs プロジェクト: davidthibodeau/JustUO
        public Skill(Skills owner, SkillInfo info, GenericReader reader)
        {
            m_Owner = owner;
            m_Info  = info;

            int version = reader.ReadByte();

            switch (version)
            {
            case 0:
            {
                m_Base = reader.ReadUShort();
                m_Cap  = reader.ReadUShort();
                m_Lock = (SkillLock)reader.ReadByte();

                break;
            }

            case 0xFF:
            {
                m_Base = 0;
                m_Cap  = 1000;
                m_Lock = SkillLock.Up;

                break;
            }

            default:
            {
                if ((version & 0xC0) == 0x00)
                {
                    if ((version & 0x1) != 0)
                    {
                        m_Base = reader.ReadUShort();
                    }

                    if ((version & 0x2) != 0)
                    {
                        m_Cap = reader.ReadUShort();
                    }
                    else
                    {
                        m_Cap = 1000;
                    }

                    if ((version & 0x4) != 0)
                    {
                        m_Lock = (SkillLock)reader.ReadByte();
                    }
                }

                break;
            }
            }

            if (m_Lock < SkillLock.Up || m_Lock > SkillLock.Locked)
            {
                Console.WriteLine("Bad skill lock -> {0}.{1}", owner.Owner, m_Lock);
                m_Lock = SkillLock.Up;
            }
        }
コード例 #25
0
ファイル: Escudeiro.cs プロジェクト: evildude807/kaltar
        private void adicionarSkillCap(Skills skills)
        {
            skillsMaximoCap(skills, 0.0);

            maxSkill(skills.Alchemy,100.0);
            maxSkill(skills.Anatomy,45.0);
            maxSkill(skills.AnimalLore,0.0);
            maxSkill(skills.AnimalTaming,0.0);
            maxSkill(skills.Archery,45.0);
            maxSkill(skills.ArmsLore,100.0);
            maxSkill(skills.Begging,0.0);
            maxSkill(skills.Blacksmith,100.0);
            maxSkill(skills.Camping,100.0);
            maxSkill(skills.Carpentry,100.0);
            maxSkill(skills.Cartography,100.0);
            maxSkill(skills.Chivalry,0.0);
            maxSkill(skills.Cooking,100.0);
            maxSkill(skills.DetectHidden,20.0);
            maxSkill(skills.Discordance,0.0);
            maxSkill(skills.EvalInt,0.0);
            maxSkill(skills.Fencing,45.0);
            maxSkill(skills.Fishing,100.0);
            maxSkill(skills.Fletching,100.0);
            maxSkill(skills.Focus,40.0);
            maxSkill(skills.Forensics,20.0);
            maxSkill(skills.Healing,20.0);
            maxSkill(skills.Herding,0.0);
            maxSkill(skills.Hiding,0.0);
            maxSkill(skills.Highest,0.0);
            maxSkill(skills.Inscribe,0.0);
            maxSkill(skills.ItemID,0.0);
            maxSkill(skills.Lockpicking,0.0);
            maxSkill(skills.Lumberjacking,100.0);
            maxSkill(skills.Macing,45.0);
            maxSkill(skills.Magery,0.0);
            maxSkill(skills.MagicResist,20.0);
            maxSkill(skills.Meditation,0.0);
            maxSkill(skills.Mining,100.0);
            maxSkill(skills.Musicianship,0.0);
            maxSkill(skills.Necromancy,0.0);
            maxSkill(skills.Parry,45.0);
            maxSkill(skills.Peacemaking,0.0);
            maxSkill(skills.Poisoning,0.0);
            maxSkill(skills.Provocation,0.0);
            maxSkill(skills.RemoveTrap,0.0);
            maxSkill(skills.Snooping,0.0);
            maxSkill(skills.SpiritSpeak,0.0);
            maxSkill(skills.Stealing,0.0);
            maxSkill(skills.Stealth,0.0);
            maxSkill(skills.Swords,45.0);
            maxSkill(skills.Tactics,45.0);
            maxSkill(skills.Tailoring,100.0);
            maxSkill(skills.TasteID,0.0);
            maxSkill(skills.Tinkering,100.0);
            maxSkill(skills.Tracking,0.0);
            maxSkill(skills.Veterinary,0.0);
            maxSkill(skills.Wrestling,45.0);
        }
コード例 #26
0
ファイル: Packets.cs プロジェクト: Telm/RunUO_EME
        public SkillUpdate( Skills skills )
            : base(0x3A)
        {
            this.EnsureCapacity( 6 + (skills.Length * 9) );

            m_Stream.Write( (byte) 0x02 ); // type: absolute, capped

            for ( int i = 0; i < skills.Length; ++i )
            {
                Skill s = skills[i];

                double v = s.NonRacialValue;
                int uv = (int)(v * 10);

                if ( uv < 0 )
                    uv = 0;
                else if ( uv >= 0x10000 )
                    uv = 0xFFFF;

                m_Stream.Write( (ushort) (s.Info.SkillID + 1) );
                m_Stream.Write( (ushort) uv );
                m_Stream.Write( (ushort) s.BaseFixedPoint );
                m_Stream.Write( (byte) s.Lock );
                m_Stream.Write( (ushort) s.CapFixedPoint );
            }

            m_Stream.Write( (short) 0 ); // terminate
        }
コード例 #27
0
ファイル: StockNewPlayer2.cs プロジェクト: zerodowned/annox
        private static void EventSink_Login(LoginEventArgs args)
        {
            Mobile from = args.Mobile;

            TimeSpan gameTime = TimeSpan.Zero;

            gameTime = ((PlayerMobile)from).GameTime;


            Console.WriteLine("Starting LoginEvenArgs");

            //Convert players to new settings when they log in.
            #region Convert players to new settings when they log in.
            Console.WriteLine("change_AllPlayers = " + change_AllPlayers);
            Console.WriteLine("set_AllPlayersLastChangeVersion = " + set_AllPlayersLastChangeVersion);
            Console.WriteLine("MobileGameTime = " + gameTime);
            Console.WriteLine("TimeSpan = " + TimeSpan.FromSeconds(15));

            if (change_AllPlayers || gameTime < TimeSpan.FromSeconds(15)) //TimeSpan = "00:00:00"
            {
                //Change starting music
                if (change_StartingMusic)
                {
                    from.Send(Network.PlayMusic.GetInstance(StockNewPlayer.m_Music));
                }

                string gump_message;
                gump_message = "<p>";

                //This sets the new Stat Cap
                if (change_StatCap && (from.StatCap != set_StatCap))
                {
                    gump_message = gump_message + ("<p>Current Stat Cap is: " + from.StatCap);
                    from.StatCap = set_StatCap;
                    gump_message = gump_message + ("<p>New Stat Cap is:     " + from.StatCap);
                }

                //This sets the new Skills Cap
                if (change_SkillsCap && (from.SkillsCap != set_SkillsCap))
                {
                    gump_message   = gump_message + ("<p>Current Skills Cap is: " + from.SkillsCap);
                    from.SkillsCap = set_SkillsCap;
                    gump_message   = gump_message + ("<p>New Skills Cap is:     " + from.SkillsCap);
                }

                //This turns on power scrolls, or turns up indivudal skills
                if (change_PowerScrolls)
                {
                    gump_message = gump_message + ("<p>Updateing Power Scrolls");
                    for (int i = 0; i < PowerScroll.Skills.Length; ++i)
                    {
                        from.Skills[PowerScroll.Skills[i]].Cap = set_PowerScrolls;
                        //from.Skills[PowerScroll.Skills[i]].ObeyCap = true;
                    }
                }

                if (change_PlayerStartingStat) // && (from.Str < set_PlayerStatTo) || (from.Int < set_PlayerStatTo) || (from.Dex < set_PlayerStatTo))
                {
                    gump_message = gump_message + ("<p>Current Stats are...<p>Str: " + from.Str + " Int: " + from.Int + " Dex: " + from.Dex);
                    if (from.Str < set_PlayerStatTo)
                    {
                        from.Str = set_PlayerStatTo;
                    }

                    if (from.Int < set_PlayerStatTo)
                    {
                        from.Int = set_PlayerStatTo;
                    }

                    if (from.Dex < set_PlayerStatTo)
                    {
                        from.Dex = set_PlayerStatTo;
                    }

                    //from.SendMessage("New Stats are: Str-" + from.Str + " Int-" + from.Int + " Dex-" + from.Dex);
                    gump_message = gump_message + ("<p>New Stats are...<p>Str: " + from.Str + " Int: " + from.Int + " Dex: " + from.Dex);
                }

                if (change_PlayerStartingSkills)
                {
                    gump_message = gump_message + ("<p>Increase all skils to " + set_PlayerSkillsTo);
                    Server.Skills skills = from.Skills;

                    for (int i = 0; i < skills.Length; ++i)
                    {
                        skills[i].Base = set_PlayerSkillsTo;
                    }
                }

                gump_message = gump_message + ("</p>");

                if (gump_message != "<p></p>")
                {
                    from.SendGump(new StockNewPlayerGump(gump_message));
                    Console.WriteLine(gump_message);
                }
            }
            #endregion
        }
コード例 #28
0
ファイル: Aprendiz.cs プロジェクト: evildude807/kaltar
        private void adicionarSkillCap(Skills skills)
        {
            skillsMaximoCap(skills, 0.0);

            //colcoar o cap das skills de trabalho para 100

            maxSkill(skills.Alchemy,100.0);
        }
コード例 #29
0
ファイル: Skills.cs プロジェクト: AlcesAlces/UOsmart
 public Skill( Skills owner, SkillInfo info, int baseValue, int cap, SkillLock skillLock )
 {
     m_Owner = owner;
     m_Info = info;
     m_Base = (ushort)baseValue;
     m_Cap = (ushort)cap;
     m_Lock = skillLock;
 }
コード例 #30
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile m = state.Mobile;

            switch (info.ButtonID)
            {
            case 0: { break; }

            case 1:
            {
                if (info.Switches.Length < switches)
                {
                    m.SendGump(new SkillPickGump(m_SkillBallPlus));
                    m.SendMessage(0, "You must pick {0} more skills.", switches - info.Switches.Length);
                    break;
                }
                else if (info.Switches.Length > switches)
                {
                    m.SendGump(new SkillPickGump(m_SkillBallPlus));
                    m.SendMessage(0, "Please get rid of {0} skills, you have exceeded the 7 skills that are allowed.", info.Switches.Length - switches);
                    break;
                }

                else
                {
                    Server.Skills skills = m.Skills;

                    for (int i = 0; i < skills.Length; ++i)
                    {
                        //       skills[i].Base = 0;
                        if (info.IsSwitched(1)) // ------------------------------------------------ Alchemy
                        {
                            m.Skills[SkillName.Alchemy].Base = val;
                            Container pack = m.Backpack;
                            if (pack != null)
                            {
                                pack.DropItem(new Bottle(10));
                                pack.DropItem(new MortarPestle());
                                pack.DropItem(new BagOfReagents(50));
                            }
                        }
                    }
                    if (info.IsSwitched(2))     // ------------------------------------------------ Anatomy
                    {
                        m.Skills[SkillName.Anatomy].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Bandage(50));
                        }
                    }
                    if (info.IsSwitched(3))     // ------------------------------------------------ AnimalLore
                    {
                        m.Skills[SkillName.AnimalLore].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new ShepherdsCrook());
                        }
                    }
                    if (info.IsSwitched(4))     // ------------------------------------------------ AnimalTaming
                    {
                        m.Skills[SkillName.AnimalTaming].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Apple(10));
                        }
                    }
                    if (info.IsSwitched(5))     // ------------------------------------------------ Archery
                    {
                        m.Skills[SkillName.Archery].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Arrow(200));
                            pack.DropItem(new Bow( ));
                        }
                    }
                    if (info.IsSwitched(6)) // ------------------------------------------------ ArmsLore
                    {
                        m.Skills[SkillName.ArmsLore].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new IronIngot(50));
                        }
                    }
                    if (info.IsSwitched(7)) // ------------------------------------------------ Begging
                    {
                        m.Skills[SkillName.Begging].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BankCheck(5000));
                        }
                    }
                    if (info.IsSwitched(9)) // ------------------------------------------------ Blacksmith
                    {
                        m.Skills[SkillName.Blacksmith].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new IronIngot(50));
                            pack.DropItem(new Tongs());
                            pack.DropItem(new Pickaxe());
                            pack.DropItem(new Pickaxe());
                            pack.DropItem(new Shovel());
                        }
                    }
                    if (info.IsSwitched(11)) // ------------------------------------------------ Camping
                    {
                        m.Skills[SkillName.Camping].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Bedroll());
                            pack.DropItem(new Kindling(20));
                        }
                    }
                    if (info.IsSwitched(13)) // ------------------------------------------------ Carpentry
                    {
                        m.Skills[SkillName.Carpentry].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Saw());
                            pack.DropItem(new Board(100));
                        }
                    }
                    if (info.IsSwitched(14)) // ------------------------------------------------ Cooking
                    {
                        m.Skills[SkillName.Cooking].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Kindling(10));
                            pack.DropItem(new RawLambLeg());
                            pack.DropItem(new RawChickenLeg());
                            pack.DropItem(new RawFishSteak());
                            pack.DropItem(new SackFlour());
                            pack.DropItem(new Pitcher(BeverageType.Water));
                        }
                    }
                    if (info.IsSwitched(15)) // ------------------------------------------------ Fishing
                    {
                        m.Skills[SkillName.Fishing].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new FishingPole());
                            pack.DropItem(new FishingPole());
                            pack.DropItem(new FishingPole());
                            pack.DropItem(new FloppyHat(Utility.RandomYellowHue()));
                        }
                    }
                    if (info.IsSwitched(17)) // ------------------------------------------------ Healing
                    {
                        m.Skills[SkillName.Healing].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Bandage(50));
                            pack.DropItem(new Scissors());
                        }
                    }
                    if (info.IsSwitched(18)) // ------------------------------------------------ Herding
                    {
                        m.Skills[SkillName.Herding].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new ShepherdsCrook());
                        }
                    }
                    if (info.IsSwitched(19)) // ------------------------------------------------ Lockpicking
                    {
                        m.Skills[SkillName.Lockpicking].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Lockpick(20));
                        }
                    }
                    if (info.IsSwitched(20)) // ------------------------------------------------ Lumberjacking
                    {
                        m.Skills[SkillName.Lumberjacking].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Hatchet());
                            pack.DropItem(new FullApron(Utility.RandomYellowHue()));
                        }
                    }
                    if (info.IsSwitched(21)) // ------------------------------------------------ Magery
                    {
                        m.Skills[SkillName.Magery].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Spellbook(UInt64.MaxValue));
                            pack.DropItem(new BagOfReagents(50));
                        }
                    }
                    if (info.IsSwitched(22))     // ------------------------------------------------ Meditation
                    {
                        m.Skills[SkillName.Meditation].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new DecoCrystalBall());
                        }
                    }
                    if (info.IsSwitched(23)) // ------------------------------------------------ Mining
                    {
                        m.Skills[SkillName.Mining].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Pickaxe());
                            pack.DropItem(new Pickaxe());
                            pack.DropItem(new Pickaxe());
                            pack.DropItem(new Shovel());
                            pack.DropItem(new Shovel());
                            pack.DropItem(new Shovel());
                        }
                    }
                    if (info.IsSwitched(24)) // ------------------------------------------------ Musicianship
                    {
                        m.Skills[SkillName.Musicianship].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Lute());
                            pack.DropItem(new LapHarp());
                            pack.DropItem(new TambourineTassel());
                            pack.DropItem(new Drums());
                        }
                    }
                    if (info.IsSwitched(27)) // ------------------------------------------------ RemoveTrap
                    {
                        m.Skills[SkillName.RemoveTrap].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new GreaterHealPotion(3));
                        }
                    }
                    if (info.IsSwitched(28)) // ------------------------------------------------ MagicResist
                    {
                        m.Skills[SkillName.MagicResist].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new FireballWand());
                            pack.DropItem(new LightningWand());
                            pack.DropItem(new MagicArrowWand());
                        }
                    }
                    if (info.IsSwitched(29)) // ------------------------------------------------ Snooping
                    {
                        m.Skills[SkillName.Snooping].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BankCheck(5000));
                        }
                    }
                    if (info.IsSwitched(31)) // ------------------------------------------------ Stealing
                    {
                        m.Skills[SkillName.Stealing].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BankCheck(5000));
                        }
                    }
                    if (info.IsSwitched(32)) // ------------------------------------------------ Stealth
                    {
                        m.Skills[SkillName.Stealth].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BurglarsBandana());
                        }
                    }
                    if (info.IsSwitched(33)) // ------------------------------------------------ Tailoring
                    {
                        m.Skills[SkillName.Tailoring].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BoltOfCloth( ));
                            pack.DropItem(new Cloth(100));
                            pack.DropItem(new SewingKit( ));
                            pack.DropItem(new SewingKit( ));
                            pack.DropItem(new SewingKit( ));
                        }
                    }
                    if (info.IsSwitched(34)) // ------------------------------------------------ Tinkering
                    {
                        m.Skills[SkillName.Tinkering].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new TinkerTools());
                            pack.DropItem(new IronIngot(20));
                        }
                    }
                    if (info.IsSwitched(35)) // ------------------------------------------------ Veterinary
                    {
                        m.Skills[SkillName.Veterinary].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Bandage(50));
                        }
                    }
                    if (info.IsSwitched(36)) // ------------------------------------------------ Fencing
                    {
                        m.Skills[SkillName.Fencing].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Kryss());
                        }
                    }
                    if (info.IsSwitched(37)) // ------------------------------------------------ Macing
                    {
                        m.Skills[SkillName.Macing].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Mace());
                        }
                    }
                    if (info.IsSwitched(38)) // ------------------------------------------------ Parry
                    {
                        m.Skills[SkillName.Parry].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new MetalKiteShield());
                        }
                    }
                    if (info.IsSwitched(39)) // ------------------------------------------------ Swords
                    {
                        m.Skills[SkillName.Swords].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Longsword());
                        }
                    }
                    if (info.IsSwitched(40)) // ------------------------------------------------ Tactics
                    {
                        m.Skills[SkillName.Tactics].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Gold(500));
                        }
                    }
                    if (info.IsSwitched(41)) // ------------------------------------------------ Wrestling
                    {
                        m.Skills[SkillName.Wrestling].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new LeatherGloves());
                        }
                    }
                    if (info.IsSwitched(42)) // ------------------------------------------------ Cartography
                    {
                        m.Skills[SkillName.Cartography].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BlankMap());
                            pack.DropItem(new BlankMap());
                            pack.DropItem(new BlankMap());
                            pack.DropItem(new BlankMap());
                            pack.DropItem(new Sextant());
                        }
                    }
                    if (info.IsSwitched(43)) // ------------------------------------------------ DetectHidden
                    {
                        m.Skills[SkillName.DetectHidden].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Cloak(0x455));
                        }
                    }
                    if (info.IsSwitched(44)) // ------------------------------------------------ Inscribe
                    {
                        m.Skills[SkillName.Inscribe].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BlankScroll(10));
                            pack.DropItem(new BlueBook( ));
                        }
                    }
                    if (info.IsSwitched(45)) // ------------------------------------------------ Peacemaking
                    {
                        m.Skills[SkillName.Peacemaking].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Tambourine());
                        }
                    }
                    if (info.IsSwitched(46)) // ------------------------------------------------ Poisoning
                    {
                        m.Skills[SkillName.Poisoning].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new LesserPoisonPotion());
                            pack.DropItem(new LesserPoisonPotion());
                            pack.DropItem(new LesserPoisonPotion());
                        }
                    }
                    if (info.IsSwitched(47)) // ------------------------------------------------ Provocation
                    {
                        m.Skills[SkillName.Provocation].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BambooFlute());
                        }
                    }
                    if (info.IsSwitched(48)) // ------------------------------------------------ SpiritSpeak
                    {
                        m.Skills[SkillName.SpiritSpeak].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BagOfNecroReagents(50));
                        }
                    }
                    if (info.IsSwitched(49)) // ------------------------------------------------ Tracking
                    {
                        m.Skills[SkillName.Tracking].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BearMask(0x1545));
                        }
                    }
                    if (info.IsSwitched(50)) // ------------------------------------------------ EvalInt
                    {
                        m.Skills[SkillName.EvalInt].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BagOfReagents(50));
                        }
                    }
                    if (info.IsSwitched(51)) // ------------------------------------------------ Forensics
                    {
                        m.Skills[SkillName.Forensics].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new SkinningKnife(0xEC4));
                        }
                    }
                    if (info.IsSwitched(52)) // ------------------------------------------------ ItemID
                    {
                        m.Skills[SkillName.ItemID].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new IDWand(25));
                        }
                    }
                    if (info.IsSwitched(53)) // ------------------------------------------------ TasteID
                    {
                        m.Skills[SkillName.TasteID].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new GreaterHealPotion(1));
                            pack.DropItem(new GreaterAgilityPotion(1));
                            pack.DropItem(new GreaterStrengthPotion(1));
                        }
                    }
                    if (info.IsSwitched(55)) // ------------------------------------------------ Hiding
                    //           {
                    //           m.Skills[SkillName.Hiding].Base = val;
                    //                       Container pack = m.Backpack;
                    //               if (pack != null)
                    //               {
                    //                   pack.DropItem( new BagOfSmokeBombs(20) );
                    //               }
                    //           }
                    {
                        if (info.IsSwitched(56)) // ------------------------------------------------ Fletching
                        {
                            m.Skills[SkillName.Fletching].Base = val;
                            Container pack = m.Backpack;
                            if (pack != null)
                            {
                                pack.DropItem(new FletcherTools(0x1022));
                                pack.DropItem(new Shaft(50));
                                pack.DropItem(new Feather(50));
                            }
                        }
                    }
                    if (info.IsSwitched(57)) // ------------------------------------------------ Focus
                    {
                        m.Skills[SkillName.Focus].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Chessboard(0xFA6));
                        }
                    }
                    if (info.IsSwitched(58)) // ------------------------------------------------ Throwing
                    {
                        m.Skills[SkillName.Throwing].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new ThrowingDagger());
                        }
                    }
                    if (info.IsSwitched(59))     // ------------------------------------------------ Bushido
                    {
                        m.Skills[SkillName.Bushido].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BookOfBushido());
                        }
                    }
                    if (info.IsSwitched(60))     // ------------------------------------------------ Chivalry
                    {
                        m.Skills[SkillName.Chivalry].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BookOfChivalry((UInt64)0x3FF));
                        }
                    }
                    if (info.IsSwitched(61)) // ------------------------------------------------ Imbuing
                    {
                        m.Skills[SkillName.Imbuing].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new RunicHammer(CraftResource.Valorite));
                        }
                    }
                    if (info.IsSwitched(62)) // ------------------------------------------------ Mysticism
                    {
                        m.Skills[SkillName.Mysticism].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Bone(50));
                            pack.DropItem(new DaemonBone(50));
                            pack.DropItem(new FertileDirt(50));
                        }
                    }
                    if (info.IsSwitched(63)) // ------------------------------------------------ Necromancy
                    {
                        m.Skills[SkillName.Necromancy].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new NecromancerSpellbook((UInt64)0xFFFF));
                            pack.DropItem(new BagOfNecroReagents(50));
                        }
                    }
                    if (info.IsSwitched(64))     // ------------------------------------------------ Ninjitsu
                    {
                        m.Skills[SkillName.Ninjitsu].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new BookOfNinjitsu());
                        }
                    }

                    if (info.IsSwitched(65)) // ------------------------------------------------ Spellweaving
                    {
                        m.Skills[SkillName.Spellweaving].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            new SpellweavingBook((Int64)0xFFFF);
                        }
                    }
                    if (info.IsSwitched(66)) // ------------------------------------------------ Discordance
                    {
                        m.Skills[SkillName.Discordance].Base = val;
                        Container pack = m.Backpack;
                        if (pack != null)
                        {
                            pack.DropItem(new Harp());
                        }
                    }

                    m_SkillBallPlus.Delete();
                }

                break;
            }
            }
        }