Gatsby 269 Опубликовано 16 января, 2014 (изменено) Почему то работает только на персонаже с правами администратора, помогите поправить. import sys from ru.catssoftware.gameserver.model.actor.instance import L2PcInstance from java.util import Iterator from ru.catssoftware.gameserver.datatables import SkillTable from ru.catssoftware import L2DatabaseFactory from ru.catssoftware.gameserver.model.actor.appearance import PcAppearance from ru.catssoftware.gameserver.model.quest import State from ru.catssoftware.gameserver.model.quest import QuestState from ru.catssoftware.gameserver.model.quest.jython import QuestJython as JQuest qn = "20707_Ranking" NPC=[20707] Precio_ID = 57 QuestId = 20707 QuestName = "Ranking" QuestDesc = "custom" InitialHtml = "1.htm" print "..............! - Importing Custom: 50300: IL_PKlist - .............." 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 >= 1000000 : st.takeItems(Precio_ID,1000000) total_asesinados = 0 htmltext_ini = "<html><head><title>Информация о PK</title></head><body><table width=300><tr><td><font color =\"FF0000\">Позиция</td><td><center><font color =\"FF0000\">Игрок</color></center></td><td><center>Убийств</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 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 =\"ae9977\">" color = 2 htmltext_info = htmltext_info + "<tr><td><center><font color =\"ae9977\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pkkills + "</center></td></tr>" elif color == 2: color_text = "<font color =\"ae9977\">" color = 1 htmltext_info = htmltext_info + "<tr><td><center><font color =\"ae9977\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pkkills + "</center></td></tr>" htmltext_end = "</table><center><font color=\"FF0000\">" + "В сумме " + str(total_asesinados) + " убийств.</center></body></html>" htmltext_pklist = htmltext_ini + htmltext_info + htmltext_end con.close() return htmltext_pklist elif event == "1" and cantidad_pago < 1000000 : htmltext = "<html><head><title>Информация о PK</title></head><body><font color =\"FF0000\">Primero pagame...!! son 1000000 adenas.</body></html>" return htmltext # ********** # PvP info * # ********** if event == "2" and cantidad_pago >= 1000000 : st.takeItems(Precio_ID,1000000) total_asesinados = 0 htmltext_ini = "<html><head><title>Информация о PvP</title></head><body><table width=300><tr><td><font color =\"FF0000\">Позиция</td><td><center><font color =\"FF0000\">Игрок</color></center></td><td><center>Убийств</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 order by pvpkills desc limit 50") 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 =\"ae9977\">" color = 2 htmltext_info = htmltext_info + "<tr><td><center><font color =\"ae9977\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pkkills + "</center></td></tr>" elif color == 2: color_text = "<font color =\"ae9977\">" color = 1 htmltext_info = htmltext_info + "<tr><td><center><font color =\"ae9977\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pkkills + "</center></td></tr>" htmltext_end = "</table><center><font color=\"FF0000\">" + "В сумме " + str(total_asesinados) + " убийств.</center></body></html>" htmltext_pklist = htmltext_ini + htmltext_info + htmltext_end con.close() return htmltext_pklist elif event == "2" and cantidad_pago < 1000000 : htmltext = "<html><head><title>Информация о PK</title></head><body><font color =\"FF0000\">Primero pagame...!! son 1000000 adenas.</body></html>" return htmltext # ********** # Rec info * # ********** if event == "4" and cantidad_pago >= 1000000 : st.takeItems(Precio_ID,1000000) total_asesinados = 0 htmltext_ini = "<html><head><title>Уважаемые люди</title></head><body><table width=300><tr><td><font color =\"FF0000\">Позиция</td><td><center><font color =\"FF0000\">Игрок</color></center></td><td><center>Репутация</center></td></tr>" htmltext_info ="" color = 1 pos = 0 con = L2DatabaseFactory.getInstance().getConnection() pks = con.prepareStatement("SELECT char_name,rec_have FROM characters WHERE rec_have>0 order by rec_have desc limit 50") rs = pks.executeQuery() while (rs.next()) : char_name = rs.getString("char_name") char_pkkills = rs.getString("rec_have") total_asesinados = total_asesinados + int(char_pkkills) pos = pos + 1 posstr = str(pos) if color == 1: color_text = "<font color =\"ae9977\">" color = 2 htmltext_info = htmltext_info + "<tr><td><center><font color =\"ae9977\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pkkills + "</center></td></tr>" elif color == 2: color_text = "<font color =\"ae9977\">" color = 1 htmltext_info = htmltext_info + "<tr><td><center><font color =\"ae9977\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pkkills + "</center></td></tr>" htmltext_end = "</table><center><font color=\"FF0000\">" + "В сумме " + str(total_asesinados) + " очков репутации.</center></body></html>" htmltext_pklist = htmltext_ini + htmltext_info + htmltext_end con.close() return htmltext_pklist elif event == "4" and cantidad_pago < 1000000 : htmltext = "<html><head><title>Информация о PK</title></head><body><font color =\"FF0000\">Primero pagame...!! son 1000000 adenas.</body></html>" return htmltext # ********** # Online info * # ********** if event == "5" and cantidad_pago >= 1000000 : st.takeItems(Precio_ID,1000000) total_asesinados = 0 htmltext_ini = "<html><head><title>Старожилы сервера</title></head><body><table width=300><tr><td><font color =\"FF0000\">Позиция</td><td><center><font color =\"FF0000\">Игрок</color></center></td><td><center>Время в игре</center></td></tr>" htmltext_info ="" color = 1 pos = 0 con = L2DatabaseFactory.getInstance().getConnection() pks = con.prepareStatement("SELECT char_name,onlinetime FROM characters WHERE onlinetime>0 order by onlinetime desc limit 50") rs = pks.executeQuery() while (rs.next()) : char_name = rs.getString("char_name") char_pkkills = rs.getString("onlinetime") total_asesinados = total_asesinados + int(char_pkkills) pos = pos + 1 posstr = str(pos) if color == 1: color_text = "<font color =\"ae9977\">" color = 2 htmltext_info = htmltext_info + "<tr><td><center><font color =\"ae9977\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pkkills + "</center></td></tr>" elif color == 2: color_text = "<font color =\"ae9977\">" color = 1 htmltext_info = htmltext_info + "<tr><td><center><font color =\"ae9977\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pkkills + "</center></td></tr>" htmltext_end = "</table><center><font color=\"FF0000\">" + "В сумме " + str(total_asesinados) + " времени онлайн</center></body></html>" htmltext_pklist = htmltext_ini + htmltext_info + htmltext_end con.close() return htmltext_pklist elif event == "5" and cantidad_pago < 1000000 : htmltext = "<html><head><title>Информация о PK</title></head><body><font color =\"FF0000\">Primero pagame...!! son 1000000 adenas.</body></html>" return htmltext # ************* # Medal Of Victory info * # ************* if event == "3" and cantidad_pago >= 100000 : st.takeItems(Precio_ID,100000) total_cantidad = 0 htmltext_ini = "<html><head><title>Medal Of Victory info Online</title></head><body><table width=300><tr><td><font color =\"FF00FF\">Pos.</td><td><center><font color =\"FFFF00\">*** Name ***</color></center></td><td><center>*** Adenas ***</center></td></tr>" htmltext_info ="" color = 1 pos = 0 con = L2DatabaseFactory.getInstance().getConnection() pks = con.prepareStatement("SELECT count,owner_id FROM items WHERE item_id=57 order by count desc limit 10") rs = pks.executeQuery() while (rs.next()) : cantidad = rs.getString("count") pj_id = rs.getString("owner_id") total_cantidad = total_cantidad + long(cantidad) pos = pos + 1 posstr = str(pos) charname = con.prepareStatement("SELECT char_name FROM characters WHERE charId=" + pj_id) rs2 = charname.executeQuery() while (rs2.next()) : char_name = rs2.getString("char_name") if color == 1: color_text = "<font color =\"ae9977\">" color = 2 htmltext_info = htmltext_info + "<tr><td><center><font color =\"ae9977\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + cantidad + "</center></td></tr>" elif color == 2: color_text = "<font color =\"ae9977\">" color = 1 htmltext_info = htmltext_info + "<tr><td><center><font color =\"ae9977\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + cantidad + "</center></td></tr>" htmltext_end = "</table><center><font color=\"ae9977\">" + "Los TOPS suman " + str(total_cantidad) + " adenas.</center></body></html>" htmltext_pklist = htmltext_ini + htmltext_info + htmltext_end con.close() return htmltext_pklist elif event == "3" and cantidad_pago < 1000000 : htmltext = "<html><head><title>Adenas info Online</title></head><body><font color =\"FF0000\">Primero pagame...!! son 100k adenas.</body></html>" return htmltext QUEST = Quest(20707,qn,"custom") QUEST.addStartNpc(20707) QUEST.addTalkId(20707) Изменено 16 января, 2014 пользователем Gatsby 3 Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
CooL 0 Опубликовано 16 января, 2014 Мб сборку скажешь ??? Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
RastaDev 54 Опубликовано 16 января, 2014 Мб сборку скажешь ??? А по импортам не видно что как минимум основа сборки люська?) Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
TrueMan 742 Опубликовано 16 января, 2014 (изменено) Зачем 3 темы создавать? Изменено 16 января, 2014 пользователем TrueMan Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
Gatsby 269 Опубликовано 16 января, 2014 (изменено) Хз лаг какой то , 1 создавал...а потом редактировал, ппц оно 3 зафигачило... И еще прикол я не могу отредактировать не 1 из тем, как будто не я создавал)) п.с Поможет кто ? Изменено 16 января, 2014 пользователем Gatsby 3 Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты