مشاهدة النسخة كاملة : حل مشكلة perfection x2
Tarek Roshdi
2020-03-13, 04:40 AM
بسم الله الرحمن الرحيم
طبعا معروف عن البريفكشن الاكس تو بتاعة مبيطلعش الا لم تكون اعلي بريفكشن من الاكونت ال بتضرب فية
انا عندي مشكلة ان الاكس تو بيطلع من اي اكونت ف اي اكونت ودة طبعا مش مظبوط ف ارجوا حد يفيدني فالحوار دة
انا حاولت اعدل فية وتمام ظبطتة ان الاكس تو ميطلعش الا لو انت اعلي بريفكشن بس جت ع دماغي وحصل مشكلتين الاولي مكنش ينفع اضرب ف الوحوش التانية ان لو اكونت البريفكشن بتاعة صفر مستحيل اموتة ممكن اطلع فية ضربة بنص مليون ومينقصش من صحتة حاجة
وشكرا مقدما للمنتدي
magdy
2020-03-13, 05:13 AM
متابع
Users
2020-03-13, 02:21 PM
حاضر
Tarek Roshdi
2020-03-13, 11:25 PM
حاضر
يحضرلك الخير ياغاااالي
بس عاوزين حل بعد حاااضر دي
وريني الكود الاسلسي و الكود بعد التعديل
Tarek Roshdi
2020-03-16, 12:30 AM
#region Perfection X2
byte Tiempo = 0;
new MsgRefineEffect().HandleLuckyStrike(attacker, ref Tiempo);
if (Kernel.Rate(Tiempo))
{
Network.Writer.WriteUInt16((ushort)(1 << 10), 36, attack.ToArray());
new MsgRefineEffect().SendEffect(attacker, attacked, Game.Enums.PerfectionEffect.LuckyStrike);
damage = damage * 2;
}
اضفتلة
#region Perfection X2
if ((attacker.Perfection != null)(attacked.Perfection != null))
{
if ((attacker.Perfection.Id) > (attacked.Perfection.Id))
{
byte Tiempo = 0;
new MsgRefineEffect().HandleLuckyStrike(attacker, ref Tiempo);
if (Kernel.Rate(Tiempo))
{
Network.Writer.WriteUInt16((ushort)(1 << 10), 36, attack.ToArray());
new MsgRefineEffect().SendEffect(attacker, attacked, Game.Enums.PerfectionEffect.LuckyStrike);
damage = damage * 2;
}
}
}
#endregion
Tarek Roshdi
2020-03-16, 11:04 PM
???
جرب تخليه بالشكل ده
#region Perfection X2
if ((attacker.Perfection >0)
{
if ((attacker.TotalPerfectionScore) > (attacked.TotalPerfectionScore))
{
byte Tiempo = 0;
new MsgRefineEffect().HandleLuckyStrike(attacker, ref Tiempo);
if (Kernel.Rate(Tiempo))
{
Network.Writer.WriteUInt16((ushort)(1 << 10), 36, attack.ToArray());
new MsgRefineEffect().SendEffect(attacker, attacked, Game.Enums.PerfectionEffect.LuckyStrike);
damage = damage * 2;
}
}
}
#endregion
دي لو جت ايرور TotalPerfectionScore اكتب TotalPerfectionPoints علي حسب سورس بتاعك
Tarek Roshdi
2020-03-17, 02:01 AM
جرب تخليه بالشكل ده
#region Perfection X2
if ((attacker.Perfection >0)
{
if ((attacker.TotalPerfectionScore) > (attacked.TotalPerfectionScore))
{
byte Tiempo = 0;
new MsgRefineEffect().HandleLuckyStrike(attacker, ref Tiempo);
if (Kernel.Rate(Tiempo))
{
Network.Writer.WriteUInt16((ushort)(1 << 10), 36, attack.ToArray());
new MsgRefineEffect().SendEffect(attacker, attacked, Game.Enums.PerfectionEffect.LuckyStrike);
damage = damage * 2;
}
}
}
#endregion
دي لو جت ايرور TotalPerfectionScore اكتب TotalPerfectionPoints علي حسب سورس بتاعك
انا شغال ع سورس رايزو
TotalPerfectionPoints
TotalPerfectionScore
الاتنين فيهم ايرور
وللتوضيح اكتر التعديل دة عندي ف كلاس Handle
كود من سورس رايزو
if(attacker.TotalPerfectionScore>attacked.TotalPerfectionScore)
Tarek Roshdi
2020-03-17, 02:41 AM
كل حاجة عندي فيها بريفكشن هوضحها لحضرتك واسف لو هشغلك معايا كتير لأني مش عارف اوصل لحل
Handle.cs
#region Perfection
if (attacker.PlayerFlag == PlayerFlag.Player)
{
uint rand = (uint)Rayzo.Kernel.Random.Next(1, 2);
switch (rand)
{
case 1:
{
#region Perfection
Game.Enums.PerfectionEffect effect = Enums.PerfectionEffect.CalmWind;
byte chance = 1;
new MsgRefineEffect().GenerateEffectandChance(attacker .Owner, ref effect, ref chance);
if (Kernel.Rate(chance))
{
new MsgRefineEffect().SendEffect(attacker, attacked, effect);
}
#endregion
break;
}
case 2:
{
#region Perfection
byte chance = 0;
new MsgRefineEffect().HandleLuckyStrike(attacker, ref chance);
if (Kernel.Rate(chance))
{
Network.Writer.WriteUInt16((ushort)(1 << 10), 36, attack.ToArray());
new MsgRefineEffect().SendEffect(attacker, attacked, Game.Enums.PerfectionEffect.LuckyStrike);
damage *= 3 / 2;
}
#endregion
break;
}
}
}
#endregion
#region Perfection
if (attacked.PlayerFlag == PlayerFlag.Player)
{
uint rand = (uint)Rayzo.Kernel.Random.Next(1, 2);
switch (rand)
{
case 1:
{
// if (attacked.PlayerFlag == PlayerFlag.Player)
{
#region Perfection
byte chance = 1;
new MsgRefineEffect().HandleStrickeLock(attacker, ref chance);
if (Kernel.Rate(chance))
{
Game.Enums.PerfectionEffect effect = Enums.PerfectionEffect.Stricklock;
new MsgRefineEffect().SendEffect(attacked, attacker, effect);
return;
}
#endregion
}
break;
}
case 2:
{
// if (attacked.PlayerFlag == PlayerFlag.Player)
{
#region Perfection
Game.Enums.PerfectionEffect effect = Enums.PerfectionEffect.MirrorofSin;
byte chance = 0;
new MsgRefineEffect().HandleMirror(attacked, ref chance);
if (Kernel.Rate(chance))
{
new MsgRefineEffect().SendEffect(attacked, attacker, effect);
if (!attacker.ContainsFlag4(Rayzo.Network.GamePackets .MsgUpdate.Flags4.Omnipotence) || !attacker.ContainsFlag3((ulong)Rayzo.Network.GameP ackets.MsgUpdate.Flags3.BladeFlurry)) return;
{
attacked.AddFlag((ulong)Network.GamePackets.MsgUpd ate.Flags.XPList);
attacker.Owner.XPListStamp = Time32.Now;
}
}
#endregion
}
break;
}
}
}
#endregion
#region Perfection X2
byte Tiempo = 0;
new MsgRefineEffect().HandleLuckyStrike(attacker, ref Tiempo);
if (Kernel.Rate(Tiempo))
{
Network.Writer.WriteUInt16((ushort)(1 << 10), 36, attack.ToArray());
new MsgRefineEffect().SendEffect(attacker, attacked, Game.Enums.PerfectionEffect.LuckyStrike);
damage = damage * 2;
}
#endregion
Gamestate.cs
#region Perfiction
if (Player.Perfection != null)
{
if (this.Equipment.TotalPerfectionLevel >= Player.Perfection.Id)
{
Player.BaseMinAttack += Player.Perfection.PhysicalAttack;
Player.BaseMaxAttack += Player.Perfection.PhysicalAttack;
Player.Defence += Player.Perfection.PhysicalDefense;
Player.BaseMagicAttack += Player.Perfection.MagicAttack;
Player.MagicDefence += Player.Perfection.MagicDefense;
}
}
MsgRefineEffect.cs
public byte GetChance(Client.GameState client, Game.Enums.PerfectionEffect effect)
{
if (client.Equipment.TotalPerfectionLevel == 0) return 0;
byte Chance = 10;
if (effect == Game.Enums.PerfectionEffect.CalmWind)
{
if (client.Equipment.TotalPerfectionLevel == 3) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 90) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 170) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 250) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 285) Chance += 1;
}
if (effect == Game.Enums.PerfectionEffect.BloodSpawn)
{
if (client.Equipment.TotalPerfectionLevel >= 40) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 240) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 288) Chance += 1;
}
if (effect == Game.Enums.PerfectionEffect.DivineGuard)
{
if (client.Equipment.TotalPerfectionLevel <= 40) Chance += 5;
}
if (effect == Game.Enums.PerfectionEffect.CoreStrike)
{
if (client.Equipment.TotalPerfectionLevel == 50) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 80) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 135) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 205) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 245) Chance += 1;
}
if (effect == Game.Enums.PerfectionEffect.DrainingTouch)
{
if (client.Equipment.TotalPerfectionLevel >= 35) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 220) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 276) Chance += 1;
}
if (effect == Game.Enums.PerfectionEffect.FreeSoul)
{
if (client.Equipment.TotalPerfectionLevel >= 25) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 95) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 130) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 195) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 279) Chance += 1;
}
if (effect == Game.Enums.PerfectionEffect.InvisibleArrow)
{
if (client.Equipment.TotalPerfectionLevel >= 65) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 225) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 282) Chance += 1;
}
if (effect == Game.Enums.PerfectionEffect.KillingFlash)
{
if (client.Equipment.TotalPerfectionLevel >= 55) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 165) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 294) Chance += 1;
}
if (effect == Game.Enums.PerfectionEffect.LightofStamina)
{
if (client.Equipment.TotalPerfectionLevel >= 1) Chance += 5;
}
if (effect == Game.Enums.PerfectionEffect.LuckyStrike)
{
if (client.Equipment.TotalPerfectionLevel >= 15) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 115) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 215) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 314) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 320) Chance += 1;
}
if (effect == Game.Enums.PerfectionEffect.MirrorofSin)
{
if (client.Equipment.TotalPerfectionLevel >= 60) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 190) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 291) Chance += 1;
}
if (effect == Game.Enums.PerfectionEffect.ShieldBreak)
{
if (client.Equipment.TotalPerfectionLevel == 155 && client.Equipment.TotalPerfectionLevel <= 254) Chance += 50 / 100;
if (client.Equipment.TotalPerfectionLevel == 255 && client.Equipment.TotalPerfectionLevel <= 296) Chance += 70 / 100;
if (client.Equipment.TotalPerfectionLevel == 297 && client.Equipment.TotalPerfectionLevel <= 311) Chance += 1;
if (client.Equipment.TotalPerfectionLevel == 312 && client.Equipment.TotalPerfectionLevel <= 321) Chance += 150 / 100;
if (client.Equipment.TotalPerfectionLevel == 322 && client.Equipment.TotalPerfectionLevel >= 322) Chance += 2;
}
if (effect == Game.Enums.PerfectionEffect.StraightLife)
{
if (client.Equipment.TotalPerfectionLevel >= 30) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 125) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 210) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 265) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 303) Chance += 1;
}
if (effect == Game.Enums.PerfectionEffect.Stricklock)
{
if (client.Equipment.TotalPerfectionLevel >= 30) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 125) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 210) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 265) Chance += 1;
if (client.Equipment.TotalPerfectionLevel >= 303) Chance += 1;
}
return Chance;
}
public void SendEffect(Game.Player attacker, Game.Player attacked, Game.Enums.PerfectionEffect effect)
{
if (attacker == null || attacked == null) return;
var proto = new MsgRefineEffectProto();
proto.AttackerUID = attacker.UID;
if (attacked.PlayerFlag == Game.PlayerFlag.Player)
proto.AttackedUID = attacked.UID;
else if (attacked.PlayerFlag == Game.PlayerFlag.Monster && attacked != null && attacked.UID != 0)
{
proto.AttackedUID = attacked.UID;
}
proto.Effect = (uint)effect;
var proto2 = Kernel.FinalizeProtoBuf(proto, 3254);
attacker.Owner.SendScreen(proto2, true);
if (effect == Game.Enums.PerfectionEffect.DrainingTouch)
{
attacker.Hitpoints = attacker.MaxHitpoints;
}
if (effect == Game.Enums.PerfectionEffect.KillingFlash)
{
if (!attacker.ContainsFlag4(Rayzo.Network.GamePackets .MsgUpdate.Flags4.Omnipotence) || !attacker.ContainsFlag3((ulong)Rayzo.Network.GameP ackets.MsgUpdate.Flags3.BladeFlurry)) return;
{
attacker.AddFlag((ulong)Network.GamePackets.MsgUpd ate.Flags.XPList);
attacker.Owner.XPListStamp = Time32.Now;
}
}
if (effect == Game.Enums.PerfectionEffect.DivineGuard)
{
attacker.AddFlag3((ulong)Network.GamePackets.MsgUp date.Flags3.DivineGuard);
attacker.Defence = (ushort)(((attacker.Defence) * 20) / 100);
attacker.DivineGuardStamp = Time32.Now;
}
if (effect == Game.Enums.PerfectionEffect.ShieldBreak)
{
attacker.AddFlag3((ulong)Network.GamePackets.MsgUp date.Flags3.ShieldBreak);
attacker.ShieldBreakStamp = Time32.Now;
attacker.Block += (ushort)(((attacker.Block) * 2) / 10);
}
if (effect == Game.Enums.PerfectionEffect.StraightLife)
{
attacker.BringToLife();
}
if (effect == Game.Enums.PerfectionEffect.LightofStamina && attacked.PlayerFlag == Game.PlayerFlag.Player && attacker.Owner.Equipment.TotalPerfectionLevel > attacked.Owner.Equipment.TotalPerfectionLevel || effect == Game.Enums.PerfectionEffect.LightofStamina && attacked.PlayerFlag == Game.PlayerFlag.Monster) attacker.Stamina = 100;
}
public void GenerateEffectandChance(Client.GameState client, ref Game.Enums.PerfectionEffect effect, ref byte chance)
{
effect = (Game.Enums.PerfectionEffect)Kernel.Random.Next(3, 14);
chance = GetChance(client, effect);
while (chance == 10)
{
effect = (Game.Enums.PerfectionEffect)Kernel.Random.Next(3, 14);
chance = GetChance(client, effect);
}
}
public void HandleStrickeLock(Game.Player client, ref byte chance)
{
chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.Stricklock);
}
public void HandleFreeSoul(Game.Player client, ref byte chance)
{
chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.FreeSoul);
}
public void HandleStraightLife(Game.Player client, ref byte chance)
{
chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.StraightLife);
}
public void HandleBloodSpawn(Game.Player client, ref byte chance)
{
chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.BloodSpawn);
}
public void HandleMirror(Game.Player client, ref byte chance)
{
chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.MirrorofSin);
}
public void HandleLuckyStrike(Game.Player client, ref byte chance)
{
chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.LuckyStrike);
}
Equipments.cs
public ushort TotalPerfectionLevel
{
get
{
ushort Count = 0;
foreach (Network.GamePackets.MsgItemInfo item in Objects)
{
if (item == null) continue;
if (item.Position > 19 || item.Position == 7 || item.Position == 9 || item.Position == 15 || item.Position == 16 || item.Position == 17) continue;
Count += (ushort)(ItemHandler.IsTwoHand(item.ID) ? item.PerfectionLevel * 2 : item.PerfectionLevel);
}
return Count;
}
}
للاسف مفيش اي كود من الي فوق دول عندي ف سورس ريزو بروتو بس هل لما بدلت كود الي عندك بالكود الي لسه انا كتبهولك فوق لما قولت عندك ايرور هل ظهر اي ايرور جديد
Tarek Roshdi
2020-03-17, 07:02 AM
ايوا بيظهر ايرور
بص ياغالي
كل الموضوع الكور الاول كان اية ان الاكس تو بيطلع حظ مش مربزط ب حوار ان الاعلي بريفكشن هو ال يطلع اكس تو ف قومت انا عدلت علي الكود الاصلي دة
#region Perfection X2
byte Tiempo = 0;
new MsgRefineEffect().HandleLuckyStrike(attacker, ref Tiempo);
if (Kernel.Rate(Tiempo))
{
Network.Writer.WriteUInt16((ushort)(1 << 10), 36, attack.ToArray());
new MsgRefineEffect().SendEffect(attacker, attacked, Game.Enums.PerfectionEffect.LuckyStrike);
damage = damage * 2;
}
ف اصبح بالشكل دة
#region Perfection X2
if ((attacker.Perfection != null)(attacked.Perfection != null))
{
if ((attacker.Perfection.Id) > (attacked.Perfection.Id))
{
byte Tiempo = 0;
new MsgRefineEffect().HandleLuckyStrike(attacker, ref Tiempo);
if (Kernel.Rate(Tiempo))
{
Network.Writer.WriteUInt16((ushort)(1 << 10), 36, attack.ToArray());
new MsgRefineEffect().SendEffect(attacker, attacked, Game.Enums.PerfectionEffect.LuckyStrike);
damage = damage * 2;
}
}
}
#endregion
بعد التعديل دة الاكونت الاعلي بريفكشن بس هو ال يطلع اكس تو ودي تمام
لاقيت ظهر مشكلتين ان لو الاكونت زيرو بريفكشن الضربة هتطلع فية برقم عالي بس صحتة مش هتنقص ومش هيموت و تاني حاجة مبيضربش فالوحوش
عارف اني طولت عليك
وللعلم السورس دة انا شارية بس للاسف المشاكل كلها غرقان فيها لوحدي
جرب تمسح اول سطر كده
if ((attacker.Perfection != null)(attacked.Perfection != null))
vBulletin® v3.8.8 Beta 1, Copyright ©2000-2024, TranZ by code