'PACI 2,317 Posted November 7, 2013 Boas. Bem após ter andado à volta do dragon soul e ter conseguido fazê-lo como queria (ou seja, está acabado) decidi postar a 1ª versão que fiz. Esta só tem a parte de cima a funcionar, nem os slots de baixo, nem os refines estão incluídos, é só mesmo, usar item, ir para o slot, activar e receber os extras. Aconselho-vos a seguirem os passos como deve de ser.. Parte python: Criem um ficheiro no bloco de notas e colem isto: import uiimport dbgimport appclass DSS(ui.Window): def __init__(self): ui.Window.__init__(self) self.BuildWindow() def __del__(self): ui.Window.__del__(self) def BuildWindow(self): self.Board = ui.BoardWithTitleBar() self.Board.SetSize(287, 535) self.Board.SetCenterPosition() self.Board.AddFlag('movable') self.Board.AddFlag('float') self.Board.SetTitleName('DragonSoulSystem') self.Board.SetCloseEvent(self.Close) self.Board.Show() self.__BuildKeyDict() self.comp = Component() self.bg = self.comp.ExpandedImage(self.Board , 10, 34, 'guieditor/ds/dragon_soul_bg.tga') self.img1 = self.comp.ExpandedImage(self.Board , 9, 283, 'guieditor/ds/tap01.tga') self.slots = self.comp.ExpandedImage(self.Board , 6, 317, 'guieditor/ds/ds_slots.tga') self.btnactdeact = self.comp.Button(self.Board, 'Activar', '', 216, 502, self.btnactdeact_func, 'd:/ymir work/ui/public/middle_button_01.sub', 'd:/ymir work/ui/public/middle_button_02.sub', 'd:/ymir work/ui/public/middle_button_03.sub') self.btndeck2 = self.comp.Button(self.Board, '', '', 234, 232, self.btndeck2_func, 'guieditor/ds/deck2_1.tga', 'guieditor/ds/deck2_2.tga', 'guieditor/ds/deck2_3.tga') def btnactdeact_func(self): pass def btndeck2_func(self): pass def __BuildKeyDict(self): onPressKeyDict = {} onPressKeyDict[app.DIK_F5] = lambda : self.OpenWindow() self.onPressKeyDict = onPressKeyDict def OnKeyDown(self, key): try: self.onPressKeyDict[key]() except KeyError: pass except: raise return TRUE def OpenWindow(self): if self.Board.IsShow(): self.Board.Hide() else: self.Board.Show() def Close(self): self.Board.Hide()class Component: 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, b): 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, ListBoxDSS().Show() Quest: quest dragonsoulsystem begin state start begin function removeItemFromDSSslot(itemVnum) dragonsoulsystem.remove_dss_item(itemVnum) end function remove_dss_item(itemVnum) pc.remove_part(PART_MAIN, itemVnum) end function setItemToDSSslot(itemVnum) if itemVnum >= 120000 and itemVnum <= 164400 then dragonsoulsystem.equip_dss_item(itemVnum) end end function giveDSSbonus(itemVnum) local a, b = mysql_query("SELECT applytype0 FROM player.item_proto WHERE vnum >= 120000 and vnum <= 164400"), mysql_query("SELECT applyvalue0 FROM player.item_proto WHERE vnum >= 120000 and vnum <= 16400") affect.add_collect(apply.a[1], b[1], 60*60*60*365) end function removeDSSbonus(itemVnum) local a, b = mysql_query("SELECT applytype0 FROM player.item_proto WHERE vnum >= 120000 and vnum <= 164400"), mysql_query("SELECT applyvalue0 FROM player.item_proto WHERE vnum >= 120000 and vnum <= 16400") affect.remove_collect(apply.a[1], b[1], 60*60*60*365) end function equip_dss_item(itemVnum) pc.set_part(PART_MAIN, itemVnum) end function DssItems() return item.get_vnum() >= 120000 and item.get_vnum() <= 1664400 end when dragonsoulsystem.DssItems().use begin if pc.getqf("dragonsouluse") == 0 then pc.setqf("dragonsouluse", 1) dragonsoulsystem.setItemToDSSslot(item.get_vnum()) dragonsoulsystem.giveDSSbonus(item.get_vnum()) else pc.setqf("dragonsouluse", 0) dragonsoulsystem.removeItemFromDSSslot(item.get_vnum()) dragonsoulsystem.removeDSSbonus(item.get_vnum()) end end endend Notas: :trollface: 1 7 andras93, WildEgo, Kɛɛɗ and 5 others reacted to this Share this post Link to post Share on other sites
EliminaEstaContaSff 536 Posted November 7, 2013 Eu segui os paços e não consegui... O que devo fazer? Share this post Link to post Share on other sites
'PACI 2,317 Posted November 7, 2013 Verifica se as tabulações estão bem feitas. Share this post Link to post Share on other sites
EliminaEstaContaSff 536 Posted November 7, 2013 Verifica se as tabulações estão bem feitas. Estão... O que faço? -.- Share this post Link to post Share on other sites
Guest Origin. Posted November 7, 2013 Texto em spoiler tem vírus, apagou a BIOS do Paulo !#Request Close que estou com fome ! Share this post Link to post Share on other sites
'PACI 2,317 Posted November 7, 2013 Foi só um mysql_query... Share this post Link to post Share on other sites
ƤāƱŁѲ ƒēƦƦēƗƦā 1,220 Posted November 7, 2013 Fonseona? Share this post Link to post Share on other sites
'PACI 2,317 Posted November 7, 2013 Sin. 1 rryt283887 reacted to this Share this post Link to post Share on other sites
SINVAL o.O 728 Posted November 7, 2013 é pena não postar a versão com tudo funcional mais mesmo assim obrigado por postares +1. Share this post Link to post Share on other sites
quenii 981 Posted November 11, 2013 Quando eu tiver um tempinho faço umas alterações nesse cod ae e te passo, da pra melhorar bastante. Abraço Share this post Link to post Share on other sites
Guest Origin. Posted November 11, 2013 Nunca ví tanto vírus junto.Isso até instalei o Win 8.2 no meu pc FERA :o Share this post Link to post Share on other sites
ɱɑcɑcѳ 71 Posted November 11, 2013 PACI faltam as imagens guieditor/ds/dragon_soul_bg.tga etc... PLS Share this post Link to post Share on other sites