// above actor APLAYER // **** Duke respawns without resetting the map or inventory **** // DUKE_RESPAWN gamevar DUKEANG 0 1 gamevar DUKEX 0 1 gamevar DUKEY 0 1 gamevar DUKEZ 0 1 appendevent EVENT_SPAWN // size of the green spinning Duke head ifactor DUKESTART sizeat 32 32 endevent actor DUKESTART // gets Duke's x,y,z, and angle - need more than just the sector setvar ISDUKESTART 1 // error check ifp palive break // if Duke is alive then do nothing - "break" can be used in other actors but be careful with APLAYER else { getactor[].ang DUKEANG getactor[].x DUKEX getactor[].y DUKEY getactor[].z DUKEZ } enda state RESPAWNDUKE // called from actor APLAYER ifp palive break else { quote 75 // blank quote to stop hard coded quote setplayer[].ang DUKEANG setplayer[].posx DUKEX setplayer[].posy DUKEY setplayer[].posz DUKEZ action PSTAND setplayer[].dead_flag 0 // set dead to 0 which is alive cstat 257 // this is how to fix Duke being invincible ifn player[].curr_weapon 0 // this is so Duke does not fire a weapon when revived setplayer[].curr_weapon 0 ifrnd 128 // random health { ifrnd 128 setactor[].extra 57 else setactor[].extra 62 } else { ifrnd 128 setactor[].extra 54 else setactor[].extra 65 } lockplayer 4 // This stops Duke from being knocked around after he is // brought back to life from the hit that just killed him. } ends // a sample under actor APLAYER ifaction PLYINGDEAD { ifactioncount 3 move PSTOPED quote 13 ifhitspace { /* action PSTAND spawn DUKELYINGDEAD resetplayer */ state RESPAWNDUKE } break }