Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

L2J noblesse npc

Newbie Spellweaver
Joined
Jul 22, 2006
Messages
7
Reaction score
0
hi i seen this to make lvl 80 char noblesse for 10 goldbars but is wasnt made for l2j so changed the imports but it dosnt work,shows text but when click on button dosnt do anthing,no errors in console or anything its adde into scripts.cfg.
any help would be nice thx this is script.

import sys
from java.util import Iterator
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
from net.sf.l2j.gameserver.datatables import ItemTable

SERVER_NAME = "http://titangracia.site11.com"
NPC=7202
QUEST_DATA = [8204,"NpcNoblesse","custom"]
ITEMS = [3470,10]
QN = str(QUEST_DATA[0]) + "_" + QUEST_DATA[1]

class NoblesseManager (JQuest) :

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

def onAdvEvent (self,event,npc,player) :
st = player.getQuestState(QN)
htmltext = event

def html(TEXT) :
return "<html><head><title>" + SERVER_NAME + "</title></head><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" + TEXT + "</center></body></html>"

if event == "make_noblesse":
if player.getLevel() < 85 :
return html("Your level is too low!")

elif player.isNoble() == 1 :
return html("You are already a noblesse!")

elif st.getQuestItemsCount(ITEMS[0]) < ITEMS[1] :
return html("You don't have enough <font color=\"LEVEL\">" + ItemTable.getInstance().getTemplate(int(ITEMS[0])).getName() + " </font>!")

else:
st.takeItems(ITEMS[0],ITEMS[1])
player.setNoble(True)
st.playSound("ItemSound.quest_finish")
return html("You are now a noblesse!<br>Congratulations!")

def onFirstTalk (self,npc,player):
st = player.getQuestState(QN)
if not st :
st = self.newQuestState(player)
s = "<html><head><title>"+SERVER_NAME+"</title></head><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>"
s += "I'm here to help you to become a noblesse!<br>All you need is <font color=\"LEVEL\">" + str(ITEMS[1]) + " " + ItemTable.getInstance().getTemplate(int(ITEMS[0])).getName() + "</font>!<br>"
s += "<button value=\"Make me noblesse\" action=\"bypass -h Quest "+QN+" make_noblesse\" width=200 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">"
s += "</center></body></html>"
return s

QUEST = NoblesseManager(QUEST_DATA[0],QN,QUEST_DATA[2])
QUEST.addStartNpc(NPC)
QUEST.addFirstTalkId(NPC)
 
Last edited:
Supreme Arcanarch
Joined
Apr 24, 2006
Messages
906
Reaction score
10
you failed to configure it.. remove the giveitem line and try again..
 
Upvote 0
Newbie Spellweaver
Joined
Jul 22, 2006
Messages
7
Reaction score
0
Hi thx for reply bu ti removed this line still same.

st.giveItems(ITEMS[2],ITEMS[3])
 
Upvote 0
Newbie Spellweaver
Joined
Jul 22, 2006
Messages
7
Reaction score
0
yes mate sorry i did remove it from code i just didnt edit the 1st post sorry
 
Upvote 0
Joined
Oct 5, 2006
Messages
4,293
Reaction score
103
i prefer java files not scripts :)

do you want to give you a way using a java file ? :)

btw in the script i think you should add the import for l2pcinstance
 
Last edited:
Upvote 0
Back
Top