コード例 #1
1
ファイル: SpellbookData.cs プロジェクト: jorsi/UltimaXNA
        public SpellbookData(Serial serial, ushort itemID, ushort bookTypePacketID, ulong spellBitFields)
        {
            Serial = serial;
            ItemID = itemID;

            SpellsBitfield = spellBitFields;

            switch (bookTypePacketID)
            {
                case 1:
                    BookType = SpellBookTypes.Magic;
                    break;
                case 101:
                    BookType = SpellBookTypes.Necromancer;
                    break;
                case 201:
                    BookType = SpellBookTypes.Chivalry;
                    break;
                case 401:
                    BookType = SpellBookTypes.Bushido;
                    break;
                case 501:
                    BookType = SpellBookTypes.Ninjitsu;
                    break;
                case 601:
                    BookType = SpellBookTypes.Spellweaving;
                    break;
                default:
                    BookType = SpellBookTypes.Unknown;
                    return;
            }
        }
コード例 #2
0
        public static SpellBookTypes GetSpellBookTypeFromItemID(int itemID)
        {
            SpellBookTypes bookType = SpellBookTypes.Unknown;

            switch (itemID)
            {
            case 0x0E3B:     // spellbook
            case 0x0EFA:
                bookType = SpellBookTypes.Magic;
                break;

            case 0x2252:     // paladin spellbook
                bookType = SpellBookTypes.Chivalry;
                break;

            case 0x2253:     // necromancer book
                bookType = SpellBookTypes.Necromancer;
                break;

            case 0x238C:     // book of bushido
                bookType = SpellBookTypes.Bushido;
                break;

            case 0x23A0:     // book of ninjitsu
                bookType = SpellBookTypes.Ninjitsu;
                break;

            case 0x2D50:     // spell weaving book
                bookType = SpellBookTypes.Chivalry;
                break;
            }
            return(bookType);
        }
コード例 #3
0
        public static int GetOffsetFromSpellBookType(SpellBookTypes spellbooktype)
        {
            switch (spellbooktype)
            {
            case SpellBookTypes.Magic:
                return(1);

            case SpellBookTypes.Necromancer:
                return(101);

            case SpellBookTypes.Chivalry:
                return(201);

            case SpellBookTypes.Bushido:
                return(401);

            case SpellBookTypes.Ninjitsu:
                return(501);

            case SpellBookTypes.Spellweaving:
                return(601);

            default:
                return(1);
            }
        }
コード例 #4
0
ファイル: SpellBook.cs プロジェクト: robertdeclaux/UltimaXNA
        public void ReceiveSpellData(SpellBookTypes sbType, ulong sbBitfield)
        {
            bool entityUpdated = true;

            if (BookType != sbType)
            {
                BookType = sbType;
                entityUpdated = true;
            }

            m_SpellsBitfield = sbBitfield;

            if (entityUpdated && OnEntityUpdated != null)
                OnEntityUpdated();
        }
コード例 #5
0
        public void ReceiveSpellData(SpellBookTypes sbType, ulong sbBitfield)
        {
            bool entityUpdated = false;

            if (BookType != sbType)
            {
                BookType      = sbType;
                entityUpdated = true;
            }

            m_SpellsBitfield = sbBitfield;

            if (entityUpdated && OnEntityUpdated != null)
            {
                OnEntityUpdated();
            }
        }
コード例 #6
0
        public SpellbookData(Container spellbook, ContainerContentPacket contents)
        {
            Serial = spellbook.Serial;
            ItemID = (ushort)spellbook.ItemID;

            BookType = GetSpellBookTypeFromItemID(spellbook.ItemID);
            if (BookType == SpellBookTypes.Unknown)
                return;

            int offset = GetOffsetFromSpellBookType(BookType);

            foreach (ItemInContainer i in contents.Items)
            {
                ulong spellBit = ((ulong)1) << ((i.Amount - offset) & 0x0000003F);
                SpellsBitfield |= spellBit;
            }
        }
コード例 #7
0
        public SpellbookData(Container spellbook, ContainerContentPacket contents)
        {
            Serial = spellbook.Serial;
            ItemID = (ushort)spellbook.ItemID;

            BookType = GetSpellBookTypeFromItemID(spellbook.ItemID);
            if (BookType == SpellBookTypes.Unknown)
            {
                return;
            }

            int offset = GetOffsetFromSpellBookType(BookType);

            foreach (ItemInContainer i in contents.Items)
            {
                ulong spellBit = ((ulong)1) << ((i.Amount - offset) & 0x0000003F);
                SpellsBitfield |= spellBit;
            }
        }
