Code
if reacting to arrives then zoneenc; ##zoneenc: if $init_obj's class == 'player' then zonemaybe; ##zonemaybe: runsub zoneenc1/7; ##zoneenc1: if $loc > 0 then zoneenc1x; ##zoneenc1x: $loczone = $loc's material; if $loczone like _zone_ then continue else zoneenc2; ##zoneenc2: $matvals = $actor's matvals; manipulate $matvals get zone to $zonename; find 66621,$zonename; if $found_id > 0 then zoneenc3; ##zoneenc3: $zonefrom = $found_id; find $found_id,random; $encfrom = $found_id; if $encfrom's host > 0 then zonehost; $compare = 'buttonplayer'; $encclass = $encfrom's class; if $compare like $encclass then continue else zoneenc4; ##zonehost: $encfrom = $encfrom's host; ##zoneenc4: $encloc = $init_obj's loc; $level = $encfrom's extra; $skill = $level; multiply $skill by 10; $scap = $level; add 1 to $scap; multiply $scap by 10; $skillvals = "aim=svalue=$skill}2{smod=0}2{spoints=0}2{scap=$scap}1{dodge=svalue=$skill}2{smod=0}2{spoints=0}2{scap=$scap"; $mlevel = $encfrom's pose; if $mlevel > 0 then zonemagic; multiply $mlevel by 10; $worth = $encfrom's worth; copy $encfrom; set $encfrom's worth to $worth; $encid = $new_id; $mat = $encfrom's material; swap $mat add _living_; swap $mat add _encounter_; set $encid's material to $mat; set $encid's skillvals to $skillvals; multiset $encid to "health='$scap',healthmax='$scap',loc='$encloc',worth='$worth',pose='',extra='',mana='$mana',manamax='$manamax'"; foreach in $zonefrom do zonehosts; foreach in $encfrom do zoneinv; $target = $encid; $second = $init_obj; msg $loc,$actor,$target,$second,"wakes","[$encid] suddenly arrives!"; ##zonemagic; $mana = $mlevel; $manamax = $mlevel; $skillvals = "$skillvals}1{mysticism=svalue=$mlevel}2{smod=0}2{spoints=0}2{scap=$mlevel}1{sorcery=svalue=$mlevel}2{smod=0}2{spoints=0}2{scap=$mlevel}1{necromancy=svalue=$mlevel}2{smod=0}2{spoints=0}2{scap=$mlevel"; ##zonehosts: $fhost = $for_id's host; if $for_id's host == $encfrom then zonehosts2; ##zonehosts2: $worth = $for_id's worth; copy $for_id; set $for_id's worth to $worth; $health = $for_id's health; $healthmax = $for_id's healthmax; multiset $new_id to "health='$health',healthmax='$healthmax',loc='$encloc',worth='$worth',host='$encid'"; ##zoneinv: $worth = $for_id's worth; copy $for_id; set $for_id's worth to $worth; $health = $for_id's health; $healthmax = $for_id's healthmax; multiset $new_id to "health='$health',healthmax='$healthmax',loc='$encid',worth='$worth'";