[Release]Fixed SS/FB System

02/01/2010 09:57 ramix#16
Quote:
foreach (Character C in World.H_Chars.Values)
{
if (C.Alive && (C != User || Info.Damageing == DamageType.HealHP || Info.Damageing == DamageType.HealMP))
{
if ((!RangeFromChar && MyMath.PointDistance(AimX, AimY, C.Loc.X, C.Loc.Y) <= Info.MaxDist) || MyMath.PointDistance(User.Loc.X, User.Loc.Y, C.Loc.X, C.Loc.Y) <= Info.MaxDist)
if (Info.Targetting == TargetType.Sector && InSector(C.Loc.X, C.Loc.Y) || Info.Targetting != TargetType.Sector)
if (Info.Targetting == TargetType.Linear && Line.Contains(new coords(C.Loc.X, C.Loc.Y)) || Info.Targetting != TargetType.Linear)
if (C.PKAble(User.PKMode, User) && !PlayerTargets.Contains(C) && !World.NoPKMaps.Contains(User.Loc.Map) || Info.ExtraEff == ExtraEffect.UnMount)
if (Game.World.NoPKMaps.Contains(User.Loc.Map) && GetDamage(C) == 0 || !Game.World.NoPKMaps.Contains(User.Loc.Map) || (Info.ExtraEff == ExtraEffect.UnMount && C.StatEff.Contains(StatusEffectEn.Ride)) && C.Equips.Steed.Plus < User.Equips.Steed.Plus)
if (true)
PlayerTargets.Add(C, GetDamage(C));
}
}

give me erro that :S
02/01/2010 10:01 walmartboi#17
Quote:
Originally Posted by ramix View Post
give me erro that :S
You need to add the definition of "Line". Look at the other adds to figure out what to do, it's fairly simple.
02/01/2010 10:09 ramix#18
ya loool xD i fixed that
02/01/2010 10:46 WHITELIONX#19
I have the same problem as Ramix but I have no idea on adding a definition >.< I also have the Add takes 2 arguments problem also and yes I moved it from under to over and it got rid of most the problems now I just have the four errors definition problem and three Add takes 2 arguments problem please help lol.

[edit] In my source it is not "public static class mymath" it is just "public class mymath" and if I change it to "public static class mymath" then I only get the one error and that error is "the name line does not exist in the current context"
02/01/2010 11:42 ramix#20
Quote:
List<coords> Line = new List<coords>(5);
if (Info.Targetting == TargetType.Linear)
Line = MyMath.LineCoords(User.Loc.X, User.Loc.Y, AimX, AimY, 10);
foreach (Character C in World.H_Chars.Values)
{
if (C.Alive && (C != User || Info.Damageing == DamageType.HealHP || Info.Damageing == DamageType.HealMP))
{
if ((!RangeFromChar && MyMath.PointDistance(AimX, AimY, C.Loc.X, C.Loc.Y) <= Info.MaxDist) || MyMath.PointDistance(User.Loc.X, User.Loc.Y, C.Loc.X, C.Loc.Y) <= Info.MaxDist)
if (Info.Targetting == TargetType.Sector && InSector(C.Loc.X, C.Loc.Y) || Info.Targetting != TargetType.Sector)
if (Info.Targetting == TargetType.Linear && Line.Contains(new coords(C.Loc.X, C.Loc.Y)) || Info.Targetting != TargetType.Linear)
if (C.PKAble(User.PKMode, User) && !PlayerTargets.Contains(C) && !World.NoPKMaps.Contains(User.Loc.Map) || Info.ExtraEff == ExtraEffect.UnMount)
if (Game.World.NoPKMaps.Contains(User.Loc.Map) && GetDamage(C) == 0 || !Game.World.NoPKMaps.Contains(User.Loc.Map) || (Info.ExtraEff == ExtraEffect.UnMount && C.StatEff.Contains(StatusEffectEn.Ride)) && C.Equips.Steed.Plus < User.Equips.Steed.Plus)
if (true)
PlayerTargets.Add(C, GetDamage(C));
}
}

you only need added this in "foreach (Character C in World.H_Chars.Values)"


why in server my friend i cant atack with 2 swords and ss :S ????
02/01/2010 12:35 WHITELIONX#21
Thank you ramix :D It sorted the problem out hehe
02/01/2010 13:19 walmartboi#22
This alorithm is actually quite buggy, the original one kind of beats it if you ask me.
02/01/2010 16:11 glover#23
Great job, good algoritm for line, it's really work a lot better from orginal crap fb/ss.
02/01/2010 16:14 w.maatman#24
Quote:
Originally Posted by WHITELIONX View Post
I have the same problem as Ramix but I have no idea on adding a definition >.< I also have the Add takes 2 arguments problem also and yes I moved it from under to over and it got rid of most the problems now I just have the four errors definition problem and three Add takes 2 arguments problem please help lol.

[edit] In my source it is not "public static class mymath" it is just "public class mymath" and if I change it to "public static class mymath" then I only get the one error and that error is "the name line does not exist in the current context"
same problem as you, only it seems like u fixed it while i cant :P


Edit: Could u not just upload ur mymath.cs file :P
02/01/2010 18:10 _tao4229_#25
You have to mark the class as static to make extensions inside of it.
02/01/2010 18:18 ASSN9NE#26
only problem i get after making
Code:
    public class MyMath
into
Code:
    public static class MyMath
i get this error
[Only registered and activated users can see links. Click Here To Register...]
02/01/2010 18:38 ASSN9NE#27
well i figured out my own prob for the ones that cant figure it out try the following

search for:

Code:
                    else if (Info.Targetting != TargetType.Sector && Info.Targetting != TargetType.Linear && Info.Targetting != TargetType.Range && Info.Targetting != TargetType.FromPoint)
then in this area:

Code:
                    }
                    else
                        RangeFromChar = false;
                    foreach (Character C in World.H_Chars.Values)
                    {
your gonna add:

Code:
                    List<coords> Line = new List<coords>(5);
so it looks like this:

Code:
                    }
                    else
                        RangeFromChar = false;
                    List<coords> Line = new List<coords>(5);
                    foreach (Character C in World.H_Chars.Values)
                    {
that should fix your Line error
02/01/2010 20:06 ASSN9NE#28
ok i changed MyMath 2 this public static class MyMath and did the List<coords> steps then
fb/ss works fine against guards,monsters & tg steaks but if i go and pvp fb/ss dont work player Vs player
02/01/2010 20:09 glover#29
hmmm. try to add MyMath.coords if you bad added function coords into mymath.cs :P
02/02/2010 00:29 WHITELIONX#30
I tested SS in TG and only hit one scarecrow but to be honest I would rather only hit the one scarecrow compared to hitting four lol