المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : تــعــديـل ع حـل مشـكـلة الاسـكـلةة للاخ ابـو مـرووان


Commander
2019-08-23, 09:09 PM
بسم الله الرحمن الرحيم
الناس الي متعرفش الموضوع القديم اهو
عفواً لايمكن عرض الروابط في الإرشيف
هنعدل بس علي الاكواد بتاعت كلاس handle وباقي الموضوع تمام

ابحث عن
#region Monster -> Entity \ Monster
هتلاقي جواه
#region ThunderCloud
#region ThunderCloudSight
اقفلهم وبدلهم الاتنين بدول
#region ThunderCloud
if (attacker.Name == "Thundercloud")
{

if (Kernel.GamePool.ContainsKey(attacker.OwnerUID))
{

var owner = Kernel.GamePool[attacker.OwnerUID];
var spell = Database.SpellTable.GetSpell(12840, owner);
var spell2 = Database.SpellTable.GetSpell(12970, owner);
byte percent = 0;
if (spell2 != null)
{
if (spell2.Level == 0) percent = 130;
if (spell2.Level == 1) percent = 140;
if (spell2.Level == 2) percent = 150;
if (spell2.Level == 3) percent = 160;
if (spell2.Level == 4) percent = 170;
if (spell2.Level == 5) percent = 180;
if (spell2.Level == 6) percent = 200;
}
attack = new Attack(true);
attack.Attacker = attacker.UID;
attack.Attacked = attacked.UID;
attack.AttackType = Network.GamePackets.Attack.Kill;
attack.X = attacked.X;
attack.Y = attacked.Y;
attack.Damage = 1;
uint damage2 = (uint)(Calculate.Melee(owner.Player, attacked, ref attack) * spell.FirstDamage / 100);
if (attacker.SpawnPacket[50] == 128)//ThunderBolt
damage2 = (uint)(damage2 * percent / 100);
SpellUse suse2 = new SpellUse(true);
suse2.Attacker = attacker.UID;
suse2.Attacker1 = attacked.UID;
suse2.SpellID = 13190;
suse2.X = attacked.X;
suse2.Y = attacked.Y;
suse2.AddTarget(attacked, damage2, attack);
attacker.MonsterInfo.SendScreen(suse2);
if (attacked.Hitpoints <= damage2)
{
attacked.Die(attacker);
attack.ResponseDamage = damage2;
attacker.MonsterInfo.SendScreen(attack);
}
else
{
attacked.Hitpoints -= damage2;
}
return;
}
else
return;
}
#endregion
#region ThunderCloudSight
if (attacker != null && Kernel.Maps[attacker.MapID] != null)
{
foreach (var th in Kernel.Maps[attacker.MapID].Entities.Values.Where(i => i.Name == "Thundercloud"))
{
if (th.OwnerUID == attacked.UID)
{
if (attacker == null || Kernel.GetDistance(attacker.X, attacker.Y, th.X, th.Y) > th.MonsterInfo.AttackRange || attacker.Dead) break;
th.MonsterInfo.InSight = attacker.UID;
break;
}
}
}
#endregion
بعد كدا روح علي الاسكله الي انا نزلتها و بدلها بده
#region ThunderCloud(Passive)
case 12840:
{
if (CanUseSpell(spell, attacker.Owner))
{
PrepareSpell(spell, attacker.Owner);
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.X = X;
suse.Y = Y;
suse.SpellID = spell.ID;
attacker.Owner.SendScreen(suse, true);
//////////////////////////////////////////////////
///////////////////////////////////////////////////
uint UID = Kernel.Maps[attacker.MapID].EntityUIDCounter.Next;
uint Mesh = 980;
//////////////////////////////////////////////////////
MsgPetInfo pet = new MsgPetInfo();
pet.UID = UID;
pet.PetID = 4264;
pet.PetType = 3;
pet.Mesh = Mesh;
pet.AttackRange = 14;
pet.X = X;
pet.Y = Y;
pet.Name = "Thundercloud";
//////////////////////////////////////////////////
///////////////////////////////////////////////////
//////////////////////////////////////////////////////
Entity ThunderCloud = new Entity(Game.EntityFlag.Monster, true);
ThunderCloud.Name = "Thundercloud";
ThunderCloud.Mesh = Mesh;
ThunderCloud.UID = UID;
ThunderCloud.GuildID = attacker.GuildID;
ThunderCloud.MaxHitpoints = attacker.MaxHitpoints;
ThunderCloud.Level = 140;
ThunderCloud.X = X;
ThunderCloud.Y = Y;
ThunderCloud.Facing = attacker.Facing;
ThunderCloud.Boss = 1;
ThunderCloud.MapID = attacker.MapID;
Writer.Write(3, 308, ThunderCloud.SpawnPacket);
Writer.Write(15, 272, ThunderCloud.SpawnPacket);
Writer.Write(3, 271, ThunderCloud.SpawnPacket);//AttackUser
Writer.Write(attacker.Owner.UnionID, 278, ThunderCloud.SpawnPacket);//UnionID
ThunderCloud.OwnerUID = attacker.UID;
ThunderCloud.Owner = new Client.GameState(null);
ThunderCloud.Owner.Player = ThunderCloud;
ThunderCloud.MonsterInfo = new MonsterInformation();
ThunderCloud.MonsterInfo.AttackType = 24;
ThunderCloud.MonsterInfo.AttackSpeed = 1000;
ThunderCloud.MonsterInfo.AttackRange = 14;
ThunderCloud.MonsterInfo.Boss = true;
ThunderCloud.MonsterInfo.BoundX = X;
ThunderCloud.Companion = true;
ThunderCloud.MonsterInfo.Guard = false;
ThunderCloud.MonsterInfo.BoundY = Y;
ThunderCloud.MonsterInfo.Defence = attacker.Defence;
ThunderCloud.MonsterInfo.Hitpoints = 10000;
ThunderCloud.MonsterInfo.Mesh = 980;
ThunderCloud.MonsterInfo.MoveSpeed = int.MaxValue;
ThunderCloud.MonsterInfo.Name = "Thundercloud";
ThunderCloud.MonsterInfo.Owner = attacker;
ThunderCloud.MonsterInfo.ViewRange = 14;
ThunderCloud.MonsterInfo.RespawnTime = 0;
ThunderCloud.MonsterInfo.RunSpeed = int.MaxValue;
ThunderCloud.MonsterInfo.SpellID = 13190;
ThunderCloud.Hitpoints = 10000;
Kernel.Maps[ThunderCloud.MapID].AddEntity(ThunderCloud);
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
/////////////////////////////////////////////
Network.GamePackets.Data d = new Data(true);
d.UID = UID;
d.ID = Data.AddEntity;
d.Facing = attacker.Facing;
d.X2 = ThunderCloud.X;
d.Y2 = ThunderCloud.Y;
///////////////////////////////////////////////
////////////////////////////////////////////
/////////////////////////////////////////
attacker.Owner.SendScreen(pet.ToArray(), true);
attacker.Owner.SendScreen(ThunderCloud.SpawnPacket , true);
attacker.Owner.SendScreenSpawn(ThunderCloud, true);
attacker.Owner.SendScreen(d, true);
ThunderCloud.ThunderCloudStamp = Time32.Now;
Program.World.Register(ThunderCloud);
attacker.AttackPacket = null;
}
break;

}
#endregion
بعد كدا روح فويد
void ReceiveAttack(Game.Entity attacker, Game.Entity attacked, Attack attack, ref uint damage, Database.SpellInformation spell)
هتلاقي
region thundercloud
بدلو بده
#region ThunderCloud
if (attacked.Name == "Thundercloud")
{
if (spell != null && spell.ID != 0) damage = 0;
else damage = 1;
}
foreach (var th in Kernel.Maps[attacker.MapID].Entities.Values.Where(i => i.Name == "Thundercloud"))
{
if (th.OwnerUID == attacked.UID)
{
if (attacker == null || Kernel.GetDistance(attacker.X, attacker.Y, th.X, th.Y) > th.MonsterInfo.AttackRange || attacker.Dead) break;
th.MonsterInfo.InSight = attacker.UID;
break;
}
}
#endregion
بعد كدا تروح البول ده
static bool CanAttack(Game.Entity attacker, Game.Entity attacked, Database.SpellInformation spell, bool melee)
هتلاقي region thundercloud بدله بده
#region ThunderCloud
if (attacked.Name == "Thundercloud")
{
if (attacked.OwnerUID == attacker.UID) return false;
if (!Constants.PKForbiddenMaps.Contains(attacker.MapI D))
{
if (attacker.PKMode != Fighter.Game.Enums.PKMode.PK &&
attacker.PKMode != Fighter.Game.Enums.PKMode.Team)
return false;
else if (Constants.PKFreeMaps.Contains(attacker.MapID))
{
return true;
}
else
{
attacker.FlashingNameStamp = Time32.Now;
attacker.FlashingNameTime = 20;
attacker.AddFlag(Network.GamePackets.Update.Flags. FlashingName);
return true;
}
}
else if (Constants.PKForbiddenMaps.Contains(attacker.Owner .Map.ID))
{
if (attacker.PKMode == Fighter.Game.Enums.PKMode.PK ||
attacker.PKMode == Fighter.Game.Enums.PKMode.Team || (spell != null && spell.CanKill))
{
attacker.Owner.Send(Constants.PKForbidden);
attacker.AttackPacket = null;
}
return false;
}
}
#endregion
بعد كدا ابحث عن
if (attacker.MonsterInfo.SpellID == 0)[/CENTER
[CENTER]انزل لحد
uint damage = Calculate.MonsterDamage(attacker, attacked, attacker.MonsterInfo.SpellID);
ضيف فوقيه ده
#region ThunderCloud
if (attacker.Name == "Thundercloud")
{
if (Kernel.GamePool.ContainsKey(attacker.OwnerUID))
{
var owner = Kernel.GamePool[attacker.OwnerUID];
var spell = Database.SpellTable.GetSpell(12840, owner);
var spell2 = Database.SpellTable.GetSpell(12970, owner);
attack = new Attack(true);
attack.Attacker = attacker.UID;
attack.Attacked = attacked.UID;
attack.AttackType = Network.GamePackets.Attack.Magic;
uint damage2 = (uint)(Calculate.Melee(owner.Player, attacked, spell2, ref attack) * (spell.Level < 8 ? spell.FirstDamage : 50) / 100);
if (attacker.ContainsFlag4(Network.GamePackets.Update .Flags4.ThunderBolt))
damage2 = (uint)(damage2 * spell2.FirstDamage);
SpellUse suse2 = new SpellUse(true);
suse2.Attacker = attacker.UID;
suse2.Attacker1 = attacked.UID;
suse2.SpellID = 13190;
suse2.X = attacked.X;
suse2.Y = attacked.Y;
suse2.AddTarget(attacked, damage2, attack);
attacker.MonsterInfo.SendScreen(suse2);
if (attacked.Hitpoints <= damage2)
{
attacked.Die(attacker);
attack = new Attack(true);
attack.Attacker = attacker.UID;
attack.Attacked = attacked.UID;
attack.AttackType = Network.GamePackets.Attack.Kill;
attack.X = attacked.X;
attack.Y = attacked.Y;
attack.Damage = 1;
attack.ResponseDamage = damage2;
attacker.MonsterInfo.SendScreen(attack);
}
else
{
attacked.Hitpoints -= damage2;
}
return;
}
else
return;
}
#endregion

ابو مروان
2019-08-23, 09:14 PM
جميل جميل جميل والله ما حد غيرك كان يمكن يعمل الموضوع دا عشان خاطر ان هو مطول كدا تقييم 100 نجمه وجارى التجربه ولو فيه جديد هقلك xd

ابو مروان
2019-08-23, 09:19 PM
ايرور فى كود
if (attacker.ContainsFlag4(Network.GamePackets.Update .Flags4.ThunderBolt))
بالتحديد
ThunderBolt

ابو مروان
2019-08-23, 09:26 PM
فيه مشكله بسيطه خالص اللسكله بعد ما بتخلص الوقت بتاعها بتختفى عادى بس برده بتفضل تضرب والضربه بتظهر عند الشخصيه الى بتضرب وعند الشخصيه الى ضاربه اللسكله مبتظهرش
صورة للتوضيح دا مكان الى انا ضرب فيه اللسكله
عفواً لايمكن عرض الروابط في الإرشيف
وهنا لم بعدت عن المكان الضرب اختفا
عفواً لايمكن عرض الروابط في الإرشيف
وهنا عند الشخصيه الى ضرب اللسكله الضرب فى الشخصيه التانيه مش ظاهر ان هى بتضرب
عفواً لايمكن عرض الروابط في الإرشيف

Commander
2019-08-23, 09:44 PM
روح كلاس flags4 وضيف ده
ThunderBolt = 1UL << 199,

Commander
2019-08-23, 09:44 PM
وباالنسبه ان الاسكلة مش شغاله راجع اضافتك ياما تبعتلي رساله باي دي الاني دسك وهخش احلهالك

MohamedModyAdel
2019-08-23, 10:19 PM
عاش

ابو مروان
2019-08-23, 10:50 PM
وباالنسبه ان الاسكلة مش شغاله راجع اضافتك ياما تبعتلي رساله باي دي الاني دسك وهخش احلهالك

ابعتلى رابط الفيس بتاعك يا صحبي او ضيفني انت الى يريحك
عفواً لايمكن عرض الروابط في الإرشيف

AliNasser
2019-08-24, 11:54 AM
شكرا جدا

AliNasser
2019-08-24, 12:01 PM
تسلم علي المجهود

AhmedBayoumi
2019-08-25, 06:05 PM
goooooooooooooooooooooooooood

Avengers-Co
2019-09-11, 08:17 PM
تسلم

محمود محمدm
2019-10-22, 06:03 PM
عاااش

Hassan Emprator
2019-10-24, 11:24 PM
تسلم

Mostafa Shalby
2019-10-29, 03:21 PM
استمر

bosha1
2022-01-04, 05:59 PM
عاشش

bisho2009
2022-05-02, 11:31 PM
شكرا

Abdelalem
2022-05-03, 08:32 AM
thanks

GrayMask
2023-04-09, 06:30 AM
see

mohammedshafik
2023-05-25, 10:08 AM
thhxxx

MRonlineGvrix
2023-05-28, 06:25 PM
عاش

ahmed207556
2025-01-10, 04:46 AM
هشوف الموضوع القديم ههههه