Jump to content

Search the Community

Showing results for tags 'c++'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Metin2 Dev
    • Announcements
  • Community
    • Member Representations
    • Off Topic
  • Miscellaneous
    • Metin2
    • Showcase
    • File Requests
    • Community Support - Questions & Answers
    • Paid Support / Searching / Recruiting
  • Metin2 Development
  • Metin2 Development
    • Basic Tutorials / Beginners
    • Guides & HowTo
    • Binaries
    • Programming & Development
    • Web Development & Scripts / Systems
    • Tools & Programs
    • Maps
    • Quests
    • 3D Models
    • 2D Graphics
    • Operating Systems
    • Miscellaneous
  • Private Servers
    • Private Servers
  • Uncategorized
    • Drafts
    • Trash
    • Archive
    • Temporary
    • Metin2 Download

Product Groups

  • Small Advertisement
  • Large Advertisement
  • Advertising

Categories

  • Third Party - Providers Directory

Categories

  • Overview
  • Pages
    • Overview
    • File Formats
    • Network
    • Extensions

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Pillory


Marketplace


Game Server


Country


Nationality


Github


Gitlab


Discord


Skype


Website

  1. Hi guys I want to disclose a modification I made to my source to slightly improve the organization of common_drop_item.txt As always I notice, that I am not so familiar with c++, so this tutorial may contain some problem, for this reason I want to post and receive criticisms or opinions. I am also using google translator, I live in Brazil and I can only speak Portuguese First, I don't know if everyone knows, the common_drop_item is divided into 24 columns separated by TAB These columns are divided into 4 sections, from rank 0 to 3 That would be something like this PAWN S_PAWN KNIGHT S_KNIGHT In these sessions the first one is always ignored, because it could be some annotation or something The second is the initial level The third is the final level The fourth is the percentage The fifth is the item's VNUM And the sixth is the number of kill's, however investigating the source, I did not see a need in the field, after all in the function that reads these drops she also ignores. So what exactly did I do? I modified the function that reads common_drop_item, so that it looks like the later drop files. Separated by Group "Group Name" { Rank (int) "It would be from level 0 to 3" ID - Min Level - Max level - Percent - VNUM } I believe it is more organized and easy to change. Tutorial And common_drop_item will now look like this The common_drop_item I used was one that I believe is not modified, and with standard drops, if anyone needs it, I posted it here too. I put the common_drop_item files in github gits too. [Hidden Content] I used a script I made in nodejs, to organize this file, and put these comments at the end with the name of each item. In case someone just needs to ask. Remembering that it is something experimental, I tested it here and it is working normally. Any criticism or suggestion just speak. Att: Rospirski
  2. M2 Download Center Download Here ( Internal ) Download Here ( MEGA ) Download Here ( GitHub ) Hello, this release is nothing special but I hope someone finds it useful for their server. Introduced in the 10th anniversary of Metin2, your city will look more appealing with banner flags describing the on-going event your server is currently running. How to add more banners? @ data/banner/list.txt ___________________ | VNUM | NAME | |------ | ----------| | 20142 | halloween | | 20143 | easter | | 20135 | xmas | ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ You can simply add more banner flags following the example above. VNUM is the VNUM / ID of the NPC. NAME is the name of the command and file of the banner. Note: If you want to add for example the Ramadan Banner which VNUM is 20138, this is how you should do it step by step. Edit @ data/banner/list.txt and extended the file with: ___________________ | VNUM | NAME | |------ | ----------| | 20138 | ramadan | ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ Make duplicates of the existing banners. Copy data/banner/a/xmas.txt and rename the duplicated file to data/banner/a/ramadan.txt Edit data/banner/a/ramadan.txt and replace the VNUM / ID with the Ramadan Banner 20138. Copy data/banner/b/xmas.txt and rename the duplicated file to data/banner/b/ramadan.txt Edit data/banner/b/ramadan.txt and replace the VNUM / ID with the Ramadan Banner 20138. Copy data/banner/c/xmas.txt and rename the duplicated file to data/banner/c/ramadan.txt Edit data/banner/c/ramadan.txt and replace the VNUM / ID with the Ramadan Banner 20138. @ Source/Client/UserInterface/InstanceBase.cpp Search #if defined(ENABLE_EVENT_BANNER_FLAG) BOOL CInstanceBase::IsBannerFlag() { if (GetRace() >= 20127 && GetRace() <= 20143) return TRUE; return FALSE; } #endif Replace with (If you want it to be more manageable) #if defined(ENABLE_EVENT_BANNER_FLAG) BOOL CInstanceBase::IsBannerFlag() { switch(GetRace()) { case 20127: // Anniversary Banner 1 case 20128: // Anniversary Banner 2 case 20129: // Anniversary Banner 3 case 20130: // Anniversary Banner 4 case 20131: // Anniversary Banner 5 case 20132: // Anniversary Banner 6 case 20133: // Anniversary Banner 7 case 20134: // Solar Banner case 20135: // Christmas Banner case 20138: // Ramadan Banner case 20142: // Halloween Banner case 20143: // Easter Banner return TRUE; } return FALSE; } #endif Don't forget each folder (a / b / c) have different positions so be careful when copying files. How to activiate? In-game, you can use the command: /banner < x > < banner_name > where < x > is the status ( 1 : ON / 0 : OFF ) and < banner_name > is the name of the banner @ data/banner/list.txt
  3. Download Metin2 Download or Mega Hello! I searched a lot for this "system", but i didnt found it on this, or other forums. I remember, this "system" was on an other forum but the forum changed and its lost. I saw an other system, and i remember back, this changed color damage "system" can be somewhere there. So i searched for it and i finally found it! After i look for some random SFs and i figured out how can i do it. (it was not only copy paste cuz i only found the bleeding part.) So here is it. Enjoy! If you missing someting, let me know and i will add it. Also, check my Separate the damage with a dot stuff, if you need. (I linked it cuz of the pictures) Proof images: Poison: Critical damage: Penetrate damage: Last words: You can change the color of the Crit+pen damage, but for me the pen and crit+pen is same. _VT LINK_
  4. A fool came and gave you no peace and you blocked this fool. Let's see what will happen. additional: while coding the system i fixed a few errors related to mesenge_manager and made adjustments and p2p works. -> You can block or delete a player from the list by typing the player's name from the Messenger panel. There is also a block button inside the target buttons. M2 Download Center Download Here ( Internal ) Download Here ( GitHub )
  5. A simple code that you can configure in the vector to add the maps where you do not want any boss or mob to drop their items. service.h #define ENABLE_BLOCK_DROP_MAP utils.h search: extern void set_global_time(time_t t); add: #ifdef ENABLE_BLOCK_DROP_MAP extern bool is_drop_item(int map_index); #endif utils.cpp add: #ifdef ENABLE_BLOCK_DROP_MAP bool is_drop_item(int map_index){ vector<int> DropMap {41}; // -- add index the map (41 == jinno map) //dungeon for (int i=180000; i<190000; i++) DropMap.push_back(i); return std::find(DropMap.begin(), DropMap.end(), map_index) != DropMap.end(); } #endif char_battle.cpp search: else if (IsRevive() == true) { Reward(false); } else { Reward(true); // Drops gold, item, etc.. } replace: else if (IsRevive() == true) { Reward(false); } else { #ifdef ENABLE_BLOCK_DROP_MAP if (is_drop_item(GetMapIndex())){ Reward(false);} else { Reward(true); } } #else Reward(true); } #endif
  6. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) [Hidden Content] Create /usr/game/auth/BANIP. Then find IP at player.player ip table and add to file. Don't forget the left a space at the end. Example: Gm Command: [Hidden Content]
  7. NEW FLAG NOMOVE_AFTER_SPAWM service.h #define ENABLE_NOMOVE_AFTER_SPAWM length.h search : AIFLAG_REVIVE = (1 << 11), add: #ifdef ENABLE_NOMOVE_AFTER_SPAWM AIFLAG_NOMOVE_AFTER_SPAWM = (1 << 12), #endif protoreader.cpp search int get_Mob_AIFlag_Value(string inputString) add in string arAIFlag[] #ifdef ENABLE_NOMOVE_AFTER_SPAWM "NOMOVE_AFTER_SPAWM", #endif char.cpp search bool CHARACTER::SetSyncOwner(LPCHARACTER ch, bool bRemoveFromList) add: #ifdef ENABLE_NOMOVE_AFTER_SPAWM if (IS_SET(m_pointsInstant.dwAIFlag, AIFLAG_NOMOVE_AFTER_SPAWM)) return false; #endif char_skill.cpp search if (IS_SET(m_pkSk->dwFlag, SKILL_FLAG_CRUSH | SKILL_FLAG_CRUSH_LONG) add: #ifdef ENABLE_NOMOVE_AFTER_SPAWM && !IS_SET(pkChrVictim->GetAIFlag(), AIFLAG_NOMOVE_AFTER_SPAWM) #endif char_state.cpp search void CHARACTER::__StateIdle_Monster() in if (!no_wander && !IS_SET(m_pointsInstant.dwAIFlag, AIFLAG_NOMOVE) add: #ifdef ENABLE_NOMOVE_AFTER_SPAWM && !IS_SET(m_pointsInstant.dwAIFlag, AIFLAG_NOMOVE_AFTER_SPAWM) #endif src client locale_inc.h #define ENABLE_NOMOVE_AFTER_SPAWM search in pythonnonplayer.h AIFLAG_REVIVE = (1 << 11), add: #if defined ENABLE_NOMOVE_AFTER_SPAWM AIFLAG_NOMOVE_AFTER_SPAWM = (1 << 12), #endif 991 ????? S_KNIGHT MONSTER MELEE 59 SMALL AGGR,NOMOVE example a small flag so that the mobs always have their location, so that when searching for a player they are always in the same position [Hidden Content]
  8. M2 Download Center Download Here ( Internal ) Hey devs! One word: Works! Follow the steps: 1.) Open "db/src/Main.cpp" file and write this to the top of the file, under to the includes: // NOTXT_STARTUP_BEGIN BOOL g_noTXT = false; // NOTXT_STARTUP_END 2.) Search for this: "int iDisableHotBackup;" and put under this: // NOTXT_STARTUP_BEGIN int iNoTXT; if (CConfig::instance().GetValue("NO_TXT", &iNoTXT)) { if (iNoTXT) { sys_log(0, "CONFIG: NO_TXT"); g_noTXT = true; } } // NOTXT_STARTUP_END 3.) Save&Close. Now open "db/src/ClientManager.h" and replace: bool InitializeMobTable(); bool InitializeItemTable(); With: // NOTXT_STARTUP_BEGIN bool InitializeMobTableTXT(); bool InitializeItemTableTXT(); bool InitializeMobTableSQL(); bool InitializeItemTableSQL(); // NOTXT_STARTUP_END 4.) Save&Close. Then open "db/src/ClientManagerBoot.cpp" and put this the top of the file: // NOTXT_STARTUP_BEGIN extern int g_noTXT; // NOTXT_STARTUP_END 5.) Replace this: bool CClientManager::InitializeMobTable() With this: bool CClientManager::InitializeMobTableTXT() And repeat it with ItemProto(::InitializeItemTable) 6.) Search for this: "bool CClientManager::InitializeTables()" and replace this: if (!InitializeMobTable()) { sys_err("InitializeMobTable FAILED"); return false; } if (!MirrorMobTableIntoDB()) { sys_err("MirrorMobTableIntoDB FAILED"); return false; } if (!InitializeItemTable()) { sys_err("InitializeItemTable FAILED"); return false; } if (!MirrorItemTableIntoDB()) { sys_err("MirrorItemTableIntoDB FAILED"); return false; } With this: // NOTXT_STARTUP_BEGIN if (g_noTXT) // item and mob proto { if (!InitializeMobTableSQL()) { sys_err("InitializeMobTableSQL FAILED"); return false; } if (!InitializeItemTableSQL()) { sys_err("InitializeItemTableSQL FAILED"); return false; } } else { if (!InitializeMobTableTXT()) { sys_err("InitializeMobTableTXT FAILED"); return false; } if (!MirrorMobTableIntoDB()) { sys_err("MirrorMobTableIntoDB FAILED"); return false; } if (!InitializeItemTableTXT()) { sys_err("InitializeItemTableTXT FAILED"); return false; } if (!MirrorItemTableIntoDB()) { sys_err("MirrorItemTableIntoDB FAILED"); return false; } } // NOTXT_STARTUP_END 7.) And last put these functions into the file: 7+1.) New item_proto_table.sql: DROP TABLE IF EXISTS `item_proto`; CREATE TABLE `item_proto` ( `vnum` int(11) unsigned NOT NULL DEFAULT '0', `vnum_range` int(11) unsigned NOT NULL DEFAULT '0', `name` varbinary(200) NOT NULL DEFAULT 'Noname ', `locale_name` varbinary(24) NOT NULL DEFAULT 'Noname ', `type` tinyint(2) NOT NULL DEFAULT '0', `subtype` tinyint(2) NOT NULL DEFAULT '0', `weight` tinyint(3) DEFAULT '0', `size` tinyint(3) DEFAULT '0', `antiflag` int(11) DEFAULT '0', `flag` int(11) DEFAULT '0', `wearflag` int(11) DEFAULT '0', `immuneflag` set('PARA','CURSE','STUN','SLEEP','SLOW','POISON','TERROR') CHARACTER SET big5 NOT NULL DEFAULT '', `gold` int(11) DEFAULT '0', `shop_buy_price` int(10) unsigned NOT NULL DEFAULT '0', `refined_vnum` int(10) unsigned NOT NULL DEFAULT '0', `refine_set` smallint(11) unsigned NOT NULL DEFAULT '0', `refine_set2` smallint(5) unsigned NOT NULL DEFAULT '0', `magic_pct` tinyint(4) NOT NULL DEFAULT '0', `limittype0` tinyint(4) DEFAULT '0', `limitvalue0` int(11) DEFAULT '0', `limittype1` tinyint(4) DEFAULT '0', `limitvalue1` int(11) DEFAULT '0', `applytype0` tinyint(4) DEFAULT '0', `applyvalue0` int(11) DEFAULT '0', `applytype1` tinyint(4) DEFAULT '0', `applyvalue1` int(11) DEFAULT '0', `applytype2` tinyint(4) DEFAULT '0', `applyvalue2` int(11) DEFAULT '0', `value0` int(11) DEFAULT '0', `value1` int(11) DEFAULT '0', `value2` int(11) DEFAULT '0', `value3` int(11) DEFAULT '0', `value4` int(11) DEFAULT '0', `value5` int(11) DEFAULT '0', `socket0` tinyint(4) DEFAULT '-1', `socket1` tinyint(4) DEFAULT '-1', `socket2` tinyint(4) DEFAULT '-1', `socket3` tinyint(4) DEFAULT '-1', `socket4` tinyint(4) DEFAULT '-1', `socket5` tinyint(4) DEFAULT '-1', `specular` tinyint(4) NOT NULL DEFAULT '0', `socket_pct` tinyint(4) NOT NULL DEFAULT '0', `addon_type` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`vnum`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin; But you can modify your item_proto with "Design table" option in navicat, just make the vnum_range column to the second column after the vnum, as you can see in the query. conf.txt: NO_TXT = 1 0: TXT 1: SQL Special thanks to: - iMer, Zonni for the snippets ^^ Changelog: - "0" If you find any errors or problems just post a message into this thread. I tested on win. I hope you like it. With regards, P3NG3R.
  9. M2 Download Center Download Here ( Advance Refine Systems ) Download Here ( Cheque System ) Download Here ( Soul Bind System ) Hello everyone ! I've been away from metin2 for about 6 months and i've get back from less then a month and made thoes systems , i've start selling them but i didn't sell it to anyone and i got bored from metin2 again so i'm going to release it and go off from metin2 for ever . about the Advance Refine System here some info: so download and have fun [Hidden Content]
  10. M2 Download Center Download Here ( Internal ) Download Here ( GitHub )
  11. M2 Download Center Download Here ( Internal ) - Searching Glass, Allows the arrow mark appearing on the private shop where the item you select in the search results and guides for players to call the selling items easier access. You must be the same on the map with the seller. Default time limit; 1 Week - Trading Glass, Without going to the private shop on the same map that allows you can buy directly. Default time limit; 1 Week - Trading Glass+, Without going to the private shop you can buy directly works on any map. Default time limit; 2 Week - Common features, You can be viewed right from cheap to expensive price of items in the private shops, you can see the features of items When you move your mouse over the item you are looking for. Level, item name and bonuses you can search on the basis of price. HowTo tutorial exists in archive, Warning: It doesn't works with published shoulder sash system. You need upgrade attr type, value amounts. Download: [Hidden Content] It doesn't looks like %100 official but it's works, My last shared and my last working in metin2.
  12. Download Alternative download links → Mega Hello Metin2 Dev. I'm here to present a Portable Shop System. How does it work? Players get a panel when click F7 with several options. This system exists to make players able to buy items while farming. In case of any problem, contact me or write here. With best regards, Doose.
  13. M2 Download Center Download Here ( Internal )
  14. M2 Download Center Download Here ( Internal ) 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::SendShopSellPacketNew With 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.h Search 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 smallint And 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
  15. M2 Download Center Download Here ( Internal ) 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: [Hidden Content] Password: Cxl.Services
  16. [Hidden Content] [Hidden Content] After using it in almost all of the modern UIs they made, they finally decided to turn it into a class.
  17. Hello everyone, I was optimizing the loading of maps for my server and I decided to share it with the public. With this modifications, only the objects and effects around the character will be loaded and it will handle their load and unload as you move around. Also effect updatings are optimized a way that closer effects are updated more frequently. Okay, so let's start the work [Hidden Content] Good luck!
  18. Hello all, I am new to programming with c++ so i wanted to try out and make an item proto maker as simple as it could be for everybody to use. Note that everything is still beta and many more things will add UP - for any bugs report back to me How it works: Its simple as it gets, you just enter the values you want & it will return you the values in a text file. Reminder: This is beta more version updated will be coming with more options of course. Download Alternative download links → Mega or Github Console App Screenshot
  19. [Hidden Content] [Hidden Content] Reversed from 22.2.7.0 Client part is from 2018 official root List of functions: Be careful about IsDIsable, it's actually IsEnable. They use like this:
  20. M2 Download Center Download Here ( Internal ) You need to install this first: [Hidden Content] You can use it in guild wars, tournaments etc.
  21. Hello. As you know, the LibJPEG library in Metin2 is only useful for taking screenshots. Other than that, it doesn't have any duties. Those who have Directx9 and want to take better quality screenshots with this method can follow this guide carefully. Those who use Directx8 can update the code I will give according to Directx8 and try it, I did not have the chance to try it. Make sure you are determined before following the steps here. Because as a result of these operations, you will no longer have the libjpeg library, and the screenshot files will reach larger sizes than the jpg file, depending on the quality. (between 3-8MB) The explanation will be a bit complicated, but if you follow each process in order, you will not have any problems. If you still have a problem, you can report it below. First, let's get rid of libjpeg: -> Enter the Client src/extern/lib folder and delete the .lib files whose file name starts with libjpeg... -> Enter the Client src/EterLib folder and delete the JpegFile.cpp & JpegFile.h files. Open the EterLib project in Visual Studio in the same way, select these two files and remove them. -> Open the client src/EterPythonLib/PythonGraphic.cpp file and remove the following include line and functions: #include "../eterLib/JpegFile.h" --------------------------------- void GenScreenShotTag(const char* src, DWORD crc32, char* leaf, size_t leafLen){ const char* p = src; const char* n = p; while (n = strchr(p, '\\')) p = n + 1; _snprintf(leaf, leafLen, "YMIR_METIN2:%s:0x%.8x", p, crc32); } bool CPythonGraphic::SaveJPEG(const char* pszFileName, LPBYTE pbyBuffer, UINT uWidth, UINT uHeight) { return jpeg_save(pbyBuffer, uWidth, uHeight, 100, pszFileName) != 0; } -> Where you delete these, you will see this function: bool CPythonGraphic::SaveScreenShot(const char* c_pszFileName) { -> Replace this function completely like this: bool CPythonGraphic::SaveScreenShot() { LPDIRECT3DSURFACE9 lpSurface = nullptr; D3DSURFACE_DESC stSurfaceDesc = {}; uint32_t uWidth = stSurfaceDesc.Width; uint32_t uHeight = stSurfaceDesc.Height; ms_lpd3dDevice->CreateOffscreenPlainSurface(uWidth, uHeight, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &lpSurface, NULL); if (SUCCEEDED(ms_lpd3dDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &lpSurface))) { if (!CreateDirectory("screenshot", NULL) && ERROR_ALREADY_EXISTS != GetLastError()) //yoksa oluştur return false; SYSTEMTIME st; GetSystemTime(&st); char szFileName[MAX_PATH]; sprintf_s(szFileName, "screenshot/screenshot_%04d%02d%02d_%02d%02d%02d.bmp", // eşsiz st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond); D3DXSaveSurfaceToFile(szFileName, D3DXIFF_BMP, lpSurface, NULL, NULL); } else TraceError("CPythonGraphic::SaveScreenShot() - ScreenShot Basarisiz!"); // yok et if (lpSurface) { lpSurface->Release(); lpSurface = nullptr; } return true; } -> Then remove the following from the PythonGraphic.h file: bool SaveJPEG(const char* pszFileName, LPBYTE pbyBuffer, UINT uWidth, UINT uHeight); -> In the same file there will be: bool SaveScreenShot(const char* szFileName); -> Update this to: bool SaveScreenShot(); -> Open PythonGraphicModule.cpp and delete this PyObject* grpSaveScreenShot(PyObject* poSelf, PyObject* poArgs) { struct tm* tmNow; time_t ct; ct = time(0); tmNow = localtime(&ct); char szPath[MAX_PATH + 256]; SHGetSpecialFolderPath(NULL, szPath, CSIDL_PERSONAL, TRUE); //GetTempPath(); strcat(szPath, "\\METIN2\\"); if (-1 == _access(szPath, 0)) if (!CreateDirectory(szPath, NULL)) { TraceError("Failed to create directory [%s]\n", szPath); return Py_BuildValue("(is)", FALSE, ""); } sprintf(szPath + strlen(szPath), "%02d%02d_%02d%02d%02d.jpg", tmNow->tm_mon + 1, tmNow->tm_mday, tmNow->tm_hour, tmNow->tm_min, tmNow->tm_sec); BOOL bResult = CPythonGraphic::Instance().SaveScreenShot(szPath); return Py_BuildValue("(is)", bResult, szPath); } -> and delete this: { "SaveScreenShot", grpSaveScreenShot, METH_VARARGS }, -> Find the following function in the same file PyObject* grpSaveScreenShotToPath(PyObject* poSelf, PyObject* poArgs) { -> Replace this function completely with the code I gave below. PyObject* grpSaveScreenShotToPath(PyObject* poSelf, PyObject* poArgs) { CPythonGraphic::Instance().SaveScreenShot(); return Py_BuildNone(); } -> We are done with the client src. Now open root/game.py and find this function: def SaveScreen(self): print "save screen" # SCREENSHOT_CWDSAVE if SCREENSHOT_CWDSAVE: if not os.path.exists(os.getcwd()+os.sep+"screenshot"): os.mkdir(os.getcwd()+os.sep+"screenshot") (succeeded, name) = grp.SaveScreenShotToPath(os.getcwd()+os.sep+"screenshot"+os.sep) elif SCREENSHOT_DIR: (succeeded, name) = grp.SaveScreenShot(SCREENSHOT_DIR) else: (succeeded, name) = grp.SaveScreenShot() # END_OF_SCREENSHOT_CWDSAVE if succeeded: pass """ chat.AppendChat(chat.CHAT_TYPE_INFO, name + localeInfo.SCREENSHOT_SAVE1) chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE2) """ else: chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE_FAILURE) -> ..and update it like this: def SaveScreen(self): grp.SaveScreenShotToPath() You can also search and delete the variables in the original Python code above from root. I'm sorry for my bad english.
  22. Download Merry Christmas to everyone, I saw that here is not the best option, so I want to offer you the official system, it is not a complicated system, but maybe someone needs it.
  23. [Hidden Content] [Hidden Content] [Hidden Content] I used ITEM_USE instead of ITEM_GACHA. It was shared on the forum, you can look there and change it. You must add this: Let me know if there is a problem.
×
×
  • 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.