Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import uimg
- import grp
- import uiToolTip
- import app
- import event
- import constInfo
- import item
- ILOSC_MISJI = 13
- NAZWY_ITEMOW = ["Ząb Orka", "Księga Klątw", "Pamiątka Po Demonie", "Matowy Lód", "Konar Zelkova", "Certyfika Tyguisa", "Czerwony Konar", "Ząb Orka", "Księga Klątw", "Pamiątka Po Demonie", "Matowy Lód", "Konar Zelkova", "Certyfika Tyguisa"]
- BIOLOG_TOOLTIP = [
- "Wymagany Poziom: 30|Lokalizacja: Dolina Orków|Czas oddawania: 5:00 min.|Nagrody:|5% Odporność na trucizny|Tęczowy Kamień (x1)|5.000.000 yang",
- "Wymagany Poziom: 40|Lokalizacja: Dolina Orków|Czas oddawania: 10:00 min.|Nagrody:|15% Szybkość Ataku|Medal Szczęścia (30 min.)|10.000.000 yang",
- "Wymagany Poziom: 50|Lokalizacja: Wieża Demonów|Czas oddawania: 20:00 min.|Nagrody:|Obrona +200|Wykrywacz Kamieni Metin (x3)|15.000.000 yang",
- "Wymagany Poziom: 60|Lokalizacja: Góra Sohan|Czas oddawania: 25:00 min.|Nagrody:|15% Obrażenia Umiejętności|Skrzynia Neshalie (x5)|20.000.000 yang",
- "Wymagany Poziom: 70|Lokalizacja: Las Duchów|Czas oddawania: 35:00 min.|Nagrody:|+10000 Max PŻ|Każda Perła (x5)|25.000.000 yang",
- "Wymagany Poziom: 80|Lokalizacja: Kraina Gigantów|Czas oddawania: 50:00 min.|Nagrody:|15% Silny Na Klasy|Złoty Metal (x2)|30.000.000 yang",
- "Wymagany Poziom: 30|Lokalizacja: Dolina Orków|Czas oddawania: 5:00 min.|Nagrody:|5% Odporność na trucizny|Tęczowy Kamień (x1)|5.000.000 yang",
- "Wymagany Poziom: 40|Lokalizacja: Dolina Orków|Czas oddawania: 10:00 min.|Nagrody:|15% Szybkość Ataku|Medal Szczęścia (30 min.)|10.000.000 yang",
- "Wymagany Poziom: 50|Lokalizacja: Wieża Demonów|Czas oddawania: 20:00 min.|Nagrody:|Obrona +200|Wykrywacz Kamieni Metin (x3)|15.000.000 yang",
- "Wymagany Poziom: 60|Lokalizacja: Góra Sohan|Czas oddawania: 25:00 min.|Nagrody:|15% Obrażenia Umiejętności|Skrzynia Neshalie (x5)|20.000.000 yang",
- "Wymagany Poziom: 70|Lokalizacja: Las Duchów|Czas oddawania: 35:00 min.|Nagrody:|+10000 Max PŻ|Każda Perła (x5)|25.000.000 yang",
- "Wymagany Poziom: 80|Lokalizacja: Kraina Gigantów|Czas oddawania: 50:00 min.|Nagrody:|15% Silny Na Klasy|Złoty Metal (x2)|30.000.000 yang",
- "Wymagany Poziom: 80|Lokalizacja: Kraina Gigantów|Czas oddawania: 50:00 min.|Nagrody:|15% Silny Na Klasy|Złoty Metal (x2)|30.000.000 yang",
- ]
- PRZEDMIOTY = [23001, 23002, 23003, 23004, 23005, 23006, 23007, 23008, 30041, 30041, 30041, 30041, 30041]
- class VenturisBiolog(uimg.BoardWithTitleBar):
- Etap = 3
- WymaganaIlosc = [10, 15, 20, 20, 25, 25, 30, 30, 30, 35, 35, 35, 45]
- Oddane = 7
- Czas = 0
- UI = {}
- BiologIndex = 0
- def __init__(self):
- uimg.BoardWithTitleBar.__init__(self)
- self.SetSize(300, 500)
- self.SetTitleName("|cffe6d0a2Badania Biologa")
- self.AddFlag("float")
- self.AddFlag("movable")
- self.SetCloseEvent(self.Close)
- self.Show()
- self.LoadWindow()
- def __del__(self):
- uimg.BoardWithTitleBar.__del__(self)
- def LoadWindow(self):
- self.UI["Suwak"] = uimg.ScrollBar()
- self.UI["Suwak"].SetParent(self)
- self.UI["Suwak"].SetPosition(265, 45)
- self.UI["Suwak"].SetScrollBarSize(265)
- self.UI["Suwak"].SetScrollEvent(uimg.__mem_func__(self.Suwaj))
- self.UI["Suwak"].Show()
- self.UI["Biolog1"] = SpecialWindow()
- self.UI["Biolog1"].SetParent(self)
- self.UI["Biolog1"].SetPosition(20, 45)
- self.UI["Biolog1"].WczytajDane(10, 12, NAZWY_ITEMOW[0])
- self.UI["Biolog1"].Show()
- self.UI["Biolog2"] = SpecialWindow()
- self.UI["Biolog2"].SetParent(self)
- self.UI["Biolog2"].SetPosition(20, 135)
- self.UI["Biolog2"].WczytajDane(8, 20, NAZWY_ITEMOW[1])
- self.UI["Biolog2"].Show()
- self.UI["Biolog3"] = SpecialWindow()
- self.UI["Biolog3"].SetParent(self)
- self.UI["Biolog3"].SetPosition(20, 225)
- self.UI["Biolog3"].WczytajDane(12, 15, NAZWY_ITEMOW[2])
- self.UI["Biolog3"].Show()
- self.UI["Napis_1"] = uimg.TextLine()
- self.UI["Napis_1"].SetParent(self)
- self.UI["Napis_1"].SetPosition(30, 310)
- self.UI["Napis_1"].SetText("|cffa07970Brak1")
- self.UI["Napis_1"].Show()
- self.UI["bar1"] = uimg.SlotBarMG()
- self.UI["bar1"].SetParent(self)
- self.UI["bar1"].SetPosition(30, 330)
- self.UI["bar1"].SetWidth(150)
- self.UI["bar1"].Show()
- self.UI["Status"] = uimg.TextLine()
- self.UI["Status"].SetParent(self.UI["bar1"])
- self.UI["Status"].SetPosition(0,4)
- self.UI["Status"].SetText("|cffa07970Brak")
- self.UI["Status"].SetWindowHorizontalAlignCenter()
- self.UI["Status"].SetHorizontalAlignCenter()
- self.UI["Status"].Show()
- self.UI["Napis_2"] = uimg.TextLine()
- self.UI["Napis_2"].SetParent(self)
- self.UI["Napis_2"].SetPosition(30, 355)
- self.UI["Napis_2"].SetText("|cffa07970Brak2")
- self.UI["Napis_2"].Show()
- self.UI["bar2"] = uimg.SlotBarMG()
- self.UI["bar2"].SetParent(self)
- self.UI["bar2"].SetPosition(30, 375)
- self.UI["bar2"].SetWidth(150)
- self.UI["bar2"].Show()
- self.UI["Szansa"] = uimg.TextLine()
- self.UI["Szansa"].SetParent(self.UI["bar2"])
- self.UI["Szansa"].SetPosition(0,4)
- self.UI["Szansa"].SetText("|cffa07970Brak")
- self.UI["Szansa"].SetWindowHorizontalAlignCenter()
- self.UI["Szansa"].SetHorizontalAlignCenter()
- self.UI["Szansa"].Show()
- self.UI["Napis_3"] = uimg.TextLine()
- self.UI["Napis_3"].SetParent(self)
- self.UI["Napis_3"].SetPosition(30, 400)
- self.UI["Napis_3"].SetText("|cffa07970Brak3")
- self.UI["Napis_3"].Show()
- self.UI["bar3"] = uimg.SlotBarMG()
- self.UI["bar3"].SetParent(self)
- self.UI["bar3"].SetPosition(30, 420)
- self.UI["bar3"].SetWidth(150)
- self.UI["bar3"].Show()
- self.UI["Czas"] = uimg.TextLine()
- self.UI["Czas"].SetParent(self.UI["bar3"])
- self.UI["Czas"].SetPosition(0,4)
- self.UI["Czas"].SetText("|cffa07970Brak")
- self.UI["Czas"].SetWindowHorizontalAlignCenter()
- self.UI["Czas"].SetHorizontalAlignCenter()
- self.UI["Czas"].Show()
- self.UI["OddajButton"] = uimg.Button()
- self.UI["OddajButton"].SetParent(self)
- self.UI["OddajButton"].SetPosition(0, 445)
- self.UI["OddajButton"].SetUpVisual("d:/ymir work/ui/public/XLarge_Button_01.sub")
- self.UI["OddajButton"].SetOverVisual("d:/ymir work/ui/public/XLarge_button_02.sub")
- self.UI["OddajButton"].SetDownVisual("d:/ymir work/ui/public/XLarge_button_03.sub")
- self.UI["OddajButton"].SetWindowHorizontalAlignCenter()
- self.UI["OddajButton"].SetEvent(uimg.__mem_func__(self.OddajPrzedmiot))
- self.UI["OddajButton"].SetText("Oddaj Przedmiot")
- self.UI["OddajButton"].Show()
- self.RefreshBiolog()
- pass
- def WczytajBiologa(self, etap, oddane, szansa, czas):
- self.Etap = int(etap)
- self.UI["Szansa"].SetText(szansa+"%")
- self.Czas = int(czas)
- self.Oddane = oddane
- '''
- test = int(czas) - app.GetGlobalTime()
- self.UI["Status"].SetText(czas)
- self.UI["Szansa"].SetText(str(app.GetGlobalTime()))
- self.UI["Czas"].SetText(str(test))
- '''
- self.RefreshBiolog()
- def Suwaj(self):
- ScrollCount = ILOSC_MISJI - 3
- Index = int(ScrollCount * self.UI["Suwak"].GetPos())
- if Index != self.BiologIndex:
- self.BiologIndex = Index
- self.RefreshBiolog()
- def RefreshBiolog(self):
- if self.Etap-1 == self.BiologIndex:
- self.UI["Biolog1"].WczytajDane(self.Oddane, self.WymaganaIlosc[self.BiologIndex], NAZWY_ITEMOW[self.BiologIndex], BIOLOG_TOOLTIP[self.BiologIndex])
- elif self.Etap-1 < self.BiologIndex:
- self.UI["Biolog1"].WczytajDane(0, self.WymaganaIlosc[self.BiologIndex], NAZWY_ITEMOW[self.BiologIndex], BIOLOG_TOOLTIP[self.BiologIndex])
- else:
- self.UI["Biolog1"].WczytajDane(self.WymaganaIlosc[self.BiologIndex], self.WymaganaIlosc[self.BiologIndex], NAZWY_ITEMOW[self.BiologIndex], BIOLOG_TOOLTIP[self.BiologIndex])
- if self.Etap-1 == self.BiologIndex+1:
- self.UI["Biolog2"].WczytajDane(self.Oddane, self.WymaganaIlosc[self.BiologIndex+1], NAZWY_ITEMOW[self.BiologIndex+1], BIOLOG_TOOLTIP[self.BiologIndex+1])
- elif self.Etap-1 < self.BiologIndex+1:
- self.UI["Biolog2"].WczytajDane(0, self.WymaganaIlosc[self.BiologIndex+1], NAZWY_ITEMOW[self.BiologIndex+1], BIOLOG_TOOLTIP[self.BiologIndex+1])
- else:
- self.UI["Biolog2"].WczytajDane(self.WymaganaIlosc[self.BiologIndex+1], self.WymaganaIlosc[self.BiologIndex+1], NAZWY_ITEMOW[self.BiologIndex+1], BIOLOG_TOOLTIP[self.BiologIndex+1])
- if self.Etap-1 == self.BiologIndex+2:
- self.UI["Biolog3"].WczytajDane(self.Oddane, self.WymaganaIlosc[self.BiologIndex+2], NAZWY_ITEMOW[self.BiologIndex+2], BIOLOG_TOOLTIP[self.BiologIndex+2])
- elif self.Etap-1 < self.BiologIndex+2:
- self.UI["Biolog3"].WczytajDane(0, self.WymaganaIlosc[self.BiologIndex+2], NAZWY_ITEMOW[self.BiologIndex+2], BIOLOG_TOOLTIP[self.BiologIndex+2])
- else:
- self.UI["Biolog3"].WczytajDane(self.WymaganaIlosc[self.BiologIndex+2], self.WymaganaIlosc[self.BiologIndex+2], NAZWY_ITEMOW[self.BiologIndex+2], BIOLOG_TOOLTIP[self.BiologIndex+2])
- self.UI["Biolog1"].LoadItemImage(self.BiologIndex)
- self.UI["Biolog2"].LoadItemImage(self.BiologIndex+1)
- self.UI["Biolog3"].LoadItemImage(self.BiologIndex+2)
- pass
- def OnUpdate(self):
- self.UI["Status"].SetText(str(app.GetTime()))
- czas = self.Czas - app.GetGlobalTimeStamp()
- minuty = czas/60
- sekundy = czas - minuty * 60
- minuty_txt = ""
- sekundy_txt = ""
- if minuty < 10:
- minuty_txt = "0"+str(minuty)
- else:
- minuty_txt = str(minuty)
- if sekundy < 10:
- sekundy_txt = "0"+str(sekundy)
- else:
- sekundy_txt = str(sekundy)
- if self.Czas == 0 or self.Czas < app.GetGlobalTimeStamp():
- self.UI["Czas"].SetText("00:00")
- self.UI["Status"].SetText("Chodź tu.")
- else:
- self.UI["Czas"].SetText(minuty_txt + ":" + sekundy_txt)
- self.UI["Status"].SetText("Odpierdol się!")
- def OddajPrzedmiot(self):
- event.QuestButtonClick(constInfo.OddajBiolog)
- def Close(self):
- self.Hide()
- class SpecialWindow(uimg.Window):
- LIGHT = grp.GenerateColor(0.6, 0.6, 0.6, 0.6)
- PROGRESS_COLOR = grp.GenerateColor(1.0, 0.0, 0.0, 0.2)
- FINISHED_COLOR = grp.GenerateColor(0.0, 1.0, 0.0, 0.2)
- def __init__(self):
- uimg.Window.__init__(self)
- self.CreateWindow()
- def __del__(self):
- uimg.Window.__del__(self)
- def CreateWindow(self):
- self.SetSize(230, 80)
- self.Opis = uiToolTip.ToolTip()
- self.Ramka1 = uimg.ImageBox()
- self.Ramka1.SetParent(self)
- self.Ramka1.SetPosition(0, 0)
- self.Ramka1.LoadImage("illumina/inne/biolog_ramka.tga")
- self.Ramka1.Show()
- # self.Base = uimg.Bar()
- # self.Base.AddFlag("not_pick")
- # self.Base.SetColor(0xff442200)
- # self.Base.SetSize(230, 80)
- # self.Base.SetParent(self)
- # self.Base.Show()
- self.EmptyBar = uimg.Bar()
- self.EmptyBar.SetParent(self.Ramka1)
- self.EmptyBar.SetColor(self.PROGRESS_COLOR)
- self.EmptyBar.SetPosition(5, 62)
- self.EmptyBar.SetSize(229, 21)
- self.EmptyBar.Show()
- self.Progress = uimg.Bar()
- self.Progress.SetParent(self.Ramka1)
- self.Progress.SetColor(self.FINISHED_COLOR)
- self.Progress.SetPosition(5, 62)
- self.Progress.SetSize(int(229*0.7), 21)
- self.Progress.Show()
- self.Slot = uimg.ImageBox()
- self.Slot.SetParent(self.Ramka1)
- self.Slot.SetPosition(12, 11)
- self.Slot.LoadImage("illumina/controls/common/slot_ellipse/slot.tga")
- self.Slot.Show()
- self.ItemImg = uimg.ImageBox()
- self.ItemImg.SetParent(self.Slot)
- self.ItemImg.SetPosition(4, 4)
- self.ItemImg.Show()
- self.Info = uimg.ImageBox()
- self.Info.SetParent(self.Ramka1)
- self.Info.SetPosition(203, 12)
- self.Info.SAFE_SetStringEvent("MOUSE_OVER_IN", self.PokazOpis)
- self.Info.SAFE_SetStringEvent("MOUSE_OVER_OUT", self.SchowajOpis)
- self.Info.LoadImage("illumina/inne/icon_info.tga")
- self.Info.Show()
- # self.Left = uimg.Bar()
- # self.Left.SetParent(self.Base)
- # self.Left.SetColor(0xff555555)
- # self.Left.SetSize(1, 80)
- # self.Left.Show()
- # self.Top = uimg.Bar()
- # self.Top.SetParent(self.Base)
- # self.Top.SetColor(0xff555555)
- # self.Top.SetSize(230, 1)
- # self.Top.Show()
- # self.Right = uimg.Bar()
- # self.Right.SetParent(self.Base)
- # self.Right.SetColor(0xff555555)
- # self.Right.SetPosition(229, 0)
- # self.Right.SetSize(1, 80)
- # self.Right.Show()
- # self.Middle = uimg.Bar()
- # self.Middle.SetParent(self.Base)
- # self.Middle.SetColor(0xff555555)
- # self.Middle.SetPosition(0, 50)
- # self.Middle.SetSize(229, 1)
- # self.Middle.Show()
- # self.Bottom = uimg.Bar()
- # self.Bottom.SetParent(self.Base)
- # self.Bottom.SetColor(0xff555555)
- # self.Bottom.SetPosition(0, 79)
- # self.Bottom.SetSize(229, 1)
- # self.Bottom.Show()
- self.Oddane = uimg.TextLine()
- self.Oddane.SetParent(self.Ramka1)
- self.Oddane.SetPosition(0, 65)
- self.Oddane.SetHorizontalAlignCenter()
- self.Oddane.SetWindowHorizontalAlignCenter()
- self.Oddane.SetText("Oddano 7/10")
- self.Oddane.Show()
- self.ItemName = uimg.TextLine()
- self.ItemName.SetParent(self.Ramka1)
- self.ItemName.SetPosition(64, 8)
- self.ItemName.SetText("|cffa08784Badany Przedmiot:")
- self.ItemName.Show()
- self.TloItemName2 = uimg.ImageBox()
- self.TloItemName2.SetParent(self)
- self.TloItemName2.SetPosition(59, 27)
- self.TloItemName2.LoadImage("illumina/inne/tlo8.tga")
- self.TloItemName2.Show()
- self.ItemName2 = uimg.TextLine()
- self.ItemName2.SetParent(self.TloItemName2)
- self.ItemName2.SetPosition(0, 4)
- self.ItemName2.SetHorizontalAlignCenter()
- self.ItemName2.SetWindowHorizontalAlignCenter()
- self.ItemName2.Show()
- def WczytajDane(self, current, max, item_name="", opis=""):
- x = 0
- for i in xrange(0, len(opis)):
- if opis[i] == "|":
- x += 1
- self.Opis.ClearToolTip()
- for i in xrange(0, x):
- self.Opis.AutoAppendTextLine(opis.split("|")[i])
- self.Opis.AppendSpace(3)
- percent = float(current)/float(max)
- self.Oddane.SetText("|cffa08784Oddano |cffa07970" + str(current) + "|cffa08784/|cffa07970" +str(max))
- self.Progress.SetSize(int(229*percent), 21)
- self.ItemName2.SetText("|cffa07970" + item_name)
- def LoadItemImage(self, index):
- item.SelectItem(PRZEDMIOTY[index])
- self.ItemImg.LoadImage(item.GetIconImageFileName())
- def PokazOpis(self):
- self.Opis.ShowToolTip()
- def SchowajOpis(self):
- self.Opis.HideToolTip()
- #VenturisBiolog().Show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement