Exemplo n.º 1
0
	public PetAppearData( AsUserEntity _owner, OtherCharacterAppearData _appear)
	{
		creationType_ = eCreationType.PET_APPEAR;

		initial_ = false;

		owner_ = _owner;
		
		nPetTableIdx_ = _appear.nPetTableIdx_;
		szPetName_ = _appear.szPetName_;
		nLevel_ = _appear.nPetLevel;
		nExp_ = 1;

		if(_appear.sPetItem_ != null)
			itemIdx_ = _appear.sPetItem_.nItemTableIdx;
	}
Exemplo n.º 2
0
	public void SetCreationData( OtherCharacterAppearData _data)
	{
		sessionId_ = (int)_data.sessionKey_;
		uniqueId_ = (int)_data.uniqKey_;
		m_SessionId = _data.sessionKey_;
		m_UniqueId = _data.uniqKey_;
		if( m_ShopUId == uint.MaxValue && _data.shopUId_ != uint.MaxValue)
			m_ShopUId = _data.shopUId_;

		if( m_ShopContent == null)
		{
			string content = "null";
			if( _data.shopContent_ != null) content = System.Text.UTF8Encoding.UTF8.GetString( _data.shopContent_);
			Debug.Log( "AsUserEntity::SetCreationData: previous shop content is null. set by OtherCharacterAppearData.shopContent[" + content + "]");
			m_ShopContent = _data.shopContent_;
		}
		else
		{
			Debug.Log( "AsUserEntity::SetCreationData: previous shop content is " +
				System.Text.UTF8Encoding.UTF8.GetString( m_ShopContent) + ". ignore shop content.");
		}

		#region -Designation
		designationID = _data.designationID;
		#endregion

		#region -AccountGender
#if !NEW_DELEGATE_IMAGE
		userGender = _data.userGender;
#endif
		#endregion

		#region -GMMark
		isGM = _data.isGM;
		#endregion

		SetProperty( eComponentProperty.NAME, AsUtil.GetRealString( _data.charName_));
		SetProperty( eComponentProperty.GUILD_NAME, AsUtil.GetRealString( _data.guildName_));
		SetProperty( eComponentProperty.RACE, _data.race_);
		SetProperty( eComponentProperty.CLASS, _data.class_);
		SetProperty( eComponentProperty.GENDER, _data.gender_);
		SetProperty( eComponentProperty.LEVEL, _data.level_);

		if( GetProperty<bool>( eComponentProperty.SHOP_OPENING) == false)
		{
			SetProperty( eComponentProperty.SHOP_OPENING, _data.shopOpening_);
//			Debug.Log( "AsUserEntity::SetCreationData: [" + _data.uniqKey_ + "]eComponentProperty.SHOP_OPENING = " + _data.shopOpening_);
		}

		Vector3 pos = _data.curPosition_; pos.y += 0.1f;
		transform.position = pos;
		transform.rotation = Quaternion.AngleAxis( 180, Vector3.up);

		SetProperty( eComponentProperty.HP_CUR, _data.hpCur_);
		SetProperty( eComponentProperty.HP_MAX, _data.hpMax_);

		SetProperty( eComponentProperty.MOVE_SPEED , _data.moveSpeed_);

		if (_data.notRegisterMgr == false)
			AsEntityManager.Instance.RegisterUserCharacter( this);

		m_iHairItemIndex = _data.hair_ + _data.hairColor_;

		m_sCharView = new sITEMVIEW[AsGameDefine.ITEM_SLOT_VIEW_COUNT];
		if( _data.surverData != null)
		{
			m_bCostumeOnOff = _data.surverData.bCostumeOnOff;

			m_sCharView[0] = _data.surverData.sNormalItemVeiw_1;
			m_sCharView[1] = _data.surverData.sNormalItemVeiw_2;
			m_sCharView[2] = _data.surverData.sNormalItemVeiw_3;
			m_sCharView[3] = _data.surverData.sNormalItemVeiw_4;
			m_sCharView[4] = _data.surverData.sNormalItemVeiw_5;
		}

		m_sCosItemView = new sITEMVIEW[AsGameDefine.ITEM_SLOT_COS_VIEW_COUNT];
		if( _data.surverData != null)
		{
			m_sCosItemView[0] = _data.surverData.sCosItemView_1;
			m_sCosItemView[1] = _data.surverData.sCosItemView_2;
			m_sCosItemView[2] = _data.surverData.sCosItemView_3;
			m_sCosItemView[3] = _data.surverData.sCosItemView_4;
			m_sCosItemView[4] = _data.surverData.sCosItemView_5;
			m_sCosItemView[5] = _data.surverData.sCosItemView_6;
			m_sCosItemView[6] = _data.surverData.sCosItemView_7;
		}
		
		m_Hide = _data.hide_;
		//m_nPvpPoint = _data.nPvpPoint_;
		m_nYesterdayPvpRank = _data.nYesterdayPvpRank;
		m_nYesterdayPvpPoint = _data.nYesterdayPvpPoint;
		m_nYesterdayPvpRankRate = _data.nYesterdayPvpRankRate;
#if NEW_DELEGATE_IMAGE
		nUserDelegateImageIndex = _data.nDelegateImageTableIndex;
#else
		m_nRankPoint = _data.nRankPoint_;
#endif
		m_bSubTitleHide = _data.bSubTitleHide;
		
		buffAccure_ = new Msg_CharBuffAccure( _data.criticalChance, _data.dodgeChance);
		HandleMessage( buffAccure_);
	}
