Jump to content
  • 0

[jscript]ligo help boydes an exete di kati i an xerete na to metatrepsoume


Question

Posted

paidia mipos iparxi kanena npc tou dixni tous castl lords me to rr tou char na na enfanizete sto html tha ithela kati paromio me tous hero kai top 10 online players an exete di kati stilte xero oti afto theli jscript exo enan kodika pou einai gia pvp kai pk pos mporo na ton alakso kai na ton kano gia afta po thelo

aftos einai o kodikas

 

import sys

from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance

from java.util import Iterator

from net.sf.l2j.gameserver.datatables import SkillTable

from net.sf.l2j       import L2DatabaseFactory

from net.sf.l2j.gameserver.model.quest import State

from net.sf.l2j.gameserver.model.quest import QuestState

from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest

 

print "importing custom: TOP PVP/PK LIST"

 

 

NPC=[90007]

Precio_ID   = 57

 

QuestId     = 90007

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 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...