Jump to content

Best method to disarm enemies?


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!

Link to comment
Share on other sites

It's probably worth mentioning that I thought maybe casting the disarm spell on the enemy wasn't working because the player didn't "know" the disarm spell to cast it. I tried using Actor.addSpell() to add it to the player, but it still doesn't seem to cause the enemy to disarm when cast.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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