2 Problem popup only if a second char attack
3 Problem its update all chars dmg if one char attack
Does anyone know where the problem is?
Code:
#region UNIQUE_SELECT
else if (_pck.Opcode == 0xB070)
{
try
{
DataTable dame = Task.Run(async () => await sqlCon.GetList($"SELECT * FROM SRO_VT_MAIN.._DPSMetterDame Where TargetID = {this.uinque078} ORDER BY DameCount DESC")).Result;
byte isSuccess = _pck.ReadUInt8();
if (isSuccess == 1) //
{
_pck.ReadUInt8();
_pck.ReadUInt8();
this.Skill_ID = _pck.ReadInt32();
this.uinque = _pck.ReadUInt32(); //char unique id
_pck.ReadUInt32();
this.uinque2 = _pck.ReadInt32(); //boss uniqueid
_pck.ReadUInt8();
byte atackType = _pck.ReadUInt8();
if (atackType == 2)
{
_pck.ReadUInt8();
_pck.ReadUInt32();
_pck.ReadUInt8();
_pck.ReadUInt32();
_pck.ReadUInt32();
_pck.ReadUInt8();
_pck.ReadUInt8();
this.dame1 = _pck.ReadUInt16();
}
Task.Run(async () => await sqlCon.exec($"EXEC [SRO_VT_MAIN].[dbo].[_UpdateDPS] '{this.sqlCharName}', {dame1},{this.uinque},'{this.uinque2}'"));
if (MainForm.UniqueSkills.Contains(Skill_ID))//check if in list unique_skill
{
Task.Run(async () => await sqlCon.exec($"EXEC [SRO_VT_MAIN].[dbo].[_UpdateDPS] '{this.sqlCharName}', {dame1},{this.uinque},'{this.uinque2}'"));
this.updateDPS();
this.UniqueSelectST = true;
this.UniqueSELECT2();
Send(true);
}
else
{
this.UniqueSelectST = false;
this.UniqueSELECT0();
Send(true);
}
}
}
catch { }
}
else if (_pck.Opcode == 0x3057)
{
_pck.ReadUInt32();
if (_pck.ReadUInt8() == 0x10)
{
this.updateDPS();
UniqueSELECT0();
Send(true);
}
//else if(!this.UniqueSelectST)
//{
// this.HideControl(5011, 5);
// this.CleanDPS();
//}
}
else if (_pck.Opcode == 0x3013)
{
this.updateDPS();
UniqueSELECT0();
Send(true);
}
else if (_pck.Opcode == 0xB071)
{
try
{
byte isSuccess = _pck.ReadUInt8();
if (isSuccess == 1)
{
uint uinque071 = _pck.ReadUInt32();
uint uinque073 = _pck.ReadUInt32();
//MainForm.WriteLine(2, "uinque073 ID [" + uinque073 + "]");
byte hasDmg = _pck.ReadUInt8();
if (hasDmg == 1)
{
byte hitcount = _pck.ReadUInt8();
byte targetCount = _pck.ReadUInt8();
for (uint i = 0; i < targetCount; i++)
{
uint uinque072 = _pck.ReadUInt32(); //boss id
//MainForm.WriteLine(2, "SKILL ID 071 [" + this.Skill_ID + "]");
for (uint ii = 0; ii < hitcount; ii++)
{
byte effects = _pck.ReadUInt8(); // bitmask --> ATTACK_STATE_KNOCKBACK = 0x01, ATTACK_STATE_BLOCK = 0x02, ATTACK_STATE_POSITION = 0x04, abort ? --> 0x08 ATTACK_STATE_DEAD = 0x80
byte dmgSource = _pck.ReadUInt8();// bitmask --> DAMAGE_STATE_NORMAL = 0x01, DAMAGE_STATE_CRIT = 0x02, DAMAGE_STATE_STATUS = 0x10
if ((effects & 0x0A) != 0x00) // if ATTACK_STATE_BLOCK or abort --> no more data
{
continue;
}
this.targetCoun7t = _pck.ReadUInt32();
if (uinque072 != this.uniqueID && this.uniqueID == this.uinque)
{
this.uinque078 = uinque072;
if (this.UniqueSelectST&& this.targetCoun7t<3000000)
{
Task.Run(async () => await sqlCon.exec($"EXEC [SRO_VT_MAIN].[dbo].[_UpdateDPS] '{sqlCon.clean(this.sqlCharName)}', {this.targetCoun7t},{uinque078},'{this.uniqueID}'"));
}
}
else
{
this.targetCoun7t = 0;
}
_pck.ReadUInt8();
_pck.ReadUInt8();
_pck.ReadUInt8();
}
}
}
else if (isSuccess == 2)
{
MainForm.WriteLine(2, "a3 [" + isSuccess + "]");
}
}
}
catch { }
}
#endregion
Code:
public void updateDPS()
{
DataTable dame = Task.Run(async () => await sqlCon.GetList($"SELECT * FROM SRO_VT_MAIN.._DPSMetterDame Where TargetID = {this.uinque078} ORDER BY DameCount DESC")).Result;
int i = 1;
foreach (DataRow dts in dame.Rows)
{
string Name = dts["CharName"].ToString();
string DameCount = dts["DameCount"].ToString();
string TargetID = dts["TargetID"].ToString();
int code;
int.TryParse(DameCount.ToString(), out code);
uint TargetIDS;
uint.TryParse(TargetID.ToString(), out TargetIDS);
if (i == 1)
{
if (TargetIDS == uinque078)
//MainForm.WriteLine(2, "a1 [" + i + "]");
this.ShowControl(5011, 1, Name, code, 1);
}
if (i == 2)
{
if (TargetIDS == uinque078)
//MainForm.WriteLine(2, "a2 [" + i + "]");
this.ShowControl(5011, 1, Name, code, 2);
}
if (i == 3)
{
if (TargetIDS == uinque078)
//MainForm.WriteLine(2, "a3 [" + i + "]");
this.ShowControl(5011, 1, Name, code, 3);
}
if (i == 4)
{
if (TargetIDS == uinque078)
//MainForm.WriteLine(2, "a3 [" + i + "]");
this.ShowControl(5011, 1, Name, code, 4);
}
if (i == 5)
{
if (TargetIDS == uinque078)
//MainForm.WriteLine(2, "a3 [" + i + "]");
this.ShowControl(5011, 1, Name, code, 5);
}
if (i == 6)
{
if (TargetIDS == uinque078)
//MainForm.WriteLine(2, "a3 [" + i + "]");
this.ShowControl(5011, 1, Name, code, 6);
}
if (i == 7)
{
if (TargetIDS == uinque078)
//MainForm.WriteLine(2, "a3 [" + i + "]");
this.ShowControl(5011, 1, Name, code, 7);
}
if (i == 8)
{
if (TargetIDS == uinque078)
//MainForm.WriteLine(2, "a3 [" + i + "]");
this.ShowControl(5011, 1, Name, code, 8);
}
if (i > 9)
break;
i++;
}
}








