For a system I had to add to new horse skills and they had to be levelled to P. At the end of doing this, I got "stuck" for a moment on how the charge horse skill didn't load the animation over the level 19 and trying to search online, seems no one bothered to make them working in a good way. Somehow I found people saying they don't do damage. Honestly, no idea how, probably very old kraizy super bugged files, but can't check that rn.
But let's say they do damage, but you'll notice the animation is always the same, effects too. What if you made new ones, how can they be read? Well, you might encounter two problems while doing it:
1: you will get disconnected for skill hack
2: the charge skill (it's the only one affected by this) won't do the horse animation if the level is over 20
To fix the first, we need to change char_skill.cpp and go to:
- { 2, 137, 140, 0, 0},
- { 1, 138, 0, 0, 0},
- { 1, 139, 0, 0, 0},
Probably line: 3345
so, now you have to add multiple lines just:
maybe adding the motion index on the right (so 124 125 ecc. for every line)
every +25 you add again:
- { 2, 137, 140, 0, 0},
- { 1, 138, 0, 0, 0},
- { 1, 139, 0, 0, 0},
so, it will be something like:
-
- { 2, 137, 140, 0, 0},
- { 1, 138, 0, 0, 0},
- { 1, 139, 0, 0, 0},
-
-
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
-
-
- { 2, 137, 140, 0, 0},
- { 1, 138, 0, 0, 0},
- { 1, 139, 0, 0, 0},
-
-
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
-
-
- { 2, 137, 140, 0, 0},
- { 1, 138, 0, 0, 0},
- { 1, 139, 0, 0, 0},
-
-
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0},
-
-
-
- { 2, 137, 140, 0, 0},
- { 1, 138, 0, 0, 0},
- { 1, 139, 0, 0, 0},
-
Alles anzeigen
But why we did this? Someone might say "but won't be the motion index always be the same from playersettingsmodule.py?". Right, except, we said we wanted to put new effects and animations.
And we get to the second problem.
Let's say you already made all the effects, and you have your skill_splash_2.msa skill_splash_3.msa skill_splash_4.msa ecc.
So, we open playersettingsmodule.py and first we edit:
- HORSE_SKILL_WILDATTACK = chr.MOTION_SKILL+121
- HORSE_SKILL_CHARGE = chr.MOTION_SKILL+122
- HORSE_SKILL_SPLASH = chr.MOTION_SKILL+123
into:
- HORSE_SKILL_WILDATTACK = 121
- HORSE_SKILL_CHARGE = 122
- HORSE_SKILL_SPLASH = 123
and then for every character we need to edit:
- chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, HORSE_SKILL_CHARGE, "skill_charge.msa")
and
- chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, HORSE_SKILL_WILDATTACK, "skill_wildattack.msa")
- chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_ONEHAND_SWORD, HORSE_SKILL_SPLASH, "skill_splash.msa")
and
- chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_TWOHAND_SWORD, HORSE_SKILL_WILDATTACK, "skill_wildattack.msa")
- chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_TWOHAND_SWORD, HORSE_SKILL_SPLASH, "skill_splash.msa")
for the Assassin we'll have:
- chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_DUALHAND_SWORD, HORSE_SKILL_WILDATTACK, "skill_wildattack.msa")
- chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_DUALHAND_SWORD, HORSE_SKILL_SPLASH, "skill_splash.msa")
- chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_BOW, HORSE_SKILL_WILDATTACK, "skill_wildattack.msa")
- chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE_BOW, HORSE_SKILL_SPLASH, "skill_splash.msa")
well, you got the idea.
Now, how do we make it that it reads the new effects and animations? Now, for the effects, it's pretty simple. All those lines need to be changed into (skill charge example):
- for i in xrange(skill.SKILL_EFFECT_COUNT):
- END_STRING = ""
- if i != 0: END_STRING = "_%d" % (i+1)
-
- chrmgr.RegisterCacheMotionData(chr.MOTION_MODE_HORSE, chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+HORSE_SKILL_CHARGE, "skill_charge" + END_STRING + ".msa")
What's changed? We added: chr.MOTION_SKILL+(i*skill.SKILL_GRADEGAP)+ before the name of the skill, and edited the name files with "name_file" + END_STRING + ".msa")
Now, repeat that for every horse skill, and now you'll have your new effects, except, try to do the charge skill and, well, the horse will run, but then it will just stop, the character will do the animation, there will be your new effect and you get there wondering why the f the horse does nothing. Where's that animation in the first place? Obviously in the horse folder, right? Right
It should be in:
D:\ymir work\npc\horse and horse2 and opening motlist.txt we find:
GENERAL SKILL2 25.msa 100
If we open the model of the horse with granny viewer and load the 25.gr2 animation, well, we found the animation, it's there! What's happening?
Well, in RaceManager.cpp in the launcher, we'll find:
- s_kMap_stType_dwIndex.insert(std::map<std::string, DWORD>::value_type("SKILL2", CRaceMotionData::NAME_SKILL + 122));
That's the "malicious" line who will link the "SKILL2" (charge) to his motion index, 122. Right, but at M/G/P we'll have a different motion index.
Now, it might not be elegant, but, what can you do?
I added three new lines (for the skill charge):
- s_kMap_stType_dwIndex.insert(std::map<std::string, DWORD>::value_type("SKILL2M", CRaceMotionData::NAME_SKILL + 147));
- s_kMap_stType_dwIndex.insert(std::map<std::string, DWORD>::value_type("SKILL2G", CRaceMotionData::NAME_SKILL + 172));
- s_kMap_stType_dwIndex.insert(std::map<std::string, DWORD>::value_type("SKILL2P", CRaceMotionData::NAME_SKILL + 197));
and slapped it in the motlist.txt of every horse:
- GENERAL SKILL2M 25.msa 100
- GENERAL SKILL2G 25.msa 100
- GENERAL SKILL2P 25.msa 100
et voilà, every level of the skill, it loads the animation with the effect you wanted (and animation, but in that case, you'll need to change the msa for the level you wanted to change).