|
المشاركات 127 |
+التقييم 0.06 |
تاريخ التسجيل Jul 2019 |
الاقامة https://www.facebook.com/Hossam.eldein123/ |
نظام التشغيل |
رقم العضوية 407 |
#region Monster -> Entity \ Monster
#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
if (attacked.Name == "Thundercloud")
{
if (attacked.OwnerUID == attacker.UID) return false;
if (!Constants.PKForbiddenMaps.Contains(attacker.MapID))
{
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)
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
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
مشـكـلة فـي البــأاتـل بــاوور ! | Source-Danger | مشكلات السيرفيرات كونكر الشخصيه | 9 | 2019-11-27 05:40 PM |
حــل مشـكـلة اسـم السـرفـر ! | Hassan Emprator | تطوير سيرفرات كونكر | 5 | 2019-08-24 12:11 AM |
حـل مشـكـلة يجدعان | Hassan Emprator | مشكلات السيرفيرات كونكر الشخصيه | 6 | 2019-08-21 06:01 AM |
حـل يشـبــااب مشـكـلة صغــيــرة . | MrCroSon | مشكلات السيرفيرات كونكر الشخصيه | 4 | 2019-08-19 04:23 AM |
حـل مشـكـلة يشبــااب | zonfor | مشكلات السيرفيرات كونكر الشخصيه | 5 | 2019-08-18 02:59 AM |