I see you've grown from the last time I worked with you, good job *claps*
I will teach you how to add your own skills to the game as a reward for your dedication and hard work on this and your compiler thread!
you will need to pay extremely close attention to this,
animations are handled purely client sided sooooo you can ignore most the animation data in skill###.h unless you want the animations and have the client source and compiler in hand already.
first off! filters! oh yes filters! these are extremely valuable and are called from the server by the client and use the file in configs.pck/buff_icon.txt, Buff_str.txt and Buff_type.txt
Lets go over these files one at a time to explain what each of these does shall we?
Buff_icon.txt --> this calls the filter ID and then places a corresponding icon dds image to what it is, for example
Code:
4537 "任务_克莱蒙多无忧卡.dds"
This calls my custom filter 4537 and applies the Eryda VIP dds image to it
Buff_str.txt ---> This applies the same as Buff_icon.txt but uses it to display what it does for example
Code:
4537 "^9000ff^O057Reborn V.I.P.\r
^ff7502^O001Welcome, Warrior!\r
^ffffff^O001You have the following privileges:\r
[Upgrade] Enhanced Memory Berry consumption.\r
[Convenient Service] Town Portal cooldown reduced. Access to the VIP Shop.\r
[Gems] Increased speed and optimization of Gem Reforging.\r
[Exclusive Drop Rate] You Gain Double the Drops!\r
[Luck Visits] Able to receive Champion every day, as will as other benefits."
Buff_type.txt --> this one is arguably the most important, this tells the game what type of buff it is, 0 being a buff and 1 being a debuff
Now you want to add your own filters? they are pretty straight forward but with some complications, you MUST ADD them to wskill\filters\filters.h and filterstubb.cpp, you must assign the filters themselves a new filterID and internal server ID for the compiler to work
Now onto the Skills, this part is really difficult, i would get accustomed to all the basic skills in the game and their ID's before you go poking around in them, you could have some pretty serious consequences from modifying such. but when your ready to proceed lets go over a pretty simple skill!
Code:
#ifndef __CPPGEN_GNET_SKILL_1
#define __CPPGEN_GNET_SKILL_1
namespace GNET
{
#ifdef _SKILL_SERVER
class Skill1:public Skill
{
public:enum { SKILL_ID = 1 };
Skill1():Skill(SKILL_ID){}
};
#endif
class Skill1Stub:public SkillStub
{
public:
#ifdef _SKILL_SERVER
class State1:public SkillStub::State
{
public:
int GetTime(Skill * skill) const{return (int)(0);}
void Calculate(Skill * skill) const{skill->SetDamagetype(7);skill->SetToukonratio(0);skill->GetPlayer()->SetPerform(1);}};
all of this data here identifies the skill, the skill damage type, the Toukonratio which i think is wrath? idk its been a hot minute but this last part >SetPerform 1 is what enables it, if the skill says SetRatio this is the attack in multiplication, you can verify whether or not the code is doing its job by cross checking against script.pck/skill/skilldec##.lua with their ID from script\skill\skillstr.lua, those %.f%% is pulled directly from those lua files and the server acts on it, you can also modify cooldown times and mana and a whole mess of items in those lua files but the code MUST match in the server speaking of which!
lets talk about the next set of skill data
Code:
icon = "";
race = 1;
occupation = 1;
type = 1;
usetype = 1;
origintype = 3;
showtype = 1;
timetype = 2;
barshow = 1;
extraflag = 0;
movemode = 0;
maxlevel = 200;
autoattack = 0;
rangetype = 0;
doenchant = false;
dobless = false;
selfcondition = 0;
delaymode = 1;
targettype = 0;
delaytime = 0;
flyspeed = 0;
statecondition = 0;
exclusivestatecondition = 0;
monster = "";
othercondition = 0;
no_fight_mount_canuse = 0;
eventflag = 0;
passive_filter_id = 0;
I've highlighted the most basic parts which you need to pay attention to if you plan to race / class lock the skill, this all details what is what in terms of flags and such, most of this is reverse engineered if you can read C++ code fairly well
this next part is tricky
Code:
float GetMinPraydistance(Skill * skill) const{return (float)( 0);}
float GetMaxPraydistance(Skill * skill) const{return (float)( skill->GetRange()+2);}
float GetCastdistance(Skill* skill) const{return (float)(skill->GetRange());}
int GetExecutetime(Skill* skill) const{return (int)(0);}
for our purposes here i have highlighted the most important, GetMin and GetMaxPraydistance tells the server and client how far the skill can reach, GetExecutetime tells it how fast it can cast in milliseconds
additionally once you've become accustomed at this point, you will notice theres alot more in that section such as GetCooldowntime, you will need to be GOOD at math at this point otherwise you will run into severe problems such as giant unintended errors like Bash having a cooltime of 2 seconds or 20 minutes !
Now the Juicy Parts!
Code:
#ifdef _SKILL_SERVER
bool StateAttack(Skill* skill) const{
StateFilter646 *filter1 = new StateFilter646(skill->GetVictim()->GetObject(), 0);
if(filter1->GetStub(0)) filter1->GetStub(0)->SetData(5*skill->GetT1());
if(filter1->GetStub(1)) filter1->GetStub(1)->SetData(skill->GetT1()==5?0.01:0);
filter1->SetTimeParam((int)(20000));
filter1->SetSucceedParam((int)(skill->GetT1()==0?0:(50+20*skill->GetT3())));
skill->GetVictim()->AddFilter(filter1);
This is extremely dependant on what the FilterID and filter is doing, so if you want to apply a bleed then you must take a skill that already does this and go look at its filter and pay very close attention to what the filter is doing, the code thats already there will teach you everything you need to know about how it works and what its doing, this is how i originally patched the healbot and tons of other exploits when i ran with RebornFW
Additionally you will need to add the custom skills if you plan to make your own to the skillstub###.cpp in wskill\skills
I hope you and whoever you are working with values this knowledge as much as i do and make something great from this gift! Take Care and Have Fun!