Npc Delevel
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
-
- Posts: 21
- Joined: Wed Apr 27, 2011 10:33 pm
Npc Delevel
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number:5937
L2JDP Revision Number:9641
Hi everyone
i'm writing to you guys cause i need help with an npc delevel, when i start my gameserver i have an error, and in npc delevel folder i have a text error with:
Error on: C:\Users\camera mia\Desktop\Server h5\game\data\scripts\custom\10021_SubirLevel\__init__.py.error.log
Line: -1 - Column: -1
Traceback (innermost last):
File "custom/10021_SubirLevel/__init__.py", line 24, in ?
NameError: JQuest
my file py is:
import sys
import com.l2jserver.L2DatabaseFactory;
import com.l2jserver.gameserver.cache.HtmCache;
import com.l2jserver.gameserver.datatables.ExperienceTable;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
Qn = "10021_SubirLevel"
NPCid = [10021]
NPC = [10021]
ADENA = 57
QuestId = 10021
QuestName = "SubirLevel"
QuestDesc = "custom"
InitialHtml = "1.html"
print "importing custom: 10021_SubirLevel"
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent(self,event,st) :
htmltext = event
level = st.getPlayer().getLevel()
#Subimos level por 1kk
if event == "1":
if st.getQuestItemsCount(ADENA) >= 5000000:
st.takeItems(ADENA,5000000)
delexp = (st.player.getStat().getExp() - st.player.getStat() .getExpForLevel(level-1))
st.player.getStat().addExp(-delexp)
return "2.htm"
else:
htmltext = "You do not have enough adena!"
return htmltext
def onTalk (self,npcid,player):
st = player.getQuestState(qn)
st.setState(STARTED)
return InitialHtml
QUEST = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)
CREATED=State('Start',QUEST)
STARTED=State('Started',QUEST)
COMPLETED=State('Completed',QUEST)
QUEST.setInitialState(CREATED)
for npcId in NPC:
QUEST.addStartNpc(npcId)
QUEST.addTalkId(npcId)
Thank you
» Find Revision
L2J Revision Number:5937
L2JDP Revision Number:9641
Hi everyone
i'm writing to you guys cause i need help with an npc delevel, when i start my gameserver i have an error, and in npc delevel folder i have a text error with:
Error on: C:\Users\camera mia\Desktop\Server h5\game\data\scripts\custom\10021_SubirLevel\__init__.py.error.log
Line: -1 - Column: -1
Traceback (innermost last):
File "custom/10021_SubirLevel/__init__.py", line 24, in ?
NameError: JQuest
my file py is:
import sys
import com.l2jserver.L2DatabaseFactory;
import com.l2jserver.gameserver.cache.HtmCache;
import com.l2jserver.gameserver.datatables.ExperienceTable;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
Qn = "10021_SubirLevel"
NPCid = [10021]
NPC = [10021]
ADENA = 57
QuestId = 10021
QuestName = "SubirLevel"
QuestDesc = "custom"
InitialHtml = "1.html"
print "importing custom: 10021_SubirLevel"
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent(self,event,st) :
htmltext = event
level = st.getPlayer().getLevel()
#Subimos level por 1kk
if event == "1":
if st.getQuestItemsCount(ADENA) >= 5000000:
st.takeItems(ADENA,5000000)
delexp = (st.player.getStat().getExp() - st.player.getStat() .getExpForLevel(level-1))
st.player.getStat().addExp(-delexp)
return "2.htm"
else:
htmltext = "You do not have enough adena!"
return htmltext
def onTalk (self,npcid,player):
st = player.getQuestState(qn)
st.setState(STARTED)
return InitialHtml
QUEST = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)
CREATED=State('Start',QUEST)
STARTED=State('Started',QUEST)
COMPLETED=State('Completed',QUEST)
QUEST.setInitialState(CREATED)
for npcId in NPC:
QUEST.addStartNpc(npcId)
QUEST.addTalkId(npcId)
Thank you
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: Npc Delevel
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
-
- Posts: 21
- Joined: Wed Apr 27, 2011 10:33 pm
Re: Npc Delevel
Thx m8, i already tried this one but i can't load it, if you can tell me the steps to do it plz.
thank you
thank you
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: Npc Delevel
Add to scripts.cfg, change the cost inside the script, restart server.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
-
- Posts: 21
- Joined: Wed Apr 27, 2011 10:33 pm
Re: Npc Delevel
I have this error
Error on: C:\Users\camera mia\Desktop\Server h5\game\data\scripts\custom\DelevelManager\DelevelManager.java.error.log
Line: -1 - Column: -1
java.lang.ClassNotFoundException: Custom.DelevelManager.DelevelManager
Error on: C:\Users\camera mia\Desktop\Server h5\game\data\scripts\custom\DelevelManager\DelevelManager.java.error.log
Line: -1 - Column: -1
java.lang.ClassNotFoundException: Custom.DelevelManager.DelevelManager
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: Npc Delevel
Did you use v5?
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: Npc Delevel
Eh, fucked if I know what's wrong there, nobody else has had any problems loading the script for years, so it must be something you did.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
-
- Posts: 21
- Joined: Wed Apr 27, 2011 10:33 pm
Re: Npc Delevel
maybe the error is what i put on config?
i added this in the end of config
custom/DelevelManager/DelevelManager.java
and i have this error
Error on: C:\Users\camera mia\Desktop\Server h5\game\data\scripts\custom\DelevelManager\DelevelManager.java.error.log
Line: -1 - Column: -1
no main method in custom.DelevelManager.DelevelManager
i added this in the end of config
custom/DelevelManager/DelevelManager.java
and i have this error
Error on: C:\Users\camera mia\Desktop\Server h5\game\data\scripts\custom\DelevelManager\DelevelManager.java.error.log
Line: -1 - Column: -1
no main method in custom.DelevelManager.DelevelManager
- Konstantinos
- Posts: 501
- Joined: Wed Feb 08, 2012 12:19 pm
Re: Npc Delevel
any error in eclipse? red line?
-
- Posts: 21
- Joined: Wed Apr 27, 2011 10:33 pm
Re: Npc Delevel
i didn't use eclipse, i need just to load the java file?
- Konstantinos
- Posts: 501
- Joined: Wed Feb 08, 2012 12:19 pm
Re: Npc Delevel
idk then without eclipse 
i have check the file with eclipse and its ok so something is wrong from you.

i have check the file with eclipse and its ok so something is wrong from you.