Jump to content

Recommended Posts

Posted

Here iam again with a simple java guide

 

Go here:

gameserver\data\scripts\quests\247_PossessorOfAPreciousSoul_4\

and open __init__.py with notebook.

 

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 = "247_PossessorOfAPreciousSoul_4"

#NPC
CARADINE = 31740
LADY_OF_LAKE = 31745

#QUEST ITEM
CARADINE_LETTER_LAST = 7679
NOBLESS_TIARA = 7694

class Quest (JQuest) :

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

def onAdvEvent (self,event,npc, player) :
  htmltext = event
  st = player.getQuestState(qn)
  if not st : return
  cond = st.getInt("cond") 
  if event == "31740-3.htm" :
    if cond == 0 :
      st.set("cond","1")
      st.setState(State.STARTED)
      st.playSound("ItemSound.quest_accept")
  elif event == "31740-5.htm" :
    if cond == 1 :
      st.set("cond","2")
      st.takeItems(CARADINE_LETTER_LAST,1)
    st.getPlayer().teleToLocation(143209,43968,-3038)
  elif event == "31745-5.htm" :
    if cond == 2 :
      st.set("cond","0")
      st.getPlayer().setNoble(True)
      st.giveItems(NOBLESS_TIARA,1)
      st.playSound("ItemSound.quest_finish")
      st.exitQuest(False)
  return htmltext

def onTalk (self,npc,player):
  htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>"
  st = player.getQuestState(qn)
  if not st : return htmltext
  npcId = npc.getNpcId()
  id = st.getState()
  if npcId != CARADINE and id != State.STARTED : return htmltext
  cond = st.getInt("cond")
  if id == State.CREATED :
    st.set("cond","0")
  if player.isSubClassActive() :
    if npcId == CARADINE :
        if st.getQuestItemsCount(CARADINE_LETTER_LAST) == 1 :
          if cond in [0,1] :
            if id == State.COMPLETED :
              htmltext = "<html><body>This quest has already been completed.</body></html>"
            elif player.getLevel() < 75 : 
              htmltext = "31740-2.htm"
              st.exitQuest(1)
            elif player.getLevel() >= 75 :
              htmltext = "31740-1.htm"
        elif cond == 2 :
            htmltext = "31740-6.htm"
    elif npcId == LADY_OF_LAKE and cond == 2 :
        htmltext = "31745-1.htm"
  else :
    htmltext = "<html><body>This quest may only be undertaken by sub-class characters of level 50 or above.</body></html>"
  return htmltext

QUEST       = Quest(247,qn,"Possessor Of A Precious Soul - 4")

QUEST.addStartNpc(CARADINE)
QUEST.addTalkId(CARADINE)
QUEST.addTalkId(LADY_OF_LAKE)

 

Change Quest item/noblesse tiara:

#QUEST ITEM
CARADINE_LETTER_LAST = Write ID of item here what you want to become noblesse
NOBLESS_TIARA = Noblesse Tiara's ID

 

Change NPC:

 

#NPC
CARADINE = Caradine's ID(u need to write here the new "caradine's" ID)
LADY_OF_LAKE = Lady of Lake ID

 

Others:

 

            if id == State.COMPLETED :
              htmltext = "<html><body>This quest has already been completed.</body></html>" <-messenge when the
                                                                                                                                            noblesse has compleated
            elif player.getLevel() < 75 : <- minimum level for noblesse
              htmltext = "31740-2.htm"
              st.exitQuest(1)
            elif player.getLevel() >= 75 :<- minimum level for noblesse
              htmltext = "31740-1.htm"

[move]

::: Credits to me :::

::: Report bugs/problems :::[/move]

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..