At the beginning you see the parameter_define_begin which i believe are 4 different random locations it will teleport to depending on which branch the ai.obj gets to.
Orfen snippet of his Ai code (you can see teleport functions, not exactly sure how each get called)
Code:
class ai_boss03_orfen : party_leader_aggressive
parameter_define_begin
int b03_x1 0
int b03_y1 0
int b03_z1 0
int b03_x2 0
int b03_y2 0
int b03_z2 0
int b03_x3 0
int b03_y3 0
int b03_z3 0
int b03_x4 0
int b03_y4 0
int b03_z4 0
parameter_define_end
handler 13 // CREATED
variable_begin
"i6"
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // flag
push_const 1716
add
push_reg_sp
fetch_i
push_const 0
assign
shift_sp -1
push_event // myself
push_const 28
add
fetch_i // i_ai0
push_const 2336
add
push_reg_sp
fetch_i
push_const 0
assign
shift_sp -1
shift_sp 1
push_const 3001
push_const 10000
func_call 28 // func[AddTimerEx]
shift_sp -2
shift_sp -1
call_super
handler_end
handler 12 // TIMER_FIRED_EX
variable_begin
"timer_id"
"i6"
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end
push_event // timer_id
push_const 176
add
fetch_i
push_const 3001
equal
branch_false L2296
L2295
push_event // myself
push_const 28
add
fetch_i // i_ai0
push_const 2336
add
fetch_i
push_const 1
equal
push_reg_sp
fetch_i
branch_false L2297
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // hp
push_const 344
add
fetch_d
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i // max_hp
push_const 1000
add
fetch_d
push_const 0.950000
mul
greater
and
L2297
branch_false L2299
L2298
push_event // i6
push_const 216
add
push_reg_sp
fetch_i
shift_sp 1
push_const 100
func_call 55 // func[Rand]
shift_sp -1
assign
shift_sp -1
push_event // i6
push_const 216
add
fetch_i
push_const 33
less
branch_false L2301
L2300
shift_sp 1
push_parameter b03_x2
push_parameter b03_y2
push_parameter b03_z2
func_call 27 // func[SetTeleportPosOnLost]
shift_sp -3
shift_sp -1
shift_sp 1
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i
push_parameter b03_x2
push_parameter b03_y2
push_parameter b03_z2
func_call 46 // func[InstantTeleport]
shift_sp -4
shift_sp -1
jump L2302
L2301
push_event // i6
push_const 216
add
fetch_i
push_const 66
less
branch_false L2304
L2303
shift_sp 1
push_parameter b03_x3
push_parameter b03_y3
push_parameter b03_z3
func_call 27 // func[SetTeleportPosOnLost]
shift_sp -3
shift_sp -1
shift_sp 1
push_event // myself
push_const 28
add
fetch_i // sm
push_const 2400
add
fetch_i
push_parameter b03_x3
push_parameter b03_y3
push_parameter b03_z3
func_call 46 // func[InstantTeleport]
shift_sp -4
shift_sp -1
jump L2305
......
Here is part of the npcos.txt code for Orfen and a few things u can see defined. You will need to add to define the parameters for the ai for each mob i believe unless you can somehow figure a way in the ai.onj code to teleport to original location:
Code:
ai_parameters={[b03_x1]=[43728];[b03_y1]=[17220];[b03_z1]=[-4342];[b03_x2]=[55024];[b03_y2]=[17368];[b03_z2]=[-5412];[b03_x3]=[53504];[b03_y3]=[21248];[b03_z3]=[-5486];[b03_x4]=[53248];[b03_y4]=[24576];[b03_z4]=[-5262]}
Not sure if copying all of orfens teleport code will work, but this was just to show u a few of the obvious things I found while i took a few minutes looking around these files to point ya in the right direction.
Good luck, and share anything you fgure out to help the community grow