M2 Download Center
Download Here ( Internal )
I'm releasing self-tipped Source-Code extension for attacking Pets ?
Preview:
In Scope Square - the hottest P-Server project that will ever start -
the whole thing is of course 1000x better, fixed with possible bugs, and a gui,
with which the pet can then essentially control where the target of the
Can choose pets himself, and can also launch skills of the pet ?
you open "PetSystem.h" and insert under "void unmount();"
bool Attack(LPCHARACTER pkVictim = NULL);
Should then look like this:
Same file, looks for:
CPetActor * GetByVnum(DWORD vnum) const;
and inserts below:
void LaunchAttack(LPCHARACTER pkVictim = NULL);
Should then look like this:
you open "PetSystem.cpp" and:
searches for
bool CPetActor::Update(DWORD deltaTime)
Replace complete function with:
bool CPetActor::Update(DWORD deltaTime)
{
bool bResult = false;
// Æê ÁÖÀÎÀÌ Á×¾ú°Å³ª, ¼ÒȯµÈ ÆêÀÇ »óŰ¡ ÀÌ»óÇÏ´Ù¸é ÆêÀ» ¾ø¾Ú. (NOTE: °¡²û°¡´Ù ÀÌ·± Àú·± ÀÌÀ¯·Î ¼ÒȯµÈ ÆêÀÌ DEAD »óÅ¿¡ ºüÁö´Â °æ¿ì°¡ ÀÖÀ½
// ÆêÀ» ¼ÒȯÇÑ ¾ÆÀÌÅÛÀÌ ¾ø°Å³ª, ³»°¡ °¡Áø »óŰ¡ ¾Æ´Ï¶ó¸é ÆêÀ» ¾ø¾Ú.
if (m_pkOwner->IsDead() || (IsSummoned() && m_pkChar->IsDead())
|| NULL == ITEM_MANAGER::instance().FindByVID(this->GetSummonItemVID())
|| ITEM_MANAGER::instance().FindByVID(this->GetSummonItemVID())->GetOwner() != this->GetOwner()
)
{
this->Unsummon();
return true;
}
if (this->GetCharacter()->GetVictim())
{
bResult = this->Attack();
}
if (!bResult)
{
if (this->IsSummoned() && HasOption(EPetOption_Followable))
bResult = this->_UpdateFollowAI();
}
return bResult;
}
Same file, looks for the function:
void CPetActor::ClearBuff()
Adds the following func AFTER this function (not IN the function):
bool CPetActor::Attack(LPCHARACTER pkVictim)
{
if (pkVictim)
{
if (!pkVictim->IsMonster() || pkVictim->IsDead())
return false;
if (m_pkChar->GetVictim())
return false;
}
else
{
pkVictim = m_pkChar->GetVictim();
if (!pkVictim)
return false;
}
m_pkChar->SetVictim(pkVictim);
const PIXEL_POSITION& rkPetPos = m_pkChar->GetXYZ();
const PIXEL_POSITION& rkVictimPos = pkVictim->GetXYZ();
int iDistance = DISTANCE_APPROX(rkPetPos.x - rkVictimPos.x, rkPetPos.y - rkVictimPos.y);
if (iDistance >= m_pkChar->GetMobAttackRange())
{
m_pkChar->Follow(pkVictim, m_pkChar->GetMobAttackRange());
}
else
{
if (get_dword_time() - m_pkChar->GetLastAttackTime() >= 3000)
{
if (m_pkChar->Attack(pkVictim))
{
m_pkChar->SendMovePacket(FUNC_ATTACK, 0, rkPetPos.x, rkPetPos.y, 0, get_dword_time());
m_pkChar->SetLastAttacked(get_dword_time());
}
}
}
return true;
}
should then look like this:
You are looking for the function:
bool CPetSystem::Update(DWORD deltaTime)
and ABOVE inserts the following function:
void CPetSystem::LaunchAttack(LPCHARACTER pkVictim)
{
if (!pkVictim)
return;
for (itertype(m_petActorMap) it = m_petActorMap.begin(); it != m_petActorMap.end(); ++it)
{
CPetActor* pkPetActor = it->second;
if (pkPetActor->IsSummoned())
pkPetActor->Attack(pkVictim);
}
}
should then look like this:
and last but not least - open the file:
"char_battle.cpp", looks for the function:
bool CHARACTER::Attack(LPCHARACTER pkVictim, BYTE bType)
and adds under the following content:
// only pc sets victim null. For npc, state machine will reset this.
if (BATTLE_DEAD == iRet && IsPC())
SetVictim(NULL);
This one:
if (BATTLE_DEAD != iRet && IsPC())
{
if (m_petSystem && m_petSystem->CountSummoned() > 0)
m_petSystem->LaunchAttack(pkVictim);
}
Should then look like this:
So ? that would increase the biceps buttock opening by - for my part - 2 meters.
#Edt: So that the pets can also die:
Opens the pvp.cpp, searches for
bool CPVPManager::CanAttack(LPCHARACTER pkChr, LPCHARACTER pkVictim)
and inserts:
if (pkChr->IsPet() && pkVictim->IsMonster())
{
return true;
}
if (pkChr->IsMonster() && pkVictim->IsPet())
{
return true;
}
Like this:
Enjoy!