ok so i got kinda bored and decided to make a guide on how to add wep. skills into your server.
ok so lets begin, FIRST OF ALL, THIS GUIDE WAS! AND I MEAN WAS MADE BY ME, AND ONLY ME! do not copy plx O.O ty.
ok so....first of all the files that we'll need
1. the list of the skills (In powersource, you will find a txt file called "Commands" you go all of the skill lists there)
2. COItems.txt which can be found in powersource debug folder.
aww btw you'll need brains to...not a lot but u'll need some.
ok so....i'm going to use spear as an example
1.Open C# and open Character.cs and Database.cs (In powersource you need to open the external database, but i dun wanna explain how to do that)
2.in character.cs look for
Code:
int WepType = Other.WeaponType(uint.Parse(Splitter[0]));
3.You will see a the following code
Code:
if(WepType == 480)
{
if (Skills.Contains((short)7020)){byte SkillLvl = (byte)Skills[(short)7020];
byte Chance = (byte)ExternalDatabase.SkillAttributes[(int)7020][(int)SkillLvl][5];
if (Other.ChanceSuccess(Chance))
{
UseSkill(7020, 0, 0, 0);
Use = true;
}
}
}
Copy the code and paste it after the last "}"
4.Where you see
Code:
if (WepType == 480)
edit the "480" to the spear weptype which is the 3 first numbers of any weapon in "COItems.txt" which in this case is "560" then it should look something like that
Code:
if (WepType == 560)
5.Where you see "7020" in the code, you edit it to the skill number you want the spear to be using, which in this case its speed gun "1260".
6.When your done the code should look something like that
Code:
else if (WepType == 560)
{
if (Skills.Contains((short)1260))
{
byte SkillLvl = (byte)Skills[(short)1260];
byte Chance = (byte)ExternalDatabase.SkillAttributes[(int)1260][(int)SkillLvl][5];
if (Other.ChanceSuccess(Chance))
{
UseSkill(1260, 0, 0, 0);
Use = true;
}
}
}
7.Copy the code, and search for
Code:
else if (WepType == 490 && !Use)
then after the code, paste the code that we just copied and add "&& !Use" to "(WepType == 560)" so it will look like that
Code:
(WepType == 560 && !Use)
so you the code should look like that
Code:
else if (WepType == 560 && !Use)
{
if (Skills.Contains((short)1260))
{
byte SkillLvl = (byte)Skills[(short)1260];
byte Chance = (byte)ExternalDatabase.SkillAttributes[(int)1260][(int)SkillLvl][5];
if (Other.ChanceSuccess(Chance))
{
UseSkill(1260, 0, 0, 0);
Use = true;
}
}
}
so you should have 2 codes, now to the kind of annoying part
1.go to Database.cs and search for
Code:
public static void DefineSkills()
2.you will see that
Code:
SkillAttributes[7020] = new ushort[10][];[7020]
3.Copy the whole code, and paste it after that.
4.A lil leason what each of the things in
Code:
SkillAttributes[7020][0] = new ushort[6] { 0, 2, 0, **** 0, 20 };
mean.
The first 0, is skill type
Then the 2, is the range
The next 0, is sector
The **** is Heal or in this case the Damage, depends on the skill type you use
The next 0, Mana Cost/Or stamina which in this case, none of them so its 0
And the last one the 20, is the activationn Chance
There are 12 Types, here they are :
RangeSkillMelee = 0,
RangeSkillRanged = 1,
SingleTargetSkillMagic = 2,
TargetRangeSkillMagic = 3,
DirectSkillMelee = 4,
RangeSectorSkillRanged = 5,
SingleTargetSkillMagicHeal = 6,
SelfUseSkill = 7,
BuffSkill = 8,
RangeSkillHeal = 11,
SingleTargetSkillMelee = 12,
SingleTargetSkillRanged = 13
5.Now lets get back to the guide, edit all of the "7020's" to the skill that we just got for the spear, which is "1290"
Debug it all, and it should work, enjoy and hope it helped any one
