Пример #1
0
 internal PlayerItem(DatabaseQuery pQuery)
 {
     mPlayerIdentifier = (int)pQuery["player_identifier"];
     mInventoryType = (EInventoryType)(byte)pQuery["inventory_type"];
     mInventorySlot = (short)pQuery["inventory_slot"];
     mItemIdentifier = (int)pQuery["item_identifier"];
     mUnusedScrollSlots = (byte)pQuery["unused_scroll_slots"];
     mUsedScrollSlots = (byte)pQuery["used_scroll_slots"];
     mStrength = (ushort)pQuery["strength"];
     mDexterity = (ushort)pQuery["dexterity"];
     mIntellect = (ushort)pQuery["intellect"];
     mLuck = (ushort)pQuery["luck"];
     mHealth = (ushort)pQuery["health"];
     mMana = (ushort)pQuery["mana"];
     mWeaponAttack = (ushort)pQuery["weapon_attack"];
     mMagicAttack = (ushort)pQuery["magic_attack"];
     mWeaponDefense = (ushort)pQuery["weapon_defense"];
     mMagicDefense = (ushort)pQuery["magic_defense"];
     mAccuracy = (ushort)pQuery["accuracy"];
     mAvoidance = (ushort)pQuery["avoidance"];
     mHands = (ushort)pQuery["hands"];
     mSpeed = (ushort)pQuery["speed"];
     mJump = (ushort)pQuery["jump"];
     mQuantity = (ushort)pQuery["quantity"];
     mOwner = (string)pQuery["owner"];
     mFlags = (ushort)pQuery["flags"];
 }
Пример #2
0
    //protected virtual void OnSelectedSlot(CUGUIInventorySlot pSlot, CLASS_DATA pData) { }

    //protected virtual void OnUnSelectedSlot() { }

    //protected virtual void OnSetItem(CUGUIInventorySlot pSlot, CLASS_DATA pData) { }

    //protected virtual void OnRemoveItem(int iRealID) { }

    /* protected - [Event] Function
     * 자식 객체가 호출(For Child class call)		*/

    //private void EventSwapData(int iOwnerSlotID, int iTargetSlotID)
    //{
    //	if (iOwnerSlotID == iTargetSlotID) return;

    //	CLASS_DATA pOwnerDataTemp = _mapInventoryData[iOwnerSlotID];

    //	if (_mapInventoryData.ContainsKey(iTargetSlotID))
    //	{
    //		EventSetSlotData(iOwnerSlotID, _mapInventoryData[iTargetSlotID]);
    //		EventSetSlotData(iTargetSlotID, pOwnerDataTemp);
    //	}
    //	else
    //	{
    //		EventRemoveData(iOwnerSlotID);
    //		EventSetSlotData(iTargetSlotID, pOwnerDataTemp);
    //	}
    //}

    //private void EventSetSlotData(int iSlotID, CLASS_DATA pData)
    //{
    //	pData.DoInitOwnerListener(this);

    //	CUGUIInventorySlot pSlot = _mapInventorySlot[iSlotID];
    //	pSlot.EventSetData(pData);

    //	_mapInventoryData[iSlotID] = pData;

    //	OnSetItem(pSlot, pData);
    //}

    //private void EventRemoveData(int iSlotID)
    //{
    //	if (_mapInventoryData.ContainsKey(iSlotID) == false) return;

    //	int iRealID_Backup = _mapInventoryData[iSlotID].p_iRealID;

    //	_mapInventorySlot[iSlotID].DoEnableImage(false);
    //	_mapInventoryData.Remove(iSlotID);

    //	OnRemoveItem(iRealID_Backup);
    //}

    protected void EventInit_InventoryType()
    {
        _iTotalDataCount = GetInventoryData().Count;

        EInventoryType eInventoryType = GetInventoryType();

        switch (eInventoryType)
        {
        case EInventoryType.Scroll:
            ProcInit_InventoryData(GetInventoryData());
            break;

        case EInventoryType.Page:
        case EInventoryType.Page_Auto:
            ProcInit_InventoryData_Page(1, eInventoryType == EInventoryType.Page_Auto);
            break;
        }
    }
