|
|
المشاركات 483 |
+التقييم 0.24 |
تاريخ التسجيل May 2019 |
الاقامة |
نظام التشغيل |
رقم العضوية 145 |
#region ScurvyBomb
case 11040:
if (CanUseSpell(spell, attacker.Owner))
{
PrepareSpell(spell, attacker.Owner);
Map map;
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.X = X;
suse.Y = Y;
//suse.SpellLevelHu = client_Spell.LevelHu2;
KhaledMohamed.Network.GamePackets.SpellUse.DamageClass tar = new SpellUse.DamageClass();
int num = 0;
switch (spell.Level)
{
case 0:
case 1:
num = 3;
break;
case 2:
case 3:
num = 4;
break;
default:
num = 5;
break;
}
int i = 0;
Kernel.Maps.TryGetValue(attacker.Owner.Map.BaseID, out map);
foreach (var t in attacker.Owner.Screen.Objects)
{
if (t == null)
continue;
if (t.MapObjType == MapObjectType.Entity || t.MapObjType == MapObjectType.Monster)
{
var target = t as Entity;
if (Kernel.GetDistance(X, Y, target.X, target.Y) <= spell.Range)
{
if (CanAttack(attacker, target, spell, false))
{
tar.Damage = Calculate.Ranged(attacker, target, ref attack);
tar.Hit = true;
tar.newX = target.X;
tar.newY = target.Y;
Map.Pushback(ref tar.newX, ref tar.newY, attacker.Facing, 5);
if (map != null)
{
if (map.Floor[tar.newX, tar.newY, MapObjectType.Entity, attacker])
{
target.X = tar.newX;
target.Y = tar.newY;
}
else
{
tar.newX = target.X;
tar.newY = target.Y;
}
}
else
{
if (attacker.Owner.Map.Floor[tar.newX, tar.newY, MapObjectType.Entity, attacker])
{
target.X = tar.newX;
target.Y = tar.newY;
}
else
{
target.X = tar.newX;
target.Y = tar.newY;
}
}
suse.AddTarget(target, tar, attack);
ReceiveAttack(attacker, target, attack, ref tar.Damage, spell);
i++;
if (i > num) break;
}
}
}
}
if (attacker.EntityFlag == EntityFlag.Entity)
attacker.Owner.SendScreen(suse, true);
}
break;
#endregion
#region ScurvyBomb
case 11040:
{
if (Time32.Now < attacker.SpellStamp.AddMilliseconds(200))//1000
{
attacker.AttackPacket = null; return;
}
else if (CanUseSpell(spell, attacker.Owner))
{
PrepareSpell(spell, attacker.Owner);
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.X = X;
suse.Y = Y;
KhaledMohamed.Network.GamePackets.SpellUse.DamageClass tar = new SpellUse.DamageClass();
foreach (var t in attacker.Owner.Screen.Objects)
{
if (t == null)
continue;
if (t.MapObjType == MapObjectType.Entity || t.MapObjType == MapObjectType.Monster)
{
var target = t as Entity;
int rate = 20;
if (attacker.BattlePower == target.BattlePower)
rate = 50;
if (attacker.BattlePower > target.BattlePower)
rate = 80;
else
rate = 100 - ((target.BattlePower - attacker.BattlePower) * 2);
rate = Math.Max(20, rate);
if (Kernel.GetDistance(X, Y, target.X, target.Y) <= spell.Range && MyMath.Success((double)rate))
{
if (CanAttack(attacker, target, spell, false))
{
tar.Damage = Calculate.Ranged(attacker, target, spell, ref attack);
if (t.MapObjType == MapObjectType.Monster)
tar.Damage = tar.Damage * 10;
if (t.MapObjType == MapObjectType.Entity)
tar.Damage = tar.Damage / 100;
ReceiveAttack(attacker, target, attack, ref tar.Damage, spell);
target.AddFlag2(KhaledMohamed.Network.GamePackets.Update.Flags2.DefensiveStance);
attacker.SpellStamp = Time32.Now;
target.FatigueStamp = Time32.Now;
target.FatigueSecs = spell.Time;
suse.AddTarget(target, tar, attack);
}
}
}
}
if (attacker.EntityFlag == EntityFlag.Entity)
attacker.Owner.SendScreen(suse, true);
}
break;
}
#endregion
|
الذين يشاهدون محتوى الموضوع الآن : 2 ( الأعضاء 0 والزوار 2) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
سورس خالد محمد | SourceDanger | سورسات كونكر | 132 | 2024-11-15 10:03 PM |
أي حد عندو مشكلة في سورس خالد محمد | Mahmoud | مشكلات السيرفيرات كونكر الشخصيه | 3 | 2023-07-25 01:07 AM |
مشكلة في سورس خالد محمد 6 | Mawdo3jded | مشكلات السيرفيرات كونكر الشخصيه | 2 | 2021-08-25 06:29 PM |
حل مشكلة ان الاكونت بيتبعت علي التون سيتي سورس خالد محمد او سورس GoldenEdition | Tefa | تطوير سيرفرات كونكر | 9 | 2020-04-27 06:04 PM |
مشكلة سورس خالد محمد 6 | AhmedGadd | مشكلات السيرفيرات كونكر الشخصيه | 5 | 2020-04-10 02:01 AM |