示例#1
0
CCharBase *CItemSpawn::SetTrackID()
{
	ADDTOCALLSTACK("CitemSpawn:SetTrackID");
	SetAttr(ATTR_INVIS);	// Indicate to GM's that it is invis.
	if (GetHue() == 0)
		SetHue(HUE_RED_DARK);

	if ( !IsType(IT_SPAWN_CHAR) )
	{
		SetDispID(ITEMID_WorldGem_lg);
		return NULL;
	}

	CCharBase *pCharDef = NULL;
	RESOURCE_ID_BASE rid = m_itSpawnChar.m_CharID;

	if ( rid.GetResType() == RES_CHARDEF )
	{
		CREID_TYPE id = static_cast<CREID_TYPE>(rid.GetResIndex());
		pCharDef = CCharBase::FindCharBase(id);
	}
	if ( pCharDef )		// They must want it to look like this.
		SetDispID(pCharDef ? pCharDef->m_trackID : ITEMID_TRACK_WISP);
		
	return pCharDef;
}
示例#2
0
CCharBase * CItem::Spawn_SetTrackID()
{
	if ( ! IsType(IT_SPAWN_CHAR))
		return NULL;
	CCharBase * pCharDef = NULL;
	RESOURCE_ID_BASE rid = m_itSpawnChar.m_CharID;

	if ( rid.GetResType() == RES_CHARDEF )
	{
		CREID_TYPE id = (CREID_TYPE) rid.GetResIndex();
		pCharDef = CCharBase::FindCharBase( id );
	}
	if ( pCharDef )
		SetAttr( ATTR_INVIS );
	if ( IsAttr(ATTR_INVIS))	// They must want it to look like this.
	{
		SetDispID( ( pCharDef == NULL ) ? ITEMID_TRACK_WISP : pCharDef->m_trackID );
		if ( GetHue() == 0 )
			SetHue( HUE_RED_DARK );	// Indicate to GM's that it is invis.
	}
	return( pCharDef );
}