gerg357 Posted March 4, 2020 Share Posted March 4, 2020 What i want to do is create a spell that does a ability on a dead npc but gives a item to player based on the dead npcs actor type.. what i mean by that is.. if the npc is a dead witch or a vampire or werewolf or bandit etc.. dunno if this is possible it looks like its alot of work as there are various types of witches an vampires.. im wanting to do something for all types.. like if the dead npc is a witch if its fire or ice or whatever it will do something because its a witch .. not what type of witch... i looked in creation kit wouldnt didnt find too much... any ideas??? I dunno if id use a template or actor base or id or what id need... the effect would work on a witch..for example regaurdless of what type of witch it is.. just as long as it is a witch... i want to do this with multiples but i guess im trying to say i need to find out how to determine the base of it.. like the id of a witch or am i gonna have to make if statements for every single type of witch?? Link to comment Share on other sites More sharing options...
dylbill Posted March 4, 2020 Share Posted March 4, 2020 (edited) I think best way to do this is to make unique magic effects and spells, and use the spell conditions GetIsRace, GetFactionRank, or HasKeyword when adding the magic effects. For instance, for witches put the condition GetIsRace HagravenRace == 1. For vampires: GetFactionRank VampireFaction >= 0. Make sure your magic effects have the No Death Dispel box ticked. Also put the condition GetActorValuePercent Health < 0.1 which is less than 10%. Then attach a script to each magic effect that looks like this: Actor Property PlayerRef Auto MiscObject Property SomeItem Auto Actor CurrentTarget Event OnEffectStart(Actor akTarget, Actor akCaster) If akTarget.IsDead() PlayerRef.AddItem(SomeItem, 1) ;If target is dead, add item to player Else CurrentTarget = akTarget ;saves target to use in OnUpdate event RegisterForSingleUpdate(3) ;if not dead, check again in 3s EndIf EndEvent Event OnUpdate() If CurrentTarget.IsDead() PlayerRef.AddItem(SomeItem, 1) ;If target is dead, add item to player CurrentTarget = none ;clears target Else RegisterForSingleUpdate(3) ;if not dead, check again in 3s EndIf EndEvent You can change the SomeItem and MiscObject type to whatever you want. Edited March 4, 2020 by dylbill Link to comment Share on other sites More sharing options...
gerg357 Posted March 4, 2020 Author Share Posted March 4, 2020 That's a good idea using condition what about bandits etc are all witches hagraven race? What about if it was a farmer or something they can be any race Link to comment Share on other sites More sharing options...
dylbill Posted March 4, 2020 Share Posted March 4, 2020 I'm not sure, I know there are a bunch of bandit factions. You could also try the condition GetIsClass to identify npc types. You'll just have to poke around a bit until you find the right conditions and identifiers. Link to comment Share on other sites More sharing options...
gerg357 Posted March 4, 2020 Author Share Posted March 4, 2020 Thx even using condition might be easier Link to comment Share on other sites More sharing options...
Recommended Posts