Code:
case 0x288d:
if (CanUseSpell(spell, this.attacker.Owner))
{
ushort num29;
ushort num30;
if (attacker != null)
{
num29 = attacker.X;
num30 = attacker.Y;
}
else
{
num29 = sob.X;
num30 = sob.Y;
}
if (Kernel.GetDistance(this.attacker.X, this.attacker.Y, num29, num30) <= spell.Range)
{
if (((sob == null) && attacker.ContainsFlag(0x8000000L)) || this.attacker.ContainsFlag(0x8000000L))
{
return;
}
PrepareSpell(spell, this.attacker.Owner);
use = new SpellUse(true)
{
Attacker = this.attacker.UID,
SpellID = spell.ID,
SpellLevel = spell.Level,
X = x,
Y = y
};
bool flag8 = false;
if (sob == null)
{
if (CanAttack(this.attacker, attacker, spell, this.attack.AttackType == 2))
{
this.attack.Effect1 = Attack.AttackEffects1.None;
power = Calculate.Melee(this.attacker, attacker, spell, ref this.attack);
power = (power * 100) / 100;
use.Effect1 = this.attack.Effect1;
ReceiveAttack(this.attacker, attacker, this.attack, power, spell);
use.Targets.Add(attacker.UID, power);
flag8 = true;
}
}
else if (CanAttack(this.attacker, sob, spell))
{
this.attack.Effect1 = Attack.AttackEffects1.None;
power = (uint)(Calculate.Melee(this.attacker, sob, ref this.attack) * spell.PowerPercent);
ReceiveAttack(this.attacker, sob, this.attack, power, spell);
use.Effect1 = this.attack.Effect1;
use.Targets.Add(sob.UID, power);
flag8 = true;
}
if (flag8)
{
this.attacker.Owner.SendScreen(use, true);
}
}
else
{
this.attacker.AttackPacket = null;
}
}
goto Label_C19A;
to my source
Code:
//Radiant Palm
case 10381:
// case 10315:
{
if (CanUseSpell(spell, attacker.Owner))
{
PrepareSpell(spell, attacker.Owner);
Game.Attacking.InLineAlgorithm ila = new Conquer_Online_Server.Game.Attacking.InLineAlgorithm(attacker.X,
X, attacker.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = SpellID;
suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
suse.X = X;
suse.Y = Y;
for (int c = 0; c < attacker.Owner.Screen.Objects.Length; c++)
{
//For a multi threaded application, while we go through the collection
//the collection might change. We will make sure that we wont go off
//the limits with a check.
if (c >= attacker.Owner.Screen.Objects.Length)
break;
Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
if (_obj == null)
continue;
if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
{
attacked = _obj as Entity;
if (ila.InLine(attacked.X, attacked.Y))
{
if (!CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
continue;
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell);
attack.Damage = damage;
// damage = ReceiveAttack(attacker, attacked, attack, damage, spell);
ReceiveAttack( attacker, attacked, attack, damage, spell);
suse.Targets.Add(attacked.UID, damage);
}
}
else if (_obj.MapObjType == MapObjectType.SobNpc)
{
attackedsob = _obj as SobNpcSpawn;
if (ila.InLine(attackedsob.X, attackedsob.Y))
{
if (!CanAttack(attacker, attackedsob, spell))
continue;
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
damage = (uint)(damage * spell.PowerPercent);
attack.Damage = damage;
ReceiveAttack( attacker, attackedsob, attack, damage, spell);
suse.Targets.Add(attackedsob.UID, damage);
}
}
}
attacker.Owner.SendScreen(suse, true);
}
attacker.AttackPacket = null;
break;
}






