irswat Posted November 20, 2016 Share Posted November 20, 2016 I'm trying to figure out a way to apply a poison in the players inventory to the currently equipped weapon by means of a script. I was thinking I could do something like" bool PoisonousPotion=PotionForm.IsPoison() MagicEffect PoisonousEffect int numEffects=PotionForm.GetNumEffects int i=0 if PoisonousPotion==true while(i<numEffects) PoisonousEffect=GetNthEffectMagicEffect(i) ;IS applied to a weapon? ;what weapon is equipped? ;if PoisonousEffect is applied to a weapon ;WHAT COMMAND DO I USE TO APPLY POISONOUS EFFECT TO A WEAPON? i+=1 endWhile endif But I'm unsure what function I could possibly use to SetMagicEffect to a weapon. There is a SetEnchanment function for weapons, but no SetMagicEffect. Also wondering if there is a function that returns whether a potion is applied to a weapon or not. Link to comment Share on other sites More sharing options...
irswat Posted November 20, 2016 Author Share Posted November 20, 2016 Here is the relevant code: SearchType="Potion" ;need to add support for poisons form FormThatMatches=ExEquipItem(ItemNameLength, SearchType) debug.notification("Using potion " + FormThatMatches.GetName()) debug.trace("Using potion " + FormThatMatches.GetName()) if (FormThatMatches as Potion).IsPoison() if PlayerRef.GetItemCount(FormThatMatches as Potion)>0 PlayerRef.EquipItem(FormThatMatches as Potion, false, false) endif endif if !(FormThatMatches as Potion).IsPoison() if PlayerRef.GetItemCount(FormThatMatches)>0 PlayerRef.EquipItem(FormThatMatches, false, false) endif endif Link to comment Share on other sites More sharing options...
irswat Posted November 20, 2016 Author Share Posted November 20, 2016 A related question. When using GetType, would frostbite venom be of type Potion? Link to comment Share on other sites More sharing options...
irswat Posted November 21, 2016 Author Share Posted November 21, 2016 EDIT: Disregard this. Problem solved! Link to comment Share on other sites More sharing options...
dlobo1999 Posted April 7, 2017 Share Posted April 7, 2017 Hey, man. I was wondering if there was a way to add poison effect to an actor via scripts?I mean, poison the actor, not his weapon? Link to comment Share on other sites More sharing options...
irswat Posted April 7, 2017 Author Share Posted April 7, 2017 I assume actorref.EquipItem(poisonrefid) would work. Link to comment Share on other sites More sharing options...
Recommended Posts