public void OnMainGripGrabbed(RagdollHand interactor, Handle handle, EventTime eventTime) { if (interactor.playerHand == Player.local.handRight) { gunGripHeldRight = true; } if (interactor.playerHand == Player.local.handLeft) { gunGripHeldLeft = true; } if (!gunGripHeldLeft && !gunGripHeldRight) { if (isEmpty) { ReloadWeapon(); } thisNPC = interactor.ragdoll.creature; thisNPCBrain = thisNPC.brain.instance; BrainBow = thisNPCBrain.GetModule <BrainModuleBow>(); BrainMelee = thisNPCBrain.GetModule <BrainModuleMelee>(); BrainParry = thisNPCBrain.GetModule <BrainModuleParry>(); thisNPC.brain.currentTarget = Player.local.creature; thisNPC.brain.isParrying = true; BrainMelee.meleeEnabled = module.npcMeleeEnableOverride; } }
public void OnMainGripUnGrabbed(RagdollHand interactor, Handle handle, EventTime eventTime) { if (interactor.playerHand == Player.local.handRight) { gunGripHeldRight = false; } if (interactor.playerHand == Player.local.handLeft) { gunGripHeldLeft = false; } if (thisNPC != null) { thisNPC = null; thisNPCBrain = null; BrainBow = null; BrainMelee = null; BrainParry = null; } }