public void DismissPsiWeapon() { Zone ParentsCurrentZone = ParentObject.CurrentZone; if (ParentsCurrentZone.findObjectById(PsiWeaponsID) != null && !ParentObject.HasObjectInInventory(PsiWeaponsID) || !ParentObject.HasEquippedObject(PsiWeaponsID)) { // AddPlayerMessage("Dismissing Weapon"); GameObject PsiWeaponInZone = ParentsCurrentZone.findObjectById(PsiWeaponsID); // AddPlayerMessage("Finding: " + PsiWeaponsID); var ParentsInventory = ParentObject.Inventory; var WeaponInInvo = ParentsInventory.GetObjects(); var ParentsBodySlots = ParentObject.Body.GetBody(); var ParentsHands = ParentsBodySlots.GetPartByName("Hand"); ParentObject.FireEvent(Event.New("CommandForceUnequipObject", "BodyPart", ParentsHands)); if (ParentsBodySlots.IsItemEquippedOnLimbType(PsiWeaponInZone, "Hand")) { // AddPlayerMessage("Dismissing getting Obj in Hands for: " + PsiWeaponInZone); PsiWeaponInZone.ForceUnequipAndRemove(true); ParentsInventory.RemoveObject(PsiWeaponInZone); XDidY(PsiWeaponInZone, "disappear", null, null, null, null); if (WeaponCounter > 0) { --WeaponCounter; } } else if (ParentsInventory.HasObject(PsiWeaponInZone)) { ParentsInventory.RemoveObject(PsiWeaponInZone); // AddPlayerMessage("Dismissing getting Obj in inv for: " + PsiWeaponInZone); if (WeaponCounter > 0) { --WeaponCounter; } } else if (ParentsCurrentZone.findObjectById(PsiWeaponsID) != null) { if (PsiWeaponInZone.CurrentCell != null) { DidX("disappear", null, null, null, null, PsiWeaponInZone); PsiWeaponInZone.CurrentCell.Splash("{{M|*}}"); PsiWeaponInZone.Destroy(); if (WeaponCounter > 0) { --WeaponCounter; } } } else { AddPlayerMessage("There are no weapons to dismiss."); } } else { AddPlayerMessage("There are no weapons to dismiss."); } }