Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Fully working pet filter Wakazaki Style ;)

Initiate Mage
Joined
Nov 24, 2017
Messages
2
Reaction score
0
thanks for your answer but it doesn't solve my problem :(

defineItemkind.h
#define WEAPON_GENERAL 0 // ÀÏ¹Ý ¹«±â
#define WEAPON_UNIQUE 1 // À¯´ÏÅ© ¹«±â
#define WEAPON_ULTIMATE 2 // ¾óÅÍ¸Ú ¹«±â

#define ARMOR_SET 3 // ¼¼Æ® ¹æ¾î±¸
#define ARMOR_GEN 4

#define PET_VIS 1 // VisPet
#endif

AIPet.cpp
FOR_LINKMAP( pWorld, vPos, pObj, nRange, CObj::linkDynamic, pMover->GetLayer() )
{
if( pObj->GetType() == OT_ITEM ) // ¾ÆÅÛ¸¸ °Ë»ö
{
CItem *pItem = (CItem *)pObj;
ItemProp* pItemProp = pItem->GetProp();
// ÀÌ°É µû·Î ³ÖÀºÀÌÀ¯´Â StateIdle ARRIVAL¿¡¼­ DoLoot()ÇÏ°í ³­Á÷ÈÄ¿¡ ´Ù½Ã SubItemLoot()À» È£ÃâÇßÀ»¶§
// LootÇÑ ¾ÆÀÌÅÛÀÌ ¾ÆÁ÷ ¾ÈÁö¿öÁ®¼­ ¿©±â¼­ ¶Ç °Ë»öÀÌ µÇ´õ¶ó°í.. ±×·¡¼­ Áߺ¹µÇ´Â ¾ÆÀÌÅÛÀº °Ë»ö ¾ÈµÇ°Ô °íÃĺôÙ.
// if( pItem->GetId() != m_idLootItem )
if( pItem->IsDelete() == FALSE )
{
if( pItemProp )
{
#ifdef __PETFILTER
BOOL b1 = TRUE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_HPFOOD) && pItem->GetProp()->dwItemKind2 == IK2_FOOD)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_MPFOOD) && pItem->GetProp()->dwItemKind3 == IK3_REFRESHER)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_FPFOOD) && pItem->GetProp()->dwItemKind2 == IK2_POTION)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_FPFOOD) && pItem->GetProp()->dwItemKind1 == IK3_DRINK)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_BWEAPON) && pItem->GetProp()->dwReferStat1 == WEAPON_GENERAL)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_GWEAPON) && pItem->GetProp()->dwReferStat1 == WEAPON_UNIQUE)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_BSET) && pItem->GetProp()->dwReferStat1 == ARMOR_GEN)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_GSET) && pItem->GetProp()->dwReferStat1 == ARMOR_SET)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_NECKLACE) && pItem->GetProp()->dwItemKind3 == IK3_NECKLACE)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_EARRING) && pItem->GetProp()->dwItemKind3 == IK3_EARRING)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_RING) && pItem->GetProp()->dwItemKind3 == IK3_RING)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_EGG) && pItem->GetProp()->dwID == II_PET_EGG)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_SUNSTONE) && pItem->GetProp()->dwID == II_GEN_MAT_ORICHALCUM01)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_SUNSTONE) && pItem->GetProp()->dwID == II_GEN_MAT_ORICHALCUM02)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_SUNSTONE) && pItem->GetProp()->dwID == II_GEN_MAT_ORICHALCUM01_1)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_SUNSTONE) && pItem->GetProp()->dwID == II_SYS_SYS_SCR_SCRAPORICHALCUM)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_MOONSTONE) && pItem->GetProp()->dwID == II_GEN_MAT_MOONSTONE)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_MOONSTONE) && pItem->GetProp()->dwID == II_GEN_MAT_MOONSTONE_1)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_MOONSTONE) && pItem->GetProp()->dwID == II_SYS_SYS_SCR_SCRAPMOONSTONE)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_QUESTITEM) && pItem->GetProp()->dwItemKind2 == IK2_GEM)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_QUESTITEM) && pItem->GetProp()->dwItemKind2 == IK3_GEM)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_ELECARDS) && pItem->GetProp()->dwItemKind3 == IK3_ELECARD)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_4PCARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_MAGMA)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_4PCARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_FLOOD)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_4PCARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_STORM)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_4PCARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_THUNDER)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_4PCARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_MOUNTAIN)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_7PCARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_EARTHQUAKE)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_7PCARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_LIGHTING)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_7PCARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_VACCUM)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_7PCARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_OCEAN)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_7PCARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_VOLCANO)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_BPIECARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_CANDLEB)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_BPIECARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_RAINATKB)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_BPIECARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_BREEZEATKB)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_BPIECARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_SPARKATKB)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_BPIECARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_SANDATKB)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_APIECARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_SANDATKA)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_APIECARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_SPARKATKA)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_APIECARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_BREEZEATKA)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_APIECARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_RAINATKA)
b1 = FALSE;
if ((((CUser*)pOwner)->m_dwPetfilter & FILTER_APIECARD) && pItem->GetProp()->dwID == II_GEN_MAT_ELE_CANDLEA)
b1 = FALSE;


if (pOwner->IsLoot(pItem, TRUE) && b1)// ·çÆõǴ¾ÆÀÌÅÛÀÎÁö °Ë»çÇÔ.
#else //__PETFILTER
if (pOwner->IsLoot(pItem, TRUE))
#endif //__PETFILTER


vDist = pObj->GetPos() - pMover->GetPos();
fDistSq = D3DXVec3LengthSq( &vDist ); // °Å¸® ±¸ÇÔ.
if( fDistSq < 15 * 15 && fDistSq < fMinDist ) // 10¹ÌÅÍ À̳»°í... °¡Àå °Å¸®°¡ °¡±î¿î ¾ÆÅÛÀ» ãÀ½.
pMinObj = pObj;

}
}
}
}
END_LINKMAP
is my aipet.cpp correctly?


when i replace the "=" with "ARMOR_GEN" in propitem.txt (dwReferStat1) my databaseserver wont start after compiling
 
Newbie Spellweaver
Joined
Oct 7, 2009
Messages
93
Reaction score
0
Having a problem with the code, after pressing "U" crashing without any errors
 
Junior Spellweaver
Joined
Nov 21, 2015
Messages
180
Reaction score
21
Having a problem with the code, after pressing "U" crashing without any errors

Debug your client see where it crashes.
Normally if you've pressed the key to open the APP and it crashes it might be a sign that your APP data is wrong or perhaps was never added to the resdata.inc or updated to the client folder?

keep in mind i'm no dev nor have I worked on any type of flyff code in many years.
 
Newbie Spellweaver
Joined
Oct 7, 2009
Messages
93
Reaction score
0
Debug your client see where it crashes.
Normally if you've pressed the key to open the APP and it crashes it might be a sign that your APP data is wrong or perhaps was never added to the resdata.inc or updated to the client folder?

keep in mind i'm no dev nor have I worked on any type of flyff code in many years.

Solved Thanks.
 
Newbie Spellweaver
Joined
Nov 28, 2019
Messages
10
Reaction score
0
Hi,

I've followed the steps and got no errors.
But when i press "U" ingame, my client crashes..
I also cannot find the petfilter in the start menu.

I'm using V18 (VS19).
 
Last edited:
Initiate Mage
Joined
Jan 16, 2019
Messages
3
Reaction score
0
Hello,first of all thanks for this nice helpful tut, bro. :)
And sorry for reposting to it, but maybe it would be helpful for other players in future.
I have a quite strange problem, which seems that nobody has in this thread besides me.

I can not open this pet filter a second time, but pet filter works well after first time.

It opens only one time after login by pressing 'U'. When i close the pet filter-window, i can not open this pet filter a second time with 'U', until i am relogging into the game again.A strange thing is, I also do not have a pet filter icon in the menu taskbar. But the thread creator told, that should also work. I can not find the code snippets, where the menu taskbar should be edited. Maybe the thread creater removed some lines, after his last edit?
Greets
 
Last edited:
Inactive
Joined
Jan 20, 2009
Messages
1,015
Reaction score
1,830
Hello,first of all thanks for this nice helpful tut, bro. :)
And sorry for reposting to it, but maybe it would be helpful for other players in future.
I have a quite strange problem, which seems that nobody has in this thread besides me.

I can not open this pet filter a second time, but pet filter works well after first time.

It opens only one time after login by pressing 'U'. When i close the pet filter-window, i can not open this pet filter a second time with 'U', until i am relogging into the game again.A strange thing is, I also do not have a pet filter icon in the menu taskbar. But the thread creator told, that should also work. I can not find the code snippets, where the menu taskbar should be edited. Maybe the thread creater removed some lines, after his last edit?
Greets

It's possible that you have multiple apps using "U" make sure that only your pet filter does in FuncApplet.cpp.

As for your second question about the start menu in game you can find that in WndTaskbar.cpp -> CWndTaskMenu::OnInitialUpdate() u can add it there if it's not there.
 
Initiate Mage
Joined
Jan 16, 2019
Messages
3
Reaction score
0
It's possible that you have multiple apps using "U" make sure that only your pet filter does in FuncApplet.cpp.As for your second question about the start menu in game you can find that in WndTaskbar.cpp -> CWndTaskMenu::OnInitialUpdate() u can add it there if it's not there.
Solution for second question works well.
Put in WndTaskbar.cpp after:
#if __VER >= 15 // __IMPROVE_QUEST_INTERFACE
pWndButton = AppendMenu( this, 0, APP_QUEST_EX_LIST , GETTEXT( TID_APP_QUEST ) );
#else // __IMPROVE_QUEST_INTERFACE
pWndButton = AppendMenu( this, 0, APP_QUEST , GETTEXT( TID_APP_QUEST ) );
#endif // __IMPROVE_QUEST_INTERFACE
These following lines:
#ifdef __PETFILTER
pWndButton = AppendMenu(this, 0, APP_PETFILTER, _T("PetFilter"));
#endif //__PETFILTER



It's possible that you have multiple apps using "U" make sure that only your pet filter does in FuncApplet.cpp.

As for your second question about the start menu in game you can find that in WndTaskbar.cpp -> CWndTaskMenu::OnInitialUpdate() u can add it there if it's not there.

Unfortunately I could not solve the first problem. I do not have a second 'U' shortcut in FuncApplet.cpp. The second call of pet filter is still not possible. It does not matter, if second call of pet filter was called by using shortcut 'U' or with menu taskbar.
 
Last edited:
Newbie Spellweaver
Joined
Aug 25, 2020
Messages
58
Reaction score
3
" propitem.txt OR spec_item.txt and rename all blue armor's "=" to "ARMOR_GEN" the same as green armor "

Sorry, I really don't know what color of armor.
 
Inactive
Joined
Jan 20, 2009
Messages
1,015
Reaction score
1,830
" propitem.txt OR spec_item.txt and rename all blue armor's "=" to "ARMOR_GEN" the same as green armor "

Sorry, I really don't know what color of armor.

Replace ARMOR_GEN with:
Code:
if( (((CUser*)pOwner)->m_dwPetfilter & FILTER_BSET) && pItem->GetProp()->dwItemKind1 == IK1_ARMOR && pItem->GetProp()->dwItemKind3 != IK3_SHIELD && pItem->GetProp()->dwReferStat1 != ARMOR_SET )
 
Newbie Spellweaver
Joined
Jan 31, 2021
Messages
12
Reaction score
2
Hello!I have copy and change all datas and compiled and merged all. But if i want compile my Worldserver it dont work.If i Open they Client, an Message pop up :APP_HOUSING 1/4 .... 104and i cant klick okay, because it cames back multiple times.Someone have an idea?
 
Inactive
Joined
Jan 20, 2009
Messages
1,015
Reaction score
1,830
Hello!I have copy and change all datas and compiled and merged all. But if i want compile my Worldserver it dont work.If i Open they Client, an Message pop up :APP_HOUSING 1/4 .... 104and i cant klick okay, because it cames back multiple times.Someone have an idea?

Go back and slowly add it / pay attention. It's possible you missed parts or merged into other functions on accident. It happens.

Also make sure your APP_PETFILER is not the same define as another APP and the PACKET have unique numbers to.
 
One word! Im Fawkin Pro!
Loyal Member
Joined
Jul 1, 2010
Messages
1,254
Reaction score
359
Hello!I have copy and change all datas and compiled and merged all. But if i want compile my Worldserver it dont work.If i Open they Client, an Message pop up :APP_HOUSING 1/4 .... 104and i cant klick okay, because it cames back multiple times.Someone have an idea?

You are using the wrong resdata.inc code :)

Go back and slowly add it / pay attention. It's possible you missed parts or merged into other functions on accident. It happens.

Also make sure your APP_PETFILER is not the same define as another APP and the PACKET have unique numbers to.

Also "ARMOR_GEN removed and replaced as it's useless"
its not useless :(
 
Inactive
Joined
Jan 20, 2009
Messages
1,015
Reaction score
1,830
Also "ARMOR_GEN removed and replaced as it's useless"
its not useless :(

When someone can do:
Code:
						if( (((CUser*)pOwner)->m_dwPetfilter & FILTER_BSET) && pItem->GetProp()->dwItemKind1 == IK1_ARMOR && pItem->GetProp()->dwItemKind3 != IK3_SHIELD && pItem->GetProp()->dwReferStat1 != ARMOR_SET )

Instead of adding ARMOR_GEN and then having to change everything in propItem/Spec_Item it's pretty pointless. Seeing the above code does the same and doesn't require resource edits.
 
Newbie Spellweaver
Joined
Sep 30, 2012
Messages
23
Reaction score
0
I'm going crazy, I've gone through the code a million times, I've compared it with another source and it's absolutely the same, I don't know what could be wrong here.

Error C2059 syntax error: ',' Neuz C:\Users\Tales\OneDrive\Escritorio\K18\Source\Source\_Interface\FuncApplet.cpp 223
Error C2059 syntax error: ',' Neuz C:\Users\Tales\OneDrive\Escritorio\K18\Source\Source\_Interface\WndField.cpp 27403




Edit: I'm using Ketchup V18 (VS19) files
 
Newbie Spellweaver
Joined
Jan 31, 2021
Messages
12
Reaction score
2
Now I've checked everything again and tried to compile. However, the WORLD is flawed. everything else worked without errors.

What have I done wrong?also get no message.

World starts anyway. If I then press "U" the neuz crashes and no error code.
 
Back
Top