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
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")
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")
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.
Hello.
This code works well. It removes buff with double click, but If you preffer remove buff with ALT + mouse click, place this code in AbnormalStatusWnd.uc
function OnLButtonDown(WindowHandle a_WindowHandle, int X, int Y)
{
local Rect windowBounds;
local int targetRow;
local int targetCol;
local StatusIconInfo info;
local SkillInfo skillInfo;
if (IsKeyDown(IK_alt) == false)
return;
// Find window position
windowBounds = Me.GetRect();
// Process clicks outside of window frame only
if (X > (windowBounds.nX + NSTATUSICON_FRAMESIZE))
{
// Calc row and col of targeted icon
targetRow = (Y - windowBounds.nY) / NSTATUSICON_SIZE;
targetCol = (X - windowBounds.nX - NSTATUSICON_FRAMESIZE) / NSTATUSICON_SIZE;
// Store status info of targeted icon
StatusIcon.GetItem(targetRow, targetCol, info);
// Store actual skill info and make sure it is exists
if (GetSkillInfo(info.ClassID, info.Level, skillInfo))
{
// Request server to stop skill effect
// Usage: _dispel:<int:skill_id>,<int :skill_level>
// Example: _dispel:313,8
RequestBypassToServer ( "_dispel:" $ string ( skillInfo. SkillID ) $ "," $ string ( skillInfo. SkillLevel ) ) ) ;
}
}
}
Question
BlackKiss
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
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.