Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case 6001:
- {
- 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;
- suse.X = X;
- suse.Y = Y;
- //suse.SpellLevelHu = client_Spell.LevelHu2;
- if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Distance)
- {
- foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
- {
- if (_obj.MapObjType == MapObjectType.Player)
- {
- attacked = _obj as Entity;
- if (attacked.MapObjType == MapObjectType.Monster)
- if (attacked.MonsterInfo.Boss)
- continue;
- if (Kernel.GetDistance(X, Y, attacked.X, attacked.Y) <= spell.Range)
- {
- if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
- {
- int potDifference = attacker.BattlePower - attacked.BattlePower;
- int rate = spell.Percent + potDifference - 20;
- if (Kernel.Rate(rate))
- {
- attacked.ToxicFogStamp = Time32.Now;
- attacked.ToxicFogLeft = 20;
- attacked.ToxicFogPercent = spell.PowerPercent;
- attacked.AddFlag(Update.Flags.Poisoned);
- suse.AddTarget(attacked, 1, null);
- }
- else
- {
- suse.AddTarget(attacked, 0, null);
- suse.Targets[attacked.UID].Hit = false;
- }
- }
- }
- }
- }
- }
- else
- {
- attacker.AttackPacket = null;
- }
- attacker.Owner.SendScreen(suse, true);
- }
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment