06-04-2009, 12:16 PM
вот такой вот бафер у меня
Не могу добавить баф что я не пробовал то ломало структуру и он переставал работать мб кто поможет надо добавить Prophecy of Wind
и скилл типо маляры для файтеров каторый тоже в ХС ловится )
Плз помогите ктонибудь)))
Заранее спасибо)
Код:
import sys
from java.lang import System
from java.util import Iterator
from net.l2emuproject.gameserver.model.quest import State
from net.l2emuproject.gameserver.model.quest import QuestState
from net.l2emuproject.gameserver.model.quest.jython import QuestJython as JQuest
from net.l2emuproject import L2DatabaseFactory
from net.l2emuproject.gameserver.datatables import SkillTable
from net.l2emuproject.gameserver.model.actor.instance import L2PcInstance
from net.l2emuproject.gameserver.network.serverpackets import SetupGauge
QUEST_ID = 555556
QUEST_NAME = "NPCBuffer"
QUEST_DESCRIPTION = "custom"
QUEST_LOADING_INFO = str(QUEST_ID)+"_"+QUEST_NAME
NPC_ID = 555556
HTMLMain = "<html><head><title>Buffer</title></head><body><center>"
HTMLMain += "<button value=\"HP\MP\CP\" action=\"bypass -h Quest " + QUEST_LOADING_INFO + " HPMPCP 0 0 0\" width=250 height=22 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">"
HTMLMain += "<button value=\"Mag buff\" action=\"bypass -h Quest " + QUEST_LOADING_INFO + " UseSetBuffs MageBuffs 0 0\" width=250 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">"
HTMLMain += "<button value=\"Fight buff\" action=\"bypass -h Quest " + QUEST_LOADING_INFO + " UseSetBuffs FightBuffs 0 0\" width=250 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">"
HTMLMain += "<button value=\"Malaria\" action=\"bypass -h Quest " + QUEST_LOADING_INFO + " Malaria 0 0 0\" width=250 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">"
HTMLMain += "<br>"
HTMLMain += "<table width=290 border=\"0\" cellspacing=\"0\">"
HTMLMain += "<tr>"
HTMLMain += "<td align=center><button value=\"Buffs\" action=\"bypass -h Quest " + QUEST_LOADING_INFO + " MenuBaf buff 0 0\" width=145 height=22 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>"
HTMLMain += "<td align=center><button value=\"Buffs*\" action=\"bypass -h Quest " + QUEST_LOADING_INFO + " MenuBafPic buff 0 0\" width=145 height=22 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>"
HTMLMain += "</tr>"
HTMLMain += "<tr>"
HTMLMain += "<td align=center><button value=\"Dances & Songs\" action=\"bypass -h Quest " + QUEST_LOADING_INFO + " MenuBaf DanceSong 0 0\" width=145 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>"
HTMLMain += "<td align=center><button value=\"Dances & Songs*\" action=\"bypass -h Quest " + QUEST_LOADING_INFO + " MenuBafPic DanceSong 0 0\" width=145 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>"
HTMLMain += "</tr>"
HTMLMain += "<tr>"
HTMLMain += "<td align=center><button value=\"Other\" action=\"bypass -h Quest " + QUEST_LOADING_INFO + " MenuBaf other 0 0\" width=145 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>"
HTMLMain += "<td align=center><button value=\"Other*\" action=\"bypass -h Quest " + QUEST_LOADING_INFO + " MenuBafPic other 0 0\" width=145 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>"
HTMLMain += "</tr>"
HTMLMain += "<tr>"
HTMLMain += "<td align=center><button value=\"Resist\" action=\"bypass -h Quest " + QUEST_LOADING_INFO + " MenuBaf resist 0 0\" width=145 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>"
HTMLMain += "<td align=center><button value=\"Resist*\" action=\"bypass -h Quest " + QUEST_LOADING_INFO + " MenuBafPic resist 0 0\" width=145 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>"
HTMLMain += "</tr>"
HTMLMain += "</table>"
HTMLMain += "<br><button value=\"Cancel\" action=\"bypass -h Quest " + QUEST_LOADING_INFO + " removeBuffs 0 0 0\" width=250 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>"
HTMLMain += "</body></html>"
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent(self,event,st):
htmltext = event
currentTime = int(System.currentTimeMillis()/1000)
def UseSetBuffs(Groop):
conn=L2DatabaseFactory.getInstance().getConnection(None)
getList = conn.prepareStatement("SELECT buffId,buffLevel FROM buffer_buff_list WHERE Groop=\""+Groop+"\" ORDER BY buffSort ASC")
rs=getList.executeQuery()
while (rs.next()) :
try :
id = rs.getInt("buffId")
level = rs.getInt("buffLevel")
if currentTime > st.getInt("blockUntilTime") :
st.getPlayer().setTarget(st.getPlayer())
SkillTable.getInstance().getInfo(id,level).getEffects(st.getPlayer(),st.getPlayer())
except :
print "error " + Groop + " id=" + str(id) + " level=" + str(level)
try :
conn.close()
except :
pass
st.getPlayer().getStatus().setCurrentHp(st.getPlayer().getStat().getMaxHp())
st.getPlayer().getStatus().setCurrentMp(st.getPlayer().getStat().getMaxMp())
st.getPlayer().getStatus().setCurrentCp(st.getPlayer().getStat().getMaxCp())
def MakeBuffsMenuPic(Groop):
HTML = "<html><head><title>Buffs menu pictures</title></head><body><center><br>"
HTML += "<table width=280 border=\"0\" cellspacing=\"0\"><tr>"
conn=L2DatabaseFactory.getInstance().getConnection(None)
if Groop == "DanceSong" :
getList = conn.prepareStatement("SELECT buffId, buffLevel FROM buffer_buff_list WHERE Groop=\"dance\" OR Groop=\"song\" ORDER BY Groop ASC, buffSort ASC")
else :
getList = conn.prepareStatement("SELECT buffId, buffLevel FROM buffer_buff_list WHERE Groop=\"" + Groop + "\" ORDER BY buffSort ASC")
rs=getList.executeQuery()
flagn = 0
while (rs.next()) :
try :
id = rs.getInt("buffId")
level = rs.getInt("buffLevel")
if flagn == 8 :
HTML += "</tr><tr>"
flagn = 0
if id < 10 :
IconSkillStrId = "000" + str(id)
else :
if id < 100 :
IconSkillStrId = "00" + str(id)
else :
if id < 1000 :
IconSkillStrId = "0" + str(id)
else :
IconSkillStrId = str(id)
if id == 4699 or id == 4700 :
IconSkillStrId = "1331"
if id == 4702 or id == 4703 :
IconSkillStrId = "1332"
HTML += "<td><button value=\"\" action=\"bypass -h Quest " + QUEST_LOADING_INFO + " USP "+str(id)+" "+str(level)+" "+Groop+"\" width=32 height=32 back=\"icon.skill"+IconSkillStrId+"\" fore=\"icon.skill"+IconSkillStrId+"\"></td>"
flagn += 1
except :
HTML += "Error loading buff list...<br>"
try :
conn.close()
except :
pass
HTML += "</tr>"
HTML += "</table>"
HTML += "<br><button value=\"Back\" action=\"bypass -h Quest " + QUEST_LOADING_INFO + " main 0 0 0\" width=150 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">"
HTML += "</body></center></html>"
return HTML
def MakeBuffsMenuBut(Groop):
HTML = "<html><head><title>Buffs menu</title></head><body><center><br>"
HTML += "<table width=280 border=\"0\" cellspacing=\"0\"><tr>"
conn=L2DatabaseFactory.getInstance().getConnection(None)
if Groop == "DanceSong" :
getList = conn.prepareStatement("SELECT buffName, buffId, buffLevel FROM buffer_buff_list WHERE Groop=\"dance\" OR Groop=\"song\" ORDER BY buffSort ASC")
else :
getList = conn.prepareStatement("SELECT buffName, buffId, buffLevel FROM buffer_buff_list WHERE Groop=\"" + Groop + "\" ORDER BY buffSort ASC")
rs=getList.executeQuery()
rs=getList.executeQuery()
flagn = 0
while (rs.next()) :
try :
name = rs.getString("buffName")
id = rs.getInt("buffId")
level = rs.getInt("buffLevel")
if flagn == 2 :
HTML += "</tr><tr>"
flagn = 0
HTML += "<td><button value=\""+name+"\" action=\"bypass -h Quest " + QUEST_LOADING_INFO + " US "+str(id)+" "+str(level)+" " + Groop + "\" width=140 height=18 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>"
flagn += 1
except :
HTML += "Error loading buff list...<br>"
try :
conn.close()
except :
pass
HTML += "</tr>"
HTML += "</table>"
HTML += "<br><button value=\"Back\" action=\"bypass -h Quest " + QUEST_LOADING_INFO + " main 0 0 0\" width=150 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">"
HTML += "</body></center></html>"
return HTML
def ShowMessage(Text):
return "<html><head><title>Buffer</title></head><br>" + Text + "</body></html>"
eventSplit = event.split(" ")
event = eventSplit[0]
eventParam1 = eventSplit[1]
eventParam2 = eventSplit[2]
eventParam3 = eventSplit[3]
if event == "main" :
return HTMLMain
if event == "MenuBaf" :
return MakeBuffsMenuBut(eventParam1)
if event == "MenuBafPic" :
return MakeBuffsMenuPic(eventParam1)
if event == "US" :
try :
if currentTime > st.getInt("blockUntilTime") :
st.getPlayer().setTarget(st.getPlayer())
SkillTable.getInstance().getInfo(int(eventParam1),int(eventParam2)).getEffects(st.getPlayer(),st.getPlayer())
return MakeBuffsMenuBut(eventParam3)
except :
return ShowMessage("Error use skill id=" + eventParam1 + ", level="+eventParam2)
if event == "USP" :
try :
if currentTime > st.getInt("blockUntilTime") :
st.getPlayer().setTarget(st.getPlayer())
SkillTable.getInstance().getInfo(int(eventParam1),int(eventParam2)).getEffects(st.getPlayer(),st.getPlayer())
return MakeBuffsMenuPic(eventParam3)
except :
return ShowMessage("Error use skill id=" + eventParam1 + ", level="+eventParam2)
if event == "Malaria" :
st.getPlayer().setTarget(st.getPlayer())
SkillTable.getInstance().getInfo(4554,4).getEffects(st.getPlayer(),st.getPlayer())
return HTMLMain
if event == "HPMPCP" :
st.getPlayer().setTarget(st.getPlayer())
st.getPlayer().getStatus().setCurrentHp(st.getPlayer().getStat().getMaxHp())
st.getPlayer().getStatus().setCurrentMp(st.getPlayer().getStat().getMaxMp())
st.getPlayer().getStatus().setCurrentCp(st.getPlayer().getStat().getMaxCp())
return HTMLMain
if event == "removeBuffs" :
if currentTime > st.getInt("blockUntilTime") :
st.getPlayer().stopAllEffects()
return HTMLMain
if event == "UseSetBuffs" :
UseSetBuffs(eventParam1)
return HTMLMain
return HTMLMain
def onTalk (self,npc,player):
st = player.getQuestState(QUEST_LOADING_INFO)
if st.getPlayer().getKarma() > 0 :
HTML = "<html><head><title>Buffer</title></head><body>"
HTML += "No buff for PK!<br>"
HTML += "</body></html>"
else:
HTML = HTMLMain
return HTML
QUEST = Quest(QUEST_ID,QUEST_LOADING_INFO,QUEST_DESCRIPTION)
QUEST.addStartNpc(NPC_ID)
QUEST.addTalkId(NPC_ID)
и скилл типо маляры для файтеров каторый тоже в ХС ловится )
Плз помогите ктонибудь)))
Заранее спасибо)