[PHP] #region WhirlwindKick case 10415: { if (Time32.Now < attacker.SpellStamp.AddMilliseconds(500)) { attacker.AttackPacket = null; return; } if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 400) { 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)Kernel.Random.Next(3, 10); suse.Y = 0; //suse.SpellLevelHu = client_Spell.LevelHu2; if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 500) { 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.Entity) { attacked = _obj as Entity; if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range) { if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Ranged)) { var damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack); damage = (uint)(damage * 0.570); suse.Effect1 = attack.Effect1; ReceiveAttack(attacker, attacked, attack, ref damage, spell); attacked.Stunned = true; attacked.StunStamp = Time32.Now; suse.AddTarget(attacked, damage, attack); } } } } attacker.AttackPacket = null; } else { attacker.AttackPacket = null; return; } attacker.Owner.SendScreen(suse, true); attacker.SpellStamp = Time32.Now; suse.Targets = new SafeDictionary<uint, SpellUse.DamageClass>(); attacker.AttackPacket = null; return; } attacker.AttackPacket = null; } attacker.AttackPacket = null; return; } #endregion #endregion