Jump to content

Metin2 Dev

Bot
  • Posts

    2151
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by Metin2 Dev

  1. [Hidden Content] Useless just for one system, useful if you use it in more places.
  2. If you don't know the essential things why are you even trying to copy something ? Pay someone who understand what i said above .
  3. Just replace that function with POINT corespondent. item.GetApplyPoint( item.APPLY_ATTBONUS_HUMAN ) == POINT_ATTBONUS_HUMAN = 43 Or copy aApplyInfo[MAX_APPLY_NUM] from constants.cpp (server) and make a simple function to get point corespondent for apply.
  4. Don't spam this topic with your developer skills, boiz. Just download and use it or put it in Recycle Bin.
  5. The code is blow minding, I wonder how much they pay their developers...
  6. M2 Download Center Download Here ( Internal ) I think they forgot to cythonize =)) I don't recommend to use that code, is ugly ... [Hidden Content]
  7. It's too basic but not bad.
  8. "equip" and "unequip" EVENTS not FUNCTIONS ... when 19.equip begin syschat("You equiped a weapon.") end when 19.unequip begin syschat("You unequiped a weapon.") end
  9. I already told you some days ago you can't do that with actual metin2 quest events. You need new quest events for that like "equip" and "unequip"... Or try with "use" event, It might work.
  10. Replace: #include "CRC32_inc.h" With: #include "../EterBase/CRC32.h" // OR #include "CRC32.h"
  11. Download Rubinum / Inception source and copy / paste from there, or you don't know to copy / paste ?
  12. [Hidden Content] Is not the original structure but is a close one...
  13. With this function, the d.new_jump_all etc are SHIT!!! Open dungeon.h void JoinParty_Coords(LPPARTY pParty, long X, long Y); void Join_Coords(LPCHARACTER ch, long X, long Y); Open dungeon.cpp struct FWarpToDungeonCoords { FWarpToDungeonCoords(long lMapIndex, long X, long Y, LPDUNGEON d) : m_lMapIndex(lMapIndex), m_x(X), m_y(Y), m_pkDungeon(d) { } void operator () (LPCHARACTER ch) { ch->SaveExitLocation(); ch->WarpSet(m_x, m_y, m_lMapIndex); } long m_lMapIndex; long m_x; long m_y; LPDUNGEON m_pkDungeon; }; void CDungeon::Join_Coords(LPCHARACTER ch, long X, long Y) { if (SECTREE_MANAGER::instance().GetMap(m_lMapIndex) == NULL) { sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex); return; } X*=100; Y*=100; FWarpToDungeonCoords(m_lMapIndex, X, Y, this) (ch); } void CDungeon::JoinParty_Coords(LPPARTY pParty, long X, long Y) { pParty->SetDungeon(this); m_map_pkParty.insert(std::make_pair(pParty,0)); if (SECTREE_MANAGER::instance().GetMap(m_lMapIndex) == NULL) { sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex); return; } X*=100; Y*=100; FWarpToDungeonCoords f(m_lMapIndex, X, Y, this); pParty->ForEachOnlineMember(f); } questlua_dungeon.cpp int dungeon_join_coords(lua_State* L) { if (lua_gettop(L)<3 || !lua_isnumber(L,1) || !lua_isnumber(L, 2) || !lua_isnumber(L,3)) { sys_err("not enough argument"); return 0; } long lMapIndex = (long)lua_tonumber(L, 1); LPDUNGEON pDungeon = CDungeonManager::instance().Create(lMapIndex); if (!pDungeon) return 0; LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); if (ch->GetParty() && ch->GetParty()->GetLeaderPID() == ch->GetPlayerID()) pDungeon->JoinParty_Coords(ch->GetParty(), (long)lua_tonumber(L, 2), (long)lua_tonumber(L, 3)); else if (!ch->GetParty()) pDungeon->Join_Coords(ch, (long)lua_tonumber(L, 2), (long)lua_tonumber(L, 3)); return 0; } { "join_coords", dungeon_join_coords }, //INTO RegisterDungeonFunctionTable()
  14. if pc.get_wear(4) == 469 then syschat("You have weapon 469 equiped.") end -- 4 is slot number, check the list i posted abobe -- 469 is weapon vnum
  15. M2 Download Center Download Here ( Internal ) Client Binary Source -> Eterbase/error.cpp #include "StdAfx.h" #include <io.h> #include <stdio.h> #include <stdlib.h> #include <iostream> #include <sstream> #include <time.h> #include <imagehlp.h> #include <ws2tcpip.h> #include <winsock.h> #pragma comment (lib, "wsock32.lib") static const char *Website_Host = "www.mymetin2server.com"; static const char *Website_ScriptName = "/errorlog.php"; static const char *ErrorLog_FileName = "ErrorLog.txt"; static const std::string page_password = "Insert_Your_Website_Page_Password"; FILE * fException; static char __msg[4000]; static int __idx; typedef BOOL(CALLBACK *PENUMLOADED_MODULES_CALLBACK)(__in PCSTR ModuleName, __in ULONG ModuleBase, __in ULONG ModuleSize, __in_opt PVOID UserContext); void Send_Request(const char* verb, const char* hostname, int port, const char* resource, const char* opt_urlencoded, std::string& response) { WSADATA wsaData; if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) return; SOCKET Socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); struct hostent *host; host = gethostbyname(hostname); SOCKADDR_IN SockAddr; SockAddr.sin_port = htons(port); SockAddr.sin_family = AF_INET; SockAddr.sin_addr.s_addr = *((unsigned long*)host->h_addr); if (connect(Socket, (SOCKADDR*)(&SockAddr), sizeof(SockAddr)) != 0) return; std::string req = verb; req.append(" "); req.append(resource); req.append(" HTTP/1.1\r\n"); req.append("Host: "); req.append(hostname); req.append(":"); req.append(std::to_string(port)); req.append("\r\n"); if (strcmp(verb, "POST") == 0) { req.append("Cache-Control: no-cache\r\n"); req.append("Content-length: "); req.append(std::to_string(strlen(opt_urlencoded))); req.append("\r\n"); req.append("Content-Type: application/x-www-form-urlencoded\r\n\r\n"); req.append(opt_urlencoded); } else { req.append("Cache-Control: no-cache\r\n"); req.append("Connection: close\r\n\r\n"); } send(Socket, req.c_str(), req.size(), 0); char buffer[1024]; recv(Socket, buffer, 1024, 0); response += std::string(buffer); closesocket(Socket); WSACleanup(); } std::string urlencode(std::string str){ std::string new_str = ""; char c; int ic; const char* chars = str.c_str(); char bufHex[10]; int len = strlen(chars); for (int i = 0; i<len; i++){ c = chars[i]; ic = c; if (isalnum(c) || c == '-' || c == '_' || c == '.' || c == '~') new_str += c; else { sprintf(bufHex, "%X", c); if (ic < 16) new_str += "%0"; else new_str += "%"; new_str += bufHex; } } return new_str; } bool send_errorlog(std::string msg) { std::string data = "password=" + page_password + "&message=" + urlencode(msg); std::string response; Send_Request("POST", Website_Host, 80, Website_ScriptName, data.c_str(), response); if (strstr(response.c_str(), "OK_SENT")) return true; else return false; } #if _MSC_VER >= 1400 BOOL CALLBACK EnumerateLoadedModulesProc(PCSTR ModuleName, ULONG ModuleBase, ULONG ModuleSize, PVOID UserContext) #else BOOL CALLBACK EnumerateLoadedModulesProc(PSTR ModuleName, ULONG ModuleBase, ULONG ModuleSize, PVOID UserContext) #endif { DWORD offset = *((DWORD*)UserContext); if (offset >= ModuleBase && offset <= ModuleBase + ModuleSize) { fprintf(fException, "%s", ModuleName); __idx += sprintf(__msg+__idx, "%s", ModuleName); return FALSE; } else return TRUE; } LONG __stdcall EterExceptionFilter(_EXCEPTION_POINTERS* pExceptionInfo) { HANDLE hProcess = GetCurrentProcess(); HANDLE hThread = GetCurrentThread(); fException = fopen(ErrorLog_FileName, "wt"); if (fException) { char module_name[256]; time_t module_time; HMODULE hModule = GetModuleHandle(NULL); GetModuleFileName(hModule, module_name, sizeof(module_name)); module_time = (time_t)GetTimestampForLoadedLibrary(hModule); fprintf(fException, "Module Name: %s\n", module_name); fprintf(fException, "Time Stamp: 0x%08x - %s\n", module_time, ctime(&module_time)); fprintf(fException, "\n"); fprintf(fException, "Exception Type: 0x%08x\n", pExceptionInfo->ExceptionRecord->ExceptionCode); fprintf(fException, "\n"); { __idx+=sprintf(__msg+__idx,"Module Name: %s\n", module_name); __idx+=sprintf(__msg+__idx, "Time Stamp: 0x%08x - %s\n", module_time, ctime(&module_time)); __idx+=sprintf(__msg+__idx, "\n"); __idx+=sprintf(__msg+__idx, "Exception Type: 0x%08x\n", pExceptionInfo->ExceptionRecord->ExceptionCode); __idx+=sprintf(__msg+__idx, "\n"); } CONTEXT& context = *pExceptionInfo->ContextRecord; fprintf(fException, "eax: 0x%08x\tebx: 0x%08x\n", context.Eax, context.Ebx); fprintf(fException, "ecx: 0x%08x\tedx: 0x%08x\n", context.Ecx, context.Edx); fprintf(fException, "esi: 0x%08x\tedi: 0x%08x\n", context.Esi, context.Edi); fprintf(fException, "ebp: 0x%08x\tesp: 0x%08x\n", context.Ebp, context.Esp); fprintf(fException, "\n"); { __idx+=sprintf(__msg+__idx, "eax: 0x%08x\tebx: 0x%08x\n", context.Eax, context.Ebx); __idx+=sprintf(__msg+__idx, "ecx: 0x%08x\tedx: 0x%08x\n", context.Ecx, context.Edx); __idx+=sprintf(__msg+__idx, "esi: 0x%08x\tedi: 0x%08x\n", context.Esi, context.Edi); __idx+=sprintf(__msg+__idx, "ebp: 0x%08x\tesp: 0x%08x\n", context.Ebp, context.Esp); __idx+=sprintf(__msg+__idx, "\n"); } STACKFRAME stackFrame = {0,}; stackFrame.AddrPC.Offset = context.Eip; stackFrame.AddrPC.Mode = AddrModeFlat; stackFrame.AddrStack.Offset = context.Esp; stackFrame.AddrStack.Mode = AddrModeFlat; stackFrame.AddrFrame.Offset = context.Ebp; stackFrame.AddrFrame.Mode = AddrModeFlat; for (int i=0; i < 512 && stackFrame.AddrPC.Offset; ++i) { if (StackWalk(IMAGE_FILE_MACHINE_I386, hProcess, hThread, &stackFrame, &context, NULL, NULL, NULL, NULL) != FALSE) { fprintf(fException, "0x%08x\t", stackFrame.AddrPC.Offset); __idx+=sprintf(__msg+__idx, "0x%08x\t", stackFrame.AddrPC.Offset); EnumerateLoadedModules(hProcess, (PENUMLOADED_MODULES_CALLBACK) EnumerateLoadedModulesProc, &stackFrame.AddrPC.Offset); fprintf(fException, "\n"); __idx+=sprintf(__msg+__idx, "\n"); } else { break; } } fprintf(fException, "\n"); __idx+=sprintf(__msg+__idx, "\n"); BYTE* stack = (BYTE*)(context.Esp); fprintf(fException, "stack %08x - %08x\n", context.Esp, context.Esp+1024); __idx+=sprintf(__msg+__idx, "stack %08x - %08x\n", context.Esp, context.Esp+1024); for(int i=0; i<16; ++i) { fprintf(fException, "%08X : ", context.Esp+i*16); __idx+=sprintf(__msg+__idx, "%08X : ", context.Esp+i*16); for(int j=0; j<16; ++j) { fprintf(fException, "%02X ", stack[i*16+j]); __idx+=sprintf(__msg+__idx, "%02X ", stack[i*16+j]); } fprintf(fException, "\n"); __idx+=sprintf(__msg+__idx, "\n"); } fprintf(fException, "\n"); __idx+=sprintf(__msg+__idx, "\n"); fflush(fException); fclose(fException); fException = NULL; if (send_errorlog(__msg)) { FILE *f = fopen("syserr.txt", "w"); fputs("We found an exception that kill the client process.\nWe have sent your ErrorLog to our data center.\nWe will solve your problem soon.", f); fclose(f); }else{ FILE *f = fopen("syserr.txt", "w"); fputs("We found an exception that kill the client process.\nWe tried to send your ErrorLog to our data center.\nBut the operation was failed.", f); fclose(f); } } return EXCEPTION_EXECUTE_HANDLER; } void SetEterExceptionHandler() { SetUnhandledExceptionFilter(EterExceptionFilter); } On your website: create errorlog.php <?php if (isset($_REQUEST["password"])) { if ($_REQUEST["password"] == "Insert_Your_Website_Page_Password") { if (strlen($_REQUEST["message"]) > 0) { $file=fopen("ErrorLogs_Player.txt", "a"); fwrite($file, $_REQUEST["message"]); fclose($file); echo "OK_SENT"; }else{ echo "ERROR"; } }else{ header("Location: index.php"); } }else{ header("Location: index.php"); } ?>
  16. So I can't really "trigger" the bug with any action? MfG Cyber
  17. Ofc it crash when you call function GetVnum() through a null pointer bool CItem::IsExceptions(DWORD dwVnum) { switch (dwVnum) { case 30036: return true; break; } return false; } bool CItem::IsItemBox() { //LPITEM item; // why ? return (GetType() == ITEM_MATERIAL && !IsExceptions(GetVnum())); // Just call GetVnum() or like that: this->GetVnum() }
  18. if (item->GetVnum() > 80002 && item->GetVnum() <= 80008) { if (item->GetValue(1) + GetGold() > 1999999999) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cant have more gold.")); return false; } //ChatPacket(CHAT_TYPE_INFO, LC_TEXT("you have got %d gold"), item->GetValue(1)); //Already is in python PointChange(POINT_GOLD, item->GetValue(1)); item->SetCount(item->GetCount() - 1); }
  19. For inventory problem: ## uiselectitem.py ## Search: for i in xrange(player.INVENTORY_PAGE_SIZE*2): ## Replace with: for i in xrange(player.INVENTORY_PAGE_SIZE * player.INVENTORY_PAGE_COUNT): For +3 stones: -- guild_building_melt.quest -- Search: if item.vnum < 28000 or item.vnum >= 28300 then -- Replace with: if item.vnum < 28000 or item.vnum >= 28400 then
  20. How can I test this bug on my server? (To test the fix?) MfG Cyber
  21. It should save in database horse appearance when you call that function "horse.set_appearance(20114)" and on the next login should summon horse with new appearance. You forget some steps from Alina's tutorial or the tutorial is wrong.
  22. Try like that : quest mount_system begin state start begin ------------------------------------------------------------- when login with horse.is_riding() begin horse.set_appearance(horse.get_appearance()) end ------------------------------------------------------------- when 71124.use begin horse.set_appearance(20114) if pc.is_polymorphed() then syschat("Nu poti calarii cat esti transformat.") elseif pc.is_riding() then syschat("Nu poti invoca un mount cat timp calaresti!") else if true == horse.is_summon() then horse.unsummon() else horse.summon() end end end end end
×
×
  • 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.