Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

[Pytanie] QUEST SYSTEM ZABÓJSTW W PYTHONIE !


Rekomendowane odpowiedzi

Opublikowano

Witam jak będzie wyglądał quest na taki kod pythona (system zabójstw)?

 

 

shinsoo = 0
chunjo = 0
jinno = 0
moby = 0
metiny = 0


import ui
import dbg
import app








class Staty(ui.Window):
    def __init__(self):
        ui.Window.__init__(self)
        self.BuildWindow()


    def __del__(self):
        ui.Window.__del__(self)


    def BuildWindow(self):


        global shinsoo
        global chunjo
        global jinno
        global moby
        global metiny
        
        self.Board = ui.BoardWithTitleBar()
        self.Board.SetSize(268, 208)
        self.Board.SetCenterPosition()
        self.Board.AddFlag('movable')
        self.Board.AddFlag('float')
        self.Board.SetTitleName('Licznik Zabójstw')
        self.Board.SetCloseEvent(self.Close)
        self.Board.Show()
        self.Warnox = komendy_WARNOX()
        wszystko = str(int(shinsoo) + int(chunjo) + int(jinno))
        self.sh = self.Warnox.Button(self.Board, str(shinsoo), '', 136, 44, self.sh_func, 'd:/ymir work/ui/public/parameter_slot_04.sub', 'd:/ymir work/ui/public/parameter_slot_04.sub', 'd:/ymir work/ui/public/parameter_slot_04.sub')
        self.ch = self.Warnox.Button(self.Board, str(chunjo), '', 136, 66, self.ch_func, 'd:/ymir work/ui/public/parameter_slot_04.sub', 'd:/ymir work/ui/public/parameter_slot_04.sub', 'd:/ymir work/ui/public/parameter_slot_04.sub')
        self.ji = self.Warnox.Button(self.Board, str(jinno), '', 136, 90, self.ji_func, 'd:/ymir work/ui/public/parameter_slot_04.sub', 'd:/ymir work/ui/public/parameter_slot_04.sub', 'd:/ymir work/ui/public/parameter_slot_04.sub')
        self.og = self.Warnox.Button(self.Board, str(wszystko), '', 136, 113, self.og_func, 'd:/ymir work/ui/public/parameter_slot_04.sub', 'd:/ymir work/ui/public/parameter_slot_04.sub', 'd:/ymir work/ui/public/parameter_slot_04.sub')
        self.mob = self.Warnox.Button(self.Board, str(moby), '', 136, 137, self.mob_func, 'd:/ymir work/ui/public/parameter_slot_04.sub', 'd:/ymir work/ui/public/parameter_slot_04.sub', 'd:/ymir work/ui/public/parameter_slot_04.sub')
        self.me = self.Warnox.Button(self.Board, str(metiny), '', 136, 162, self.me_func, 'd:/ymir work/ui/public/parameter_slot_04.sub', 'd:/ymir work/ui/public/parameter_slot_04.sub', 'd:/ymir work/ui/public/parameter_slot_04.sub')
        self.shinsoo = self.Warnox.TextLine(self.Board, 'Zabójstwa (Shinsoo):', 22, 45, self.Warnox.RGB(255, 255, 255))
        self.chunjo = self.Warnox.TextLine(self.Board, 'Zabójstwa (Chunjo):', 22, 67, self.Warnox.RGB(255, 255, 255))
        self.jinno = self.Warnox.TextLine(self.Board, 'Zabójstwa (Jinno):', 22, 90, self.Warnox.RGB(255, 255, 255))
        self.ogolem = self.Warnox.TextLine(self.Board, 'Zabójstwa (Ogółem):', 22, 114, self.Warnox.RGB(255, 255, 255))
        self.moby = self.Warnox.TextLine(self.Board, 'Pokonane Potwory:', 22, 137, self.Warnox.RGB(255, 255, 255))
        self.metiny = self.Warnox.TextLine(self.Board, 'Pokonane Metiny:', 22, 161, self.Warnox.RGB(255, 255, 255))
        #zakaz edytowania tego napisu \l/
        self.dla = self.Warnox.TextLine(self.Board, 'Embrace2', 102, 181, self.Warnox.RGB(255, 66, 0))
    
    def sh_func(self):
        pass
    
    def ch_func(self):
        pass
    
    def ji_func(self):
        pass
    
    def og_func(self):
        pass
    
    def mob_func(self):
        pass
    
    def me_func(self):
        pass
        
    def OnKeyDown(self, key):
        try:
            self.onPressKeyDict[key]()
        except KeyError:
            pass
        except:
            raise
        return TRUE
    
    def Show(self):
        self.Board.Show()
            
    
    def Close(self):
        self.Board.Hide()


