Npc Delevel

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
Nayden
Posts: 21
Joined: Wed Apr 27, 2011 10:33 pm

Npc Delevel

Post by Nayden »

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
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Npc Delevel

Post by jurchiks »

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.
Nayden
Posts: 21
Joined: Wed Apr 27, 2011 10:33 pm

Re: Npc Delevel

Post by Nayden »

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
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Npc Delevel

Post by jurchiks »

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.
Nayden
Posts: 21
Joined: Wed Apr 27, 2011 10:33 pm

Re: Npc Delevel

Post by Nayden »

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
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Npc Delevel

Post by jurchiks »

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.
Nayden
Posts: 21
Joined: Wed Apr 27, 2011 10:33 pm

Re: Npc Delevel

Post by Nayden »

yes
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Npc Delevel

Post by jurchiks »

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.
Nayden
Posts: 21
Joined: Wed Apr 27, 2011 10:33 pm

Re: Npc Delevel

Post by Nayden »

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
User avatar
Konstantinos
Posts: 501
Joined: Wed Feb 08, 2012 12:19 pm

Re: Npc Delevel

Post by Konstantinos »

any error in eclipse? red line?
Nayden
Posts: 21
Joined: Wed Apr 27, 2011 10:33 pm

Re: Npc Delevel

Post by Nayden »

i didn't use eclipse, i need just to load the java file?
User avatar
Konstantinos
Posts: 501
Joined: Wed Feb 08, 2012 12:19 pm

Re: Npc Delevel

Post by Konstantinos »

idk then without eclipse :shock:

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