Jump to content

Making chicken drop egg when punched?


Jokerine

Recommended Posts

Hello, everybody! Merry holidays and all. I'm not sure if many people are around this time of the year, but I've been thinking of posting a little request for an edit to a personal mod of mine. I would've done it myself (probably badly), but after my Skyrim got accidentally wiped I never bothered to reinstall it. :dry:

 

Anyway... As you may know, I luv chickens, and some time ago, when my Skyrim was installed, I made myself a mod that adds two summonable pets - a German shepherd and a chicken. As far as I could see the mod was working just fine, but there was something I missed from this mod I used to have: an egg would be spawned every time the player punches the chicken, and would often roll down the hills, haha. It was really fun! (please note: I do not endorse violence against poultry)

 

I'm pretty sure this must be a scripted effect, and I have no idea how to make those, so I was wondering if anybody would be interested in taking a look at my mod (downloadable here) and maybe trying to script in that effect for me, so if the player punches the summoned chicken an egg is spawned. Only the player though - wouldn't want an avalanche of eggs after fighting around in a dungeon! :P

 

I'm not sure if that uses good ole PlaceAtMe but I think it did, because as I said the eggs would often roll away and go missing forever, haha. But if you feel that method could cause save bloat, it would be fine if the egg is just added to the player inventory directly. I guess the old mod I linked above may have the script sources to check how they got it to work.

 

Hope that makes sense! It would make me very happy to have on-demand eggs. Thank you! :devil:

Link to comment
Share on other sites

This script will get you the base of what you want, although you could tweak it for preference.

 

Note that you'll need to link the Egg to the specific ingredient you want through the Properties menu after attaching the script.

 

 

=====================================

 

Scriptname ChickenDropsEggWhenPunched extends ObjectReference

; THIS SCRIPT IS ATTACHED TO A CHICKEN

; WHEN THE PLAYER PUNCHES THE CHICKEN, IT DROPS AN EGG.

 

 

Ingredient property Egg auto

 

Event OnHit( ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)

 

If(( akAgressor == ( Game.GetPlayer() as ObjectReference )) && ( akSource as Weapon ))

If(( akSource as Weapon ).GetWeaponType() == 0 )

Self.PlaceAtMe( Egg, 1 )

EndIf

EndIf

 

EndEvent

Edited by MasterBobcat
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...