Beispiel #1
0
	private void SetChatMsg( body_SC_ITEM_SLOT sitem )
	{
		Item _dropItem = ItemMgr.ItemManagement.GetItem( sitem.sItem.nItemTableIdx);
			
		if( null != _dropItem)
		{
			int iHadItemCount = sitem.sItem.nOverlapped;
			
			RealItem _dropRealItem = GetRealItemInSlot( sitem.nSlot);
			if( null != _dropRealItem)
			{
				iHadItemCount = sitem.sItem.nOverlapped - _dropRealItem.sItem.nOverlapped;					
			}
			
			
			if( 1 == iHadItemCount)
			{					
				m_sbChatTemp.Remove( 0, m_sbChatTemp.Length );
				
				m_sbChatTemp.Append( _dropItem.ItemData.GetGradeColor().ToString() );
				m_sbChatTemp.Append( AsTableManager.Instance.GetTbl_String( _dropItem.ItemData.nameId ) );		
				
				
				//m_sbChatTemp.AppendFormat( AsTableManager.Instance.GetTbl_String(1236),
				//							AsTableManager.Instance.GetTbl_String(_dropItem.ItemData.nameId) );					
				
				AsChatManager.Instance.InsertSystemChat( string.Format( AsTableManager.Instance.GetTbl_String(1236), m_sbChatTemp.ToString()), eCHATTYPE.eCHATTYPE_SYSTEM_ITEM);					
			}
			else if( 0 < iHadItemCount )
			{					
				m_sbChatTemp.Remove( 0, m_sbChatTemp.Length );				
				m_sbChatTemp.Append( _dropItem.ItemData.GetGradeColor().ToString() );
				m_sbChatTemp.Append( AsTableManager.Instance.GetTbl_String( _dropItem.ItemData.nameId ) );		
				
				//m_sbChatTemp.AppendFormat( AsTableManager.Instance.GetTbl_String(1237),
				//							AsTableManager.Instance.GetTbl_String(_dropItem.ItemData.nameId), iHadItemCount );						
				
				AsChatManager.Instance.InsertSystemChat( string.Format( AsTableManager.Instance.GetTbl_String(1237), m_sbChatTemp.ToString(), iHadItemCount ), eCHATTYPE.eCHATTYPE_SYSTEM_ITEM);						
			}				
		}
	}
Beispiel #2
0
	public void ReceiveItem( body_SC_ITEM_SLOT sitem)
	{		
		if( null == sitem)
		{
			Debug.LogError( "Inventory::ReceiveItem() [ null == sitem] ");
			return;
		}	
		
        eITEMCHANGECONTENTS itemContent = ( eITEMCHANGECONTENTS)sitem.nContents;

		if (sitem.sItem.nOverlapped != 0 && itemContent != eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_ITEMMOVE)
			CheckGetQuestItem(sitem.sItem.nItemTableIdx);
		
		
		if( eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_RANDITEM == itemContent ||
			eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_PICKUP == itemContent || 
			eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_PRODUCT == itemContent )
		{		
				
			SetChatMsg( sitem );	
			
		}		 
		else if( 	eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_SHOP == itemContent ||
					eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_PRIVATESHOP == itemContent ||
					eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_CASHSHOP == itemContent ||
					eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_SOCIALSHOP == itemContent )
		{
		}
		
		if( eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_PRODUCT == itemContent )
		{
			Item _productItem = ItemMgr.ItemManagement.GetItem( sitem.sItem.nItemTableIdx);
			if( null != _productItem )
				AsSoundManager.Instance.PlaySound( _productItem.ItemData.getStrDropSound, Vector3.zero, false);				
		}
		
		#region - pet -
		if( sitem.nSlot == AsPetManager.ePETINVENTORY)
			return;
		#endregion

        int prevItemID    = 0;
        RealItem prevSlot = GetRealItemInSlot(sitem.nSlot);
        if (prevSlot != null)
           prevItemID =  prevSlot.item.ItemID;


        if (sitem.nSlot < newReceiveItemslots.Length && false == AsHudDlgMgr.Instance.IsOpenInven)
        {
            if (0 == sitem.sItem.nItemTableIdx )
            {
                newReceiveItemslots[sitem.nSlot] = false;
            }
            else if (null == GetRealItemInSlot(sitem.nSlot) )
            {
                isNewReceiveItems = true;
                newReceiveItemslots[sitem.nSlot] = true;
                AsHudDlgMgr.Instance.SetNewInvenImg(true);
            }
        }
		
		
		//아이템 장착...
		if(sitem.nSlot < useInvenSlotBeginIndex && sitem.sItem.nItemTableIdx != 0 && 
			eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_STRENGTHEN != itemContent && eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_ENCHANT != itemContent )
		{
			AsEventNotifyMgr.Instance.CenterNotify.AddItemPutOnMessage( GetRealItemInSlot(sitem.nSlot), sitem.sItem.nItemTableIdx, sitem.sItem.nStrengthenCount, sitem.sItem );
		}
	
		SetItem( sitem.sItem, sitem.nSlot);
		
		
		if( eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_ROULETTE == itemContent )
		{			
			AsHudDlgMgr.Instance.OpenRandItemUI( sitem.nSlot, GetRealItemInSlot( sitem.nSlot) );			
		}


		if (itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_PICKUP ||
			 itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_TRADE ||
			 itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_PRODUCT ||
			 itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_SHOP ||
			 itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_SOCIALSHOP ||
			 itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_CHEAT ||
			 itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_ITEMMOVE)
		{
			if (sitem.sItem.nOverlapped == 0)
			{
				if (itemContent != eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_ITEMMOVE)
					ArkQuestmanager.instance.GernerateQuestItemMsg(prevItemID, GetItemTotalCount(prevItemID));
				AsUseItemToMonTriggerManager.instance.UpdateUseItemToTarget(prevItemID);
				AsUseItemToTargetPanelManager.instance.UpdateUseItemToTargetPanel(prevItemID);
			}
			else
			{
				if (itemContent != eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_ITEMMOVE)
					ArkQuestmanager.instance.GernerateQuestItemMsg(sitem.sItem.nItemTableIdx, GetItemTotalCount(sitem.sItem.nItemTableIdx));
				AsUseItemToMonTriggerManager.instance.UpdateUseItemToTarget(sitem.sItem.nItemTableIdx);
				AsUseItemToTargetPanelManager.instance.UpdateUseItemToTargetPanel(sitem.sItem.nItemTableIdx);
			}

			// quest - equip item check
			if (itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_ITEMMOVE && sitem.nSlot < useInvenSlotBeginIndex)
			{
				// check equip

				// Equip
				if (invenSlots[sitem.nSlot].realItem != null)
				{
					AchEquipItem equipItem = new AchEquipItem(sitem.sItem.nItemTableIdx);
					QuestMessageBroadCaster.BrocastQuest(QuestMessages.QM_EQUIP_ITEM, equipItem);
				}
				else // unEquip
				{
					List<int> listEquipItemID = ArkQuestmanager.instance.GetAchEquipItemIDs();

					foreach (int id in listEquipItemID)
					{
						if (IsHaveEquipItem(id) == false && IsHaveCosEquipItem(id) == false)
						{
							AchEquipItem equipItem = new AchEquipItem(id);
							QuestMessageBroadCaster.BrocastQuest(QuestMessages.QM_UNEQUIP_ITEM, equipItem);
						}
					}
				}
			}

		}
		else if (itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_QUEST || itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_RANDITEM)
		{
			ArkQuestmanager.instance.UpdateQuestItem();
		}
        else if (itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_QUEST_COMPLETE_REWARD)
        {
            AsEventNotifyMgr.Instance.ShowGetItemAlrameBalloon(sitem.sItem);
        }
        else
			Debug.LogWarning(itemContent);
		
		
		if( null != AsHudDlgMgr.Instance )
		{
			if( true == AsHudDlgMgr.Instance.IsOpenInven && sitem.nSlot >= useInvenSlotBeginIndex && eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_ROULETTE != itemContent)
			{
				AsHudDlgMgr.Instance.invenDlg.SetSlotItem( sitem.nSlot, GetRealItemInSlot( sitem.nSlot));
			}
			else if( true == AsHudDlgMgr.Instance.IsOpenPlayerStatus && sitem.nSlot < useInvenSlotBeginIndex)
			{
				AsHudDlgMgr.Instance.playerStatusDlg.SetSlotItem( sitem.nSlot, GetRealItemInSlot( sitem.nSlot));
			}		
			
			if( true == AsHudDlgMgr.Instance.IsOpenEnchantDlg )
			{
				AsHudDlgMgr.Instance.enchantDlg.ReciveEnchantUseItem( sitem.nSlot, GetRealItemInSlot( sitem.nSlot));
			}
			
			if ( true == AsHudDlgMgr.Instance.IsOpenStrengthenDlg)
			{			
				AsHudDlgMgr.Instance.strengthenDlg.ResetRealItems();			
			}
			
			if( true == AsHudDlgMgr.Instance.IsOpenProductionDlg)
			{
				AsHudDlgMgr.Instance.productionDlg.ResetReceiveItem();
			}	
			
			if( true == AsHudDlgMgr.Instance.IsOpenStorage )
			{
				AsHudDlgMgr.Instance.storageDlg.SetSlotItem( sitem.nSlot );
			}
			
		}	
			
		
		if( null != ItemMgr.HadItemManagement && sitem.nSlot >= useInvenSlotBeginIndex )
			ItemMgr.HadItemManagement.QuickSlot.ResetSlot();
		
		//Debug.Log( "------ total time : " + ( Time.realtimeSinceStartup - fTotalTime ) );

        if (AsHudDlgMgr.Instance.IsOpenInven)
            QuestTutorialMgr.Instance.ProcessQuestTutorialMsg(new QuestTutorialMsgInfo(QuestTutorialMsg.MOVE_INVENTORY_ITEM));
		
		
		if ( itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_PICKUP ||
             itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_TRADE  ||
             itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_POST ||             
			itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_MIXITEM ||
			itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_CHEAT ||
			itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_SHOP ||
			itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_PRIVATESHOP ||
			itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_PRODUCT ||
			itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_CASHSHOP ||
			itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_SOCIALSHOP ||
			itemContent == eITEMCHANGECONTENTS.eITEMCHANGECONTENTS_QUEST			
			)
		{
			AutoEquipItem( GetRealItemInSlot( sitem.nSlot) );
		}
	}
Beispiel #3
0
	private void ReciveItemSlot(byte[] _packet)
	{
		//Debug.Log("ReciveItemSlot");

        body_SC_ITEM_SLOT data = new body_SC_ITEM_SLOT();
        data.PacketBytesToClass(_packet);

        ItemMgr.HadItemManagement.Inven.ReceiveItem(data);
	}