[Papyrus] Quick Script Question Disease and Poison

Post » Tue Jun 19, 2012 6:03 pm

Hey guys n gals!
I have made a script that does stuff when hit by a hostile spell. It works all gravy, however I need to alter it so that it only fires when its a hostile spell within the spell category (so no poisons or diseases etc). Can anyone help me out with this? I am gonig to take a look at the wiki too, but its always good to ask teh community too :biggrin:

Spoiler
 Scriptname magicfeedback extends ActiveMagicEffect  actor property selfRef auto hiddenEVENT OnEffectStart(Actor Target, Actor Caster)				selfRef = caster		endEVENTEVENT onHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)	if (akSource as Spell)		if (akSource as spell).isHostile()   		   Do stuff		endif	endifendEVENT
User avatar
candice keenan
 
Posts: 3510
Joined: Tue Dec 05, 2006 10:43 pm

Post » Tue Jun 19, 2012 10:04 pm

Checking keywords with HasKeyword is probably a good bet. I'd think all poisons should share a keyword, diseases and enchantments too.
e.g.
!aksource.HasKeyword(poisonkeyword)

so

   if (akSource as spell).isHostile()       !aksource.HasKeyword(poisonkeyword)          Do stuff

then stuff would only be done if you were hit by a hostile, non poison spell effect
User avatar
kristy dunn
 
Posts: 3410
Joined: Thu Mar 01, 2007 2:08 am

Post » Tue Jun 19, 2012 9:24 pm

I took a look at them last night, and I think that nothing has keywords :( Mighty frustrating, I am not that keen to be editing all these spells, potentialy making my mod compeltly incompatible with any other spell mod out there =(

curses!
User avatar
Richus Dude
 
Posts: 3381
Joined: Fri Jun 16, 2006 1:17 am

Post » Tue Jun 19, 2012 9:28 pm

could try make a formlist with all the spells you want in it then compare to incoming spell with HasForm
User avatar
RUby DIaz
 
Posts: 3383
Joined: Wed Nov 29, 2006 8:18 am

Post » Tue Jun 19, 2012 11:01 am

could try make a formlist with all the spells you want in it then compare to incoming spell with HasForm
I've spent all day learning all about Formlists

I am (pretty) confident in saying: Use A FormList For This :smile:

Just create a theSpellsIAmInterestedIn List and drag the appropriate spells into it, then search the list - when spell encountered - to see if it is present

(FormLists, they're the future, man :wink:)

Here's the topic I made a couple of days ago: Check Shana's answer and link
User avatar
Fam Mughal
 
Posts: 3468
Joined: Sat May 26, 2007 3:18 am

Post » Tue Jun 19, 2012 12:04 pm

I took a look at them last night, and I think that nothing has keywords :(

Everything in this game has keywords.

The keywords are located on the base magic effect. In the case of poisons, the keyword you're looking for is "MagicAlchHarmful"
User avatar
Lavender Brown
 
Posts: 3448
Joined: Tue Jul 25, 2006 9:37 am

Post » Tue Jun 19, 2012 10:18 pm

Everything in this game has keywords.

The keywords are located on the base magic effect. In the case of poisons, the keyword you're looking for is "MagicAlchHarmful"
I just had a look, diseases have nothing under the keyword (nor does their associated magical effect), nor do the poisons encounteresd in the wild, such as the frostvenom spiders.

I may take a look into the formlists although this will still not help with mod compatability =(

if only i could do a "editorID contains poison/ disease" =(
User avatar
Jessica Stokes
 
Posts: 3315
Joined: Fri Jul 28, 2006 11:01 am


Return to V - Skyrim