Jump to content
  • 0

[HELP]Few teleport locations


Question

Posted

Hallo, i have question, how i can create a few teleport location..

 

For exmample i have 3 coordinates location:

 

1 --------------2

|

|

|

|

|

3---------------

 

and i press on my custom teleporter button: "Wall of Agros"

 

and I want that one time teleporter teleport me to location 1, second for exmaple to 3... Random coord...

 

I think i need to create this teleporter based jython language...

 

I found tele script on 247_PossessorOfAPreciousSoul_4 quest

 

   elif event == "31740-5.htm" :
     if cond == 1 :
       st.set("cond","2")
       st.takeItems(CARADINE_LETTER_LAST,1)
     st.getPlayer().teleToLocation(143209,43968,-3038)

 

So i need something, like this

 

    st.getPlayer().teleToLocation(1545,43968,-3038)

    st.getPlayer().teleToLocation(143209,43968,-3038)

    st.getPlayer().teleToLocation(14251129,-45468,-3038)

    st.getPlayer().teleToLocation(1454209,44968,-2138)

 

a few cord...

 

I think you understand me.

4 answers to this question

Recommended Posts

  • 0
Posted

To get right coords use /loc in game in places you wish the spawns.

To get random spawns use in jython

...rest of script...
      landing == Rnd.get(100)
      if landing < 33:
            st.getPlayer().teleToLocation(143209,43968,-3038)
      elif landing < 66:
            st.getPlayer().teleToLocation(143209,43968,-3038)
      else:
            st.getPlayer().teleToLocation(1454209,44968,-2138)
...rest of script...

Dont forget to add at the beggining of the script:

from com.l2jserver.util                                                 import Rnd

If using different version than l2j epilogue you must check how the imports works in your pack and change to look like others.

 

  • 0
Posted

Rnd.get(100) generates a random number between 0 and 100. If the number is 0 to 32 the player will be teleported to the first location. If the number is between 33 and 65 the player will be teleported to the second location and so on.

Guest
This topic is now closed to further replies.


×
×
  • Create New...