[Help] 5165 Profiency/Skill/Attack Bug(s).

10/19/2010 04:54 killersub#1
alright so I've been quickly modifying this source for a few days now. YES, it's 5165. but I've had a few problems wit it lately. to make the long story short, I attack mobs and my profiency does not increase like it's supposed to (not even to level 1) and also, my skills wont appear once I do the command ( idk wat dat has to do with anything but I guess it's a bug?).

Profiencies Bug:

I get this error:

Quote:
System.NullReferenceException: Object not set to an instance of an object
here are the voids I get the errors in ( errors marked in red ):

Code:
public void AddProfExp(ushort Wep, uint Amount)
        {
            [COLOR="DarkRed"]if (Profs.Contains(Wep))[/COLOR]
            {
                Prof P = (Prof)Profs[Wep];
                if (P.Lvl < 20)
                {
                    Profs.Remove(Wep);
                    Amount *= World.Server.ProfExpRate;
                    P.Exp += Amount;
                    if (P.Exp >= Database.ProfExp[P.Lvl])
                    {
                        P.Lvl++;
                        P.Exp = 0;
                        MyClient.LocalMessage(2000, System.Drawing.Color.Yellow, "Your proficiency level has gone up!.");
                        Database.SaveProfs(P, this);
                    }
                    Profs.Add(Wep, P);
                    MyClient.AddSend(Packets.Prof(P));
                }
            }
            else
            {
                Prof P = new Prof();
                P.ID = Wep;
                P.Lvl = 0;
                P.Exp = 0;
                NewProf(P);
            }
        }
Code:
Attacker.IncreaseExp(MaxHP / 10, false);
                    if (!IsSkill)
                    {
                        if (AT == AttackType.Ranged || AT == AttackType.Melee || AT == AttackType.FatalStrike)
                        {
                            if (Attacker.Equips.RightHand.ID != 0)
                                [COLOR="#8b0000"]Attacker.AddProfExp((ushort)Game.ItemIDManipulation.Part(Attacker.Equips.RightHand.ID, 0, 3), Benefit);
            [/COLOR]                if (Attacker.Equips.LeftHand.ID != 0)
                                Attacker.AddProfExp((ushort)Game.ItemIDManipulation.Part(Attacker.Equips.LeftHand.ID, 0, 3), Benefit / 3 * 2);
                        }
                    }
Code:
if (PossMob != null && PossMob.Alive && (MyMath.PointDistance(GC.MyChar.Loc.X, GC.MyChar.Loc.Y, PossMob.Loc.X, PossMob.Loc.Y) <= 3 || AttackType == 28 && MyMath.PointDistance(GC.MyChar.Loc.X, GC.MyChar.Loc.Y, PossMob.Loc.X, PossMob.Loc.Y) <= 15 || GC.MyChar.StatEff.Contains(Game.StatusEffectEn.FatalStrike)))
                                {
                                    if (!GC.MyChar.WeaponSkill(PossMob.Loc.X, PossMob.Loc.Y, PossMob.EntityID))
                                        [COLOR="#8b0000"]PossMob.TakeAttack(GC.MyChar, ref Damage, (Game.AttackType)AttackType, false);[/COLOR]
                                }
any ideas out of that lol?
10/19/2010 10:34 ryuchetval#2
You set Profs to null somewhere...
10/19/2010 22:02 killersub#3
Quote:
Originally Posted by ryuchetval View Post
You set Profs to null somewhere...
last time I checked my profiencies were alright.

mind telling me where I set it to null at?