public void PlayRandItemNotify() { if( null == m_randItemNotify) return; ReceiveUserEventNotify( m_randItemNotify); m_randItemNotify = null; }
public void Event_Condition_GetRareItem(body_SC_USER_EVENT_NOTIFY _data) { if(AsEntityManager.Instance.UserEntity.UniqueId == _data.nValue_2) return; if(AsEntityManager.Instance.GetUserEntityByUniqueId((uint)_data.nValue_2) == false) return; Item item = ItemMgr.ItemManagement.GetItem(_data.sItem.nItemTableIdx); if(item.ItemData.grade == Item.eGRADE.Rare || item.ItemData.grade == Item.eGRADE.Epic || item.ItemData.grade == Item.eGRADE.Ark) { Tbl_Emoticon_Record record = AsTableManager.Instance.GetEmoticonByCondition(eAutoCondition.Condition_GetRareItem); if(record != null && Random.Range(0, 1001) <= record.GetConditionProb(eAutoCondition.Condition_GetRareItem)) { if(CheckEnableConditon(eAutoCondition.Condition_GetRareItem) == true) { ConditionProcess(record, eAutoCondition.Condition_GetRareItem); } } } }
//아이템 강화. public void AddItemStrengthenOnMessage( body_SC_USER_EVENT_NOTIFY notify) { Item item = ItemMgr.ItemManagement.GetItem( notify.sItem.nItemTableIdx); if( null == item) return; StringBuilder sbStrengthenCount = new StringBuilder(); sbStrengthenCount.AppendFormat( "+{0}", notify.sItem.nStrengthenCount.ToString()); StringBuilder sbItemName = new StringBuilder(); sbItemName.Insert( 0, item.ItemData.GetGradeColor().ToString()); sbItemName.AppendFormat( "{0}", AsTableManager.Instance.GetTbl_String( item.ItemData.nameId)); string chatMsg = string.Format( AsTableManager.Instance.GetTbl_String(850), AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString( notify.szCharName)), sbStrengthenCount.ToString(), sbItemName.ToString()); AsChatManager.Instance.InsertSystemChat( chatMsg, eCHATTYPE.eCHATTYPE_SYSTEM_ITEM); AddMessageItemPanel( chatMsg, eCENTER_NOTIFY.ItemStrengthen); }
public void ReceiveUserEventNotify( body_SC_USER_EVENT_NOTIFY notify) { if( (eUSEREVENTTYPE)notify.eType == eUSEREVENTTYPE.eUSEREVENTTYPE_ITEM) { Item item = ItemMgr.ItemManagement.GetItem( notify.sItem.nItemTableIdx); if( null == item) return; if( notify.nValue_1 == (int)eUSEREVENT_ITEM_GETTYPE.eUSEREVENT_ITEM_GETTYPE_STRENGTHEN) { CenterNotify.AddItemStrengthenOnMessage( notify); return; } StringBuilder sbItemName = new StringBuilder(); sbItemName.Insert( 0, item.ItemData.GetGradeColor().ToString()); sbItemName.AppendFormat( "{0}", AsTableManager.Instance. GetTbl_String( item.ItemData.nameId)); sbItemName.AppendFormat( "{0}", AsChatManager.Instance.GetChatTypeColor( eCHATTYPE.eCHATTYPE_SYSTEM_ITEM)); StringBuilder getType = new StringBuilder(); switch( (eUSEREVENT_ITEM_GETTYPE)notify.nValue_1) { case eUSEREVENT_ITEM_GETTYPE.eUSEREVENT_ITEM_GETTYPE_HUNTING: getType.Insert( 0, AsTableManager.Instance. GetTbl_String(842)); break; case eUSEREVENT_ITEM_GETTYPE.eUSEREVENT_ITEM_GETTYPE_MIX: getType.Insert( 0, AsTableManager.Instance. GetTbl_String(843)); break; case eUSEREVENT_ITEM_GETTYPE.eUSEREVENT_ITEM_GETTYPE_RULLET: case eUSEREVENT_ITEM_GETTYPE.eUSEREVENT_ITEM_GETTYPE_RANDOMBOX: getType.Insert( 0, AsTableManager.Instance. GetTbl_String(844)); break; case eUSEREVENT_ITEM_GETTYPE.eUSEREVENT_ITEM_GETTYPE_COLLECTING: getType.Insert( 0, AsTableManager.Instance. GetTbl_String(845)); break; case eUSEREVENT_ITEM_GETTYPE.eUSEREVENT_ITEM_GETTYPE_PRODUCT: getType.Insert( 0, AsTableManager.Instance. GetTbl_String(846)); break; } bool isEquipItem = Item.eITEM_TYPE.EquipItem == item.ItemData.GetItemType() || Item.eITEM_TYPE.CosEquipItem == item.ItemData.GetItemType(); //-->머리위 표시는 매직등급 이상 획득 시 표시. //-->채팅창 외치기는 에픽등급 이상 획득 시 표시. if( item.ItemData.grade >= Item.eGRADE.Epic && isEquipItem) { //시스템 메세지 표시.RGBA( 0.0,0.7,0.0,1.0){0}RGBA( 1.0,0.4,0.6,1.0)님이 RGBA( 0.9,0.0,0.0,1.0){1}RGBA( 1.0,0.4,0.6,1.0)을( 를) 통해 [{2}RGBA( 1.0,0.4,0.6,1.0)]을( 를) 획득하였습니다!!! string msg = string.Format( AsTableManager.Instance. GetTbl_String(836),AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString( notify.szCharName)), getType.ToString(), sbItemName.ToString()); AsChatManager.Instance.InsertSystemChat( msg, eCHATTYPE.eCHATTYPE_SYSTEM_ITEM); AsUserEntity userEntity = AsUserInfo.Instance.GetCurrentUserEntity(); if( null != userEntity) { string userName = userEntity.GetProperty<string>( eComponentProperty.NAME); if( userName.CompareTo( AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString( notify.szCharName))) != 0) { CenterNotify.AddItemGetMessage( msg); } } } /* if( isEquipItem && item.ItemData.grade >= Item.eGRADE.Magic && (eUSEREVENT_ITEM_GETTYPE)notify.nValue_1 != eUSEREVENT_ITEM_GETTYPE.eUSEREVENT_ITEM_GETTYPE_RULLET) { AsUserEntity userEntity = AsUserInfo.Instance.GetCurrentUserEntity(); if( null != userEntity) { string userName = userEntity.GetProperty<string>( eComponentProperty.NAME); if( userName.CompareTo( AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString( notify.szCharName))) == 0) m_ItemGetNotify.DisplayItemPanel( notify.sItem.nItemTableIdx); } }*/ if( isEquipItem && item.ItemData.grade >= Item.eGRADE.Rare ) { AsUserEntity userEntity = AsUserInfo.Instance.GetCurrentUserEntity(); AsUserEntity entityEntity = AsEntityManager.Instance.GetUserEntityByUniqueId( (uint)notify.nValue_2 ); if( null != userEntity && null != entityEntity ) { //if( true == entityEntity.IsCheckEquipEnable(item) ) //{ if( userEntity == entityEntity ) { ItemGetAlarmNotify.AddListItem( notify.sItem ); } else { entityEntity.ShowItemGetAlarmBallonImg( notify.sItem, true ); } //} } } } }
public void SetRandItemNotify( body_SC_USER_EVENT_NOTIFY _data) { m_randItemNotify = _data; }
private void ReceiveUserEventNotify( byte[] _packet) { Debug.Log( "ReceiveUserEventNotify"); body_SC_USER_EVENT_NOTIFY notify = new body_SC_USER_EVENT_NOTIFY(); notify.PacketBytesToClass( _packet); /* AsEmotionManager.Instance.Event_Condition_GetRareItem(notify);//$yde if( (eUSEREVENT_ITEM_GETTYPE)notify.nValue_1 == eUSEREVENT_ITEM_GETTYPE.eUSEREVENT_ITEM_GETTYPE_RULLET) { AsUserEntity userEntity = AsUserInfo.Instance.GetCurrentUserEntity(); if( null != userEntity) { string userName = userEntity.GetProperty<string>( eComponentProperty.NAME); if( userName.CompareTo( AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString( notify.szCharName))) == 0) { AsEventNotifyMgr.Instance.SetRandItemNotify( notify); return; } } AsEventNotifyMgr.Instance.ReceiveUserEventNotify( notify); if( AsUserInfo.Instance.SavedCharStat.uniqKey_ != notify.nValue_2) { AsUserEntity _entity = AsEntityManager.Instance.GetUserEntityByUniqueId( (uint)notify.nValue_2); if( null != _entity) { Debug.Log("other user"); } } else { Debug.Log("Player"); } } else { AsEventNotifyMgr.Instance.ReceiveUserEventNotify( notify); } */ if( eUSEREVENTTYPE.eUSEREVENTTYPE_ITEM == (eUSEREVENTTYPE)notify.eType) { AsEmotionManager.Instance.Event_Condition_GetRareItem(notify);//$yde if( (eUSEREVENT_ITEM_GETTYPE)notify.nValue_1 == eUSEREVENT_ITEM_GETTYPE.eUSEREVENT_ITEM_GETTYPE_RULLET) { AsUserEntity userEntity = AsUserInfo.Instance.GetCurrentUserEntity(); if( null != userEntity) { string userName = userEntity.GetProperty<string>( eComponentProperty.NAME); if( userName.CompareTo( AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString( notify.szCharName))) == 0) { AsEventNotifyMgr.Instance.SetRandItemNotify( notify); return; } } AsEventNotifyMgr.Instance.ReceiveUserEventNotify( notify); if( AsUserInfo.Instance.SavedCharStat.uniqKey_ != notify.nValue_2) { AsUserEntity _entity = AsEntityManager.Instance.GetUserEntityByUniqueId( (uint)notify.nValue_2); if( null != _entity) { Debug.Log("other user"); } } else { Debug.Log("Player"); } } else { AsEventNotifyMgr.Instance.ReceiveUserEventNotify( notify); } } else if( eUSEREVENTTYPE.eUSEREVENTTYPE_ARENA == (eUSEREVENTTYPE)notify.eType) { if( eUSEREVENT_ARENATYPE.eUSEREVENT_ARENATYPE_LEAVE == (eUSEREVENT_ARENATYPE)notify.nValue_1) { //string strMsg = string.Format( AsTableManager.Instance.GetTbl_String( 2109), AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString( notify.szCharName))); //AsEventNotifyMgr.Instance.CenterNotify.AddGMMessage( strMsg); AsPvpManager.Instance.ShowKillMessage( notify.nValue_2, 0); if( notify.nValue_2 == AsUserInfo.Instance.SavedCharStat.uniqKey_) { AsPvpManager.Instance.SetBackGroundDelayTime( notify.nServerTime); } } else if( eUSEREVENT_ARENATYPE.eUSEREVENT_ARENATYPE_DEATH == (eUSEREVENT_ARENATYPE)notify.nValue_1) { AsPvpManager.Instance.ShowKillMessage( notify.nValue_2, notify.nValue_3); } } }
void OnGUI() { GUILayout.BeginArea( new Rect( 1, 1, 200, 100)); if( true == GUILayout.Button( "EventNotify: " )) { body_SC_USER_EVENT_NOTIFY notify = new body_SC_USER_EVENT_NOTIFY(); notify.eType = (int)eUSEREVENTTYPE.eUSEREVENTTYPE_ITEM; notify.szCharName = System.Text.UTF8Encoding.UTF8.GetBytes("mmma"); notify.sItem = new sITEM(); notify.sItem.nItemTableIdx = 175041; notify.nValue_1 = (int)eUSEREVENT_ITEM_GETTYPE.eUSEREVENT_ITEM_GETTYPE_HUNTING; //notify.nValue_1 = 175041; //notify.nValue_2 = (int)eUSEREVENT_ITEM_GETTYPE.eUSEREVENT_ITEM_GETTYPE_HUNTING; AsEventNotifyMgr.Instance.ReceiveUserEventNotify(notify); sPARTYLIST[] pList = new sPARTYLIST[20]; for(int i = 0; i < 20; i++) { pList[i] = new sPARTYLIST(); pList[i].sOption = new sPARTYOPTION(); pList[i].sOption.bPublic = true; pList[i].nPartyIdx = i+1; pList[i].nLevel = i % 10; pList[i].nUserCnt = i % 4; pList[i].sOption.szPartyName = System.Text.UTF8Encoding.UTF8.GetBytes( pList[i].nLevel.ToString().ToCharArray(), 0, pList[i].nLevel.ToString().Length ); if(pList[i].nUserCnt==0) pList[i].nUserCnt = 1; } pList[0].sOption.nMaxUser = 4; pList[1].sOption.nMaxUser = 4; pList[2].sOption.nMaxUser = 4; pList[3].sOption.nMaxUser = 4; pList[4].sOption.nMaxUser = 4; pList[5].sOption.nMaxUser = 3; pList[6].sOption.nMaxUser = 3; pList[7].sOption.nMaxUser = 3; pList[8].sOption.nMaxUser = 3; pList[9].sOption.nMaxUser = 3; pList[10].sOption.nMaxUser = 2; pList[11].sOption.nMaxUser = 2; pList[12].sOption.nMaxUser = 2; pList[13].sOption.nMaxUser = 2; pList[14].sOption.nMaxUser = 2; pList[15].sOption.nMaxUser = 4; pList[16].sOption.nMaxUser = 3; pList[17].sOption.nMaxUser = 2; pList[18].sOption.nMaxUser = 4; pList[19].sOption.nMaxUser = 3; // AsPartyManager.Instance.ReceivePartyList(pList); // AS_SC_PARTY_DICE_ITEM_INFO data = new AS_SC_PARTY_DICE_ITEM_INFO(); // data.nDropItemIdx = 170002; //data.sItem = new sITEM(); // AsPartyManager.Instance.PartyDiceItemInfo(data); /* AS_SC_PARTY_DICE_ITEM_INFO dice = new AS_SC_PARTY_DICE_ITEM_INFO(); dice.nDropItemIdx = 170002; dice.sItem = new sITEM(); dice.sItem.nItemTableIdx = 170002; // dice.sItem AsPartyManager.Instance.PartyDiceItemInfo(dice); */ /* * public eRESULTCODE eResult; public UInt32 nUserUniqKey; //Check BlockList 2013.03.05 public UInt32 nCharUniqKey; public body_SC_CHAT_NAME kName = new body_SC_CHAT_NAME(); public body_SC_CHAT_MESSAGE kMessage = new body_SC_CHAT_MESSAGE(); */ //sEventNotifyMgr.Instance.CenterNotify.AddGMMessage("123456789"); // AsChatManager.Instance.InsertGMChat( "1234567890" ); } GUILayout.EndArea(); }