|
private void CharactersCallback(GameState client, int time)
public TimerRule<Entity> ThunderCloud;
private void ThunderCloudTimer(Entity ThunderCloud, int time)
{
if (ThunderCloud == null) return;
if (!Kernel.Maps.ContainsKey(ThunderCloud.MapID))
{
Kernel.Maps[ThunderCloud.MapID].RemoveEntity(ThunderCloud);
Data data = new Data(true);
data.UID = ThunderCloud.UID;
data.ID = Data.RemoveEntity;
ThunderCloud.MonsterInfo.SendScreen(data);
ThunderCloud.MonsterInfo.SendScreen(data);
foreach (var client in Kernel.GamePool.Values)
{
if (Kernel.GetDistance(ThunderCloud.X, ThunderCloud.Y, client.Player.X, client.Player.Y) > 16) continue;
client.RemoveScreenSpawn(ThunderCloud, true);
}
Unregister(ThunderCloud);
return;
}
if (Time32.Now >= ThunderCloud.ThunderCloudStamp.AddSeconds(1))
{
ThunderCloud.ThunderCloudStamp = Time32.Now;
if (ThunderCloud.Hitpoints > 400)
ThunderCloud.Hitpoints -= 400;
else
{
Kernel.Maps[ThunderCloud.MapID].RemoveEntity(ThunderCloud);
Data data = new Data(true);
data.UID = ThunderCloud.UID;
data.ID = Data.RemoveEntity;
ThunderCloud.MonsterInfo.SendScreen(data);
ThunderCloud.MonsterInfo.SendScreen(data);
foreach (var client in Kernel.GamePool.Values)
{
if (Kernel.GetDistance(ThunderCloud.X, ThunderCloud.Y, client.Player.X, client.Player.Y) > 16) continue;
client.RemoveScreenSpawn(ThunderCloud, true);
}
Unregister(ThunderCloud);
return;
}
}
if ((ThunderCloud.SpawnPacket[50] == 0 && Time32.Now >= ThunderCloud.MonsterInfo.LastMove.AddMilliseconds(750)) || ThunderCloud.SpawnPacket[50] == 128)
{
ThunderCloud.MonsterInfo.LastMove = Time32.Now;
if (ThunderCloud.MonsterInfo.InSight == 0)
{
foreach (var one in Kernel.Maps[ThunderCloud.MapID].Entities.Values.Where(i => Kernel.GetDistance(ThunderCloud.X, ThunderCloud.Y, i.X, i.Y) <= ThunderCloud.MonsterInfo.AttackRange))
{
if (one == null || one.Dead || one.MonsterInfo.Guard || one.Companion) continue;
ThunderCloud.MonsterInfo.InSight = one.UID;
Entity insight = null;
if (Kernel.Maps[ThunderCloud.MapID].Entities.ContainsKey(ThunderCloud.MonsterInfo.InSight))
insight = Kernel.Maps[ThunderCloud.MapID].Entities[ThunderCloud.MonsterInfo.InSight];
else if (Kernel.GamePool.ContainsKey(ThunderCloud.MonsterInfo.InSight))
insight = Kernel.GamePool[ThunderCloud.MonsterInfo.InSight].Player;
if (insight == null || insight.Dead || (insight.MonsterInfo != null && insight.MonsterInfo.Guard))
{
ThunderCloud.MonsterInfo.InSight = 0;
break;
}
new Game.Attacking.Handle(null, ThunderCloud, insight);
break;
}
}
else
{
Entity insight = null;
if (Kernel.Maps[ThunderCloud.MapID].Entities.ContainsKey(ThunderCloud.MonsterInfo.InSight))
insight = Kernel.Maps[ThunderCloud.MapID].Entities[ThunderCloud.MonsterInfo.InSight];
else if (Kernel.GamePool.ContainsKey(ThunderCloud.MonsterInfo.InSight))
insight = Kernel.GamePool[ThunderCloud.MonsterInfo.InSight].Player;
if (insight == null || insight.Dead || (insight.MonsterInfo != null && insight.MonsterInfo.Guard))
{
ThunderCloud.MonsterInfo.InSight = 0;
return;
}
new Game.Attacking.Handle(null, ThunderCloud, insight);
}
}
}
Buffers = new TimerRule<GameState>(BuffersCallback, 1000, ThreadPriority.BelowNormal);
ThunderCloud = new TimerRule<Entity>(ThunderCloudTimer, 250, ThreadPriority.Lowest);
private void CharactersCallback(GameState client, int time)
public TimerRule<Entity> ThunderCloud;
private void ThunderCloudTimer(Entity ThunderCloud, int time)
{
if (ThunderCloud == null) return;
if (!Kernel.Maps.ContainsKey(ThunderCloud.MapID))
{
Kernel.Maps[ThunderCloud.MapID].RemoveEntity(ThunderCloud);
Data data = new Data(true);
data.UID = ThunderCloud.UID;
data.ID = Data.RemoveEntity;
ThunderCloud.MonsterInfo.SendScreen(data);
ThunderCloud.MonsterInfo.SendScreen(data);
foreach (var client in Kernel.GamePool.Values)
{
if (Kernel.GetDistance(ThunderCloud.X, ThunderCloud.Y, client.Player.X, client.Player.Y) > 16) continue;
client.RemoveScreenSpawn(ThunderCloud, true);
}
Unregister(ThunderCloud);
return;
}
if (Time32.Now >= ThunderCloud.ThunderCloudStamp.AddSeconds(1))
{
ThunderCloud.ThunderCloudStamp = Time32.Now;
if (ThunderCloud.Hitpoints > 400)
ThunderCloud.Hitpoints -= 400;
else
{
Kernel.Maps[ThunderCloud.MapID].RemoveEntity(ThunderCloud);
Data data = new Data(true);
data.UID = ThunderCloud.UID;
data.ID = Data.RemoveEntity;
ThunderCloud.MonsterInfo.SendScreen(data);
ThunderCloud.MonsterInfo.SendScreen(data);
foreach (var client in Kernel.GamePool.Values)
{
if (Kernel.GetDistance(ThunderCloud.X, ThunderCloud.Y, client.Player.X, client.Player.Y) > 16) continue;
client.RemoveScreenSpawn(ThunderCloud, true);
}
Unregister(ThunderCloud);
return;
}
}
if ((ThunderCloud.SpawnPacket[50] == 0 && Time32.Now >= ThunderCloud.MonsterInfo.LastMove.AddMilliseconds(750)) || ThunderCloud.SpawnPacket[50] == 128)
{
ThunderCloud.MonsterInfo.LastMove = Time32.Now;
if (ThunderCloud.MonsterInfo.InSight == 0)
{
foreach (var one in Kernel.Maps[ThunderCloud.MapID].Entities.Values.Where(i => Kernel.GetDistance(ThunderCloud.X, ThunderCloud.Y, i.X, i.Y) <= ThunderCloud.MonsterInfo.AttackRange))
{
if (one == null || one.Dead || one.MonsterInfo.Guard || one.Companion) continue;
ThunderCloud.MonsterInfo.InSight = one.UID;
Entity insight = null;
if (Kernel.Maps[ThunderCloud.MapID].Entities.ContainsKey(ThunderCloud.MonsterInfo.InSight))
insight = Kernel.Maps[ThunderCloud.MapID].Entities[ThunderCloud.MonsterInfo.InSight];
else if (Kernel.GamePool.ContainsKey(ThunderCloud.MonsterInfo.InSight))
insight = Kernel.GamePool[ThunderCloud.MonsterInfo.InSight].Player;
if (insight == null || insight.Dead || (insight.MonsterInfo != null && insight.MonsterInfo.Guard))
{
ThunderCloud.MonsterInfo.InSight = 0;
break;
}
new Game.Attacking.Handle(null, ThunderCloud, insight);
break;
}
}
else
{
Entity insight = null;
if (Kernel.Maps[ThunderCloud.MapID].Entities.ContainsKey(ThunderCloud.MonsterInfo.InSight))
insight = Kernel.Maps[ThunderCloud.MapID].Entities[ThunderCloud.MonsterInfo.InSight];
else if (Kernel.GamePool.ContainsKey(ThunderCloud.MonsterInfo.InSight))
insight = Kernel.GamePool[ThunderCloud.MonsterInfo.InSight].Player;
if (insight == null || insight.Dead || (insight.MonsterInfo != null && insight.MonsterInfo.Guard))
{
ThunderCloud.MonsterInfo.InSight = 0;
return;
}
new Game.Attacking.Handle(null, ThunderCloud, insight);
}
}
}
Buffers = new TimerRule<GameState>(BuffersCallback, 1000, ThreadPriority.BelowNormal);
ThunderCloud = new TimerRule<Entity>(ThunderCloudTimer, 250, ThreadPriority.Lowest);
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
مشكلة الاسكلات اللى بتفضل ف سورس رايزو | nova | مشكلات السيرفيرات كونكر الشخصيه | 5 | 2020-03-29 01:43 PM |
اسكلة النينجا الى بتطلع من الارض عالية اوي فى الضرب | lofyCo | مشكلات السيرفيرات كونكر الشخصيه | 1 | 2020-03-25 02:17 PM |
اسكلة النينجا اديك فى الارض تفحر عاوز اشوفلها حل | MRonlineGvrix | مشكلات السيرفيرات كونكر الشخصيه | 4 | 2020-02-05 05:55 PM |
حل مشكله الاك لما بيموت يقع عا الارض وبعدين يتحول شبح | Hassan Emprator | تطوير سيرفرات كونكر | 7 | 2019-11-15 08:49 AM |
الوحوش مش ظاهره في اللعبه | سمير | مشكلات السيرفيرات كونكر الشخصيه | 4 | 2019-10-26 12:56 AM |