Jump to content

Question

Posted

Hello i search forum for my problem but i don't find sth..  so i post it here...

 

i updated my server pack L2J server Beta to a new revirsion and i have  problem with my custom npcs... like toplist npc

 

the code is this .

import sys
from java.util import Iterator
from com.l2jserver import L2DatabaseFactory
from com.l2jserver.gameserver.model.quest import State
from com.l2jserver.gameserver.model.quest import QuestState
from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest

qn = "36601_Toplist"

NPC         = 36601
QuestId     = 36601
MIN_LEVEL   = 0
MAX_LEVEL   = 86
QuestName   = "Toplist"
QuestDesc   = "custom"
InitialHtml = "1.htm"
DonateMaster  = "This ain't no free service nubblet! Now get out of my hare... Get it, 'hare'? - That gets me every time!"


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()
	levelup = 86 - level
	if level < MIN_LEVEL :
		return"<html><head><body>No quicky for you! - Your to young shorty!</body></html>"
	if level > MAX_LEVEL :
	    return"<html><head><body>No quicky for you! - Your to old fatty!</body></html>"

	else:
            		#PK INFO
		if event == "01":
		 con = L2DatabaseFactory.getInstance().getConnection()
		 total_asesinados = 0
		 htmltext_ini = "<html><head><title>PK List</title></head><body><table width=300><tr><td><font color =\"FF00FF\">Pos.</td><td><center><font color =\"FFFF00\">*** Player ***</color></center></td><td><center>*** Kill's ***</center></td></tr>"
		 htmltext_info =""
		 color = 1
		 pos = 0
		 pks = con.prepareStatement("SELECT char_name,pkkills FROM characters WHERE pkkills>0 and accesslevel=0 order by pkkills desc limit 50")
		 rs = pks.executeQuery()
		 while (rs.next()) :
		   char_name = rs.getString("char_name")
		   char_pkkills = rs.getString("pkkills")
		   total_asesinados = total_asesinados + int(char_pkkills)
		   pos = pos + 1
		   posstr = str(pos)
		   if color == 1:
		      color_text = "<font color =\"00FFFF\">"
		      color = 2
		      htmltext_info = htmltext_info + "<tr><td><center><font color =\"FF00FF\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pkkills + "</center></td></tr>"
		   elif color == 2:
		      color_text = "<font color =\"FF0000\">"
		      color = 1
		      htmltext_info = htmltext_info + "<tr><td><center><font color =\"FF00FF\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pkkills + "</center></td></tr>"
		 htmltext_end = "</table><center><font color=\"FFFFFF\">" + "A Total of " + str(total_asesinados) + " Pk's.</center></body></html>"
		 htmltext_pklist = htmltext_ini + htmltext_info + htmltext_end
		 L2DatabaseFactory.close(con)
		 return htmltext_pklist

            		#PVP INFO
		if event == "02":
		 con = L2DatabaseFactory.getInstance().getConnection()
		 total_asesinados = 0
		 htmltext_ini = "<html><head><title>PvP List</title></head><body><table width=300><tr><td><font color =\"FF00FF\">Pos.</td><td><center><font color =\"FFFF00\">*** Player ***</color></center></td><td><center>*** Kill's ***</center></td></tr>"
		 htmltext_info =""
		 color = 1
		 pos = 0
		 pks = con.prepareStatement("SELECT char_name,pvpkills FROM characters WHERE pvpkills>0 and accesslevel=0 order by pvpkills desc limit 50")
		 rs = pks.executeQuery()
		 while (rs.next()) :
		   char_name = rs.getString("char_name")
		   char_pvpkills = rs.getString("pvpkills")
		   total_asesinados = total_asesinados + int(char_pvpkills)
		   pos = pos + 1
		   posstr = str(pos)
		   if color == 1:
		      color_text = "<font color =\"00FFFF\">"
		      color = 2
		      htmltext_info = htmltext_info + "<tr><td><center><font color =\"FF00FF\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pvpkills + "</center></td></tr>"
		   elif color == 2:
		      color_text = "<font color =\"FF0000\">"
		      color = 1
		      htmltext_info = htmltext_info + "<tr><td><center><font color =\"FF00FF\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pvpkills + "</center></td></tr>"
		 htmltext_end = "</table><center><font color=\"FFFFFF\">" + "A Total of " + str(total_asesinados) + " PvP's.</center></body></html>"
		 htmltext_pklist = htmltext_ini + htmltext_info + htmltext_end
		 L2DatabaseFactory.close(con)
		 return htmltext_pklist

		if htmltext != event:

			st.exitQuest(1)

	return htmltext



