Exemplo n.º 1
0
	public void ItemUsedResult(body_SC_ITEM_RESULT _item)
	{
		//*	
		if(SetPStoreOpenItem(_item.nItemTableIdx) == true)
		{
			Debug.Log("AsPStoreManager::ItemUsedResult: pstore item used[" + m_PStoreEnableSlot + "(" + _item.nItemTableIdx + ")]");
			Request_Create();
		}// dopamin70 */
	}
Exemplo n.º 2
0
	private void ReciveItemResult(byte[] _packet)
	{
        body_SC_ITEM_RESULT data = new body_SC_ITEM_RESULT();
        data.PacketBytesToClass(_packet);

		Debug.Log("ReciveItemResult [ result : " + data.eResult + "][ commond : " + (PROTOCOL_CS)data.nCommond );

		if( eRESULTCODE.eRESULT_FAIL_IVNENTORY_FULL == data.eResult )
		{
			AsChatManager.Instance.InsertChat( AsTableManager.Instance.GetTbl_String(118), eCHATTYPE.eCHATTYPE_SYSTEM);
		}

		switch( (PROTOCOL_CS)data.nCommond )
		{
		case PROTOCOL_CS.CS_ITEM_USE:
			if( eRESULTCODE.eRESULT_SUCC == data.eResult )
			{
				//$yde
				AsPStoreManager.Instance.ItemUsedResult(data);

				//kij
				if( 0 != data.nItemTableIdx )
				{
					Item _item = ItemMgr.ItemManagement.GetItem( data.nItemTableIdx );
					if( null != _item )
					{
                        AsSoundManager.Instance.PlaySound(_item.ItemData.m_strUseSound, Vector3.zero, false);

						/*Tbl_Lottery_Record _randomRecord = AsTableManager.Instance.GetTbl_Lottery_Record( _item.ItemData.m_iItem_Rand_ID );
						if( null != _randomRecord && true == _randomRecord.needEffect )
						{
						}
						else
						{
							AsUserInfo.Instance.GetCurrentUserEntity().PlayUseItemEffect( _item );
						}*/

                        // get quest item
                        if (_item.ItemData.m_eItemType == Item.eITEM_TYPE.UseItem)
                        {
                            Item.eUSE_ITEM subType = (Item.eUSE_ITEM)_item.ItemData.m_iSubType;

                            if (subType == Item.eUSE_ITEM.GetQuest)
                            {
                                ArkSphereQuestTool.QuestData questData = AsTableManager.Instance.GetTbl_QuestData(_item.ItemData.m_iItem_Rand_ID);

                                if (questData != null)
                                {
                                    ArkQuest.SetQuestStrings(questData);

                                    AsHudDlgMgr.Instance.OpenQuestAcceptUI(questData, true);
                                }
                            }
							else if (subType == Item.eUSE_ITEM.InfiniteQuest || subType == Item.eUSE_ITEM.ConsumeQuest)
							{
								CoolTimeGroup coolTimeGroup = CoolTimeGroupMgr.Instance.GetCoolTimeGroup( _item.ItemData.itemSkill, _item.ItemData.itemSkillLevel );
								if( null != coolTimeGroup )
									coolTimeGroup.ActionCoolTime();
							}
                        }

						//$yde
						AsPetManager.Instance.ItemProc(_item);
					}
					else
					{
						Debug.LogError("ReciveItemResult()[ not find item [ id : " + data.nItemTableIdx );
					}
				}
			}

			AsCommonSender.isSendItemUse = false;
			break;

		case PROTOCOL_CS.CS_ITEM_MOVE:
			AsCommonSender.isSendItemMove = false;
			break;

        case PROTOCOL_CS.CS_ITEM_REMOVE:
            {
                AsCommonSender.isSendItemRemove = false;
                ArkQuestmanager.instance.CheckQuestMarkAllNpcAndCollecion();
            }
            break;
		}

        if (eRESULTCODE.eRESULT_FAIL_ITEM_USE == data.eResult      || eRESULTCODE.eRESULT_FAIL_ITEM_USE_SKILLRESET_DEFAULT == data.eResult ||
            eRESULTCODE.eRESULT_FAIL_ITEM_USE_AREA == data.eResult || eRESULTCODE.eRESULT_FAIL_ITEM_USE_BAD_TARGET == data.eResult ||
            eRESULTCODE.eRESULT_FAIL_ITEM_USE_NOT_EXIST_TARGET == data.eResult || eRESULTCODE.eRESULT_FAIL_ITEM_USE_ALREADY_AREA == data.eResult ||
            eRESULTCODE.eRESULT_FAIL_ITEM_USE_ALREADY_TARGET == data.eResult)
        {
            String msg = string.Empty;
			
			switch( data.eResult )
			{
			case eRESULTCODE.eRESULT_FAIL_ITEM_USE:
				msg = AsTableManager.Instance.GetTbl_String(13);
				AsSoundManager.Instance.PlaySound_VoiceBattle(eVoiceBattle.str13_Cannot_Use_Item);
				break;
				
			case eRESULTCODE.eRESULT_FAIL_ITEM_USE_SKILLRESET_DEFAULT:
				msg = AsTableManager.Instance.GetTbl_String(120);
				break;

			case eRESULTCODE.eRESULT_FAIL_ITEM_USE_AREA:
				msg = AsTableManager.Instance.GetTbl_String(924);
				break;

			case eRESULTCODE.eRESULT_FAIL_ITEM_USE_BAD_TARGET:
				msg = AsTableManager.Instance.GetTbl_String(923);
				break;

			case eRESULTCODE.eRESULT_FAIL_ITEM_USE_NOT_EXIST_TARGET:
				msg = AsTableManager.Instance.GetTbl_String(922);
				break;

			case eRESULTCODE.eRESULT_FAIL_ITEM_USE_ALREADY_AREA:
				msg = AsTableManager.Instance.GetTbl_String(953);
				break;

			case eRESULTCODE.eRESULT_FAIL_ITEM_USE_ALREADY_TARGET:
				msg = AsTableManager.Instance.GetTbl_String(923);
				break;
			}
			
            AsChatManager.Instance.InsertChat(msg, eCHATTYPE.eCHATTYPE_SYSTEM);
            AsEventNotifyMgr.Instance.CenterNotify.AddQuestMessage(msg, true);
        }
		else if (eRESULTCODE.eRESULT_FAIL_PRIVATESHOP_MANY == data.eResult)
        {
            string msg = AsTableManager.Instance.GetTbl_String(945);

            AsChatManager.Instance.InsertChat(msg, eCHATTYPE.eCHATTYPE_SYSTEM);
            AsEventNotifyMgr.Instance.CenterNotify.AddQuestMessage(msg, true);
        }
		else if( eRESULTCODE.eRESULT_FAIL_ARENAMATCHING_OTHER_CONTENTS == data.eResult)
		{
			AsEventNotifyMgr.Instance.CenterNotify.AddGMMessage( AsTableManager.Instance.GetTbl_String( 894));
		}
		else if( eRESULTCODE.eRESULT_FAIL_ARENA_OTHER_CONTENTS == data.eResult)
		{
			AsEventNotifyMgr.Instance.CenterNotify.AddGMMessage( AsTableManager.Instance.GetTbl_String( 903));
		}
		else if( eRESULTCODE.eRESULT_FAIL_PET_NOT_EXSIT == data.eResult)
		{
			AsNotify.Instance.MessageBox( AsTableManager.Instance.GetTbl_String(126), AsTableManager.Instance.GetTbl_String(2778),
			                             AsNotify.MSG_BOX_TYPE.MBT_OK, AsNotify.MSG_BOX_ICON.MBI_NOTICE);
		}
		else if( eRESULTCODE.eRESULT_FAIL_PET_FULL_SLOT == data.eResult)
		{
			AsNotify.Instance.MessageBox( AsTableManager.Instance.GetTbl_String(126), AsTableManager.Instance.GetTbl_String(2737),
			                             null, null, AsNotify.MSG_BOX_TYPE.MBT_OK, AsNotify.MSG_BOX_ICON.MBI_NOTICE);
		}
		else if( eRESULTCODE.eRESULT_FAIL_PET_USE_ITEM_COMBAT == data.eResult)
		{
			AsNotify.Instance.MessageBox( AsTableManager.Instance.GetTbl_String(126), AsTableManager.Instance.GetTbl_String(2738),
			                             null, null, AsNotify.MSG_BOX_TYPE.MBT_OK, AsNotify.MSG_BOX_ICON.MBI_NOTICE);
		}
		else if( eRESULTCODE.eRESULT_FAIL_PET_USE_ITEM_ZONE == data.eResult)
		{
			AsNotify.Instance.MessageBox( AsTableManager.Instance.GetTbl_String(126), AsTableManager.Instance.GetTbl_String(2739),
			                             null, null, AsNotify.MSG_BOX_TYPE.MBT_OK, AsNotify.MSG_BOX_ICON.MBI_NOTICE);
		}
		else if( eRESULTCODE.eRESULT_FAIL_PET_HUNGRY_FULL == data.eResult)
		{
			AsNotify.Instance.MessageBox( AsTableManager.Instance.GetTbl_String(126), AsTableManager.Instance.GetTbl_String(2217),
			                             null, null, AsNotify.MSG_BOX_TYPE.MBT_OK, AsNotify.MSG_BOX_ICON.MBI_NOTICE);
		}
		// default
        else if (eRESULTCODE.eRESULT_SUCC != data.eResult)
        {
            Debug.LogError("error ReciveItemResult()[ result : " + data.eResult);
        }

        // update quest item count
        ArkQuestmanager.instance.UpdateQuestItem();
	}