class komendy_WARNOX:
    def Button(self, parent, buttonName, tooltipText, x, y, func, UpVisual, OverVisual, DownVisual):
        button = ui.Button()
        if parent != None:
            button.SetParent(parent)
        button.SetPosition(x, y)
        button.SetUpVisual(UpVisual)
        button.SetOverVisual(OverVisual)
        button.SetDownVisual(DownVisual)
        button.SetText(buttonName)
        button.SetToolTipText(tooltipText)
        button.Show()
        button.SetEvent(func)
        return button


    def ToggleButton(self, parent, buttonName, tooltipText, x, y, funcUp, funcDown, UpVisual, OverVisual, DownVisual):
        button = ui.ToggleButton()
        if parent != None:
            button.SetParent(parent)
        button.SetPosition(x, y)
        button.SetUpVisual(UpVisual)
        button.SetOverVisual(OverVisual)
        button.SetDownVisual(DownVisual)
        button.SetText(buttonName)
        button.SetToolTipText(tooltipText)
        button.Show()
        button.SetToggleUpEvent(funcUp)
        button.SetToggleDownEvent(funcDown)
        return button


    def EditLine(self, parent, editlineText, x, y, width, heigh, max):
        SlotBar = ui.SlotBar()
        if parent != None:
            SlotBar.SetParent(parent)
        SlotBar.SetSize(width, heigh)
        SlotBar.SetPosition(x, y)
        SlotBar.Show()
        Value = ui.EditLine()
        Value.SetParent(SlotBar)
        Value.SetSize(width, heigh)
        Value.SetPosition(1, 1)
        Value.SetMax(max)
        Value.SetLimitWidth(width)
        Value.SetMultiLine()
        Value.SetText(editlineText)
        Value.Show()
        return SlotBar, Value


    def TextLine(self, parent, textlineText, x, y, color):
        textline = ui.TextLine()
        if parent != None:
            textline.SetParent(parent)
        textline.SetPosition(x, y)
        if color != None:
            textline.SetFontColor(color[0], color[1], color[2])
        textline.SetText(textlineText)
        textline.Show()
        return textline


    def RGB(self, r, g, :
        return (r*255, g*255, b*255)


    def SliderBar(self, parent, sliderPos, func, x, y):
        Slider = ui.SliderBar()
        if parent != None:
            Slider.SetParent(parent)
        Slider.SetPosition(x, y)
        Slider.SetSliderPos(sliderPos / 100)
        Slider.Show()
        Slider.SetEvent(func)
        return Slider


    def ExpandedImage(self, parent, x, y, img):
        image = ui.ExpandedImageBox()
        if parent != None:
            image.SetParent(parent)
        image.SetPosition(x, y)
        image.LoadImage(img)
        image.Show()
        return image


    def ComboBox(self, parent, text, x, y, width):
        combo = ui.ComboBox()
        if parent != None:
            combo.SetParent(parent)
        combo.SetPosition(x, y)
        combo.SetSize(width, 15)
        combo.SetCurrentItem(text)
        combo.Show()
        return combo


    def ThinBoard(self, parent, moveable, x, y, width, heigh, center):
        thin = ui.ThinBoard()
        if parent != None:
            thin.SetParent(parent)
        if moveable == TRUE:
            thin.AddFlag('movable')
            thin.AddFlag('float')
        thin.SetSize(width, heigh)
        thin.SetPosition(x, y)
        if center == TRUE:
            thin.SetCenterPosition()
        thin.Show()
        return thin


    def Gauge(self, parent, width, color, x, y):
        gauge = ui.Gauge()
        if parent != None:
            gauge.SetParent(parent)
        gauge.SetPosition(x, y)
        gauge.MakeGauge(width, color)
        gauge.Show()
        return gauge


    def ListBoxEx(self, parent, x, y, width, heigh):
        bar = ui.Bar()
        if parent != None:
            bar.SetParent(parent)
        bar.SetPosition(x, y)
        bar.SetSize(width, heigh)
        bar.SetColor(0x77000000)
        bar.Show()
        ListBox=ui.ListBoxEx()
        ListBox.SetParent(bar)
        ListBox.SetPosition(0, 0)
        ListBox.SetSize(width, heigh)
        ListBox.Show()
        scroll = ui.ScrollBar()
        scroll.SetParent(ListBox)
        scroll.SetPosition(width-15, 0)
        scroll.SetScrollBarSize(heigh)
        scroll.Show()
        ListBox.SetScrollBar(scroll)
        return bar, ListBox
 

 

Opublikowano

F5 - Wiecie jak to powinno wyglądać, żeby naliczało te statystyki ? ;>

Opublikowano

Questem musisz to zrobić quest:

Quest sobie spolszczysz ale najpierw daj lajka ;p

 

quest killgui begin
    state start begin
        when kill begin
            if npc.is_pc() then
                local new_point = pc.getqf("empire"..npc.get_empire())+1
                pc.setqf("empire"..npc.get_empire(), new_point)
                cmdchat("KillRotReich "..pc.getqf("empire1"))
                cmdchat("KillGelbReich "..pc.getqf("empire2"))
                cmdchat("KillBlauReich "..pc.getqf("empire3"))
            else
                local new_point = pc.getqf("mob")+1
                pc.setqf("mob", new_point)
                cmdchat("KillMob "..pc.getqf("mob"))
            end
        end
        when login begin
            if pc.getqf("showkillgui") == 1 then
                cmdchat("ShowKillGui")
                cmdchat("KillRotReich "..pc.getqf("empire1"))
                cmdchat("KillGelbReich "..pc.getqf("empire2"))
                cmdchat("KillBlauReich "..pc.getqf("empire3"))
                cmdchat("KillMob "..pc.getqf("mob"))
            else
                cmdchat("HideKillGui")
            end
        end
        when letter begin
            send_letter("Killstatistik")
        end
        when info or button begin
            say_title("Killstatistik")
            say("Ein- oder Ausblenden?")
            local janein = select("Anzeigen", "Ausblenden")
            if janein == 2 then
                pc.setqf("showkillgui", 0)
                cmdchat("HideKillGui")
            else
                pc.setqf("showkillgui", 1)
                cmdchat("ShowKillGui")
                cmdchat("KillRotReich "..pc.getqf("empire1"))
                cmdchat("KillGelbReich "..pc.getqf("empire2"))
                cmdchat("KillBlauReich "..pc.getqf("empire3"))
                cmdchat("KillMob "..pc.getqf("mob"))
            end
        end
    end
end
Opublikowano

 

Questem musisz to zrobić quest:

Quest sobie spolszczysz ale najpierw daj lajka ;p

 

quest killgui begin
    state start begin
        when kill begin
            if npc.is_pc() then
                local new_point = pc.getqf("empire"..npc.get_empire())+1
                pc.setqf("empire"..npc.get_empire(), new_point)
                cmdchat("KillRotReich "..pc.getqf("empire1"))
                cmdchat("KillGelbReich "..pc.getqf("empire2"))
                cmdchat("KillBlauReich "..pc.getqf("empire3"))
            else
                local new_point = pc.getqf("mob")+1
                pc.setqf("mob", new_point)
                cmdchat("KillMob "..pc.getqf("mob"))
            end
        end
        when login begin
            if pc.getqf("showkillgui") == 1 then
                cmdchat("ShowKillGui")
                cmdchat("KillRotReich "..pc.getqf("empire1"))
                cmdchat("KillGelbReich "..pc.getqf("empire2"))
                cmdchat("KillBlauReich "..pc.getqf("empire3"))
                cmdchat("KillMob "..pc.getqf("mob"))
            else
                cmdchat("HideKillGui")
            end
        end
        when letter begin
            send_letter("Killstatistik")
        end
        when info or button begin
            say_title("Killstatistik")
            say("Ein- oder Ausblenden?")
            local janein = select("Anzeigen", "Ausblenden")
            if janein == 2 then
                pc.setqf("showkillgui", 0)
                cmdchat("HideKillGui")
            else
                pc.setqf("showkillgui", 1)
                cmdchat("ShowKillGui")
                cmdchat("KillRotReich "..pc.getqf("empire1"))
                cmdchat("KillGelbReich "..pc.getqf("empire2"))
                cmdchat("KillBlauReich "..pc.getqf("empire3"))
                cmdchat("KillMob "..pc.getqf("mob"))
            end
        end
    end
end

 

Po 1 z elitepvpers to każdy może, a po 2 ten quest nie spełnia tych warunków:

 

 

        self.shinsoo = self.Warnox.TextLine(self.Board, 'Zabójstwa (Shinsoo):', 22, 45, self.Warnox.RGB(255, 255, 255))
        self.chunjo = self.Warnox.TextLine(self.Board, 'Zabójstwa (Chunjo):', 22, 67, self.Warnox.RGB(255, 255, 255))
        self.jinno = self.Warnox.TextLine(self.Board, 'Zabójstwa (Jinno):', 22, 90, self.Warnox.RGB(255, 255, 255))
        self.ogolem = self.Warnox.TextLine(self.Board, 'Zabójstwa (Ogółem):', 22, 114, self.Warnox.RGB(255, 255, 255))
        self.moby = self.Warnox.TextLine(self.Board, 'Pokonane Potwory:', 22, 137, self.Warnox.RGB(255, 255, 255))
        self.metiny = self.Warnox.TextLine(self.Board, 'Pokonane Metiny:', 22, 161, self.Warnox.RGB(255, 255, 255))
 
  • 1 miesiąc temu...

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...