Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@Source/Game/char_item.cpp
- //1.) Add header:
- #include "pvp.h"
- //2.) Search:
- case USE_POTION:
- //3.) Add after:
- if (CPVPManager::instance().IsFighting(GetPlayerID()))
- {
- switch (item->GetVnum())
- {
- case 27001:
- case 27002:
- case 27003:
- case 27004:
- case 27005:
- case 27006:
- ChatPacket(CHAT_TYPE_INFO, "You can not use potions in a duel!");
- return false;
- break;
- }
- }
- //@Source/Game/pvp.cpp
- //4.) Search:
- void CPVPManager::ConnectEx(LPCHARACTER pkChr, bool bDisconnect)
- //5.) Add 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;
- }
- //@Source/Game/pvp.h
- //4.) Search:
- virtual ~CPVPManager();
- //5.) Add after:
- bool IsFighting(LPCHARACTER pkChr);
- bool IsFighting(DWORD dwPID);
Advertisement
Add Comment
Please, Sign In to add comment