Needs modification if not used for instant 80 servers
Index
======
1.Finding code to edit
2.Editing/Adding
3.Explanation
4.Conclusion
======
1.Finding code to edit
If we open the player.cpp located in the src/arcemu_world directory in an editor and find
the method _AddSkillLine which is defined by :
Code:
void Player::_AddSkillLine(uint32 SkillLine, uint32 Curr_sk, uint32 Max_sk)
we see that below this there is:
Code:
Curr_sk = (Curr_sk > 450 ? 450 : (Curr_sk < 1 ? 1 : Curr_sk));
This is basically the code we need to edit. The rest we'll be adding.
======
2.Editing/Adding code
Case 1:
change this:
Code:
Curr_sk = (Curr_sk > 450 ? 450 : (Curr_sk < 1 ? 1 : Curr_sk));
to this:
Code:
Curr_sk = (Curr_sk > 450 ? 450 : (Curr_sk < 450 ? 450 : Curr_sk));
Case 2:
change this at the end of _AddSkillLine method
Code:
_LearnSkillSpells(SkillLine, Curr_sk);
// Displaying bug fix
_UpdateSkillFields();
and adding this to it:
Code:
_LearnSkillSpells(SkillLine, Curr_sk);
_AdvanceAllSkills(450);
// Displaying bug fix
_UpdateSkillFields()
Case 3:
change this again
Code:
_LearnSkillSpells(SkillLine, Curr_sk);
// Displaying bug fix
_UpdateSkillFields();
to this:
Code:
_LearnSkillSpells(SkillLine, Curr_sk);
for(SkillMap::iterator itr = m_skills.begin(); itr != m_skills.end(); ++itr)
{
if(itr->second.Skill->type == SKILL_TYPE_WEAPON || itr->second.Skill->id == SKILL_LOCKPICKING)
{
_AdvanceSkillLine(itr->second.Skill->id,399);
}
}
// Displaying bug fix
_UpdateSkillFields();
======
3.Explanation
case 1:
Code:
(Curr_sk < 450 ? 450 : Curr_sk)
This basically translates to everytime we add a new skill line the method _AddSkillLine will be invoked hence
when reading the code above if the variable Curr_sk is less than 450 then it will set it to 450. Afterwards towards
the end of the method _LearnSkillSpells(SkillLine, Curr_sk); gets invoked and it passes the skill level it will be tought at.
case 2:
Code:
_AdvanceAllSkills(450);
Whilst the first case determines at how many skillpoints the skills will be learn't upon creation, this waits for the skills to be
created and then advances them from the value of 1.
case 3:
Code:
for(SkillMap::iterator itr = m_skills.begin(); itr != m_skills.end(); ++itr)
{
if(itr->second.Skill->type == SKILL_TYPE_WEAPON || itr->second.Skill->id == SKILL_LOCKPICKING)
{
_AdvanceSkillLine(itr->second.Skill->id,399);
}
}
Now for this...It is much more specific and probably the easiest way, rather than having to idividually create an array with the skill ids from skill.h file.
This will only increase the weapon skills and (special case) lockpicking.
The for loop is pretty straight forward, the if statement, as itr increments and scans the skills, for every skill the type via pointer is compared to the
bool SKILL_TYPE_WEAPON which makes life easier as the only starting skill ID we need to manually check is lockpicking done in the second
part of the if statement.
Then we simply advance the skill by retrieving the id into the skillLine argument of _AdvanceSkillLine and add the number of skill points we
want to add to that skill.
======
4.Conclusion
If you do not care about professions then you can use case 1 and 2 because once learning the profession it will be increased to skill 75 upon learning the first rank but then it will not increase again on the second rank.
All weapon skills will be increased to 400.
If you do care about professions then use case 3 because it will preserve the professions to 1 skill level.
Also remember with professions and skills that you learn that can be upgraded to a different maximum skill point level you the maximum skill points will
only be given once this is why it works with instant 80 servers or static maximum skill value.
One more thing, in case 3 you may ask why I insert value 399, because we see that this
Code:
max = 5 * getLevel();
sets the weapon skill max to 5*80 so 400, after we created the spell it is 1 out of 400 so we need 399 increments
I made this for instant 80 servers, modifications can be made in player.cpp to easily fix professions etc or for different situations.
Anyway, thanks for reading bb