Exemplo n.º 1
0
        public UnequipItemResult UnequipItem(byte sourceIndex, out byte index, out byte amount)
        {
            index  = 0;
            amount = 0;

            EQUIP_SLOT fromSlot = (EQUIP_SLOT)sourceIndex;

            // equip slot is not empty
            if (!this.equip.ContainsKey(fromSlot))
            {
                return(UnequipItemResult.ERROR);
            }

            // move the item into the inventory
            AddItemResult aRes = this.AddItem(this.equip[fromSlot], out index, out amount);

            if (aRes == AddItemResult.ERROR)
            {
                return(UnequipItemResult.ERROR);
            }

            // unequip the item
            this.equip.Remove(fromSlot);

            if (aRes == AddItemResult.NEW_INDEX)
            {
                return(UnequipItemResult.NEW_INDEX);
            }
            else if (aRes == AddItemResult.STACKED)
            {
                return(UnequipItemResult.STACKED);
            }

            return(UnequipItemResult.ERROR);
        }
Exemplo n.º 2
0
    public void SetEquipInfo(EquipItemInfo equip_info)
    {
        PlayerLoadInfo playerLoadInfo = playerLoader.loadInfo.Clone();

        if (equip_info != null)
        {
            playerLoadInfo.SetEquip(MonoBehaviourSingleton <UserInfoManager> .I.userStatus.sex, equip_info.tableData, true, true, true);
        }
        else if (viewMode == VIEW_MODE.AVATAR)
        {
            int num = EQUIP_SLOT.AvatatToEquip(equipSetData.index);
            equip_info = equipSetData.equipSetInfo.item[num];
            if (equip_info == null)
            {
                playerLoadInfo.RemoveEquip(MonoBehaviourSingleton <UserInfoManager> .I.userStatus.sex, num);
            }
            else
            {
                playerLoadInfo.SetEquip(MonoBehaviourSingleton <UserInfoManager> .I.userStatus.sex, equip_info.tableData, true, true, true);
            }
        }
        else if (equipSetData != null)
        {
            playerLoadInfo.RemoveEquip(MonoBehaviourSingleton <UserInfoManager> .I.userStatus.sex, equipSetData.index);
        }
        LoadPlayer(playerLoadInfo);
        if (equipInfo != equip_info)
        {
            equipInfo = equip_info;
            MoveCamera(viewType, viewType, viewMode, viewMode);
        }
    }
Exemplo n.º 3
0
 public void MakeInactive(EQUIP_SLOT slot)
 {
     Item item;
     if (!this.Char.inv.EquipList.ContainsKey(slot)) return;
     item = this.Char.inv.EquipList[slot];
     if (item.active == 0) return;
     item.active = 0;
     Bonus.BonusHandler.Instance.EquiqItem(this.Char, item, true);
     Packets.Server.ItemAdjust p = new SagaMap.Packets.Server.ItemAdjust();
     p.SetContainer(1);
     p.SetSlot((byte)slot);
     p.SetFunction(SagaMap.Packets.Server.ItemAdjust.Function.Active);
     p.SetValue(0);
     this.client.netIO.SendPacket(p, client.SessionID);
 }
Exemplo n.º 4
0
        public EquipItemResult EquipItem(byte sourceIndex, byte destIndex, out Item item)
        {
            item = null;

            EQUIP_SLOT toSlot = (EQUIP_SLOT)destIndex;

            // does the item exist?
            item = this.GetItem(CONTAINER_TYPE.INVENTORY, sourceIndex);
            if (item == null)
            {
                return(EquipItemResult.ERROR);
            }

            // item is equipable
            //if (item.type != ITEM_TYPE.EQUIP) return EquipItemResult.NOT_EQUIPABLE;//is not working properly in OB Database

            //make sure the equipSlots match *does not work properly, yet*
            //if (this.inv[fromIndex].equipSlot != toSlot) return EquipItemResult.WRONG_EQUIPSLOT;

            // is the slot unequiped?
            if (!this.equip.ContainsKey(toSlot))
            {
                // if the equip slot was empty, we delete the sourceItemIndex from the inventory
                byte nAmount;
                this.DeleteItem(CONTAINER_TYPE.INVENTORY, sourceIndex, item.id, 1, out nAmount);
            }
            else
            {
                // if there's already another item at this slot, the client expects that
                // its switched with the new equip item
                this.inv[sourceIndex]       = this.equip[toSlot];
                this.inv[sourceIndex].index = item.index;
                this.equip.Remove(toSlot);
            }


            this.equip.Add(toSlot, item);
            item.index = destIndex;

            return(EquipItemResult.NO_ERROR);
        }
