Beispiel #1
0
 public LokaiSkill(LokaiSkills owner, LokaiSkillInfo info, int baseValue, int cap, LokaiSkillLock LokaiSkillLock)
 {
     m_Owner = owner;
     m_Info  = info;
     m_Base  = (ushort)baseValue;
     m_Cap   = (ushort)cap;
     m_Lock  = LokaiSkillLock;
 }
Beispiel #2
0
        public void SetLockNoRelay(LokaiSkillLock LokaiSkillLock)
        {
            if (LokaiSkillLock < LokaiSkillLock.Up || LokaiSkillLock > LokaiSkillLock.Locked)
            {
                return;
            }

            m_Lock = LokaiSkillLock;
        }
Beispiel #3
0
        public LokaiSkill(LokaiSkills owner, LokaiSkillInfo 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 = (LokaiSkillLock)reader.ReadByte();

                break;
            }

            case 0xFF:
            {
                m_Base = 0;
                m_Cap  = 1000;
                m_Lock = LokaiSkillLock.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 = (LokaiSkillLock)reader.ReadByte();
                    }
                }

                break;
            }
            }

            if (m_Lock < LokaiSkillLock.Up || m_Lock > LokaiSkillLock.Locked)
            {
                Console.WriteLine("Bad Lokai Skill lock -> {0}.{1}", owner.Owner, m_Lock);
                m_Lock = LokaiSkillLock.Up;
            }
        }