Advertisement
DieFeM

Untitled

Jul 28th, 2017
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.13 KB | None | 0 0
  1. Scriptname PlaceAtMeWhatever extends ObjectReference
  2. {places something static at the object}
  3.  
  4. Form Property MyCreaturesListForm  Auto Const mandatory
  5. {select a Form List with the creatures}
  6. Sound Property MySound Auto
  7. {play the sound when the creature is placed}
  8.  
  9. Race Property DeathClawRace Auto Const mandatory
  10. Race Property MirelurkRace Auto Const mandatory
  11. Race Property MirelurkKingRace Auto Const mandatory
  12. Race Property BrahminRace Auto Const mandatory
  13. Faction Property PlayerFaction auto
  14.  
  15. ObjectReference MyCreatureReference
  16. int SoundInstanceID
  17. bool isBottled = true
  18. Actor MyCreature
  19.  
  20. Event OnInit()
  21.     if (self.Is3DLoaded())
  22.         self.SetMotionType(self.Motion_Keyframed)
  23.     endif
  24.     MyCreatureReference = self.PlaceAtMe(MyCreaturesListForm)
  25.     MyCreatureReference.setScale(0.0)
  26.     MyCreature = MyCreatureReference as Actor
  27.     MyCreature.AddToFaction(PlayerFaction)
  28. EndEvent
  29.  
  30. event OnLoad()
  31.     Utility.Wait(0.4)
  32.     if(MyCreature.GetRace() == DeathClawRace)
  33.         MyCreatureReference.TranslateTo(self.X, self.Y + 3, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
  34.         MyCreatureReference.setScale(0.05)
  35.     elseif(MyCreature.GetRace() == MirelurkRace)
  36.         MyCreatureReference.TranslateTo(self.X, self.Y, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
  37.         MyCreatureReference.setScale(0.12)
  38.     elseif(MyCreature.GetRace() == MirelurkKingRace)
  39.         MyCreatureReference.TranslateTo(self.X, self.Y + 3, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
  40.         MyCreatureReference.setScale(0.08)
  41.     elseif(MyCreature.GetRace() == BrahminRace)
  42.         MyCreatureReference.TranslateTo(self.X, self.Y, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
  43.         MyCreatureReference.setScale(0.1)
  44.     else
  45.         MyCreatureReference.TranslateTo(self.X, self.Y, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
  46.         MyCreatureReference.setScale(0.1)
  47.     endif
  48.     MyCreature.EnableAI()
  49.     MyCreature.EnableAI(false, true)
  50.     if (MyCreature.Is3DLoaded())
  51.         MyCreature.SetMotionType(MyCreature.Motion_Keyframed)
  52.     endif
  53.     MyCreature.KillSilent()
  54.     MyCreature.BlockActivation()
  55.     isBottled = true;
  56.     SoundInstanceID = MySound.Play(MyCreature)
  57. EndEvent
  58.  
  59. Event OnActivate(ObjectReference akActionRef)
  60.     if(akActionRef == Game.GetPlayer())
  61.         If (isBottled == false)
  62.             if(MyCreature.GetRace() == DeathClawRace)
  63.                 MyCreatureReference.TranslateTo(self.X, self.Y + 3, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
  64.                 MyCreatureReference.setScale(0.05)
  65.             elseif(MyCreature.GetRace() == MirelurkRace)
  66.                 MyCreatureReference.TranslateTo(self.X, self.Y, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
  67.                 MyCreatureReference.setScale(0.12)
  68.             elseif(MyCreature.GetRace() == MirelurkKingRace)
  69.                 MyCreatureReference.TranslateTo(self.X, self.Y + 3, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
  70.                 MyCreatureReference.setScale(0.08)
  71.             elseif(MyCreature.GetRace() == BrahminRace)
  72.                 MyCreatureReference.TranslateTo(self.X, self.Y, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
  73.                 MyCreatureReference.setScale(0.1)
  74.             else
  75.                 MyCreatureReference.TranslateTo(self.X, self.Y, self.Z + 1, self.GetAngleX(), self.GetAngleY(), self.GetAngleZ() + 180, 5000.0, 3600.0)
  76.                 MyCreatureReference.setScale(0.1)
  77.             endif
  78.             MyCreature.EnableAI()
  79.             MyCreature.EnableAI(false, true)
  80.             if (MyCreature.Is3DLoaded())
  81.                 MyCreature.SetMotionType(MyCreature.Motion_Keyframed)
  82.             endif
  83.             MyCreature.KillSilent()
  84.             MyCreature.BlockActivation()
  85.             SoundInstanceID = MySound.Play(MyCreature)
  86.             isBottled = true
  87.         else
  88.             Debug.MessageBox("Reactivating Creature")
  89.             MyCreatureReference.setScale(1.00)
  90.             MyCreature.Resurrect()
  91.             MyCreature.Reset()
  92.             MyCreature.EnableAI()
  93.             MyCreature.SetCompanion()
  94.             isBottled = false
  95.         endif
  96.     endif
  97. EndEvent
  98.  
  99. Event OnWorkshopObjectDestroyed(ObjectReference WorkshopRef)
  100.     MyCreatureReference.Disable()
  101.     MyCreatureReference.Delete()
  102. EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement