Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   How to force mobs to teleport back? (https://postpacific.loc-online.com/showthread.php?t=2354)

Gremilcar 25.10.2005 22:35

How to force mobs to teleport back?
 
Well i've tried to find a way to force mobs, to teleport back at their respawn place, when the get stuck in the walls(like Orfen), but i couldn't found any..

If u know how to fix it post it here or PM me...Any help would be greatly appreciated...

Truffe 25.10.2005 22:49

Heavy hexing/coding...

Else you can't.

Gremilcar 25.10.2005 23:22

Well that's kinda sucks, but thx anyway for a really fast responce !

Eliot 25.10.2005 23:23

I believe that Orfens AI is build like this. And it doesn't have anything to do with hexing. But i may be wrong, i didn't messed with it.

CubAfull 25.10.2005 23:25

make new geodata for SOS

pirateice 25.10.2005 23:50

something to do with the pathnode i guess

bob1122 26.10.2005 00:21

you need ai.obj work, NO HEXING REQUIRED, just look up ofren, or another teleporter, i myself dont know much ai.obj but know that its easily possible.

hint hint, allot of time people say hex, they have no idea what they are talking about :)

Gremilcar 26.10.2005 00:27

thx ppl for all your info gonna try it right now ^^

RmzVoid 26.10.2005 05:02

how you can catch moment then mob stucked?
throught ai now way.
just get coordinates x,y,z and compare it with saved in ai variables any time (timer?).

czar 26.10.2005 05:56

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 :)

Flamestrike 26.10.2005 08:36

Add Orfen's AI ?

Gremilcar 26.10.2005 15:03

Well i think that when Orfen spawns she starts with a 4 sets of clean coordinates, because they're defined as 0's...
Code:

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

but, after she's spawned, it records the coordinates for the teleport
Code:

  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

// I think that "shift_sp 1" and "shift_sp -1" are used as brackets, correct me if im wrong...

So later she can teleport back using
Code:

        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

AND there is a timer there:
Code:

        shift_sp 1
        push_const 3001
        push_const 10000
        func_call 28        //  func[AddTimerEx]
        shift_sp -2
        shift_sp -1

Yet im not a good programmer, but maybe using common sense i could figure this out to make other mobs to teleport back...

If there is any type of explanation of all these ai.obj language send me a link, i might be stupid but i'll learn fast :wink:

Gremilcar 26.10.2005 19:03

Quote:

Originally Posted by czar
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]}

I think that were Raikel teleports..

Orfen has only territory in npspos

Code:

territory_begin        [orphen_t21_18_001_01]        {{43084;15944;-4468;-4118};{45140;15816;-4468;-4118};{45748;17200;-4468;-4118};{44504;18780;-4468;-4118};{43284;18952;-4468;-4118};{42476;18164;-4468;-4118};{42480;16448;-4468;-4118}}        territory_end

Gremilcar 26.10.2005 19:38

Well I've tried to make an ai.obj scripd to teleport back the mobs...but with mob's that have a lot of differtent spawns its really an pain in the ass...
So i've got another idea..many ppl know that Ishka can somehow walk through walls on his way home...maybe we could use this...

any ideas?


All times are GMT. The time now is 15:55.