Пример #1
0
/*!
	Play the sound effect for a miss.
*/
void cCombat::playMissedSoundEffect( P_CHAR pChar, UINT16 skill )
{
	UINT16 id = 0;

	switch( skill )
	{
	case ARCHERY:
		id = RandomNum( 0, 1 ) ? 0x233 : 0x238;
		break;

	// Wrestling Sounds are creature-dependant
	case WRESTLING:
		if( !pChar->isHuman() )
		{
			cCharBaseDef *def = BaseDefManager::instance()->getCharBaseDef( pChar->body() );

			if( def != 0 )
				id = def->basesound() + RandomNum( 0, 1 );
			break;
		}

	default:
		id = RandomNum( 0x238, 0x23a );
		break;
	}

	if( id != 0 )
		pChar->soundEffect( id );
}
Пример #2
0
/*!
	Play the soundeffect for getting hit.
*/
void cCombat::playGetHitSoundEffect( P_CHAR pChar )
{
	if ( pChar->body() == 0x191 )
	{
		UI16 sound = hex2dec( Definitions::instance()->getRandomListEntry( "SOUNDS_COMBAT_HIT_HUMAN_FEMALE" ) ).toUShort();
		if ( sound > 0 )
			pChar->soundEffect( sound );
		else
			pChar->soundEffect( 0x14b );
	}
	else if ( pChar->body() == 0x190 )
	{
		UI16 sound = hex2dec( Definitions::instance()->getRandomListEntry( "SOUNDS_COMBAT_HIT_HUMAN_MALE" ) ).toUShort();
		if ( sound > 0 )
			pChar->soundEffect( sound );
		else
			pChar->soundEffect( 0x156 );
	}
	else
		pChar->bark( cBaseChar::Bark_GetHit );
}
Пример #3
0
	cTrackingList( P_CHAR player, UINT8 type )
	{
		setType( 0xFE12ACDE );

		startPage( 0 );
		addBackground( 0x13BE, 440, 160 );
		addResizeGump( 10, 10, 0xA3C, 420, 75 );
		addResizeGump( 10, 85, 0xBB8, 420, 50 );

		UINT32 pCount = 0;
		UINT32 pAmount = 0;

		// 1: Animals
		// 2: Monsters
		// 3: Humans
		// 4: Players
		cCharSectorIterator *iter = SectorMaps::instance()->findChars( player->pos(), 18 );

		for( P_CHAR pChar = iter->first(); pChar; pChar = iter->next() )
		{
			// Do the neccesary checks
			bool passed = true;

			switch( type )
			{
			// Animals
			case 1:
				passed = !( pChar->objectType() != enNPC || pChar->body() == 0x190 || pChar->body() == 0x191 ); //|| pChar->npcaitype() == 2 );
				break;
			// Monsters
			case 2:
				passed = !( pChar->objectType() != enNPC || pChar->body() == 0x190 || pChar->body() == 0x191 ); //|| pChar->npcaitype() != 2 );
				break;
			// Human
			case 3:
				passed = !( pChar->objectType() != enNPC || ( pChar->body() != 0x190 && pChar->body() != 0x191 ) );
				break;
			case 4:
				passed = ( pChar->objectType() == enPlayer && dynamic_cast<P_PLAYER>(pChar)->socket() );
				break;
			};

			if( !passed )
				continue;

			// Checks passed, add the character
			if( pAmount == 0 ) // Start new page
			{
				// Add a button on the old page
				if( pCount > 0 )
				{
					addPageButton( 395, 137, 0x26af, 0x26b1, pCount );
				}

				startPage( ++pCount );

				// Add a button on the new page
				if( pCount > 1 )
				{
					addPageButton( 365, 137, 0x26b5, 0x26b7, pCount-1 );
				}
			}

			cCharBaseDef *def = BaseDefManager::instance()->getCharBaseDef( pChar->body() );

			if( def && def->shrinked() != 0 )
				addTilePic( (pAmount*100)+20, 20, def->shrinked() );

			addButton( (pAmount*100)+20, 110, 0xFA5, 0xFA7, pChar->serial() );
			addCroppedText( (pAmount*100)+20, 90, 100, 40, pChar->name() );

			++pAmount;
		}

		delete iter;
	}