Рейтинг темы:
  • 0 Голос(ов) - 0 в среднем
  • 1
  • 2
  • 3
  • 4
  • 5
Бафер Скрипт...
#1
вот такой вот бафер у меня
Код:
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)
Не могу добавить баф что я не пробовал то ломало структуру и он переставал работать мб кто поможет надо добавить Prophecy of Wind
и скилл типо маляры для файтеров каторый тоже в ХС ловится )
Плз помогите ктонибудь)))
Заранее спасибо)
Ответ
#2
Ты залез в ядро. Помоиму тебе нетуда...
Ответ
#3
выложи скл к нему, если я прально понял скрипт, то ети вещи он из нее грузит соотвественно туда и лить нада.
выложи посмотрим и решим
Ответ


Возможно похожие темы ...
Тема Автор Ответы Просмотры Последний пост
  Скрипт для альт+б Jm0t 0 1,814 03-21-2019, 04:18 PM
Последний пост: Jm0t
  Помогите переписать скрипт с Python на Java Virrilis3 0 1,478 03-29-2018, 10:55 PM
Последний пост: Virrilis3
  кто может открыть .u формат скрипт? velterna 1 1,925 01-31-2018, 09:49 PM
Последний пост: PROGRAMMATOR
  Скрипт не срабатывает сразу Froust 4 2,383 09-22-2017, 02:14 PM
Последний пост: Froust
  скрипт на превращение зарича по id v1kt0r 3 2,129 05-07-2017, 10:04 PM
Последний пост: Emperor
  Скрипт статистики онлайн серверов NewUser 18 4,999 01-26-2015, 02:33 PM
Последний пост: Apoloser
  Бафер Rezzimx 0 1,187 09-27-2014, 12:02 PM
Последний пост: Rezzimx
  Скрипт установки сервера не работает. Linux /. SunWar 2 1,331 08-24-2014, 06:48 PM
Последний пост: SunWar
  Нужен скрипт на услуги донат менеджера (PW Soft) Intruder 3 2,273 05-26-2014, 08:22 AM
Последний пост: Masone
  скрипт Vasya 12 2,875 04-16-2014, 04:33 PM
Последний пост: Cywka!

Перейти к форуму:


Пользователи, просматривающие эту тему: 1 Гость(ей)