Code:
I publish the system gear score already published on another forum always similar a little time to lose and this can help the most beginner I am happy. : )
In function :
Code:
void CDPClient::OnSnapshot( CAr & ar )
Code:
#ifdef __GEAR_SCORE case SNAPSHOTTYPE_UPDATE_GSVLUE: OnUpdateGSValue(objid, ar); break; #endif // __GEAR_SCORE
Code:
void CDPClient::OnDoEquip( OBJID objid, CAr & ar )
Code:
ar >> nPart;
Code:
#ifdef __GEAR_SCORE DWORD m_dwGearScore = 0; ar >> m_dwGearScore; #endif // __GEAR_SCORE
Code:
CWndInventory* pWndInventory = (CWndInventory*)g_WndMng.GetWndBase( APP_INVENTORY );
if(pWndInventory && pWndInventory->GetModel())
{
pWndInventory->UpdateParts();
}
}
else
{
pPlayer->DoFakeEquip( equipInfo, fEquip, nPart, NULL );
}
pPlayer->UpdateParts( !pPlayer->IsActiveMover() );
Code:
#ifdef __GEAR_SCORE pPlayer->SetGearScore(m_dwGearScore); #endif // __GEAR_SCORE
Code:
in function :
void CDPClient::OnQueryEquip( OBJID objid, CAr & ar )
After :
Code:
EQUIP_INFO_ADD aEquipInfoAdd[MAX_HUMAN_PARTS]; // memset( aEquipInfoAdd, 0, sizeof(EQUIP_INFO_ADD) * MAX_HUMAN_PARTS );
Code:
#ifdef __GEAR_SCORE DWORD m_dwGearScore = 0; ar >> m_dwGearScore; #endif // __GEAR_SCORE
Code:
CMover* pMover = prj.GetMover( objid );
if( IsValidObj( (CObj*)pMover ) )
{
Code:
#ifdef __GEAR_SCORE pMover->SetGearScore(m_dwGearScore); #endif // __GEAR_SCORE
Code:
CDPClient g_DPlay;
Code:
#ifdef __GEAR_SCORE
void CDPClient::OnUpdateGSValue(OBJID objid, CAr & ar)
{
DWORD dwGearScoreValue = 0;
ar >> dwGearScoreValue;
CMover* pMover = prj.GetMover(objid);
if (IsValidObj(pMover))
{
pMover->SetGearScore(dwGearScoreValue);
}
}
#endif // __GEAR_SCORE
After :
Code:
#ifdef __GUILD_HOUSE_MIDDLE private: void OnGuildHouseTenderMainWnd( CAr & ar ); void OnGuildHouseTenderInfoWnd( CAr & ar ); void OnGuildHouseTenderResult( CAr & ar ); public: void SendGuildHouseTenderMainWnd( DWORD dwGHType, OBJID objNpcId ); void SendGuildHouseTenderInfoWnd( OBJID objGHId ); void SendGuildHouseTenderJoin( OBJID objGHId, int nTenderPerin, int nTenderPenya ); #endif // __GUILD_HOUSE_MIDDLE
Code:
#ifdef __GEAR_SCORE void OnUpdateGSValue(OBJID objid, CAr & ar); #endif // __GEAR_SCORE
Search :
Code:
#ifdef __MAP_SECURITY void CUser::Open( DWORD dwWorldId ) #else // __MAP_SECURITY void CUser::Open( void ) #endif // __MAP_SECURITY
After :
Code:
#if __VER >= 12 // __LORD AddLord(); #endif // __LORD #if __VER >= 13 // __COUPLE_1117 AddCouple(); #endif // __COUPLE_1117
Code:
#ifdef __GEAR_SCORE CalculateGearScore(); #endif // __GEAR_SCORE
Code:
void CUser::AddQueryEquip( CUser* pUser )
{
if( IsDelete() ) return;
m_Snapshot.cb++;
m_Snapshot.ar << GETID( pUser );
m_Snapshot.ar << SNAPSHOTTYPE_QUERYEQUIP;
#ifdef __GEAR_SCORE
m_Snapshot.ar << pUser->GetGearScore();
#endif // __GEAR_SCORE
u_long uOffset = m_Snapshot.ar.GetOffset();
int cbEquip = 0;
m_Snapshot.ar << cbEquip;
In function :
Code:
void CUserMng::AddDoEquip( CMover* pMover, int nPart, BYTE nId, const EQUIP_INFO & rEquipInfo, BYTE fEquip )
Code:
ar << nPart;
Code:
#ifdef __GEAR_SCORE ar << pMover->GetGearScore(); #endif // __GEAR_SCORE
Code:
#ifdef __GEAR_SCORE
void CUser::UpdateGearScoreValue(CMover* pMover)
{
if (IsDelete()) return;
m_Snapshot.cb++;
m_Snapshot.ar << GetId();
m_Snapshot.ar << SNAPSHOTTYPE_UPDATE_GSVLUE;
m_Snapshot.ar << pMover->GetGearScore();
}
#endif // __GEAR_SCORE
User.h
After :
Code:
// mulcom BEGIN100405 각성 보호의 두루마리 public: void SelectAwakeningValue( DWORD dwItemObjID, DWORD dwSerialNumber, BYTE bySelectFlag ); void SendNewRandomOption( unsigned char id, DWORD dwSerialNumber, __int64 n64NewRandomOption ); // mulcom END100405 각성 보호의 두루마리
Code:
#ifdef __GEAR_SCORE void UpdateGearScoreValue(CMover* pMover); #endif // __GEAR_SCORE
After :
Code:
data.dwClass = static_cast<DWORD>( Lua.GetFieldToNumber( -1, "dwClass" ) ); data.nMinLevel = static_cast<int>( Lua.GetFieldToNumber( -1, "nMinLevel" ) ); data.nMaxLevel = static_cast<int>( Lua.GetFieldToNumber( -1, "nMaxLevel" ) ); data.dwCoolTime = static_cast<DWORD>( Lua.GetFieldToNumber( -1, "dwCoolTime" ) );
Code:
#ifdef __GEAR_SCORE data.nMinGearScore = static_cast<int>(Lua.GetFieldToNumber(-1, "nMinGearScore")); data.nMaxGearScore = static_cast<int>(Lua.GetFieldToNumber(-1, "nMaxGearScore")); #endif // __GEAR_SCORE
Code:
BOOL CInstanceDungeonBase::CheckClassLevel( CUser* pUser, DWORD dwWorldId )
{
MAP_IDDATA::iterator it = m_mapDungeonData.find( dwWorldId );
if( it == m_mapDungeonData.end() )
return FALSE;
WORD wClass = 0x0000;
switch( pUser->GetLegendChar() )
{
case LEGEND_CLASS_NORMAL : wClass = CLASS_NORMAL; break;
case LEGEND_CLASS_MASTER : wClass = CLASS_MASTER; break;
case LEGEND_CLASS_HERO : wClass = CLASS_HERO; break;
#ifdef __3RD_LEGEND16
case LEGEND_CLASS_LEGENDHERO : wClass = CLASS_LEGEND_HERO; break;
#endif // __3RD_LEGEND16
default : wClass = 0x0000;
}
#ifdef __GAMEMASTER
if (pUser->IsAuthHigher(AUTH_GAMEMASTER2))
return TRUE;
#endif // __GAMEMASTER
if( wClass & it->second.dwClass )
{
if( pUser->GetLevel() < it->second.nMinLevel || pUser->GetLevel() > it->second.nMaxLevel )
{
pUser->AddDefinedText( TID_GAME_INSTANCE_LEVEL, "%d %d", it->second.nMinLevel, it->second.nMaxLevel );
return FALSE;
}
#ifdef __GEAR_SCORE
if (pUser->GetGearScore() < it->second.nMinGearScore || pUser->GetGearScore() > it->second.nMaxGearScore)
{
CString str;
str.Format("You must have a GearScore between% d and% d to enter this instance !", it->second.nMinGearScore, it->second.nMaxGearScore);
pUser->AddText(str);
return FALSE;
}
#endif // __GEAR_SCORE
return TRUE;
}
else
pUser->AddDefinedText( TID_GAME_INSTANCE_CLASS );
return FALSE;
}
After :
Code:
map<int, D3DXVECTOR3> mapTeleportPos; vector<MONSTER> vecMonster; map<int, int> mapObjCount;
Code:
#ifdef __GEAR_SCORE int nMinGearScore; int nMaxGearScore; #endif // __GEAR_SCORE
..\Common\Item.cpp
After :
Code:
#if __VER >= 15 // __PETVIS
void CItemElem::SetSwapVisItem( int nPos1, int nPos2 )
{
int nSize = GetPiercingSize();
if( nPos1 >= nSize || nPos2 >= nSize )
return;
DWORD dwTempId = GetPiercingItem( nPos1 );
time_t tmTemp = GetVisKeepTime( nPos1 );
SetPiercingItem( nPos1, GetPiercingItem( nPos2 ) );
SetVisKeepTime( nPos1, GetVisKeepTime( nPos2 ) );
SetPiercingItem( nPos2, dwTempId );
SetVisKeepTime( nPos2, tmTemp );
}
DWORD CItemElem::GetVisPetSfxId()
{
int nLevel = 0;
for( int i=0; i<GetPiercingSize(); i++ )
{
ItemProp* pProp = prj.GetItemProp( GetPiercingItem( i ) );
if( pProp && pProp->dwAbilityMax > (DWORD)( nLevel ) )
nLevel = pProp->dwAbilityMax;
}
switch( nLevel )
{
case 1: return XI_BUFFPET_GRADE1;
case 2: return XI_BUFFPET_GRADE2;
case 3: return XI_BUFFPET_GRADE3;
}
return NULL_ID;
}
#endif // __PETVIS
Code:
#ifdef __GEAR_SCORE
DWORD CItemElem::GetGearScoreValue()
{
DWORD dwTotalGearScore = 0;
if (GetProp() == NULL)
return dwTotalGearScore;
if (GetProp()->dwItemKind1 != IK1_WEAPON && GetProp()->dwItemKind2 != IK2_ARMOR && GetProp()->dwItemKind2 != IK2_ARMORETC && GetProp()->dwItemKind3 != IK3_EGG && GetProp()->dwItemKind2 != IK2_JEWELRY)
return dwTotalGearScore;
if (!m_pPet)
{
if (IsAccessory())
{
if (GetAbilityOption() > 0 && GetAbilityOption() <= prj.GearScoreProperty.m_mAccessoryAbilityOption.size())
dwTotalGearScore += prj.GearScoreProperty.m_mAccessoryAbilityOption[GetAbilityOption()];
}
else
{
if (GetAbilityOption() > 0 && GetAbilityOption() <= prj.GearScoreProperty.m_mWeaponAbilityOption.size())
dwTotalGearScore += prj.GearScoreProperty.m_mWeaponAbilityOption[GetAbilityOption()];
}
if (GetPiercingSize() > 0 && GetPiercingSize() <= prj.GearScoreProperty.m_mWeaponPiercing.size())
{
int nPiercingCount = 0;
for (int i = 0; i < GetPiercingSize(); i++)
{
if (GetPiercingItem(i) != 0)
nPiercingCount++;
}
dwTotalGearScore += prj.GearScoreProperty.m_mWeaponPiercing[nPiercingCount];
}
dwTotalGearScore += prj.GearScoreProperty.m_mWeaponType[GetProp()->dwReferStat1];
for (auto const& weaponLevel : prj.GearScoreProperty.vWeaponLevels)
{
if (weaponLevel.m_dwMinLevel <= GetProp()->dwLimitLevel1 && weaponLevel.m_dwMaxLevel > GetProp()->dwLimitLevel1)
dwTotalGearScore += weaponLevel.m_dwGearScoreValue;
}
}
else
{
int nLevel = m_pPet->GetLevel();
int levelPet = 0;
BYTE bLevel;
for (int i = PL_D; i <= nLevel; i++)
{
bLevel = m_pPet->GetAvailLevel(i);
levelPet += bLevel;
}
if (levelPet == 25)
dwTotalGearScore += prj.GearScoreProperty.m_dwPerfectPetGearScore;
}
int nKind = g_xRandomOptionProperty->GetRandomOptionKind(this);
int nSize = g_xRandomOptionProperty->GetRandomOptionSize(GetRandomOptItemId());
if (nKind == CRandomOptionProperty::eAwakening || nKind == CRandomOptionProperty::eSystemPet)
{
for (int i = 0; i < nSize; i++)
{
int nDst, nAdj;
if (!g_xRandomOptionProperty->GetParam(GetRandomOptItemId(), i, &nDst, &nAdj))
continue;
if (prj.GearScoreProperty.m_mWeaponAwakes.find(nDst) != prj.GearScoreProperty.m_mWeaponAwakes.end())
{
for (auto const& weaponAwakes : prj.GearScoreProperty.m_mWeaponAwakes[nDst])
{
if (weaponAwakes.m_dwMinAdj <= nAdj && weaponAwakes.m_dwMaxAdj > nAdj)
dwTotalGearScore += weaponAwakes.m_dwGearScoreValue;
}
}
}
}
return dwTotalGearScore;
}
#endif // __GEAR_SCORE
after :
Code:
#if __VER >= 15 // __PETVIS
BOOL IsVisPet() { return ( GetProp() && GetProp()->IsVisPet() ) || IsTransformVisPet() ; }
void SetSwapVisItem( int nPos1, int nPos2 );
void SetVisKeepTimeSize( int nSize ) { m_piercing.SetVisKeepTimeSize( nSize ); }
void SetVisKeepTime( int nth, time_t tmKeep ) { m_piercing.SetVisKeepTime( nth, tmKeep ); }
time_t GetVisKeepTime( int nth ) { return m_piercing.GetVisKeepTime( nth ); }
DWORD GetVisPetSfxId();
BOOL IsTransformVisPet() { return GetProp() && GetProp()->dwItemKind3 == IK3_PET && m_bTranformVisPet; }
BOOL m_bTranformVisPet;
#endif // __PETVIS
Add :
Code:
#ifdef __GEAR_SCORE DWORD GetGearScoreValue(); #endif // __GEAR_SCORE
..\Common\Mover.H
Add end files :
Code:
#ifdef __GEAR_SCORE
void CMover::CalculateGearScore()
{
m_dwGearScore = 0;
DWORD dwTotalGearScore = 0;
CItemElem* pLeftHandWeapon = (CItemElem*)m_Inventory.GetEquip(PARTS_RWEAPON);
if (pLeftHandWeapon)
{
if (pLeftHandWeapon->GetAbilityOption() > 0 && pLeftHandWeapon->GetAbilityOption() <= prj.GearScoreProperty.m_mWeaponAbilityOption.size())
dwTotalGearScore += prj.GearScoreProperty.m_mWeaponAbilityOption[pLeftHandWeapon->GetAbilityOption()];
if (pLeftHandWeapon->GetPiercingSize() > 0 && pLeftHandWeapon->GetPiercingSize() <= prj.GearScoreProperty.m_mWeaponPiercing.size())
{
int nPiercingCount = 0;
for (int i = 0; i < pLeftHandWeapon->GetPiercingSize(); i++)
{
if (pLeftHandWeapon->GetPiercingItem(i) != 0)
nPiercingCount++;
}
dwTotalGearScore += prj.GearScoreProperty.m_mWeaponPiercing[nPiercingCount];
}
if (pLeftHandWeapon->GetProp())
{
dwTotalGearScore += prj.GearScoreProperty.m_mWeaponType[pLeftHandWeapon->GetProp()->dwReferStat1];
for (auto const& weaponLevel : prj.GearScoreProperty.vWeaponLevels)
{
if (weaponLevel.m_dwMinLevel <= pLeftHandWeapon->GetProp()->dwLimitLevel1 && weaponLevel.m_dwMaxLevel > pLeftHandWeapon->GetProp()->dwLimitLevel1)
dwTotalGearScore += weaponLevel.m_dwGearScoreValue;
}
}
int nKind = g_xRandomOptionProperty->GetRandomOptionKind(pLeftHandWeapon);
int nSize = g_xRandomOptionProperty->GetRandomOptionSize(pLeftHandWeapon->GetRandomOptItemId());
if (nKind == CRandomOptionProperty::eAwakening || nKind == CRandomOptionProperty::eSystemPet)
{
for (int i = 0; i < nSize; i++)
{
int nDst, nAdj;
if (!g_xRandomOptionProperty->GetParam(pLeftHandWeapon->GetRandomOptItemId(), i, &nDst, &nAdj))
continue;
if (prj.GearScoreProperty.m_mWeaponAwakes.find(nDst) != prj.GearScoreProperty.m_mWeaponAwakes.end())
{
for (auto const& weaponAwakes : prj.GearScoreProperty.m_mWeaponAwakes[nDst])
{
if (weaponAwakes.m_dwMinAdj <= nAdj && weaponAwakes.m_dwMaxAdj > nAdj)
dwTotalGearScore += weaponAwakes.m_dwGearScoreValue;
}
}
}
}
}
for (int nPart = PARTS_UPPER_BODY; nPart < PARTS_CAP + 1; nPart++)
{
CItemElem* pArmorPiece = (CItemElem*)m_Inventory.GetEquip(nPart);
if (pArmorPiece)
{
if (pArmorPiece->GetAbilityOption() > 0 && pArmorPiece->GetAbilityOption() <= prj.GearScoreProperty.m_mWeaponAbilityOption.size())
dwTotalGearScore += prj.GearScoreProperty.m_mWeaponAbilityOption[pArmorPiece->GetAbilityOption()];
if (pArmorPiece->GetPiercingSize() > 0 && pArmorPiece->GetPiercingSize() <= prj.GearScoreProperty.m_mWeaponPiercing.size())
{
int nPiercingCount = 0;
for (int i = 0; i < pArmorPiece->GetPiercingSize(); i++)
{
if (pArmorPiece->GetPiercingItem(i) != 0)
nPiercingCount++;
}
dwTotalGearScore += prj.GearScoreProperty.m_mWeaponPiercing[nPiercingCount];
}
if (pArmorPiece->GetProp())
{
dwTotalGearScore += prj.GearScoreProperty.m_mWeaponType[pArmorPiece->GetProp()->dwReferStat1];
for (auto const& weaponLevel : prj.GearScoreProperty.vWeaponLevels)
{
if (weaponLevel.m_dwMinLevel <= pArmorPiece->GetProp()->dwLimitLevel1 && weaponLevel.m_dwMaxLevel > pArmorPiece->GetProp()->dwLimitLevel1)
dwTotalGearScore += weaponLevel.m_dwGearScoreValue;
}
}
int nKind = g_xRandomOptionProperty->GetRandomOptionKind(pArmorPiece);
int nSize = g_xRandomOptionProperty->GetRandomOptionSize(pArmorPiece->GetRandomOptItemId());
if (nKind == CRandomOptionProperty::eAwakening || nKind == CRandomOptionProperty::eSystemPet)
{
for (int i = 0; i < nSize; i++)
{
int nDst, nAdj;
if (!g_xRandomOptionProperty->GetParam(pArmorPiece->GetRandomOptItemId(), i, &nDst, &nAdj))
continue;
if (prj.GearScoreProperty.m_mWeaponAwakes.find(nDst) != prj.GearScoreProperty.m_mWeaponAwakes.end())
{
for (auto const& weaponAwakes : prj.GearScoreProperty.m_mWeaponAwakes[nDst])
{
if (weaponAwakes.m_dwMinAdj <= nAdj && weaponAwakes.m_dwMaxAdj > nAdj)
dwTotalGearScore += weaponAwakes.m_dwGearScoreValue;
}
}
}
}
}
}
for (int nPart = PARTS_NECKLACE1; nPart < PARTS_EARRING2 + 1; nPart++)
{
CItemElem* pJewelry = (CItemElem*)m_Inventory.GetEquip(nPart);
if (pJewelry)
{
if (pJewelry->GetAbilityOption() > 0 && pJewelry->GetAbilityOption() <= prj.GearScoreProperty.m_mAccessoryAbilityOption.size())
dwTotalGearScore += prj.GearScoreProperty.m_mAccessoryAbilityOption[pJewelry->GetAbilityOption()];
if (pJewelry->GetProp())
{
dwTotalGearScore += prj.GearScoreProperty.m_mWeaponType[pJewelry->GetProp()->dwReferStat1];
for (auto const& weaponLevel : prj.GearScoreProperty.vWeaponLevels)
{
if (weaponLevel.m_dwMinLevel <= pJewelry->GetProp()->dwLimitLevel1 && weaponLevel.m_dwMaxLevel > pJewelry->GetProp()->dwLimitLevel1)
dwTotalGearScore += weaponLevel.m_dwGearScoreValue;
}
}
}
}
CPet* pPet = GetPet();
CItemElem* pPetItem = GetPetItem();
if (pPet && IsUsableItem(pPetItem))
{
int nLevel = pPet->GetLevel();
int levelPet = 0;
BYTE bLevel;
for (int i = PL_D; i <= nLevel; i++)
{
bLevel = pPet->GetAvailLevel(i);
levelPet += bLevel;
}
if (levelPet == 25)
dwTotalGearScore += prj.GearScoreProperty.m_dwPerfectPetGearScore;
}
m_dwGearScore = dwTotalGearScore;
#ifdef __WORLDSERVER
static_cast<CUser*>(this)->UpdateGearScoreValue(this);
#endif
}
#endif // __GEAR_SCORE
After :
Code:
#ifndef __VM_0820
#ifndef __MEM_TRACE
static CMoverPool* m_pPool;
void* operator new( size_t nSize ) { return CMover::m_pPool->Alloc(); }
void* operator new( size_t nSize, LPCSTR lpszFileName, int nLine ) { return CMover::m_pPool->Alloc(); }
void operator delete( void* lpMem ) { CMover::m_pPool->Free( (CMover*)lpMem ); }
void operator delete( void* lpMem, LPCSTR lpszFileName, int nLine ) { CMover::m_pPool->Free( (CMover*)lpMem ); }
#endif // __MEM_TRACE
#endif // __VM_0820
Code:
#ifdef __GEAR_SCORE
DWORD m_dwGearScore;
void CalculateGearScore();
DWORD GetGearScore() { return m_dwGearScore; }
void SetGearScore(DWORD m_dwGearScoreVal) { m_dwGearScore = m_dwGearScoreVal; }
#endif // __GEAR_SCORE
..\Common\MoverEquip.cpp
Change function by:
Code:
void CMover::EquipItem( CItemElem *pItemElem, BOOL bEquip, int nPart )
{
if( m_pActMover && m_pActMover->IsActAttack() )
return;
if( DoEquip( pItemElem, bEquip, nPart ) )
{
#ifdef __GEAR_SCORE
CalculateGearScore();
#endif // __GEAR_SCORE
#ifdef __WORLDSERVER
g_UserMng.AddDoEquip( this, nPart, pItemElem, bEquip );
if( pItemElem->GetProp()->dwParts == PARTS_RIDE && pItemElem->GetProp()->dwItemJob == JOB_VAGRANT && bEquip == FALSE )
// ( ( pItemElem->m_dwItemId == II_RID_RID_BOR_EVEINSHOVER || pItemElem->m_dwItemId == II_RID_RID_BOR_LADOLF ) && bEquip == FALSE )
RemoveItem( (BYTE)( pItemElem->m_dwObjId ), pItemElem->m_nItemNum );
#endif // __WORLDSERVER
}
}
..\Common\Moverskill.cpp
Code:
#ifdef __WORLDSERVER
void CMover::ActivateSystemPet( CItemElem* pItemElem )
{
#ifdef __FIXES_CUSTOM_V1
if (!pItemElem)
return;
#endif // __FIXES_CUSTOM_V1
#ifdef __QUIZ
if( GetWorld() && GetWorld()->GetID() == WI_WORLD_QUIZ )
return;
#endif // __QUIZ
if( IsFly() )
{
static_cast<CUser*>( this )->AddDefinedText( TID_GAME_CANNOT_CALL_PET_ON_FLYING );
return;
}
BOOL bFirst = FALSE;
if( pItemElem->m_pPet == NULL )
{
pItemElem->m_pPet = new CPet;
pItemElem->m_pPet->InitEgg();
bFirst = TRUE;
}
SetPetId( pItemElem->m_dwObjId );
//#if __VER >= 12 // __PET_0519 // CMover::ProcessPetAvail()로 이동
// SetDestParamRandomOptExtension( pItemElem ); // 시스템 펫 활성화 시 각성 효과 적용
//#endif // __PET_0519
g_dpDBClient.CalluspPetLog( m_idPlayer, pItemElem->GetSerialNumber(), 0, PETLOGTYPE_CALL, pItemElem->m_pPet );
// pet, log
#ifdef __PET_1024
g_UserMng.AddPetCall( this, pItemElem->m_dwObjId, pItemElem->m_pPet->GetIndex(), (BYTE)pItemElem->m_pPet->GetLevel(), pItemElem->m_pPet->GetName() );
#else // __PET_1024
g_UserMng.AddPetCall( this, pItemElem->m_dwObjId, pItemElem->m_pPet->GetIndex(), (BYTE)pItemElem->m_pPet->GetLevel() );
#endif // __PET_1024
if( bFirst )
static_cast<CUser*>(this )->AddPet( pItemElem->m_pPet, PF_PET );
#ifdef __GEAR_SCORE
CalculateGearScore();
#endif // __GEAR_SCORE
}
Code:
void CMover::InactivateSystemPet( CItemElem* pItemElem )
{
if( GetPetId() == pItemElem->m_dwObjId )
PetRelease();
else
static_cast<CUser*>(this )->AddDefinedText( TID_GAME_PET_NOWUSE );
#ifdef __GEAR_SCORE
CalculateGearScore();
#endif // __GEAR_SCORE
}
After :
Code:
#if __VER >= 15 // __CAMPUS ar << m_idCampus; ar << m_nCampusPoint; #endif // __CAMPUS
Add :
Code:
#ifdef __GEAR_SCORE ar << m_dwGearScore; #endif // __GEAR_SCORE
Code:
#if __VER >= 15 // __CAMPUS ar >> m_idCampus; ar >> m_nCampusPoint; #endif // __CAMPUS
Code:
#ifdef __GEAR_SCORE ar >> m_dwGearScore; #endif // __GEAR_SCORE
After :
Code:
#if __VER >= 13 // __HONORABLE_TITLE
CTitleManager::Instance()->LoadTitle("honorList.txt");
#endif // __HONORABLE_TITLE
#if __VER >= 15 /* __IMPROVE_QUEST_INTERFACE */ && defined( __CLIENT )
LoadQuestDestination();
LoadPatrolDestination();
#endif // defined( __IMPROVE_QUEST_INTERFACE ) && defined( __CLIENT )
#ifdef __IMPROVE_MAP_SYSTEM
#ifdef __CLIENT
m_MapInformationManager.LoadMapInformationData();
#endif // __CLIENT
#endif // __IMPROVE_MAP_SYSTEM
Code:
#ifdef __GEAR_SCORE LoadGearScoreFile(); #endif // __GEAR_SCORE
Code:
#ifdef __GEAR_SCORE
void CProject::LoadGearScoreFile()
{
CScript s;
if (!s.Load("GearScore.inc"))
{
Error(__FUNCTION__ " Cannot load GearScore.inc");
return;
}
s.GetToken(); // "Property"
while (s.tok != FINISHED)
{
s.GetToken(); // {
int nBlock = 1;
DWORD nGearScoreValue = 0;
while (nBlock && s.tok != FINISHED)
{
s.GetToken();
if (s.Token == "{")
nBlock++;
else if (s.Token == "}")
nBlock--;
else if (s.Token == "TYPE_WEAPON")
{
s.GetToken();
s.GetToken();
int nWeaponType = -1;
if (*s.token != '}')
nWeaponType = atoi(s.Token);
while (*s.token != '}')
{
nGearScoreValue = s.GetNumber();
GearScoreProperty.m_mWeaponType[nWeaponType] = nGearScoreValue;
nWeaponType = s.GetNumber();
}
}
else if (s.Token == "WEAPON_LEVEL")
{
s.GetToken(); // {
s.GetToken(); // BETWEEN
while (*s.token != '}')
{
s.GetToken(); // (
DWORD nMinLevel = s.GetNumber();
s.GetToken(); // ,
DWORD nMaxLevel = s.GetNumber();
s.GetToken(); // )
nGearScoreValue = s.GetNumber();
GearScoreProperty.vWeaponLevels.push_back({ nMinLevel, nMaxLevel, nGearScoreValue });
s.GetToken();
}
}
else if (s.Token == "WEAPON_PIERCING")
{
s.GetToken(); // {
s.GetToken();
while (*s.token != '}')
{
DWORD nIndex = atoi(s.Token);
nGearScoreValue = s.GetNumber();
GearScoreProperty.m_mWeaponPiercing[nIndex] = nGearScoreValue;
s.GetToken();
}
}
else if (s.Token == "WEAPON_ABILITY")
{
s.GetToken(); // {
s.GetToken();
while (*s.token != '}')
{
DWORD nIndex = atoi(s.Token);
nGearScoreValue = s.GetNumber();
GearScoreProperty.m_mWeaponAbilityOption[nIndex] = nGearScoreValue;
s.GetToken();
}
}
else if (s.Token == "ACCESSORY_ABILITY")
{
s.GetToken(); // {
s.GetToken();
while (*s.token != '}')
{
DWORD nIndex = atoi(s.Token);
nGearScoreValue = s.GetNumber();
GearScoreProperty.m_mAccessoryAbilityOption[nIndex] = nGearScoreValue;
s.GetToken();
}
}
else if (s.Token == "AWAKES")
{
s.GetToken(); // {
s.GetToken(); // DST
while (*s.token != '}')
{
DWORD nDST = atoi(s.Token);
s.GetToken(); // {
s.GetToken(); // BETWEEN
while (*s.token != '}')
{
s.GetToken(); // (
DWORD nMinAdj = s.GetNumber();
s.GetToken(); // ,
DWORD nMaxAdj = s.GetNumber();
s.GetToken(); // )
nGearScoreValue = s.GetNumber();
GearScoreProperty.m_mWeaponAwakes[nDST].push_back({ nMinAdj, nMaxAdj, nGearScoreValue });
s.GetToken();
}
s.GetToken();
}
}
else if (s.Token == "PERFECT_PET")
{
nGearScoreValue = s.GetNumber();
GearScoreProperty.m_dwPerfectPetGearScore = nGearScoreValue;
}
}
}
}
#endif // __GEAR_SCORE
before :
Code:
inline void LOG_RANGE( const char* szMsg, int nMin, int nMax, int nIndex )
Code:
#ifdef __GEAR_SCORE
struct GEAR_SCORE_WEAPON_LEVELS
{
DWORD m_dwMinLevel;
DWORD m_dwMaxLevel;
DWORD m_dwGearScoreValue;
};
struct GEAR_SCORE_AWAKES
{
DWORD m_dwMinAdj;
DWORD m_dwMaxAdj;
DWORD m_dwGearScoreValue;
};
struct GEAR_SCORE_PROPERTY
{
map<DWORD, DWORD> m_mWeaponType;
vector<GEAR_SCORE_WEAPON_LEVELS> vWeaponLevels;
map<DWORD, DWORD> m_mWeaponPiercing;
map<DWORD, DWORD> m_mWeaponAbilityOption;
map<DWORD, DWORD> m_mAccessoryAbilityOption;
map<DWORD, vector<GEAR_SCORE_AWAKES>> m_mWeaponAwakes;
DWORD m_dwPerfectPetGearScore;
};
#endif // __GEAR_SCORE
Code:
#ifdef __IMPROVE_MAP_SYSTEM #ifdef __CLIENT CMapInformationManager m_MapInformationManager; BOOL m_bMapTransparent; #endif // __CLIENT #endif // __IMPROVE_MAP_SYSTEM
Code:
#ifdef __GEAR_SCORE void LoadGearScoreFile(); GEAR_SCORE_PROPERTY GearScoreProperty; #endif // __GEAR_SCORE
In function :
Code:
void CWndQueryEquip::OnDraw(C2DRender* p2DRender)
{
CMover* pMover = GetMover();
if( IsInvalidObj(pMover) )
return ;
Code:
#ifdef __GEAR_SCORE
CWndStatic* pWndGearScoreValue = (CWndStatic*)GetDlgItem(WIDC_STATICX);
if (pWndGearScoreValue)
{
CString str;
str.Format("%d", pMover->GetGearScore());
pWndGearScoreValue->SetTitle(str);
pWndGearScoreValue->m_dwColor = 0xFF009700;
}
CWndStatic* pWndGearScoreTooltip = (CWndStatic*)GetDlgItem(WIDC_STATIC1X);
CPoint point = GetMousePoint();
if (pWndGearScoreTooltip && pWndGearScoreTooltip->GetWndRect().PtInRect(point))
{
CPoint point2 = point;
CRect DrawRect = pWndGearScoreTooltip->GetWndRect();
ClientToScreen(&point2);
ClientToScreen(&DrawRect);
g_toolTip.PutToolTip(100, "Gear Score value", DrawRect, point2, 0);
}
#endif // __GEAR_SCORE
Code:
void CWndInventory::OnDraw(C2DRender* p2DRender)
{
CMover* pMover = g_pPlayer;
if( !pMover )
return;
Add :
Code:
#ifdef __GEAR_SCORE
CWndStatic* pWndGearScoreValue = (CWndStatic*)GetDlgItem(WIDC_STATICX);
if (pWndGearScoreValue)
{
CString str;
str.Format("%d", g_pPlayer->GetGearScore());
pWndGearScoreValue->SetTitle(str);
pWndGearScoreValue->m_dwColor = 0xFFff0000;
}
CWndStatic* pWndGearScoreTooltip = (CWndStatic*)GetDlgItem(WIDC_STATIC1X);
CPoint point = GetMousePoint();
if (pWndGearScoreTooltip && pWndGearScoreTooltip->GetWndRect().PtInRect(point))
{
CPoint point2 = point;
CRect DrawRect = pWndGearScoreTooltip->GetWndRect();
ClientToScreen(&point2);
ClientToScreen(&DrawRect);
g_toolTip.PutToolTip(100, "Gear Score value", DrawRect, point2, 0);
}
#endif // __GEAR_SCORE
Code:
//Level History
int nLevel = pItemElem->m_pPet->GetLevel();
if(nLevel > PL_EGG)
{
pEdit->AddString( "\n" );
pEdit->AddString( "(", D3DCOLOR_XRGB(0, 200, 255) );
for(int i=PL_D; i<=nLevel; i++)
{
BYTE bLevel = pItemElem->m_pPet->GetAvailLevel(i);
strTemp.Format(prj.GetText(TID_GAME_PET_TOOLTIP_LEVEL), bLevel);
pEdit->AddString( strTemp, D3DCOLOR_XRGB(0, 127, 255) );
if(i != nLevel)
pEdit->AddString( "/", D3DCOLOR_XRGB(0, 200, 255) );
}
pEdit->AddString( ")", D3DCOLOR_XRGB(0, 200, 255) );
//Pet Experience
EXPINTEGER nExpResult = pItemElem->m_pPet->GetExp() * (EXPINTEGER)10000 / pItemElem->m_pPet->GetMaxExp();
float fExp = (float)nExpResult / 100.0f;
if( fExp >= 99.99f )
strTemp.Format(prj.GetText(TID_GAME_PET_TOOLTIP_EXP_MAX));
else
strTemp.Format(prj.GetText(TID_GAME_PET_TOOLTIP_EXP), fExp);
pEdit->AddString( "\n" );
pEdit->AddString( strTemp, D3DCOLOR_XRGB(120, 120, 220) );
//Pet Energy
int nMaxEnergy = pItemElem->m_pPet->GetMaxEnergy();
int nEnergy = pItemElem->m_pPet->GetEnergy();
int nLife = pItemElem->m_pPet->GetLife();
pEdit->AddString( "\n" );
strTemp.Format(prj.GetText(TID_GAME_PET_TOOLTIP_LIFE), nLife);
pEdit->AddString( strTemp, D3DCOLOR_XRGB(255, 100, 100) );
pEdit->AddString( "\n" );
strTemp.Format(prj.GetText(TID_GAME_PET_TOOLTIP_HP), nEnergy, nMaxEnergy);
pEdit->AddString( strTemp, D3DCOLOR_XRGB(255, 10, 10) );
}
else
{
//Pet Experience
EXPINTEGER nExpResult = pItemElem->m_pPet->GetExp() * (EXPINTEGER)10000 / pItemElem->m_pPet->GetMaxExp();
float fExp = (float)nExpResult / 100.0f;
if( fExp >= 99.99f )
strTemp.Format(prj.GetText(TID_GAME_PET_TOOLTIP_EXP_MAX));
else
strTemp.Format(prj.GetText(TID_GAME_PET_TOOLTIP_EXP), fExp);
pEdit->AddString( "\n" );
pEdit->AddString( strTemp, D3DCOLOR_XRGB(120, 120, 220) );
}
Add :
Code:
#ifdef __GEAR_SCORE PutGearScore(pItemElem, pEdit); #endif // __GEAR_SCORE
Code:
void CWndMgr::PutToolTip_Item(CItemBase* pItemBase, CPoint point, CRect* pRect, int flag)
Code:
PutJob( pMover, pItemElem, &strEdit ); PutLevel( pMover, pItemElem, &strEdit );
Code:
#ifdef __GEAR_SCORE PutGearScore(pItemElem, &strEdit); #endif // __GEAR_SCORE
Code:
#ifdef __GEAR_SCORE
void CWndMgr::PutGearScore(CItemElem* pItemElem, CEditString* pEdit)
{
DWORD dwGearScoreValue = pItemElem->GetGearScoreValue();
if (dwGearScoreValue <= 0)
return;
CString str;
str.Format("\nGear Score level : %d", pItemElem->GetGearScoreValue());
pEdit->AddString(str, dwItemColor[g_Option.m_nToolTipText].dwBlessingWarning);
}
#endif // __GEAR_SCORE
..\Interface\Wndmanager.h
After :
Code:
#if __VER >= 15 // __IMPROVE_SYSTEM_VER15 void PutEquipItemText( CEditString* pEdit ); #endif // __IMPROVE_SYSTEM_VER15
Code:
#ifdef __GEAR_SCORE void PutGearScore(CItemElem* pItemElem, CEditString* pEdit); #endif // __GEAR_SCORE
.._Common\Network\Obj.cpp
After :
Code:
#if __VER >= 15 // __GUILD_HOUSE m_nRestPoint = 0; m_tLogOut = 0; #endif // __GUILD_HOUSE
Code:
#ifdef __GEAR_SCORE m_dwGearScore = 0; #endif // __GEAR_SCORE
Code:
#if __VER >= 15 // __CAMPUS m_idCampus = pMover->m_idCampus; m_nCampusPoint = pMover->m_nCampusPoint; #endif // __CAMPUS
Code:
#ifdef __GEAR_SCORE m_dwGearScore = pMover->m_dwGearScore; #endif // __GEAR_SCORE
..\Common\Network\Obj.h
search :
Code:
#if __VER >= 15 // __GUILD_HOUSE public: int m_nRestPoint; time_t m_tLogOut; #endif // __GUILD_HOUSE
Code:
#ifdef __GEAR_SCORE DWORD m_dwGearScore; #endif // __GEAR_SCORE
And as we have added buttons in WndField.cpp in queryequip and inventoryondraw
we have to add two buttons in the resdata. Inc in the function:
APP_QUERYEQUIP and
APP_INVENTORY
Resource :
Resdata.inc, search :
APP_QUERYEQUIP
add :
Code:
WTYPE_STATIC WIDC_STATICX "" 0 57 185 172 202 0x220010 0 0 0 0
{
// Title String
IDS_RESDATA_INC_DHEL_800006
}
{
// ToolTip
IDS_RESDATA_INC_DHEL_800007
}
WTYPE_STATIC WIDC_STATIC1X "" 0 75 170 149 189 0x220010 0 0 0 0
{
// Title String
IDS_RESDATA_INC_DHEL_800009
}
{
// ToolTip
IDS_RESDATA_INC_DHEL_800009
}
Code:
WTYPE_STATIC WIDC_STATICX "" 0 56 191 171 208 0x220010 0 0 0 0
{
// Title String
IDS_RESDATA_INC_DHEL_800006
}
{
// ToolTip
IDS_RESDATA_INC_DHEL_800007
}
WTYPE_STATIC WIDC_STATIC1X "" 0 75 176 149 195 0x220010 0 0 0 0
{
// Title String
IDS_RESDATA_INC_DHEL_800009
}
{
// ToolTip
IDS_RESDATA_INC_DHEL_800009
}
Code:
FOR RESDATA V19 EXEMPLE DIFFERENCE:
Res data V15
WTYPE_STATIC WIDC_STATIC1X "" 0 75 176 149 195 0x220010 0 0 0 0
And V19 and for v19 you just need to add 3 zero at the end of the line look :
WTYPE_STATIC WIDC_STATIC1X "" 0 75 176 149 195 0x220010 0 0 0 0 0 0 0
..Ressource\LuaFun\InstanceDungeonBase.lua
Modifie function :
Code:
function AddDungeon( strWorldId )
local nIndex = #tDungeon + 1
tDungeon[nIndex] = {}
tDungeon[nIndex].strWorldId = strWorldId
tDungeon[nIndex].dwClass = 65535
tDungeon[nIndex].nMinLevel = 1
tDungeon[nIndex].nMaxLevel = 120--
[COLOR="red"] tDungeon[nIndex].nMinGearScore = 0
tDungeon[nIndex].nMaxGearScore = 0
[/COLOR]
tDungeon[nIndex].dwCoolTime = MIN( 30 )
tDungeon[nIndex].tMonster = {}
tDungeon[nIndex].tTeleport = {}
end
And add end files :
Code:
function SetGearScore( nMinGearScore, nMaxGearScore ) local nIndex = #tDungeon tDungeon[nIndex].nMinGearScore = nMinGearScore tDungeon[nIndex].nMaxGearScore = nMaxGearScore end
Code:
And in partydungeon.lua
Code:
AddDungeon( "WI_INSTANCE_HERNEOS" )
--{
SetClass( CLASS_NORMAL,CLASS_MASTER, CLASS_HERO, CLASS_LEGEND_HERO )
SetLevel( 90 , 300 )
SetCoolTime( MIN(90) )
SetGearScore( 10, 2000) // GEAR SCORE , MIN/MAX.
SetMonster( ID_MIDBOSS, "MI_HERNSIREN01", true, 689, 100, 508 )
SetMonster( ID_BOSS, "MI_HERNKRAKEN01", true, 1942, 100, 1424 )
--}






