|
المشاركات 214 |
+التقييم 0.11 |
تاريخ التسجيل May 2019 |
الاقامة |
نظام التشغيل |
رقم العضوية 129 |
#region ShadowClone
case 12090:
{
if (attacker.MyClones.Count != 0)
{
foreach (var clone in attacker.MyClones)
clone.RemoveThat();
attacker.MyClones.Clear();
break;
}
if (CanUseSpell(spell, attacker.Owner))
{
PrepareSpell(spell, attacker.Owner);
MsgMagicEffect suse = new MsgMagicEffect(true);
suse.Attacker = attacker.UID;
suse.Attacker1 = attacker.UID;
suse.SpellID = SpellID;
suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
suse.X = X;
suse.Y = Y;
switch (attacker.Owner.Spells[SpellID].Level)
{
case 0:
case 1:
case 2:
{
attacker.MyClones.Add(new Clone(attacker, "ShadowClone", 10003));
break;
}
default:
{
attacker.MyClones.Add(new Clone(attacker, "ShadowClone", 3));
attacker.MyClones.Add(new Clone(attacker, "ShadowClone", 10003));
break;
}
}
foreach (var clone in attacker.MyClones)
{
}
attacker.Owner.SendScreen(suse, true);
}
break;
}
#endregion
case 2812:
{
var attackd = BitConverter.ReadUint(packet, 4);
var clonecount = packet[8];
for (int i = 0; i < clonecount; i++)
{
var attackr = BitConverter.ReadUint(packet, 9 + (i * 4));
if (client.Entity.MyClones.Count < clonecount)
return;
var attack = client.Entity.AttackPacket;
if (attack == null)
attack = new GamePackets.Attack(true);
attack.Attacker = attackr;
attack.Attacked = attackd;
if (client.Entity.MyClones.Count == 0)
return;
if (attackd == client.Entity.UID || client.Entity.MyClones.ContainsKey(attackd))
return;
KhaledMohamed.Database.SpellInformation MySpell = null;
try
{
MySpell = Database.SpellTable.GetSpell(client.Spells[12090].ID, client.Spells[12090].Level);
}
catch { MySpell = Database.SpellTable.GetSpell(12090, 4); }
Entity Clone = null;
if (client.Entity.MyClones.TryGetValue(attackr, out Clone))
{
Entity attacked = null;
SobNpcSpawn attackedsob = null;
if (client.Screen.TryGetValue(attackd, out attacked))
{
uint damage = 0;
var spell = Database.SpellTable.GetSpell(attack.MagicType, (byte)attack.MagicLevel);
if (spell == null)
spell = Database.SpellTable.GetSpell(12080, 0);
if (attack.AttackType == GamePackets.Attack.Melee)
{
if (Game.Attacking.Handle.CanAttack(client.Entity, attacked, spell, true))
{
damage = Game.Attacking.Calculate.Melee(client.Entity, attacked, spell, ref attack);
double power = (0.5);
damage = (uint)((double)damage * power / 8);
Game.Attacking.Handle.ReceiveAttack(Clone, attacked, attack, ref damage, spell);
attack.Damage = damage;
client.SendScreen(attack);
}
}
else
{
if (Game.Attacking.Handle.CanAttack(client.Entity, attacked, spell, false))
{
damage = Game.Attacking.Calculate.Magic(client.Entity, attacked, spell, ref attack);
double power = (0.5);
damage = (uint)((double)damage * power / 8);
Game.Attacking.Handle.ReceiveAttack(Clone, attacked, attack, ref damage, spell);
attack.Damage = damage;
client.SendScreen(attack);
}
}
SpellUse suse = new SpellUse(true);
suse.Attacker = Clone.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.X = attacked.X;
suse.Y = attacked.Y;
suse.Effect1 = attack.Effect1;
suse.AddTarget(attacked, damage, attack);
client.SendScreen(suse, true);
if (client.Account.State == KhaledMohamed.Database.AccountTable.AccountState.ProjectManager)
client.Send(new Message("Clone Attack With Skill: " + spell.Name, System.Drawing.Color.CadetBlue, Message.Talk));
}
else if (client.Screen.TryGetSob(attackd, out attackedsob))
{
uint damage = 0;
var spell = Database.SpellTable.GetSpell(attack.MagicType, (byte)attack.MagicLevel);
if (spell == null)
spell = Database.SpellTable.GetSpell(12080, 0);
if (attack.AttackType == GamePackets.Attack.Melee)
{
if (Game.Attacking.Handle.CanAttack(client.Entity, attackedsob, null))
{
damage = Game.Attacking.Calculate.Melee(client.Entity, attackedsob, ref attack);
double power = ((MySpell.Power / 100.0) / 100.0);
damage = (uint)((double)damage * power);
Game.Attacking.Handle.ReceiveAttack(Clone, attackedsob, attack, damage, null);
attack.Damage = damage;
client.SendScreen(attack);
}
}
else
{
if (Game.Attacking.Handle.CanAttack(client.Entity, attackedsob, spell))
{
damage = Game.Attacking.Calculate.Magic(client.Entity, attackedsob, spell, ref attack);
double power = ((MySpell.Power / 100.0) / 100.0);
damage = (uint)((double)damage * power);
Game.Attacking.Handle.ReceiveAttack(Clone, attackedsob, attack, damage, spell);
attack.Damage = damage;
client.SendScreen(attack);
}
}
SpellUse suse = new SpellUse(true);
suse.Attacker = Clone.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.X = attackedsob.X;
suse.Y = attackedsob.Y;
suse.Effect1 = attack.Effect1;
suse.AddTarget(attackedsob, damage, attack);
client.SendScreen(suse, true);
if (client.Account.State == KhaledMohamed.Database.AccountTable.AccountState.ProjectManager)
client.Send(new Message("Clone Attack With Skill: " + spell.Name, System.Drawing.Color.CadetBlue, Message.Talk));
}
}
}
break;
}
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
حاجه مهمه بخصوص Revive لو سمحتو | uncelsam | مشكلات السيرفيرات كونكر الشخصيه | 3 | 2019-07-12 01:04 AM |