-
Posts
220 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Everything posted by DrTurk
-
You have to code it
-
Real random number Generator using c++ library
DrTurk replied to TheDragster's topic in Programming & Scripts
its not used, maybe they changed that after the source got leaked -
void CHARACTER::PointChange SetHP(GetHP() + amount); val = GetHP(); BroadcastTargetPacket(); to SetHP(GetHP() + amount); val = GetHP(); if (GetHP() < 0) { SetHP(0); val = 0; } BroadcastTargetPacket();
-
Highlights New Item Refresh Animation
DrTurk replied to kaJaMrSimple's topic in Community Support - Questions & Answers
normal in marty files, you could debug it via visual studio. this bug doesnt appear in base leaked source -
in germany they dont warn you, they knock on your door and take all your stuff
-
its better to run the server with visual studio, better for debugging.
-
Host Metin2 Servers in a legal way
DrTurk replied to Arvydas's topic in Community Support - Questions & Answers
there is no legal way -
no/wrong folder in the mob_proto wrong data folder for the mount no accumulation in the msa
-
I just want to block it when your not the owner of the item, only hovering on the item will be very hard when the shoutbox is really active, but thanks anyway
-
Does someone know how to block copying posted hyperlinks from items?
-
With your changes -> 430MB Without your changes -> 775MB thats impressiv
-
[Collector's topic] Remove Unussed code
DrTurk replied to SamuraiHUN's topic in Programming & Scripts
You can remove alot of dead code, i removed all of it years ago. It takes time -
If you talking about that -> char g_nation_name[4][32] = { "", "½Å¼ö±¹", "õÁ¶±¹", "Áø³ë±¹", }; I removed castle/monarch etc. on my source so i didnt had to translate that, but the same is for priv_empire function. I send Sonitex my way how i have done this, but i think its better i keep that for me. I dont have alot knowledge about coding, so I dont really know if it works with alot of players. My way is a very dirty solution for the problem
-
ye better, the thing that i did was without checking if the string is empty also created something for whisper because of duel: pkVictim->LocaleWhisperPacket(WHISPER_TYPE_SYSTEM , pkChr, 503, "%s challenged you to a battle!", pkChr->GetName()); but the ugliest part that i did was for the priv_empire, no one wants to see what i did there
-
Ye didnt fix this yet, i'll fix that as soon as i have time for that. ok just edit this in client src: bool CPythonNetworkStream::RecvLocaleChatPacket() { TPacketGCLocaleChat kChat; if (!Recv(sizeof(kChat), &kChat)) return false; std::string localeString = ""; bool bSuccess = LocaleStringManager::Instance().FillLocaleString(kChat.format, localeString); if (!bSuccess) return false; if (CHAT_TYPE_NOTICE == kChat.type) { PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_SetTipMessage", Py_BuildValue("(s)", localeString.c_str())); } else if (CHAT_TYPE_BIG_NOTICE == kChat.type) { PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_SetBigMessage", Py_BuildValue("(s)", localeString.c_str())); } if (!localeString.empty()) CPythonChat::Instance().AppendChat(kChat.type, localeString.c_str()); return true; }
-
Just create another function like that: void SendNoticeMapLocal(DWORD dwIndex, const char* c_pszBuf, int nMapIndex, bool bBigFont, ...) { BYTE type = 0; const DESC_MANAGER::DESC_SET& c_ref_set = DESC_MANAGER::instance().GetClientSet(); if (!c_pszBuf) return; DESC_MANAGER::DESC_SET::const_iterator it = c_ref_set.begin(); while (it != c_ref_set.end()) { LPDESC d = *(it++); if (d->GetCharacter()) { if (d->GetCharacter()->GetMapIndex() != nMapIndex) continue; bool isNotice = false; if (c_pszBuf == "%s") { char chatbuf[CHAT_MAX_LEN + 1]; va_list args; va_start(args, c_pszBuf); vsnprintf(chatbuf, sizeof(chatbuf), c_pszBuf, args); va_end(args); strlcpy(chatbuf, c_pszBuf, sizeof(chatbuf)); isNotice = true; } TEMP_BUFFER buf; if (bBigFont == true) { type = CHAT_TYPE_BIG_NOTICE; } else { type = CHAT_TYPE_NOTICE; } TPacketGCLocaleChat packet; packet.header = HEADER_GC_LOCALE_CHAT; packet.size = sizeof(TPacketGCLocaleChat); packet.type = type; packet.format = dwIndex; va_list args; va_start(args, bBigFont); FindFormatSpecifiers(c_pszBuf, args, &packet.size, &buf); va_end(args); d->Packet(&packet, sizeof(packet)); if (buf.size()) d->Packet(buf.read_peek(), buf.size()); } } } then you can use it like that: void WeddingMap::SetEnded(DWORD dwMapIndex) { if (m_pEndEvent) { sys_err("WeddingMap::SetEnded - ALREADY EndEvent(m_pEndEvent=%x)", get_pointer(m_pEndEvent)); return; } wedding_map_info* info = AllocEventInfo<wedding_map_info>(); info->pWeddingMap = this; m_pEndEvent = event_create(wedding_end_event, info, PASSES_PER_SEC(5)); SendNoticeMapLocal(889, " ", dwMapIndex, true); SendNoticeMapLocal(447, " ", dwMapIndex, true);
-
[Collector's topic] Remove Unussed code
DrTurk replied to SamuraiHUN's topic in Programming & Scripts
better use spoilers for each removed system -
tested on windows with only map1 blue -> with changed functions: 100,6MB without changed functions: 114MB nice release, thanks
-
Question about delay of death
DrTurk replied to Klaus's topic in Community Support - Questions & Answers
as i said i had this problem even before i modifyed the dead function, but only when you one shot someone with a poison skill. i can redo my dead function modify and it will also bug when killed with one shot which has 100% poison rate -
Question about delay of death
DrTurk replied to Klaus's topic in Community Support - Questions & Answers
Isnt that a normal m2 problem with bleed/poison/fire when you one shot someone with it? I fixxed this before i did this change. Just add if (ch->IsDead()) { ch->RemovePoison(); } like that: EVENTFUNC(poison_event) { TPoisonEventInfo * info = dynamic_cast<TPoisonEventInfo *>( event->info ); if ( info == NULL ) { sys_err( "poison_event> <Factor> Null pointer" ); return 0; } LPCHARACTER ch = info->ch; if (ch == NULL) { return 0; } LPCHARACTER pkAttacker = CHARACTER_MANAGER::instance().FindByPID(info->attacker_pid); if (ch->IsDead()) { ch->RemovePoison(); } int dam = ch->GetMaxHP() * GetPoisonDamageRate(ch) / 1000; if (test_server) ch->ChatPacket(CHAT_TYPE_NOTICE, "Poison Damage %d", dam); if (ch->Damage(pkAttacker, dam, DAMAGE_TYPE_POISON)) { ch->m_pkPoisonEvent = NULL; return 0; } --info->count; if (info->count) return PASSES_PER_SEC(3); else { ch->m_pkPoisonEvent = NULL; return 0; } } same thing with fire: EVENTFUNC(fire_event) { TFireEventInfo * info = dynamic_cast<TFireEventInfo *>( event->info ); if ( info == NULL ) { sys_err( "fire_event> <Factor> Null pointer" ); return 0; } LPCHARACTER ch = info->ch; if (ch == NULL) { return 0; } LPCHARACTER pkAttacker = CHARACTER_MANAGER::instance().FindByPID(info->attacker_pid); if (ch->IsDead()) { ch->RemoveFire(); } int dam = info->amount; if (test_server) ch->ChatPacket(CHAT_TYPE_NOTICE, "Fire Damage %d", dam); if (ch->Damage(pkAttacker, dam, DAMAGE_TYPE_FIRE)) { ch->m_pkFireEvent = NULL; return 0; } --info->count; if (info->count) return PASSES_PER_SEC(3); else { ch->m_pkFireEvent = NULL; return 0; } } -
Question about delay of death
DrTurk replied to Klaus's topic in Community Support - Questions & Answers
Had two servers with that change, didnt experienced any bugs -
Question about delay of death
DrTurk replied to Klaus's topic in Community Support - Questions & Answers
char.cpp --> remove that: m_dwKillerPID = 0; char.h --> remove that: DWORD m_dwKillerPID; char_battle.cpp --> remove/change that: if (!pkKiller && m_dwKillerPID) pkKiller = CHARACTER_MANAGER::instance().FindByPID(m_dwKillerPID); m_dwKillerPID = 0; change that: if (GetHP() <= 0) { Stun(); if (pAttacker && !pAttacker->IsNPC()) m_dwKillerPID = pAttacker->GetPlayerID(); else m_dwKillerPID = 0; } to this: if (GetHP() <= 0) { Dead(pAttacker); } -
problem with _IMPROVED_PACKET_ENCRYPTION_
DrTurk replied to ahmedhaies's topic in Community Support - Questions & Answers
Change this: if (iSizeBuffer > 0) { TEMP_BUFFER tempbuf; LPBUFFER lpBufferDecrypt = tempbuf.getptr(); buffer_adjust_size(lpBufferDecrypt, iSizeBuffer); int iSizeAfter = TEA_Decrypt((DWORD*)buffer_write_peek(lpBufferDecrypt), (DWORD*)buffer_read_peek(m_lpInputBuffer), GetDecryptionKey(), to this: if (iSizeBuffer > 0) { LPBUFFER lpBufferDecrypt = buffer_new(iSizeBuffer); int iSizeAfter = TEA_Decrypt((DWORD*)buffer_write_peek(lpBufferDecrypt), (DWORD*)buffer_read_peek(m_lpInputBuffer), GetDecryptionKey(), iSizeBuffer);