Exemplo n.º 5
0
Arquivo: PC.cs Projeto: xxlio109/Saga
        public void MakeInactive(EQUIP_SLOT slot)
        {
            Item item;

            if (!this.Char.inv.EquipList.ContainsKey(slot))
            {
                return;
            }
            item = this.Char.inv.EquipList[slot];
            if (item.active == 0)
            {
                return;
            }
            item.active = 0;
            Bonus.BonusHandler.Instance.EquiqItem(this.Char, item, true);
            Packets.Server.ItemAdjust p = new SagaMap.Packets.Server.ItemAdjust();
            p.SetContainer(1);
            p.SetSlot((byte)slot);
            p.SetFunction(SagaMap.Packets.Server.ItemAdjust.Function.Active);
            p.SetValue(0);
            this.client.netIO.SendPacket(p, client.SessionID);
        }
Exemplo n.º 6
0
    private void MoveCamera(VIEW_TYPE type_from, VIEW_TYPE type_to, VIEW_MODE mode_from, VIEW_MODE mode_to)
    {
        //IL_0015: Unknown result type (might be due to invalid IL or missing references)
        //IL_001a: Unknown result type (might be due to invalid IL or missing references)
        //IL_0028: Unknown result type (might be due to invalid IL or missing references)
        //IL_002d: Unknown result type (might be due to invalid IL or missing references)
        //IL_004c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0051: Unknown result type (might be due to invalid IL or missing references)
        //IL_00e3: Unknown result type (might be due to invalid IL or missing references)
        //IL_00e8: Unknown result type (might be due to invalid IL or missing references)
        //IL_00fe: Unknown result type (might be due to invalid IL or missing references)
        //IL_00ff: Unknown result type (might be due to invalid IL or missing references)
        //IL_0101: Unknown result type (might be due to invalid IL or missing references)
        //IL_0106: Unknown result type (might be due to invalid IL or missing references)
        //IL_0108: Unknown result type (might be due to invalid IL or missing references)
        //IL_010d: Unknown result type (might be due to invalid IL or missing references)
        //IL_0117: Unknown result type (might be due to invalid IL or missing references)
        //IL_011c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0129: Unknown result type (might be due to invalid IL or missing references)
        //IL_012e: Unknown result type (might be due to invalid IL or missing references)
        //IL_0133: Unknown result type (might be due to invalid IL or missing references)
        //IL_0138: Unknown result type (might be due to invalid IL or missing references)
        //IL_013d: Unknown result type (might be due to invalid IL or missing references)
        //IL_0142: Unknown result type (might be due to invalid IL or missing references)
        //IL_0143: Unknown result type (might be due to invalid IL or missing references)
        //IL_0144: Unknown result type (might be due to invalid IL or missing references)
        //IL_0145: Unknown result type (might be due to invalid IL or missing references)
        //IL_014a: Unknown result type (might be due to invalid IL or missing references)
        //IL_014b: Unknown result type (might be due to invalid IL or missing references)
        //IL_014d: Unknown result type (might be due to invalid IL or missing references)
        //IL_0155: Unknown result type (might be due to invalid IL or missing references)
        //IL_015a: Unknown result type (might be due to invalid IL or missing references)
        //IL_015f: Unknown result type (might be due to invalid IL or missing references)
        //IL_0165: Unknown result type (might be due to invalid IL or missing references)
        //IL_0166: Unknown result type (might be due to invalid IL or missing references)
        //IL_016b: Unknown result type (might be due to invalid IL or missing references)
        //IL_0170: Unknown result type (might be due to invalid IL or missing references)
        //IL_0172: Unknown result type (might be due to invalid IL or missing references)
        //IL_0174: Unknown result type (might be due to invalid IL or missing references)
        //IL_0181: Unknown result type (might be due to invalid IL or missing references)
        //IL_0186: Unknown result type (might be due to invalid IL or missing references)
        //IL_01a0: Unknown result type (might be due to invalid IL or missing references)
        //IL_01a5: Unknown result type (might be due to invalid IL or missing references)
        //IL_01aa: Unknown result type (might be due to invalid IL or missing references)
        //IL_01ab: Unknown result type (might be due to invalid IL or missing references)
        //IL_01c2: Unknown result type (might be due to invalid IL or missing references)
        //IL_01c7: Unknown result type (might be due to invalid IL or missing references)
        //IL_01cc: Unknown result type (might be due to invalid IL or missing references)
        //IL_01ce: Unknown result type (might be due to invalid IL or missing references)
        //IL_01d0: Unknown result type (might be due to invalid IL or missing references)
        //IL_01d1: Unknown result type (might be due to invalid IL or missing references)
        //IL_01d6: Unknown result type (might be due to invalid IL or missing references)
        //IL_01db: Unknown result type (might be due to invalid IL or missing references)
        //IL_01fb: Unknown result type (might be due to invalid IL or missing references)
        //IL_0200: Unknown result type (might be due to invalid IL or missing references)
        //IL_0203: Unknown result type (might be due to invalid IL or missing references)
        //IL_0208: Unknown result type (might be due to invalid IL or missing references)
        //IL_020d: Unknown result type (might be due to invalid IL or missing references)
        //IL_022b: Unknown result type (might be due to invalid IL or missing references)
        //IL_0230: Unknown result type (might be due to invalid IL or missing references)
        //IL_029c: Unknown result type (might be due to invalid IL or missing references)
        //IL_02a1: Unknown result type (might be due to invalid IL or missing references)
        //IL_02a5: Unknown result type (might be due to invalid IL or missing references)
        //IL_02ab: Unknown result type (might be due to invalid IL or missing references)
        //IL_02cc: Unknown result type (might be due to invalid IL or missing references)
        //IL_02d1: Unknown result type (might be due to invalid IL or missing references)
        //IL_02d5: Unknown result type (might be due to invalid IL or missing references)
        //IL_02db: Unknown result type (might be due to invalid IL or missing references)
        //IL_034e: Unknown result type (might be due to invalid IL or missing references)
        //IL_0353: Unknown result type (might be due to invalid IL or missing references)
        //IL_0358: Unknown result type (might be due to invalid IL or missing references)
        //IL_035c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0362: Unknown result type (might be due to invalid IL or missing references)
        Quaternion val = Quaternion.Euler(0f, parameter.playerRot, 0f);
        Vector3    val2;
        Quaternion end_value;
        float      end_value2;

        if (type_to == VIEW_TYPE.STATUS)
        {
            Vector3 playerPos = parameter.playerPos;
            if (mode_to == VIEW_MODE.AVATAR)
            {
                val = Quaternion.Euler(0f, parameter.avatarPlayerRot, 0f);
            }
            if (equipSetData != null)
            {
                OutGameSettingsManager.StatusScene.EquipViewInfo equipViewInfo = null;
                if (equipInfo != null)
                {
                    equipViewInfo = parameter.GetEquipViewInfo(equipInfo.tableData.type.ToString());
                }
                if (equipViewInfo == null)
                {
                    equipViewInfo = parameter.GetEquipViewInfo(EQUIP_SLOT.ToType((viewMode != VIEW_MODE.AVATAR) ? equipSetData.index : EQUIP_SLOT.AvatatToEquip(equipSetData.index)).ToString());
                }
                Vector3 cameraTargetPos = equipViewInfo.cameraTargetPos;
                if (mode_to == VIEW_MODE.AVATAR)
                {
                    cameraTargetPos.x = 0f;
                }
                playerPos = val * cameraTargetPos + playerPos;
                val2      = Quaternion.AngleAxis(0f - equipViewInfo.cameraXAngle, Vector3.get_right()) * Quaternion.AngleAxis(0f - equipViewInfo.cameraYAngle, Vector3.get_up()) * Vector3.get_forward();
                val2      = val * val2;
                val2      = playerPos + val2 * equipViewInfo.cameraDistance;
            }
            else
            {
                Vector3 val3 = val * Vector3.get_forward();
                val2       = playerPos + val3 * parameter.cameraTargetDistance + new Vector3(0f, parameter.cameraHeight, 0f);
                playerPos += new Vector3(0f, parameter.cameraTargetHeight, 0f);
            }
            end_value  = Quaternion.LookRotation(playerPos - val2);
            end_value2 = parameter.cameraFieldOfView;
        }
        else
        {
            OutGameSettingsManager.SmithScene smithScene = MonoBehaviourSingleton <OutGameSettingsManager> .I.smithScene;
            val2       = smithScene.createCameraPos;
            end_value  = Quaternion.Euler(smithScene.createCameraRot);
            end_value2 = smithScene.createCameraFieldOfView;
            val        = Quaternion.Euler(0f, parameter.playerRot, 0f);
        }
        float num = parameter.cameraMoveTime;

        if (MonoBehaviourSingleton <TransitionManager> .I.isTransing && !MonoBehaviourSingleton <TransitionManager> .I.isChanging)
        {
            num = 0f;
        }
        cameraTurningMode = (num > 0f && type_from == type_to && type_from == VIEW_TYPE.STATUS && mode_from != mode_to);
        cameraPosAnim.Set(num, targetCameraTransform.get_position(), val2, null, default(Vector3), null);
        cameraPosAnim.Play();
        cameraRotAnim.Set(num, targetCameraTransform.get_rotation(), end_value, null, default(Quaternion), null);
        cameraRotAnim.Play();
        cameraFovAnim.Set(num, targetCamera.get_fieldOfView(), end_value2, null, 0f, null);
        cameraFovAnim.Play();
        if (playerLoader != null && !playerLoader.isLoading)
        {
            playerRotAnim.Set(num * 1.25f, playerLoader.get_transform().get_rotation(), val, null, default(Quaternion), null);
            playerRotAnim.Play();
        }
    }
Exemplo n.º 7
0
 public void SetEquipment(EQUIP_SLOT item)
 {
     this.PutByte((byte)item, 10);
 }
Exemplo n.º 8
0
 public void SetEquipSlot(EQUIP_SLOT slot)
 {
     this.PutByte((byte)slot, 8);
 }
Exemplo n.º 9
0
 public void SetEquipSlot(EQUIP_SLOT slot)
 {
     this.PutByte((byte)slot, 8);
 }
Exemplo n.º 10
0
 public void SetEquipment(EQUIP_SLOT item)
 {
     this.PutByte((byte)item, 10);
 }