Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scriptname PlaceAtMeWhatever extends ObjectReference
- {places something static at the object}
- Form Property MyCreaturesListForm Auto Const mandatory
- {select a Form List with the creatures}
- Sound Property MySound Auto
- {play the sound when the creature is placed}
- Race Property DeathClawRace Auto Const mandatory
- Race Property MirelurkRace Auto Const mandatory
- Race Property MirelurkKingRace Auto Const mandatory
- Race Property BrahminRace Auto Const mandatory
- Faction Property PlayerFaction auto
- ObjectReference MyCreatureReference
- int SoundInstanceID
- bool isBottled = true
- Actor MyCreature
- Event OnInit()
- if (self.Is3DLoaded())
- self.SetMotionType(self.Motion_Keyframed)
- endif
- MyCreatureReference = self.PlaceAtMe(MyCreaturesListForm)
- MyCreatureReference.setScale(0.0)
- MyCreature = MyCreatureReference as Actor
- MyCreature.AddToFaction(PlayerFaction)
- EndEvent
- event OnLoad()
- Utility.Wait(0.4)
- if(MyCreature.GetRace() == DeathClawRace)
- MyCreatureReference.TranslateTo(self.X, self.Y + 3, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
- MyCreatureReference.setScale(0.05)
- elseif(MyCreature.GetRace() == MirelurkRace)
- MyCreatureReference.TranslateTo(self.X, self.Y, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
- MyCreatureReference.setScale(0.12)
- elseif(MyCreature.GetRace() == MirelurkKingRace)
- MyCreatureReference.TranslateTo(self.X, self.Y + 3, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
- MyCreatureReference.setScale(0.08)
- elseif(MyCreature.GetRace() == BrahminRace)
- MyCreatureReference.TranslateTo(self.X, self.Y, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
- MyCreatureReference.setScale(0.1)
- else
- MyCreatureReference.TranslateTo(self.X, self.Y, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
- MyCreatureReference.setScale(0.1)
- endif
- MyCreature.EnableAI()
- MyCreature.EnableAI(false, true)
- if (MyCreature.Is3DLoaded())
- MyCreature.SetMotionType(MyCreature.Motion_Keyframed)
- endif
- MyCreature.KillSilent()
- MyCreature.BlockActivation()
- isBottled = true;
- SoundInstanceID = MySound.Play(MyCreature)
- EndEvent
- Event OnActivate(ObjectReference akActionRef)
- if(akActionRef == Game.GetPlayer())
- If (isBottled == false)
- if(MyCreature.GetRace() == DeathClawRace)
- MyCreatureReference.TranslateTo(self.X, self.Y + 3, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
- MyCreatureReference.setScale(0.05)
- elseif(MyCreature.GetRace() == MirelurkRace)
- MyCreatureReference.TranslateTo(self.X, self.Y, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
- MyCreatureReference.setScale(0.12)
- elseif(MyCreature.GetRace() == MirelurkKingRace)
- MyCreatureReference.TranslateTo(self.X, self.Y + 3, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
- MyCreatureReference.setScale(0.08)
- elseif(MyCreature.GetRace() == BrahminRace)
- MyCreatureReference.TranslateTo(self.X, self.Y, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
- MyCreatureReference.setScale(0.1)
- else
- MyCreatureReference.TranslateTo(self.X, self.Y, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
- MyCreatureReference.setScale(0.1)
- endif
- MyCreature.EnableAI()
- MyCreature.EnableAI(false, true)
- if (MyCreature.Is3DLoaded())
- MyCreature.SetMotionType(MyCreature.Motion_Keyframed)
- endif
- MyCreature.KillSilent()
- MyCreature.BlockActivation()
- SoundInstanceID = MySound.Play(MyCreature)
- isBottled = true
- else
- Debug.MessageBox("Reactivating Creature")
- MyCreatureReference.setScale(1.00)
- MyCreature.Resurrect()
- MyCreature.Reset()
- MyCreature.EnableAI()
- MyCreature.SetCompanion()
- isBottled = false
- endif
- endif
- EndEvent
- Event OnWorkshopObjectDestroyed(ObjectReference WorkshopRef)
- MyCreatureReference.Disable()
- MyCreatureReference.Delete()
- EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement