当前位置: 首页>>代码示例>>C++>>正文


C++ P_CHAR::baseSkill方法代码示例

本文整理汇总了C++中P_CHAR::baseSkill方法的典型用法代码示例。如果您正苦于以下问题:C++ P_CHAR::baseSkill方法的具体用法?C++ P_CHAR::baseSkill怎么用?C++ P_CHAR::baseSkill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在P_CHAR的用法示例。


在下文中一共展示了P_CHAR::baseSkill方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: fromChar

void cUOTxSendSkills::fromChar( P_CHAR pChar )
{
	if( !pChar )
		return;

	for( Q_UINT8 i = 0; i < ALLSKILLS; ++i )
		addSkill( i, pChar->skill( i ), pChar->baseSkill( i ), cUOTxSendSkills::Up );
}
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:8,代码来源:uotxpackets.cpp

示例2: dropOnTrainer

void cDragItems::dropOnTrainer( P_CLIENT client, P_ITEM pItem, P_CHAR pTrainer )
{
	P_CHAR pChar = client->player();

	if( pItem->id() != 0xEED )
	{
		pTrainer->talk( "You need to give me gold if you want me to train you!" );
		bounceItem( client, pItem );
		return;
	}

	pTrainer->talk( "I thank thee for thy payment. That should give thee a good start on thy way. Farewell!" );

	Q_UINT8 skill = pTrainer->trainingplayerin();
	Q_INT32 skillSum = pChar->getSkillSum();
	Q_INT32 skillDelta = pTrainer->getTeachingDelta( pChar, skill, skillSum );

	goldsfx( client->socket(), pItem->amount() );

	if( pItem->amount() > skillDelta )
	{
		pItem->ReduceAmount( skillDelta );
		bounceItem( client, pItem );
	}
	else
	{
		skillDelta = pItem->amount();
		Items->DeleItem( pItem );
	}
	
	pChar->setBaseSkill( skill, pChar->baseSkill( skill ) + skillDelta );
	Skills->updateSkillLevel( pChar, skill );
	updateskill( client->socket(), skill );

	// we will not reset the trainer id here because he may want to give him more money
}
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:36,代码来源:dragdrop.cpp


注:本文中的P_CHAR::baseSkill方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。