Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function OnDying(Actor akKiller)
- Float Spasm
- Float random2
- Int iBleeding = 0
- Int random = utility.RandomInt(3, 5)
- if NodeChecked == false
- utility.wait(0.200000)
- if NodeChecked == false
- utility.wait(0.500000)
- endIf
- endIf
- if bKillmoved == true && akKiller != target && target != none
- spAmount = zblood_spas_amount.GetValueInt()
- while iBleeding < random && target != none && target.Is3DLoaded() == true
- if !target.WornHasKeyword(DecapKeyword)
- self.randomHitTextureRandomLocation()
- iBleeding += 1
- random = utility.RandomInt(6, 7)
- else
- Bool bBleedingHead
- if bBleedingHead == false
- random = utility.RandomInt(9, 12)
- bBleedingHead == true
- endIf
- if iBleeding < 8
- self.randomHitSplatterHEAD()
- endIf
- BloodVisual.Play(target as objectreference, 0.200000, none)
- iBleeding += 1
- if iBleeding < 11
- if utility.RandomFloat(0.0100000, 1.00000) <= zblood_spas_chance_head.GetValue()
- Spasm = utility.RandomInt(spAmount + 5, spAmount + 20) as Float
- if zblood_spas_mass.GetValueInt() == 1
- Spasm = target.GetMass() / utility.RandomInt(spAmount, spAmount + 2) as Float
- elseIf Spasm > 51 as Float
- Spasm -= 20 as Float
- endIf
- target.ApplyHavokImpulse(0.000000, 0.000000, 1.00000, Spasm)
- endIf
- utility.wait(1 as Float)
- else
- utility.wait(2 as Float)
- endIf
- endIf
- endWhile
- target.PlayImpactEffect(BloodSpurtLarge, asNodeName, 0 as Float, 0 as Float, 0 as Float, 512 as Float, false, true)
- target.PlayImpactEffect(BloodSpurtNormal, asNodeName, 0 as Float, 0 as Float, 0 as Float, 512 as Float, false, true)
- elseIf target.WornHasKeyword(DecapKeyword) && target != none
- random = utility.RandomInt(8, 10)
- while iBleeding < random && target != none && target.Is3DLoaded() == true
- if iBleeding < 3
- self.randomHitSplatterHEADless()
- endIf
- BloodVisual.Play(target as objectreference, 0.200000, none)
- iBleeding += 1
- if iBleeding < 8
- if utility.RandomFloat(0.0100000, 1.00000) <= zblood_spas_chance_head.GetValue()
- Spasm = utility.RandomInt(spAmount, spAmount + 15) as Float
- if zblood_spas_mass.GetValueInt() == 1
- Spasm = target.GetMass() / utility.RandomInt(spAmount, spAmount + 2) as Float
- elseIf Spasm > 51 as Float
- Spasm -= 20 as Float
- endIf
- target.ApplyHavokImpulse(0.000000, 0.000000, 1.00000, Spasm)
- endIf
- utility.wait(1 as Float)
- else
- utility.wait(2 as Float)
- endIf
- endWhile
- target.PlayImpactEffect(BloodSpurtNormal, asNodeName, 0 as Float, 0 as Float, 0 as Float, 512 as Float, false, true)
- endIf
- if isFirstHit == true && isValidHit == false
- utility.wait(3.50000)
- endIf
- if akKiller.GetRace() == WerewolfBeastRace
- self.randomHitTextureRandomLocation()
- self.randomHitTextureRandomLocation()
- self.randomHitTextureRandomLocation()
- endIf
- if (isValidHit == true || bKillmoved == true) && target.IsDead() && isSummon == false && target.Is3DLoaded() == true
- Int picktexturepool = utility.RandomInt(0, 3)
- spAmount = zblood_spas_amount.GetValueInt()
- iBleeding = 0
- Float bodylocationx = target.GetPositionX()
- Float bodylocationy = target.GetPositionY()
- utility.wait(1.50000)
- while bodylocationx != target.GetPositionX() && bodylocationy != target.GetPositionY() && target.IsDead() && target.Is3DLoaded() == true
- if zblood_spas_mass.GetValueInt() == 1
- Spasm = target.GetMass() / utility.RandomInt(spAmount, spAmount + 5) as Float
- Spasm += (spAmount / 2) as Float
- else
- Spasm = (utility.RandomInt(spAmount, spAmount + 30) - random) as Float
- endIf
- if target != none
- target.PlayImpactEffect(BloodSpurtArrow, asNodeName, 0 as Float, 0 as Float, 0 as Float, 512 as Float, false, true)
- if bKillmoved == true && !target.WornHasKeyword(DecapKeyword)
- target.PlayImpactEffect(BloodSpurtLarge, asNodeName, 0 as Float, 0 as Float, 0 as Float, 512 as Float, false, true)
- endIf
- if bKillmoved == true && !target.WornHasKeyword(DecapKeyword) && utility.RandomFloat(0.0100000, 1.00000) <= zblood_spas_chance_kill.GetValue()
- random = utility.RandomInt(0, 1)
- while target.IsDead() && target.Is3DLoaded() == true && random <= 6
- Int spas_times
- target.PlayImpactEffect(BloodSpurtLarge, asNodeName, 0 as Float, 0 as Float, 0 as Float, 512 as Float, false, true)
- if random == 3 || random == 6
- self.randomHitTextureSmall()
- target.PlayImpactEffect(BloodSpurtNormal, asNodeName, 0 as Float, 0 as Float, 0 as Float, 512 as Float, false, true)
- endIf
- if random == 5
- Spasm *= 0.550000
- endIf
- Float spas_times_RND = utility.RandomFloat(0.0500000, 0.900000)
- if spas_times_RND <= 0.200000
- spas_times = 7
- else
- spas_times = 3
- endIf
- while target.IsDead() && target.Is3DLoaded() == true && iBleeding <= spas_times
- spX = utility.RandomFloat(-0.300000, 0.300000)
- spY = utility.RandomFloat(-0.300000, 0.300000)
- spZ = utility.RandomFloat(1 as Float, 0.800000)
- target.ApplyHavokImpulse(spX, spY, spZ, Spasm)
- utility.wait(spas_times_RND)
- iBleeding += 1
- endWhile
- iBleeding = 0
- random += 1
- endWhile
- bKillmoved = false
- endIf
- endIf
- bodylocationx = target.GetPositionX()
- bodylocationy = target.GetPositionY()
- self.blooddropsDead()
- endWhile
- random = utility.RandomInt(19, 20)
- iBleeding = 0
- while iBleeding < random && target.IsDead() && target.Is3DLoaded() == true && zblood_poolEnabled.GetValueInt() == 1
- if target != none && iBleeding <= 15
- if picktexturepool == 0
- target.PlayImpactEffect(BloodFXPool01_ANI, asNodeName, 0 as Float, 0 as Float, -1 as Float, 512 as Float, false, true)
- elseIf picktexturepool == 1
- target.PlayImpactEffect(BloodFXPool02_ANI, asNodeName, 0 as Float, 0 as Float, -1 as Float, 512 as Float, false, true)
- elseIf picktexturepool == 2
- target.PlayImpactEffect(BloodFXPool03_ANI, asNodeName, 0 as Float, 0 as Float, -1 as Float, 512 as Float, false, true)
- elseIf picktexturepool == 3
- target.PlayImpactEffect(BloodFXPool04_ANI, asNodeName, 0 as Float, 0 as Float, -1 as Float, 512 as Float, false, true)
- endIf
- endIf
- if target != none && iBleeding > 15
- if picktexturepool == 0
- target.PlayImpactEffect(BloodFXPool01, asNodeName, 0 as Float, 0 as Float, -1 as Float, 512 as Float, false, true)
- elseIf picktexturepool == 1
- target.PlayImpactEffect(BloodFXPool02, asNodeName, 0 as Float, 0 as Float, -1 as Float, 512 as Float, false, true)
- elseIf picktexturepool == 2
- target.PlayImpactEffect(BloodFXPool03, asNodeName, 0 as Float, 0 as Float, -1 as Float, 512 as Float, false, true)
- elseIf picktexturepool == 3
- target.PlayImpactEffect(BloodFXPool04, asNodeName, 0 as Float, 0 as Float, -1 as Float, 512 as Float, false, true)
- endIf
- endIf
- utility.wait(0.100000)
- iBleeding += 1
- endWhile
- endIf
- endFunction
- function randomHitTextureRandomLocationHIT()
- randomLocationX = utility.RandomFloat(-1.00000, 1.00000)
- randomLocationY = utility.RandomFloat(-1.00000, 1.00000)
- picktexture = utility.RandomInt(0, 2)
- if target != none
- if picktexture == 0
- target.PlayImpactEffect(BigBloodFX01, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 1
- target.PlayImpactEffect(BigBloodFX02, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 2
- target.PlayImpactEffect(BigBloodFX03, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- return
- endIf
- endIf
- endFunction
- ; Skipped compiler generated GetState
- function randomHitSplatterHEADless()
- picktexture = utility.RandomInt(0, 3)
- if target != none
- if picktexture == 0
- target.PlayImpactEffect(SmallBloodFX01, "NPC Neck [Neck]", 0 as Float, 0 as Float, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 1
- target.PlayImpactEffect(SmallBloodFX02, "NPC Neck [Neck]", 0 as Float, 0 as Float, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 2
- target.PlayImpactEffect(SmallBloodFX03, "NPC Neck [Neck]", 0 as Float, 0 as Float, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 3
- target.PlayImpactEffect(SmallBloodFX04, "NPC Neck [Neck]", 0 as Float, 0 as Float, -1 as Float, 512 as Float, false, true)
- return
- endIf
- endIf
- endFunction
- function OnEnterBleedout()
- if AggressorRace != DragonRace || AggressorRace != AlduinRace
- self.bloodDrops()
- endIf
- endFunction
- ; Skipped compiler generated GotoState
- function bloodDrops()
- Int MaxAmount = 0
- while target.IsBleedingOut() && target != none && MaxAmount <= 100 && target.Is3DLoaded() == true
- picktexture = utility.RandomInt(0, 4)
- randomLocationX = utility.RandomFloat(0.000000, 0.600000)
- randomLocationY = utility.RandomFloat(0.300000, 0.900000)
- if target != none
- if picktexture == 0
- target.PlayImpactEffect(BloodFXDrop01, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- target.PlayImpactEffect(BloodSpurtArrow, asNodeName, 0 as Float, 0 as Float, 0 as Float, 512 as Float, false, true)
- elseIf picktexture == 1
- target.PlayImpactEffect(BloodFXDrop02, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- elseIf picktexture == 2
- target.PlayImpactEffect(BloodFXDrop03, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- elseIf picktexture == 3
- target.PlayImpactEffect(BloodFXDrop04, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- elseIf picktexture == 4
- target.PlayImpactEffect(BloodFXDrop05, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- target.PlayImpactEffect(BloodSpurtArrow, asNodeName, 0 as Float, 0 as Float, 0 as Float, 512 as Float, false, true)
- endIf
- endIf
- utility.wait(1.20000)
- MaxAmount += 1
- endWhile
- endFunction
- function randomHitTextureSmall()
- picktexture = utility.RandomInt(0, 3)
- randomLocationX = utility.RandomFloat(-0.500000, 0.500000)
- randomLocationY = utility.RandomFloat(-0.500000, 0.500000)
- if target != none
- if picktexture == 0
- target.PlayImpactEffect(SmallBloodFX01, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 1
- target.PlayImpactEffect(SmallBloodFX02, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 2
- target.PlayImpactEffect(SmallBloodFX03, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 3
- target.PlayImpactEffect(SmallBloodFX04, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- return
- endIf
- endIf
- endFunction
- function blooddropsDead()
- Int MaxAmount = 0
- while target != none && MaxAmount <= 2 && target.Is3DLoaded() == true
- picktexture = utility.RandomInt(0, 1)
- randomLocationX = utility.RandomFloat(0.000000, 0.500000)
- randomLocationY = utility.RandomFloat(0.000000, 0.500000)
- if target != none
- if picktexture == 0
- target.PlayImpactEffect(BloodFXDropNoSpec01, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- elseIf picktexture == 1
- target.PlayImpactEffect(BloodFXDropNoSpec02, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- endIf
- endIf
- utility.wait(0.500000)
- MaxAmount += 1
- endWhile
- endFunction
- function randomHitSplatterHEAD()
- picktexture = utility.RandomInt(0, 3)
- if target != none
- if picktexture == 0
- target.PlayImpactEffect(BloodFX01, "NPC Neck [Neck]", 0 as Float, 0 as Float, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 1
- target.PlayImpactEffect(BloodFX02, "NPC Neck [Neck]", 0 as Float, 0 as Float, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 2
- target.PlayImpactEffect(BloodFX03, "NPC Neck [Neck]", 0 as Float, 0 as Float, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 3
- target.PlayImpactEffect(BloodFX04, "NPC Neck [Neck]", 0 as Float, 0 as Float, -1 as Float, 512 as Float, false, true)
- return
- endIf
- endIf
- endFunction
- function randomHitTextureRandomLocation()
- picktexture = utility.RandomInt(0, 7)
- randomLocationX = utility.RandomFloat(-2.50000, 2.50000)
- randomLocationY = utility.RandomFloat(-2.50000, 2.50000)
- if picktexture == 0
- target.PlayImpactEffect(BloodFX01, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 1
- target.PlayImpactEffect(BloodFX02, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 2
- target.PlayImpactEffect(BloodFX03, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 3
- target.PlayImpactEffect(BloodFX04, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 4
- target.PlayImpactEffect(SmallBloodFX01, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 5
- target.PlayImpactEffect(SmallBloodFX02, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 6
- target.PlayImpactEffect(SmallBloodFX03, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 7
- target.PlayImpactEffect(SmallBloodFX04, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- return
- endIf
- endFunction
- function randomHitTexture()
- picktexture = utility.RandomInt(0, 3)
- randomLocationX = utility.RandomFloat(-0.500000, 0.500000)
- randomLocationY = utility.RandomFloat(-0.500000, 0.500000)
- if target != none
- if picktexture == 0
- target.PlayImpactEffect(BloodFX01, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 1
- target.PlayImpactEffect(BloodFX02, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 2
- target.PlayImpactEffect(BloodFX03, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- return
- elseIf picktexture == 3
- target.PlayImpactEffect(BloodFX04, asNodeName, randomLocationX, randomLocationY, -1 as Float, 512 as Float, false, true)
- return
- endIf
- endIf
- endFunction
- ;-- State -------------------------------------------
- state busy
- endState
- ;-- State -------------------------------------------
- auto state BloodEffects
- function OnEffectStart(Actor akTarget, Actor akCaster)
- target = akTarget
- caster = akCaster
- if target != none
- healthcurrent = target.GetAV("health")
- mindamage = zblood_severeMin.GetValue() * target.GetBaseAV("health")
- if target.isCommandedActor() == true
- isSummon = true
- endIf
- endIf
- endFunction
- function OnHit(objectreference akAggressor, Form akSource, Projectile akProjectile, Bool abPowerAttack, Bool abSneakAttack, Bool abBashAttack, Bool abHitBlocked)
- if !akSource as enchantment && !akSource as spell
- self.GotoState("busy")
- if target != none && akAggressor != none
- AggressorRace = (akAggressor as Actor).GetRace()
- if akSource.HasKeyword(WeapTypeBattleaxe) || akSource.HasKeyword(WeapTypeBow) || akSource.HasKeyword(WeapTypeDagger) || akSource.HasKeyword(WeapTypeGreatsword) || akSource.HasKeyword(WeapTypeMace) || akSource.HasKeyword(WeapTypeSword) || akSource.HasKeyword(WeapTypeWarAxe) || akSource.HasKeyword(WeapTypeWarHammer) || AggressorRace == DragonRace || AggressorRace == AlduinRace || AggressorRace == WerewolfBeastRace || akAggressor.HasKeyword(ActorTypeAnimal) || akAggressor.HasKeyword(ActorTypeGiant)
- if target.isInKillMove()
- if target as objectreference != akAggressor
- bKillmoved = true
- target.PlayImpactEffect(BloodSpurtWolf, asNodeName, 0 as Float, 0 as Float, 0 as Float, 512 as Float, false, true)
- endIf
- endIf
- if NodeChecked == false
- isValidHit = true
- if target.HasNode("NPC Spine2 [Spn2]")
- asNodeName = "NPC Spine2 [Spn2]"
- elseIf target.HasNode("NPC Spine2")
- asNodeName = "NPC Spine2"
- elseIf target.HasNode("NPC Ribcage")
- asNodeName = "NPC Ribcage"
- elseIf target.HasNode("Canine_Ribcage")
- asNodeName = "Canine_Ribcage"
- elseIf target.HasNode("Sabrecat_Ribcage[Spn4]")
- asNodeName = "Sabrecat_Ribcage[Spn4]"
- elseIf target.HasNode("[body]")
- asNodeName = "[body]"
- elseIf target.HasNode("ChaurusFlyerTorso")
- asNodeName = "ChaurusFlyerTorso"
- endIf
- NodeChecked = true
- if target.IsDead() && bKillmoved == false && !akSource.HasKeyword(WeapTypeBow)
- self.randomHitTextureSmall()
- self.randomHitTextureRandomLocationHIT()
- isFirstHit = true
- endIf
- endIf
- extrabloodchance = utility.RandomInt(1, 3)
- health = target.GetAVPercentage("health")
- damage = healthcurrent - target.GetAV("health")
- if !(abHitBlocked == true && health >= 0.500000)
- if damage >= mindamage && !akSource.HasKeyword(WeapTypeBow)
- self.randomHitTexture()
- else
- self.randomHitTextureSmall()
- endIf
- if health <= 0.500000 && extrabloodchance == 1 && bKillmoved == false
- self.randomHitTextureRandomLocationHIT()
- endIf
- endIf
- endIf
- endIf
- healthcurrent = target.GetAV("health")
- endIf
- self.GotoState("BloodEffects")
- endFunction
- endState
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement