Jump to content

Need help with disarm


Krentz

Recommended Posts

I'm working on a mod that adds a chance to disarm enemies when the player hits them with a Power Attack. I have gotten this working for disarming shields by creating a property for each possible shield, doing a check to figure out what kind of shield they are using, and then using Actor.DropItem(shieldProperty). This is definitely not the most efficient way to do it but eventually I want to be able to "smash" the shields to pieces so I will need to know what kind it is anyway.

 

I would also like to add a chance to disarm an enemy's weapon if they are blocking with one instead of a shield. The problem is that I REALLY don't want to add a property for every possible weapon in the game, so ideally I just want to run a check to see if the enemy is blocking with a weapon, and then do something like Actor.disarm(). It doesn't seem like anything like that exists though. I did have some fun with Actor.unequipAll() for a while, but that's not quite what I'm looking for. I can figure out if the enemy is blocking, and I can figure out what "type" of weapon they have equipped using Actor.getEquippedItemType(), but I can't figure out how to make them drop it without having a specific reference to the weapon object.

 

I tried using the Disarm Magic Effect from the Perk Disarm Spell from the Shield Bash Disarm perk. Currently I am trying to have the player "cast" the disarm spell on the blocking enemy when they Power Attack, but it doesn't seem to take. Either the player can't cast it, or the disarm effect is not applying to the enemy.

 

Does anybody know of a good way to do this sort of "generic disarm"? Also are there any good example scripts doing something similar? Any combat scripts would be a great reference for me.

 

Extra question:

Is there any way to apply a Magic Effect on an Actor without casting a spell (with the Magic Effect attached) on them?

 

Thanks for your help!

Edited by Krentz
Link to comment
Share on other sites

  • 2 weeks later...

I'm working on a mod that adds a chance to disarm enemies when the player hits them with a Power Attack. I have gotten this working for disarming shields by creating a property for each possible shield, doing a check to figure out what kind of shield they are using, and then using Actor.DropItem(shieldProperty). This is definitely not the most efficient way to do it but eventually I want to be able to "smash" the shields to pieces so I will need to know what kind it is anyway.

 

I would also like to add a chance to disarm an enemy's weapon if they are blocking with one instead of a shield. The problem is that I REALLY don't want to add a property for every possible weapon in the game, so ideally I just want to run a check to see if the enemy is blocking with a weapon, and then do something like Actor.disarm(). It doesn't seem like anything like that exists though. I did have some fun with Actor.unequipAll() for a while, but that's not quite what I'm looking for. I can figure out if the enemy is blocking, and I can figure out what "type" of weapon they have equipped using Actor.getEquippedItemType(), but I can't figure out how to make them drop it without having a specific reference to the weapon object.

 

I tried using the Disarm Magic Effect from the Perk Disarm Spell from the Shield Bash Disarm perk. Currently I am trying to have the player "cast" the disarm spell on the blocking enemy when they Power Attack, but it doesn't seem to take. Either the player can't cast it, or the disarm effect is not applying to the enemy.

 

Does anybody know of a good way to do this sort of "generic disarm"? Also are there any good example scripts doing something similar? Any combat scripts would be a great reference for me.

 

Extra question:

Is there any way to apply a Magic Effect on an Actor without casting a spell (with the Magic Effect attached) on them?

 

Thanks for your help!

I'm doing something similar with my fighting stance mod - the vanilla disarm effect doesn't seem to apply reliably - I think the game has some balancing for it built-in.

Here is the relevant section of script I made that makes them drop all hand-held equipment

 

Weapon EnemyWeapon = akTarget.GetEquippedWeapon(false);

Weapon EnemyWeaponRight = akTarget.GetEquippedWeapon(true);

Armor EnemyShield = akTarget.GetEquippedShield();

akTarget.DropObject(EnemyWeapon , 1);

akTarget.DropObject(EnemyWeaponRight , 1);

akTarget.DropObject(EnemyShield, 1);

 

What you seem to want is: If they don't have a shield, but they are blocking, then you can disarm their weapon

As far as checking if they are blocking, I haven't seen a papyrus function for it yet, but there is the condition IsBlocking. You can have a power-attack on-hit enchantment that requires this conditional, for that particular check

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...