SkullMonster Print
Written by Mithrandir   
Wednesday, 10 February 2010 08:48

Taken from Pilgrim's post:

When giant skulls creak open it's usually not a good sign. This machine is no exception. It unlocks by message or virtual object and then opens when approached by the Player to generate a monster. Of course you could go for an anticlimax and have it spawn a chicken. Included in the zip is the TMORT custom mesh for Quest Editor display purposes. The machine has a radius of 3 blocks and I found it best to draw a line of 5 collisions behind it and then behind that in the middle a line of 3 collisions.

STATE_MACHINE {
KEY {SkullMonster}
COMMENT [Giant skull that opens by message or virtual object after the Player approaches and generates a monster.]

PARAM {
KEY {1}
TYPE {FRAME}
DISPLAY {}
DEFAULT {TMORT}
COMMENT [Quest Editor display:]}

PARAM {
KEY {2}
TYPE {INT}
DEFAULT {1}
COMMENT [Message to open skull:]}

PARAM {
KEY {3}
TYPE {OBJECT}
COMMENT [Virtual object to open skull:]}

PARAM {
KEY {4}
TYPE {SOUND}
DEFAULT {STONEDRAG}
COMMENT [Opening sound:]}

PARAM {
KEY {5}
TYPE {MONSTER}
DEFAULT {ROLLANDLC}
COMMENT [Monster generated:]}

PARAM {
KEY {6}
TYPE {SOUND}
DEFAULT {ROLANDATK}
COMMENT [Monster generation sound:]}

PARAM {
KEY {7}
TYPE {ALPHA}
COMMENT [Monster effect (e.g.: FUMEE)]}

CODE [
TRAP {
KEY {%0}
FLAG {HANDLE|LIGHTBUFFER|LIGHT|NOSHADOW}
SKELFILE {SKULL}

STATE {
KEY {CLOSED}
SETCOLLID {3}
SKELNAME {SKULL}
SKELANIM {STATIC1}
MULTI {
CONDITION {
MSG {%2}
GOTO {WAIT}}
CONDITION {
OBJECT {%3}
GOTO {WAIT}}}}

STATE {
KEY {WAIT}
SETCOLLID {3}
SKELNAME {SKULL}
SKELANIM {STATIC1}
MULTI {
CONDITION {
COLLIDEX {1,4,1}
GOTO {OPENING}}}}

STATE {
KEY {OPENING}
SETCOLLID {3}
SKELNAME {SKULL}
SKELANIM {OPEN}
ACTION {
SOUND {%4}}
MULTI {
CONDITION {
ENDANIM {}
GOTO {OPEN}}}}

STATE {
KEY {OPEN}
CLEARCOLLID {3}
SKELNAME {SKULL}
SKELANIM {STATIC2}
ACTION {
MONSTER {%5}
SOUND {%6}
EFFECT {%7}}}}]}