Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/31/21 in all areas

  1. Let's assume common_drop_item.txt is almost never used by anyone, but for those who are thinking about using it, here's some (potential) bugs I found inside. Those may or may be not bugs, it depends on what use you want to make for common_drop_item. I think the most useful use would be to set drops easily depending on mob and users' levels, without making it mob-by-mob(mob_drop_item.txt), for those who wish to rewrite all the drops from scratch. It would be a good replace of settings drops via LUA(which may cause performance issues, and also you have to deal also with empire and user's drop rates) too. The bugs I found are: 1) Min and max_level are only based on the user's level. No matter which mob level it is(e.g. min_level=30, max_level=100: if you kill a wolf(level 3) you will get the item anyway). 2) Consequence of (1), if player level is above or below 15 levels(standard level limit for dropping items) than mob's, the item will be dropped anyway. 3) The "count" was declared but never applied, only one item used to be dropped. And so on, thus I decided to rewrite the entire function and make it useful. Renewal Features: 1) If mob level is below or above than for example 15 levels than the common_drop_item, the item won't be dropped. 2) If mob level is above or below than certain levels from user, the item won't be dropped. 3) Just like standard drops, there will be applied handicaps on drop rate %, based on user and mob levels(There is a mid-level between start and end, the farthest difference between this and user or mob level is, the less drop rate % will be) 4) Drops can be also based on mob ranks(like common drop item's concern), and the ranks can be indicated. 5) You can choose in which map the item can be dropped(0=any). 6) Multiple items can be set in the same settings. Other features can be found in the function. Understanding structure: The structure is similar to mob_drop_item's one, but with new(and different) variables, which are: "map": the map index, default 0 "lv_start" and "lv_end": min and max (user)level, default 1-999 "min_rank": and "max_rank": min and max (mob)Rank, starting from 0, which is the 1st rank, default 0-3 "rank_gain": if there are more ranks, each rank will have more % chance to drop the item, based on the previous rank's percent, default 20 "level_diff": the minimum level difference between user and mobs' levels, and also the minimum level difference between mob and lv_start or lv_end, default 15 For item declaration, the syntax is the same as mob_drop_item, with 3 chars: ID VNUM COUNT PERCENT Note: This system has not been tested in real servers, and it may have some bugs or can be optimized, so please analyze it if you are planning to user it in real servers. If you find any bug or you have any advice, please share it here. Replace inside ITEM_MANAGER::CreateDropItem function in item_manager.cpp Replace entire function inside item_manager_read_tables.cpp Replace this class inside item_manager_private_types.h and item_manager.cpp Example Usage(Sword+9 at 0.5%): Note: If you wish to apply fairness between q.ty of items->percents, you can use one of these logics: 1) multiply iPercent by i (inside item_manager.cpp) 2) just multiply manually item percents by count of items inside common_drop_item.txt(e.g. first item(1) percent = 1, item_count=30 -> first_item(1) percent = first_item(1) percent*item_count)
    5 points
  2. Moin, I wrote a small system out of boredom which helps to block multiboxxing, you can define in the clientcode how many clients can be open at the same time. The whole thing works with windows mutexes and is completely "clientside" i.e. it's not an "ultimate" solution, but should stop every shit botter and similar. Do note: The code is not perfect. just paste the code into UserInterface.cpp: bool genMutex(int id) { std::string mutex_name = "MultiBoxBlock"; mutex_name.push_back(id); HANDLE Mutex = OpenMutexA(MUTEX_ALL_ACCESS, 1, mutex_name.c_str()); if (!Mutex || WaitForSingleObject(Mutex,500) == WAIT_ABANDONED) { CreateMutexA(0, 1, mutex_name.c_str()); Sleep(INFINITY);//locks mutex return true; } return false; } int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { bool ret = false; for (int i = 0;i<3;i++) { ret = genMutex(i); if (ret) break; } if (!ret) { MessageBoxA(NULL, "MultiBox detected", "", MB_OK); ExitProcess(0); } You can define the number of allowed clients in the "for loop". in my case 3. Video: [Hidden Content] Enjoy.
    3 points
  3. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) Python-Code-Translator-2-to-3 Is a Python program that reads Python 2.x source code and applies a series of fixers to transform it into valid Python 3.x code that works on all versions (py2.x - py3.x). The standard library contains a rich set of fixers that will handle almost all code. A flexible and generic library, so it is possible to write your own fixers based on your purposes. Warning: This tool purpose wasn't for doing the transition to python3, is just for the IDE purpose. INSTALLATION [Hidden Content] USING Add your .py scripts to the modules folder. Run main.bat Take the output files and move them into your application. FIXERS print Converts the print statement to the print() function. Matching multiple formats, comments, and more. Exception handling Convert except to except BaseException, since BaseException is the base class for all built-in exceptions. Converts except X, T to except X as T. xrange Renames xrange() to range() and wraps existing range() calls with list. has_key Changed dict.has_key(key) to dict..contains__(key) dict Fixes dictionary iteration methods. dict.iteritems() is converted to dict.items(), dict.iterkeys() to dict.keys(), and dict.itervalues() to dict.values(). Similarly, dict.viewitems(), dict.viewkeys() and dict.viewvalues() are converted respectively to dict.items(), dict.keys() and dict.values(). It also wraps existing usages of dict.items(), dict.keys(), and dict.values() in a call to list. exec - TODO Converts the exec statement to the exec() function. apply - TODO Removes usage of apply(). For example apply(function, *args, **kwargs) is converted to function(*args, **kwargs). raise - TODO Converts raise E, V to raise E(V), and raise E, V, T to raise E(V).with_traceback(T). If E is a tuple, the translation will be incorrect because substituting tuples for exceptions has been removed in 3.0. You can use it together with Skeleton of Python modules for IDE, from @Takuma. Download: [hide][Hidden Content]]
    1 point
  4. M2 Download Center Download Here ( Internal ) Hello, I did some effects for metin2 and I said to post at least one of them Youtube DOWNLOAD VirusTotal
    1 point
  5. reverse text prank 1 april.. I searched for 10 minutes to post this topic
    1 point
  6. Welcome to Metin2Dev, D!
    1 point
  7. The basic changes are: From: def __SelectSkillGroup(self, index): for btn in self.skillGroupButton: btn.SetUp() self.skillGroupButton[index].Down() if self.__CanUseHorseSkill(): if 0 == index: index = net.GetMainActorSkillGroup()-1 elif 1 == index: index = self.PAGE_HORSE self.curSelectedSkillGroup = index self.__SetSkillSlotData(net.GetMainActorRace(), index+1, net.GetMainActorEmpire()) To: [Hidden Content] After some minutes of debugging I rewrote this shit, there're more changes, when i'll have some free time (at Monday), i'll post the code. Without skill group +/- horse riding: [Hidden Content] With skill group +/- horse riding: [Hidden Content]
    1 point
  8. The idea isn't so bad, but the code has too many useless lines, here's what you can do to improve it. def RefreshPickupFilter(self): #Weapon if systemSetting.IsPickUpFilterWeapon(): self.PickUpFilterList[0].Down() else: self.PickUpFilterList[0].SetUp() #Armor if systemSetting.IsPickUpFilterArmor(): self.PickUpFilterList[1].Down() else: self.PickUpFilterList[1].SetUp() #Ear if systemSetting.IsPickUpFilterEar(): self.PickUpFilterList[2].Down() else: self.PickUpFilterList[2].SetUp() #Neck if systemSetting.IsPickUpFilterNeck(): self.PickUpFilterList[3].Down() else: self.PickUpFilterList[3].SetUp() #Foots if systemSetting.IsPickUpFilterFoots(): self.PickUpFilterList[4].Down() else: self.PickUpFilterList[4].SetUp() #Shield if systemSetting.IsPickUpFilterShield(): self.PickUpFilterList[5].Down() else: self.PickUpFilterList[5].SetUp() #Book if systemSetting.IsPickUpFilterBook(): self.PickUpFilterList[6].Down() else: self.PickUpFilterList[6].SetUp() #Stone if systemSetting.IsPickUpFilterStone(): self.PickUpFilterList[7].Down() else: self.PickUpFilterList[7].SetUp() #Etc if systemSetting.IsPickUpFilterEtc(): self.PickUpFilterList[8].Down() else: self.PickUpFilterList[8].SetUp() To: def RefreshPickupFilter(self): checkFilterList = ( systemSetting.IsPickUpFilterWeapon(), systemSetting.IsPickUpFilterArmor(), systemSetting.IsPickUpFilterEar(), systemSetting.IsPickUpFilterNeck(), systemSetting.IsPickUpFilterFoots(), systemSetting.IsPickUpFilterShield(), systemSetting.IsPickUpFilterBook(), systemSetting.IsPickUpFilterStone(), systemSetting.IsPickUpFilterEtc() ) for child, flag in zip(self.PickUpFilterList, checkFilterList): if flag: child.Down() else: child.SetUp() self.PickUpFilterList.append(GetObject("Pick_Up_FilterWeapon")) self.PickUpFilterList.append(GetObject("Pick_Up_FilterArmor")) self.PickUpFilterList.append(GetObject("Pick_Up_FilterEar")) self.PickUpFilterList.append(GetObject("Pick_Up_FilterNeck")) self.PickUpFilterList.append(GetObject("Pick_Up_FilterFoots")) self.PickUpFilterList.append(GetObject("Pick_Up_FilterShield")) self.PickUpFilterList.append(GetObject("Pick_Up_FilterBook")) self.PickUpFilterList.append(GetObject("Pick_Up_FilterStone")) self.PickUpFilterList.append(GetObject("Pick_Up_FilterEtc")) To: for name in ('Weapon','Armor','Ear','Neck','Foots','Shield','Book','Stone','Etc'): self.PickUpFilterList.append(GetObject("Pick_Up_Filter{}".format(name))) self.PickUpFilterList[0].SetToggleUpEvent(self.__OnClickPickupFilterButtonWeapon) # Weapon self.PickUpFilterList[0].SetToggleDownEvent(self.__OnClickPickupFilterButtonWeapon) # Weapon self.PickUpFilterList[1].SetToggleUpEvent(self.__OnClickPickupFilterButtonArmor) # Armor self.PickUpFilterList[1].SetToggleDownEvent(self.__OnClickPickupFilterButtonArmor) # Armor self.PickUpFilterList[2].SetToggleUpEvent(self.__OnClickPickupFilterButtonEar) # Ear self.PickUpFilterList[2].SetToggleDownEvent(self.__OnClickPickupFilterButtonEar) # Ear self.PickUpFilterList[3].SetToggleUpEvent(self.__OnClickPickupFilterButtonNeck) # Neck self.PickUpFilterList[3].SetToggleDownEvent(self.__OnClickPickupFilterButtonNeck) # Neck self.PickUpFilterList[4].SetToggleUpEvent(self.__OnClickPickupFilterButtonFoots) # Foots self.PickUpFilterList[4].SetToggleDownEvent(self.__OnClickPickupFilterButtonFoots) # Foots self.PickUpFilterList[5].SetToggleUpEvent(self.__OnClickPickupFilterButtonShield) # Shield self.PickUpFilterList[5].SetToggleDownEvent(self.__OnClickPickupFilterButtonShield) # Shield self.PickUpFilterList[6].SetToggleUpEvent(self.__OnClickPickupFilterButtonBook) # Books self.PickUpFilterList[6].SetToggleDownEvent(self.__OnClickPickupFilterButtonBook) # Books self.PickUpFilterList[7].SetToggleUpEvent(self.__OnClickPickupFilterButtonStone) # Stone self.PickUpFilterList[7].SetToggleDownEvent(self.__OnClickPickupFilterButtonStone) # Stone self.PickUpFilterList[8].SetToggleUpEvent(self.__OnClickPickupFilterButtonEtc) # Etc self.PickUpFilterList[8].SetToggleDownEvent(self.__OnClickPickupFilterButtonEtc) # Etc To: eventFuncList = ( self.__OnClickPickupFilterButtonWeapon, self.__OnClickPickupFilterButtonArmor, self.__OnClickPickupFilterButtonEar, self.__OnClickPickupFilterButtonNeck, self.__OnClickPickupFilterButtonFoots, self.__OnClickPickupFilterButtonShield, self.__OnClickPickupFilterButtonBook, self.__OnClickPickupFilterButtonStone, self.__OnClickPickupFilterButtonEtc ) for child, event in zip(self.PickUpFilterList, eventFuncList): child.SetToggleUpEvent(event) child.SetToggleDownEvent(event)
    1 point
  9. You don't need server source for this, you can do it directly via source client. For being in real time you'll need to do a boolean variable inside of CInstanceBase class which is updated from RecvAffectAddPacket, RecvAffectRemovePacket for each instance. So with that you could do a function like chrmgr.IsPoisoned(self.GetTargetVID()) which will result the status of poison for specific vid and check it in OnUpdate. Btw, the implementation is very bad, if i would want to do this, i don't touch the hpGauge, just add a new gauge bar over the hpGauge and hide/show it, that's all, could be done just with few lines, without the python. [Hidden Content]
    0 points
×
×
  • 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.