本文整理汇总了C++中CreatureObject::getZone方法的典型用法代码示例。如果您正苦于以下问题:C++ CreatureObject::getZone方法的具体用法?C++ CreatureObject::getZone怎么用?C++ CreatureObject::getZone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CreatureObject
的用法示例。
在下文中一共展示了CreatureObject::getZone方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeMember
void GroupObjectImplementation::removeMember(SceneObject* member) {
ManagedReference<SceneObject*> obj = member;
for (int i = 0; i < groupMembers.size(); i++) {
SceneObject* scno = groupMembers.get(i).get().get();
if (scno == member) {
GroupObjectDeltaMessage6* grp = new GroupObjectDeltaMessage6(_this.getReferenceUnsafeStaticCast());
grp->startUpdate(1);
groupMembers.remove(i, grp);
grp->close();
broadcastMessage(grp);
}
}
if (member->isPlayerCreature()) {
// Remove member's pets
CreatureObject* playerCreature = cast<CreatureObject*>(member);
RemovePetsFromGroupTask* task = new RemovePetsFromGroupTask(playerCreature, _this.getReferenceUnsafeStaticCast());
task->execute();
//Close any open Group SUIs.
ManagedReference<PlayerObject*> ghost = playerCreature->getPlayerObject();
if (ghost != NULL) {
ghost->closeSuiWindowType(SuiWindowType::GROUP_LOOT_RULE);
ghost->closeSuiWindowType(SuiWindowType::GROUP_LOOT_CHANGED);
ghost->closeSuiWindowType(SuiWindowType::GROUP_LOOT_PICK_LOOTER);
}
//Reset Master Looter if needed.
if (getMasterLooterID() == playerCreature->getObjectID()) {
ManagedReference<CreatureObject*> groupLeader = (getLeader()).castTo<CreatureObject*>();
GroupManager::instance()->changeMasterLooter(_this.getReferenceUnsafeStaticCast(), groupLeader, false);
}
if (hasSquadLeader()) {
removeGroupModifiers(playerCreature);
}
if (playerCreature->getPlayerObject() != NULL) {
PlayerObject* ghost = playerCreature->getPlayerObject();
ghost->removeWaypointBySpecialType(WaypointObject::SPECIALTYPE_NEARESTMISSIONFORGROUP);
}
Zone* zone = playerCreature->getZone();
if (zone != NULL) {
scheduleUpdateNearestMissionForGroup(zone->getPlanetCRC());
}
}
calcGroupLevel();
}
示例2: isJediTrainer
int LuaPlayerObject::isJediTrainer(lua_State* L) {
CreatureObject* trainer = (CreatureObject*)lua_touserdata(L, -1);
Vector3 npc(trainer->getWorldPositionX(), trainer->getWorldPositionY(), 0);
Vector3 playerCoord = realObject->getTrainerCoordinates();
Vector3 player(playerCoord.getX(), playerCoord.getY(), 0);
bool result = (npc == player) && (realObject->getTrainerZoneName() == trainer->getZone()->getZoneName());
lua_pushboolean(L, result);
return 1;
}
示例3: doAggro
void LairObserverImplementation::doAggro(TangibleObject* lair, TangibleObject* attacker, bool allAttack){
for (int i = 0; i < spawnedCreatures.size() ; ++i) {
CreatureObject* creo = spawnedCreatures.get(i);
if (creo->isDead() || creo->getZone() == NULL)
continue;
if (creo->isAiAgent() && attacker != NULL && (allAttack || (System::random(1) == 1))) {
// TODO: only set defender if needed
AiAgent* ai = cast<AiAgent*>( creo);
Locker clocker(creo, lair);
creo->setDefender(attacker);
}
}
}
示例4: healLair
void LairObserverImplementation::healLair(TangibleObject* lair, TangibleObject* attacker){
Locker locker(lair);
if (lair->getZone() == NULL)
return;
int damageToHeal = 0;
int lairMaxCondition = lair->getMaxCondition();
for (int i = 0; i < spawnedCreatures.size() ; ++i) {
CreatureObject* creo = spawnedCreatures.get(i);
if (creo->isDead() || creo->getZone() == NULL)
continue;
// TODO: Range check
damageToHeal += lairMaxCondition / 100;
}
if (damageToHeal == 0)
return;
if (lair->getZone() == NULL)
return;
lair->healDamage(lair, 0, damageToHeal, true);
PlayClientEffectObjectMessage* heal =
new PlayClientEffectObjectMessage(lair, "clienteffect/healing_healdamage.cef", "");
lair->broadcastMessage(heal, false);
PlayClientEffectLoc* healLoc = new PlayClientEffectLoc("clienteffect/healing_healdamage.cef",
lair->getZone()->getZoneName(), lair->getPositionX(),
lair->getPositionZ(), lair->getPositionY());
lair->broadcastMessage(healLoc, false);
}