- Joined
- Nov 25, 2008
- Messages
- 1,309
Of the several methods to create a corpse none is stranger than the way to literally create a corpse;
What is so special about the started time, the unit group, and the blend time? What if i want a permanent corpse that doesn't go away, but works with Raise Dead, Animate Death, Resurrection, Cannibalize, and Pick Up Corpse?
What if i wanted to remove the corpse later from the game? What special things do i need to do to not cause errors?
native CreateCorpse takes player whichPlayer, integer unitid, real x, real y, real face returns unit
. However, if you want to create a permanent corpse you need;
JASS:
function CreatePermanentCorpseLocBJ takes integer style, integer unitid, player whichPlayer, location loc, real facing returns unit
set bj_lastCreatedUnit = CreateCorpse(whichPlayer, unitid, GetLocationX(loc), GetLocationY(loc), facing)
call SetUnitBlendTime(bj_lastCreatedUnit, 0)
if (style == bj_CORPSETYPE_FLESH) then
call SetUnitAnimation(bj_lastCreatedUnit, "decay flesh")
call GroupAddUnit(bj_suspendDecayFleshGroup, bj_lastCreatedUnit)
elseif (style == bj_CORPSETYPE_BONE) then
call SetUnitAnimation(bj_lastCreatedUnit, "decay bone")
call GroupAddUnit(bj_suspendDecayBoneGroup, bj_lastCreatedUnit)
else
// Unknown decay style - treat as skeletal.
call SetUnitAnimation(bj_lastCreatedUnit, "decay bone")
call GroupAddUnit(bj_suspendDecayBoneGroup, bj_lastCreatedUnit)
endif
call TimerStart(bj_delayedSuspendDecayTimer, 0.05, false, null)
return bj_lastCreatedUnit
endfunction
What if i wanted to remove the corpse later from the game? What special things do i need to do to not cause errors?