Exemplo n.º 3
0
	void _PetProc( AsUserEntity _user, OtherCharacterAppearData _data)
	{
		if( _data.nPetTableIdx_ > 0)
		{
			PetAppearData appear = new PetAppearData(_user, _data);
			_user.HandleMessage( new Msg_PetDataIndicate( appear));
//			PetAppear( appear);
		}
	}
Exemplo n.º 4
0
	protected void CreateRenderTarget(eCLASS _eClass, eGENDER _gender, params int[] _partsIDs)
	{
		if (null == objCategoryListItem)
			return;

		if (null != AsHudDlgMgr.Instance.cashShopEntity)
		{
			AsEntityManager.Instance.RemoveEntity(AsHudDlgMgr.Instance.cashShopEntity);
			AsHudDlgMgr.Instance.cashShopEntity = null;
		}

		m_isShowInit = true;
		m_PartsRot = 300f;

		AS_SC_OTHER_CHAR_APPEAR_2 appear = new AS_SC_OTHER_CHAR_APPEAR_2();
		appear.nCharUniqKey = uint.MaxValue;
		appear.eClass = (int)_eClass;
		appear.eGender = _gender;
		appear.eRace = (int)AsEntityManager.Instance.UserEntity.GetProperty<eRACE>(eComponentProperty.RACE);
		Tbl_Class_Record record = AsTableManager.Instance.GetTbl_Class_Record((eRACE)appear.eRace, (eCLASS)appear.eClass);
		if (null != record)
			appear.nMoveSpeed = (int)record.MoveSpeed;

		appear.bCostumeOnOff = PartsRoot.GetCosOnDef();
		appear.sNormalItemVeiw_1 = new sITEMVIEW();
		appear.sNormalItemVeiw_2 = new sITEMVIEW();
		appear.sNormalItemVeiw_3 = new sITEMVIEW();
		appear.sNormalItemVeiw_4 = new sITEMVIEW();
		appear.sNormalItemVeiw_5 = new sITEMVIEW();

		appear.sCosItemView_1 = new sITEMVIEW();
		appear.sCosItemView_2 = new sITEMVIEW();
		appear.sCosItemView_3 = new sITEMVIEW();
		appear.sCosItemView_4 = new sITEMVIEW();
		appear.sCosItemView_5 = new sITEMVIEW();
		appear.sCosItemView_6 = new sITEMVIEW();
		appear.sCosItemView_7 = new sITEMVIEW();
		appear.fHpMax = 100f;
		appear.fHpCur = 100f;

		int count = 0;
		foreach (int id in _partsIDs)
		{
			Item _item = ItemMgr.ItemManagement.GetItem(id);
			if (null == _item)
				continue;

			if (_item.ItemData.GetItemType() == Item.eITEM_TYPE.UseItem &&
				_item.ItemData.GetSubType() == (int)Item.eUSE_ITEM.ConsumeHair &&
				_item.ItemData.needClass == _eClass &&
				count == 0)
			{
				Item hairItem = ItemMgr.ItemManagement.GetItem(_item.ItemData.m_iItem_Rand_ID);

				if (hairItem != null)
				{
					if (hairItem.ItemData.GetItemType() == Item.eITEM_TYPE.EquipItem && hairItem.ItemData.GetSubType() == (int)Item.eEQUIP.Hair)
						appear.nHair = hairItem.ItemID;
				}

				continue;
			}

			count++;

			if (Item.eITEM_TYPE.CosEquipItem != _item.ItemData.GetItemType() && Item.eITEM_TYPE.EquipItem != _item.ItemData.GetItemType())
				continue;

			switch ((Item.eEQUIP)_item.ItemData.GetSubType())
			{
				case Item.eEQUIP.Weapon:
					appear.sNormalItemVeiw_1.nItemTableIdx = PartsRoot.GetDefWeaponItemID(_eClass);
					appear.sCosItemView_1.nItemTableIdx = id;
					break;

				case Item.eEQUIP.Head:
					appear.sCosItemView_2.nItemTableIdx = id;
					break;

				case Item.eEQUIP.Armor:
					appear.sCosItemView_3.nItemTableIdx = id;
					break;

				case Item.eEQUIP.Gloves:
					appear.sCosItemView_4.nItemTableIdx = id;
					break;

				case Item.eEQUIP.Point:
					appear.sCosItemView_5.nItemTableIdx = id;
					break;

				case Item.eEQUIP.Fairy:
					appear.sCosItemView_7.nItemTableIdx = id;
					break;

				case Item.eEQUIP.Wing:
					appear.sCosItemView_6.nItemTableIdx = id;
					break;
			}
		}


		OtherCharacterAppearData creationData = new OtherCharacterAppearData(appear);
		creationData.notRegisterMgr = true;

		AsHudDlgMgr.Instance.cashShopEntity = AsEntityManager.Instance.CreateUserEntity("OtherUser", creationData, true, true, 3f);


		if (null != leftRot)
			leftRot.AddInputDelegate(leftRotDelegate);

		if (null != rightRot)
			rightRot.AddInputDelegate(rightRotDelegate);

		m_isLeftRot = false;
		m_isRightRot = false;
		m_fEffectDlayTime = 0f;
	}
