Page 1 of 1

Npc Delevel

Posted: Sat Jul 27, 2013 12:45 pm
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

Re: Npc Delevel

Posted: Sat Jul 27, 2013 1:05 pm
by jurchiks

Re: Npc Delevel

Posted: Sat Jul 27, 2013 1:44 pm
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

Re: Npc Delevel

Posted: Sat Jul 27, 2013 1:55 pm
by jurchiks
Add to scripts.cfg, change the cost inside the script, restart server.

Re: Npc Delevel

Posted: Sat Jul 27, 2013 2:04 pm
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

Re: Npc Delevel

Posted: Sat Jul 27, 2013 2:08 pm
by jurchiks
Did you use v5?

Re: Npc Delevel

Posted: Sat Jul 27, 2013 2:10 pm
by Nayden
yes

Re: Npc Delevel

Posted: Sat Jul 27, 2013 2:33 pm
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.

Re: Npc Delevel

Posted: Sat Jul 27, 2013 2:38 pm
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

Re: Npc Delevel

Posted: Sat Jul 27, 2013 2:42 pm
by Konstantinos
any error in eclipse? red line?

Re: Npc Delevel

Posted: Sat Jul 27, 2013 3:25 pm
by Nayden
i didn't use eclipse, i need just to load the java file?

Re: Npc Delevel

Posted: Sat Jul 27, 2013 3:27 pm
by Konstantinos
idk then without eclipse :shock:

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