|
المشاركات 2,515 |
+التقييم 1.28 |
تاريخ التسجيل Jul 2019 |
الاقامة |
نظام التشغيل |
رقم العضوية 358 |
public void Drop(Game.Entity killer)
if (killer.Name == "Thundercloud") return;
Calculate.cs
public static void Refinary(Entity attacker, Entity attacked, ref double Damage, ref Attack Packet, bool magic = false)
if (attacker.Name == "Thundercloud") return;
private void Execute()
{
if (attacker.Name != "Thundercloud")
{
if (Constants.PKForbiddenMaps.Contains(attacker.MapID))
return;
}
#region ThunderCloud
if (attacker.Name == "Thundercloud")
{
Console.WriteLine("Test 1");
if (Kernel.GamePool.ContainsKey(attacker.OwnerUID))
{
Console.WriteLine("Test 2");
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
if (attacker.MonsterInfo.SpellID == 0)
uint damage = Calculate.MonsterDamage(attacker, attacked, ref attack, false);
#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);
uint damage2 = (uint)(Calculate.Melee(owner.Player, attacked, ref attack, 0) * (spell.Level < 8 ? spell.FirstDamage : 50) / 100);
if (attacker.SpawnPacket[50] == 128)
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
#region ThunderCloud[Chaser]
case 12840:
{
if (CanUseSpell(spell, attacker.Owner))
{
attacker.GreenEffect = 10;
PrepareSpell(spell, attacker.Owner);
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.Attacker1 = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
var cl = new WindWalker.ThunderCloud(attacker.Owner, attack.X, attack.Y);
suse.AddTarget(cl.UID, 0, null);
attacker.Owner.SendScreen(suse, true);
}
break;
}
#endregion
#region ThunderBolt[Chaser]
case 12970:
{
if (CanUseSpell(spell, attacker.Owner))
{
//attacker.GreenEffect = 10;
PrepareSpell(spell, attacker.Owner);
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.Attacker1 = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.AddTarget(attacker.UID, 0, null);
attacker.Owner.SendScreen(suse, true);
foreach (var Cloud in attacker.Owner.Map.Clouds.Values.ToList())
{
Cloud.ThunderBolt = true;
attacker.ThunderBolt = true;
//Cloud.DisposeCloud2(attacker.Owner);
if (Kernel.GetDistance(Cloud.X, Cloud.Y, attacker.Owner.Player.X, attacker.Owner.Player.Y) > 16) continue;
Cloud.SendSpawn2(attacker.Owner, false);
//ThunderCloud cl = new ThunderCloud(attacker.Owner, Cloud.X, Cloud.Y);
}
}
break;
}
#endregion
#region RevengeTaill
#region ThunderCloud
if (attacked.Name == "Thundercloud")
{
if (spell != null && spell.ID != 0)
{
if (Kernel.Rate(75)) damage = 1;
else damage = 0;
}
else if (spell == null || spell.ID == 0)
{
damage = 1;
}
}
foreach (var th in Kernel.Maps[attacker.MapID].Entities.Values.Where(i => i.Name == "Thundercloud"))
{
if (th.UID == 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
attacked.Owner.LoadItemStats();
#region ThunderCloud
foreach (var th in Kernel.Maps[attacker.MapID].Entities.Values.Where(i => i.Name == "Thundercloud"))
{
if (th.OwnerUID == attacker.UID)
{
if (attacked == null || Kernel.GetDistance(attacked.X, attacked.Y, th.X, th.Y) > th.MonsterInfo.AttackRange || attacked.Dead) break;
th.MonsterInfo.InSight = attacked.UID;
break;
}
}
#endregion
public static bool CanAttack(Game.Entity attacker, Game.Entity attacked, Database.SpellInformation spell, bool melee)
#region ThunderCloud
if (attacked.Name == "Thundercloud")
{
if (attacked.OwnerUID == attacker.UID) return false;
if (!Constants.PKForbiddenMaps.Contains(attacker.MapID))
{
if (attacker.PKMode != Game.Enums.PKMode.PK &&
attacker.PKMode != Game.Enums.PKMode.Team)
return false;
else
{
attacker.AddFlag(Network.GamePackets.Update.Flags.FlashingName);
attacker.FlashingNameStamp = Time32.Now;
attacker.FlashingNameTime = 20;
return true;
}
}
else return false;
}
#endregion
bool _thbolt;
public bool ThunderBolt
{
get
{
return _thbolt;
}
set
{
if (Cloud != null)
Cloud.ThunderBolt = value;
_thbolt = value;
}
}
public WindWalker.ThunderCloud Cloud;
ManiacDanceStamp
ThunderCloudStamp,
public uint Hitpoints
set
{
if (EntityFlag == EntityFlag.Entity)
Update((byte)Network.GamePackets.Update.DataType.Hitpoints, value, true);
else if (EntityFlag == EntityFlag.Monster)
{
if (Name != "Thundercloud")
{
var update = new Update(true);
update.UID = UID;
update.Append(Network.GamePackets.Update.Hitpoints, value);
MonsterInfo.SendScreen(update);
}
else
{
var update = new Update(true);
update.UID = UID;
update.Append(Network.GamePackets.Update.Hitpoints, value / 400);
MonsterInfo.SendScreen(update);
}
}
_hitpoints = value;
if (Boss > 0 && Name != "Thundercloud")
{
uint key = (uint)(MaxHitpoints / 10000);
if (key != 0)
Writer.Write((ushort)(value / key), _Hitpoints, SpawnPacket);
else
Writer.Write((ushort)(value * MaxHitpoints / 1000 / 1.09), _Hitpoints, SpawnPacket);
}
else
Writer.Write((ushort)value, _Hitpoints, SpawnPacket);
/* if (EntityFlag == EntityFlag.Entity)
{
if (Owner != null)
{
if (Owner.Team != null)
{
foreach (var Team in Owner.Team.Temates)
{
AddToTeam addme = new AddToTeam();
addme.UID = Owner.Entity.UID;
addme.Hitpoints = (ushort)Owner.Entity.Hitpoints;
addme.Mesh = Owner.Entity.Mesh;
addme.Name = Owner.Entity.Name;
addme.MaxHitpoints = (ushort)Owner.Entity.MaxHitpoints;
Team.entry.Send(addme.ToArray());
}
}
}
}*/
}
}
Thundercloud = 12840,
public Dictionary<uint, WindWalker.ThunderCloud> Clouds = new Dictionary<uint, WindWalker.ThunderCloud>();
public void AddCloud(WindWalker.ThunderCloud entity)
{
if (!this.Clouds.ContainsKey(entity.UID))
this.Clouds.Add(entity.UID, entity);
}
Region rageofwar
#region ThunderCloud
foreach (var Cloud in client.Map.Clouds.Values)
{
if (Cloud == null) continue;
if (Kernel.GetDistance(Cloud.X, Cloud.Y, client.Player.X, client.Player.Y) > 16) continue;
if (DateTime.Now > Cloud.EndTime || Cloud.Owner == null)
{
Cloud.DisposeCloud(client);
return;
}
}
#endregion
region Stamina
#region ThunderCloud
foreach (var Cloud in client.Map.Clouds.Values)
{
if (Cloud == null) continue;
if (Kernel.GetDistance(Cloud.X, Cloud.Y, client.Player.X, client.Player.Y) > 16) continue;
if (DateTime.Now > Cloud.EndTime || Cloud.Owner == null)
{
Cloud.DisposeCloud(client);
return;
}
#region ThunderCloud
if (!Cloud.Dead && Time32.Now > Cloud.LastCloudAttack.AddSeconds(Cloud.ThunderBolt == true ? 1 : 2))
{
if (client.Player.Cloud != null)
{
var spell = Database.SpellTable.GetSpell(12970, client);
SpellUse suse = new SpellUse(true);
suse.Attacker = client.Player.Cloud.UID;
suse.SpellID = 13190;
suse.SpellLevel = 0;
suse.X = client.Player.Cloud.X;
suse.Y = client.Player.Cloud.Y;
Entity attacked = null;
foreach (Interfaces.IMapObject _obj in client.Screen.Objects)
{
if (_obj == null) continue;
if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
{
Cloud.LastCloudAttack = Time32.Now;
attacked = _obj as Entity;
if (Kernel.GetDistance(Cloud.X, Cloud.Y, attacked.X, attacked.Y) <= 15)
{
Attack attack = new Attack(true);
if (Game.Attacking.Handle.CanAttack(Cloud.Owner.Player, attacked, spell, attack.AttackType == Attack.Melee))
{
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Melee(Cloud.Owner.Player, attacked, spell, ref attack);
damage = (uint)(damage * 0.2);
if (Cloud.ThunderBolt)
damage += Game.Attacking.Calculate.Melee(Cloud.Owner.Player, attacked, Database.SpellTable.GetSpell(12970, client), ref attack);
suse.Effect1 = attack.Effect1;
Game.Attacking.Handle.ReceiveAttack(Cloud.Owner.Player, attacked, attack, ref damage, spell);
suse.AddTarget(attacked, damage, attack);
break;
}
}
}
}
client.SendScreen(suse, true);
}
}
#endregion
}
#endregion
public void Reload(Interfaces.IPacket spawnWith = null)
#region ThunderCloud
foreach (var Cloud in Map.Clouds.Values)
{
if (Cloud == null) continue;
if (Kernel.GetDistance(Cloud.X, Cloud.Y, Owner.Player.X, Owner.Player.Y) > 16) continue;
Cloud.SendSpawn(Owner, false);
}
#endregion
public Game.Enums.ConquerAngle Facing
public ushort Thundercloud
{
get { return BitConverter.ToUInt16(Buffer, 26); }
set { Writer.WriteUInt16(value, 26, Buffer); }
}
Windwalker.cs
public class ThunderCloud
{
public static Counter ThunderCloudCounter = new Counter(700000);
byte[] Buffer;
public ushort X = 0, Y = 0;
public uint UID = 0;
public uint OwnerID;
public GameState Owner;
public DateTime EndTime;
public bool Dead = false;
bool _bol;
public bool ThunderBolt
{
get { return _bol; }
set
{
if (value == true)
Writer.WriteUInt32(128, 50, Buffer);
else
Writer.WriteUInt32(0, 50, Buffer);
_bol = value;
}
}
public Time32 LastCloudAttack;
public ThunderCloud(GameState client, ushort X, ushort Y)
{
Owner = client;
Owner.Player.Cloud = this;
EndTime = DateTime.Now.AddSeconds(24);
this.X = X;
this.Y = Y;
OwnerID = client.Player.UID;
UID = ThunderCloudCounter.Next;
string _Name = "Thundercloud";
byte[] Packet_2035 = new byte[68 + 8];
Writer.WriteUInt16((ushort)(Packet_2035.Length - 8), 0, Packet_2035);
Writer.WriteUInt16(2035, 2, Packet_2035);
Writer.WriteUInt32(UID, 4, Packet_2035);
Writer.WriteUInt32(4264, 8, Packet_2035);
Packet_2035[12] = 3;
Writer.WriteUInt32(980, 16, Packet_2035);//mesh
Packet_2035[24] = 14;
Writer.WriteUInt32(22348141, 26, Packet_2035);
Writer.WriteString(_Name, 30, Packet_2035);
Buffer = new byte[8 + Game.Entity._Names + _Name.Length + 36];
Writer.WriteUInt16((ushort)(Buffer.Length - 8), 0, Buffer);
Writer.WriteUInt16(10014, 2, Buffer);
Writer.WriteUInt32((uint)Time32.timeGetTime().GetHashCode(), 4, Buffer);
Writer.WriteUInt32(980, 8, Buffer);//Mesh
Writer.WriteUInt32(UID, 12, Buffer);//Uid
var seconds = System.Math.Abs((EndTime - DateTime.Now).TotalSeconds);
Writer.WriteUInt32((uint)((seconds * 10000) / 24), 111, Buffer);//Time
Writer.WriteUInt32(140, 117, Buffer);//Level
Writer.WriteUInt32(X, 119, Buffer);
Writer.WriteUInt32(Y, 121, Buffer);
Writer.WriteUInt32(5, 125, Buffer);
Writer.WriteUInt32(client.Player.UID, 274, Buffer);//OwnerUID
Buffer[278] = 1;
Buffer[220] = 1;
Writer.WriteUInt16(768, 270, Buffer);
Writer.WriteStringList(new List<string>() { _Name, "", "", "", "", "", "" }, Game.Entity._Names, Buffer);
Network.GamePackets.Data d = new Data(true);
d.UID = UID;
d.ID = Data.SpawnEffect;
d.Facing = (Game.Enums.ConquerAngle)5;
client.Send(Packet_2035);
client.Send(Buffer);
client.Send(d);
client.Map.AddCloud(this);
}
public void DisposeCloud(GameState c)
{
if (c != null)
if (c.Map.Clouds.ContainsKey(UID))
{
c.Map.Clouds.Remove(UID);
Data d = new Data(true);
d.UID = UID;
d.ID = Data.RemoveEntity;
c.SendScreen(d, true);
ThunderBolt = false;
if (Owner != null)
Owner.Player.ThunderBolt = false;
Dead = true;
}
}
public void SendSpawn(GameState Owner, bool p)
{
var seconds = System.Math.Abs((EndTime - DateTime.Now).TotalSeconds);
if (seconds > 24) seconds = 0;
Writer.WriteUInt32((uint)((seconds * 10000) / 24), 111, Buffer);//Time
Owner.Send(Buffer);
}
public byte[] Refresh()
{
var seconds = System.Math.Abs((EndTime - DateTime.Now).TotalSeconds);
if (seconds > 24) seconds = 0;
Writer.WriteUInt32((uint)((seconds * 10000) / 24), 111, Buffer);//Time
return Buffer;
}
public void SendSpawn2(GameState Owner, bool p)
{
byte[] Packet_2035 = new byte[68 + 8];
var seconds = System.Math.Abs((EndTime - DateTime.Now).TotalSeconds);
if (seconds > 24) seconds = 0;
Writer.WriteUInt32((uint)((seconds * 10000) / 24), 111, Buffer);//Time
Writer.Write(128, 50, Buffer);//Flag4(128)
Writer.Write(128, 50, Packet_2035);//Flag4(128)
Owner.Send(Buffer);
}
}
World.cs
public void Init(bool onlylogin = false)
{
if (!onlylogin)
{
ThunderCloud = new TimerRule<Entity>(ThunderCloudTimer, 250, ThreadPriority.Lowest);
public void CreateTournaments()
public bool Register(Entity ThunderCloudd)
{
if (ThunderCloudd.Owner.TimerSubscriptions == null)
{
ThunderCloudd.Owner.TimerSyncRoot = new object();
ThunderCloudd.Owner.TimerSubscriptions = new IDisposable[]
{
ThunderCloud.Add(ThunderCloudd)
};
return true;
}
return false;
}
public void Unregister(Entity Thundercloud)
{
if (Thundercloud.Owner == null || Thundercloud.Owner.TimerSubscriptions == null) return;
lock (Thundercloud.Owner.TimerSyncRoot)
{
if (Thundercloud.Owner.TimerSubscriptions != null)
{
foreach (var timer in Thundercloud.Owner.TimerSubscriptions)
timer.Dispose();
Thundercloud.Owner.TimerSubscriptions = null;
}
}
}
private void CharactersCallback(
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);
}
}
}
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
Rayzo V2 EpicPirate Runes ThunderStrike [Beta] نسخه تجريبيه | Tefa | سورسات كونكر | 234 | 2024-09-30 02:16 PM |
اسكله thundercloud | سمير | مشكلات السيرفيرات كونكر الشخصيه | 4 | 2019-11-13 02:05 AM |
مشكله Thundercloud | سمير | مشكلات السيرفيرات كونكر الشخصيه | 1 | 2019-10-31 10:17 PM |
ازاى اعمل للسورس نسخه pin ? | ابو مروان | مشكلات السيرفيرات كونكر الشخصيه | 7 | 2019-09-26 06:54 PM |
اعمل نسخه احتياطيه لسورس | MohamedModyAdel | تطوير سيرفرات كونكر | 4 | 2019-07-10 08:57 PM |