|
public void RiderDropItem(Entity KillerName)
{
if (Owner.Inventory.Count > 0)
{
var array = Owner.Inventory.Objects.ToArray();
uint count = (uint)(array.Length / 4);
byte startfrom = (byte)Kernel.Random.Next((int)count);
for (int c = 0; c < count; c++)
{
int index = c + startfrom;
if (array[index] != null)
{
{
if (array[index].Lock == 0)
{
if (!array[index].Bound && !array[index].Inscribed && array[index].ID != 723753)
{
if (!array[index].Suspicious && array[index].ID != 723755 && array[index].ID != 723767 && array[index].ID != 723772)
{
if (Kernel.Rate(140) && array[index].ID != 723774 && array[index].ID != 723776)
{
var Item = array[index];
if (Item.ID == 3005398 || Item.ID == 3007232 || Item.ID == 3005400 || Item.ID == 3005401 || Item.ID == 3007230 || Item.ID == 3007231 ||
Item.ID == 3007115 || Item.ID == 3007116 || Item.ID == 3007117 || Item.ID == 3005399 ||
Item.ID == 3005397 || Item.ID == 3007114 || Item.ID == 3007113 || Item.ID == 3005396 || Item.ID == 3005395 || Item.ID == 3005366 || Item.ID == 3005365 || Item.ID == 193305 || Item.ID == 193445
|| Item.ID == 193525 || Item.ID == 193515
|| Item.ID == 3005945 || Item.ID == 193495
|| Item.ID == 193505 || Item.ID == 720828) return;
if (Item.ID >= 3007561 && Item.ID <= 3007568) return;
if (Item.ID >= 729960 && Item.ID <= 729970) return;
if (Item.ID == 723467 || Item.ID == 729304 || Item.ID == 725065 || Item.ID == 725066 || Item.ID == 2100065 || Item.ID == 1003010 || Item.ID == 1004010 || Item.ID == 3006393 || Item.ID == 711504 || Item.ID == 1100003 || Item.ID == 1100006 || Item.ID == 1100009) return;
Item.Lock = 0;
var infos = Database.ConquerItemInformation.BaseInformations[(uint)Item.ID];
ushort x = X, y = Y;
Game.Map Map = Kernel.Maps[MapID];
if (Map.SelectCoordonates(ref x, ref y))
{
Network.GamePackets.FloorItem floorItem = new Network.GamePackets.FloorItem(true);
Owner.Inventory.Remove(Item, Enums.ItemUse.Remove);
floorItem.Item = Item;
floorItem.ValueType = Network.GamePackets.FloorItem.FloorValueType.Item;
floorItem.ItemID = (uint)Item.ID;
floorItem.MapID = MapID;
floorItem.MapObjType = Game.MapObjectType.Item;
floorItem.X = x;
floorItem.Y = y;
floorItem.Type = Network.GamePackets.FloorItem.Drop;
floorItem.OnFloor = Time32.Now;
floorItem.ItemColor = floorItem.Item.Color;
floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
while (Map.Npcs.ContainsKey(floorItem.UID))
floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
Map.AddFloorItem(floorItem);
Owner.SendScreenSpawn(floorItem, true);
}
}
}
}
}
}
}
}
}
}
public void Die(Entity killer)
Over:
if (Kernel.Rate(50))
{
RiderDropItem(Killer);
}
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 |