Leaderboard
Popular Content
Showing content with the highest reputation on 05/09/15 in all areas
-
M2 Download Center Download Here ( Internal ) Hi guys Someone wondered how to make 4 inventory page with source. I will share how to make 4 inventory page today I hope you are like it First which you are use to source files open it. I will use to mainline_released(SG) log in mainline_released/mainline_sg/Srcs/Server/common after open length.h after search this INVENTORY_MAX_NUM = 90, Replace to INVENTORY_MAX_NUM = 180, Open char_item.cpp and search this BYTE bPage = bCell / (INVENTORY_MAX_NUM / 2); Replace to BYTE bPage = bCell / (INVENTORY_MAX_NUM / 4); search this if (p / (INVENTORY_MAX_NUM / 2) != bPage) Replace to if (p / (INVENTORY_MAX_NUM / 4) != bPage) open exchange.cpp. Search this after add under this. static CGrid s_grid2(5, INVENTORY_MAX_NUM/5 / 2); // inven page 2 will be like this. static CGrid s_grid1(5, INVENTORY_MAX_NUM/5 / 2); // inven page 1 static CGrid s_grid2(5, INVENTORY_MAX_NUM/5 / 2); // inven page 2 static CGrid s_grid3(5, INVENTORY_MAX_NUM/5 / 2); // inven page 3 static CGrid s_grid4(5, INVENTORY_MAX_NUM/5 / 2); // inven page 4 s_grid1.Clear(); s_grid2.Clear(); s_grid3.Clear(); s_grid4.Clear(); and replace to your self.. for (i = 0; i < INVENTORY_MAX_NUM / 4; ++i) { if (!(item = victim->GetInventoryItem(i))) continue; s_grid1.Put(i, 1, item->GetSize()); } for (i = INVENTORY_MAX_NUM / 4; i < INVENTORY_MAX_NUM; ++i) { if (!(item = victim->GetInventoryItem(i))) continue; s_grid2.Put(i - INVENTORY_MAX_NUM / 4, 1, item->GetSize()); } for (i = INVENTORY_MAX_NUM / 4; i < INVENTORY_MAX_NUM; ++i) { if (!(item = victim->GetInventoryItem(i))) continue; s_grid3.Put(i - INVENTORY_MAX_NUM / 4, 1, item->GetSize()); } for (i = INVENTORY_MAX_NUM / 4; i < INVENTORY_MAX_NUM; ++i) { if (!(item = victim->GetInventoryItem(i))) continue; s_grid4.Put(i - INVENTORY_MAX_NUM / 4, 1, item->GetSize()); } After client.. Log in mainline_released/mainline_sg/Srcs/Client/Userinterface after open GameType.h after search this const DWORD c_Inventory_Page_Count = 2; Replace to const DWORD c_Inventory_Page_Count = 4; open inventorywindow.py and search this EQUIPMENT_START_INDEX = 90 Replace to EQUIPMENT_START_INDEX = 180 open uiinventory.py and search this after add under this self.inventoryTab.append(self.GetChild("Inventory_Tab_02")) self.inventoryTab.append(self.GetChild("Inventory_Tab_03")) self.inventoryTab.append(self.GetChild("Inventory_Tab_04")) search this after add under this self.inventoryTab[1].SetEvent(lambda arg=1: self.SetInventoryPage(arg)) self.inventoryTab[2].SetEvent(lambda arg=2: self.SetInventoryPage(arg)) self.inventoryTab[3].SetEvent(lambda arg=3: self.SetInventoryPage(arg)) Search SetInventoryPage function and replace with this. def SetInventoryPage(self, page): self.inventoryTab[self.inventoryPageIndex].SetUp() self.inventoryPageIndex = page self.inventoryTab[self.inventoryPageIndex].Down() self.RefreshBagSlotWindow() Thanks for @Zardon,Deniec Cikiec comment. i will share my inventorywindow.py import uiScriptLocale import item EQUIPMENT_START_INDEX = 180 window = { "name" : "InventoryWindow", ## 600 - (width + 오른쪽으로 부터 띄우기 24 px) "x" : SCREEN_WIDTH - 176, "y" : SCREEN_HEIGHT - 37 - 565, "style" : ("movable", "float",), "width" : 176, "height" : 585, "children" : ( ## Inventory, Equipment Slots { "name" : "board", "type" : "board", "style" : ("attach",), "x" : 0, "y" : 0, "width" : 176, "height" : 585, "children" : ( ## Title { "name" : "TitleBar", "type" : "titlebar", "style" : ("attach",), "x" : 8, "y" : 7, "width" : 161, "color" : "yellow", "children" : ( { "name":"TitleName", "type":"text", "x":77, "y":3, "text":uiScriptLocale.INVENTORY_TITLE, "text_horizontal_align":"center" }, ), }, ## Equipment Slot { "name" : "Equipment_Base", "type" : "image", "x" : 10, "y" : 33, "image" : "d:/ymir work/ui/equipment_bg_without_ring.tga", "children" : ( { "name" : "EquipmentSlot", "type" : "slot", "x" : 3, "y" : 3, "width" : 150, "height" : 182, "slot" : ( {"index":EQUIPMENT_START_INDEX+0, "x":39, "y":37, "width":32, "height":64}, {"index":EQUIPMENT_START_INDEX+1, "x":39, "y":2, "width":32, "height":32}, {"index":EQUIPMENT_START_INDEX+2, "x":39, "y":145, "width":32, "height":32}, {"index":EQUIPMENT_START_INDEX+3, "x":75, "y":67, "width":32, "height":32}, {"index":EQUIPMENT_START_INDEX+4, "x":3, "y":3, "width":32, "height":96}, {"index":EQUIPMENT_START_INDEX+5, "x":114, "y":67, "width":32, "height":32}, {"index":EQUIPMENT_START_INDEX+6, "x":114, "y":35, "width":32, "height":32}, {"index":EQUIPMENT_START_INDEX+7, "x":2, "y":145, "width":32, "height":32}, {"index":EQUIPMENT_START_INDEX+8, "x":75, "y":145, "width":32, "height":32}, {"index":EQUIPMENT_START_INDEX+9, "x":114, "y":2, "width":32, "height":32}, {"index":EQUIPMENT_START_INDEX+10, "x":75, "y":35, "width":32, "height":32}, ## 새 반지1 ##{"index":item.EQUIPMENT_RING1, "x":2, "y":106, "width":32, "height":32}, ## 새 반지2 ##{"index":item.EQUIPMENT_RING2, "x":75, "y":106, "width":32, "height":32}, ## 새 벨트 {"index":item.EQUIPMENT_BELT, "x":39, "y":106, "width":32, "height":32}, ), }, ## Dragon Soul Button { "name" : "DSSButton", "type" : "button", "x" : 114, "y" : 107, "tooltip_text" : uiScriptLocale.TASKBAR_DRAGON_SOUL, "default_image" : "d:/ymir work/ui/dragonsoul/dss_inventory_button_01.tga", "over_image" : "d:/ymir work/ui/dragonsoul/dss_inventory_button_02.tga", "down_image" : "d:/ymir work/ui/dragonsoul/dss_inventory_button_03.tga", }, ## MallButton { "name" : "MallButton", "type" : "button", "x" : 118, "y" : 148, "tooltip_text" : uiScriptLocale.MALL_TITLE, "default_image" : "d:/ymir work/ui/game/TaskBar/Mall_Button_01.tga", "over_image" : "d:/ymir work/ui/game/TaskBar/Mall_Button_02.tga", "down_image" : "d:/ymir work/ui/game/TaskBar/Mall_Button_03.tga", }, ## CostumeButton { "name" : "CostumeButton", "type" : "button", "x" : 78, "y" : 5, "tooltip_text" : uiScriptLocale.COSTUME_TITLE, "default_image" : "d:/ymir work/ui/game/taskbar/costume_Button_01.tga", "over_image" : "d:/ymir work/ui/game/taskbar/costume_Button_02.tga", "down_image" : "d:/ymir work/ui/game/taskbar/costume_Button_03.tga", }, { "name" : "Equipment_Tab_01", "type" : "radio_button", "x" : 86, "y" : 161, "default_image" : "d:/ymir work/ui/game/windows/tab_button_small_01.sub", "over_image" : "d:/ymir work/ui/game/windows/tab_button_small_02.sub", "down_image" : "d:/ymir work/ui/game/windows/tab_button_small_03.sub", "children" : ( { "name" : "Equipment_Tab_01_Print", "type" : "text", "x" : 0, "y" : 0, "all_align" : "center", "text" : "I", }, ), }, { "name" : "Equipment_Tab_02", "type" : "radio_button", "x" : 86 + 32, "y" : 161, "default_image" : "d:/ymir work/ui/game/windows/tab_button_small_01.sub", "over_image" : "d:/ymir work/ui/game/windows/tab_button_small_02.sub", "down_image" : "d:/ymir work/ui/game/windows/tab_button_small_03.sub", "children" : ( { "name" : "Equipment_Tab_02_Print", "type" : "text", "x" : 0, "y" : 0, "all_align" : "center", "text" : "II", }, ), }, ), }, { "name" : "Inventory_Tab_01", "type" : "radio_button", "x" : 10, "y" : 33 + 189, "default_image" : "d:/ymir work/ui/game/windows/tab_button_large_01.sub", "over_image" : "d:/ymir work/ui/game/windows/tab_button_large_02.sub", "down_image" : "d:/ymir work/ui/game/windows/tab_button_large_03.sub", "tooltip_text" : uiScriptLocale.INVENTORY_PAGE_BUTTON_TOOLTIP_1, "children" : ( { "name" : "Inventory_Tab_01_Print", "type" : "text", "x" : 0, "y" : 0, "all_align" : "center", "text" : "I", }, ), }, { "name" : "Inventory_Tab_02", "type" : "radio_button", "x" : 10 + 78, "y" : 33 + 189, "default_image" : "d:/ymir work/ui/game/windows/tab_button_large_01.sub", "over_image" : "d:/ymir work/ui/game/windows/tab_button_large_02.sub", "down_image" : "d:/ymir work/ui/game/windows/tab_button_large_03.sub", "tooltip_text" : uiScriptLocale.INVENTORY_PAGE_BUTTON_TOOLTIP_2, "children" : ( { "name" : "Inventory_Tab_02_Print", "type" : "text", "x" : 0, "y" : 0, "all_align" : "center", "text" : "II", }, ), }, { "name" : "Inventory_Tab_03", "type" : "radio_button", "x" : 10, "y" : 33 + 210, "default_image" : "d:/ymir work/ui/game/windows/tab_button_large_01.sub", "over_image" : "d:/ymir work/ui/game/windows/tab_button_large_02.sub", "down_image" : "d:/ymir work/ui/game/windows/tab_button_large_03.sub", "tooltip_text" : uiScriptLocale.INVENTORY_PAGE_BUTTON_TOOLTIP_2, "children" : ( { "name" : "Inventory_Tab_03_Print", "type" : "text", "x" : 0, "y" : 0, "all_align" : "center", "text" : "III", }, ), }, { "name" : "Inventory_Tab_04", "type" : "radio_button", "x" : 10 + 78, "y" : 33 + 210, "default_image" : "d:/ymir work/ui/game/windows/tab_button_large_01.sub", "over_image" : "d:/ymir work/ui/game/windows/tab_button_large_02.sub", "down_image" : "d:/ymir work/ui/game/windows/tab_button_large_03.sub", "tooltip_text" : uiScriptLocale.INVENTORY_PAGE_BUTTON_TOOLTIP_2, "children" : ( { "name" : "Inventory_Tab_04_Print", "type" : "text", "x" : 0, "y" : 0, "all_align" : "center", "text" : "IV", }, ), }, ## Item Slot { "name" : "ItemSlot", "type" : "grid_table", "x" : 8, "y" : 264, "start_index" : 0, "x_count" : 5, "y_count" : 9, "x_step" : 32, "y_step" : 32, "image" : "d:/ymir work/ui/public/Slot_Base.sub" }, ## Print { "name":"Money_Slot", "type":"button", "x":8, "y":28, "horizontal_align":"center", "vertical_align":"bottom", "default_image" : "d:/ymir work/ui/public/parameter_slot_05.sub", "over_image" : "d:/ymir work/ui/public/parameter_slot_05.sub", "down_image" : "d:/ymir work/ui/public/parameter_slot_05.sub", "children" : ( { "name":"Money_Icon", "type":"image", "x":-18, "y":2, "image":"d:/ymir work/ui/game/windows/money_icon.sub", }, { "name" : "Money", "type" : "text", "x" : 3, "y" : 3, "horizontal_align" : "right", "text_horizontal_align" : "right", "text" : "123456789", }, ), }, ), }, ), } open beltinventorywindow.py after search this EQUIPMENT_START_INDEX = 90 replace to EQUIPMENT_START_INDEX = 180 I think someone don't make part of client-side. I share binary file (original file) with your. [Hidden Content] Kind Regards HaveBeen1 point
-
M2 Download Center Download Here ( Internal ) Here ( Bonus - Unban Command ) Hi, In this thread I will show you how to do an in-game ban for your GMs. First of all, you need to make a new column in the account.account. The name of the field should be reason and select varchar as type. Or just use this in your console to create the field: ALTER TABLE account ADD reason VARCHAR(256); Now open game/cmd.cpp and search for this: ACMD(do_block_chat); Add this under that: ACMD(do_ban); Search for this still in the game/cmd.cpp: { "block_chat_list",do_block_chat_list, 0, POS_DEAD, GM_PLAYER }, Make a new line and add this under that: { "ban", do_ban, 0, POS_DEAD, GM_IMPLEMENTOR }, At this point you can change the rights for the command: GM_PLAYER - do NOT choose this! GM_LOW_WIZARD GM_WIZARD GM_HIGH_WIZARD GM_GOD GM_IMPLEMENTOR Search for this event in game/cmd_gm.cpp: ACMD(do_block_chat) Add this under that: ACMD(do_ban) Now time to add the complete code to ACMD(do_ban): // Args char arg1[256], arg2[256], arg3[256]; // Local variables const char* szName; const char* szReason; int iDuration; one_argument(two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2)), arg3, sizeof(arg3)); // Invalid syntax if (!*arg1 || !*arg2 || !*arg3) { ch->ChatPacket(CHAT_TYPE_INFO, "Invalid Syntax, usage: <player name> <time in hours> <reason> tip: don't use spaces in the reason, use _"); return; } szName = arg1; iDuration = atoi(arg2); szReason = arg3; if (iDuration <= 0) { ch->ChatPacket(CHAT_TYPE_INFO, "Duration can't be 0 or minus."); return; } LPCHARACTER tch = CHARACTER_MANAGER::instance().FindPC(szName); if (!tch) { ch->ChatPacket(CHAT_TYPE_INFO, "%s is not playing", szName); return; } if (!tch->GetDesc()) { ch->ChatPacket(CHAT_TYPE_INFO, "%s don't have desc", szName); return; } if (tch == ch) { ch->ChatPacket(CHAT_TYPE_INFO, "What's wrong with you? Don't ban yourself"); return; } if (tch->GetGMLevel() > GM_PLAYER) { ch->ChatPacket(CHAT_TYPE_INFO, "Do not ban GMs"); return; } std::auto_ptr<SQLMsg> msg(DBManager::instance().DirectQuery("UPDATE account.account SET availDt = FROM_UNIXTIME(UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) + %i), reason = '%s' WHERE id = %d", iDuration * 3600, szReason, tch->GetDesc()->GetAccountTable().id)); tch->GetDesc()->DelayedDisconnect(5); sys_log(0, "%s[%d] banned %s for %i hours with reason: %s", ch->GetName(), ch->GetPlayerID(), szName, iDuration, szReason); ch->ChatPacket(CHAT_TYPE_INFO, "%s has been banned for %i hours with reason: %s", szName, iDuration, szReason); Check how it works: If you have any question or suggestion, please just reply to this topic. Kind Regards, Sanchez1 point
-
Hi Dev's, for three days untill now I've worked to do some options in gamesource for CONFIG's files from server, to make my job for server easier! Now, first option: First new option in config is players max status over CONFIG: 1. In cmd_general.cpp, after extern int g_server_id; add: extern int gPlayerMaxStatus; extern int gPlayerMaxHT; extern int gPlayerMaxIQ; extern int gPlayerMaxST; extern int gPlayerMaxDX; 2. Also in cmd_general.cpp search ACMD(do_stat) and after idx = POINT_IQ; add: if (ch->GetRealPoint(idx) >= gPlayerMaxStatus) checking = true; switch (idx) { case POINT_HT: if ((ch->GetRealPoint(idx) < gPlayerMaxHT)) checking = false; else checking = true; case POINT_IQ: if (ch->GetRealPoint(idx) < gPlayerMaxIQ) checking = false; else checking = true; case POINT_ST: if (ch->GetRealPoint(idx) < gPlayerMaxST) checking = false; else checking = true; case POINT_DX: if (ch->GetRealPoint(idx) < gPlayerMaxDX) checking = false; else checking = true; } if(checking==true) return; 3. Well done, pro metiners. Now in cmd_gm.cpp after DropEvent_RefineBox_SetValue(const std::string& name, int value); add: extern int gPlayerMaxStatus; extern int gPlayerMaxHT; extern int gPlayerMaxIQ; extern int gPlayerMaxST; extern int gPlayerMaxDX; 4. Also in cmd_gm.cpp search ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Cannot set stat under initial stat.")); and you'll see something, a little bit down: if (nPoint > change it with: if (nPoint > gPlayerMaxStatus) { nChangeAmount -= nPoint - gPlayerMaxStatus; nPoint = gPlayerMaxStatus; } 5. Good. Now in config.cpp we'll need to insert our variables, to be read by rest of files! After int gPlayerMaxLevel add: int gPlayerMaxStatus = 90; int gPlayerMaxHT = 32767; int gPlayerMaxIQ = 32767; int gPlayerMaxST = 32767; int gPlayerMaxDX = 32767; 6. After, search TOKEN ("block_char_creation") and after it add: TOKEN("max_status") { str_to_number(gPlayerMaxStatus, value_string); gPlayerMaxStatus = MINMAX(1, gPlayerMaxStatus, 32767); if(gPlayerMaxHT==32767) gPlayerMaxHT = gPlayerMaxStatus; if(gPlayerMaxIQ==32767) gPlayerMaxIQ = gPlayerMaxStatus; if(gPlayerMaxST==32767) gPlayerMaxST = gPlayerMaxStatus; if(gPlayerMaxDX==32767) gPlayerMaxDX = gPlayerMaxStatus; fprintf(stderr, "PLAYER_MAX_STATUS: %dn", gPlayerMaxStatus); } TOKEN("max_ht") { str_to_number(gPlayerMaxHT, value_string); gPlayerMaxHT = MINMAX(1, gPlayerMaxHT, 32767); fprintf(stderr, "PLAYER_MAX_HT: %dn", gPlayerMaxHT); } TOKEN("max_iq") { str_to_number(gPlayerMaxIQ, value_string); gPlayerMaxIQ = MINMAX(1, gPlayerMaxIQ, 32767); fprintf(stderr, "PLAYER_MAX_IQ: %dn", gPlayerMaxIQ); } TOKEN("max_st") { str_to_number(gPlayerMaxST, value_string); gPlayerMaxST = MINMAX(1, gPlayerMaxST, 32767); fprintf(stderr, "PLAYER_MAX_ST: %dn", gPlayerMaxST); } TOKEN("max_dx") { str_to_number(gPlayerMaxDX, value_string); gPlayerMaxDX = MINMAX(1, gPlayerMaxDX, 32767); fprintf(stderr, "PLAYER_MAX_DX: %dn", gPlayerMaxDX); } 7. The last thing we need to do, is that we'll need to put extern's variables in config.h. Search extern int gPlayerMaxLevel; and add after it: extern int gPlayerMaxStatus; extern int gPLayerMaxHT; extern int gPLayerMaxIQ; extern int gPLayerMaxST; extern int gPLayerMaxDX; 8. Well done. Warning. Once you do that, you'll need to put in CONFIG's files from game99 and channels that: max_status: (from 0 to 32767) max_ht: (from 0 to 32767) max_iq: (from 0 to 32767) max_st: (from 0 to 32767) max_dx: (from 0 to 32767) 9. After that, if you do like me, you need to change POINT_VT, IQ, ST and DX from some files, to read it from CONFIG. In cmd_gm.cpp search case POINT_HT : // and change from case POINT_HT untill POINT_DX with: case POINT_HT : // 체력 if (nPoint + ch->GetPoint(POINT_HT) > gPlayerMaxHT) { nPoint = gPlayerMaxHT - ch->GetPoint(POINT_HT); } break; case POINT_IQ : // 지능 if (nPoint + ch->GetPoint(POINT_IQ) > gPlayerMaxIQ) { nPoint = gPlayerMaxIQ - ch->GetPoint(POINT_IQ); } break; case POINT_ST : // 근력 if (nPoint + ch->GetPoint(POINT_ST) > gPlayerMaxST) { nPoint = gPlayerMaxST - ch->GetPoint(POINT_ST); } break; case POINT_DX : // 민첩 if (nPoint + ch->GetPoint(POINT_DX) > gPlayerMaxDX) { nPoint = gPlayerMaxDX - ch->GetPoint(POINT_DX); } break; 10. There you go. Enjoy. You're done!1 point
-
Open in uiinventory search this if slotNumber >= player.INVENTORY_PAGE_SIZE: slotNumber -= player.INVENTORY_PAGE_SIZE Replace to if slotNumber >= player.INVENTORY_PAGE_SIZE*self.inventoryPageIndex: slotNumber -= player.INVENTORY_PAGE_SIZE*self.inventoryPageIndex1 point
-
1 point
-
watch in char_item. bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell) i think. Check for Type/Subtype. If it is right -> Message #edit here's the Equip Part: case ITEM_COSTUME: case ITEM_WEAPON: case ITEM_ARMOR: case ITEM_ROD: case ITEM_RING: case ITEM_BELT: case ITEM_PICK: if (!item->IsEquipped()) EquipItem(item); else UnequipItem(item); break; Search Everyhere for: EquipItem(item); UnequipItem(item); Greatz1 point
-
Just edit the color on the mob_proto (The MobColor column, put it to 0)1 point
-
Google translate ? If you create a new character, with level and items, only level remains ? Please give us your db syserr1 point
-
Hello, I will explain how you can have 24 slots item in exchange/trade dialog. ServerSide Open your "game/exchange.cpp" in Source File and search: m_pGrid = M2_NEW CGrid(4,3); Replace with: m_pGrid = M2_NEW CGrid(6,4); Open "game/exchange.h" and search: EXCHANGE_ITEM_MAX_NUM = 12 Replace with: EXCHANGE_ITEM_MAX_NUM = 24 Now you can compile your Game File. ClientSide Open "UserInterface/PythonExchange.h" from your Binary Source files and search: EXCHANGE_ITEM_MAX_NUM = 12 Replace with: EXCHANGE_ITEM_MAX_NUM = 24 Now you can compile your Client Binary. Extract "pack/uiscript" from your Client and open "exchangedialog.py", replace all content with: ExchangeDialog.py ~ 24 Slot Item Now you can compress your UiScript. Good work, Bye.1 point
-
1 point
-
input_main.cpp: add this: #include "belt_inventory_helper.h" after this: #include "DragonSoul.h" still in input_main.cpp Search this: if (pkItem->GetCell() >= INVENTORY_MAX_NUM && IS_SET(pkItem->GetFlag(), ITEM_FLAG_IRREMOVABLE)) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<창고> 창고로 옮길 수 없는 아이템 입니다.")); return; } and add after if (true == pkItem->IsEquipped() && true == CBeltInventoryHelper::IsExistItemInBeltInventory(ch)) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<Belt> You can't do this.")); return; } Not own solution !! Someone did post but I do not know who Sry my bad eng!1 point
-
thank you very much my friend, and a happy new year to all of you1 point