- Joined
- Apr 10, 2010
- Messages
- 183
- Reaction score
- 27
Hi, I'm Wanger@MNDT from Taiwan.
So far the only way most people know to add(not replace the skin) custom skills had been posted a long time ago through adding the skill composite property like Mercedes' skills did.
This method, however, is only viable for the version after GMS 117, and it isn't so smooth to active the custom skills since you need to actuate trigger skills first.
If you have tried to add new skills, they will appear in the skill UI but have no responses when you click or press them because NEXON specifies each skill's function in UserLocal:oActiveSkill. The skill which doesn't be placed in the code there would have no function. For example, a snippet code of UserLocal:oActiveSkill from TWMS 147 is as follow:
The assembly code:
The code above designate the skill 1321012 as an attack skill and will redirect it to corresponding DoActiveSkill function which sends the packet with opcode CLOSE_RANGE_ATTACK (OdinMS).
Now if we want to put a new attack skill 1321013 into game, we NEED TO modify the code as follow(instructive):
I will show a simple instructive code by injecting the dll to patch the client, you can, of course, patch the following code in the available section in client and jmp to correct address. Yet I don't actually recommend you patch the code in the client directly.
The result is here:
The problem is that the versions before ZERO JOB been introduced(I guess, not test yet) have messy skills designation paths. It may be somehow painful to patch every job. The newer versions, however, use switch-case(jump table), it would be easier to patch each job.
Hope you guys can have brand new GMS 117/83/62 OR TWMS 113 btw LOL.
So far the only way most people know to add(not replace the skin) custom skills had been posted a long time ago through adding the skill composite property like Mercedes' skills did.
This method, however, is only viable for the version after GMS 117, and it isn't so smooth to active the custom skills since you need to actuate trigger skills first.
If you have tried to add new skills, they will appear in the skill UI but have no responses when you click or press them because NEXON specifies each skill's function in UserLocal:oActiveSkill. The skill which doesn't be placed in the code there would have no function. For example, a snippet code of UserLocal:oActiveSkill from TWMS 147 is as follow:
Code:
if (v10 <= 2111004)
{
if (v10 == 2111004)
goto LABEL_807;
if (v10 <= 2101002)
{
if (v10 != 2101002)
{
if (v10 == 1321012)
goto LABEL_658;
....
}
The assembly code:
Code:
Address1: cmp edi, 142834h //1321012
Address2: jz ActiveAttackSkillAddr
Address3: cmp edi, 1E8869h
Address4: jle ....
The code above designate the skill 1321012 as an attack skill and will redirect it to corresponding DoActiveSkill function which sends the packet with opcode CLOSE_RANGE_ATTACK (OdinMS).
Now if we want to put a new attack skill 1321013 into game, we NEED TO modify the code as follow(instructive):
Code:
if (v10 <= 2111004)
{
if (v10 == 2111004)
goto LABEL_807;
if (v10 <= 2101002)
{
if (v10 != 2101002)
{
if (v10 == 1321012 || v10 == 1321013) // << we need to modify the code here
goto LABEL_658;
....
}
I will show a simple instructive code by injecting the dll to patch the client, you can, of course, patch the following code in the available section in client and jmp to correct address. Yet I don't actually recommend you patch the code in the client directly.
Code:
int activeAttackSkillAddr = ActiveAttackSkillAddr;
int jumpBack1 = Address3;
void __declspec(naked) DispatchActiveSkill()
{
__asm
{
cmp edi, 0x142834 //1321012
jz JumpToAttackSkillAddr
cmp edi, 0x142835 //1321013
jz JumpToAttackSkillAddr
jmp [jumpBack1] //If the skill id doesn't match skill ids above, jump back to next check.
JumpToAttackSkillAddr:
jmp[activeAttackSkillAddr]
}
}
//You need to modify the instruction in client
Address1: jmp DispatchActiveSkill // You can patch here to jump to our own dispatch function.
Address2: ?? ?? // the code will be broken here since jmp instruction would fill with cmp, but NVM.
Address3: cmp edi, 1E8869h //Keep checking other skills
Address4: jle ....
The result is here:
The problem is that the versions before ZERO JOB been introduced(I guess, not test yet) have messy skills designation paths. It may be somehow painful to patch every job. The newer versions, however, use switch-case(jump table), it would be easier to patch each job.
Hope you guys can have brand new GMS 117/83/62 OR TWMS 113 btw LOL.