def onFirstTalk (self,npc,player):

   st = player.getQuestState(qn)

   if not st : st = self.newQuestState(player)

   return InitialHtml


QUEST = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)
QUEST.addStartNpc(NPC)
QUEST.addFirstTalkId(NPC)
QUEST.addTalkId(NPC)
print "###############################"
print "#      Top Lists - Loaded     #"
print "#                             #"

 

and when i start my gameserver.bat show me an error . i go to __init__.py error,log and i see this

 

Error on: C:\server new\game\data\scripts\custom\36601_Toplist\__init__.py.error.log
Line: -1 - Column: -1

Traceback (innermost last):
  File "custom/36601_Toplist/__init__.py", line 6, in ?
ImportError: no module named jython

 

and its true because no jython moduls is at com.l2jserver.gameserver.model.quest.jython .....

 

and here is a foto of my java

 

xe.png

 

any solution ... to change com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest  to sth else location that will exist jython??

 

thn'x in advance

 

Recommended Posts

  • 0
Posted

its the first thing that made..... but with no solution..

 

try delete it xD

 

PS i'm waiting maxtor to fix this then i reply with solution

  • 0
Posted

i have tried to delete it but another error apears....

i have tried to change it to com.l2jserver.gameserver.model.quest import Quest as JQuest  (because this link exists..) but npc's not working well some times don't get adena for the work that do.. buffer don't remove  buffs...

 

and now i'm tired to change - restart server - test . change - restart server - test.... :D because of that i post it here...

 

  • 0
Posted

i have tried to delete it but another error apears....

i have tried to change it to com.l2jserver.gameserver.model.quest import Quest as JQuest  (because this link exists..) but npc's not working well some times don't get adena for the work that do.. buffer don't remove  buffs...

 

and now i'm tired to change - restart server - test . change - restart server - test.... :D because of that i post it here...

 

so its hi5 correct?

  • 0
Posted

yeah.. it's correct this npc's worked correctly before server update revision.. and now it's not..

Ok ill check... lastest updates

 

OFFTOPIC:

There is smth wrong with topic sizes and i'm sick to search the button quote :)

  • 0
Posted

OFFTOPIC:

There is smth wrong with topic sizes and i'm sick to search the button quote :)

 

OFFTIPIC: yeah it's one line of npc code that is too big ... because of that is big... 

 

 

and now i'm searching on l2jserver forum of sth exists about this problem...

  • 0
Posted

OFFTIPIC: yeah it's one line of npc code that is too big ... because of that is big... 

 

 

and now i'm searching on l2jserver forum of sth exists about this problem...

 

nop its cuz of Counting Down in the news of forum...

  • 0
Posted

This is the old one.... i have long time to see what l2j is doing right now. Ill make a check wen i have free time.

 

 

/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
* 
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
* 
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.l2j.gameserver.model.quest;

import com.l2jserver.gameserver.model.quest.Quest;

public abstract class QuestJython extends Quest
{
/**
 * Constructor used in jython files.
 * @param questId : int designating the ID of the quest
 * @param name : String designating the name of the quest
 * @param descr : String designating the description of the quest
 */
public QuestJython(int questId, String name, String descr)
{
	super(questId, name, descr);
}
}

  • 0
Posted

This is the old one.... i have long time to see what l2j is doing right now. Ill make a check wen i have free time.

 

 

/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
* 
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
* 
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.l2j.gameserver.model.quest.jython;

import com.l2jserver.gameserver.model.quest.Quest;

public abstract class QuestJython extends Quest
{
/**
 * Constructor used in jython files.
 * @param questId : int designating the ID of the quest
 * @param name : String designating the name of the quest
 * @param descr : String designating the description of the quest
 */
public QuestJython(int questId, String name, String descr)
{
	super(questId, name, descr);
}
}

 

this is the old one com.l2jserver.gameserver.model.quest.jython  ??? 

if its is its good idea to add it as java file in eclipse?

 

  • 0
