Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/22/16 in all areas

  1. if the affect number in affect.h is 42 for exemple in skill proto you must edit affect column with the number there's an example affect_x(1) affect_y(2) affect_x(3) affect_blue_posession(4) (affect.h) in skill proto edit table and count how many affects you have and put it on position that you have in affect.h in my example if the affect is on position 4 you must put the effect on 4 position in skill proto as my example .so if in affect.h you have affect blue posession on position 43 in skill proto it must be on position 43 in affect column i hope you will understand
    2 points
  2. M2 Download Center Download Here ( Internal ) Is the color that appears to each character when selected or give click, this color is changed depending on the kingdom which is the pj, this same applies to the NPC. The mobs appear with a different effect to common and is a matter of each effect changes the color depending on individual taste [Source Binary] 1. open InstanceBase.cpp in UserInterface 2. Open InstanceBase.h in UserInterface 3. Open InstanceBaseEffect.cpp in UserInterface 4. Open PythonCharacterManagerModule.cpp in UserInterface [Python Client] 1. Open playersettingmodule.py in root: Finally add eix epk and I leave at Download Img System Credits: me Greetings! Download Epk and Eix
    1 point
  3. Hi, In this thread I'm going to show you how to make a game-client or client-game communication with packets, instead of using the old quest-client, client-quest communication. Lets start with the game-client, in this example I will send 1 variable to the client. First start with the HEADER, open your binary source and navigate to UserInterface/Packet.h. Now you will see many headers, create a new one, but search for an empty number. I will use 57, because its not used. GC means it's used for Game -> Client packet, it's just a prefix. HEADER_GC_METIN2DEV Now add the structure for the packet, this is most important part. Structure is the "body" of the packet, it contains the HEADER as BYTE and the other optional variables. As I said I just want to send one int type to the client, so add it. typedef struct command_metin2dev_packet { BYTE bHeader; int M2int; } TPacketGCMetin2Dev; Now navigate to UserInterface/PythonNetworkStream.cpp and add your header to the CMainPacketHeaderMap class. The first parameter of the Set is the HEADER, second is the size of the structure. We will use just static size packets in this tutorial, but the third argument can be dynamic size too. Set(HEADER_GC_METIN2DEV, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCMetin2Dev), STATIC_SIZE_PACKET)); Now navigate to UserInterface/PythonNtworkStreamPhaseGame.cpp and add the function to the switch. case HEADER_GC_METIN2DEV: ret = RecvM2DevPacket(); break; The name of the function will be RecvM2DevPacket: Now declarate the function, navigate to UserInterface/PythonNetworkStream.h and add it as public: bool RecvM2DevPacket(); Now add the receiver part of the code. Recv "picks" out xy bytes from the buffer and the return type of it is false if there was no data in the buffer by that size otherwise true, which means it was successful. xy = size of the structure bool CPythonNetworkStream::RecvM2DevPacket() { TPacketGCMetin2Dev Metin2DevGC; if (!Recv(sizeof(TPacketGCMetin2Dev), &Metin2DevGC)) { Tracen("Recv Metin2DevGC Packet Error"); return false; } } Now we are calling the BINARY_M2DEV_Test function in game.py and passing the received data. PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_M2DEV_Test", Py_BuildValue("(i)", Metin2DevGC.M2int)); This was the client-side of the game-client communication, lets start the server-side: First of all we need to add the header again, navigate to game/packet.h and add this: And the structure: typedef struct packet_metin2dev_packet { BYTE byHeader; int M2int; } TPacketGCMetin2Dev; Now navigate to game/char.cpp and create a function which sends the packet. void CHARACTER::SendMetin2DevPacket() { } Declare it in the game/char.h: void SendMetin2DevPacket(); Now lets add the content of the function. Create a new instance of the structure, set the values of it and send it to the client. void CHARACTER::SendMetin2DevPacket() { if (!GetDesc()) { return; } TPacketGCMetin2Dev Metin2DevGC; Metin2DevGC.byHeader = HEADER_GC_METIN2DEV; Metin2DevGC.M2int = GetPlayerID(); GetDesc()->Packet(&Metin2DevGC, sizeof(TPacketGCMetin2Dev)); } Now add the last function to game.py, this will be called by the binary: def BINARY_M2DEV_Test(self, M2int): import dbg dbg.LogBox(str(M2int)) Finally, lets check how it works: If you have any question or suggestion, please just reply to this topic. Kind Regards, Sanchez
    1 point
  4. M2 Download Center Download Here ( Internal ) Hi Devs! i want share you lolly effect Let's start Open common/lenght.h and search SE_EQUIP_LOVE_PENDANT make new line and paste this SE_EQUIP_MAGIC_CANDY, Open common/vnumhelper.cpp and search const bool IsLovePendant(DWORD vnum) { return 71145 == vnum; } make new line and paste static const bool IsMagicCandy(DWORD vnum) { return 71188 == vnum; } Common is done! Open game/char_item.cpp and search else if (true == CItemVnumHelper::IsLovePendant(dwVnum)) { this->EffectPacket(SE_EQUIP_LOVE_PENDANT); } make new line and paste else if (true == CItemVnumHelper::IsMagicCandy(dwVnum)) { this->EffectPacket(SE_EQUIP_MAGIC_CANDY); } Open game/unique_item.cpp search UNIQUE_ITEM_RAMADAN_RING = 71135, make new line and paste UNIQUE_MAGIC_CANDY = 71188, Game is Done! Open Client/instancebase.h and Search EFFECT_LOVE_PENDANT_EQUIP make new line and paste EFFECT_EQUIP_CANDY, open Client/packet.h and search SE_EQUIP_LOVE_PENDANT, make new line and paste SE_EQUIP_MAGIC_CANDY, open Client/PythonNetworkStreamPhaseGameItem.cpp search case SE_EQUIP_LOVE_PENDANT: effect = CInstanceBase::EFFECT_LOVE_PENDANT_EQUIP; break; make new line and paste case SE_EQUIP_MAGIC_CANDY: effect = CInstanceBase::EFFECT_EQUIP_CANDY; break; open Client/PythonCharacterManagerModule.cpp CInstanceBase::EFFECT_LOVE_PENDANT_EQUIP); make new line and paste PyModule_AddIntConstant(poModule, "EFFECT_EQUIP_CANDY", CInstanceBase::EFFECT_EQUIP_CANDY); Client is done! Open root/playersettingsmodule.py search chrmgr.RegisterCacheEffect(chrmgr.EFFECT_LOVE_PENDANT_EQUIP, "", "d:/ymir work/effect/etc/buff/buff_item4.mse") make new line and paste chrmgr.RegisterCacheEffect(chrmgr.EFFECT_EQUIP_CANDY, "", "d:/ymir work/effect/etc/buff/buff_candy2.mse") item_proto.sql 71188 ºÎÈ°Àı »çÅÁ Lolly The Magical 16 0 0 1 106624 0 128 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 -1 -1 -1 -1 -1 0 0 0 item_proto.txt 71188 Ãʽ´ŞÀÇ ¹İÁö ITEM_UNIQUE UNIQUE_NONE 1 NONE NONE WEAR_SHIELD NONE 0 0 0 0 0 REAL_TIME 0 LIMIT_NONE 0 APPLY_NONE 0 APPLY_NONE 0 APPLY_NONE 0 0 0 0 0 0 0 0 0 0 item_names 71188 Lolly the Magical effect Click here for download effect Ingame screen: sorry i dont know how to make blocks for topic. Good luck
    1 point
  5. then check affects from affect.h and instancebase.h to be the same
    1 point
  6. yes if the affects are in thot order in instancebase
    1 point
  7. case 71051 : // 진재가 { // 유럽, 싱가폴, 베트남 진재가 사용금지 if (LC_IsSingapore() || LC_IsVietnam()) return false; LPITEM item2; // test if (item2->GetType() != ITEM_COSTUME) return false; // test if (!IsValidItemPosition(DestCell) || !(item2 = GetInventoryItem(wDestCell))) return false;
    1 point
  8. i try somethink like this : case 71051 : // 진재가 { // 유럽, 싱가폴, 베트남 진재가 사용금지 if (LC_IsSingapore() || LC_IsVietnam()) return false; LPITEM item2; // test if (item2->GetType() != ITEM_COSTUME) return false; // test if (!IsValidItemPosition(DestCell) || !(item2 = GetInventoryItem(wDestCell))) return false; if (item2->IsExchanging() == true) return false; if (item2->GetAttributeSetIndex() == -1) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("속성을 변경할 수 없는 아이템입니다.")); return false; } if (item2->AddRareAttribute() == true)
    1 point
×
×
  • 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.