Advertisement
Guest User

Untitled

a guest
Jul 8th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. ScriptName RDE_DetonationScript extends ObjectReference
  2. {Detonation Script fro RDE. Attached to detonater}
  3.  
  4. float Property WorkingRadius = 10000.0 Auto
  5. { what's the trigger range of the detonator }
  6. ; float Property SignalSpeed Auto Const
  7. ; { in units/second, used to determine the staggering effect }
  8.  
  9. Projectile Property RDE_Projectile Auto
  10.  
  11. Function Detonate(ObjectReference RDE)
  12. ; Test to see which if any of these works to make the mine explode, and give credit for potential kills
  13. RDE.DamageObject(100.0)
  14. ; RDE.DamageValue(Game.GetHealthAV(), 100.0)
  15.  
  16. ; Below probably won't work
  17. ; RDE.Activate()
  18. ; RDE.Fire(akSender)
  19. ; RDE.Fire(Self as ObjectReference)
  20. ; RDE.Fire(Game.GetPlayer())
  21. EndFunction
  22.  
  23. Event OnEquipped(Actor akActor)
  24. If (akActor == Game.GetPlayer())
  25. RegisterForAnimationEvent(akActor, "WeaponFire")
  26. EndIf
  27. EndEvent
  28.  
  29. Event OnUnequipped(Actor akActor)
  30. If (akActor == Game.GetPlayer())
  31. UnregisterForAnimationEvent(akActor, "WeaponFire")
  32. EndIf
  33. EndEvent
  34.  
  35. Event OnAnimationEvent(ObjectReference akSource, string asEventName)
  36. ObjectReference[] RDEsToExplode = akSource.FindAllReferencesOfType(RDE_Projectile as Form, WorkingRadius)
  37. int i = 0
  38.  
  39. Debug.Notification("Found " + RDEsToExplode.Length + " RDEs.")
  40.  
  41. While (i < RDEsToExplode.Length)
  42. Detonate(RDEsToExplode[i])
  43. i += 1
  44. EndWhile
  45. EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement