Fixed powder barrels not blowing up from hit with a fire arrow

This commit is contained in:
Eddoursul 2022-08-24 01:50:58 +02:00
parent 35be623d42
commit 2dc5ae454a
5 changed files with 23 additions and 2 deletions

Binary file not shown.

Binary file not shown.

View File

@ -20,6 +20,7 @@ Event OnEffectStart(Actor akTarget, Actor akCaster)
amOldAmmo = GetEquippedAmmo()
akCaster.AddItem(_00E_A1_FireArrowAmm, GetArrowCount())
akcaster.EquipItem(_00E_A1_FireArrowAmm)
AddInventoryEventFilter(_00E_A1_FireArrowAmm)
EndEvent
@ -49,7 +50,7 @@ Event OnPlayerBowShot(Weapon akWeapon, Ammo akAmmo, float afPower, bool abSunGaz
EndEvent
Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)
If akBaseItem == _00E_A1_FireArrowAmm
If akItemReference && ! akDestContainer
akItemReference.Delete()
EndIf
EndEvent

View File

@ -11,7 +11,24 @@ Import Utility
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
If (akProjectile && _00E_ExplosiveBarrel_ValidProjectiles.HasForm(akProjectile)) || (akSource && _00E_ExplosiveBarrel_ValidSources.HasForm(akSource))
bool bExplode = (akProjectile && _00E_ExplosiveBarrel_ValidProjectiles.HasForm(akProjectile)) || (akSource && _00E_ExplosiveBarrel_ValidSources.HasForm(akSource))
if ! bExplode
Actor aggressor = akAggressor as Actor
if aggressor
if _00E_A1_FireArrowAmm == None
_00E_A1_FireArrowAmm = Game.GetForm(0x670EC) as Ammo
endif
if _00E_A1_FireArrowME == None
_00E_A1_FireArrowME = Game.GetForm(0x5BD36) as MagicEffect
endif
if aggressor.IsEquipped(_00E_A1_FireArrowAmm) || ( aggressor.HasMagicEffect(_00E_A1_FireArrowME) && aggressor.GetItemCount(_00E_A1_FireArrowAmm) == 0 )
bExplode = true
endif
endif
endif
If bExplode
If bExploded == False
bExploded = True
If ExplosionMarkerRef == None
@ -75,3 +92,6 @@ Static Property XMarker Auto
Bool bExploded = False
ObjectReference ExplosionMarkerRef
MagicEffect Property _00E_A1_FireArrowME Auto
Ammo Property _00E_A1_FireArrowAmm Auto