Big + thanks to ntlefty for telling me the statuseffect.ini file =D
____________
So first, my favorite effect in the CO client already is "mass"... It looks sweet.
Its a blue kinda vortex around you, but its temporary, so I edited it to loop forever.
Next, the CO Client has a ton of unused skills, one I found is the XP Skill - Restore. It's skill ID is 1105, and it only has one level: 0/Fixed. We're going to make use of both for our coolio skill.
_______________
What it does here: Shows an effect around your character(using a good way, not spamming it)
Adds HP slowly over 50 seconds.
_________________
I tried to comment very well, so if you don't understand, ask questions.
Don't ask retarted questions though, such as "how to change hp rate?
I won't answer such questions, as it's not hard to do yourself.
________________
Reminder: I don't use LOTF, this hasn't been tested. Plx report bugs in a non-noobish way.
Ex: "um cant see efct plx help"
BEEEP! WRONG!
Ex: "My compiler is asking for a ';' here, do I need to add one?"
Ding Ding! Winner!
I will respond to these questions if I can.
_______________________________________
If you want to do it like me, start off by making it loop forever.
[Editin' 3deffect.ini]
So yeah, not that hard... open client\ini\3deffect.ini just in notepad.
ctrl + f(your handy search function!) and search for [mass].
This will lead you to where the client finds its data for the effect "mass".
All we're really concerned about is making it loop, so change the key of "LoopTime" to 99999999.(lol)
After that, the [mass] section should look like this....
Code:
[mass] Amount=2 EffectId0=2809 TextureId0=5819 ASB0=5 ADB0=6 EffectId1=2810 TextureId1=5820 ASB1=5 ADB1=6 Delay=0 LoopTime=99999999 FrameInterval=40 LoopInterval=0 OffsetX=0 OffsetY=0 OffsetZ=0
Now for teh fun part, that i just figured you could do today!
Okay, so if you know a little about CO, they have these thingz called statflags. Flags in programming are an easy way to get a lot of bools(i guess) into a value, because a bool really only needs one bit(1 or 0). The way LOTF handles it = pretty gay.... anyways............ I found a flag thats not in use(by me or LOTF that I know of), and changed it so it'll show our coolio little effect! Nice 'eh?
[Editin' statuseffect.ini]
This file contains statflags + effects to show with them...
Guess what, let's add a new one with our effect.
The file itself may seem weird, but bare with me here.
The first serious of numbers is the statflag(in HEXADECIMAL LEARN IT), and the next string is effect. Not sure what the last one is xD.
Anyways...
Find where it says...
Code:
00000200 attackup40 NULL
Code:
00000400 NULL NULL 00000800 NULL NULL
Code:
00001000 mass NULL
Easy!
Now, for easier reference for you n00ps, use MS calc to convert from hex/normal(dec). 0x1000(hex starts with 0x in most high level languages) in decimal or normal format would be 4096.
Now REMEMBER THIS!!!!
People will only be able to see the effect and stuff IF YOU SEND OUT A PATCH WITH THESE FILES IN IT. DONT ASK STUPID QUESTIONS K?
[Source part!]
Okay, so now we did the easy part.
The next part is easy too, just add some variables to the top of our character class(Character.cs).
Doesn't matter where up there, I did it here...
right under..
Code:
public bool Flying = false;
Code:
public bool Restoring = false;//our little bool for the restore flag. public DateTime RestoreTime = DateTime.Now;// a time for when restore started(like lotf does..)
Lets add our newest bool to the GetStat() in Character.cs
This serves as a way to get the total statflag from all the bools(Not a good way!! but meh..)
Search Character.cs for
Code:
public ulong GetStat()
add in the value...
Doesn't matter where as long as its in this method.
Code:
if (BlueName)
it++;
[b]
if (Restoring)
it += 4096;
[/b]
if (TeamLeader)
it += 64;
if (Poisoned)
it += 2;
[Adding the skill to the database!]
Well, LOTF loads skills gayly(as usual)...
But here you go...
In Database.cs
search for
Code:
public static void DefineSkills()
Code:
//1105 is skill ID. 0 is highest level
SkillAttributes[1105] = new ushort[1][];//LOTF has this ushort[][][] for skills.
//your putting the ushort[][] SkillAttributes[1105] and initializing it as a "new ushort[1][]
SkillAttributes[1105][0] = new ushort[6] { 7, 0, 0, 0, 0, 0 };
//now you're setting the first item in the array to a new ushort[] with 6 values, which are then listed beside it(7...)
//Each value represents stuff in certain skills, but since restore is self cast, you dont need much info...
//the 7 refers to the SkillType i'll use later in the UseSkill() function in Character.cs
SkillsDone.Add(1105, 0);// Finally, add it to the hashtable of all the skills done, so the server knows that this skill has been done, and will process it if a client uses that skill.
[Actually doing the skill in Character.UseSkill()]
Okay, well once the server receives a packet, it calls this method for the character to use a skill.
It's broken down into several #region's depending on skill type(that 7! remember the lucky 7!).
In this case, we'll be dealing with skill type 7, which is all those XPskills/self buffs(Fly, SM, Cyclone, etc).
To get here(if you cant find it >.>) search character.cs for..
Code:
public void UseSkill(ushort SkillId, ushort X, ushort Y, uint TargID)
Make your way to #region SkillAttributes7 (LUCKY 7!)
or look for skills until you find 8003/fly and 1025/SM, you'll know you're there.
Right under accuracy I added my skill usage.
find
Code:
if (SkillId == 1015)
{
XpList = false;
AccuracyOn = true;
AccuracyActivated = DateTime.Now;
MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
MyClient.SendPacket(General.MyPackets.SendMsg(MyClient.MessageId, "SYSTEM", Name, "Accuracy XP: Your accuracy wil be increased for 200 seconds.", 2005));
}
Code:
if (SkillId == 1105)
{
XpList = false;//turn off xp list
XpCircle = 0;//reset xp counter
Restoring = true;//turn on the restore flag we added, so the server keeps adding HP + the c00l effect.
RestoreTime = DateTime.Now;//So the server will know when to remove the restore.
MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));//Send the update to the client, so it starts the effect we added.
World.UpdateSpawn(this);//send the update to everyone else
}
Moving on....
[Adding the actual skill part(what it does!)]
So we all know(well...) that LOTF has a timer for characters, and most of this stuff justs loops on the timer(not a good idea but... as i said before.. `Meh.`)
To find the timer elapsed method, it's easiest to search around in Character.cs for if (StigBuff)
And find where it actually removes stig.
That code is like this...
Code:
if (StigBuff)
if (DateTime.Now > Stigged.AddSeconds(20 + StigLevel * 5))
{
StigBuff = false;
MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
World.UpdateSpawn(this);
}
Code:
if (Restoring)//If this person has the restore flag on...
{
if (CurHP < MaxHP)//Dont want to update if they have more than full HP, thats gay.
{
CurHP += (ushort)(MaxHP / 15);//Obvious, add their MaxHP divided by 15... change this if you like.
if (CurHP > MaxHP)
CurHP = MaxHP;//So the HP isn't higher than max, that'd be gay also.
MyClient.SendPacket(General.MyPackets.Vital(UID, 0, CurHP));//Send the packet so the client updates health.
}
if (DateTime.Now > RestoreTime.AddSeconds(50))//If they've been restoring for more than 50 seconds
{
Restoring = false; //Remove the flag for restoring(The effect + Adding HP)
MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));//Send the statflag packet
World.UpdateSpawn(this);//update the character with new flag.
}
}
_______________
I believe that's all, someone test and get back to me.
I hope that doing this super in depth guide will give people some insight...
This goes out to Incariuz mainly for being cool
_______________
I HAVE NOT TESTED THIS, DONT COMPLAIN, ILL FIX IT IF I MESSED UP.