コード例 #8
0
ファイル: SpellBook.cs プロジェクト: jorsi/UltimaXNA
        public void ReceiveSpellData(SpellBookTypes sbType, ulong sbBitfield)
        {
            bool entityUpdated = false;
            if (BookType != sbType)
            {
                BookType = sbType;
                entityUpdated = true;
            }

            if (m_SpellsBitfield != sbBitfield)
            {
                m_SpellsBitfield = sbBitfield;
                entityUpdated = true;
            }
            if (entityUpdated)
            {
                m_OnUpdated?.Invoke(this);
            }
        }
コード例 #9
0
ファイル: SpellbookData.cs プロジェクト: jorsi/UltimaXNA
 public SpellbookData(ContainerItem spellbook, ContainerContentPacket contents)
 {
     Serial = spellbook.Serial;
     ItemID = (ushort)spellbook.ItemID;
     BookType = GetSpellBookTypeFromItemID(spellbook.ItemID);
     if (BookType == SpellBookTypes.Unknown)
     {
         return;
     }
     int offset = GetOffsetFromSpellBookType(BookType);
     foreach (ItemInContainer i in contents.Items)
     {
         int index = ((i.Amount - offset) & 0x0000003F);
         int circle = (index / 8);
         index = index % 8;
         index = ((3 - circle % 4) + (circle / 4) * 4) * 8 + (index);
         ulong flag = ((ulong)1) << index;
         SpellsBitfield |= flag;
     }
 }
コード例 #10
0
ファイル: SpellBook.cs プロジェクト: uotools/JuicyUO
        public void ReceiveSpellData(SpellBookTypes sbType, ulong sbBitfield)
        {
            bool entityUpdated = false;

            if (BookType != sbType)
            {
                BookType      = sbType;
                entityUpdated = true;
            }

            if (m_SpellsBitfield != sbBitfield)
            {
                m_SpellsBitfield = sbBitfield;
                entityUpdated    = true;
            }
            if (entityUpdated)
            {
                m_OnUpdated?.Invoke(this);
            }
        }
コード例 #11
0
ファイル: SpellbookData.cs プロジェクト: msx752/UltimaXNA
 public static int GetOffsetFromSpellBookType(SpellBookTypes spellbooktype)
 {
     switch (spellbooktype)
     {
         case SpellBookTypes.Magic:
             return 1;
         case SpellBookTypes.Necromancer:
             return 101;
         case SpellBookTypes.Chivalry:
             return 201;
         case SpellBookTypes.Bushido:
             return 401;
         case SpellBookTypes.Ninjitsu:
             return 501;
         case SpellBookTypes.Spellweaving:
             return 601;
         default:
             return 1;
     }
 }
コード例 #12
0
        public SpellbookData(ContainerItem spellbook, ContainerContentPacket contents)
        {
            Serial   = spellbook.Serial;
            ItemID   = (ushort)spellbook.ItemID;
            BookType = GetSpellBookTypeFromItemID(spellbook.ItemID);
            if (BookType == SpellBookTypes.Unknown)
            {
                return;
            }
            int offset = GetOffsetFromSpellBookType(BookType);

            foreach (ItemInContainer i in contents.Items)
            {
                int index  = ((i.Amount - offset) & 0x0000003F);
                int circle = (index / 8);
                index = index % 8;
                index = ((3 - circle % 4) + (circle / 4) * 4) * 8 + (index);
                ulong flag = ((ulong)1) << index;
                SpellsBitfield |= flag;
            }
        }
コード例 #13
0
        public SpellbookData(Serial serial, ushort itemID, ushort bookTypePacketID, ulong spellBitFields)
        {
            Serial = serial;
            ItemID = itemID;

            SpellsBitfield = spellBitFields;

            switch (bookTypePacketID)
            {
            case 1:
                BookType = SpellBookTypes.Magic;
                break;

            case 101:
                BookType = SpellBookTypes.Necromancer;
                break;

            case 201:
                BookType = SpellBookTypes.Chivalry;
                break;

            case 401:
                BookType = SpellBookTypes.Bushido;
                break;

            case 501:
                BookType = SpellBookTypes.Ninjitsu;
                break;

            case 601:
                BookType = SpellBookTypes.Spellweaving;
                break;

            default:
                BookType = SpellBookTypes.Unknown;
                return;
            }
        }
コード例 #14
0
ファイル: SpellBook.cs プロジェクト: swak/UltimaXNA
 public SpellBook(Serial serial, Map map)
     : base(serial, map)
 {
     BookType         = SpellBookTypes.Unknown;
     m_SpellsBitfield = 0;
 }
コード例 #15
0
ファイル: SpellBook.cs プロジェクト: msx752/UltimaXNA
 public SpellBook(Serial serial, Map map)
     : base(serial, map)
 {
     BookType = SpellBookTypes.Unknown;
     m_SpellsBitfield = 0;
 }