Jump to content

VegaS™

Forum Moderator
  • Posts

    656
  • Joined

  • Last visited

  • Days Won

    187
  • Feedback

    100%

Everything posted by VegaS™

  1. Texture of the ground is a little bit weird, but in the end looks good.
  2. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) Get bonus name from tooltip affect dictionary as string, ignore the %value% and function SA, SNA etc. Ignore the dump.txt & dump_test.py, is just to test how function works. Just follow tutorial from localeInfo.py. How-To-use import localeInfo import item # FormatBonusNameString print localeInfo.FormatBonusNameString(item.APPLY_RESIST_SWORD) # FormatBonusNameDict for bonusIndex, bonusName in localeInfo.FormatBonusNameDict().iteritems(): print '{:d}: {:s}'.format(bonusIndex, bonusName) GitHub repository: [Hidden Content]
  3. Better to use for both of them since you don't change anything and also cast the (dam/100), the result can be floating point data type, since you want a integer, is a good practice to do it. const uint8_t iPrctMana = 31; const int32_t iDamageSPPart = static_cast<int32_t>(dam / 100) * iPrctMana;
  4. You declared the variable into a if condition and then you try to call it from outside, that's wrong. def main(condition): if condition: variable = 100 print variable main(True) << 100 main(False) << Traceback (most recent call last): << File "main.py", line 6, in <module> << main(False) << File "main.py", line 4, in main << print variable << UnboundLocalError: local variable 'variable' referenced before assignment So, your problem is exchangeButton, declare it before condition if self.isShowButton, like: def OnUpdate(self): exchangeButton = self.buttonDict[locale.TARGET_BUTTON_EXCHANGE] [.....]
  5. I had a lot of problems with polish guys, so that isn't something new. There's a lot of guys which trying to make shit. The main problem of me, time = bad seller. I don't have enough time since 2018, also as you saw, i wasn't actived in forums In period 2016-2019 too much, disappeared because i have more important things to do than metin2. The metin2 remained just as a hobby and do some shits when i have some free time, I've to study for university and other activities. A good point for people which still trying to contact me, write me on WhatsApp, not Skype, there's small chances to answer in Skype because i've over 4500+ contacts and hundreds of requests (photo) and messages since a lot of time, i don't have time to answer on them, i just answer to people which are friendly and random ones. As you know, i'm not a scammer, so if i didn't answered to you x weeks/months, that doesn't mean i stole your money, as i said, my problem is time, and that make me a bad person in some eyes. But in the end, everything is fine and the customer will get what he paid, even if x time passed. There still exist some guys which i still didn't answered to them because of many factors, but if they'll write me again with a good behaviour, be sure i'll reply to you back. I've no reason to put peoples to wait for my systems, if i do this there exist some factors, depends of: my time, your character and how you talk, spamming, no patience etc. I know is easy to talk, "yo vegas is shit seller, he didn't answer since months, years" but did you think about me? when you've hundreds of messages from all countries and try to talk with them as you can, and there's a lot of bastards guys which are resellers and try to buy your work and try to find them out? Let's don't a off-topic in this subject. Send me a message in Skype and we'll fix it.
  6. Added a gist link for download. Fixed NumberToMoneyString format method. (thanks to @Syreldar)
  7. There are a lot of people which had problem with localeInfo because korean-characters and bad encoding, there's a clean file with refactored code. Removed all the code which isn't used like korean characters < bad encoding [runmain error / crash](editors problem) and more checks. Removed over 500 lines unused. Removed function mapping(**kwargs) and use constructor of dict > dict(**kwarg) which is same (**kwarg let you take arbitrary number of keyword arguments). Removed function CutMoneyString because is used just when locale is HongKong, CIBN. Removed check IsYMIR from function LoadLocaleData which load locale as locale/ymir or locale/we_korea. Removed GUILD_MARK_NOT_ENOUGH_LEVEL, GUILD_HEADQUARTER, GUILD_FACILITY, GUILD_OBJECT, MAP_TRENT02, MAP_WL, MAP_NUSLUCK, MAP_TREE2, LOGIN_FAILURE_WEB_BLOCK, LOGIN_FAILURE_BLOCK_LOGIN, CHANNEL_NOTIFY_FULL, now they're readed directly from locale_game.txt. Removed declared global variables. Removed checks for declaring LOCALE_FILE_NAME, FN_GM_MARK and use current path. Removed korean functions/lists/dictionaries/characters GetAuxiliaryWordType, JOBINFO_DATA_LIST, dictSingleWord, dictDoubleWord, etc. Removed unused things: locale mapping, 'all' list etc. Removed IN_GAME_SHOP_ENABLE declaration, should be declared inside of constInfo directly. Removed checks (locale path) - 949, 932 == app.GetDefaultCodePage(), IsHONGKONG, IsNEWCIBN() or IsCIBN10() from declaration of functions like (NumberToMoneyString, NumberToSecondaryCoinString, ...),now they're declared directly from old style (IsEUROPE() and not IsWE_KOREA() and not IsYMIR()). Added custom string format(format_string, *args, **kwargs) instead of %. (old-style). Added new checks inside of LoadLocaleFile for security: Check if token3 (token1=original_string, token2=return-string, token3=function) function name exist in our types (SA, SNA, SAA, SAN) then try to call it. Check if string line have no tabs. Diff-checker: (856 Removals + 301 Additions) [Hidden Content] [Hidden Content]
  8. If I am not mistaken, he said "language quest" which for him mean "The Programming Language Lua", not "chose language for quest", so your post-explanation have no sense in this case. As @Syreldar said, you can't do it with the default structure of ymir-gay, already i tried long time ago to debug it and fix it with many attempts, but no succes (at that time), i'll take a look again when i'll have time.
  9. The post is from 4 years ago, i changed my mega-account, here's the re-upload. [Hidden Content] Password Archive: property_vegas_work
  10. Try this. (not-tested!) ..Src/Server/common/service.h #define ENABLE_OXEVENT_STATIC_QUIZ ..Src/Server/game/src/OxEvent.cpp #ifdef ENABLE_OXEVENT_STATIC_QUIZ bool COXEventManager::Quiz(unsigned char level, int timelimit) { SendNoticeMap(LC_TEXT("문제 입니다."), OXEVENT_MAP_INDEX, true); SendNoticeMap("True or false?", OXEVENT_MAP_INDEX, true); SendNoticeMap(LC_TEXT("맞으면 O, 틀리면 X로 이동해주세요"), OXEVENT_MAP_INDEX, true); if (m_timedEvent) event_cancel(&m_timedEvent); OXEventInfoData * pkEventInfo = AllocEventInfo<OXEventInfoData>(); pkEventInfo->answer = static_cast<bool>(number(0, 1)); m_timedEvent = event_create(oxevent_timer, pkEventInfo, PASSES_PER_SEC(MINMAX(15, timelimit - 15, 60))); SetStatus(OXEVENT_QUIZ); return true; } #else bool COXEventManager::Quiz(unsigned char level, int timelimit) { if (m_vec_quiz.size() == 0) return false; if (level > m_vec_quiz.size()) level = m_vec_quiz.size() - 1; if (m_vec_quiz[level].size() <= 0) return false; if (timelimit < 0) timelimit = 30; int idx = number(0, m_vec_quiz[level].size()-1); SendNoticeMap(LC_TEXT("문제 입니다."), OXEVENT_MAP_INDEX, true); SendNoticeMap(m_vec_quiz[level][idx].Quiz, OXEVENT_MAP_INDEX, true); SendNoticeMap(LC_TEXT("맞으면 O, 틀리면 X로 이동해주세요"), OXEVENT_MAP_INDEX, true); if (m_timedEvent != NULL) { event_cancel(&m_timedEvent); } OXEventInfoData* answer = AllocEventInfo<OXEventInfoData>(); answer->answer = m_vec_quiz[level][idx].answer; timelimit -= 15; m_timedEvent = event_create(oxevent_timer, answer, PASSES_PER_SEC(timelimit)); SetStatus(OXEVENT_QUIZ); m_vec_quiz[level].erase(m_vec_quiz[level].begin()+idx); return true; } #endif
  11. You should change the structure, from reading the name of item to vnum directly.
  12. I don't understand why u guys, use search string name same as the return one for non-sense... ChatPacket(CHAT_TYPE_INFO, LC_TEXT("INFO_DESTROY_ITEM"), item->GetName()); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("INFO_DESTROY_ITEM_WARNING"), item->GetName()); ../share/locale/germany/locale_string.txt "INFO_DESTROY_ITEM"; "[Info] Ai distrus %s."; "INFO_DESTROY_ITEM_WARNING"; "|cff8ddcab[Info]|r |cffffffffItem-ul|r |cFFFFC700%s|r |cffffffffnu se mai poate recupera.|r";
  13. Add some conditions in your function like this: if (race > 0 && race <= 2499) // vec_stPathes.push_back ("d:/ymir work/monster/"); else if (race >= 2500 && race <= 8999) // vec_stPathes.push_back ("d:/ymir work/monster2/"); else { [....] }
  14. If you want to compare the guild of 2 players and see if they're in the same guild you should do a global function for LUA, which can be used everywhere. Src/Server/game/src/questlua_global.cpp share/locale/germany/quest_function quest_example.lua
  15. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) Showing a message by specific error type when a item failed into refine. [Hidden Content]
  16. You use a dictionary since you don't save anything, in this case you should use a list. #WARNING_WHISPER_GM = {} WARNING_WHISPER_GM = [] #constInfo.WARNING_WHISPER_GM.update({targetName : {}}) constInfo.WARNING_WHISPER_GM.append(targetName)
  17. The idea isn't bad (even if we're in 2019 and can be bypassed very easy and have no effects this), but there's some things which can be written in C++11 and a better structure, since your map have empty list initialization (since C++11). Here's some advices which can help you in future, maybe. Your map have as value type a another std::map, for what? Since you store in key and value the same thing (player id), you should use std::list / std::vector or anything you want, but not a another std::map for no-reason if your key is same as value and no possible changes. You insert all time for each login in a x map the player id, you don't check if already exist and then insert it (you could use std::find/std::map::find), you use make_pair for map and that means the key can't be duplicated, but this isn't a good practice to trying to insert 1000 times and nothing happen. You check if map size is smaller or equal than 0, how can be a map size < 0? You declared a another map for iterating in a for-loop, you don't need to do that. std::map<DWORD, DWORD> map_players = [....]; You use map.at(...), if you use this you should use the std::out_of_range too, otherwise have no sense, because you already did a check before if exist mapIndex by map.count(index), so you can use directly operator std::map::operator[] instead of std::map::at. You declared a std::string with no-reason for GetHostName() -> return a const char *, which you can use strcmp(str1, str2) instead of string.compare(str2). Your key of map should be as constant, because you don't want to change it. You should use also #pragma once for your header file (including: less code, avoidance of name clashes, and sometimes improvement in compilation speed.) You should remove the pid of player after disconnect of the map, have no sense to remain. PS: If i were in your place, i didn't do the structure like this, it's a bit messed up. Here's some of things what i said. (didn't tested) [Hidden Content] [Hidden Content] map_manager.h map_manager.cpp BTW: Sorry for my english skills.
  18. Why u guys don't read text-informations from Git? EVENTS_CALENDAR_DICT is just a configuration for <Python-Live-Test>. The struct of the dictionary need to get it like EVENTS_CALENDAR_DICT = calendar.GetEventsData() << Source Client < Server Also i'm sure you didn't understand how's work too, check with careful, you don't need to add events for each day/week etc, all are automatic. 'WEEKLY' - 1 event = 48 objects (1 * 4 * 12) << Insert the event by a specific day of week for each month. 'DAILY' - 1 event = 336-372 objects (1 * 28-31 * 12) << Insert the event for all days in each month. 'MONTHLY' = 1 event = 1 object << Insert the event by a specific day of month. 'ANNUALLY' - 1 event = 1 object << Insert the event by a specific month, week from month and day from week. I said in the main post, this is just the python module part, the dictionary with config is just for live-test-debug, you've to parser how you want, from source client which is sended by a packet from server bla bla, is ur business how you want to do it, not mine, there's missing some things, you can get the classes/funcs and extend with your features/design etc. PS: This module is for people who know what they've to do and know to read the code and make it work as they want, not for beginners. As i said, don't ask for support implementation, the module doesn't contain all resources, is just for "developers".
  19. Thanks to @Mithras01 that he reminded me about bisection years. (i'll update the repository when i'll have a bit more free time) Leap Year A normal year has 365 days. A Leap Year has 366 days (the extra day is the 29th of February). Leap Years are any year that can be exactly divided by 4 (such as 2012, 2016, etc) except if it can be exactly divided by 100, then it isn't (such as 2100, 2200, etc) except if it can be exactly divided by 400, then it is (such as 2000, 2400) def GetRangeDaysMonth(calendarMonth): def GetBisectionYear(year): """ Provides support for maintaining a list in sorted order without having to sort the list after each insertion. Return True for leap years, False for non-leap years. """ return year % 4 == 0 and (year % 100 <> 0 or year % 400 == 0) """ TODO-DONE: Fix the calendar range days-month if month is February and is a bisection year like 2016, 2020, 2024 ... """ return Math.OFFSETS_MONTH_RANGE_TUPLE[calendarMonth - 1] + (calendarMonth == 2 and GetBisectionYear(Math.GetCurrentYear())) Output-test:
  20. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) There's just a smart python module which i did for fun, for a friend, no support for implementation. Enjoy. Github repository: [Hidden Content]
  21. Of course, the output of syserr or in generally the lines which showing the errors are not printed 100% the line fixed with the problem, there could be a syntax error, missing things etc. Before/after your EmpireName object too, and blocked while reading the code and your dictionary have missed some objects. We can't fix a error all time just because of one line in syserr, you need to investigate the files related and see what's the real problem and use debug method.
  22. Using std::ifstream, very easy. [Hidden Content] DWORD dwItemVnum; float fProb; std::ifstream myfile(c_pszFileName, std::ifstream::in); while (myfile >> dwItemVnum >> fProb) { [...........] }
  23. If somebody needs, there's a old shit which i did for somebody who had the source with no LC_TEXT and re-convert the source and adding LC_TEXT("string_index") and write a new locale_string.txt with string_index = the string which you had before. Ignore the code, is a shit, take just the idea. # Output: """ "LOCALE_STRING_01"; "Hai ricevuto %d"; "LOCALE_STRING_02"; "Una luce proviene da un grande albero"; "LOCALE_STRING_03"; "Hai ricevuto %d "; "LOCALE_STRING_04"; "Target is in %d channel (my channel %d)"; "LOCALE_STRING_05"; "Cannot find map (index %d)"; "LOCALE_STRING_06"; "You warp to ( %d, %d )"; "LOCALE_STRING_07"; "There is no one by that name"; "LOCALE_STRING_08"; "You warp to ( %d, %d )"; "LOCALE_STRING_09"; "<Mercatino Offline> Rinnovato di 30 giorni. Verrai sconnesso tra 3 secondi."; """ def UpdateLocaleString_SRC(): basePath, baseExcludeExt = (SRC_GAME_BASE_PATH, EXTENSION_EXCLUDED_LIST_SRC) localeStringList = [] for root, dirs, files in os.walk(basePath, topdown = True): dirs[:] = [dir for dir in dirs if dir not in DIRECTORY_EXCLUDED_LIST] countFunc = 0 for fileName in [file for file in files if GetExtension(file) not in baseExcludeExt]: # Cpp file fileName = '{:s}/{:s}'.format(root, fileName) for line in open(fileName, 'r').readlines(): line = line.strip('\n') chatLocaleString = '"LOCALE_STRING_%02u")' if LC_TEXT in line: continue if chatPacketFunc not in line: continue chatPointer = line.split(chatPacketFunc)[0].strip() chatType = line.split(chatPacketFunc)[1].split(",")[0] chatLine = chatMacroLocale % chatPointer chatIndexFindBeginString = line.find('"') chatIndexFindEndString = line.rfind('"') + 1 chatLastArgs = line[chatIndexFindEndString : len(line)] chatLocaleStringFinal = chatLocaleString % countFunc chatPosition = line.split(chatPacketFunc)[0] if chatPointer: chatPosition = line.split(chatPointer)[0] chatResult = chatPosition + chatPointer + chatPacketFunc + chatType + ", " + chatLine + chatLocaleStringFinal + chatLastArgs bAdded = AddLocaleString(fileName, line, chatResult) if bAdded: localeStringList.append((chatLocaleStringFinal[:-1] + ';', line[chatIndexFindBeginString : chatIndexFindEndString] + ';')) countFunc += 1 f = open("{:s}/{:s}".format(basePath, LOCALE_STRING_FILE_NAME), 'a+') for first, second in localeStringList: f.write('{:s}\n{:s}\n\n'.format(first, second)) f.close()
  24. exception KeyError Raised when a mapping (dictionary) key is not found in the set of existing keys. For example: mydict = { 'EmpireName': ui.TextLine, 'GuildImage': ui.ExpandedImageBox } >>> empireName = mydict['EmpireName'] # <ui.TextLine object at 0x06FC3310> >>> guildImage = mydict['SkillName'] # Traceback (most recent call last): # File "<stdin>", line 1, in <module> # KeyError: 'SkillName' Check your selectcharacterwindow.py and be sure you have the object called 'EmpireName'.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.