LurkerGG Posted November 26, 2012 Share Posted November 26, 2012 So I am working with my evolving follower script and attempting to improve it. So far the transformation between races happens for the Follower. I am trying to add a requirement that the NPC has to be a certain rank in the CurrentFollowerFaction for the race changes to take place. The script is intended to do the follower Check npcs current race, check the npcs rank in the Currentfollowerfaction and check the npcs level. Based on that information the npcs race is changed to the appropriate race. So far the race changes work but the npc is still being changed even though they are not 0 or higher rank with the CurrentFollowerFaction. I will be honest. I pretty much have no idea what I am doing and the script so far is just a hodge podge of other scripts I have pieced together. Thank you for any help you may be able to provide :) Scriptname Npc_evolutionscript_notext extends ActiveMagicEffect {NPC evolving through polymorph effect}Spell Property PolymorphSpell autoFormList Property WerewolfDispelList autoRace Property PolymorphRace1 autoRace Property PolymorphRace2 autoRace Property PolymorphRace3 autoFaction Property CurrentFollowerFaction autoWeapon Property MonsterWeapon autoExplosion Property EndExplosion autoImageSpaceModifier Property ChangeFX autoIdle Property IdleWerewolfTransformation auto; EVENTSEvent OnEffectStart(Actor Target, Actor Caster) GetTargetActor().PlayIdle(IdleWerewolfTransformation) PrepShift() Utility.Wait(1.5) GetTargetActor().placeAtMe(EndExplosion) IF (Target.GetActorBase().GetRace() != PolymorphRace1) || (Target.GetActorBase().GetRace() != PolymorphRace2) || (Target.GetActorBase().GetRace() != PolymorphRace3) && (Target.GetFactionRank(CurrentFollowerFaction) >= 1) IF(Target.Getlevel() <= 29) GetTargetActor().SetRace(PolymorphRace1) ELSEIF (Target.Getlevel() <= 39) GetTargetActor().SetRace(PolymorphRace2) ELSE GetTargetActor().SetRace(PolymorphRace3) AnimationEnd() ENDIF ENDIF EndEventEvent OnEffectFinish(Actor Target, Actor Caster) Target.placeAtMe(EndExplosion) ChangeFx.Apply()endEventFunction AnimationEnd()EndFunction Function PrepShift() ; Debug.Trace("WEREWOLF: Prepping shift...") Actor player = GetCasterActor() int count = 0 while (count < WerewolfDispelList.GetSize()) Spell gone = WerewolfDispelList.GetAt(count) as Spell if (gone != None) GetTargetActor().DispelSpell(gone) endif count += 1 endwhileEndFunction[/Code] Link to comment Share on other sites More sharing options...
steve40 Posted November 26, 2012 Share Posted November 26, 2012 (edited) I don't know if this will work (it compiles). I've cleaned the script up a bit. Scriptname Npc_evolutionscript_notext extends ActiveMagicEffect {NPC evolving through polymorph effect} FormList Property WerewolfDispelList auto Race Property PolymorphRace1 auto Race Property PolymorphRace2 auto Race Property PolymorphRace3 auto Faction Property CurrentFollowerFaction auto Explosion Property EndExplosion auto ImageSpaceModifier Property ChangeFX auto Idle Property IdleWerewolfTransformation auto Event OnEffectStart(Actor Target, Actor Caster) Target.PlayIdle(IdleWerewolfTransformation) PrepShift(Target) Utility.Wait(1.5) Target.PlaceAtMe(EndExplosion) Race myRace = Target.GetActorBase().GetRace() IF (myRace != PolymorphRace1) && (myRace != PolymorphRace2) && (myRace != PolymorphRace3) && (Target.GetFactionRank(CurrentFollowerFaction) >= 1) IF(Target.Getlevel() <= 29) Target.SetRace(PolymorphRace1) ELSEIF (Target.Getlevel() <= 39) Target.SetRace(PolymorphRace2) ELSE Target.SetRace(PolymorphRace3) ENDIF ENDIF EndEvent Event OnEffectFinish(Actor Target, Actor Caster) Target.PlaceAtMe(EndExplosion) ChangeFX.Apply() endEvent Function PrepShift(Actor akTarget) ; Debug.Trace("WEREWOLF: Prepping shift...") int count = 0 while (count < WerewolfDispelList.GetSize()) Spell gone = WerewolfDispelList.GetAt(count) as Spell if (gone != None) akTarget.DispelSpell(gone) endif count += 1 endwhile EndFunction Edited November 26, 2012 by steve40 Link to comment Share on other sites More sharing options...
LurkerGG Posted November 27, 2012 Author Share Posted November 27, 2012 Even if it does not work, the fact you cleaned it up will help me learn new ways to script :D Link to comment Share on other sites More sharing options...
Recommended Posts