Пример #3
0
    public void IInventory_RefreshData()
    {
        _iTotalDataCount = GetInventoryData().Count;

        EInventoryType eInventoryType = GetInventoryType();

        switch (eInventoryType)
        {
        case EInventoryType.Scroll:
            ProcInit_InventoryData(GetInventoryData());
            break;

        case EInventoryType.Page:
        case EInventoryType.Page_Auto:
            ProcInit_InventoryData_Page(_iCurPage, eInventoryType == EInventoryType.Page_Auto);
            break;
        }

        // IInventory_OnClickSlot( null );
        OnInventory_RefreshInventoryData(GetInventoryData());
    }
Пример #4
0
        public EEquipmentSlot GetItemEPlayerPartsType(EInventoryType type)
        {
            try
            {
                switch (type)
                {
                /*  case EInventoryType.NonEquip:
                 * break;*/
                case EInventoryType.Head:
                    return(EEquipmentSlot.Head);

                case EInventoryType.Neck:
                    return(EEquipmentSlot.Neck);

                case EInventoryType.Shoulders:
                    return(EEquipmentSlot.Shoulders);

                case EInventoryType.Body:
                    return(EEquipmentSlot.Body);

                case EInventoryType.Chest:
                    return(EEquipmentSlot.Chest);

                case EInventoryType.Waist:
                    return(EEquipmentSlot.Waist);

                case EInventoryType.Legs:
                    return(EEquipmentSlot.Legs);

                case EInventoryType.Feet:
                    return(EEquipmentSlot.Feet);

                case EInventoryType.Wrists:
                    return(EEquipmentSlot.Wrists);

                case EInventoryType.Hands:
                    return(EEquipmentSlot.Hands);

                case EInventoryType.Finger:
                    return(EEquipmentSlot.Finger1);

                case EInventoryType.Trinket:
                    return(EEquipmentSlot.Trinket1);

                case EInventoryType.Weapon:
                {
                    /* if (Host.CharacterSettings.TwoWeapon)
                     *   {
                     *       return EEquipmentSlot.OffHand;
                     *   }*/
                    return(EEquipmentSlot.MainHand);
                }


                case EInventoryType.Shield:
                    return(EEquipmentSlot.OffHand);

                case EInventoryType.Ranged:
                    return(Host.ClientType == EWoWClient.Classic ? EEquipmentSlot.Ranged : EEquipmentSlot.MainHand);

                case EInventoryType.Cloak:
                    return(EEquipmentSlot.Cloak);

                case EInventoryType.TwoHandedWeapon:
                    return(EEquipmentSlot.MainHand);

                case EInventoryType.Bag:
                    break;

                case EInventoryType.Tabard:
                    return(EEquipmentSlot.Tabard);

                case EInventoryType.Robe:
                    return(EEquipmentSlot.Chest);

                case EInventoryType.MainHandWeapon:
                    return(EEquipmentSlot.MainHand);

                case EInventoryType.OffHandWeapon:
                    return(EEquipmentSlot.OffHand);

                case EInventoryType.Holdable:
                    return(EEquipmentSlot.OffHand);

                /*  case EInventoryType.Ammo:
                 * break;*/
                /*  case EInventoryType.Thrown:
                 * break;*/
                case EInventoryType.RangedRight:
                    return(EEquipmentSlot.Ranged);

                    /*  case EInventoryType.Quiver:
                     *        break;*/
                    /*  case EInventoryType.Relic:
                     *        break;   */
                }

                return(EEquipmentSlot.Ranged);
            }
            catch (Exception e)
            {
                Host.log(e + "");
                return(EEquipmentSlot.Ranged);
            }
        }