After careful testing, I've determined the what causes the error to occur. I just haven't the slightest clue how to fix it.
Action that causes the error:
Quote:
Attempting to attack with Spear while using Skill Speedgun
Problem (in-game):
Quote:
When the player uses spear, the attack is fine. When the add the skill SpeedGun, they can no longer attack the monster, and the server throws the error below:
Error:
Code:
System.NullReferenceException: Object reference not set to an instance of an object.
at COServer_Project.Character.WeaponSkill() in C:Conquer BeyondCOBeyond SourceCharacter.cs:line 2849
at COServer_Project.Character.Attack() in C:Conquer BeyondCOBeyond SourceCharacter.cs:line 3250
Character.cs Statement 1:
Code:
else if (WepType == 560 && !Use)
{
if (TargetUID != 0)
if (Skills.Contains((short)1260))
{
byte SkillLvl = (byte)Skills[(short)1260];
byte Chance = (byte)DataBase.SkillAttributes[(int)1260][(int)SkillLvl][5];
if (Other.ChanceSuccess(Chance))
{
UseSkill(1260, 0, 0, TargetUID);
Use = true;
}
}
}
Line 2849:
Code:
if (Skills.Contains((short)1260))
Character.cs Statement 2:
Code:
public void Attack()
{
LastAttack = DateTime.Now;
if (!Alive)
{
MobTarget = null;
SkillLoopingTarget = 0;
TGTarget = null;
PTarget = null;
return;
}
Ready = false;
try
{
if (AtkType == 25 || AtkType == 2)
{
if (!WeaponSkill())
{
if (MobTarget != null)
{
if (MobTarget.Alive)
if (MobTarget.Map == LocMap)
if (MyMath.PointDistance(LocX, LocY, MobTarget.PosX, MobTarget.PosY) < 6 || AtkType == 25)
{
if (!SMOn && !AccuracyOn)
{
if (!Other.ChanceSuccess(RealAgi / 2 + Math.Abs((110 - Level) / 2)))
{
MissAttack(MobTarget);
return;
}
}
else if (SMOn)
{
if (!Other.ChanceSuccess(RealAgi + Math.Abs((110 - Level) / 2)))
{
MissAttack(MobTarget);
return;
}
}
else
{
if (!Other.ChanceSuccess(RealAgi * 1.2 + Math.Abs((110 - Level) / 2)))
{
MissAttack(MobTarget);
return;
}
}
Line 3250:
Code:
if (!WeaponSkill())
This is the only weapon skill I've had any errors with. All others were tested and proved working.
I thought about that, but if that was it, then why do all the other weapon skills work. I used the same code for all of them.
You don't understand, the variable IS null. Otherwise you wouldn't be getting that error. I will look at it in a minute... Are you sure that 1260 is the speedgun ID?
You don't understand, the variable IS null. Otherwise you wouldn't be getting that error. I will look at it in a minute... Are you sure that 1260 is the speedgun ID?
Yep 1260 is the speedgun id
i have a list of pretty much all
if u go a bit down in tht guide ull see all skills well allmost all
lol, i know it has to be coded in the database.cs.... and it is. here is my issue, the coding is the exact same for EVERY 2-handed weapon skill. all other skills work besides this ONE. Any more ideas?
Just out of curiosity, what was the problem, and how did you solve it?(Just incase I run into this later =o)
When I was writing the Database.cs file, I was quickly copying and pasting the codes I was using for the other weapon skills. I just forgot to change the last code to 1260(the skill id for the spear.)
Quote:
U have to code it too in the DataBase.cs!
Thanks goes to YukiXian for pointing out the Database.cs and to Kinshi who help me out the most with this error.
When I was writing the Database.cs file, I was quickly copying and pasting the codes I was using for the other weapon skills. I just forgot to change the last code to 1260(the skill id for the spear.)
Thanks goes to YukiXian for pointing out the Database.cs and to Kinshi who help me out the most with this error.
Weapon Skill Bug, Help me!! 06/21/2009 - CO2 Private Server - 1 Replies On my binary 5065 server i was changing percent rates of magictype and logged on things worked fine but i noticed that if you buy a skill such as rage u can learn it before u have ur weapon skill to the requirement. Then when you go to attack with the weapon it uses the skill every single time and people cant level tehre weapon prof. What could be the problem. If you know more information please reply back.
All weapon skill up! 12/29/2008 - WoW Exploits, Hacks, Tools & Macros - 14 Replies Scourge Event, Argent Dawn is everywhere.
The Argent Dawn NPCs are level 10. As Level 70 youll get them down very quick. But wait - they wont die! And since theyre doing Level 10 damage you can easily bringt up your weapon skills.
Alliance:
Look for Lieutenant Orrin. Open your reputation tab, look for Argent Dawn and check "At war".
Low Lvl EZ Weapon Skill Ups 02/03/2007 - WoW Exploits, Hacks, Tools & Macros - 2 Replies There is a nice mob in eversong woods (just south of silvermoon city) for when you need to lvl up a new weapon, like when you're lvl 20. Useful for BE paladins especially for when you get your new polearm. Basically, it's a lvl 6 Plaguebone Pillager that has an instant respawn. You just stand in one spot and repeatedly right click until your weapon is at the skill lvl you want. He wanders so you might have to kill a few to figure out which one it is, but his respawn point is 50,57 in the middle...