本文整理汇总了C++中Spawn::NPC方法的典型用法代码示例。如果您正苦于以下问题:C++ Spawn::NPC方法的具体用法?C++ Spawn::NPC怎么用?C++ Spawn::NPC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spawn
的用法示例。
在下文中一共展示了Spawn::NPC方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Item
Spawn::Spawn(Spawn& s, uint16_t id)
: Item(tSpawn, id)
{
setName(s.name());
setLastName(s.lastName());
Item::setPoint(s.x(), s.y(), s.z());
setPetOwnerID(s.petOwnerID());
setLight(s.light());
setGender(s.gender());
setDeity(s.deity());
setRace(s.race());
setClassVal(s.classVal());
setHP(s.HP());
setMaxHP(s.maxHP());
setGuildID(s.GuildID());
setLevel(s.level());
for (int i = 0; i <= tLastCoreWearSlot; i++)
setEquipment(i, s.equipment(i));
setEquipment(tUnknown1, 0);
setTypeflag(s.typeflag());
setNPC(s.NPC());
setAnimation(s.animation());
setDeltas(s.deltaX(), s.deltaY(), s.deltaZ());
setHeading(s.heading(), s.deltaHeading());
setConsidered(s.considered());
// the new copy will own the spawn track list
m_spawnTrackList.setAutoDelete(false);
m_spawnTrackList = s.m_spawnTrackList;
s.m_spawnTrackList.setAutoDelete(false);
m_spawnTrackList.setAutoDelete(true);
}
示例2: consMessage
void SpawnShell::consMessage(const considerStruct * con, uint32_t, uint8_t dir)
{
Item* item;
Spawn* spawn;
if (dir == DIR_CLIENT)
{
if (con->playerid != con->targetid)
{
item = m_spawns.find(con->targetid);
if (item != NULL)
{
spawn = (Spawn*)item;
// note that this spawn has been considered
spawn->setConsidered(true);
emit spawnConsidered(item);
}
}
return;
}
QString lvl("");
QString hps("");
QString cn("");
QString msg("Faction: Your faction standing with ");
//printf("%i, %i, %i, %i\n", con->unknown1[0], con->unknown1[1], con->unknown2[0], con->unknown2[1]);
// is it you that you've conned?
if (con->playerid == con->targetid)
{
// print it's deity
printf("Diety: %s\n", (const char*)m_player->deityName());
// well, this is You
msg += "YOU";
}
else
{
// find the spawn if it exists
item = m_spawns.find(con->targetid);
// has the spawn been seen before?
if (item != NULL)
{
Spawn* spawn = (Spawn*)item;
// yes
printf("Diety: %s\n", (const char*)spawn->deityName());
int changed = tSpawnChangedNone;
/* maxhp and curhp are available when considering players, */
/* but not when considering mobs. */
if (con->maxHp || con->curHp)
{
if (spawn->NPC() == SPAWN_NPC_UNKNOWN)
{
spawn->setNPC(SPAWN_PLAYER); // player
changed |= tSpawnChangedNPC;
}
spawn->setMaxHP(con->maxHp);
spawn->setHP(con->curHp);
changed |= tSpawnChangedHP;
}
else if (item->NPC() == SPAWN_NPC_UNKNOWN)
{
spawn->setNPC(SPAWN_NPC);
changed |= tSpawnChangedNPC;
}
// note the updates if any
if (changed != tSpawnChangedNone)
{
if (updateFilterFlags(item))
changed |= tSpawnChangedFilter;
if (updateRuntimeFilterFlags(item))
changed |= tSpawnChangedRuntimeFilter;
item->updateLastChanged();
emit changeItem(item, changed);
}
// note that this spawn has been considered
spawn->setConsidered(true);
emit spawnConsidered(item);
msg += item->name();
} // end if spawn found
else
msg += "Spawn:" + QString::number(con->targetid, 16);
} // else not yourself
switch (con->level)
{
case 0:
{
//.........这里部分代码省略.........