Skip to content

teleport when clicking on NPC

Featured Replies

Author: AlexMan

# Created by Ham Wong on 2007.02.28

import sys

 

from net.sf.l2j.gameserver.model.quest        import State

from net.sf.l2j.gameserver.model.quest        import QuestState

from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest

 

qn = "2400_toivortex_exit"

NPC=[29055]

 

class Quest (JQuest) :

 

def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)

 

def onTalk (Self,npc,player):

    chance = st.getRandom(3)

    if chance == 0:

      x=108784+st.getRandom(100)

      y=16000+st.getRandom(100)

      z=-4928

    elif chance == 1:

      x=113824+st.getRandom(100)

      y=10448+st.getRandom(100)

      z=-5164

    else:

      x=115488+st.getRandom(100)

      y=22096+st.getRandom(100)

      z=-5168

    player.teleToLocation(x,y,z)

    st.exitQuest(1)

    return

 

QUEST      = Quest(2400,qn,"Teleports")

 

for item in NPC:

  QUEST.addStartNpc(item)

  QUEST.addTalkId(item)

I think it's useless.

Anyway, much better to code it on java.

Also better to do it with onFirstTalk (?) If you are not gonna give multiple options to the player.

  • Author

I think it's useless.

Anyway, much better to code it on java.

Also better to do it with onFirstTalk (?) If you are not gonna give multiple options to the player.

there are three areas which will receive a random teleport

Yea.. I have seen it. But these 3 areas are randomly choosen, so you are only giving 1 option to the player and depending on his luck will teleport to 1 of these 3 areas...

  • 10 months later...

easy code

 

next time share it before someone else since its easy and dont spam , next time u post something like this i will dekarma u ....

 

On Topic :

 

Nice work mate

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.