4 mesaje
Membru Începător Membru Începător
  • Mesaje: 3
  • Reacții: 204
  • Mesaje utile: 0
  • Status: Pierd vremea ^.^
  • Server: velor2
  • Regat: Chunjo
  • [ID Discord]
  • Contact:

    Medalii

    *Descriere: Skill Select after you reach level 5 or above. Also save function if relog. + FIX Window select skill + _fix Refresh(takes atleast 3 arguments 1 given)

    - Este un system care iti arata o fereastra odata ce ai atins nivelul 5, de unde poti sa alegi skill-urile. :)

    - Are Render Target inclus, cu care poti vedea un preview al skillurilor inainte sa alegi.

    Testat & functional!


    *Poze / Video (obligatoriu):
    [C++/Py] System Skill Select (SkillTraining) + FIX - Mesaj 1 - Imagine 1
    [C++/Py] System Skill Select (SkillTraining) + FIX - Mesaj 1 - Imagine 1
    *Link download:
    Download Drive:
    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.


    Download Direct:
    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.

    Nou Cum descarc de pe TeraBox?

    Afișează detalii Ascunde detalii
    • Este asemănător cu Mega.nz
    • Instalați-vă clientul lor de Download de aici
    • Faceți-vă un cont (vă puteți loga cu Facebook / Google / etc)
    • Nou Dacă nu vreți să descărcați clientul de Download, folosiți acest site
    • Gata! Acum puteți descărca resursele rapid & simplu.

    De ce folosim TeraBox?

    • Este gratuit
    • Primești 1TB de spațiu gratuit la orice cont creat!
    • Este ușor de folosit și varianta premium este foarte ieftină
    • Fișierele nu sunt șterse niciodată
    TeraBox logo
    moară fiimea greșești plătești :-B
    See full signature

    🔥 Hai pe Discord! - Chat activ și support direct

    Te așteptăm și pe serverul de Discord - aici ne-am strâns toată comunitatea de Metin2 din România.

    Alătură-te acum!
    Suntem aproape: 
    Robot Discord
    Roboțelu'
    Anunț
    Administrator Administrator
  • Mesaje: 3901
  • Reacții: 72196
  • Mesaje utile: 38
  • Status: Pe aici.. 🤠
  • Server: Saga2 - Soon
  • Regat: Jinno
  • [ID Discord]
  • Contact:
    Avatar utilizator
    Administrator
    Administrator

    Mesaj de [HF]White »

    Multumim de FIX! Sa traiesti ;)
    Te asteptam si pe serverul de Discord :p - aici ne-am strans toata comunitatea de Metin2 din Romania.
    Link: https://discord.gg/jWxeDSf7HP

    Suntem aproape 2000 membri! - Avem chat activ zilnic, support, cereri, resurse. :D :ymcowboy:




    See full signature
    Avatar utilizator
    Utilizator șters 438
  • Reacții: 0
  • Mesaje utile: 0
  • Avatar utilizator
    Utilizator șters 438

    Mesaj de Utilizator șters 438 »

    Daca are cineva probleme cu el, totusi (mentionate mai jos), Libreso (@Lugh) a facut niste fixuri:
    • Cannot select bug1
      Path 2 of skill not working to be selected - bug2
    Fixurile:
    Parte sursa:
    Conținut: Afișat
    Code:
    ACMD(do_skill_training)
    {
        if (!ch)
            return;
        
        if (ch->GetSkillGroup())
            return;
        
        char arg1[256];
        one_argument(argument, arg1, sizeof(arg1));
    
        if (!*arg1)
            return;
        
        BYTE skill_group = 0;
        str_to_number(skill_group, arg1);
        if (skill_group)
            ch->SetSkillGroup(skill_group);
            ch->ClearSkill();
            // ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("skill_path_selected"));
            ch->UpdatePacket();
    }


    Parte python ( e lung, luati si comparati):
    Conținut: Afișat
    Code:
    import ui, localeInfo, constInfo, uiCommon
    import grp, renderTarget, app, player, skill, net
    
    SKILL_GRADE = 3
    
    SKILL_COUNT = 5
    
    class Window(ui.BoardWithTitleBar):
    	def __init__(self):
    		ui.BoardWithTitleBar.__init__(self)
    		self.__LoadWindow()
    	def Destroy(self):
    		self.__children = {}
    	def __LoadWindow(self):
    		self.Destroy()
    		
    		self.AddFlag("movable")
    		self.AddFlag("attach")
    		self.AddFlag("float")
    		self.SetTitleName("[TEST] Skill Training")
    		self.SetCloseEvent(ui.__mem_func__(self.Close))
    
    		(width, height) = (500, 400)
    		
    		global SKILL_COUNT
    		SKILL_COUNT = 5 if player.GetJob() <= 1 else 6
    
    		for j in xrange(2):
    			groupBg = CreateWindow(ui.ThinBoardCircle(), self, (8 if j == 0 else width - (100+8), 30), "", "", (100, height - 38))
    			groupBg.SetColor(grp.GenerateColor(0.0, 0.0, 0.0, 0.4))
    			groupBg.SetMouseLeftButtonUpEvent(lambda idx=j: self.__SwitchGroup(idx))
    			self.__children["groupBg"+str(j)] = groupBg
    
    			groupName = CreateWindow(ui.TextLine(), groupBg, (0, 0), "Test")
    			groupName.SetPosition((groupBg.GetWidth()/2) - (groupName.GetTextSize()[0]/2), 20)
    			self.__children["groupName"+str(j)] = groupName
    
    			skillBg = CreateWindow(ui.ThinBoardCircle(), groupBg, (0, 0), "", "", (45, (SKILL_COUNT * 36) + 20))
    			skillBg.SetPosition((groupBg.GetWidth()/2) - (skillBg.GetWidth() / 2), (groupBg.GetHeight()/2) - (skillBg.GetHeight() / 2))
    			skillBg.SetMouseLeftButtonUpEvent(lambda idx=j: self.__SwitchGroup(idx))
    			self.__children["skillBg"+str(j)] = skillBg
    
    			slotWindow = CreateWindow(ui.SlotWindow(), skillBg, ((skillBg.GetWidth()/2) - 16, 15), "", "", (32, SKILL_COUNT * 36))
    			for i in xrange(SKILL_COUNT):
    				slotWindow.AppendSlot(i, 0, i * 36, 32, 32)
    			if j == 0:
    				slotWindow.SetOverInItemEvent(ui.__mem_func__(self.__OverInFirst))
    				slotWindow.SetSelectItemSlotEvent(ui.__mem_func__(self.__SelectSkillFirst))
    				slotWindow.SetSelectEmptySlotEvent(ui.__mem_func__(self.__SelectSkillFirst))
    				slotWindow.SetUseSlotEvent(ui.__mem_func__(self.__SelectSkillFirst))
    			else:
    				slotWindow.SetOverInItemEvent(ui.__mem_func__(self.__OverInSecond))
    				slotWindow.SetSelectItemSlotEvent(ui.__mem_func__(self.__SelectSkillSecond))
    				slotWindow.SetSelectEmptySlotEvent(ui.__mem_func__(self.__SelectSkillSecond))
    				slotWindow.SetUseSlotEvent(ui.__mem_func__(self.__SelectSkillSecond))
    			slotWindow.SetOverOutItemEvent(ui.__mem_func__(self.__OverOut))
    			
    			self.__children["slotWindow"+str(j)] = slotWindow
    
    		renderIndex = renderTarget.GetFreeIndex(100, 200)
    		renderWnd = CreateWindow(ui.RenderTarget(), self, (110, 30), "", "", (width - (16 + 200 + 4), height - 38))
    		renderWnd.SetRenderTarget(renderIndex)
    		self.__children["renderWnd"] = renderWnd
    
    		renderTarget.SetBackground(renderIndex, "d:/ymir work/ui/game/render/preview_back.tga")
    		self.__children["renderIndex"] = renderIndex
    
    		selectBtn = CreateWindow(ui.Button(), self, (0, 0))
    		selectBtn.SetUpVisual("d:/ymir work/ui/public/Middle_Button_01.sub")
    		selectBtn.SetOverVisual("d:/ymir work/ui/public/Middle_Button_02.sub")
    		selectBtn.SetDownVisual("d:/ymir work/ui/public/Middle_Button_03.sub")
    		selectBtn.SetPosition((width/2) - (selectBtn.GetWidth()/2), height - 50)
    		selectBtn.SetText("Select")
    		self.__children["selectBtn"] = selectBtn
    
    		self.SetSize(width, height)
    		self.SetCenterPosition()
    
    	def __SwitchGroup(self, idx):
    		"""Schimb? grupa de skill-uri selectat?"""
    		self.__Refresh("", idx)
    
    	def __Refresh(self, emptyArg, idx, skillIdx = 0):
    		if self.__children.has_key("idx"):
    			if self.__children["idx"] == idx and skillIdx == 0:
    				return
    		self.__children["idx"] = idx
    		
    		renderIndex = self.__children["renderIndex"]
    
    		playerRace = player.GetRace()
    		playerJob = player.GetJob()
    
    		weaponList = [335, [1205, 2225], 355, [5185, 7235]]
    		weaponIdx = 0
    		if playerJob == 1:
    			weaponIdx = weaponList[playerJob][idx]
    		elif playerJob == 3:
    			weaponIdx = weaponList[playerJob][app.GetRandom(0, 1)]
    		else:
    			weaponIdx = weaponList[playerJob]
    
    		renderTarget.ResetModel(renderIndex)
    		renderTarget.SelectModel(renderIndex, playerRace)
    		renderTarget.SetVisibility(renderIndex, True)
    		renderTarget.SetWeapon(renderIndex, weaponIdx)
    		renderTarget.SetHair(renderIndex, 1)
    		renderTarget.SetAcce(renderIndex, 0)
    		renderTarget.SetArmor(renderIndex, 21225)
    		renderTarget.SetModelV3Eye(renderIndex, 0.0, -1000.0, 600.0)
    		renderTarget.Zoom(renderIndex, 20)
    
    		SKILL_GROUP_NAME_DICT = {
    			0	: { 1 : localeInfo.SKILL_GROUP_WARRIOR_1,	2 : localeInfo.SKILL_GROUP_WARRIOR_2, },
    			1	: { 1 : localeInfo.SKILL_GROUP_ASSASSIN_1,	2 : localeInfo.SKILL_GROUP_ASSASSIN_2, },
    			2	: { 1 : localeInfo.SKILL_GROUP_SURA_1,		2 : localeInfo.SKILL_GROUP_SURA_2, },
    			3	: { 1 : localeInfo.SKILL_GROUP_SHAMAN_1,	2 : localeInfo.SKILL_GROUP_SHAMAN_2, },
    		}
    		skillStart = 1 + (playerJob * 30)
    		global SKILL_COUNT
    		for j in xrange(2):
    			self.__children["groupName"+str(j)].SetPackedFontColor(0xFF00FF21 if j == idx else 0xFFFF0000)
    			self.__children["groupName"+str(j)].SetText(SKILL_GROUP_NAME_DICT[playerJob][j + 1])
    			self.__children["groupBg"+str(j)].SetColor(grp.GenerateColor(0.0, 0.0, 0.0, 1.0 if j == idx else 0.5))
    			self.__children["skillBg"+str(j)].SetColor(grp.GenerateColor(0.0, 0.0, 0.0, 1.0 if j == idx else 0.5))
    			for i in xrange(SKILL_COUNT):
    				self.__children["slotWindow"+str(j)].SetSkillSlotNew(i, skillStart + i + (15 if j == 1 else 0), SKILL_GRADE, 40)
    				if idx == j:
    					self.__children["slotWindow"+str(j)].EnableSlot(i)
    					self.__children["slotWindow"+str(j)].SetCoverButton(i)
    				else:
    					self.__children["slotWindow"+str(j)].DisableSlot(i)
    			self.__children["slotWindow"+str(j)].RefreshSlot()
    
    		self.__children["selectBtn"].SAFE_SetEvent(self.__Click, SKILL_GROUP_NAME_DICT[playerJob][idx + 1], idx + 1)
    
    		if skillIdx:
    			renderTarget.UseSkill(renderIndex, skillIdx)
    
    	def __AcceptQuestionDialog(self):
    		questionDialog = self.__children["questionDialog"] if self.__children.has_key("questionDialog") else None
    		if questionDialog:
    			net.SendChatPacket("/skill_training "+str(questionDialog.idx))
    			self.__CloseQuestionDialog()
    			self.Close()
    
    	def __CloseQuestionDialog(self):
    		questionDialog = self.__children["questionDialog"] if self.__children.has_key("questionDialog") else None
    		if questionDialog:
    			questionDialog.Close()
    			questionDialog.Destroy()
    			del self.__children["questionDialog"]
    
    	def __Click(self, name, idx):
    		questionDialog = uiCommon.QuestionDialog()
    		questionDialog.SetText("Do you want select %s?" % name)
    		questionDialog.SetAcceptEvent(ui.__mem_func__(self.__AcceptQuestionDialog))
    		questionDialog.SetCancelEvent(ui.__mem_func__(self.__CloseQuestionDialog))
    		questionDialog.Open()
    		questionDialog.idx = idx
    		self.__children["questionDialog"] = questionDialog
    
    	def __OverIn(self, slotIdx, isSec):
    		skillIdx = 1 + (player.GetJob() * 30) + slotIdx + (15 if isSec else 0)
    		interface = constInfo.GetInterfaceInstance()
    		if interface:
    			tooltipSkill = interface.tooltipSkill
    			if tooltipSkill:
    				tooltipSkill.ClearToolTip()
    				tooltipSkill.AutoAppendNewTextLineResize(skill.GetSkillName(skillIdx, SKILL_GRADE))
    				tooltipSkill.AppendSpace(5)
    				try:
    					tooltipSkill.AppendDescription(skill.GetSkillDescription(skillIdx), 25)
    				except:
    					pass
    				tooltipSkill.AppendSkillConditionData(skillIdx)
    				tooltipSkill.ShowToolTip()
    	def __OverOut(self):
    		interface = constInfo.GetInterfaceInstance()
    		if interface:
    			if interface.tooltipSkill:
    				interface.tooltipSkill.HideToolTip()
    	def __OverInSecond(self, slotIdx):
    		self.__OverIn(slotIdx, True)
    	def __OverInFirst(self, slotIdx):
    		self.__OverIn(slotIdx, False)
    	def __SelectSkill(self, slotIdx, isSec):
    		skillIdx = 1 + (player.GetJob() * 30) + slotIdx + (15 if isSec else 0)
    		self.__Refresh("", self.__children["idx"], skillIdx)
    	def __SelectSkillFirst(self, slotIdx):
    		idx = self.__children.get("idx", 0)
    		if idx != 0:
    			self.__SwitchGroup(0)
    		self.__SelectSkill(slotIdx, False)
    	def __SelectSkillSecond(self, slotIdx):
    		idx = self.__children.get("idx", 0)
    		if idx != 1:
    			self.__SwitchGroup(1)
    		self.__SelectSkill(slotIdx, True)
    	def OnUpdate(self):
    		if self.__children.has_key("waitTime"):
    			if self.__children["waitTime"] < app.GetTime():
    				idx = self.__children.get("idx", 0)
    				self.__Refresh("", idx)
    	def Open(self):
    		self.__Refresh("",0)
    		self.Show()
    		self.SetTop()
    	def Close(self):
    		self.Hide()
    	def OnPressEscapeKey(self):
    		self.Close()
    		return True
    
    def CreateWindow(window, parent, windowPos, windowArgument = "", windowPositionRule = "", windowSize = (-1, -1), windowFontName = -1):
    	window.SetParent(parent)
    	window.SetPosition(*windowPos)
    	if windowSize != (-1, -1):
    		window.SetSize(*windowSize)
    	if windowPositionRule:
    		splitList = windowPositionRule.split(":")
    		if len(splitList) == 2:
    			(type, mode) = (splitList[0], splitList[1])
    			if type == "horizontal":
    				if isinstance(window, ui.TextLine):
    					if mode == "center":
    						window.SetHorizontalAlignCenter()
    					elif mode == "right":
    						window.SetHorizontalAlignRight()
    					elif mode == "left":
    						window.SetHorizontalAlignLeft()
    				else:
    					if mode == "center":
    						window.SetWindowHorizontalAlignCenter()
    					elif mode == "right":
    						window.SetWindowHorizontalAlignRight()
    					elif mode == "left":
    						window.SetWindowHorizontalAlignLeft()
    			elif type == "vertical":
    				if isinstance(window, ui.TextLine):
    					if mode == "center":
    						window.SetVerticalAlignCenter()
    					elif mode == "top":
    						window.SetVerticalAlignTop()
    					elif mode == "bottom":
    						window.SetVerticalAlignBottom()
    				else:
    					if mode == "top":
    						window.SetWindowVerticalAlignTop()
    					elif mode == "center":
    						window.SetWindowVerticalAlignCenter()
    					elif mode == "bottom":
    						window.SetWindowVerticalAlignBottom()
    	if windowArgument:
    		if isinstance(window, ui.TextLine):
    			if windowFontName != -1:
    				window.SetFontName(windowFontName)
    			window.SetText(windowArgument)
    		elif isinstance(window, ui.NumberLine):
    			window.SetNumber(windowArgument)
    		elif isinstance(window, ui.ExpandedImageBox) or isinstance(window, ui.ImageBox):
    			window.LoadImage(windowArgument if windowArgument.find("gr2") == -1 else "icon/item/27995.tga")
    	window.Show()
    	return window
    Membru Începător Membru Începător
  • Mesaje: 3
  • Reacții: 2
  • Mesaje utile: 0
  • Status: Pierd vremea ^.^
  • Regat: Shinsoo
  • Medalii

    Avatar utilizator
    Membru Începător
    Membru Începător

    Mesaj de Fratello »

    closed fixed

    📢 Resurse Metin2 Premium!

    Zeci de resurse Metin2 Premium - exclusive și 100% funcționale începând cu 15.99€!.

    Vezi resursele Cumpără premium
    Premium
    Premium
    Anunț
    Scrie răspuns

    Creează-ți un cont sau autentifică-te pentru a participa la discuție

    Trebuie să fii membru pentru a răspunde

    Creează-ți un cont

    Membrii pot crea subiecte noi și pot descărca resurse Metin2 Gratuit!


    Te poți înregistra sau conecta rapid utilizând contul tău de Discord, Github sau Google.

    Înregistrare

    Autentifică-te

    Înapoi la “Sisteme Metin2”

    Informații

    Utilizatori ce navighează pe acest forum: fr3sh23, HunMark, mikee012, salexandru9982 și 4 vizitatori

    Discord ID copiat: