public PlayerBuffData( body2_SC_CHAR_BUFF _data ) { if( null == _data ) { AsUtil.ShutDown("PlayerBuffData::PlayerBuffData()[ null == body2_SC_CHAR_BUFF ]"); return; } m_ServerData = _data; InitData(); }
public new void PacketBytesToClass( byte[] data) { Type infotype = this.GetType(); FieldInfo headerinfo = null; int index = ParsePacketHeader( data); // nSessionIdx byte[] sessionIdx = new byte[ sizeof( UInt16)]; headerinfo = infotype.GetField( "nSessionIdx", BINDING_FLAGS_PIG); Buffer.BlockCopy( data, index, sessionIdx, 0, sizeof( UInt16)); headerinfo.SetValue( this, BitConverter.ToUInt16( sessionIdx, 0)); index += sizeof( UInt16); // nCharUniqKey byte[] charUniqKey = new byte[ sizeof( UInt32)]; headerinfo = infotype.GetField( "nCharUniqKey", BINDING_FLAGS_PIG); Buffer.BlockCopy( data, index, charUniqKey, 0, sizeof( UInt32)); headerinfo.SetValue( this, BitConverter.ToUInt32( charUniqKey, 0)); index += sizeof( UInt32); // 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_CHAR_BUFF[nBuffCnt]; for( int i = 0; i < nBuffCnt; i++) { body[i] = new body2_SC_CHAR_BUFF(); byte[] tmpData = new byte[body2_SC_CHAR_BUFF.size]; Buffer.BlockCopy( data, index, tmpData, 0, tmpData.Length); body[i].ByteArrayToClass( tmpData); index += body2_SC_CHAR_BUFF.size; } }
public void AddBuff(body2_SC_CHAR_BUFF _buff) { #region - init dictionary - if(m_dicBuff.ContainsKey(_buff.nSkillTableIdx) == false) m_dicBuff.Add(_buff.nSkillTableIdx, new Dictionary<int, BuffElement>()); if(m_dicBuff[_buff.nSkillTableIdx].ContainsKey(_buff.nPotencyIdx) == true) { m_dicBuff[_buff.nSkillTableIdx][_buff.nPotencyIdx].Release(); m_dicBuff[_buff.nSkillTableIdx].Remove(_buff.nPotencyIdx); } #endregion BuffElement buff = new BuffElement(_buff, this, false); m_dicBuff[_buff.nSkillTableIdx].Add(_buff.nPotencyIdx, buff); m_mdicBuff.Add(_buff.eType, buff); if(m_ModelLoaded == true) buff.Generate(); ResurrectionPenaltyProc( buff); }
public BuffElement(body2_SC_CHAR_BUFF _body, BuffProcessor _owner, bool _effect) { m_CurId = s_Index++; m_Owner = _owner.Owner; m_Processor = _owner; m_BuffType = _body.eType; m_Activated = _effect; int effectIdx = int.MaxValue; if(BuffBaseMgr.s_MonsterSkillIndexRange_Min <= _body.nSkillTableIdx && _body.nSkillTableIdx <= BuffBaseMgr.s_MonsterSkillIndexRange_Max) { #region - set skill name - Tbl_MonsterSkill_Record skillRecord = AsTableManager.Instance.GetTbl_MonsterSkill_Record(_body.nSkillTableIdx); SetSkillData(skillRecord); #endregion // Tbl_MonsterSkillLevel_Record skill = AsTableManager.Instance.GetTbl_MonsterSkillLevel_Record(_body.nSkillLevel, _body.nSkillTableIdx); Tbl_MonsterSkillLevel_Record skill = AsTableManager.Instance.GetTbl_MonsterSkillLevel_Record(_body.nSkillLevelTableIdx); effectIdx = skill.listSkillLevelPotency[_body.nPotencyIdx].Potency_EffectIndex; m_SkillLevelPotency = skill.listSkillLevelPotency[_body.nPotencyIdx]; } else { #region - set skill name - Tbl_Skill_Record skillRecord = AsTableManager.Instance.GetTbl_Skill_Record(_body.nSkillTableIdx); SetSkillData(skillRecord); #endregion Tbl_SkillLevel_Record skill = null; if(_body.nChargeStep == int.MaxValue) { skill = AsTableManager.Instance.GetTbl_SkillLevel_Record(_body.nSkillLevel, _body.nSkillTableIdx); } else { skill = AsTableManager.Instance.GetTbl_SkillLevel_Record(_body.nSkillLevel, _body.nSkillTableIdx, _body.nChargeStep); } // Tbl_SkillLevel_Record skill = AsTableManager.Instance.GetTbl_SkillLevel_Record(_body.nSkillLevel, _body.nSkillTableIdx); effectIdx = skill.listSkillLevelPotency[_body.nPotencyIdx].Potency_EffectIndex; m_SkillLevelPotency = skill.listSkillLevelPotency[_body.nPotencyIdx]; } m_SkillIdx = _body.nSkillTableIdx; m_PotencyIdx = _body.nPotencyIdx; m_Record = AsTableManager.Instance.GetTbl_SkillPotencyEffect_Record(effectIdx); }
public void SetBuff(body2_SC_CHAR_BUFF _body) { m_Buff.AddBuff(_body); }
public Msg_CharBuff_Body(Msg_CharBuff _parent, body2_SC_CHAR_BUFF _buff) { parent_ = _parent; charUniqKey_ = _buff.nCharUniqKey; skillTableIdx_ = _buff.nSkillTableIdx; skillLevelTableIdx_ = _buff.nSkillLevelTableIdx; skillLevel_ = _buff.nSkillLevel; chargeStep_ = _buff.nChargeStep; potencyIdx_ = _buff.nPotencyIdx; type_ = _buff.eType; duration_ = _buff.nDuration; serverData = _buff; }