Ramirow
Veteran OT User
- Joined
- Aug 22, 2009
- Messages
- 584
- Solutions
- 15
- Reaction score
- 301
- Location
- Argentina
- YouTube
- ramirogrant
This goes hand to hand with my other thread Feature - [TFS 1.3] Adding New Skills (https://otland.net/threads/tfs-1-3-adding-new-skills.265784/)
In order to display an additional skill you code into the sources, you must edit the following files:
(I will use the same example as my other thread, "Runecraft")
src/client/const.h
src/client/protocolgameparse.cpp
That's enough for source edits, compile it and it's half way done.
Next, we need to modify some otc modules.
modules/gamelib/const.lua
modules/game_skills/skills.otui
modules/game_skills/skills.lua
That should be enough. Hope it helps someone.
In order to display an additional skill you code into the sources, you must edit the following files:
(I will use the same example as my other thread, "Runecraft")
src/client/const.h
Search for:
enum Skill {
. Under the Fishing,
line just add: Runecraft,
src/client/protocolgameparse.cpp
Search for:
Next look for
int lastSkill = Otc::Fishing + 1;
and replace it with int lastSkill = Otc::Runecraft + 1;
Next look for
if(skill <= Otc::Fishing)
and change to if(skill <= Otc::Runecraft)
That's enough for source edits, compile it and it's half way done.
Next, we need to modify some otc modules.
modules/gamelib/const.lua
Look for line
Edit that table until it has the correct ids. Example.
Skill = {
Edit that table until it has the correct ids. Example.
Code:
Skill = {
Fist = 0,
Club = 1,
Sword = 2,
Axe = 3,
Distance = 4,
Shielding = 5,
Fishing = 6,
Runecraft = 7,
CriticalChance = 8,
CriticalDamage = 9,
LifeLeechChance = 10,
LifeLeechAmount = 11,
ManaLeechChance = 12,
ManaLeechAmount = 13
}
modules/game_skills/skills.otui
Search for
Under it paste
Remember to give a +1 to the id of skills below (Critical hit chance, manaleech, etc)
Code:
SkillButton
id: skillId6
SkillNameLabel
!text: tr('Fishing')
SkillValueLabel
SkillPercentPanel
Code:
SkillButton
id: skillId7
SkillNameLabel
!text: tr('Runecraft')
SkillValueLabel
SkillPercentPanel
modules/game_skills/skills.lua
Search for
if i > Skill.Fishing then
and change it to if i > Skill.Runecraft then
That should be enough. Hope it helps someone.