|
|
#region SeaBurial
case 14680:
{
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;
ushort _X = attacker.X, _Y = attacker.Y;
ushort _tX = X, _tY = Y;
byte dist = (byte)spell.Distance;
var Array = attacker.Owner.Screen.Objects;
InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist,
InLineAlgorithm.Algorithm.DDA);
X = attacker.X;
Y = attacker.Y;
int i = 0;
for (i = 0; i < algo.lcoords.Count; i++)
{
if (attacker.Owner.Map.Floor[
algo.lcoords[i].X, algo.lcoords[i].Y, MapObjectType.Entity]
&& !attacker.ThroughGate(algo.lcoords[i].X, algo.lcoords[i].Y))
{
X = (ushort)algo.lcoords[i].X;
Y = (ushort)algo.lcoords[i].Y;
}
else
{
break;
}
}
suse.X = X;
suse.Y = Y;
#region floor
_String str = new _String(true);
str.UID = attacker.UID;
str.TextsCount = 1;
str.X = X;
str.Y = Y;
str.PositionX = attacker.X;
str.PositionY = attacker.Y;
str.Type = _String.MapEffect;
str.Texts.Add("hdhlyz-lsyujing");
attacker.Owner.SendScreen(str.ToArray(), true);
Data data = new Data(true);
data.UID = attacker.UID;
data.X = X;
data.Y = Y;
data.ID = Data.FlashStep;
data.wParam1 = attacker.X;
data.wParam2 = attacker.Y;
attacker.Owner.SendScreen(data, true);
#endregion
if (!attacker.Owner.Map.Floor[X, Y, MapObjectType.Entity, null])
return;
double disth = 2.5;
foreach (Interfaces.IMapObject _obj in Array)
{
bool hit = false;
for (int j = 0; j < i; j++)
if (
Kernel.GetDDistance(_obj.X, _obj.Y, (ushort)algo.lcoords[j].X,
(ushort)algo.lcoords[j].Y) <= disth)
hit = true;
if (hit)
{
if (_obj.MapObjType == MapObjectType.Monster)
{
attacked = _obj as Entity;
if (CanAttack(attacker, attacked, spell,
attack.AttackType == Attack.Melee))
{
var damage = Game.Attacking.Calculate.Melee(attacker, attacked,
ref attack);
damage = (damage * 2);
damage = (damage / 2);
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
suse.AddTarget(attacked.UID, damage, attack);
}
}
else if (_obj.MapObjType == MapObjectType.Entity)
{
attacked = _obj as Entity;
if (CanAttack(attacker, attacked, spell,
attack.AttackType == Attack.Melee))
{
var damage = Game.Attacking.Calculate.Melee(attacker, attacked,
ref attack);
damage = (damage * 2);
damage = (damage / 2);
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
suse.AddTarget(attacked.UID, damage, attack);
}
}
else if (_obj.MapObjType == MapObjectType.SobNpc)
{
attackedsob = _obj as SobNpcSpawn;
if (CanAttack(attacker, attackedsob, spell))
{
var damage = Game.Attacking.Calculate.Melee(attacker,
attackedsob, ref attack);
//damage = (damage * spell.IncreaseDMG);
//damage = (damage / spell.DecreaseDMG);
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
suse.AddTarget(attackedsob.UID, damage, attack);
}
}
}
}
attacker.Owner.SendScreen(suse, true);
}
break;
}
#endregion
#region SeaBurial
case 14680:
{
PrepareSpell(spell, attacker.Owner);
attacker.AttackPacket = null;
// attacker.Stamina -= 10;
attacker.Stamina -= spell.UseStamina;
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.X = X;
suse.Y = Y;
if (attackedsob == null)
{
if (CanAttack(attacker, attacked, spell, false))
{
attack.Effect1 = Attack.AttackEffects1.None;
var damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack, client_Spell.LevelHu2);
damage = (damage * 11) / 100;
suse.Effect1 = attack.Effect1;
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
suse.AddTarget(attacked, damage, attack);
attacker.Owner.SendScreen(suse, true);
}
}
else
{
if (CanAttack(attacker, attackedsob, spell))
{
attack.Effect1 = Attack.AttackEffects1.None;
var damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
damage = (damage * 99) / 8;
suse.Effect1 = attack.Effect1;
}
if (CanAttack(attacker, attackedsob, spell))
{
attack.Effect1 = Attack.AttackEffects1.None;
uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
damage = (damage * 99) / 8;
suse.Effect1 = attack.Effect1;
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
suse.AddTarget(attackedsob, damage, attack);
attacker.Owner.SendScreen(suse, true);
}
}
break;
}
#endregion
|
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|