Jump to content
  • 0

error se npc top pvp/pk gia interlude


Question

Posted

exw ena error se ena top pvp/pk gia interlude. ne men perneitai nai men emfanizetai. alla otan pataw na m deiksei px pios einai 1os sto top pvp list h sto top pk list m bgazei sciprt error ti prepei na kanw?

7 answers to this question

Recommended Posts

  • 0
Posted

είσαι σίγουρος ότι τα imports του είναι σωστά (σύμφωνα εμε το proj σου;);

  • 0
Posted

y einai einai l2 j .fozen w8 na ta balw na ta deite

 

import sys

from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance

from java.util import Iterator

from com.l2jfrozen.gameserver.datatables import SkillTable

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

 

print "importing custom: ResidentEvil NPC"

 

 

NPC=[40000]

Precio_ID  = 57

 

QuestId    = 40000

QuestName  = "list"

QuestDesc  = "custom"

InitialHtml = "1.htm"

 

# ************************

# Creando la Clase Quest *

# ************************

 

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

cantidad_pago = st.getQuestItemsCount(Precio_ID)

 

#PK Info

 

if event == "1" and cantidad_pago >= 0 :

st.takeItems(Precio_ID,0)

total_asesinados = 0

htmltext_ini = "<html><head><title>Pk Info</title></head><body><table width=300><tr><td><font color =\"FF00FF\"></td><td><center><font color =\"FFFF00\">Player</color></center></td><td><center>Kills</center></td></tr>"

htmltext_info =""

color = 1

pos = 0

con = L2DatabaseFactory.getInstance().getConnection()

pks = con.prepareStatement("SELECT char_name,pkkills FROM characters WHERE pkkills>0 and accesslevel=0 order by pkkills desc limit 30")

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

con.close()

return htmltext_pklist

elif event == "1" and cantidad_pago < 0 :

htmltext = "<html><head><title>PK info Online</title></head><body><font color =\"FF0000\">Primero pagame...!! son 0 adenas.</body></html>"

return htmltext

 

 

# PvP info

 

 

if event == "2" and cantidad_pago >= 0 :

st.takeItems(Precio_ID,0)

total_asesinados = 0

htmltext_ini = "<html><head><title>PvP info</title></head><body><table width=300><tr><td><font color =\"FF00FF\"></td><td><center><font color =\"FFFF00\">Player</color></center></td><td><center>Kills</center></td></tr>"

htmltext_info =""

color = 1

pos = 0

con = L2DatabaseFactory.getInstance().getConnection()

pks = con.prepareStatement("SELECT char_name,pvpkills FROM characters WHERE pvpkills>0 and accesslevel=0 order by pvpkills desc limit 30")

rs = pks.executeQuery()

while (rs.next()) :

char_name = rs.getString("char_name")

char_pkkills = rs.getString("pvpkills")

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) + " Kills.</center></body></html>"

htmltext_pklist = htmltext_ini + htmltext_info + htmltext_end

con.close()

return htmltext_pklist

elif event == "2" and cantidad_pago < 0 :

htmltext = "<html><head><title>PK info</title></head><body><font color =\"FF0000\">Primero pagame...!! son 0 adenas.</body></html>"

return htmltext

 

 

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)

  • 0
Posted

EPISHS M BGAZEI ENA ERROR STO GAME SERVER CONSOLE P LEEI:

file "_init_.py" line 84 in onevent

NameError:L2DatabaseFactory

kai to idio ligo parakatw

file "_init_.py" line 48 in onevent

NameError:L2DatabaseFactory

  • 0
Posted

vale auta

import sys
from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance
from java.util import Iterator
from com.l2jfrozen.gameserver.datatables import SkillTable
from com.l2jfrozen.util.database import L2DatabaseFactory
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 

Guest
This topic is now closed to further replies.
×
×
  • Create New...