Lazy 14 Posted April 13, 2014 Share Posted April 13, 2014 Hey. Long time ago I did fix on the StunBug, but just now I decided to share this. So... Open the file item.cpp and go to functions: EquipTo & Unequip.Find this: DWORD dwImmuneFlag = 0; for (int i = 0; i < WEAR_MAX_NUM; ++i) if (m_pOwner->GetWear(i)) SET_BIT(dwImmuneFlag, m_pOwner->GetWear(i)->m_pProto->dwImmuneFlag); m_pOwner->SetImmuneFlag(dwImmuneFlag); Replace with: DWORD dwImmuneFlag = 0; for (int i = 0 ; i < WEAR_MAX_NUM; i++) { LPITEM pItem = m_pOwner->GetWear(i); if (pItem) { SET_BIT(dwImmuneFlag, m_pOwner->GetWear(i)->GetImmuneFlag()); } } Ayo! 8 Link to comment Share on other sites More sharing options...
Evor 72 Posted April 13, 2014 Share Posted April 13, 2014 Well. You removed only m_pOwner->SetImmuneFlag(dwImmuneFlag); Why? Stun bug is caused by the certain chance of apply. (80% i think) Regards. Link to comment Share on other sites More sharing options...
Premium Shogun 4587 Posted April 13, 2014 Premium Share Posted April 13, 2014 Well. You removed only m_pOwner->SetImmuneFlag(dwImmuneFlag); Why? Stun bug is caused by the certain chance of apply. (80% i think) Regards. If the last item you equipped is not the shield, inmune doesn't work at all, that's the bug since the creation of Metin. Link to comment Share on other sites More sharing options...
Evor 72 Posted April 13, 2014 Share Posted April 13, 2014 Oh okey. Didn't know. Wysłane z Sony XPERIA Z Link to comment Share on other sites More sharing options...
Lazy 14 Posted April 13, 2014 Author Share Posted April 13, 2014 Well. You removed only m_pOwner->SetImmuneFlag(dwImmuneFlag); Why? Stun bug is caused by the certain chance of apply. (80% i think) Regards. If you equiped e.g. armor and this item haven't any immunes then immunes set to 0, it's delete all immunes. Now doesn't delete immunes just added immunes contained in item. Link to comment Share on other sites More sharing options...
Evor 72 Posted April 13, 2014 Share Posted April 13, 2014 Thanks. I wasn't sure about it. Nevertheless good job. Wysłane z Sony XPERIA Z Link to comment Share on other sites More sharing options...
Lazy 14 Posted April 13, 2014 Author Share Posted April 13, 2014 Thanks. Link to comment Share on other sites More sharing options...
Rumor 2604 Posted April 13, 2014 Share Posted April 13, 2014 does metin2 really have such a poor developer that it took a regular person to fix this bug after all this time 4 Link to comment Share on other sites More sharing options...
Evor 72 Posted April 13, 2014 Share Posted April 13, 2014 I suppose that real developers wrote a whole game once and they had never developed it after, so ymir has to employ new developers who weren't as good as firsts Link to comment Share on other sites More sharing options...
Lazy 14 Posted April 13, 2014 Author Share Posted April 13, 2014 I suppose that it's a simple mistake. Link to comment Share on other sites More sharing options...
DasSchwarzeT 111 Posted April 13, 2014 Share Posted April 13, 2014 I suppose that it's a simple mistake. on german version of Metin2 they don't call it a bug. They call that there is only a chance to block faint.. So I think they just didn't want to change it Best regards Link to comment Share on other sites More sharing options...
Coveto 5 Posted April 29, 2014 Share Posted April 29, 2014 Actually, the chance you are talking about is in char_resist.cpp. Stun resistance has just 90% of success. This is not a bug, but if you want Stun fixed 100%, you'd also change this: bool CHARACTER::IsImmune(DWORD dwImmuneFlag) { if (IS_SET(m_pointsInstant.dwImmuneFlag, dwImmuneFlag)) { int immune_pct = 90; int percent = number(1, 100); if (percent <= immune_pct) // 90% Immune { if (test_server && IsPC()) ChatPacket(CHAT_TYPE_PARTY, "<IMMUNE_SUCCESS> (%s)", GetName()); return true; } else { if (test_server && IsPC()) ChatPacket(CHAT_TYPE_PARTY, "<IMMUNE_FAIL> (%s)", GetName()); return false; } } if (test_server && IsPC()) ChatPacket(CHAT_TYPE_PARTY, "<IMMUNE_FAIL> (%s) NO_IMMUNE_FLAG", GetName()); return false; } to this: bool CHARACTER::IsImmune(DWORD dwImmuneFlag) { if (IS_SET(m_pointsInstant.dwImmuneFlag, dwImmuneFlag)) { if (test_server && IsPC()) ChatPacket(CHAT_TYPE_PARTY, "<IMMUNE_SUCCESS> (%s)", GetName()); return true; } if (test_server && IsPC()) ChatPacket(CHAT_TYPE_PARTY, "<IMMUNE_FAIL> (%s) NO_IMMUNE_FLAG", GetName()); return false; } 3 Link to comment Share on other sites More sharing options...
Premium Shogun 4587 Posted April 30, 2014 Premium Share Posted April 30, 2014 I suppose that real developers wrote a whole game once and they had never developed it after, so ymir has to employ new developers who weren't as good as firsts This. The original team that created the game left Ymir many years ago. 1 Link to comment Share on other sites More sharing options...
Think 117 Posted July 4, 2014 Share Posted July 4, 2014 By removing m_pOwner->SetImmuneFlag(dwImmuneFlag); You are just removing the flag setting. i.e, no immune bug, because there won't be any immunes anymore! The rest of the code is therefore useless because you just change a locally scoped variable which you don't use. Link to comment Share on other sites More sharing options...
Active Member ATAG 310 Posted July 4, 2014 Active Member Share Posted July 4, 2014 SetImmuneFlag called in other functions too. This code causes that the last immune has no effect. For example: if you have stun and slow immune in a shield, only stun will work, slow won't... Link to comment Share on other sites More sharing options...
Think 117 Posted July 4, 2014 Share Posted July 4, 2014 SetImmuneFlag called in other functions too. This code causes that the last immune has no effect. For example: if you have stun and slow immune in a shield, only stun will work, slow won't... Which functions? I only see it in the monster-only section "SetProto". Link to comment Share on other sites More sharing options...
CrazyBear 2 Posted July 5, 2014 Share Posted July 5, 2014 Hey, Any diff for this ? Link to comment Share on other sites More sharing options...
Active Member ATAG 310 Posted July 6, 2014 Active Member Share Posted July 6, 2014 Ok, finally i've solved the problem (i think). i've added some lines to cmd_gm.cpp, so /state proint the immune flags too (just for checking): Look for ACMD(do_state) then add: ch->ChatPacket(CHAT_TYPE_INFO, "IMMUNE:"); ch->ChatPacket(CHAT_TYPE_INFO, " STUN:%d SLOW:%d FALL:%d", tch->GetPoint(POINT_IMMUNE_STUN), tch->GetPoint(POINT_IMMUNE_SLOW), tch->GetPoint(POINT_IMMUNE_FALL)); Looks like this: ch->ChatPacket(CHAT_TYPE_INFO, " ICE:%3d%% EARTH:%3d%% DARK:%3d%%", tch->GetPoint(POINT_RESIST_ICE), tch->GetPoint(POINT_RESIST_EARTH), tch->GetPoint(POINT_RESIST_DARK)); ch->ChatPacket(CHAT_TYPE_INFO, "IMMUNE:"); ch->ChatPacket(CHAT_TYPE_INFO, " STUN:%d SLOW:%d FALL:%d", tch->GetPoint(POINT_IMMUNE_STUN), tch->GetPoint(POINT_IMMUNE_SLOW), tch->GetPoint(POINT_IMMUNE_FALL)); ch->ChatPacket(CHAT_TYPE_INFO, "MALL:"); ch->ChatPacket(CHAT_TYPE_INFO, " ATT:%3d%% DEF:%3d%% EXP:%3d%% ITEMx%d GOLDx%d", In item.cpp it's not a big change, but it seems working for me: (In functions bool CItem::EquipTo and bool CItem::Unequip) for (int i = 0; i < WEAR_MAX_NUM; ++i) { if (m_pOwner->GetWear(i)) { SET_BIT(dwImmuneFlag, m_pOwner->GetWear(i)->GetImmuneFlag()); } } m_pOwner->SetImmuneFlag(dwImmuneFlag); Link to comment Share on other sites More sharing options...
Recommended Posts