monarchis2 13 Posted January 21, 2016 Share Posted January 21, 2016 I have vanilla core, and mounts can't attack. In pvp.cpp has nothing like case MOUNT_ID etc.. what can i do? Link to comment Share on other sites More sharing options...
Active Member enzi 842 Posted January 21, 2016 Active Member Share Posted January 21, 2016 Do you try this TuT ? https://metin2dev.org/board/index.php?/topic/2045-c-add-new-mounts-to-attack-and-damage/ Link to comment Share on other sites More sharing options...
monarchis2 13 Posted January 21, 2016 Author Share Posted January 21, 2016 In vanilla pvp.cpp is different.. I have nothing like this Link to comment Share on other sites More sharing options...
Former Staff Shisui 490 Posted January 21, 2016 Former Staff Share Posted January 21, 2016 bool CPVPManager::CanAttack(LPCHARACTER pkChr, LPCHARACTER pkVictim) Spoiler bool CPVPManager::CanAttack(LPCHARACTER pkChr, LPCHARACTER pkVictim) { switch (pkVictim->GetCharType()) { case CHAR_TYPE_NPC: case CHAR_TYPE_WARP: case CHAR_TYPE_GOTO: return false; } if (pkChr == pkVictim) // ³»°¡ ³¯ Ä¥¶ó°í ÇÏ³× -_- return false; if (pkVictim->IsNPC() && pkChr->IsNPC() && !pkChr->IsGuardNPC()) return false; if( true == pkChr->IsHorseRiding() ) { if( pkChr->GetHorseLevel() > 0 && 1 == pkChr->GetHorseGrade() ) return false; } else { switch( pkChr->GetMountVnum() ) { case 0: case 20030: case 20110: case 20111: case 20112: case 20113: case 20114: case 20115: case 20116: case 20117: case 20118: //½Å±Ô Å»°Í °í±Þ case 20205: case 20206: case 20207: case 20208: case 20209: case 20210: case 20211: case 20212: case 20119: // ¶ó¸¶´Ü È渶 case 20219: // ¶ó¸¶´Ü È渶 Ŭ·Ð (ÇÒ·ÎÀ©¿ë) case 20220: // Å©¸®½º¸¶½º Å»°Í case 20221: // Àü°© ¹é¿õ case 20222: // Àü°© ÆÒ´õ case 20120: case 20121: case 20122: case 20123: case 20124: case 20125: case 20214: // ³ÆøÇÑ Àü°©¼ø¼ø·Ï case 20215: // ¿ë¸ÍÇÑ Àü°©¼ø¼ø·Ï case 20217: // ³ÆøÇÑ Àü°©¾Ï¼ø·Ï case 20218: // ¿ë¸ÍÇÑ Àü°©¾Ï¼ø·Ï case 20224: // ³ÆøÇÑ Àü°©¼®·æÀÚ case 20225: // ¿ë¸ÍÇÑ Àü°©¼®·æÀÚ case 20226: // À¯´ÏÄÜ case 20227: case 20231: case 20232: break; default: return false; } } if (pkVictim->IsNPC() || pkChr->IsNPC()) { return true; } if (pkVictim->IsObserverMode() || pkChr->IsObserverMode()) return false; { BYTE bMapEmpire = SECTREE_MANAGER::instance().GetEmpireFromMapIndex(pkChr->GetMapIndex()); if ( (pkChr->GetPKMode() == PK_MODE_PROTECT) && (pkChr->GetEmpire() == bMapEmpire) || (pkVictim->GetPKMode() == PK_MODE_PROTECT) && (pkVictim->GetEmpire() == bMapEmpire) ) { return false; } } if (pkChr->GetEmpire() != pkVictim->GetEmpire()) { if ( LC_IsYMIR() == true || LC_IsKorea() == true ) { if ( pkChr->GetPKMode() == PK_MODE_PROTECT || pkVictim->GetPKMode() == PK_MODE_PROTECT ) { return false; } } return true; } bool beKillerMode = false; if (pkVictim->GetParty() && pkVictim->GetParty() == pkChr->GetParty()) { return false; // Cannot attack same party on any pvp model } else { if (pkVictim->IsKillerMode()) { return true; } if (pkChr->GetAlignment() < 0 && pkVictim->GetAlignment() >= 0) { if (g_protectNormalPlayer) { // ¹ü¹ýÀÚ´Â ÆòȸðµåÀÎ ÂøÇÑ»ç¶÷À» °ø°ÝÇÒ ¼ö ¾ø´Ù. if (PK_MODE_PEACE == pkVictim->GetPKMode()) return false; } } switch (pkChr->GetPKMode()) { case PK_MODE_PEACE: case PK_MODE_REVENGE: // Cannot attack same guild if (pkVictim->GetGuild() && pkVictim->GetGuild() == pkChr->GetGuild()) break; if (pkChr->GetPKMode() == PK_MODE_REVENGE) { //if (!g_iUseLocale) if (1) { if (pkChr->GetAlignment() < 0 && pkVictim->GetAlignment() >= 0) { pkChr->SetKillerMode(true); return true; } else if (pkChr->GetAlignment() >= 0 && pkVictim->GetAlignment() < 0) return true; } else { if (pkChr->GetAlignment() < 0 && pkVictim->GetAlignment() < 0) break; else if (pkChr->GetAlignment() >= 0 && pkVictim->GetAlignment() >= 0) break; beKillerMode = true; } } break; case PK_MODE_GUILD: // Same implementation from PK_MODE_FREE except for attacking same guild if (!pkChr->GetGuild() || (pkVictim->GetGuild() != pkChr->GetGuild())) { if (1) //if (!g_iUseLocale) { if (pkVictim->GetAlignment() >= 0) pkChr->SetKillerMode(true); else if (pkChr->GetAlignment() < 0 && pkVictim->GetAlignment() < 0) pkChr->SetKillerMode(true); return true; } else beKillerMode = true; } break; case PK_MODE_FREE: //if (!g_iUseLocale) if (1) { if (pkVictim->GetAlignment() >= 0) pkChr->SetKillerMode(true); else if (pkChr->GetAlignment() < 0 && pkVictim->GetAlignment() < 0) pkChr->SetKillerMode(true); return true; } else beKillerMode = true; break; } } CPVP kPVP(pkChr->GetPlayerID(), pkVictim->GetPlayerID()); CPVP * pkPVP = Find(kPVP.m_dwCRC); if (!pkPVP || !pkPVP->IsFight()) { if (beKillerMode) pkChr->SetKillerMode(true); return (beKillerMode); } pkPVP->SetLastFightTime(); return true; } Link to comment Share on other sites More sharing options...
monarchis2 13 Posted January 21, 2016 Author Share Posted January 21, 2016 (edited) Spoiler bool CPVPManager::CanAttack(LPCHARACTER pkChr, LPCHARACTER pkVictim) { switch (pkVictim->GetCharType()) { case CHAR_TYPE_NPC: case CHAR_TYPE_WARP: case CHAR_TYPE_GOTO: return false; } if (pkChr == pkVictim) // 내가 날 칠라고 하네 return false; if (pkVictim->IsNPC() && pkChr->IsNPC() && !pkChr->IsGuardNPC()) return false; if( true == pkChr->IsHorseRiding() ) { if( pkChr->GetHorseLevel() > 0 && 1 == pkChr->GetHorseGrade() ) return false; } if (pkVictim->IsNPC() || pkChr->IsNPC()) { return true; } if (pkVictim->IsObserverMode() || pkChr->IsObserverMode()) return false; { BYTE bMapEmpire = SECTREE_MANAGER::instance().GetEmpireFromMapIndex(pkChr->GetMapIndex()); if ( (pkChr->GetPKMode() == PK_MODE_PROTECT && pkChr->GetEmpire() == bMapEmpire) || (pkVictim->GetPKMode() == PK_MODE_PROTECT && pkVictim->GetEmpire() == bMapEmpire) ) { return false; } } if (pkChr->GetEmpire() != pkVictim->GetEmpire()) { if ( LC_IsYMIR() == true || LC_IsKorea() == true ) { if ( pkChr->GetPKMode() == PK_MODE_PROTECT || pkVictim->GetPKMode() == PK_MODE_PROTECT ) { return false; } } return true; } bool beKillerMode = false; if (pkVictim->GetParty() && pkVictim->GetParty() == pkChr->GetParty()) { return false; // Cannot attack same party on any pvp model } else { if (pkVictim->IsKillerMode()) { return true; } if (pkChr->GetAlignment() < 0 && pkVictim->GetAlignment() >= 0) { if (g_protectNormalPlayer) { // 범법자는 평화모드인 착한사람을 공격할 수 없다. if (PK_MODE_PEACE == pkVictim->GetPKMode()) return false; } } switch (pkChr->GetPKMode()) { case PK_MODE_PEACE: case PK_MODE_REVENGE: // Cannot attack same guild if (pkVictim->GetGuild() && pkVictim->GetGuild() == pkChr->GetGuild()) break; if (pkChr->GetPKMode() == PK_MODE_REVENGE) { //if (!g_iUseLocale) if (1) { if (pkChr->GetAlignment() < 0 && pkVictim->GetAlignment() >= 0) { pkChr->SetKillerMode(true); return true; } else if (pkChr->GetAlignment() >= 0 && pkVictim->GetAlignment() < 0) return true; } else { if (pkChr->GetAlignment() < 0 && pkVictim->GetAlignment() < 0) break; else if (pkChr->GetAlignment() >= 0 && pkVictim->GetAlignment() >= 0) break; beKillerMode = true; } } break; case PK_MODE_GUILD: // Same implementation from PK_MODE_FREE except for attacking same guild if (!pkChr->GetGuild() || (pkVictim->GetGuild() != pkChr->GetGuild())) { if (1) //if (!g_iUseLocale) { if (pkVictim->GetAlignment() >= 0) pkChr->SetKillerMode(true); else if (pkChr->GetAlignment() < 0 && pkVictim->GetAlignment() < 0) pkChr->SetKillerMode(true); return true; } else beKillerMode = true; } break; case PK_MODE_FREE: //if (!g_iUseLocale) if (1) { if (pkVictim->GetAlignment() >= 0) pkChr->SetKillerMode(true); else if (pkChr->GetAlignment() < 0 && pkVictim->GetAlignment() < 0) pkChr->SetKillerMode(true); return true; } else beKillerMode = true; break; } } CPVP kPVP(pkChr->GetPlayerID(), pkVictim->GetPlayerID()); CPVP * pkPVP = Find(kPVP.m_dwCRC); if (!pkPVP || !pkPVP->IsFight()) { if (beKillerMode) pkChr->SetKillerMode(true); return (beKillerMode); } pkPVP->SetLastFightTime(); return true; } Edited January 21, 2016 by Shisui Spoiler Tag Link to comment Share on other sites More sharing options...
Former Staff Shisui 490 Posted January 21, 2016 Former Staff Share Posted January 21, 2016 Use spoiler tag. Replace the whole function with the one i've posted. Link to comment Share on other sites More sharing options...
monarchis2 13 Posted January 21, 2016 Author Share Posted January 21, 2016 I did it, but the problem is in client i think.... I can't find vanilla client source anywhere... Link to comment Share on other sites More sharing options...
michele2ersa 1 Posted January 21, 2016 Share Posted January 21, 2016 Use novaline src for client. Link to comment Share on other sites More sharing options...
monarchis2 13 Posted January 22, 2016 Author Share Posted January 22, 2016 Uh... i'll try it but i don't think it will make a diferrence Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now