Jump to content
  • 0

Diskolia me ta Imports


Question

Posted

Kalispera paidia prospathw apo xtes na ftia3w ena npc (Olympiad Rank) Gia Frozen Pack alla den mporw na to ftiaxw me tpt...

Parakatw tha sas dixw kai to Init.py Pou einai ayto

 

import sys
from java.util                                 import Iterator
from com.l2jfrozen.gameserver.model.actor.instance  import L2PcInstance
from com.l2jfrozen.util.random                      import Rnd
from com.l2jfrozen.gameserver.model.quest           import State
from com.l2jfrozen.gameserver.model.quest           import QuestState
from com.l2jfrozen.gameserver.model.quest.jython    import QuestJython as JQuest
from com.l2jfrozen.gameserver.network.serverpackets import CreatureSay
from com.l2jfrozen.unit.database                    import L2DatabaseFactory

qn          = "20012_OlyRank"
NPC         = [50500]
QuestId     = 20012
QuestName   = "OlyRank"
QuestDesc   = "custom"
InitialHtml = "1.htm"
print "OlyRank started... Good"
class Quest (JQuest) :

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

def onTalk (self,npc,player):
	return InitialHtml

def onEvent(self,event,st):
	htmltext = event

	# Duelist
	if event == "88":

		INITIAL_HTML = "<html><head><title>Grand Olympiad Ranking</title></head><body><center><font color=66cc00>Olympiad Ranking Online System</font></center><br><center><img src=\"L2UI.SquareWhite\" width=300 height=1><img src=\"L2UI.SquareBlank\" width=1 height=3></center><table width=300 border=0 bgcolor=\"000000\"><tr><td>Psition</td><center><td>|</td></center><td><center>Name</center></td><center><td>|</td></center><td><center>Points</center></td><center><td>|</td></center><td><center>Fights</center></td></tr>"
		HTML_INFO =""			
		POSITION_VALUE_INITIAL = 0
		CONNECTION = L2DatabaseFactory.getInstance().getConnection()
		pts = CONNECTION.prepareStatement("SELECT characters.char_name,  olympiad_nobles.competitions_done, olympiad_nobles.olympiad_points  FROM olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND olympiad_nobles.class_id AND class_id=88 AND olympiad_nobles.competitions_done >= 3 order by olympiad_points desc, competitions_done desc");
		rs = pts.executeQuery()
		while (rs.next()) :
			CHAR_NAME = rs.getString("char_name")
			POINTS = rs.getString("olympiad_points")
			COMP_DONE = rs.getString("competitions_done")
			POSITION_VALUE_INITIAL = POSITION_VALUE_INITIAL + 1
			STRING_POSITION = str(POSITION_VALUE_INITIAL)
			HTML_INFO = HTML_INFO + "<tr><td><center>" + STRING_POSITION + "</td><center><td></td></center><td><center>" + CHAR_NAME +"</center></td><center><td></td></center><td><center>" + POINTS + "</center></td><center><td></td></center><td><center>" + COMP_DONE + "</center></td></tr>"
		HTML_END = "</table></body></html>"
		HTML_OLY = INITIAL_HTML + HTML_INFO + HTML_END
		CONNECTION.close()
		return HTML_OLY


# Dreadnought
	if event == "89":

Mpla Mpla mpla kai teleiwnei etsi

QUEST = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)

for npcId in NPC:
QUEST.addStartNpc(npcId)
QUEST.addTalkId(npcId)

 

Ti lathos exw kanei opois 3erei as me voithisei gia na teleiwsw to Npc mou!!!!

Eyxaristw poly

 

 

 

7 answers to this question

Recommended Posts

  • 0
Posted

Για δοκιμασε αυτο.

 

import sys
from java.util                                 import Iterator
from com.l2jfrozen.util.random                             import Rnd
from com.l2jfrozen.gameserver.model.quest          import State
from com.l2jfrozen.gameserver.model.quest           import QuestState
from com.l2jfrozen.gameserver.model.quest.jython   import QuestJython as JQuest
from com.l2jfrozen.gameserver.network.serverpackets import CreatureSay
from com.l2jfrozen.util.database                                  import L2DatabaseFactory

  • 0
Posted

Για δοκιμασε αυτο.

 

import sys
from java.util                                 import Iterator
from com.l2jfrozen.util.random                             import Rnd
from com.l2jfrozen.gameserver.model.quest          import State
from com.l2jfrozen.gameserver.model.quest           import QuestState
from com.l2jfrozen.gameserver.model.quest.jython   import QuestJython as JQuest
from com.l2jfrozen.gameserver.network.serverpackets import CreatureSay
from com.l2jfrozen.util.database                                  import L2DatabaseFactory

 

 

Tha to dokimasw twra

  • 0
Posted

Molis pataw show olympiad rank mou vgazi ayto

 

image.png  image.png

Δίνεις και το html code που δείχνεις στην φώτο? Να δούμε που οδηγεί ο κώδικας για Show olympiad ranking.

 

ή μάλλον : Έψαξα τα imports του l2jfrozen και το σωστό προς Database είναι έτσι

from com.l2jfrozen.util.database import L2DatabaseFactory

Οπότε σβήσε το τελευταίο line και δοκίμασε αυτό.

Guest
This topic is now closed to further replies.


×
×
  • Create New...