本文整理汇总了C++中P_CHAR::IsGrey方法的典型用法代码示例。如果您正苦于以下问题:C++ P_CHAR::IsGrey方法的具体用法?C++ P_CHAR::IsGrey怎么用?C++ P_CHAR::IsGrey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类P_CHAR
的用法示例。
在下文中一共展示了P_CHAR::IsGrey方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AttackStuff
void AttackStuff(NXWSOCKET s, P_CHAR victim)
{
if ( s < 0 || s >= now )
return;
P_CHAR attacker = MAKE_CHAR_REF( currchar[s] );
VALIDATEPC( attacker );
VALIDATEPC( victim );
if( attacker->getSerial32() == victim->getSerial32() )
return;
if ( attacker->amxevents[EVENT_CHR_ONBEGINATTACK]) {
g_bByPass = false;
attacker->amxevents[EVENT_CHR_ONBEGINATTACK]->Call( attacker->getSerial32(), victim->getSerial32() );
if (g_bByPass==true) return;
}
if ( victim->amxevents[EVENT_CHR_ONBEGINDEFENSE]) {
g_bByPass = false;
victim->amxevents[EVENT_CHR_ONBEGINDEFENSE]->Call( victim->getSerial32(), attacker->getSerial32() );
if (g_bByPass==true) return;
}
/*
attacker->runAmxEvent( EVENT_CHR_ONBEGINATTACK, attacker->getSerial32(), victim->getSerial32() );
if (g_bByPass==true)
return;
victim->runAmxEvent( EVENT_CHR_ONBEGINDEFENSE, victim->getSerial32(), attacker->getSerial32() );
if (g_bByPass==true)
return;
*/
attacker->targserial=victim->getSerial32();
attacker->unHide();
attacker->disturbMed();
if( victim->dead || victim->hp <= 0 )//AntiChrist
{
attacker->sysmsg( TRANSLATE("That person is already dead!") );
return;
}
if ( victim->npcaitype==NPCAI_PLAYERVENDOR)
{
attacker->sysmsg( TRANSLATE("%s cannot be harmed."), victim->getCurrentNameC() );
return;
}
SndAttackOK(s, victim->getSerial32()); //keep the target highlighted
if (!( victim->targserial== INVALID))
{
victim->attackerserial=attacker->getSerial32();
victim->ResetAttackFirst();
}
attacker->SetAttackFirst();
attacker->attackerserial=victim->getSerial32();
if( victim->guarded )
{
NxwCharWrapper sc;
sc.fillOwnedNpcs( victim, false, false );
for ( sc.rewind(); !sc.isEmpty(); sc++ )
{
P_CHAR guard = sc.getChar();
if ( ISVALIDPC( guard ) )
if ( guard->npcaitype == NPCAI_PETGUARD && ( attacker->distFrom( guard )<= 10 ) )
npcattacktarget(attacker, guard);
}
}
if ((region[ victim->region].priv & RGNPRIV_GUARDED) && (SrvParms->guardsactive))
{
if (victim->IsGrey())
attacker->SetGrey();
if (victim->npc==0 && victim->IsInnocent() && (!victim->IsGrey()) && Guildz.compareGuilds( attacker->getGuild(), victim->getGuild() )==0) //REPSYS
{
criminal( attacker );
if (ServerScp::g_nInstantGuard==1)
npcs::SpawnGuard(attacker, victim,attacker->getPosition() );
}
else if( victim->npc && victim->IsInnocent() && !victim->HasHumanBody() && victim->npcaitype!=NPCAI_TELEPORTGUARD )
{
criminal( attacker );
if (ServerScp::g_nInstantGuard==1)
npcs::SpawnGuard(attacker, victim, attacker->getPosition() );
}
else if( victim->npc && victim->IsInnocent() && victim->HasHumanBody() && victim->npcaitype!=NPCAI_TELEPORTGUARD )
{
victim->talkAll( TRANSLATE("Help! Guards! I've been attacked!"), 1);
criminal( victim );
callguards(DEREF_P_CHAR(victim)); // Sparhawk must check if npcs can call guards
}
else if( victim->npc && victim->npcaitype==NPCAI_TELEPORTGUARD)
{
criminal( attacker );
npcattacktarget(victim, attacker);
}
else if ((victim->npc || victim->tamed) && !victim->war && victim->npcaitype!=NPCAI_TELEPORTGUARD)
{
//.........这里部分代码省略.........