hey all small problem in whirlwind kick
the response of this skill required lots of time and some times it requires me to stop then click to and not work while jumping like tq all the skills works good but this not
this is my code
and if there any thread about how to code askill
the response of this skill required lots of time and some times it requires me to stop then click to and not work while jumping like tq all the skills works good but this not
this is my code
PHP Code:
//WhirlwindKick
case 10415:
{
if (Time32.Now < attacker.WhilrwindKick.AddMilliseconds(100))
{ attacker.AttackPacket = null; return; }
attacker.WhilrwindKick = Time32.Now;
if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 3)
{
if (CanUseSpell(spell, attacker.Owner))
{
PrepareSpell(spell, attacker.Owner);
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = 0;
suse.X = (ushort)ServerBase.Kernel.Random.Next(3, 10);
suse.Y = 0;
if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 3)
{
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 (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
{
if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Ranged))
{
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
damage = (damage * 112) / 100;
suse.Effect1 = attack.Effect1;
ReceiveAttack(attacker, attacked, attack, damage, spell);
attacked.Stunned = true;
attacked.StunStamp = Time32.Now;
suse.Targets.Add(attacked.UID, damage);
}
}
}
}
attacker.AttackPacket = null;
}
else
{
attacker.AttackPacket = null; return;
}
attacker.Owner.SendScreen(suse, true);
suse.Targets = new SafeDictionary<uint, SpellUse.DamageClass>();
attacker.AttackPacket = null; return;
}
attacker.AttackPacket = null;
}
attacker.AttackPacket = null; return;
}