public NpcBuffData( body2_SC_NPC_BUFF _data, float nDuration ) { if( null == _data ) { AsUtil.ShutDown("PlayerBuffData::NpcBuffData()[ null == body2_SC_NPC_BUFF ]"); return; } m_ServerData = _data; InitData( nDuration ); }
public CNpcBuffTempData( body2_SC_NPC_BUFF data) { m_npcBuffData = data; if ( 0 < m_npcBuffData.nDuration) { m_fRemainCoolTime = ( ( float)m_npcBuffData.nDuration)*0.001f; } }
void OnBuff( AsIMessage _msg) { Msg_CharBuff buff = _msg as Msg_CharBuff; foreach( Msg_CharBuff_Body body in buff.listBuff_) { m_ElementProcessor.SetBuff( buff, body); if( 0 < body.duration_ && false == IsSameBuff( body.skillTableIdx_, body.potencyIdx_)) { body2_SC_NPC_BUFF data = new body2_SC_NPC_BUFF(); data.bUpdate = body.serverData.bUpdate; data.nSkillTableIdx = body.serverData.nSkillTableIdx; data.nSkillLevel = body.serverData.nSkillLevel; data.nChargeStep = body.serverData.nChargeStep; data.nPotencyIdx = body.serverData.nPotencyIdx; data.eType = body.serverData.eType; data.nDuration = body.serverData.nDuration; m_BuffTempDataList.Add( new CNpcBuffTempData( data)); m_isNeedBuffReset = true; } // m_Entity.SetProperty( eComponentProperty.CONDITION, // AsEnumConverter.GetConditionFromBuffType( body.type_)); } }
public new void PacketBytesToClass( byte[] data) { Type infotype = this.GetType(); FieldInfo headerinfo = null; int index = ParsePacketHeader( data); // nNpcIdx byte[] npcIdx = new byte[ sizeof( Int32)]; headerinfo = infotype.GetField( "nNpcIdx", BINDING_FLAGS_PIG); Buffer.BlockCopy( data, index, npcIdx, 0, sizeof( Int32)); headerinfo.SetValue( this, BitConverter.ToInt32( npcIdx, 0)); index += sizeof( Int32); // bEffect byte[] effect = new byte[ sizeof( bool)]; headerinfo = infotype.GetField( "bEffect", BINDING_FLAGS_PIG); Buffer.BlockCopy( data, index, effect, 0, sizeof( bool)); headerinfo.SetValue( this, BitConverter.ToBoolean( effect, 0)); index += sizeof( bool); // nBuffCnt byte[] buffCnt = new byte[ sizeof( Int32)]; headerinfo = infotype.GetField( "nBuffCnt", BINDING_FLAGS_PIG); Buffer.BlockCopy( data, index, buffCnt, 0, sizeof( Int32)); headerinfo.SetValue( this, BitConverter.ToInt32( buffCnt, 0)); index += sizeof( Int32); body = new body2_SC_NPC_BUFF[nBuffCnt]; for( int i = 0; i < nBuffCnt; i++) { body[i] = new body2_SC_NPC_BUFF(); byte[] tmpData = new byte[body2_SC_NPC_BUFF.size]; Buffer.BlockCopy( data, index, tmpData, 0, tmpData.Length); body[i].ByteArrayToClass( tmpData); index += body2_SC_NPC_BUFF.size; } }
protected void InsertBuffData( body2_SC_NPC_BUFF buff, float _fRemainTime ) { if( 0 == buff.nDuration ) return; if( true == IsMonsterSkillIndex( buff.nSkillTableIdx ) ) { if( false == IsCheckHaveMobSkillIcon( buff.nSkillTableIdx, buff.nPotencyIdx ) ) return; } else { if( false == IsCheckHaveIcon( buff.nSkillTableIdx, buff.nPotencyIdx ) ) return; } /*if( IsSameBuffData( buff.nSkillTableIdx, buff.nPotencyIdx ) ) { return; }*/ m_BuffDataList.Add(new NpcBuffData(buff, _fRemainTime)); }