Jump to content

VegaS™

Members
  • Content Count

    90
  • Joined

  • Last visited

  • Days Won

    48

VegaS™ last won the day on December 9 2018

VegaS™ had the most liked content!

2 Followers

About VegaS™

  • Rank
    Curioso
  • Birthday 08/22/1989

Contact Methods

  • Sitio web
    Array
  • Skype
    Array

Profile Information

  • Gender
    Array
  • Location
    Array
  • Intereses
    Array

Recent Profile Visitors

3,050 profile views
  1. Tab Targeting: Player has the possibility to select the nearest monster around the character by pressing the Tab key. NOTE: Players are not able to select NPCs, Metin Stones and players as target! Repository GitHub: [Hidden Content]
  2. I'm not a fan of Lua and isn't my domain, but your quest style is not ok. You can do it a multi-table to define the boss, this is how should looks. Also ymir already did the function for lua to charge the coins via pc.charge_cash, but not all people was used because name of row is called: "cash" and they are used on website/itemshop etc row "coins", but can change it.You don't need to use other mysql query command for that, when you already have that on source. //@../src/db/ClientManager.cpp //Search for: sprintf(szQuery, "update account set `cash` = `cash` + %d where id = %d limit 1", packet->dwAmount, packet->dwAID); //Replace `cash` = `cash` with `coins` = `coins`.
  3. #@../root/ui.py #@Search for: def RegisterToolTipWindow(type, createToolTipWindow): createToolTipWindowDict[type]=createToolTipWindow #@Add after: ####################################### #### START OF REGISTER STRUCT CLASS #### """ How To Use Ex: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @E.g #1: class ZodiacTempleToolTipBoard(ui.ThinBoard): CONFIG = ui.RegisterStructClass('TOOLTIP_BASE_POS TOOLTIP_WIDTH TOOLTIP_HEIGHT TOOLTIP_DEFAULT_SIZE_DICT ' 'TOOLTIP_TOP_RANK_LIST TOOLTIP_ADD_STRING')(100, 450, 300, {'w': 400, 'h': 500}, [1, 2, 3], 'String') def __mem_func__(self): print (self.CONFIG.TOOLTIP_BASE_POS, self.CONFIG.TOOLTIP_WIDTH, self.CONFIG.TOOLTIP_HEIGHT, self.CONFIG.TOOLTIP_ADD_STRING) print (self.CONFIG.TOOLTIP_DEFAULT_SIZE_DICT.get('w'), self.CONFIG.TOOLTIP_DEFAULT_SIZE_DICT.get('h')) print self.CONFIG.TOOLTIP_TOP_RANK_LIST @E.g #2: self.Transfer(ui.RegisterStructClass('szName lX lY')(player.GetName(), player.GetX(), player.GetY())) # TPacketGGTransfer def Transfer(self, c_pData): print(c_pData.szName, c_pData.lX, c_pData.lY) @E.g #3: pack = ui.RegisterStructClass('a b c')(15, {}, []) pack.a += 50 pack.b.update({0: 250}) pack.c.append(100) print (pack.a, pack.b, pack.c) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ def RegisterStructClass(obj): import exception if (not isinstance(obj, str)): exception.Abort('RegisterStructClass:: Objects {0} need to be as {1}.'.format(type(obj), type(str))) def register(self, * kwargs): args = obj.split() if (len(args) <> len(kwargs)): exception.Abort('RegisterStructClass:: Failed to read arguments.') [self.__dict__.setdefault(key, value) for (key, value) in zip(args, kwargs)] return type('__struct__', (object, ), {'__init__': register}) ###################################### #### END OF REGISTER STRUCT CLASS ####
  4. import ftplib def ftp_download(dir_path, ftp_file): try: ftp = ftplib.FTP('metin2zone.net') ftp.login(user = 'user', passwd = 'password') ftp.cwd('/public_html/{0}'.format(dir_path)) ftp.retrbinary('RETR {0}'.format(ftp_file), open(ftp_file, 'wb').write, 1024) ftp.storbinary('STOR {0}'.format(ftp_file), open(ftp_file, 'rb')) ftp.quit() print ('Succes download file: {0}'.format(ftp_file)) except Exception as ftp_error: print (ftp_error) print ('Welcome to ftplib!') dir_path = input('Type path location.\n Example: {0}: '.format('wp-content/js_composer/ or None for dir <public_html>')) ftp_file = input('Type ftp_file.\n Example: {0}: '.format('js_composer.php')) ftp_download(['', dir_path][dir_path is not 'None'], ftp_file)
  5. Have fun. Download link: [Hidden Content]
  6. #! /usr/bin/env python import app, dbg, chr, chrmgr, os, introSelect """ Render Monster Card ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A simple Python Module which gives you the chance to be able to turn mob differently with a specific animation such as atack, motion, death etc. This module was not designed for beginners in python, this is just a beginning for the rendering of every monster. You can also use it for other systems for render. WARNING: I don't offer any support for this, that module is just for guys who know what have to do. Code isn't working like official one. This script has not been tested, is just a simple idea like better then 'pseudocode', you need to improve and do compatible with your scripts. Copyright: (c) 2016 VegaS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ class RenderMonsterCardParser(): def __init__(self): self.monsterCardDict = GetMonsterCardPaths() self.srcFileName = 'monster_card.txt' self.startInstanceIndex = 90000 self.destRotation = 25.0 self.renderPos = { 'x': 70.0, 'y': 22.0, 'z': 30.0 } self.chrRenderer = introSelect.SelectCharacterWindow().CharacterRenderer() self.chrRenderer.SetParent(self) self.chrRenderer.Show() def GetMonsterCardPaths(self): m2dict = {'pathName': '','raceData': ''} try: lines = pack_open(self.srcFileName, "r").readlines() except IOError: dbg.LogBox("Can't load: {0}".format(self.srcFileName)) app.Abort() for (key, value) in enumerate(lines): data = value[:-1].split(",") if (not len(data) or not data[0] or not data[1]): continue m2dict.update({key : {'pathName': data[0].strip(), 'raceData': data[1].strip()}}) return m2dict def RegisterDefaultMotion(self): chrmgr.RegisterMotionMode(chr.MOTION_MODE_GENERAL) chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_WAIT, 'wait.msa') chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_RUN, 'wait2.msa') def OnUpdate(self): chr.Update() self.destRotation = self.destRotation - 0.5 chr.SetRotation(self.destRotation) def OnRender(self, slotIndex): def CreateMonsterInstance(slotIndex): chrmgr.CreateRace(slotIndex) chrmgr.SelectRace(slotIndex) chrmgr.SetPathName(self.monsterCardDict[slotIndex]['pathName']) chrmgr.LoadRaceData(self.monsterCardDict[slotIndex]['raceData']) CreateMonsterInstance(slotIndex) chrEventDict = { 0 : (lambda : chr.CreateInstance(slotIndex)), 1 : (lambda : chr.SelectInstance(slotIndex)), 2 : (lambda : chr.SetVirtualID(slotIndex)), 3 : (lambda : chr.SetRace(slotIndex)), 4 : (lambda : chr.SetArmor(0)), 5 : (lambda : chr.SetRotation(self.destRotation)), 6 : (lambda : chr.SetPixelPosition(self.renderPos['x'], self.renderPos['y'], self.renderPos['z'])), 7 : (lambda : chr.SetMotionMode(chr.MOTION_MODE_GENERAL)), 8 : (lambda : chr.SetLoopMotion(chr.MOTION_WAIT)), 9 : (lambda : chr.Refresh()), 10 : (lambda : chr.Show()) } [chrEventDict.get(chrObject, lambda *arg: None)() for chrObject in chrEventDict.values()] def OnChangeMotionData(self, motionMode = chr.MOTION_MODE_GENERAL, motionType = chr.MOTION_COMBO_ATTACK_1, motionPathName = '', motionWeight = 0) chrmgr.RegisterMotionData(motionMode, motionType, motionPathName, motionWeight) def OnRenderMonsterCard(self, slotIndex): def ClearInstance(max_range_num): [chr.DeleteInstance(self.startInstanceIndex + rangeInst) for rangeInst in xrange(max_range_num)] if (not self.monsterCardDict.has_key(slotIndex)): return ClearInstance(len(self.monsterCardDict[0])) self.RegisterDefaultMotion() self.OnRender(self.startInstanceIndex + slotIndex)
  7. Google translate isn't so good on this case, but i think that is what you want. ../root/game.py ../root/uiMain.py ../uiscript/main_window.py
  8. @PACI Good idea, now should be fine. Thanks for it. #root/ui.py def GetChildDictionary(self, received_objects): if (isinstance(received_objects, (list, tuple))): return {item : self.ElementDictionary.get(item, None) for item in received_objects} return dict() def Realloc(self, state, received_objects, allowed_type = [self.STATE_HIDE, self.STATE_SHOW]): if (not state in allowed_type or not isinstance(received_objects, dict)): import dbg dbg.TraceError( "<ScriptWindow> Failed to change state.\n{0}\n{1}".format( "<state '{0}'> Allowed states: {1}.".format(state, allowed_type), "{0} Allowed type: {1}.".format(type(received_objects), type(dict())))) return [item.Hide() if (state is self.STATE_HIDE) else item.Show() for item in [zip for zip in received_objects.values() if (zip is not None)]] #main.py (example): self.childrenDict = self.GetChildDictionary(["LoginButton", "LoginExitButton"]) self.childrenDict["LoginButton"].SetPosition(20, 500) self.childrenDict["LoginExitButton"].SetPosition(-300, 800) self.Realloc(self.STATE_SHOW, childrenDict) # Use Realloc(state, object_dictionary) for a action as Hide() or Show() by state.
  9. This module was not designed for people who don't know nothing about python. Here is a simple functions which gives you the chance to be able to turn all objects of script loader (uiScript) into a a simple list and control all very simple. This is more easy if you have a lot a objects and want to do some actions with them like set multiples text, load images etc. do a simple loop by range start:end and you can play with it. self.OBJECT_MAX_NUM = 25 | You can change how many max objects you can send into list. self.Realloc(state, objectList) | You can run a action (Hide() / Show()) for all objects what you sended on list. How to use GetChildList(list()): class TestWindow(ui.ScriptWindow): def __init__(self): ui.ScriptWindow.__init__(self) ui.PythonScriptLoader().LoadScriptFile(self, "uiscript/guildwindow.py") self.childrenList = self.GetChildList(["GuildNameValue", "DeclareWarButton", "Board"]) def Reference(self): self.childrenList[0].SetText("GUARDIANS") self.childrenList[1].SetPosition(100, 200) self.childrenList[2].SetSize(500, 1000) How to use self.Realloc(int, list()): def OnClickHideButton(self): self.Realloc(self.STATE_HIDE, self.GetChildList(["GuildNameValue", "GuildMasterNameValue", "CurrentExperienceValue", "LastExperienceValue", "GuildMemberCountValue", "DeclareWarButton"])) How you can play with GetChildList, another example: for (key, object) in enumerate(self.GetChildList(["TextLineA", "TextLineB", "TextLineC"])): object.SetText("Format line: {0}".format(key)) Code isn't so wow, because i was write on some minutes for test something and i don't use it so, enjoy. #root/ui.py #1.) Search for: class ScriptWindow(Window): def __init__(self, layer = "UI"): Window.__init__(self, layer) self.Children = [] self.ElementDictionary = {} #2.) Add after: self.STATE_HIDE = 1 self.STATE_SHOW = 2 self.OBJECT_MAX_NUM = 25 #1.) Search for: def GetChild(self, name): return self.ElementDictionary[name] #2.) Add after: def GetChildList(self, received_objects): return [self.ElementDictionary.get(item, None) for item in received_objects] if (isinstance(received_objects, (list, tuple))) else list() def Realloc(self, state, received_objects, state_alowed = [self.STATE_HIDE, self.STATE_SHOW]): if (not state in state_alowed or not isinstance(received_objects, (list, tuple))): import dbg dbg.TraceError( "<ScriptWindow> Failed to change state.\n{0}\n{1}".format( "<state '{0}'> Allowed states: {1}.".format(state, state_alowed), "{0} Allowed type: tuple or a list.".format(type(received_objects)) )) return [item.Hide() if (state is self.STATE_HIDE) else item.Show() for item in [object for object in (received_objects if len(received_objects) < self.OBJECT_MAX_NUM else received_objects[:self.OBJECT_MAX_NUM]) if (object is not None)]]
  10. Download code: [Hidden Content]
  11. _______________________________________ Multilanguage System Full informations: [Hidden Content] _______________________________________
  12. #Be prepared on this summer, soon new systems from official.
×
×
  • Create New...