metin2united

Search the Community

Showing results for tags 'c++' in content posted in Programming / Scripts.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Community
    • Announcements
    • Feedback
  • Metin2
    • General
    • Questions and Answers
    • Frequently Asked Questions
    • Guides & HowTo
    • Design
    • Private Servers
    • Services
    • Videos
  • Releases
    • General
    • Tools
    • Programming / Scripts
    • Quests
    • Binaries & Clients/Serverfiles
    • 3D Models
    • 2D Graphics
    • Operating Systems
  • Safe Zone
    • Offtopic
    • Games Talk
    • Music/Videos/Art
  • D:\YMIR WORK\'s Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Discord


Skype


ICQ


Yahoo


Location

Found 181 results

  1. https://github.com/blackdragonx61/Check-Polymorph-Map
  2. So many PServer's packs unpacked with "pack" method. Example What is the pack method?: Game is using pack method when load .py, .pyc and .txt files. Just look at the system.py Why Simple? Because we'll just change the method name. Gf did like this little changes example: playerm2g2, chatm2g, m2netm2g .... Go UserInteface/PythonPackModule.cpp and find: Py_InitModule("pack", s_methods); And change "pack" whatever you want. I'm gonna say "examplename" Go root/system.py and find: import pack Change like this; import examplename as pack That's all. That was the simplest idea I could think of.
  3. Rainbow1

    c++ Daily boss/event

    Daily Event Winter will come in days so what do you think about daily(or in chosen day) event with Grinch?. Before Grinch spawn game will send 4 notices about time of spawn. After kill daily boss(Grinch in package with map) game will send announcement with info about player who made last hit and kill Grinch. Every participants on this map after kill Grinch will get VIP bonuses for chosen time. Every settings like spawn time, announcement time are easy configurable. If you want fix small bug with displaying time please change this line like bellow: change: ["ANNOUCEMENT_LINE_3"] = "TODAY! About %d:%d he will be on Daily Boss Map."; for: ["ANNOUCEMENT_LINE_3"] = "TODAY! About %02d:%02d he will be on Daily Boss Map."; Announcement and spawn conf: Time in quest dialogs are imported directly from settings in game. If you will set this event only in one day of week then Quest Scroll will hidden in other days. You can simple disable VIP bonuses if you want only drop reward. If you want it only in one day then simply change const value and choose own day. Download & Scan http://www70.zippyshare.com/v/N3OY5zwj/file.html https://www.virustotal.com/#/file/91e74bab2c2fab4f3046b7d4e7ff1f31432730d5adce1de863a9866303025bbc/detection
  4. https://github.com/blackdragonx61/Metin2-Official-Inventory-Expansion
  5. https://github.com/blackdragonx61/Metin2-Sort-Inventory-Items/tree/master/V2
  6. This item type is the new type from official servers used for battle boxes and recently for boss chest and fish event boxes. You can open boxes few times (set in item_proto). 1. You can use macro ENABLE_BATTLE_FIELD because was added with battle zone. 2. Number of openings is in item_proto -> LimitValue1 (Like official) Let's start: Server Source Part: #db\src\ProtoReader.cpp (same steps in ItemCSVReader.cpp) //Search: "ITEM_BELT", //Add after: "ITEM_GACHA" //Search: in array string* arSubType 0, //34 //Add after: 0, //37 //Search: in array int arNumberOfSubtype 0, //34 //Add after: 0, //37 #common\item_length.h //Search: ITEM_BELT, //Add after: ITEM_GACHA, #game\src\item_manager.cpp //Search: if (id == 0) //Add before: (be careful , before) if(item->GetType() == ITEM_GACHA) item->SetSocket(0, item->GetLimitValue(1)); #game\src\char_item.cpp //Search: (CHARACTER::UseItemEx) case ITEM_EXTRACT: ... break; //Add after: case ITEM_GACHA: { DWORD dwBoxVnum = item->GetVnum(); std::vector <DWORD> dwVnums; std::vector <DWORD> dwCounts; std::vector <LPITEM> item_gets(0); int count = 0; if (GiveItemFromSpecialItemGroup(dwBoxVnum, dwVnums, dwCounts, item_gets, count)) { if(item->GetSocket(0) > 1) item->SetSocket(0, item->GetSocket(0) - 1); else ITEM_MANAGER::instance().RemoveItem(item, "REMOVE (ITEM_GACHA)"); } } break; Client Source Part: #GameLib\ItemData.h //Search: ITEM_TYPE_BELT, //Add after: ITEM_TYPE_GACHA, #UserInterface\PythonItemModule.cpp //Search: PyModule_AddIntConstant(poModule, "ITEM_TYPE_BELT", CItemData::ITEM_TYPE_BELT); //Add after: PyModule_AddIntConstant(poModule, "ITEM_TYPE_GACHA", CItemData::ITEM_TYPE_GACHA); Client root part: #root\uitooltip.py #Search: elif item.ITEM_TYPE_FISH == itemType: if 0 != metinSlot: self.__AppendFishInfo(metinSlot[0]) #Add after: ### Gacha = Battle Shop Chest ### elif item.ITEM_TYPE_GACHA == itemType: if 0 != metinSlot: if self.isShopItem: restUsableCount = int(item.GetLimit(1)[1]) else: restUsableCount = int(metinSlot[0]) self.AppendSpace(5) self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % (restUsableCount), grp.GenerateColor(0.5, 1.0, 0.3, 1.0)) Client locale part: #locale_game.txt #Add: TOOLTIP_REST_USABLE_COUNT Left: %d Server Item_proto example: 25111 fish 보상상자 ITEM_GACHA 0 1 NONE NONE NONE NONE 0 0 0 0 0 LIMIT_NONE 0 LIMIT_NONE 1 APPLY_NONE 0 APPLY_NONE 0 APPLY_NONE 0 0 0 0 0 0 0 0 0 0 12 25112 fish 보상상자 ITEM_GACHA 0 1 NONE NONE NONE NONE 0 0 0 0 0 LIMIT_NONE 0 LIMIT_NONE 2 APPLY_NONE 0 APPLY_NONE 0 APPLY_NONE 0 0 0 0 0 0 0 0 0 0 12 25113 fish 보상상자 ITEM_GACHA 0 1 NONE NONE NONE NONE 0 0 0 0 0 LIMIT_NONE 0 LIMIT_NONE 3 APPLY_NONE 0 APPLY_NONE 0 APPLY_NONE 0 0 0 0 0 0 0 0 0 0 12
  7. Description : The mount will follow you. The bonuses is set from item_proto. https://i.gyazo.com/9dac9deaada344672a153f37575d0b13.mp4 https://i.gyazo.com/05713068360a55cbbe25db6761925030.mp4https://i.gyazo.com/de7397f26a0b7aeeb66e1b4ce4af5b0d.mp4 Code is based on default pet code from Ymir, i don't offer support for extra features, details, anyway easy for use. (Sorry for tutorial, not so perfect.) Download: https://mega.nz/#!Ss4Bja6a!6hvCfE_Ec2D-4ESAMoWLrD80Cuafh718c5QV8LwBlpA
  8. CxL'Mufuku

    c++ [RLS]RenderTarget

    Hi, I don't think I have to tell much about this. It'll look like the official one, some code is c&p from the official root files. Most of the own written code is NOT like the offical one. I added a new python module ("renderTarget"), so you don't need methods which officials use, like this: "playerm2g2.MyShopDecoShow( True )" You are able to display more than one render target at the same time. If you want to know more, take a look at the code. If there are any bugs, just message me. Download: https://cxl.services/freebies/RenderTarget (CxL).rar Password: Cxl.Services
  9. Cheque system full ~ like official This is my second release. I hope the tut is understood perfectly. Any error that you find in the system can comment here. I hope you find it useful. PS: Sorry for the quest, I know it's not very optimized, but it's functional and you can modify it yourself. If you want, you can install expanded money taskbar that I released in this same forum. Clic here to download VirusTotal Password: metin2.dev Best regards.
  10. Informations about system : When you will open a chest with drop , will appear this window. In this window you can preview drop of chest and you can make a setting how many chests you want open. Image:https://gyazo.com/866f9c8b3cf7f495642139b61e01bf4f.gif DL Link : https://mega.nz/#!yUwxVSbZ!Kbo00sVG8suCK0PCtrcVAW9I63Xt98DNHAiKMAoqaOY
  11. https://github.com/blackdragonx61/Metin2-Typing-Information--Whisper-
  12. Rainbow1

    c++ Auto Announcements

    Auto Announcements This system allows you to send announcements at chosen time. There are 3 categories of announcements. Hourly Announcements You can set announcements which will appears at chosen minute after every full hour. Special Announcements You can set announcements which appears at chosen time in chosen day. If you want to show messageeveryday in same hour simply set day to EVERYDAY. Special Announcements | from h - to h You can set announcements which appears in chosen by you time intervals(ex. 17:00 - 21:00) 00, 20 and 40 minutes after full hour. Like in preview mode you can set it to EVERYDAY if you want show announcement everyday. By default it support 5 lines of message, but it's configurable. If you want to hide line simply set it to "". Dwonload & Scan http://www89.zippyshare.com/v/R6aMRmtr/file.html https://www.virustotal.com/#/file/350f23a008f2ec7d972be88c1e28247477d03d12e7e64e0d28e91a556ea5ab09/detection
  13. UserInterface.cpp find: bool PackInitialize(const char * c_pszFolder) change: bool PackInitialize(const char * c_pszFolder) { if (_access(c_pszFolder, 0)) return true; std::string stFolder = c_pszFolder + std::string("/"); CTextFileLoader::SetCacheMode(); #if defined(USE_RELATIVE_PATH) CEterPackManager::Instance().SetRelativePathMode(); #endif CEterPackManager::Instance().SetCacheMode(); CEterPackManager::Instance().SetSearchMode(true); CSoundData::SetPackMode(); std::vector<std::string> packlist { "icon", "locale", "uiscript", "textureset", "Map", "Property", "Sound", "Terrain", "examplepack", "ymir_pack", }; for (const auto & pack : packlist) CEterPackManager::Instance().RegisterPack((stFolder + pack).c_str(), "*"); CEterPackManager::Instance().RegisterRootPack((stFolder + std::string("root")).c_str()); return true; }
  14. Hi there. Description: You put your cursor over an costume/armour and it will preview it. https://gyazo.com/514cf4f2ad25ba92d4be0484f68e001 Download: https://mega.nz/#!GqpCCY4K!uRtYVELuB3uIv7xsoAc3uqoRLasJJStiuN7msOyGoKU VT:https://www.virustotal.com/gui/file/efdd44a1ad4e4bc71724347a36d6338338345d40e71f8f2eeca7a4173baa9579/detection First, u have to install render target. Have fun with this.
  15. Hi everyone. I'd like to share a small guide for the official .mss file. It is a new Token in the sound script files which is controlling the volume, if the Token has been set of course. Couple of sound scripts are using this option: 0.0.) Make a backup of your files. 0.1.) Copying the codes from the board brings some invisible white characters with it, paste first into notepad++ and remove all the "?" characters. 1.0.) Open MilesLib/Type.h. 1.1.) Add the following variable to the two structured types by name: TSoundData and TSoundInstance. float fSoundVolume; 2.0.) Open MilesLib/Type.cpp. 2.1.) In the function by name "NSound::LoadSoundInformationPiece" look for the following code: int iCount; if (!rkTextFileLoader.GetTokenInteger("sounddatacount", &iCount)) { SetResultString((strResult + " File format error, SoundDataCount Unable to find.").c_str()); return false; } 2.2.) Paste the following below of it: float fVolume = 0.0f; if (rkTextFileLoader.GetTokenFloat("soundpositionenable", &fVolume)) { SetResultString((strResult + " SoundPosition has checked.").c_str()); } else { SetResultString((strResult + " SoundPosition has not checked.").c_str()); } 2.3.) Bit scrolled down extend the for cycle like this: for (DWORD i = 0; i < rSoundDataVector.size(); ++i) { //Some random stuff //{} rSoundDataVector[i].fSoundVolume = fVolume; } 2.4.) At the bottom of the file you will find this function: "NSound::DataToInstance", extend the for cycle with this line: rSoundInstance.fSoundVolume = c_rSoundData.fSoundVolume; 3.0.) Open the MilesLib/SoundManager.h. 3.1.) Add a new argument to the definition of the "PlaySound2D" function: void PlaySound2D(const char * c_szFileName, float fVolume = 0.0f); 4.0.) Open the MilesLib/SoundManager.cpp. 4.1.) Replace the function "PlaySound2D" with this: void CSoundManager::PlaySound2D(const char * c_szFileName, float fVolume) { if (0.0f == GetSoundVolume()) return; ISoundInstance * pInstance; if (!GetSoundInstance2D(c_szFileName, &pInstance)) return; float fNewVolume = fVolume; if (fVolume == 0.0f) fNewVolume = GetSoundVolume(); pInstance->SetVolume(fNewVolume); pInstance->Play(1); } 4.2.) Replace this function "CSoundManager::UpdateSoundInstance" with this: <!> Attention: Of this function you will find two, be sure you will replace the correct one, check the arguments! I think the second one is not in used at all <!> void CSoundManager::UpdateSoundInstance(float fx, float fy, float fz, DWORD dwcurFrame, const NSound::TSoundInstanceVector * c_pSoundInstanceVector, BOOL bCheckFrequency) { for (DWORD i = 0; i < c_pSoundInstanceVector->size(); ++i) { const NSound::TSoundInstance & c_rSoundInstance = c_pSoundInstanceVector->at(i); if (c_rSoundInstance.dwFrame == dwcurFrame) { if (0.0f == c_rSoundInstance.fSoundVolume) { //Tracenf("PLAY SOUND %s", c_rSoundInstance.strSoundFileName.c_str()); PlayCharacterSound3D(fx, fy, fz, c_rSoundInstance.strSoundFileName.c_str(), bCheckFrequency); } else { PlaySound2D(c_rSoundInstance.strSoundFileName.c_str(), c_rSoundInstance.fSoundVolume); } } } } Any problem occurs, post a comment below.
  16. Mali61

    c++ Check Time Event

    https://github.com/blackdragonx61/Check-Time-Event/ Somebody asked me about auto night and day change(server time). I coded simple func and added few features. •Auto night and day change: •Auto snow mode at winter: •Reminder for special days: •Announcement every hour You can add new features like this.
  17. Hello everyone, A lot of people might already know the issue. If you choose Arial as Font for Metin2, texts will be displayed in a weird way and with dots. There are a few reasons for this to happen and increasing font size fixes it, but no one wants huge texts everywhere and obviously, we wannt a nice font. Not a trial and error. So here's a partial fix for it. If you choose very small font sizes (e. g. font size 9px) in locale_game.txt it'll still look a bit off but it's definitely readable. With these changes, you'll have no problem with font sizes 14px and higher. Maybe someone wants to share different approaches or ideas. I think with these changes the problem is almost entirely fixed, no one needs size 9 especially with Arial.. First open your Binary source and search for "LOGFONT" (without "" of course). You'll find two matches where it's being used for initialization of new fonts: One in TextBar.cpp(CTextBar::__SetFont) and one in GrpFontTexture(CGraphicFontTexture::GetFont). And these are the two functions where we need to make some changes first. Under the line where LOGFONT is used, you're gonna add the following code: HDC hDC = m_dib.GetDCHandle(); if (hDC) { auto px = fontSize * 72 / 96; fontSize = -MulDiv(px, GetDeviceCaps(hDC, LOGPIXELSY), 72); } This code segment does two things: First it converst px -> pt, since LOGFONT expects pt. And on second, it calculates the correct displaying size according to the ppi and the cell height. This leads to the variable we need: The point size. Note that there's a minus, which means that we'll automatically choose the nearest possible size according to the specified font size. So everything's good here. Als note that you need add this segment to BOTH places where LOGFONT is being used for initialization. You have to change the name fontSize according to the files you edit. In TextBar.cpp the example above fits, for GrpFontTexture you just need to change fontSize to m_fontSize. Now change the following parts in both functions: logFont.lfOutPrecision = OUT_TT_ONLY_PRECIS; logFont.lfClipPrecision = CLIP_DEFAULT_PRECIS; logFont.lfQuality = NONANTIALIASED_QUALITY; logFont.lfPitchAndFamily = VARIABLE_PITCH; Note: You can also change logFont.lfWeight from FONT_NORMAL to FONT_MEDIUM or any other font weight if you wanna add up a mit more strength to your fonts. I just left it to FONT_NORMAL, which is fine. Also note that I chose NONANTIALIASED_QUALITY since anti-aliasing didn't make any change (not sure if Arial is even compatible, at least not those small font sized that I tested it with..). You can also change them to something like ClearType to do the job, that's up to you. I wanted to display the fonts just like they are, no mangling with them. But depending on your needs you can tweak a bit here. that's almost it! Last but not least, we have to change the way our adapter hDC does it's job. Especially since the above calculation for point size is only 100% true for MapMode MM_TEXT. And that's what we're gonna establish now. If you are in CGraphicFontTexture::GetFont, you can just scroll a bit higher. You'll see the initialization of hdC (function CGraphicFontTexture::Create). just below SetBkColor(hDC, 0); you can add these two lines: SetGraphicsMode(hDC, GM_ADVANCED); SetMapMode(hDC, MM_TEXT); Aaand you're done! That's it! Compile and enjoy! Best Regards Vanilla
  18. A few days ago I saw a post where someone asked how to hide the effects of the character and if there was a way, it would be better to do it with options to enabled/disabled. So I was trying to replicate the feature that the official servers implemented in version 18.4 Here I leave you an advance, it is not finished. At the moment only the options for hiding effects of items (such as "EFFECT_AUTO_HPUP", "EFFECT_HAPPINESS_RING_EQUIP", etc.) work. I know that you can also hide the effects such as skills, emoticons, etc. But I still can not find the way to do it (I could do it from playersettingmodule.py, but in that case it would not be updated in real time, the client.exe would have to be restarted for the changes to be made.) I suppose that somewhere in the client src it will be possible to , but I still can not find it. But you can also try! So if you like you can do it and share in this thread. Screenshot: Download link: click me ^^
  19. Hey there, I have an Halloween gift for you all. i have been working for a few hours on official like element image on target window(See screenshots below). When you click on a mob if it is defined as elemental, it will open an element image in addition to the target window. Don't forget to hit the like button! (C) Metin2 guild wars - coded by [GA]Ruin - 27/10/2017 (I create custom metin2 systems in c++/python. if you want a custom system send me a pm and we can talk over skype). Client files: element_image_client_files.rar Let's begin! Server Side: Open service.h, add in the end: #define ELEMENT_TARGET Open char.cpp, search for else { p.dwVID = 0; p.bHPPercent = 0; } add below: #ifdef ELEMENT_TARGET const int ELEMENT_BASE = 11; DWORD curElementBase = ELEMENT_BASE; DWORD raceFlag; if (m_pkChrTarget && m_pkChrTarget->IsMonster() && (raceFlag = m_pkChrTarget->GetMobTable().dwRaceFlag) >= RACE_FLAG_ATT_ELEC) { for (int i = RACE_FLAG_ATT_ELEC; i <= RACE_FLAG_ATT_DARK; i *= 2) { curElementBase++; int diff = raceFlag - i; if (abs(diff) <= 1024) break; } p.bElement = curElementBase - ELEMENT_BASE; } else { p.bElement = 0; } #endif open packet.h, search for: } TPacketGCTarget; add above: #ifdef ELEMENT_TARGET BYTE bElement; #endif Client side: open locale_inc.h, add in the end: #define ELEMENT_TARGET open packet.h, search for } TPacketGCTarget; add above: #ifdef ELEMENT_TARGET BYTE bElement; #endif open PythonNetworkPhaseGame.cpp, look for: else if (pInstPlayer->CanViewTargetHP(*pInstTarget)) replace below with the following: #ifdef ELEMENT_TARGET PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetHPTargetBoard", Py_BuildValue("(iii)", TargetPacket.dwVID, TargetPacket.bHPPercent, TargetPacket.bElement)); #else PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetHPTargetBoard", Py_BuildValue("(ii)", TargetPacket.dwVID, TargetPacket.bHPPercent)); #endif open PythonApplicationModule.cpp, look for #ifdef ENABLE_ENERGY_SYSTEM add above: #ifdef ELEMENT_TARGET PyModule_AddIntConstant(poModule, "ENABLE_VIEW_ELEMENT", 1); #else PyModule_AddIntConstant(poModule, "ENABLE_VIEW_ELEMENT", 0); #endif open game.py, look for def SetHPTargetBoard(self, vid, hpPercentage): if vid != self.targetBoard.GetTargetVID(): self.targetBoard.ResetTargetBoard() self.targetBoard.SetEnemyVID(vid) self.targetBoard.SetHP(hpPercentage) self.targetBoard.Show() replace with: if app.ENABLE_VIEW_ELEMENT: def SetHPTargetBoard(self, vid, hpPercentage,bElement): if vid != self.targetBoard.GetTargetVID(): self.targetBoard.ResetTargetBoard() self.targetBoard.SetEnemyVID(vid) self.targetBoard.SetHP(hpPercentage) self.targetBoard.SetElementImage(bElement) self.targetBoard.Show() else: def SetHPTargetBoard(self, vid, hpPercentage): if vid != self.targetBoard.GetTargetVID(): self.targetBoard.ResetTargetBoard() self.targetBoard.SetEnemyVID(vid) self.targetBoard.SetHP(hpPercentage) self.targetBoard.Show() open uitarget.py, look for import background add below: if app.ENABLE_VIEW_ELEMENT: ELEMENT_IMAGE_DIC = {1: "elect", 2: "fire", 3: "ice", 4: "wind", 5: "earth", 6 : "dark"} look for: self.isShowButton = False add below: if app.ENABLE_VIEW_ELEMENT: self.elementImage = None inside Destroy method, look for: self.__Initialize() add below: if app.ENABLE_VIEW_ELEMENT: self.elementImage = None inside ResetTargetBoard method, look for: self.hpGauge.Hide() add below: if app.ENABLE_VIEW_ELEMENT and self.elementImage: self.elementImage = None look for : def SetElementImage(self,elementId): add above: if app.ENABLE_VIEW_ELEMENT: def SetElementImage(self,elementId): try: if elementId > 0 and elementId in ELEMENT_IMAGE_DIC.keys(): self.elementImage = ui.ImageBox() self.elementImage.SetParent(self.name) self.elementImage.SetPosition(-60,-12) self.elementImage.LoadImage("d:/ymir work/ui/game/12zi/element/%s.sub" % (ELEMENT_IMAGE_DIC[elementId])) self.elementImage.Show() except: pass Compile server, client source and root pack and that's it! Enjoy! Happy halloween! element_image_client_files.rar
  20. 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 at GitHub: https://github.com/Vegas007/Metin2-Tab-Targeting-GF-v16.1 Copyright infringement:
  21. Hi there Devs, I successfully extended the maximum number of items in a stack, so I'd like to share it. Originally the type of the "count" variables are "BYTE", so the maximum number only 255. I changed this to "WORD" (unsigned short), so now its about 60k. client packet.h Search for this: typedef struct command_item_drop2 then replace this in the struct: BYTE count;to this: WORD count; Then search for this: typedef struct command_item_move then replace this in the struct: BYTE num;To this: WORD num;Search for this: typedef struct SShopItemTable then replace this in the struct: BYTE count;to this: WORD count; Search for this: typedef struct packet_set_item2 then replace this in the struct: BYTE count;to this: WORD count; Then search for this: typedef struct packet_update_item then replace this in the struct: BYTE count;to this: WORD count; Then search for this: typedef struct SEquipmentItemSet replace this: BYTE count;to this: WORD count; PythonNetworkPhaseGame.cpp->RecvExchangePacket function Replace this: CPythonExchange::Instance().SetItemToSelf(iSlotIndex, exchange_packet.arg1, (BYTE) exchange_packet.arg3);To this: CPythonExchange::Instance().SetItemToSelf(iSlotIndex, exchange_packet.arg1, (WORD) exchange_packet.arg3);and this: CPythonExchange::Instance().SetItemToTarget(iSlotIndex, exchange_packet.arg1, (BYTE) exchange_packet.arg3);to this: CPythonExchange::Instance().SetItemToTarget(iSlotIndex, exchange_packet.arg1, (WORD) exchange_packet.arg3); pythonexchange.cpp: Replace this: BYTE CPythonExchange::GetItemCountFromTarget(BYTE pos)With this: WORD CPythonExchange::GetItemCountFromTarget(BYTE pos)Then this: BYTE CPythonExchange::GetItemCountFromSelf(BYTE pos)With this: WORD CPythonExchange::GetItemCountFromSelf(BYTE pos) And this: void CPythonExchange::SetItemToTarget(DWORD pos, DWORD vnum, BYTE count)With this: void CPythonExchange::SetItemToTarget(DWORD pos, DWORD vnum, WORD count) And then this: void CPythonExchange::SetItemToSelf(DWORD pos, DWORD vnum, BYTE count)With this: void CPythonExchange::SetItemToSelf(DWORD pos, DWORD vnum, WORD count) pythonexchange.h Replace this ones: BYTE GetItemCountFromTarget(BYTE pos); BYTE GetItemCountFromSelf(BYTE pos); void SetItemToTarget(DWORD pos, DWORD vnum, BYTE count); void SetItemToSelf(DWORD pos, DWORD vnum, BYTE count); BYTE item_count[EXCHANGE_ITEM_MAX_NUM];To this: WORD GetItemCountFromTarget(BYTE pos); WORD GetItemCountFromSelf(BYTE pos); void SetItemToTarget(DWORD pos, DWORD vnum, WORD count); void SetItemToSelf(DWORD pos, DWORD vnum, WORD count); WORD item_count[EXCHANGE_ITEM_MAX_NUM]; PythonNetworkStreamPhaseGameItem.cpp Replace the whole function: bool CPythonNetworkStream::SendShopSellPacketNewWith this: typedef struct fckOFF { BYTE bySlot; WORD byCount; } TfckOFF; bool CPythonNetworkStream::SendShopSellPacketNew(BYTE bySlot, WORD byCount) { if (!__CanActMainInstance()) return true; TPacketCGShop PacketShop; PacketShop.header = HEADER_CG_SHOP; PacketShop.subheader = SHOP_SUBHEADER_CG_SELL2; TfckOFF second; second.byCount = byCount; second.bySlot = bySlot; if (!Send(sizeof(TPacketCGShop), &PacketShop)) { Tracef("SendShopSellPacket Error\n"); return false; } if (!Send(sizeof(TfckOFF), &second)) { Tracef("SendShopAddSellPacket Error\n"); return false; } /*if (!Send(sizeof(WORD), &byCount)) { Tracef("SendShopAddSellPacket Error\n"); return false; }*/ Tracef(" SendShopSellPacketNew(bySlot=%d, byCount=%u)\n", bySlot, byCount); return SendSequence(); }Then replace this: bool CPythonNetworkStream::SendItemMovePacket(TItemPos pos, TItemPos change_pos, BYTE num) bool CPythonNetworkStream::SendSafeBoxItemMovePacket(BYTE bySourcePos, BYTE byTargetPos, BYTE byCount)To this: bool CPythonNetworkStream::SendItemMovePacket(TItemPos pos, TItemPos change_pos, WORD num) bool CPythonNetworkStream::SendSafeBoxItemMovePacket(BYTE bySourcePos, BYTE byTargetPos, WORD byCount) pythonplayermodule.cpp Replace the whole function: PyObject * playerSetItemCount(PyObject* poSelf, PyObject* poArgs)With this: PyObject * playerSetItemCount(PyObject* poSelf, PyObject* poArgs) { switch (PyTuple_Size(poArgs)) { case 2: { int iSlotIndex; if (!PyTuple_GetInteger(poArgs, 0, &iSlotIndex)) return Py_BuildException(); WORD wCount; if (!PyTuple_GetInteger(poArgs, 1, &wCount)) return Py_BuildException(); if (0 == wCount) return Py_BuildException(); CPythonPlayer::Instance().SetItemCount(TItemPos (INVENTORY, iSlotIndex), wCount); return Py_BuildNone(); } case 3: { TItemPos Cell; if (!PyTuple_GetByte(poArgs, 0, &Cell.window_type)) return Py_BuildException(); if (!PyTuple_GetInteger(poArgs, 1, &Cell.cell)) return Py_BuildException(); WORD wCount; if (!PyTuple_GetInteger(poArgs, 2, &wCount)) return Py_BuildException(); CPythonPlayer::Instance().SetItemCount(Cell, wCount); return Py_BuildNone(); } default: return Py_BuildException(); } } PythonNetworkStreamModule.cpp Replace the following function: PyObject* netSendItemMovePacket(PyObject* poSelf, PyObject* poArgs)With this: PyObject* netSendItemMovePacket(PyObject* poSelf, PyObject* poArgs) { TItemPos Cell; TItemPos ChangeCell; int num; switch (PyTuple_Size(poArgs)) { case 3: if (!PyTuple_GetInteger(poArgs, 0, &Cell.cell)) return Py_BuildException(); if (!PyTuple_GetInteger(poArgs, 1, &ChangeCell.cell)) return Py_BuildException(); if (!PyTuple_GetInteger(poArgs, 2, &num)) return Py_BuildException(); break; case 5: { if (!PyTuple_GetByte(poArgs, 0, &Cell.window_type)) return Py_BuildException(); if (!PyTuple_GetInteger(poArgs, 1, &Cell.cell)) return Py_BuildException(); if (!PyTuple_GetByte(poArgs, 2, &ChangeCell.window_type)) return Py_BuildException(); if (!PyTuple_GetInteger(poArgs, 3, &ChangeCell.cell)) return Py_BuildException(); if (!PyTuple_GetInteger(poArgs, 4, &num)) return Py_BuildException(); } break; default: return Py_BuildException(); } CPythonNetworkStream& rkNetStream=CPythonNetworkStream::Instance(); rkNetStream.SendItemMovePacket(Cell, ChangeCell, (WORD) num);//ez a sor az return Py_BuildNone(); } GameType.h Search for this: typedef struct packet_item Then replace this: BYTE count;With this: WORD count; Search for this: typedef struct packet_shop_item And edit this: BYTE count;to this: WORD count; AbstractPlayer.h Replace this: virtual void SetItemCount(TItemPos itemPos, BYTE byCount) = 0;With this: virtual void SetItemCount(TItemPos itemPos, WORD byCount) = 0; PythonPlayer.cpp Replace this: void CPythonPlayer::SetItemCount(TItemPos Cell, BYTE byCount)With this: void CPythonPlayer::SetItemCount(TItemPos Cell, WORD byCount) PythonPlayer.h Replace this: void SetItemCount(TItemPos Cell, BYTE byCount);With this: void SetItemCount(TItemPos Cell, WORD byCount); PythonNetworkStream.h And this: bool SendSafeBoxItemMovePacket(BYTE bySourcePos, BYTE byTargetPos, BYTE byCount); bool SendShopSellPacketNew(BYTE bySlot, BYTE byCount); bool SendItemMovePacket(TItemPos pos, TItemPos change_pos, BYTE num);With this: bool SendSafeBoxItemMovePacket(BYTE bySourcePos, BYTE byTargetPos, WORD byCount); bool SendShopSellPacketNew(BYTE bySlot, WORD byCount); bool SendItemMovePacket(TItemPos pos, TItemPos change_pos, WORD num);Now we are done with the client, you can build it now. server common/tables.h Search this: typedef struct SShopItemTable Then replace this: BYTE count;To this: WORD count; packet.h Search for this: typedef struct command_item_drop2 Then edit this: BYTE count;To this: WORD count; Then search this:: typedef struct command_item_move Replace this: BYTE count;With this: WORD count; Then search this: typedef struct packet_item_set Replace this: BYTE count;To this: WORD count; Search this: typedef struct packet_item_update Replace this: BYTE count;To this: WORD count; Search this: struct packet_shop_item Replace this: BYTE count;To this: WORD count; Search this: typedef struct pakcet_view_equip Then replace this: BYTE count;To this: WORD count; input_main.cpp Replace this whole function: int CInputMain::Shop(LPCHARACTER ch, const char * data, size_t uiBytes)With this: typedef struct fckOFF { BYTE bySlot; WORD byCount; } TfckOFF; int CInputMain::Shop(LPCHARACTER ch, const char * data, size_t uiBytes) { TPacketCGShop * p = (TPacketCGShop *) data; if (uiBytes < sizeof(TPacketCGShop)) return -1; if (test_server) sys_log(0, "CInputMain::Shop() ==> SubHeader %d", p->subheader); const char * c_pData = data + sizeof(TPacketCGShop); uiBytes -= sizeof(TPacketCGShop); switch (p->subheader) { case SHOP_SUBHEADER_CG_END: sys_log(1, "INPUT: %s SHOP: END", ch->GetName()); CShopManager::instance().StopShopping(ch); return 0; case SHOP_SUBHEADER_CG_BUY: { if (uiBytes < sizeof(BYTE) + sizeof(BYTE)) return -1; BYTE bPos = *(c_pData + 1); sys_log(1, "INPUT: %s SHOP: BUY %d", ch->GetName(), bPos); CShopManager::instance().Buy(ch, bPos); return (sizeof(BYTE) + sizeof(BYTE)); } case SHOP_SUBHEADER_CG_SELL: { if (uiBytes < sizeof(BYTE)) return -1; BYTE pos = *c_pData; sys_log(0, "INPUT: %s SHOP: SELL", ch->GetName()); CShopManager::instance().Sell(ch, pos); return sizeof(BYTE); } case SHOP_SUBHEADER_CG_SELL2: { if (uiBytes < sizeof(TfckOFF)) return -1; TfckOFF*p2 = (TfckOFF*)c_pData; /*BYTE pos = *(c_pData++); WORD count = *(c_pData);*/ sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName()); CShopManager::instance().Sell(ch, p2->bySlot, p2->byCount); return sizeof(TfckOFF); } default: sys_err("CInputMain::Shop : Unknown subheader %d : %s", p->subheader, ch->GetName()); break; } return 0; } shop_manager.cpp Replace this: void CShopManager::Sell(LPCHARACTER ch, BYTE bCell, BYTE bCount)To this: void CShopManager::Sell(LPCHARACTER ch, BYTE bCell, WORD bCount) shop.hSearch this: typedef struct shop_item Replace this: BYTE count;To this: WORD count; shop_manager.h Replace this: void Sell(LPCHARACTER ch, BYTE bCell, BYTE bCount=0);To this: void Sell(LPCHARACTER ch, BYTE bCell, WORD bCount=0); char_item.cpp Replace this: bool CHARACTER::DropItem(TItemPos Cell, BYTE bCount)To this: bool CHARACTER::DropItem(TItemPos Cell, WORD bCount) Then replace this: bool CHARACTER::MoveItem(TItemPos Cell, TItemPos DestCell, BYTE count)To this: bool CHARACTER::MoveItem(TItemPos Cell, TItemPos DestCell, WORD count)And replace this in this function: count = MIN(200 - item2->GetCount(), count);To this: count = MIN(ITEM_MAX_COUNT - item2->GetCount(), count); Then replace this: LPITEM CHARACTER::AutoGiveItem(DWORD dwItemVnum, BYTE bCount, int iRarePct, bool bMsg)To this: LPITEM CHARACTER::AutoGiveItem(DWORD dwItemVnum, WORD bCount, int iRarePct, bool bMsg)And replace this in this function: BYTE bCount2 = MIN(200 - item->GetCount(), bCount);To this: WORD bCount2 = MIN(ITEM_MAX_COUNT - item->GetCount(), bCount); And replace this inside the PickupItem function: BYTE bCount = item->GetCount();To this: WORD bCount = item->GetCount();And this (still inside this function): BYTE bCount2 = MIN(200 - item2->GetCount(), bCount);To this: WORD bCount2 = MIN(ITEM_MAX_COUNT - item2->GetCount(), bCount); item.cpp->DWORD CItem::GetCount() Replace this: return MIN(m_dwCount, 200);To this: return MIN(m_dwCount, ITEM_MAX_COUNT); safebox.cpp Replace this: bool CSafebox::MoveItem(BYTE bCell, BYTE bDestCell, BYTE count)To this: bool CSafebox::MoveItem(BYTE bCell, BYTE bDestCell, WORD count)Then replace this inside this function: count = MIN(200 - item2->GetCount(), count);To this: count = MIN(ITEM_MAX_COUNT - item2->GetCount(), count); common/item_lenght.h Here you can set the maximum number in a stack. Change this as big as you want (between 0 and ~60k) ITEM_MAX_COUNT = 200,(I changed this to 300, just for the test) char.h Replace this: bool DropItem(TItemPos Cell, BYTE bCount=0); bool MoveItem(TItemPos pos, TItemPos change_pos, BYTE num); LPITEM AutoGiveItem(DWORD dwItemVnum, BYTE bCount=1, int iRarePct = -1, bool bMsg = true);To this: bool DropItem(TItemPos Cell, WORD bCount=0); bool MoveItem(TItemPos pos, TItemPos change_pos, WORD num); LPITEM AutoGiveItem(DWORD dwItemVnum, WORD bCount=1, int iRarePct = -1, bool bMsg = true); safebox.h Replace this: bool MoveItem(BYTE bCell, BYTE bDestCell, BYTE count);To this: bool MoveItem(BYTE bCell, BYTE bDestCell, WORD count); oxevent.cpp Replace this: bool COXEventManager::GiveItemToAttender(DWORD dwItemVnum, BYTE count)To this: bool COXEventManager::GiveItemToAttender(DWORD dwItemVnum, WORD count) oxevent.h Replace this: bool GiveItemToAttender(DWORD dwItemVnum, BYTE count);With this: bool GiveItemToAttender(DWORD dwItemVnum, WORD count); Now we are done with the server, don't foget to build the db and the gamefile too! database We have to do 2 more things: Go to the player database, right click on the item table -> desing table, then edit the count column's type from tinyint to smallint and the lenght from 3 to 4.shop_item table->desing table: edit the count column's type from tinyint to smallintAnd we are done I also captured the "progress" like in my "Expand maximum level" topic, its about 40 minutes long again, its not necessary at all to watch it, but if you are interested about the progress, or you just bored and have 40-50 minute freetime, watch it, if you want Special thanks to TheSLZ for testing the edits. If you have any problem/remark/question, or you've just found a bug, feel free to tell/ask it here or in PM. Have a nice day, ~masodikbela
  22. Hi, I'd like to share a small fix about the messenger system. what exactly are we fixing? The main problem is when you remove any person from your list, the companion's messenger list is not refreshing until relog in. Webzen has fixed this situation with a small packet. That packet will provide to remove the name from the list. There is no part of Python because it's already done by Ymir. For serverside For client side Best Regards Ken
  23. xRooT

    [C++] Swap Item

    Hello Excuse me, I do not like introductions Go to: game/src/char.h ------------------------------------------------------------------------------- Go to : game/src/char_item.cpp ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Note: char_item.cpp > Search: Edit the number of pages inventory
  24. Hi, I have worked on official like new elemental bonuses(strong against elec,fire,ice,wind,earth,dark), follow the guide below to add it to your server. Please like this topic if you find it useful! (C) Metin2 Guild wars - (If you're looking for a custom made metin2 systems in c++/python send me a pm). Screenshots: Let's begin! Server side: open service.h,add at the bottom: #define ELEMENT_NEW_BONUSES open length.h, look for: MAX_APPLY_NUM, }; add above: #ifdef ELEMENT_NEW_BONUSES APPLY_ATTBONUS_ELEC, APPLY_ATTBONUS_FIRE, APPLY_ATTBONUS_ICE, APPLY_ATTBONUS_WIND, APPLY_ATTBONUS_EARTH, APPLY_ATTBONUS_DARK, #endif in the same file replace enumERaceFlags with: enum ERaceFlags { RACE_FLAG_ANIMAL = (1 << 0), RACE_FLAG_UNDEAD = (1 << 1), RACE_FLAG_DEVIL = (1 << 2), RACE_FLAG_HUMAN = (1 << 3), RACE_FLAG_ORC = (1 << 4), RACE_FLAG_MILGYO = (1 << 5), RACE_FLAG_INSECT = (1 << 6), RACE_FLAG_FIRE = (1 << 7), RACE_FLAG_ICE = (1 << 8), RACE_FLAG_DESERT = (1 << 9), RACE_FLAG_TREE = (1 << 10), RACE_FLAG_ELEC = (1 << 11), RACE_FLAG_WIND = (1 << 12), RACE_FLAG_EARTH = (1 << 13), RACE_FLAG_DARK = (1 << 14), RACE_FLAG_ATT_ELEC = (1 << 15), RACE_FLAG_ATT_FIRE = (1 << 16), RACE_FLAG_ATT_ICE = (1 << 17), RACE_FLAG_ATT_WIND = (1 << 18), RACE_FLAG_ATT_EARTH = (1 << 19), RACE_FLAG_ATT_DARK = (1 << 20), }; open battle.cpp, look for: else if (pkVictim->IsRaceFlag(RACE_FLAG_ICE)) iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_ICE)) / 100; add below: #ifdef ELEMENT_NEW_BONUSES else if (pkVictim->IsRaceFlag(RACE_FLAG_ELEC)) iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_ELEC)) / 100; else if (pkVictim->IsRaceFlag(RACE_FLAG_WIND)) iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_WIND)) / 100; else if (pkVictim->IsRaceFlag(RACE_FLAG_EARTH)) iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_EARTH)) / 100; else if (pkVictim->IsRaceFlag(RACE_FLAG_DARK)) iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_DARK)) / 100; #endif open char.cpp, look for: case POINT_NORMAL_HIT_DEFEND_BONUS: add below: #ifdef ELEMENT_NEW_BONUSES case POINT_ATTBONUS_ELEC: case POINT_ATTBONUS_FIRE: case POINT_ATTBONUS_ICE: case POINT_ATTBONUS_WIND: case POINT_ATTBONUS_EARTH: case POINT_ATTBONUS_DARK: #endif in char.cpp, look for: PointChange(aApplyInfo[bApplyType].bPointType, iVal); add above: #ifdef ELEMENT_NEW_BONUSES case APPLY_ATTBONUS_ELEC: case APPLY_ATTBONUS_FIRE: case APPLY_ATTBONUS_ICE: case APPLY_ATTBONUS_WIND: case APPLY_ATTBONUS_EARTH: case APPLY_ATTBONUS_DARK: #endif in char.h, look for: }; enum EPKModes add above: #ifdef ELEMENT_NEW_BONUSES POINT_ATTBONUS_ELEC, POINT_ATTBONUS_WIND, POINT_ATTBONUS_EARTH, POINT_ATTBONUS_DARK, #endif in constants.cpp, look for: }; const int aiItemMagicAttributePercentHigh[ITEM_ATTRIBUTE_MAX_LEVEL] = {30, 40, 20, 8, 2}; add above: #ifdef ELEMENT_NEW_BONUSES { POINT_ATTBONUS_ELEC,}, { POINT_ATTBONUS_FIRE, }, { POINT_ATTBONUS_ICE, }, { POINT_ATTBONUS_WIND, }, { POINT_ATTBONUS_EARTH, }, { POINT_ATTBONUS_DARK, }, #endif now go into db source. open ProtoReader.cpp, look for: string arApplyType[] = { "APPLY_NONE", "APPLY_MAX_HP", "APPLY_MAX_SP", "APPLY_CON", "APPLY_INT", "APPLY_STR", "APPLY_DEX", "APPLY_ATT_SPEED", "APPLY_MOV_SPEED", "APPLY_CAST_SPEED", "APPLY_HP_REGEN", "APPLY_SP_REGEN", "APPLY_POISON_PCT", "APPLY_STUN_PCT", "APPLY_SLOW_PCT", "APPLY_CRITICAL_PCT", "APPLY_PENETRATE_PCT", "APPLY_ATTBONUS_HUMAN", "APPLY_ATTBONUS_ANIMAL", "APPLY_ATTBONUS_ORC", "APPLY_ATTBONUS_MILGYO", "APPLY_ATTBONUS_UNDEAD", "APPLY_ATTBONUS_DEVIL", "APPLY_STEAL_HP", "APPLY_STEAL_SP", "APPLY_MANA_BURN_PCT", "APPLY_DAMAGE_SP_RECOVER", "APPLY_BLOCK", "APPLY_DODGE", "APPLY_RESIST_SWORD", "APPLY_RESIST_TWOHAND", "APPLY_RESIST_DAGGER", "APPLY_RESIST_BELL", "APPLY_RESIST_FAN", "APPLY_RESIST_BOW","APPLY_RESIST_FIRE", "APPLY_RESIST_ELEC", "APPLY_RESIST_MAGIC", "APPLY_RESIST_WIND", "APPLY_REFLECT_MELEE", "APPLY_REFLECT_CURSE", "APPLY_POISON_REDUCE", "APPLY_KILL_SP_RECOVER", "APPLY_EXP_DOUBLE_BONUS", "APPLY_GOLD_DOUBLE_BONUS", "APPLY_ITEM_DROP_BONUS", "APPLY_POTION_BONUS", "APPLY_KILL_HP_RECOVER", "APPLY_IMMUNE_STUN", "APPLY_IMMUNE_SLOW", "APPLY_IMMUNE_FALL", "APPLY_SKILL", "APPLY_BOW_DISTANCE", "APPLY_ATT_GRADE_BONUS", "APPLY_DEF_GRADE_BONUS", "APPLY_MAGIC_ATT_GRADE", "APPLY_MAGIC_DEF_GRADE", "APPLY_CURSE_PCT", "APPLY_MAX_STAMINA", "APPLY_ATTBONUS_WARRIOR", "APPLY_ATTBONUS_ASSASSIN", "APPLY_ATTBONUS_SURA", "APPLY_ATTBONUS_SHAMAN", "APPLY_ATTBONUS_MONSTER", "APPLY_MALL_ATTBONUS", "APPLY_MALL_DEFBONUS", "APPLY_MALL_EXPBONUS", "APPLY_MALL_ITEMBONUS", "APPLY_MALL_GOLDBONUS", "APPLY_MAX_HP_PCT", "APPLY_MAX_SP_PCT", "APPLY_SKILL_DAMAGE_BONUS","APPLY_NORMAL_HIT_DAMAGE_BONUS", "APPLY_SKILL_DEFEND_BONUS", "APPLY_NORMAL_HIT_DEFEND_BONUS", "APPLY_PC_BANG_EXP_BONUS", "APPLY_PC_BANG_DROP_BONUS", "APPLY_EXTRACT_HP_PCT", "APPLY_RESIST_WARRIOR", "APPLY_RESIST_ASSASSIN", "APPLY_RESIST_SURA", "APPLY_RESIST_SHAMAN", "APPLY_ENERGY", "APPLY_DEF_GRADE", "APPLY_COSTUME_ATTR_BONUS", "APPLY_MAGIC_ATTBONUS_PER", "APPLY_MELEE_MAGIC_ATTBONUS_PER", "APPLY_RESIST_ICE", "APPLY_RESIST_EARTH", "APPLY_RESIST_DARK", "APPLY_ANTI_CRITICAL_PCT", "APPLY_ANTI_PENETRATE_PCT", "APPLY_ATTBONUS_WOLF", "APPLY_RESIST_WOLF", "APPLY_RESIST_CLAW", "APPLY_ANTI_RESIST_MAGIC", "APPLY_ATTBONUS_ELECT", "APPLY_ATTBONUS_FIRE", "APPLY_ATTBONUS_ICE", "APPLY_ATTBONUS_WIND", "APPLY_ATTBONUS_EARTH", "APPLY_ATTBONUS_DARK" }; replace with: #ifdef ELEMENT_NEW_BONUSES string arApplyType[] = { "APPLY_NONE", "APPLY_MAX_HP", "APPLY_MAX_SP", "APPLY_CON", "APPLY_INT", "APPLY_STR", "APPLY_DEX", "APPLY_ATT_SPEED", "APPLY_MOV_SPEED", "APPLY_CAST_SPEED", "APPLY_HP_REGEN", "APPLY_SP_REGEN", "APPLY_POISON_PCT", "APPLY_STUN_PCT", "APPLY_SLOW_PCT", "APPLY_CRITICAL_PCT", "APPLY_PENETRATE_PCT", "APPLY_ATTBONUS_HUMAN", "APPLY_ATTBONUS_ANIMAL", "APPLY_ATTBONUS_ORC", "APPLY_ATTBONUS_MILGYO", "APPLY_ATTBONUS_UNDEAD", "APPLY_ATTBONUS_DEVIL", "APPLY_STEAL_HP", "APPLY_STEAL_SP", "APPLY_MANA_BURN_PCT", "APPLY_DAMAGE_SP_RECOVER", "APPLY_BLOCK", "APPLY_DODGE", "APPLY_RESIST_SWORD", "APPLY_RESIST_TWOHAND", "APPLY_RESIST_DAGGER", "APPLY_RESIST_BELL", "APPLY_RESIST_FAN", "APPLY_RESIST_BOW","APPLY_RESIST_FIRE", "APPLY_RESIST_ELEC", "APPLY_RESIST_MAGIC", "APPLY_RESIST_WIND", "APPLY_REFLECT_MELEE", "APPLY_REFLECT_CURSE", "APPLY_POISON_REDUCE", "APPLY_KILL_SP_RECOVER", "APPLY_EXP_DOUBLE_BONUS", "APPLY_GOLD_DOUBLE_BONUS", "APPLY_ITEM_DROP_BONUS", "APPLY_POTION_BONUS", "APPLY_KILL_HP_RECOVER", "APPLY_IMMUNE_STUN", "APPLY_IMMUNE_SLOW", "APPLY_IMMUNE_FALL", "APPLY_SKILL", "APPLY_BOW_DISTANCE", "APPLY_ATT_GRADE_BONUS", "APPLY_DEF_GRADE_BONUS", "APPLY_MAGIC_ATT_GRADE", "APPLY_MAGIC_DEF_GRADE", "APPLY_CURSE_PCT", "APPLY_MAX_STAMINA", "APPLY_ATTBONUS_WARRIOR", "APPLY_ATTBONUS_ASSASSIN", "APPLY_ATTBONUS_SURA", "APPLY_ATTBONUS_SHAMAN", "APPLY_ATTBONUS_MONSTER", "APPLY_MALL_ATTBONUS", "APPLY_MALL_DEFBONUS", "APPLY_MALL_EXPBONUS", "APPLY_MALL_ITEMBONUS", "APPLY_MALL_GOLDBONUS", "APPLY_MAX_HP_PCT", "APPLY_MAX_SP_PCT", "APPLY_SKILL_DAMAGE_BONUS","APPLY_NORMAL_HIT_DAMAGE_BONUS", "APPLY_SKILL_DEFEND_BONUS", "APPLY_NORMAL_HIT_DEFEND_BONUS", "APPLY_PC_BANG_EXP_BONUS", "APPLY_PC_BANG_DROP_BONUS", "APPLY_EXTRACT_HP_PCT", "APPLY_RESIST_WARRIOR", "APPLY_RESIST_ASSASSIN", "APPLY_RESIST_SURA", "APPLY_RESIST_SHAMAN", "APPLY_ENERGY", "APPLY_DEF_GRADE", "APPLY_COSTUME_ATTR_BONUS", "APPLY_MAGIC_ATTBONUS_PER", "APPLY_MELEE_MAGIC_ATTBONUS_PER", "APPLY_RESIST_ICE", "APPLY_RESIST_EARTH", "APPLY_RESIST_DARK", "APPLY_ANTI_CRITICAL_PCT", "APPLY_ANTI_PENETRATE_PCT", "APPLY_ATTBONUS_WOLF", "APPLY_RESIST_WOLF", "APPLY_RESIST_CLAW", "APPLY_ANTI_RESIST_MAGIC", "APPLY_ATTBONUS_ELECT", "APPLY_ATTBONUS_FIRE", "APPLY_ATTBONUS_ICE", "APPLY_ATTBONUS_WIND", "APPLY_ATTBONUS_EARTH", "APPLY_ATTBONUS_DARK" }; #else string arApplyType[] = { "APPLY_NONE", "APPLY_MAX_HP", "APPLY_MAX_SP", "APPLY_CON", "APPLY_INT", "APPLY_STR", "APPLY_DEX", "APPLY_ATT_SPEED", "APPLY_MOV_SPEED", "APPLY_CAST_SPEED", "APPLY_HP_REGEN", "APPLY_SP_REGEN", "APPLY_POISON_PCT", "APPLY_STUN_PCT", "APPLY_SLOW_PCT", "APPLY_CRITICAL_PCT", "APPLY_PENETRATE_PCT", "APPLY_ATTBONUS_HUMAN", "APPLY_ATTBONUS_ANIMAL", "APPLY_ATTBONUS_ORC", "APPLY_ATTBONUS_MILGYO", "APPLY_ATTBONUS_UNDEAD", "APPLY_ATTBONUS_DEVIL", "APPLY_STEAL_HP", "APPLY_STEAL_SP", "APPLY_MANA_BURN_PCT", "APPLY_DAMAGE_SP_RECOVER", "APPLY_BLOCK", "APPLY_DODGE", "APPLY_RESIST_SWORD", "APPLY_RESIST_TWOHAND", "APPLY_RESIST_DAGGER", "APPLY_RESIST_BELL", "APPLY_RESIST_FAN", "APPLY_RESIST_BOW", "APPLY_RESIST_FIRE", "APPLY_RESIST_ELEC", "APPLY_RESIST_MAGIC", "APPLY_RESIST_WIND", "APPLY_REFLECT_MELEE", "APPLY_REFLECT_CURSE", "APPLY_POISON_REDUCE", "APPLY_KILL_SP_RECOVER", "APPLY_EXP_DOUBLE_BONUS", "APPLY_GOLD_DOUBLE_BONUS", "APPLY_ITEM_DROP_BONUS", "APPLY_POTION_BONUS", "APPLY_KILL_HP_RECOVER", "APPLY_IMMUNE_STUN", "APPLY_IMMUNE_SLOW", "APPLY_IMMUNE_FALL", "APPLY_SKILL", "APPLY_BOW_DISTANCE", "APPLY_ATT_GRADE_BONUS", "APPLY_DEF_GRADE_BONUS", "APPLY_MAGIC_ATT_GRADE", "APPLY_MAGIC_DEF_GRADE", "APPLY_CURSE_PCT", "APPLY_MAX_STAMINA", "APPLY_ATTBONUS_WARRIOR", "APPLY_ATTBONUS_ASSASSIN", "APPLY_ATTBONUS_SURA", "APPLY_ATTBONUS_SHAMAN", "APPLY_ATTBONUS_MONSTER", "APPLY_MALL_ATTBONUS", "APPLY_MALL_DEFBONUS", "APPLY_MALL_EXPBONUS", "APPLY_MALL_ITEMBONUS", "APPLY_MALL_GOLDBONUS", "APPLY_MAX_HP_PCT", "APPLY_MAX_SP_PCT", "APPLY_SKILL_DAMAGE_BONUS", "APPLY_NORMAL_HIT_DAMAGE_BONUS", "APPLY_SKILL_DEFEND_BONUS", "APPLY_NORMAL_HIT_DEFEND_BONUS", "APPLY_PC_BANG_EXP_BONUS", "APPLY_PC_BANG_DROP_BONUS", "APPLY_EXTRACT_HP_PCT", "APPLY_RESIST_WARRIOR", "APPLY_RESIST_ASSASSIN", "APPLY_RESIST_SURA", "APPLY_RESIST_SHAMAN", "APPLY_ENERGY", "APPLY_DEF_GRADE", "APPLY_COSTUME_ATTR_BONUS", "APPLY_MAGIC_ATTBONUS_PER", "APPLY_MELEE_MAGIC_ATTBONUS_PER", "APPLY_RESIST_ICE", "APPLY_RESIST_EARTH", "APPLY_RESIST_DARK", "APPLY_ANTI_CRITICAL_PCT", "APPLY_ANTI_PENETRATE_PCT", "APPLY_ATTBONUS_WOLF", "APPLY_RESIST_WOLF", "APPLY_RESIST_CLAW", "APPLY_ANTI_RESIST_MAGIC", }; #endif Compile. Client side: open locale_inc.h, add at the bottom: #define ELEMENT_NEW_BONUSES open PythonItemModule.cpp, look for: #ifdef ENABLE_NEW_EQUIPMENT_SYSTEM add above: #ifdef ELEMENT_NEW_BONUSES PyModule_AddIntConstant(poModule, "APPLY_ATTBONUS_ELEC", CItemData::APPLY_ATTBONUS_ELEC); PyModule_AddIntConstant(poModule, "APPLY_ATTBONUS_FIRE", CItemData::APPLY_ATTBONUS_FIRE); PyModule_AddIntConstant(poModule, "APPLY_ATTBONUS_ICE", CItemData::APPLY_ATTBONUS_ICE); PyModule_AddIntConstant(poModule, "APPLY_ATTBONUS_WIND", CItemData::APPLY_ATTBONUS_WIND); PyModule_AddIntConstant(poModule, "APPLY_ATTBONUS_EARTH", CItemData::APPLY_ATTBONUS_EARTH); PyModule_AddIntConstant(poModule, "APPLY_ATTBONUS_DARK", CItemData::APPLY_ATTBONUS_DARK); #endif open Packet.h,look for: POINT_MIN_WEP = 200, add above: #ifdef ELEMENT_NEW_BONUSES POINT_ATTBONUS_ELEC, POINT_ATTBONUS_WIND, POINT_ATTBONUS_EARTH, POINT_ATTBONUS_DARK, #endif open itemData.h, look for: MAX_APPLY_NUM, }; enum EImmuneFlags add above: #ifdef ELEMENT_NEW_BONUSES APPLY_ATTBONUS_ELEC, APPLY_ATTBONUS_FIRE, APPLY_ATTBONUS_ICE, APPLY_ATTBONUS_WIND, APPLY_ATTBONUS_EARTH, APPLY_ATTBONUS_DARK, #endif go to root pack. open uiToolTip.py look for: } ATTRIBUTE_NEED_WIDTH = { add above: item.APPLY_ATTBONUS_ELEC : localeInfo.TOOLTIP_APPLY_ATTBONUS_ELEC, item.APPLY_ATTBONUS_FIRE : localeInfo.TOOLTIP_APPLY_ATTBONUS_FIRE, item.APPLY_ATTBONUS_ICE : localeInfo.TOOLTIP_APPLY_ATTBONUS_ICE, item.APPLY_ATTBONUS_WIND : localeInfo.TOOLTIP_APPLY_ATTBONUS_WIND, item.APPLY_ATTBONUS_EARTH : localeInfo.TOOLTIP_APPLY_ATTBONUS_EARTH, item.APPLY_ATTBONUS_DARK : localeInfo.TOOLTIP_APPLY_ATTBONUS_DARK, go to dump_proto folder, open ItemCSVReader.cpp,look for: #include "ItemCSVReader.h" add below: #define ELEMENT_NEW_BONUSES search for: string arApplyType[] = {"APPLY_NONE", "APPLY_MAX_HP", "APPLY_MAX_SP", "APPLY_CON", "APPLY_INT", "APPLY_STR", "APPLY_DEX", "APPLY_ATT_SPEED", "APPLY_MOV_SPEED", "APPLY_CAST_SPEED", "APPLY_HP_REGEN", "APPLY_SP_REGEN", "APPLY_POISON_PCT", "APPLY_STUN_PCT", "APPLY_SLOW_PCT", "APPLY_CRITICAL_PCT", "APPLY_PENETRATE_PCT", "APPLY_ATTBONUS_HUMAN", "APPLY_ATTBONUS_ANIMAL", "APPLY_ATTBONUS_ORC", "APPLY_ATTBONUS_MILGYO", "APPLY_ATTBONUS_UNDEAD", "APPLY_ATTBONUS_DEVIL", "APPLY_STEAL_HP", "APPLY_STEAL_SP", "APPLY_MANA_BURN_PCT", "APPLY_DAMAGE_SP_RECOVER", "APPLY_BLOCK", "APPLY_DODGE", "APPLY_RESIST_SWORD", "APPLY_RESIST_TWOHAND", "APPLY_RESIST_DAGGER", "APPLY_RESIST_BELL", "APPLY_RESIST_FAN", "APPLY_RESIST_BOW","APPLY_RESIST_FIRE", "APPLY_RESIST_ELEC", "APPLY_RESIST_MAGIC", "APPLY_RESIST_WIND", "APPLY_REFLECT_MELEE", "APPLY_REFLECT_CURSE", "APPLY_POISON_REDUCE", "APPLY_KILL_SP_RECOVER", "APPLY_EXP_DOUBLE_BONUS", "APPLY_GOLD_DOUBLE_BONUS", "APPLY_ITEM_DROP_BONUS", "APPLY_POTION_BONUS", "APPLY_KILL_HP_RECOVER", "APPLY_IMMUNE_STUN", "APPLY_IMMUNE_SLOW", "APPLY_IMMUNE_FALL", "APPLY_SKILL", "APPLY_BOW_DISTANCE", "APPLY_ATT_GRADE_BONUS", "APPLY_DEF_GRADE_BONUS", "APPLY_MAGIC_ATT_GRADE", "APPLY_MAGIC_DEF_GRADE", "APPLY_CURSE_PCT", "APPLY_MAX_STAMINA", "APPLY_ATTBONUS_WARRIOR", "APPLY_ATTBONUS_ASSASSIN", "APPLY_ATTBONUS_SURA", "APPLY_ATTBONUS_SHAMAN", "APPLY_ATTBONUS_MONSTER", "APPLY_MALL_ATTBONUS", "APPLY_MALL_DEFBONUS", "APPLY_MALL_EXPBONUS", "APPLY_MALL_ITEMBONUS", "APPLY_MALL_GOLDBONUS", "APPLY_MAX_HP_PCT", "APPLY_MAX_SP_PCT", "APPLY_SKILL_DAMAGE_BONUS","APPLY_NORMAL_HIT_DAMAGE_BONUS", "APPLY_SKILL_DEFEND_BONUS", "APPLY_NORMAL_HIT_DEFEND_BONUS", "APPLY_PC_BANG_EXP_BONUS", "APPLY_PC_BANG_DROP_BONUS", "APPLY_EXTRACT_HP_PCT", "APPLY_RESIST_WARRIOR", "APPLY_RESIST_ASSASSIN", "APPLY_RESIST_SURA", "APPLY_RESIST_SHAMAN", "APPLY_ENERGY", "APPLY_DEF_GRADE", "APPLY_COSTUME_ATTR_BONUS", "APPLY_MAGIC_ATTBONUS_PER", "APPLY_MELEE_MAGIC_ATTBONUS_PER", "APPLY_RESIST_ICE", "APPLY_RESIST_EARTH", "APPLY_RESIST_DARK", "APPLY_ANTI_CRITICAL_PCT", "APPLY_ANTI_PENETRATE_PCT", "APPLY_ATTBONUS_WOLF", "APPLY_RESIST_WOLF", "APPLY_RESIST_CLAW","APPLY_ANTI_RESIST_MAGIC","APPLY_ATTBONUS_ELECT","APPLY_ATTBONUS_FIRE","APPLY_ATTBONUS_ICE","APPLY_ATTBONUS_WIND","APPLY_ATTBONUS_EARTH","APPLY_ATTBONUS_DARK"}; replace with: #ifdef ELEMENT_NEW_BONUSES string arApplyType[] = {"APPLY_NONE", "APPLY_MAX_HP", "APPLY_MAX_SP", "APPLY_CON", "APPLY_INT", "APPLY_STR", "APPLY_DEX", "APPLY_ATT_SPEED", "APPLY_MOV_SPEED", "APPLY_CAST_SPEED", "APPLY_HP_REGEN", "APPLY_SP_REGEN", "APPLY_POISON_PCT", "APPLY_STUN_PCT", "APPLY_SLOW_PCT", "APPLY_CRITICAL_PCT", "APPLY_PENETRATE_PCT", "APPLY_ATTBONUS_HUMAN", "APPLY_ATTBONUS_ANIMAL", "APPLY_ATTBONUS_ORC", "APPLY_ATTBONUS_MILGYO", "APPLY_ATTBONUS_UNDEAD", "APPLY_ATTBONUS_DEVIL", "APPLY_STEAL_HP", "APPLY_STEAL_SP", "APPLY_MANA_BURN_PCT", "APPLY_DAMAGE_SP_RECOVER", "APPLY_BLOCK", "APPLY_DODGE", "APPLY_RESIST_SWORD", "APPLY_RESIST_TWOHAND", "APPLY_RESIST_DAGGER", "APPLY_RESIST_BELL", "APPLY_RESIST_FAN", "APPLY_RESIST_BOW","APPLY_RESIST_FIRE", "APPLY_RESIST_ELEC", "APPLY_RESIST_MAGIC", "APPLY_RESIST_WIND", "APPLY_REFLECT_MELEE", "APPLY_REFLECT_CURSE", "APPLY_POISON_REDUCE", "APPLY_KILL_SP_RECOVER", "APPLY_EXP_DOUBLE_BONUS", "APPLY_GOLD_DOUBLE_BONUS", "APPLY_ITEM_DROP_BONUS", "APPLY_POTION_BONUS", "APPLY_KILL_HP_RECOVER", "APPLY_IMMUNE_STUN", "APPLY_IMMUNE_SLOW", "APPLY_IMMUNE_FALL", "APPLY_SKILL", "APPLY_BOW_DISTANCE", "APPLY_ATT_GRADE_BONUS", "APPLY_DEF_GRADE_BONUS", "APPLY_MAGIC_ATT_GRADE", "APPLY_MAGIC_DEF_GRADE", "APPLY_CURSE_PCT", "APPLY_MAX_STAMINA", "APPLY_ATTBONUS_WARRIOR", "APPLY_ATTBONUS_ASSASSIN", "APPLY_ATTBONUS_SURA", "APPLY_ATTBONUS_SHAMAN", "APPLY_ATTBONUS_MONSTER", "APPLY_MALL_ATTBONUS", "APPLY_MALL_DEFBONUS", "APPLY_MALL_EXPBONUS", "APPLY_MALL_ITEMBONUS", "APPLY_MALL_GOLDBONUS", "APPLY_MAX_HP_PCT", "APPLY_MAX_SP_PCT", "APPLY_SKILL_DAMAGE_BONUS","APPLY_NORMAL_HIT_DAMAGE_BONUS", "APPLY_SKILL_DEFEND_BONUS", "APPLY_NORMAL_HIT_DEFEND_BONUS", "APPLY_PC_BANG_EXP_BONUS", "APPLY_PC_BANG_DROP_BONUS", "APPLY_EXTRACT_HP_PCT", "APPLY_RESIST_WARRIOR", "APPLY_RESIST_ASSASSIN", "APPLY_RESIST_SURA", "APPLY_RESIST_SHAMAN", "APPLY_ENERGY", "APPLY_DEF_GRADE", "APPLY_COSTUME_ATTR_BONUS", "APPLY_MAGIC_ATTBONUS_PER", "APPLY_MELEE_MAGIC_ATTBONUS_PER", "APPLY_RESIST_ICE", "APPLY_RESIST_EARTH", "APPLY_RESIST_DARK", "APPLY_ANTI_CRITICAL_PCT", "APPLY_ANTI_PENETRATE_PCT", "APPLY_ATTBONUS_WOLF", "APPLY_RESIST_WOLF", "APPLY_RESIST_CLAW","APPLY_ANTI_RESIST_MAGIC","APPLY_ATTBONUS_ELECT","APPLY_ATTBONUS_FIRE","APPLY_ATTBONUS_ICE","APPLY_ATTBONUS_WIND","APPLY_ATTBONUS_EARTH","APPLY_ATTBONUS_DARK"}; #else string arApplyType[] = { "APPLY_NONE", "APPLY_MAX_HP", "APPLY_MAX_SP", "APPLY_CON", "APPLY_INT", "APPLY_STR", "APPLY_DEX", "APPLY_ATT_SPEED", "APPLY_MOV_SPEED", "APPLY_CAST_SPEED", "APPLY_HP_REGEN", "APPLY_SP_REGEN", "APPLY_POISON_PCT", "APPLY_STUN_PCT", "APPLY_SLOW_PCT", "APPLY_CRITICAL_PCT", "APPLY_PENETRATE_PCT", "APPLY_ATTBONUS_HUMAN", "APPLY_ATTBONUS_ANIMAL", "APPLY_ATTBONUS_ORC", "APPLY_ATTBONUS_MILGYO", "APPLY_ATTBONUS_UNDEAD", "APPLY_ATTBONUS_DEVIL", "APPLY_STEAL_HP", "APPLY_STEAL_SP", "APPLY_MANA_BURN_PCT", "APPLY_DAMAGE_SP_RECOVER", "APPLY_BLOCK", "APPLY_DODGE", "APPLY_RESIST_SWORD", "APPLY_RESIST_TWOHAND", "APPLY_RESIST_DAGGER", "APPLY_RESIST_BELL", "APPLY_RESIST_FAN", "APPLY_RESIST_BOW", "APPLY_RESIST_FIRE", "APPLY_RESIST_ELEC", "APPLY_RESIST_MAGIC", "APPLY_RESIST_WIND", "APPLY_REFLECT_MELEE", "APPLY_REFLECT_CURSE", "APPLY_POISON_REDUCE", "APPLY_KILL_SP_RECOVER", "APPLY_EXP_DOUBLE_BONUS", "APPLY_GOLD_DOUBLE_BONUS", "APPLY_ITEM_DROP_BONUS", "APPLY_POTION_BONUS", "APPLY_KILL_HP_RECOVER", "APPLY_IMMUNE_STUN", "APPLY_IMMUNE_SLOW", "APPLY_IMMUNE_FALL", "APPLY_SKILL", "APPLY_BOW_DISTANCE", "APPLY_ATT_GRADE_BONUS", "APPLY_DEF_GRADE_BONUS", "APPLY_MAGIC_ATT_GRADE", "APPLY_MAGIC_DEF_GRADE", "APPLY_CURSE_PCT", "APPLY_MAX_STAMINA", "APPLY_ATTBONUS_WARRIOR", "APPLY_ATTBONUS_ASSASSIN", "APPLY_ATTBONUS_SURA", "APPLY_ATTBONUS_SHAMAN", "APPLY_ATTBONUS_MONSTER", "APPLY_MALL_ATTBONUS", "APPLY_MALL_DEFBONUS", "APPLY_MALL_EXPBONUS", "APPLY_MALL_ITEMBONUS", "APPLY_MALL_GOLDBONUS", "APPLY_MAX_HP_PCT", "APPLY_MAX_SP_PCT", "APPLY_SKILL_DAMAGE_BONUS", "APPLY_NORMAL_HIT_DAMAGE_BONUS", "APPLY_SKILL_DEFEND_BONUS", "APPLY_NORMAL_HIT_DEFEND_BONUS", "APPLY_PC_BANG_EXP_BONUS", "APPLY_PC_BANG_DROP_BONUS", "APPLY_EXTRACT_HP_PCT", "APPLY_RESIST_WARRIOR", "APPLY_RESIST_ASSASSIN", "APPLY_RESIST_SURA", "APPLY_RESIST_SHAMAN", "APPLY_ENERGY", "APPLY_DEF_GRADE", "APPLY_COSTUME_ATTR_BONUS", "APPLY_MAGIC_ATTBONUS_PER", "APPLY_MELEE_MAGIC_ATTBONUS_PER", "APPLY_RESIST_ICE", "APPLY_RESIST_EARTH", "APPLY_RESIST_DARK", "APPLY_ANTI_CRITICAL_PCT", "APPLY_ANTI_PENETRATE_PCT", "APPLY_ATTBONUS_WOLF", "APPLY_RESIST_WOLF", "APPLY_RESIST_CLAW", "APPLY_ANTI_RESIST_MAGIC", }; #endif inside locale folder, open locale_game.txt, add in the end: TOOLTIP_APPLY_ATTBONUS_ELEC Strong against Lightning +%d%% SA TOOLTIP_APPLY_ATTBONUS_FIRE Strong against Fire +%d%% SA TOOLTIP_APPLY_ATTBONUS_ICE Strong against Ice +%d%% SA TOOLTIP_APPLY_ATTBONUS_WIND Strong against Wind +%d%% SA TOOLTIP_APPLY_ATTBONUS_EARTH Strong against Earth +%d%% SA TOOLTIP_APPLY_ATTBONUS_DARK Strong against Dark +%d%% SA Compile and that's it! to use it in item_proto.txt you can use: APPLY_ATTBONUS_ELEC, APPLY_ATTBONUS_FIRE, APPLY_ATTBONUS_ICE, APPLY_ATTBONUS_WIND, APPLY_ATTBONUS_EARTH, APPLY_ATTBONUS_DARK Enjoy!
  25. Hi, This is a item witch can change dragon soul attributes, I made it with subtype but you can easily do it by vnum. Here you have the case for subtype: (If in DragonSoul.h function PutAttributes is on private move it on public.) https://pastebin.com/0cNA0Xtj