Exemplo n.º 5
0
	public void OtherCharAppear( AS_SC_OTHER_CHAR_APPEAR_1 _appear)//game process
	{
		for( int i = 0; i < _appear.nCharCnt; ++i)
		{
			AS_SC_OTHER_CHAR_APPEAR_2 appear = _appear.body[i];

			if( false == m_dicUserEntity_UniqueId.ContainsKey( appear.nCharUniqKey))
			{
				//create
				OtherCharacterAppearData creationData = new OtherCharacterAppearData( appear);
				AsUserEntity entity = AsEntityManager.Instance.CreateUserEntity( "OtherUser", creationData, true, true);
				entity.SetRePosition( entity.transform.position);
				
				_PetProc( entity, creationData);

				Msg_OtherUserMoveIndicate moveInfo = new Msg_OtherUserMoveIndicate( creationData.sessionKey_,
					creationData.uniqKey_, creationData.curPosition_, creationData.destPosition_, eMoveType.Normal);
				entity.HandleMessage( moveInfo);

				if( appear.bProgress)
				{
					entity.ShowProductImg( appear.bProgress);
				}
				else if( 0 != appear.nCollectIdx)
				{
					body_SC_COLLECT_INFO info = new body_SC_COLLECT_INFO();
					info.nCollectNpcIdx = appear.nCollectIdx;
					info.nCollectorUniqKey = appear.nCharUniqKey;
					info.nCollectorSession = appear.nSessionIdx;
					info.eCollectState = ( int)eCOLLECT_STATE.eCOLLECT_STATE_START;
					entity.HandleMessage( new Msg_CollectInfo( info));
				}

				//party
				entity.PartyIdx = appear.nPartyIdx;
				entity.ShowPartyPR( appear.bPartyNotice, System.Text.UTF8Encoding.UTF8.GetString( appear.szPartyNotice));
			}
			else
			{
				AsUserEntity entity = m_dicUserEntity_UniqueId[appear.nCharUniqKey];

				if( entity.CheckShopOpening() == true)
				{
					OtherCharacterAppearData creationData = new OtherCharacterAppearData( appear);
					entity.SetCreationData( creationData);
					entity.SetRePosition( entity.transform.position);
					entity.ShowProductImg( appear.bProgress);

					if( 0 != appear.nCollectIdx)
					{
						body_SC_COLLECT_INFO info = new body_SC_COLLECT_INFO();
						info.nCollectNpcIdx = appear.nCollectIdx;
						info.nCollectorUniqKey = appear.nCharUniqKey;
						info.nCollectorSession = appear.nSessionIdx;
						info.eCollectState = ( int)eCOLLECT_STATE.eCOLLECT_STATE_START;
						entity.HandleMessage( new Msg_CollectInfo( info));
					}
				}
				else
				{
					Debug.LogError( "[AsEntityManager]OtherCharAppear: already created character. id = " + appear.nCharUniqKey);
					continue;
				}
			}
		}
	}