Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/22/19 in all areas

  1. 2019-04-16 14:54:48 Tuesday (Video - Click) - 345 additions and 160 deletions. Added a check for attr types and values min - max. You can't insert wrong bonuses into a specific item. Eg. Add 2000 MAX_HP on your Sword+9, was possible, now not. Eg. Add +500 INT to your shield, now there's a check for min-max value of player.item_attr Lv.1 - Lv.5 and your 500 INT value will be replaced with max value from lvl5 of bonus, like 12 (lv5), that happen with all the bonuses, same thing with the values lower than lvl1, like 5 HP_REGEN on your neck, when the minimum (lv1) is 10, the value will be replaced with 10. If the bonus type can't be added into a specific item, the bonus will be ignored > deleted. (example: critical pct to armor) Refactorized all the code and moved all features into ItemAwardManager.cpp (Click). C++11 or higher is required for checking attributes.
    3 points
  2. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) Metin2 Extended Item Award You can store all bonuses and stones for items. I wrote that as request from @ProfessorEnte, more informations at repository. 2018-04-02 14:02:11 Monday Fixed problem with save bonus after reload items. Fixed problem with unknown values. Correction for socket real time and more. Fixed unknown average/skill damage bonus value. player.item_proto.addon_type = -1 (Eg. 189, 199, 299, 1139, 1179, 2159, 2179, 3169, 3219, 5119, 5129, 6019, 6069, 6079, 7169)[+0 - +9] That's for the items which have addon type (-1) and you added them in item shop without bonuses like skill damage or hit damage, value x, y as default, so they'll will be without bonuses and get bugged. Now when the item will be inserted there'll be a check if item doesn't have those bonuses (from query) add a random average/skill damage bonus value. INSERT INTO player.item_award(`login`, `vnum`, `count`, `mall`) VALUES ('account', 189, 1, 1); 2019-04-12 02:31:18 Friday Fixed unique items based on the real time. Fixed unstackable items. Fixed if item count overflow occured, then set it to maximum. Added support for books. (check skill types, unknown skill), skill vnum need to be saved into socket0, (4=Aura of the Sword < player.skill_proto), if the skill vnum is unknown, there will be a random book based on pc races, excluded skills PASSIVE, GUILD, SUPPORT. Added a to-do for ITEM_BLEND, check if apply_type exists in bonuses, check if apply_value/apply_duration is equal with grades (1/2/3/4/5) from settings, blend.txt Added auto query. # Random book INSERT INTO player.item_award(`login`, `vnum`, `count`, `mall`) VALUES ('account', 50300, 1, 1); # Specific book by skill vnum INSERT INTO player.item_award(`login`, `vnum`, `count`, `socket0`, `mall`) VALUES ('account', 50300, 1, 4, 1); 2019-04-16 14:54:48 Tuesday (Video - Click) Added a check for attr types and values min - max. You can't insert wrong bonuses into a specific item. Eg. Add 2000 MAX_HP on your Sword+9, was possible, now not. Eg. Add +500 INT to your shield, now there's a check for min-max value of player.item_attr Lv.1 - Lv.5 and your 500 INTvalue will be replaced with max value from lvl5 of bonus, like 12 (lv5), that happen with all the bonuses, same thing with the values lower than lvl1, like 5 HP_REGEN on your neck, when the minimum (lv1) is 10, the value will be replaced with 10. If the bonus type can't be added into a specific item, the bonus will be ignored > deleted. (example: critical pct to armor) Refactorized all the code and moved all features into ItemAwardManager.cpp. C++11 or higher is required for checking attributes. # Test unknown types + higher and lower values in game. INSERT INTO `player`.`item_award`(`login`, `vnum`, `count`, `attrtype0`, `attrvalue0`, `attrtype1`, `attrvalue1`, `attrtype2`, `attrvalue2`, `attrtype3`, `attrvalue3`, `attrtype4`, `attrvalue4`, `mall`) VALUES ( 'test', 149, 1, 17, 25, -- ATTBONUS_HUMAN 22, 35, -- ATTBONUS_DEVIL, 32, 175, -- RESIST_BELL 33, -150, -- RESIST_FAN 48, 1, -- IMMUNE_STUN 1 ); # See the min-max values for all the bonuses from weapon. SELECT apply+0 AS `index`, apply AS `name`, lv1 as `min_value`, lv5 as `max_value` FROM `item_attr` WHERE weapon > 0; # See if a specific bonus is included in bonuses of weapon. SELECT apply, apply+0 FROM `item_attr` WHERE weapon > 0 AND apply in ('ATTBONUS_HUMAN', 'ATTBONUS_DEVIL', 'RESIST_BELL', 'RESIST_FAN', 'IMMUNE_STUN'); 2019-10-30 03:48:12 Wednesday Fixed expression is not assignable. Break a for loop after the bonus has found. Sockets & attrs INSERT INTO `player`.`item_award`(`login`, `vnum`, `count`, `given_time`, `why`, `socket0`, `socket1`, `socket2`, `attrtype0`, `attrvalue0`, `attrtype1`, `attrvalue1`, `attrtype2`, `attrvalue2`, `attrtype3`, `attrvalue3`, `attrtype4`, `attrvalue4`, `mall`) VALUES ( 'test', -- ACCOUNT_NAME 12029, -- ITEM_VNUM 1, -- ITEM_COUNT '2018-03-25 05:53:17', -- GIVEN_TIME 'ITEM_SHOP', -- REASON 28442, 28441, 28438, -- SOCKET 1 & 2 & 3 1, 1500, -- APPLY_MAX_HP 29, 10, -- APPLY_RESIST_SWORD, 30, 10, -- APPLY_RESIST_TWOHAND 31, 10, -- APPLY_RESIST_DAGGER 32, 10, -- APPLY_RESIST_BELL 1 -- MALL ); For those who use @martysama0134 source: //@Srcs/Server/db/src/ClientManager.cpp #define ENABLE_ITEMAWARD_REFRESH // Should be enabled Github repository or download - (click here): [hide][Hidden Content]]
    2 points
  3. Hi everyone!? I'm back I want to show you me new map. This is summoner's rift version metin2. Maybe soon I will create a 'twisted treeline' and 'aram' How do you like it? ? contact _________________________________________________________________________________ _________________________________________________________________________________
    2 points
  4. 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
    1 point
  5. 1 point
  6. You need some more codes in the part of uiexchange to be functional with the system of cheque_system. You do not need to use the exchangedialog_new.py if you do not have the system. Here is my uiexchange.py (if you want compare) [Hidden Content] Add this in uitooltip.py:
    1 point
  7. [Hidden Content] You need have "cheque" in inventorywindow (or inventorywindowex) Here is my inventorywindowex.py: [Hidden Content]
    1 point
  8. In /etc/rc.conf you must have this line to generate core dumps: dumpdev="AUTO"
    1 point
  9. Thanks to @ProfessorEnte for reports. 2019-04-12 02:31:18 Friday - 170 additions and 50 deletions. Fixed unique items based on the real time. Fixed unstackable items. Fixed if item count overflow occured, then set it to maximum. Added support for books. (check skill types, unknown skill), skill vnum need to be saved into socket0, (4=Aura of the Sword < player.skill_proto), if the skill vnum is unknown, there will be a random book based on pc races, excluded skills PASSIVE, GUILD, SUPPORT. Added a to-do for ITEM_BLEND, check if apply_type exists in bonuses, check if apply_value/apply_duration is equal with grades (1/2/3/4/5) from settings, blend.txt Added auto query. # Random book INSERT INTO player.item_award(`login`, `vnum`, `count`, `mall`) VALUES ('account', 50300, 1, 1); # Specific book by skill vnum INSERT INTO player.item_award(`login`, `vnum`, `count`, `socket0`, `mall`) VALUES ('account', 50300, 1, 4, 1);
    1 point
  10. Nice release. Thanks. One thing tho: in the locale/ui/taskbar.py, don't do: "x" : SCREEN_WIDTH - 178 + 8, Instead, just do: "x" : SCREEN_WIDTH - 178, Becase else it bugs out and the button goes a bit inside the characterbutton, each button in the taskbar has to be exactly 34 units away from eachother, characterbutton takes 144. It would also be useful to remove the moneydialog from the inventory if you're using this, I'll post the code when I have more time.
    1 point
  11. I think you did not follow my guide on uiexchange.py Your debug shows "OnPickMoney" takes exactly 2 arguments (3 given) If you have any more errors I think you should write me privately since this post is becoming conversation.
    0 points
×
×
  • Create New...

Important Information

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