Enchanted Armor

How I can make an armor that will increase player damage?
for example: I want to make an armor that will increase 20% sword damage, so if the player is using the armor his damage will
increase by 20% (but only for Sword type weapons). if the player isn't use sword type weapons, then the damage won't increase.
is it possible to do that?
I am sorry I know it's kinda big request, but I think it's pretty cool damage system


np: I use TES V: Skyrim as a reference
About the only way is to use a plug-in. You might be able to do it by getting cute with the damage formula but it would get long and complicated fast as far as I know.

I'll move this to plug-in request, and if someone can come up with a way to do it without a plug-in, that will be a bonus then.

Moved to Plug-in Requests

@Keegan I have a feeling you could do this with Hime's State Damage Modifiers by using the armor to apply a state to the user, and having an attacker modifier on that state. I'm not near a computer at the moment so I can't test it, but I think the notetag would look like this, where n is replaced by the weapon type id for swords:
Code:
<state damage modifier: attacker>
if (a.isWtypeEquipped(n)) {
    return d * 1.2;
} else {
    return d;
}
</state damage modifier>

Edit: note this would increase ALL damage for ALL skills. There'd be another conditional if you only wanted it to increase damage for certain skills.
@Keegan I have a feeling you could do this with Hime's State Damage Modifiers by using the armor to apply a state to the user, and having an attacker modifier on that state. I'm not near a computer at the moment so I can't test it, but I think the notetag would look like this, where n is replaced by the weapon type id for swords:
Code:
<state damage modifier: attacker>
if (a.isWtypeEquipped(n)) {
    return d * 1.2;
} else {
    return d;
}
</state damage modifier>

Edit: note this would increase ALL damage for ALL skills. There'd be another conditional if you only wanted it to increase damage for certain skills.
Where I should put that notetag?
@Keegan I have a feeling you could do this with Hime's State Damage Modifiers by using the armor to apply a state to the user, and having an attacker modifier on that state. I'm not near a computer at the moment so I can't test it, but I think the notetag would look like this, where n is replaced by the weapon type id for swords:
Code:
<state damage modifier: attacker>
if (a.isWtypeEquipped(n)) {
    return d * 1.2;
} else {
    return d;
}
</state damage modifier>

Edit: note this would increase ALL damage for ALL skills. There'd be another conditional if you only wanted it to increase damage for certain skills.
I have discovered how to apply it, and it works!!! thank you very much for your help!
@Keegan I have a feeling you could do this with Hime's State Damage Modifiers by using the armor to apply a state to the user, and having an attacker modifier on that state. I'm not near a computer at the moment so I can't test it, but I think the notetag would look like this, where n is replaced by the weapon type id for swords:
Code:
<state damage modifier: attacker>
if (a.isWtypeEquipped(n)) {
    return d * 1.2;
} else {
    return d;
}
</state damage modifier>

Edit: note this would increase ALL damage for ALL skills. There'd be another conditional if you only wanted it to increase damage for certain skills.
I tried it and the damage dealt is 207.01828390192 or 45.12391293, can i get rid of those unnecessary number? and make it into integers like 207 or 45
Ah, yes, I forgot the rounding function.

Code:
<state damage modifier: attacker>
if (a.isWtypeEquipped(n)) {
    return Math.floor(d * 1.2);
} else {
    return d;
}
</state damage modifier>
To round the numbers down, you'll want to use the Math.floor() function. To round them up, it's Math.ceil()

Edit: Beat me to it!
t
Ah, yes, I forgot the rounding function.

Code:
<state damage modifier: attacker>
if (a.isWtypeEquipped(n)) {
    return Math.floor(d * 1.2);
} else {
    return d;
}
</state damage modifier>
Thank you guys, it really helps
To round the numbers down, you'll want to use the Math.floor() function. To round them up, it's Math.ceil()

Edit: Beat me to it!
ahh yes, I should know it if I learn JS first 🙁

Original thread: https://forums.rpgmakerweb.com/threads/enchanted-armor.89877/