Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scriptname NukaWorldPlus:System:ShockCollarScript extends ObjectReference
- ;Author : Simon Grunwald, @Systoliker#6260
- ;First Date : 05.06.2019
- ;Last Date : 05.06.2019
- ;Editor : DieFeM, @DieFeM#3996
- ;First Date : 06.06.2019
- ;Last Date : 06.06.2019
- Function BlowUp()
- if !Wearer.getActorBase().isEssential()
- if Wearer.getActorBase().isProtected()
- Wearer.setProtected(false)
- endif
- Wearer.PlaceAtMe(pFragExplosion)
- Wearer.kill()
- Wearer.Dismember("Head1", true, false, false)
- Wearer.Dismember("Torso", true, false, false)
- Wearer.Dismember("LeftArm1", false, false, false)
- Wearer.Dismember("RightArm1", true, false, false)
- Wearer.Dismember("LeftLeg1", true, false, false)
- Wearer.Dismember("RightLeg1", false, false, false)
- else
- Wearer.PlaceAtMe(pFragExplosion)
- Wearer.kill()
- endif
- EndFunction
- Bool Function CheckLocation(Actor ActorRef)
- return ActorRef.GetCurrentLocation() == NukaWorldLoc || ActorRef.GetWorldspace() == NukaWorld
- EndFunction
- Event OnEquipped(Actor akEquipper)
- Wearer = akEquipper
- RegisterForRemoteEvent(akEquipper, "OnLocationChange")
- EndEvent
- Event OnUnequipped(Actor akUnequipper)
- Wearer = None
- UnregisterForRemoteEvent(akUnequipper, "OnLocationChange")
- if akUnequipper == game.getPlayer()
- int iButton = DisarmMessage.show()
- if iButton == 0
- CancelTimer(BlowUpTimerId)
- akUnequipper.RemoveItem(DisarmKey)
- akUnequipper.RemoveItem(GetBaseObject())
- elseif iButton == 1
- int i = utility.RandomInt(1, 15)
- if i <= akUnequipper.getValue(DisarmPerk)
- CancelTimer(BlowUpTimerId)
- akUnequipper.RemoveItem(GetBaseObject())
- else
- BlowUp()
- endif
- elseif iButton == 2
- akUnequipper.EquipItem(GetBaseObject())
- endif
- endif
- EndEvent
- Event Actor.OnLocationChange(Actor akSender, Location akOldLoc, Location akNewLoc)
- If !CheckLocation(akSender)
- WarningMessage.show()
- Debug.Notification("Death Counter started!")
- StartTimer(40, BlowUpTimerId)
- Else
- CancelTimer(BlowUpTimerId)
- EndIf
- EndEvent
- Event onTimer(int aiTimerId)
- if aiTimerId == BlowUpTimerId
- if Wearer.isEquipped(GetBaseObject())
- BlowUp()
- endif
- endif
- EndEvent
- Group HUD
- Explosion Property pFragExplosion Auto Const
- Message Property DisarmMessage Auto Const
- Message Property WarningMessage Auto Const
- EndGroup
- Group System
- MiscObject Property DisarmKey Auto Const
- Location Property NukaWorldLoc Auto Const
- WorldSpace Property NukaWorld Auto Const
- ActorValue Property DisarmPerk Auto Const
- EndGroup
- Group assisstance
- Actor Property Wearer Auto Hidden
- Int Property BlowUpTimerId = 34 Auto Hidden
- endGroup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement