Code:
enum eGameObjType
{
GOT_Door=0,
GOT_Button=1,
GOT_QuestGiver=2,
GOT_Chest=3,
GOT_Binder=4,
GOT_Generic=5,
GOT_Trap=6,
GOT_Chair=7,
GOT_SpellFocus=8,
GOT_Text=9,
GOT_Goober=0xa,
GOT_Transport=0xb,
GOT_AreaDamage=0xc,
GOT_Camera=0xd,
GOT_WorldObj=0xe,
GOT_MapObjTransport=0xf,
GOT_DuelArbiter=0x10,
GOT_FishingNode=0x11,
GOT_Ritual=0x12,
GOT_Mailbox=0x13,
GOT_AuctionHouse=0x14,
GOT_SpellCaster=0x16,
GOT_MeetingStone=0x17,
GOT_FORCEDWORD=0xFFFFFFFF,
};
Furthermore, for herbs/mines/etc I use GetModel. Here's my implementations.
Code:
bool CGGameObject_C::IsFish()
{
if (GetSubType() == GOT_FishingNode)
return true;
return false;
}
bool CGGameObject_C::IsFoodOrWater()
{
if (GetModel())
{
if (strstr(GetModel(),"BARREL") || strstr(GetModel(),"Barrel") || strstr(GetModel(),"Crate"))
return true;
}
return false;
}
bool CGGameObject_C::IsTreasure()
{
if (GetObjectName() && GetSubType() == GOT_Chest)
{
if (IsHerb() || IsMine() || strstr(GetObjectName()," Power Crystal"))
return false;
else if (IsFoodOrWater())
return true;
else
return true;
}
return false;
}
bool CGGameObject_C::IsHerb()
{
if (GetModel() && strstr(GetModel(),"TradeskillNodes\Bush"))
return true;
return false;
}
bool CGGameObject_C::IsMine()
{
if (GetModel() && strstr(GetModel(),"_Miningnode_"))
return true;
return false;
}
GetModel and GetObjectName are in the CGObject_C VMT.