[Admin] tierrilopes Posted October 26, 2017 at 08:26 PM Share Posted October 26, 2017 at 08:26 PM NOTE: The following must be done twice because theres two occurrences of each "Look for" inside of the CHARACTER::Damage. Go to file char_battle.cpp Inside: bool CHARACTER::Damage (LPCHARACTER pAttacker, int dam, EDamageType type) Look for: IsCritical = true; dam *= 2; EffectPacket (SE_CRITICAL); if (IsAffectFlag (AFF_MANASHIELD)) { RemoveAffect (AFF_MANASHIELD); } Replace with: LPCHARACTER ch = quest::CQuestManager::instance().GetCurrentCharacterPtr(); if (CPVPManager::Instance().IsFighting (ch)) { IsCritical = false; ChatPacket (CHAT_TYPE_INFO, "[Debug] A critical hit has been denied."); //You can remove this, is here for debug purposes to see if was working } else { IsCritical = true; dam *= 2; EffectPacket (SE_CRITICAL); if (IsAffectFlag (AFF_MANASHIELD)) { RemoveAffect (AFF_MANASHIELD); } } Look for: IsPenetrate = true; if (test_server) { ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("°üÅë Ãß°¡ µ¥¹ÌÁö %d"), GetPoint (POINT_DEF_GRADE) * (100 + GetPoint (POINT_DEF_BONUS)) / 100); } dam += GetPoint (POINT_DEF_GRADE) * (100 + GetPoint (POINT_DEF_BONUS)) / 100; if (IsAffectFlag (AFF_MANASHIELD)) { RemoveAffect (AFF_MANASHIELD); } Replace with: LPCHARACTER ch = quest::CQuestManager::instance().GetCurrentCharacterPtr(); if (CPVPManager::Instance().IsFighting (ch)) { IsPenetrate = false; ChatPacket (CHAT_TYPE_INFO, "[Debug] A penetration hit has been denied."); //You can remove this, is here for debug purposes to see if was working } else { IsPenetrate = true; if (test_server) { ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("°üÅë Ãß°¡ µ¥¹ÌÁö %d"), GetPoint (POINT_DEF_GRADE) * (100 + GetPoint (POINT_DEF_BONUS)) / 100); } dam += GetPoint (POINT_DEF_GRADE) * (100 + GetPoint (POINT_DEF_BONUS)) / 100; if (IsAffectFlag (AFF_MANASHIELD)) { RemoveAffect (AFF_MANASHIELD); } } Skip the following steps if you already installed IsFighting function. Go to file pvp.cpp Look for: void CPVPManager::ConnectEx (LPCHARACTER pkChr, bool bDisconnect) Add this BEFORE: bool CPVPManager::IsFighting (LPCHARACTER pkChr) { if (!pkChr) { return false; } return IsFighting (pkChr->GetPlayerID()); } bool CPVPManager::IsFighting (DWORD dwPID) { CPVPSetMap::iterator it = m_map_pkPVPSetByID.find (dwPID); if (it == m_map_pkPVPSetByID.end()) { return false; } TR1_NS::unordered_set<CPVP *>::iterator it2 = it->second.begin(); while (it2 != it->second.end()) { CPVP *pkPVP = *it2++; if (pkPVP->IsFight()) { return true; } } return false; } Go to file pvp.h Look for: virtual ~CPVPManager(); Add this AFTER: bool IsFighting (LPCHARACTER pkChr); bool IsFighting (DWORD dwPID); 2 1 Link to comment Share on other sites More sharing options...
WLN Posted October 26, 2017 at 09:49 PM Share Posted October 26, 2017 at 09:49 PM como sempre um conteúdo util e bem feito, obrigado pela partilha. Link to comment Share on other sites More sharing options...
jeddawee1 Posted February 26, 2020 at 12:59 AM Share Posted February 26, 2020 at 12:59 AM thx Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now