A generic skill can be created and other races utilize it with possible custom parameters which is dependent on the generic skill implementation
for example, the evasion skill will accept an array of 5 floats to define its chances per level
SEE SVN DIFF
http://goo.gl/M0emY
the generic evasion skill is implemented in rainbow dash, but night elf uses it
first the generic skill is created
then each race designates a skill to use that generic skill. the race gets skillID to itself as usual, but the generic skill does all the work.
the generic skill will do all the level checking. The race engine searches for the skill level the player currently has, and redirects that level to the generic skill level amount.
WAY too ****ing easy
Code:
new Float:EvadeChance[5]={0.0,0.05,0.10,0.15,0.20};
new evasiondata=CreateArray(5,1);
SetArrayArray(evasiondata,0,EvadeChance,sizeof(EvadeChance));
SKILL_EVADE=War3_UseGenericSkill(thisRaceID,"g_evasion",evasiondata,"Evasion",_,true,_,_);
and your done, the generic skill does ALL the precautions and checks (immunity, hex) for you.new evasiondata=CreateArray(5,1);
SetArrayArray(evasiondata,0,EvadeChance,sizeof(EvadeChance));
SKILL_EVADE=War3_UseGenericSkill(thisRaceID,"g_evasion",evasiondata,"Evasion",_,true,_,_);
*Disclaimer: if you create copycat races out of greed to earn money, i will hunt you down
Credits to Necavi and his WCX engines, which will be possibly converted to generic skills
Credits to Glider for <insert something here>.






Logged
DarkEnergy






