How to create a weapon that does bonus damage to certain ene

Post » Tue Jun 19, 2012 12:18 pm

I want to create a special weapon that does bonus damage against a specific type of enemy, bears for example. Does anyone know the best way to do this? I figure it probably needs to be an enchantment, based purely on looking through existing items and enchantments and how they work. Any ideas to point me in the right direction?
User avatar
Rhiannon Jones
 
Posts: 3423
Joined: Thu Sep 21, 2006 3:18 pm

Post » Tue Jun 19, 2012 8:59 pm

You can do it with an enchantment or an on hit event script on the weapon if you want it to still be enchantable.

To do it with an enchantment set magic effect conditions on the magic effect you link to the enchantment.
User avatar
Evaa
 
Posts: 3502
Joined: Mon Dec 18, 2006 9:11 am

Post » Wed Jun 20, 2012 12:20 am

You can do it with an enchantment or an on hit event script on the weapon if you want it to still be enchantable.

To do it with an enchantment set magic effect conditions on the magic effect you link to the enchantment.

Thanks for the response. I was going to do an enchantment that can not be learned to keep my weapon unique, but if I can just write a script and put it on the weapon, that might be even better! You got my mind churning now.

So now I have new questions. :biggrin:
  • Looking at the wiki (maybe a mistake, but... http://www.creationkit.com/Weapon_Script) I don't see an OnHit event for weapons. So what should my weapon script extend?
  • Also, once I do get an OnHit event to fire, how do I get a reference to the actor I just clobbered?
Once I get there, I think I can figure out the rest.
User avatar
Bellismydesi
 
Posts: 3360
Joined: Sun Jun 18, 2006 7:25 am

Post » Tue Jun 19, 2012 7:47 pm

Sorry I've mislead you it does have onHit since weapon extends object. But sadly that is called when an object is hit so would have to be on the target.
User avatar
Adam Baumgartner
 
Posts: 3344
Joined: Wed May 30, 2007 12:12 pm

Post » Wed Jun 20, 2012 3:03 am

However if you want to give a weapon multiple effects the The magic effect for the enchantment can be scripted to add a number of disease magic effects you define to the target on start and remove them on end. ensure you tick the box so they ignore disease resistance
User avatar
Claire Jackson
 
Posts: 3422
Joined: Thu Jul 20, 2006 11:38 pm

Post » Tue Jun 19, 2012 10:59 pm

the way the silver weapons work (bonus damage to undead) is it equips a hidden perk to the player whenever you equip the weapon, and then removes it when you unequip the weapon
User avatar
ImmaTakeYour
 
Posts: 3383
Joined: Mon Sep 03, 2007 12:45 pm

Post » Tue Jun 19, 2012 1:05 pm

Oh - perks! I'll look into those. Thanks!
User avatar
Stephanie Valentine
 
Posts: 3281
Joined: Wed Jun 28, 2006 2:09 pm

Post » Tue Jun 19, 2012 8:11 pm

Scripts attached to weapons shouldn't extend http://www.creationkit.com/Weapon_Script, they should extend http://www.creationkit.com/ObjectReference_Script.

Cipscis
User avatar
J.P loves
 
Posts: 3487
Joined: Thu Jun 21, 2007 9:03 am

Post » Tue Jun 19, 2012 4:49 pm

You could also take a look at the Lunar weapon enchant (damage to beasts) thats on a couple weapons in addition to the Silver one.
User avatar
Jeneene Hunte
 
Posts: 3478
Joined: Mon Sep 11, 2006 3:18 pm

Post » Tue Jun 19, 2012 12:09 pm

the way wuuthrad does it is an onequip event to add a perk to the player as long as the weapon remains equipped, then an onunequip event to remove the perk when the player takes the weapon off

the perk it added to the player created a bonus damage with conditions set that the race the player was attacking was identified as one of the elven races
User avatar
Elisha KIng
 
Posts: 3285
Joined: Sat Aug 18, 2007 12:18 am

Post » Tue Jun 19, 2012 1:54 pm

I'd look into keywords...those can work...

like
if Target.HasKeyWord(WhateverKeywordIndicatesTheRightTargetType)   Target.DamageAV("Health",AmountOfBonusDamage)endif

J'zargo's infamous scrolls do it by checking the target for the Undead keyword, and dropping a fireball if it has it.
User avatar
Lloyd Muldowney
 
Posts: 3497
Joined: Wed May 23, 2007 2:08 pm

Post » Tue Jun 19, 2012 5:13 pm

Depending on what type of enemies you want it to effect, you could use apply a script to a spell, then add the spell to the race(s) you want to be effected. You can use a script that extends that magic effect (ActiveMagicEffect) and use an OnHit event in it.

Beware, though, there are some races that I cannot get to accept "racial spells."
User avatar
Marina Leigh
 
Posts: 3339
Joined: Wed Jun 21, 2006 7:59 pm

Post » Tue Jun 19, 2012 5:42 pm

Doesn't "OnHit" only fire for the target being hit, and not the thing doing the hitting? I ran into that when I was thinking of making a weapon that could "Knock the ore" out of a vein (I.E. Detect when it had hit an ore vein, deplete it, and just drop the ore at your feet.)
User avatar
Markie Mark
 
Posts: 3420
Joined: Tue Dec 04, 2007 7:24 am

Post » Tue Jun 19, 2012 12:01 pm

I ended up looking at how Ysgramor's Blade is implemented. It basically adds a perk on equip that multiplies weapon damage when the target meets certain conditions. Although, looking at similarly named forms in the base game, apparently Ysgramor went through a few itterations. There are an enchantment and a magic effect for this weapon which are no longer used as far as I can tell.
User avatar
koumba
 
Posts: 3394
Joined: Thu Mar 22, 2007 8:39 pm


Return to V - Skyrim