本文整理汇总了C++中P_CHAR::getTeachingDelta方法的典型用法代码示例。如果您正苦于以下问题:C++ P_CHAR::getTeachingDelta方法的具体用法?C++ P_CHAR::getTeachingDelta怎么用?C++ P_CHAR::getTeachingDelta使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类P_CHAR
的用法示例。
在下文中一共展示了P_CHAR::getTeachingDelta方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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
}