Don't like ads? PRO users don't see any ads ;-)
Guest

corpse disintegrate

By: Mellen on Feb 18th, 2013  |  syntax: None  |  size: 1.16 KB  |  hits: 30  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Scriptname DisintegrateCorpses extends activemagiceffect  
  2.  
  3. EffectShader Property pShader  Auto
  4. ;easy way of setting the shader effect we want to use
  5.  
  6. Event OnEffectStart(Actor akTarget, Actor akCaster)
  7. ;start doing the stuff listed below whenever this spell hits something
  8. ;akTarget tells the game what the spell hit, akCaster tells it who cast the spell
  9.  
  10.         Bool aretheydead = akTarget.IsDead()
  11.         ;sets a variable to either 1 or 0, depending on whether the thing that the spell hit is dead
  12.  
  13.         If aretheydead == 1
  14.         ;start doing the stuff listed below only if the thing above turned out to be 1
  15.                 pShader.play(akTarget)
  16.                 ;apply the shader effect you set in the properties to the unfortunate victim
  17.                 akTarget.AttachAshPile()
  18.                 ;put a lootable ash pile under the corpse
  19.                 Utility.Wait(3.0)
  20.                 ;give the effects a few seconds to finish so that everything looks pretty
  21.                 akTarget.SetAlpha (0.0)
  22.                 ;make sure the corpse is fully invisible, to prevent things looking weird
  23.                 akTarget.ForceRemoveRagdollFromWorld()
  24.                 ;sends the ragdoll off to the scary room so that nothing will bump into it
  25.         Else
  26.                 ;otherwise, if it's not dead, fuck it all and do nothing
  27.         EndIf
  28. EndEvent