Posted

this is the old one com.l2jserver.gameserver.model.quest.jython  ??? 

if its is its good idea to add it as java file in eclipse?

 

 

mmmm w8

 

name it QuestJython.java and put this inside and lets see :P

 

at com.l2jserver.l2j.gameserver.model.quest

 

/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
* 
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
* 
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.l2j.gameserver.model.quest;

import com.l2jserver.gameserver.model.quest.Quest;

public abstract class QuestJython extends Quest
{
/**
 * Constructor used in jython files.
 * @param questId : int designating the ID of the quest
 * @param name : String designating the name of the quest
 * @param descr : String designating the description of the quest
 */
public QuestJython(int questId, String name, String descr)
{
	super(questId, name, descr);
}
}

  • 0
Posted

i have tried to delete it but another error apears....

i have tried to change it to com.l2jserver.gameserver.model.quest import Quest as JQuest  (because this link exists..) but npc's not working well some times don't get adena for the work that do.. buffer don't remove  buffs...

 

and now i'm tired to change - restart server - test . change - restart server - test.... :D because of that i post it here...

 

 

i'have tried

Guest
This topic is now closed to further replies.


  • Posts

    • 🚀 End-of-month restock! Upgrade your personal Gmail to 5TB + Gemini Pro instantly with 100% private automated delivery!
    • Καλησπερα, εχει εδω και καποιους μηνες πειραματιζομαι με το νεο μοντελο του chatgpt (free) και η αληθεια ειναι πως αυτο το πραγμα δεν εχει πλεον οριο στο τι μπορει καποιος να κανει και πραγματικα δεν εχει σχεση με κανενα προηγούμενο μοντελο.  Μεσα σε αυτους τους μηνες εχω καταφερει να κανω socket system, με κενουργιες native https://www.youtube.com/watch?v=ltiLhNKyIT8 Να προσθεσω περισσοτερα απο 1 Mount https://www.youtube.com/watch?v=fN14hjs0qng&t=2s Να βαλω Skill σε Pets ή Wings οπου κανει τον χαρακτηρα να πεταει https://www.youtube.com/watch?v=VK4K65nsHEI&t=1s & https://www.youtube.com/watch?v=7e-RLcHWWXA&t=6s Να βαλω Weapon ukx απο Final Gracia και να αλλαζω την θεση του Weapon Live μεσο .ini και σκεφτομαι οτι μπορουμε να διορθωσουμε το υπαρχων cloak system του interlude με σωστα behavior απο final gracia σαν να υπηρχε απο πριν και σιγουρα μπορουμε να κανουμε ξεχωριστω συστημα για agathions ωστε να εχουν και αυτα σωστη συμπεριφορα. (πραγματα που εδω και 20 χρονια δεν ειχαν γινει) επισης εχω δει και μια ταση τωρα τελευταια, να προσπαθουν να βαλουν dlss5. ενω dlss5 ουσιαστικα για να τρεξει πρεπει να εχεις rtx 5090 και υπαρχει μονο σε λιγα games. αυτο που κανουν ολοι μεχρι στιγμης ειναι να βαλουν ενα απλο ReShader με preset στο system και να το παρουσιαζουν σαν dlss5.  αυτο που ειναι εφικτο σχετικα με τα γραφικα απο οσο καταλαβα για το l2 ειναι ισως το dlss4.5 οπου μπορει να τρεξει ακομα και σε rtx 2060, απλα 4.5 στην ουσια ηταν σαν BETA εκδωση και δεν εχει αναπτυχθεί για πολλα games οποτε θα ειναι δυσκολο στο να βρεις ενα module που να τεριαζει στο engine του l2. αλλα εστω οτι παιρνουμε το pattern και το φτιαχνουμε και αυτο, ισως μετα θα πρεπει να εχουμε installer για τον server ωστε να μπορει να γινει dedicated app στην gpu  αλλα ολο αυτο που τελειωνει ? ή τι ακριβως ειναι αυτο που βλεπουμε να αρχιζει ?   πραγματικα δεν μπορω να κανω προβλεψει για το μελλον, γιατι ουσιαστικα μιλαμε για μια κενουργια εποχη στα games. Μοιραστείτε την σκεψη σας ελευθερα
  • Topics

×
×
  • 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..