/* * server/zone/objects/creature/AiAgent.cpp generated by engine3 IDL compiler 0.60 */ #include "AiAgent.h" #include "server/zone/Zone.h" #include "server/zone/objects/creature/events/AiThinkEvent.h" #include "server/zone/objects/creature/events/AiMoveEvent.h" #include "server/zone/objects/creature/events/AiWaitEvent.h" #include "server/zone/objects/creature/events/AiAwarenessEvent.h" #include "server/zone/packets/scene/AttributeListMessage.h" #include "server/zone/objects/tangible/weapon/WeaponObject.h" #include "server/zone/objects/tangible/TangibleObject.h" #include "server/zone/objects/tangible/weapon/WeaponObject.h" #include "server/zone/templates/SharedObjectTemplate.h" #include "server/zone/templates/mobile/CreatureTemplate.h" #include "server/zone/objects/creature/events/DespawnCreatureOnPlayerDissappear.h" #include "server/zone/objects/creature/commands/QueueCommand.h" #include "server/zone/objects/player/PlayerObject.h" /* * AiAgentStub */ enum {RPC_INITIALIZETRANSIENTMEMBERS__ = 6,RPC_FINALIZE__,RPC_ACTIVATERECOVERY__,RPC_ACTIVATEMOVEMENTEVENT__,RPC_ACTIVATEWAITEVENT__,RPC_ACTIVATEAWARENESSEVENT__CREATUREOBJECT_,RPC_TRYRETREAT__,RPC_DORECOVERY__,RPC_DOATTACK__,RPC_DOMOVEMENT__,RPC_SETLEVEL__INT_,RPC_SENDBASELINESTO__SCENEOBJECT_,RPC_CALCULATEATTACKMINDAMAGE__INT_,RPC_CALCULATEATTACKMAXDAMAGE__INT_,RPC_CALCULATEATTACKSPEED__INT_,RPC_ISCAMOUFLAGED__CREATUREOBJECT_,RPC_ISSCENTMASKED__CREATUREOBJECT_,RPC_ISCONCEALED__CREATUREOBJECT_,RPC_HANDLEOBJECTMENUSELECT__CREATUREOBJECT_BYTE_,RPC_CHECKNEWANGLE__,RPC_FILLATTRIBUTELIST__ATTRIBUTELISTMESSAGE_CREATUREOBJECT_,RPC_SETNEXTPOSITION__FLOAT_FLOAT_FLOAT_SCENEOBJECT_,RPC_NOTIFYPOSITIONUPDATE__QUADTREEENTRY_,RPC_CLEARPATROLPOINTS__,RPC_INFLICTDAMAGE__TANGIBLEOBJECT_INT_FLOAT_BOOL_BOOL_,RPC_INFLICTDAMAGE__TANGIBLEOBJECT_INT_FLOAT_BOOL_STRING_BOOL_,RPC_SENDCONVERSATIONSTARTTO__SCENEOBJECT_,RPC_SENDDEFAULTCONVERSATIONTO__SCENEOBJECT_,RPC_SELECTCONVERSATIONOPTION__INT_SCENEOBJECT_,RPC_NOTIFYOBJECTDESTRUCTIONOBSERVERS__TANGIBLEOBJECT_INT_,RPC_NOTIFYCONVERSEOBSERVERS__CREATUREOBJECT_,RPC_NOTIFYATTACK__OBSERVABLE_,RPC_NOTIFYCALLFORHELP__OBSERVABLE_MANAGEDOBJECT_,RPC_DESTROYOBJECTFROMWORLD__BOOL_,RPC_ACTIVATEPOSTURERECOVERY__,RPC_QUEUEDIZZYFALLEVENT__,RPC_CLEARCOMBATSTATE__BOOL_,RPC_SETDEFENDER__SCENEOBJECT_,RPC_ADDDEFENDER__SCENEOBJECT_,RPC_REMOVEDEFENDER__SCENEOBJECT_,RPC_SETDESPAWNONNOPLAYERINRANGE__BOOL_,RPC_NOTIFYDESPAWN__ZONE_,RPC_SCHEDULEDESPAWN__,RPC_SCHEDULEDESPAWN__INT_,RPC_RESPAWN__ZONE_INT_,RPC_SETHOMELOCATION__FLOAT_FLOAT_FLOAT_SCENEOBJECT_,RPC_SETRESPAWNTIMER__FLOAT_,RPC_ISATTACKABLEBY__CREATUREOBJECT_,RPC_ISAGGRESSIVETO__CREATUREOBJECT_,RPC_SETOBLIVIOUS__,RPC_SETWATCHOBJECT__SCENEOBJECT_,RPC_SETSTALKOBJECT__SCENEOBJECT_,RPC_SETFOLLOWOBJECT__SCENEOBJECT_,RPC_SETTARGETOBJECT__SCENEOBJECT_,RPC_GETFOLLOWOBJECT__,RPC_SELECTWEAPON__,RPC_VALIDATESTATEATTACK__CREATUREOBJECT_STRING_,RPC_ISRETREATING__,RPC_ISFLEEING__,RPC_CLEARDESPAWNEVENT__,RPC_GETKINETIC__,RPC_GETENERGY__,RPC_GETELECTRICITY__,RPC_GETSTUN__,RPC_GETBLAST__,RPC_GETHEAT__,RPC_GETCOLD__,RPC_GETACID__,RPC_GETLIGHTSABER__,RPC_ISSTALKER__,RPC_ISKILLER__,RPC_GETFEROCITY__,RPC_GETARMOR__,RPC_GETDESPAWNONNOPLAYERINRANGE__,RPC_GETNUMBEROFPLAYERSINRANGE__,RPC_GETFACTIONSTRING__,RPC_GETSOCIALGROUP__,RPC_GETCHANCEHIT__,RPC_GETDAMAGEMIN__,RPC_GETDAMAGEMAX__,RPC_GETBASEXP__,RPC_GETDIET__,RPC_GETRESPAWNTIMER__,RPC_ISAIAGENT__,RPC_HASLOOT__,RPC_SETSHOWNEXTPOSITION__BOOL_}; AiAgent::AiAgent() : CreatureObject(DummyConstructorParameter::instance()) { AiAgentImplementation* _implementation = new AiAgentImplementation(); _impl = _implementation; _impl->_setStub(this); _setClassName("AiAgent"); } AiAgent::AiAgent(DummyConstructorParameter* param) : CreatureObject(param) { _setClassName("AiAgent"); } AiAgent::~AiAgent() { } void AiAgent::initializeTransientMembers() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_INITIALIZETRANSIENTMEMBERS__); method.executeWithVoidReturn(); } else _implementation->initializeTransientMembers(); } void AiAgent::activateRecovery() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_ACTIVATERECOVERY__); method.executeWithVoidReturn(); } else _implementation->activateRecovery(); } void AiAgent::activateMovementEvent() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_ACTIVATEMOVEMENTEVENT__); method.executeWithVoidReturn(); } else _implementation->activateMovementEvent(); } void AiAgent::activateWaitEvent() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_ACTIVATEWAITEVENT__); method.executeWithVoidReturn(); } else _implementation->activateWaitEvent(); } void AiAgent::activateAwarenessEvent(CreatureObject* target) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_ACTIVATEAWARENESSEVENT__CREATUREOBJECT_); method.addObjectParameter(target); method.executeWithVoidReturn(); } else _implementation->activateAwarenessEvent(target); } bool AiAgent::tryRetreat() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_TRYRETREAT__); return method.executeWithBooleanReturn(); } else return _implementation->tryRetreat(); } void AiAgent::doRecovery() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_DORECOVERY__); method.executeWithVoidReturn(); } else _implementation->doRecovery(); } void AiAgent::doAttack() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_DOATTACK__); method.executeWithVoidReturn(); } else _implementation->doAttack(); } void AiAgent::doMovement() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_DOMOVEMENT__); method.executeWithVoidReturn(); } else _implementation->doMovement(); } void AiAgent::setLevel(int lvl) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SETLEVEL__INT_); method.addSignedIntParameter(lvl); method.executeWithVoidReturn(); } else _implementation->setLevel(lvl); } void AiAgent::sendBaselinesTo(SceneObject* player) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SENDBASELINESTO__SCENEOBJECT_); method.addObjectParameter(player); method.executeWithVoidReturn(); } else _implementation->sendBaselinesTo(player); } int AiAgent::calculateAttackMinDamage(int level) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_CALCULATEATTACKMINDAMAGE__INT_); method.addSignedIntParameter(level); return method.executeWithSignedIntReturn(); } else return _implementation->calculateAttackMinDamage(level); } int AiAgent::calculateAttackMaxDamage(int level) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_CALCULATEATTACKMAXDAMAGE__INT_); method.addSignedIntParameter(level); return method.executeWithSignedIntReturn(); } else return _implementation->calculateAttackMaxDamage(level); } float AiAgent::calculateAttackSpeed(int level) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_CALCULATEATTACKSPEED__INT_); method.addSignedIntParameter(level); return method.executeWithFloatReturn(); } else return _implementation->calculateAttackSpeed(level); } bool AiAgent::isCamouflaged(CreatureObject* target) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_ISCAMOUFLAGED__CREATUREOBJECT_); method.addObjectParameter(target); return method.executeWithBooleanReturn(); } else return _implementation->isCamouflaged(target); } bool AiAgent::isScentMasked(CreatureObject* target) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_ISSCENTMASKED__CREATUREOBJECT_); method.addObjectParameter(target); return method.executeWithBooleanReturn(); } else return _implementation->isScentMasked(target); } bool AiAgent::isConcealed(CreatureObject* target) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_ISCONCEALED__CREATUREOBJECT_); method.addObjectParameter(target); return method.executeWithBooleanReturn(); } else return _implementation->isConcealed(target); } void AiAgent::doAwarenessCheck(Coordinate& start, unsigned long long time, CreatureObject* target) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { throw ObjectNotLocalException(this); } else _implementation->doAwarenessCheck(start, time, target); } int AiAgent::handleObjectMenuSelect(CreatureObject* player, byte selectedID) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_HANDLEOBJECTMENUSELECT__CREATUREOBJECT_BYTE_); method.addObjectParameter(player); method.addByteParameter(selectedID); return method.executeWithSignedIntReturn(); } else return _implementation->handleObjectMenuSelect(player, selectedID); } void AiAgent::checkNewAngle() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_CHECKNEWANGLE__); method.executeWithVoidReturn(); } else _implementation->checkNewAngle(); } void AiAgent::fillAttributeList(AttributeListMessage* msg, CreatureObject* object) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_FILLATTRIBUTELIST__ATTRIBUTELISTMESSAGE_CREATUREOBJECT_); method.addObjectParameter(msg); method.addObjectParameter(object); method.executeWithVoidReturn(); } else _implementation->fillAttributeList(msg, object); } void AiAgent::setNextPosition(float x, float z, float y, SceneObject* cell) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SETNEXTPOSITION__FLOAT_FLOAT_FLOAT_SCENEOBJECT_); method.addFloatParameter(x); method.addFloatParameter(z); method.addFloatParameter(y); method.addObjectParameter(cell); method.executeWithVoidReturn(); } else _implementation->setNextPosition(x, z, y, cell); } void AiAgent::notifyPositionUpdate(QuadTreeEntry* entry) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_NOTIFYPOSITIONUPDATE__QUADTREEENTRY_); method.addObjectParameter(entry); method.executeWithVoidReturn(); } else _implementation->notifyPositionUpdate(entry); } void AiAgent::updateCurrentPosition(PatrolPoint* point) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { throw ObjectNotLocalException(this); } else _implementation->updateCurrentPosition(point); } void AiAgent::broadcastNextPositionUpdate(PatrolPoint* point) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { throw ObjectNotLocalException(this); } else _implementation->broadcastNextPositionUpdate(point); } void AiAgent::clearPatrolPoints() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_CLEARPATROLPOINTS__); method.executeWithVoidReturn(); } else _implementation->clearPatrolPoints(); } void AiAgent::notifyInsert(QuadTreeEntry* entry) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { throw ObjectNotLocalException(this); } else _implementation->notifyInsert(entry); } void AiAgent::notifyDissapear(QuadTreeEntry* entry) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { throw ObjectNotLocalException(this); } else _implementation->notifyDissapear(entry); } void AiAgent::loadTemplateData(SharedObjectTemplate* templateData) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { throw ObjectNotLocalException(this); } else _implementation->loadTemplateData(templateData); } void AiAgent::loadTemplateData(CreatureTemplate* templateData) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { throw ObjectNotLocalException(this); } else _implementation->loadTemplateData(templateData); } int AiAgent::inflictDamage(TangibleObject* attacker, int damageType, float damage, bool destroy, bool notifyClient) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_INFLICTDAMAGE__TANGIBLEOBJECT_INT_FLOAT_BOOL_BOOL_); method.addObjectParameter(attacker); method.addSignedIntParameter(damageType); method.addFloatParameter(damage); method.addBooleanParameter(destroy); method.addBooleanParameter(notifyClient); return method.executeWithSignedIntReturn(); } else return _implementation->inflictDamage(attacker, damageType, damage, destroy, notifyClient); } int AiAgent::inflictDamage(TangibleObject* attacker, int damageType, float damage, bool destroy, const String& xp, bool notifyClient) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_INFLICTDAMAGE__TANGIBLEOBJECT_INT_FLOAT_BOOL_STRING_BOOL_); method.addObjectParameter(attacker); method.addSignedIntParameter(damageType); method.addFloatParameter(damage); method.addBooleanParameter(destroy); method.addAsciiParameter(xp); method.addBooleanParameter(notifyClient); return method.executeWithSignedIntReturn(); } else return _implementation->inflictDamage(attacker, damageType, damage, destroy, xp, notifyClient); } void AiAgent::sendConversationStartTo(SceneObject* player) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SENDCONVERSATIONSTARTTO__SCENEOBJECT_); method.addObjectParameter(player); method.executeWithVoidReturn(); } else _implementation->sendConversationStartTo(player); } void AiAgent::sendDefaultConversationTo(SceneObject* player) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SENDDEFAULTCONVERSATIONTO__SCENEOBJECT_); method.addObjectParameter(player); method.executeWithVoidReturn(); } else _implementation->sendDefaultConversationTo(player); } void AiAgent::selectConversationOption(int option, SceneObject* obj) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SELECTCONVERSATIONOPTION__INT_SCENEOBJECT_); method.addSignedIntParameter(option); method.addObjectParameter(obj); method.executeWithVoidReturn(); } else _implementation->selectConversationOption(option, obj); } int AiAgent::notifyObjectDestructionObservers(TangibleObject* attacker, int condition) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_NOTIFYOBJECTDESTRUCTIONOBSERVERS__TANGIBLEOBJECT_INT_); method.addObjectParameter(attacker); method.addSignedIntParameter(condition); return method.executeWithSignedIntReturn(); } else return _implementation->notifyObjectDestructionObservers(attacker, condition); } int AiAgent::notifyConverseObservers(CreatureObject* converser) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_NOTIFYCONVERSEOBSERVERS__CREATUREOBJECT_); method.addObjectParameter(converser); return method.executeWithSignedIntReturn(); } else return _implementation->notifyConverseObservers(converser); } int AiAgent::notifyAttack(Observable* observable) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_NOTIFYATTACK__OBSERVABLE_); method.addObjectParameter(observable); return method.executeWithSignedIntReturn(); } else return _implementation->notifyAttack(observable); } int AiAgent::notifyCallForHelp(Observable* observable, ManagedObject* arg1) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_NOTIFYCALLFORHELP__OBSERVABLE_MANAGEDOBJECT_); method.addObjectParameter(observable); method.addObjectParameter(arg1); return method.executeWithSignedIntReturn(); } else return _implementation->notifyCallForHelp(observable, arg1); } void AiAgent::destroyObjectFromWorld(bool sendSelfDestroy) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_DESTROYOBJECTFROMWORLD__BOOL_); method.addBooleanParameter(sendSelfDestroy); method.executeWithVoidReturn(); } else _implementation->destroyObjectFromWorld(sendSelfDestroy); } void AiAgent::activatePostureRecovery() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_ACTIVATEPOSTURERECOVERY__); method.executeWithVoidReturn(); } else _implementation->activatePostureRecovery(); } void AiAgent::queueDizzyFallEvent() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_QUEUEDIZZYFALLEVENT__); method.executeWithVoidReturn(); } else _implementation->queueDizzyFallEvent(); } void AiAgent::clearCombatState(bool clearDefenders) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_CLEARCOMBATSTATE__BOOL_); method.addBooleanParameter(clearDefenders); method.executeWithVoidReturn(); } else _implementation->clearCombatState(clearDefenders); } void AiAgent::setDefender(SceneObject* defender) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SETDEFENDER__SCENEOBJECT_); method.addObjectParameter(defender); method.executeWithVoidReturn(); } else _implementation->setDefender(defender); } void AiAgent::addDefender(SceneObject* defender) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_ADDDEFENDER__SCENEOBJECT_); method.addObjectParameter(defender); method.executeWithVoidReturn(); } else _implementation->addDefender(defender); } void AiAgent::removeDefender(SceneObject* defender) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_REMOVEDEFENDER__SCENEOBJECT_); method.addObjectParameter(defender); method.executeWithVoidReturn(); } else _implementation->removeDefender(defender); } void AiAgent::setDespawnOnNoPlayerInRange(bool val) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SETDESPAWNONNOPLAYERINRANGE__BOOL_); method.addBooleanParameter(val); method.executeWithVoidReturn(); } else _implementation->setDespawnOnNoPlayerInRange(val); } void AiAgent::notifyDespawn(Zone* zone) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_NOTIFYDESPAWN__ZONE_); method.addObjectParameter(zone); method.executeWithVoidReturn(); } else _implementation->notifyDespawn(zone); } void AiAgent::scheduleDespawn() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SCHEDULEDESPAWN__); method.executeWithVoidReturn(); } else _implementation->scheduleDespawn(); } void AiAgent::scheduleDespawn(int timeToDespawn) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SCHEDULEDESPAWN__INT_); method.addSignedIntParameter(timeToDespawn); method.executeWithVoidReturn(); } else _implementation->scheduleDespawn(timeToDespawn); } void AiAgent::respawn(Zone* zone, int level) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_RESPAWN__ZONE_INT_); method.addObjectParameter(zone); method.addSignedIntParameter(level); method.executeWithVoidReturn(); } else _implementation->respawn(zone, level); } void AiAgent::addPatrolPoint(PatrolPoint& point) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { throw ObjectNotLocalException(this); } else _implementation->addPatrolPoint(point); } void AiAgent::setHomeLocation(float x, float z, float y, SceneObject* cell) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SETHOMELOCATION__FLOAT_FLOAT_FLOAT_SCENEOBJECT_); method.addFloatParameter(x); method.addFloatParameter(z); method.addFloatParameter(y); method.addObjectParameter(cell); method.executeWithVoidReturn(); } else _implementation->setHomeLocation(x, z, y, cell); } void AiAgent::setRespawnTimer(float resp) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SETRESPAWNTIMER__FLOAT_); method.addFloatParameter(resp); method.executeWithVoidReturn(); } else _implementation->setRespawnTimer(resp); } bool AiAgent::isAttackableBy(CreatureObject* object) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_ISATTACKABLEBY__CREATUREOBJECT_); method.addObjectParameter(object); return method.executeWithBooleanReturn(); } else return _implementation->isAttackableBy(object); } bool AiAgent::isAggressiveTo(CreatureObject* object) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_ISAGGRESSIVETO__CREATUREOBJECT_); method.addObjectParameter(object); return method.executeWithBooleanReturn(); } else return _implementation->isAggressiveTo(object); } void AiAgent::setOblivious() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SETOBLIVIOUS__); method.executeWithVoidReturn(); } else _implementation->setOblivious(); } void AiAgent::setWatchObject(SceneObject* obj) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SETWATCHOBJECT__SCENEOBJECT_); method.addObjectParameter(obj); method.executeWithVoidReturn(); } else _implementation->setWatchObject(obj); } void AiAgent::setStalkObject(SceneObject* obj) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SETSTALKOBJECT__SCENEOBJECT_); method.addObjectParameter(obj); method.executeWithVoidReturn(); } else _implementation->setStalkObject(obj); } void AiAgent::setFollowObject(SceneObject* obj) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SETFOLLOWOBJECT__SCENEOBJECT_); method.addObjectParameter(obj); method.executeWithVoidReturn(); } else _implementation->setFollowObject(obj); } void AiAgent::setTargetObject(SceneObject* obj) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SETTARGETOBJECT__SCENEOBJECT_); method.addObjectParameter(obj); method.executeWithVoidReturn(); } else _implementation->setTargetObject(obj); } SceneObject* AiAgent::getFollowObject() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETFOLLOWOBJECT__); return static_cast(method.executeWithObjectReturn()); } else return _implementation->getFollowObject(); } void AiAgent::selectWeapon() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SELECTWEAPON__); method.executeWithVoidReturn(); } else _implementation->selectWeapon(); } bool AiAgent::validateStateAttack(CreatureObject* target, String& args) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_VALIDATESTATEATTACK__CREATUREOBJECT_STRING_); method.addObjectParameter(target); method.addAsciiParameter(args); return method.executeWithBooleanReturn(); } else return _implementation->validateStateAttack(target, args); } bool AiAgent::isRetreating() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_ISRETREATING__); return method.executeWithBooleanReturn(); } else return _implementation->isRetreating(); } bool AiAgent::isFleeing() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_ISFLEEING__); return method.executeWithBooleanReturn(); } else return _implementation->isFleeing(); } void AiAgent::clearDespawnEvent() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_CLEARDESPAWNEVENT__); method.executeWithVoidReturn(); } else _implementation->clearDespawnEvent(); } float AiAgent::getKinetic() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETKINETIC__); return method.executeWithFloatReturn(); } else return _implementation->getKinetic(); } float AiAgent::getEnergy() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETENERGY__); return method.executeWithFloatReturn(); } else return _implementation->getEnergy(); } float AiAgent::getElectricity() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETELECTRICITY__); return method.executeWithFloatReturn(); } else return _implementation->getElectricity(); } float AiAgent::getStun() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETSTUN__); return method.executeWithFloatReturn(); } else return _implementation->getStun(); } float AiAgent::getBlast() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETBLAST__); return method.executeWithFloatReturn(); } else return _implementation->getBlast(); } float AiAgent::getHeat() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETHEAT__); return method.executeWithFloatReturn(); } else return _implementation->getHeat(); } float AiAgent::getCold() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETCOLD__); return method.executeWithFloatReturn(); } else return _implementation->getCold(); } float AiAgent::getAcid() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETACID__); return method.executeWithFloatReturn(); } else return _implementation->getAcid(); } float AiAgent::getLightSaber() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETLIGHTSABER__); return method.executeWithFloatReturn(); } else return _implementation->getLightSaber(); } bool AiAgent::isStalker() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_ISSTALKER__); return method.executeWithBooleanReturn(); } else return _implementation->isStalker(); } bool AiAgent::isKiller() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_ISKILLER__); return method.executeWithBooleanReturn(); } else return _implementation->isKiller(); } unsigned int AiAgent::getFerocity() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETFEROCITY__); return method.executeWithUnsignedIntReturn(); } else return _implementation->getFerocity(); } unsigned int AiAgent::getArmor() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETARMOR__); return method.executeWithUnsignedIntReturn(); } else return _implementation->getArmor(); } bool AiAgent::getDespawnOnNoPlayerInRange() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETDESPAWNONNOPLAYERINRANGE__); return method.executeWithBooleanReturn(); } else return _implementation->getDespawnOnNoPlayerInRange(); } int AiAgent::getNumberOfPlayersInRange() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETNUMBEROFPLAYERSINRANGE__); return method.executeWithSignedIntReturn(); } else return _implementation->getNumberOfPlayersInRange(); } String AiAgent::getFactionString() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETFACTIONSTRING__); String _return_getFactionString; method.executeWithAsciiReturn(_return_getFactionString); return _return_getFactionString; } else return _implementation->getFactionString(); } String AiAgent::getSocialGroup() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETSOCIALGROUP__); String _return_getSocialGroup; method.executeWithAsciiReturn(_return_getSocialGroup); return _return_getSocialGroup; } else return _implementation->getSocialGroup(); } float AiAgent::getChanceHit() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETCHANCEHIT__); return method.executeWithFloatReturn(); } else return _implementation->getChanceHit(); } int AiAgent::getDamageMin() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETDAMAGEMIN__); return method.executeWithSignedIntReturn(); } else return _implementation->getDamageMin(); } int AiAgent::getDamageMax() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETDAMAGEMAX__); return method.executeWithSignedIntReturn(); } else return _implementation->getDamageMax(); } int AiAgent::getBaseXp() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETBASEXP__); return method.executeWithSignedIntReturn(); } else return _implementation->getBaseXp(); } unsigned int AiAgent::getDiet() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETDIET__); return method.executeWithUnsignedIntReturn(); } else return _implementation->getDiet(); } CreatureAttackMap* AiAgent::getAttackMap() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { throw ObjectNotLocalException(this); } else return _implementation->getAttackMap(); } LootGroupCollection* AiAgent::getLootGroups() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { throw ObjectNotLocalException(this); } else return _implementation->getLootGroups(); } float AiAgent::getRespawnTimer() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_GETRESPAWNTIMER__); return method.executeWithFloatReturn(); } else return _implementation->getRespawnTimer(); } PatrolPoint* AiAgent::getHomeLocation() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { throw ObjectNotLocalException(this); } else return _implementation->getHomeLocation(); } bool AiAgent::isAiAgent() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_ISAIAGENT__); return method.executeWithBooleanReturn(); } else return _implementation->isAiAgent(); } CreatureTemplate* AiAgent::getCreatureTemplate() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { throw ObjectNotLocalException(this); } else return _implementation->getCreatureTemplate(); } bool AiAgent::hasLoot() { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_HASLOOT__); return method.executeWithBooleanReturn(); } else return _implementation->hasLoot(); } void AiAgent::setShowNextPosition(bool val) { AiAgentImplementation* _implementation = static_cast(_getImplementation()); if (_implementation == NULL) { if (!deployed) throw ObjectNotDeployedException(this); DistributedMethod method(this, RPC_SETSHOWNEXTPOSITION__BOOL_); method.addBooleanParameter(val); method.executeWithVoidReturn(); } else _implementation->setShowNextPosition(val); } DistributedObjectServant* AiAgent::_getImplementation() { if (!_updated) _updated = true; return _impl; } void AiAgent::_setImplementation(DistributedObjectServant* servant) { _impl = servant; } /* * AiAgentImplementation */ AiAgentImplementation::AiAgentImplementation(DummyConstructorParameter* param) : CreatureObjectImplementation(param) { _initializeImplementation(); } AiAgentImplementation::~AiAgentImplementation() { AiAgentImplementation::finalize(); } void AiAgentImplementation::_initializeImplementation() { _setClassHelper(AiAgentHelper::instance()); _this = NULL; _serializationHelperMethod(); } void AiAgentImplementation::_setStub(DistributedObjectStub* stub) { _this = static_cast(stub); CreatureObjectImplementation::_setStub(stub); } DistributedObjectStub* AiAgentImplementation::_getStub() { return _this.get(); } AiAgentImplementation::operator const AiAgent*() { return _this.get(); } void AiAgentImplementation::lock(bool doLock) { _this.getReferenceUnsafeStaticCast()->lock(doLock); } void AiAgentImplementation::lock(ManagedObject* obj) { _this.getReferenceUnsafeStaticCast()->lock(obj); } void AiAgentImplementation::rlock(bool doLock) { _this.getReferenceUnsafeStaticCast()->rlock(doLock); } void AiAgentImplementation::wlock(bool doLock) { _this.getReferenceUnsafeStaticCast()->wlock(doLock); } void AiAgentImplementation::wlock(ManagedObject* obj) { _this.getReferenceUnsafeStaticCast()->wlock(obj); } void AiAgentImplementation::unlock(bool doLock) { _this.getReferenceUnsafeStaticCast()->unlock(doLock); } void AiAgentImplementation::runlock(bool doLock) { _this.getReferenceUnsafeStaticCast()->runlock(doLock); } void AiAgentImplementation::_serializationHelperMethod() { CreatureObjectImplementation::_serializationHelperMethod(); _setClassName("AiAgent"); } void AiAgentImplementation::readObject(ObjectInputStream* stream) { uint16 _varCount = stream->readShort(); for (int i = 0; i < _varCount; ++i) { String _name; _name.parseFromBinaryStream(stream); uint32 _varSize = stream->readInt(); int _currentOffset = stream->getOffset(); if(AiAgentImplementation::readObjectMember(stream, _name)) { } stream->setOffset(_currentOffset + _varSize); } initializeTransientMembers(); } bool AiAgentImplementation::readObjectMember(ObjectInputStream* stream, const String& _name) { if (CreatureObjectImplementation::readObjectMember(stream, _name)) return true; if (_name == "AiAgent.skillCommands") { TypeInfo >::parseFromBinaryStream(&skillCommands, stream); return true; } if (_name == "AiAgent.patrolPoints") { TypeInfo::parseFromBinaryStream(&patrolPoints, stream); return true; } if (_name == "AiAgent.homeLocation") { TypeInfo::parseFromBinaryStream(&homeLocation, stream); return true; } if (_name == "AiAgent.nextStepPosition") { TypeInfo::parseFromBinaryStream(&nextStepPosition, stream); return true; } if (_name == "AiAgent.weapons") { TypeInfo > >::parseFromBinaryStream(&weapons, stream); return true; } if (_name == "AiAgent.camouflagedObjects") { TypeInfo > >::parseFromBinaryStream(&camouflagedObjects, stream); return true; } if (_name == "AiAgent.npcTemplate") { TypeInfo::parseFromBinaryStream(&npcTemplate, stream); return true; } if (_name == "AiAgent.baby") { TypeInfo::parseFromBinaryStream(&baby, stream); return true; } if (_name == "AiAgent.showNextMovementPosition") { TypeInfo::parseFromBinaryStream(&showNextMovementPosition, stream); return true; } if (_name == "AiAgent.movementMarkers") { TypeInfo > >::parseFromBinaryStream(&movementMarkers, stream); return true; } if (_name == "AiAgent.despawnOnNoPlayerInRange") { TypeInfo::parseFromBinaryStream(&despawnOnNoPlayerInRange, stream); return true; } if (_name == "AiAgent.followObject") { TypeInfo >::parseFromBinaryStream(&followObject, stream); return true; } if (_name == "AiAgent.followState") { TypeInfo::parseFromBinaryStream(&followState, stream); return true; } if (_name == "AiAgent.fleeing") { TypeInfo::parseFromBinaryStream(&fleeing, stream); return true; } if (_name == "AiAgent.respawnTimer") { TypeInfo::parseFromBinaryStream(&respawnTimer, stream); return true; } if (_name == "AiAgent.numberOfPlayersInRange") { TypeInfo::parseFromBinaryStream(&numberOfPlayersInRange, stream); return true; } if (_name == "AiAgent.loadedOutfit") { TypeInfo::parseFromBinaryStream(&loadedOutfit, stream); return true; } return false; } void AiAgentImplementation::writeObject(ObjectOutputStream* stream) { int _currentOffset = stream->getOffset(); stream->writeShort(0); int _varCount = AiAgentImplementation::writeObjectMembers(stream); stream->writeShort(_currentOffset, _varCount); } int AiAgentImplementation::writeObjectMembers(ObjectOutputStream* stream) { int _count = CreatureObjectImplementation::writeObjectMembers(stream); String _name; int _offset; uint32 _totalSize; _name = "AiAgent.skillCommands"; _name.toBinaryStream(stream); _offset = stream->getOffset(); stream->writeInt(0); TypeInfo >::toBinaryStream(&skillCommands, stream); _totalSize = (uint32) (stream->getOffset() - (_offset + 4)); stream->writeInt(_offset, _totalSize); _name = "AiAgent.patrolPoints"; _name.toBinaryStream(stream); _offset = stream->getOffset(); stream->writeInt(0); TypeInfo::toBinaryStream(&patrolPoints, stream); _totalSize = (uint32) (stream->getOffset() - (_offset + 4)); stream->writeInt(_offset, _totalSize); _name = "AiAgent.homeLocation"; _name.toBinaryStream(stream); _offset = stream->getOffset(); stream->writeInt(0); TypeInfo::toBinaryStream(&homeLocation, stream); _totalSize = (uint32) (stream->getOffset() - (_offset + 4)); stream->writeInt(_offset, _totalSize); _name = "AiAgent.nextStepPosition"; _name.toBinaryStream(stream); _offset = stream->getOffset(); stream->writeInt(0); TypeInfo::toBinaryStream(&nextStepPosition, stream); _totalSize = (uint32) (stream->getOffset() - (_offset + 4)); stream->writeInt(_offset, _totalSize); _name = "AiAgent.weapons"; _name.toBinaryStream(stream); _offset = stream->getOffset(); stream->writeInt(0); TypeInfo > >::toBinaryStream(&weapons, stream); _totalSize = (uint32) (stream->getOffset() - (_offset + 4)); stream->writeInt(_offset, _totalSize); _name = "AiAgent.camouflagedObjects"; _name.toBinaryStream(stream); _offset = stream->getOffset(); stream->writeInt(0); TypeInfo > >::toBinaryStream(&camouflagedObjects, stream); _totalSize = (uint32) (stream->getOffset() - (_offset + 4)); stream->writeInt(_offset, _totalSize); _name = "AiAgent.npcTemplate"; _name.toBinaryStream(stream); _offset = stream->getOffset(); stream->writeInt(0); TypeInfo::toBinaryStream(&npcTemplate, stream); _totalSize = (uint32) (stream->getOffset() - (_offset + 4)); stream->writeInt(_offset, _totalSize); _name = "AiAgent.baby"; _name.toBinaryStream(stream); _offset = stream->getOffset(); stream->writeInt(0); TypeInfo::toBinaryStream(&baby, stream); _totalSize = (uint32) (stream->getOffset() - (_offset + 4)); stream->writeInt(_offset, _totalSize); _name = "AiAgent.showNextMovementPosition"; _name.toBinaryStream(stream); _offset = stream->getOffset(); stream->writeInt(0); TypeInfo::toBinaryStream(&showNextMovementPosition, stream); _totalSize = (uint32) (stream->getOffset() - (_offset + 4)); stream->writeInt(_offset, _totalSize); _name = "AiAgent.movementMarkers"; _name.toBinaryStream(stream); _offset = stream->getOffset(); stream->writeInt(0); TypeInfo > >::toBinaryStream(&movementMarkers, stream); _totalSize = (uint32) (stream->getOffset() - (_offset + 4)); stream->writeInt(_offset, _totalSize); _name = "AiAgent.despawnOnNoPlayerInRange"; _name.toBinaryStream(stream); _offset = stream->getOffset(); stream->writeInt(0); TypeInfo::toBinaryStream(&despawnOnNoPlayerInRange, stream); _totalSize = (uint32) (stream->getOffset() - (_offset + 4)); stream->writeInt(_offset, _totalSize); _name = "AiAgent.followObject"; _name.toBinaryStream(stream); _offset = stream->getOffset(); stream->writeInt(0); TypeInfo >::toBinaryStream(&followObject, stream); _totalSize = (uint32) (stream->getOffset() - (_offset + 4)); stream->writeInt(_offset, _totalSize); _name = "AiAgent.followState"; _name.toBinaryStream(stream); _offset = stream->getOffset(); stream->writeInt(0); TypeInfo::toBinaryStream(&followState, stream); _totalSize = (uint32) (stream->getOffset() - (_offset + 4)); stream->writeInt(_offset, _totalSize); _name = "AiAgent.fleeing"; _name.toBinaryStream(stream); _offset = stream->getOffset(); stream->writeInt(0); TypeInfo::toBinaryStream(&fleeing, stream); _totalSize = (uint32) (stream->getOffset() - (_offset + 4)); stream->writeInt(_offset, _totalSize); _name = "AiAgent.respawnTimer"; _name.toBinaryStream(stream); _offset = stream->getOffset(); stream->writeInt(0); TypeInfo::toBinaryStream(&respawnTimer, stream); _totalSize = (uint32) (stream->getOffset() - (_offset + 4)); stream->writeInt(_offset, _totalSize); _name = "AiAgent.numberOfPlayersInRange"; _name.toBinaryStream(stream); _offset = stream->getOffset(); stream->writeInt(0); TypeInfo::toBinaryStream(&numberOfPlayersInRange, stream); _totalSize = (uint32) (stream->getOffset() - (_offset + 4)); stream->writeInt(_offset, _totalSize); _name = "AiAgent.loadedOutfit"; _name.toBinaryStream(stream); _offset = stream->getOffset(); stream->writeInt(0); TypeInfo::toBinaryStream(&loadedOutfit, stream); _totalSize = (uint32) (stream->getOffset() - (_offset + 4)); stream->writeInt(_offset, _totalSize); return _count + 17; } AiAgentImplementation::AiAgentImplementation() { _initializeImplementation(); // server/zone/objects/creature/AiAgent.idl(): baby = false; baby = false; // server/zone/objects/creature/AiAgent.idl(): followState = OBLIVIOUS; followState = OBLIVIOUS; // server/zone/objects/creature/AiAgent.idl(): respawnTimer = 0; respawnTimer = 0; // server/zone/objects/creature/AiAgent.idl(): showNextMovementPosition = true; showNextMovementPosition = true; // server/zone/objects/creature/AiAgent.idl(): despawnOnNoPlayerInRange = true; despawnOnNoPlayerInRange = true; // server/zone/objects/creature/AiAgent.idl(): numberOfPlayersInRange = 0; numberOfPlayersInRange = 0; // server/zone/objects/creature/AiAgent.idl(): loadedOutfit = false; loadedOutfit = false; // server/zone/objects/creature/AiAgent.idl(): Logger.setLoggingName("AiAgent"); Logger::setLoggingName("AiAgent"); // server/zone/objects/creature/AiAgent.idl(): Logger.setLogging(false); Logger::setLogging(false); // server/zone/objects/creature/AiAgent.idl(): Logger.setGlobalLogging(true); Logger::setGlobalLogging(true); // server/zone/objects/creature/AiAgent.idl(): fleeing = false; fleeing = false; // server/zone/objects/creature/AiAgent.idl(): baby = false; baby = false; } void AiAgentImplementation::finalize() { } bool AiAgentImplementation::isCamouflaged(CreatureObject* target) { // server/zone/objects/creature/AiAgent.idl(): return false; return false; } void AiAgentImplementation::clearPatrolPoints() { // server/zone/objects/creature/AiAgent.idl(): } { Locker _locker((&targetMutex)); // server/zone/objects/creature/AiAgent.idl(): patrolPoints.removeAll(); (&patrolPoints)->removeAll(); } } void AiAgentImplementation::destroyObjectFromWorld(bool sendSelfDestroy) { // server/zone/objects/creature/AiAgent.idl(): super.destroyObjectFromWorld(sendSelfDestroy); CreatureObjectImplementation::destroyObjectFromWorld(sendSelfDestroy); // server/zone/objects/creature/AiAgent.idl(): } if (moveEvent != NULL){ // server/zone/objects/creature/AiAgent.idl(): moveEvent.clearCreatureObject(); moveEvent->clearCreatureObject(); // server/zone/objects/creature/AiAgent.idl(): moveEvent = null; moveEvent = NULL; } } void AiAgentImplementation::scheduleDespawn() { // server/zone/objects/creature/AiAgent.idl(): scheduleDespawn(45); scheduleDespawn(45); } void AiAgentImplementation::addPatrolPoint(PatrolPoint& point) { // server/zone/objects/creature/AiAgent.idl(): } { Locker _locker((&targetMutex)); // server/zone/objects/creature/AiAgent.idl(): patrolPoints.add(point); (&patrolPoints)->add(point); } } void AiAgentImplementation::setHomeLocation(float x, float z, float y, SceneObject* cell) { // server/zone/objects/creature/AiAgent.idl(): homeLocation.setPosition(x, z, y); (&homeLocation)->setPosition(x, z, y); // server/zone/objects/creature/AiAgent.idl(): homeLocation.setCell(cell); (&homeLocation)->setCell(cell); // server/zone/objects/creature/AiAgent.idl(): homeLocation.setReached(true); (&homeLocation)->setReached(true); } void AiAgentImplementation::setRespawnTimer(float resp) { // server/zone/objects/creature/AiAgent.idl(): respawnTimer = resp; respawnTimer = resp; } bool AiAgentImplementation::isAttackableBy(CreatureObject* object) { // server/zone/objects/creature/AiAgent.idl(): if if (object == _this.get()) // server/zone/objects/creature/AiAgent.idl(): return false; return false; // server/zone/objects/creature/AiAgent.idl(): if if (CreatureObjectImplementation::pvpStatusBitmask == 0) // server/zone/objects/creature/AiAgent.idl(): return false; return false; // server/zone/objects/creature/AiAgent.idl(): if if (isRetreating()) // server/zone/objects/creature/AiAgent.idl(): return false; return false; // server/zone/objects/creature/AiAgent.idl(): if if (isDead()) // server/zone/objects/creature/AiAgent.idl(): return false; return false; // server/zone/objects/creature/AiAgent.idl(): unsigned if (object->isAiAgent()) // server/zone/objects/creature/AiAgent.idl(): return false; return false; // server/zone/objects/creature/AiAgent.idl(): unsigned int targetFaction = object.getFaction(); unsigned int targetFaction = object->getFaction(); // server/zone/objects/creature/AiAgent.idl(): return if (targetFaction != 0 && CreatureObjectImplementation::getFaction() != 0){ // server/zone/objects/creature/AiAgent.idl(): PlayerObject ghost = object.getPlayerObject(); ManagedReference ghost = object->getPlayerObject(); // server/zone/objects/creature/AiAgent.idl(): if if (targetFaction == getFaction()) // server/zone/objects/creature/AiAgent.idl(): return false; return false; // server/zone/objects/creature/AiAgent.idl(): } if (ghost != NULL && (targetFaction != CreatureObjectImplementation::getFaction()) && ghost->getFactionStatus() == FactionStatus::ONLEAVE) // server/zone/objects/creature/AiAgent.idl(): return false; return false; } else // server/zone/objects/creature/AiAgent.idl(): return if (targetFaction == 0 && CreatureObjectImplementation::getFaction() != 0) // server/zone/objects/creature/AiAgent.idl(): return false; return false; // server/zone/objects/creature/AiAgent.idl(): return true; return true; } void AiAgentImplementation::setOblivious() { // server/zone/objects/creature/AiAgent.idl(): followState = OBLIVIOUS; followState = OBLIVIOUS; // server/zone/objects/creature/AiAgent.idl(): setTargetObject(null); setTargetObject(NULL); // server/zone/objects/creature/AiAgent.idl(): activateMovementEvent(); activateMovementEvent(); } void AiAgentImplementation::setWatchObject(SceneObject* obj) { // server/zone/objects/creature/AiAgent.idl(): } { Locker _locker((&targetMutex)); // server/zone/objects/creature/AiAgent.idl(): followState if (_this.get()->isRetreating()) // server/zone/objects/creature/AiAgent.idl(): return; return; // server/zone/objects/creature/AiAgent.idl(): followState = WATCHING; followState = WATCHING; // server/zone/objects/creature/AiAgent.idl(): setTargetObject(obj); setTargetObject(obj); // server/zone/objects/creature/AiAgent.idl(): activateMovementEvent(); activateMovementEvent(); } } void AiAgentImplementation::setStalkObject(SceneObject* obj) { // server/zone/objects/creature/AiAgent.idl(): } { Locker _locker((&targetMutex)); // server/zone/objects/creature/AiAgent.idl(): followState if (_this.get()->isRetreating()) // server/zone/objects/creature/AiAgent.idl(): return; return; // server/zone/objects/creature/AiAgent.idl(): followState = STALKING; followState = STALKING; // server/zone/objects/creature/AiAgent.idl(): setTargetObject(obj); setTargetObject(obj); // server/zone/objects/creature/AiAgent.idl(): activateMovementEvent(); activateMovementEvent(); } } void AiAgentImplementation::setFollowObject(SceneObject* obj) { // server/zone/objects/creature/AiAgent.idl(): } { Locker _locker((&targetMutex)); // server/zone/objects/creature/AiAgent.idl(): followState if (_this.get()->isRetreating()) // server/zone/objects/creature/AiAgent.idl(): return; return; // server/zone/objects/creature/AiAgent.idl(): followState = FOLLOWING; followState = FOLLOWING; // server/zone/objects/creature/AiAgent.idl(): setTargetObject(obj); setTargetObject(obj); // server/zone/objects/creature/AiAgent.idl(): activateMovementEvent(); activateMovementEvent(); } } void AiAgentImplementation::setTargetObject(SceneObject* obj) { // server/zone/objects/creature/AiAgent.idl(): } { Locker _locker((&targetMutex)); // server/zone/objects/creature/AiAgent.idl(): } if (followObject != obj){ // server/zone/objects/creature/AiAgent.idl(): clearPatrolPoints(); clearPatrolPoints(); // server/zone/objects/creature/AiAgent.idl(): followObject = obj; followObject = obj; } } } SceneObject* AiAgentImplementation::getFollowObject() { // server/zone/objects/creature/AiAgent.idl(): return followObject; return followObject; } bool AiAgentImplementation::isRetreating() { // server/zone/objects/creature/AiAgent.idl(): return !homeLocation.isReached(); return !(&homeLocation)->isReached(); } bool AiAgentImplementation::isFleeing() { // server/zone/objects/creature/AiAgent.idl(): return fleeing; return fleeing; } float AiAgentImplementation::getKinetic() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return 0; return 0; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().getKinetic(); return (&npcTemplate)->get()->getKinetic(); } float AiAgentImplementation::getEnergy() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return 0; return 0; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().getEnergy(); return (&npcTemplate)->get()->getEnergy(); } float AiAgentImplementation::getElectricity() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return 0; return 0; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().getElectricity(); return (&npcTemplate)->get()->getElectricity(); } float AiAgentImplementation::getStun() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return 0; return 0; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().getStun(); return (&npcTemplate)->get()->getStun(); } float AiAgentImplementation::getBlast() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return 0; return 0; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().getBlast(); return (&npcTemplate)->get()->getBlast(); } float AiAgentImplementation::getHeat() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return 0; return 0; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().getHeat(); return (&npcTemplate)->get()->getHeat(); } float AiAgentImplementation::getCold() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return 0; return 0; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().getCold(); return (&npcTemplate)->get()->getCold(); } float AiAgentImplementation::getAcid() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return 0; return 0; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().getAcid(); return (&npcTemplate)->get()->getAcid(); } float AiAgentImplementation::getLightSaber() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return 0; return 0; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().getLightSaber(); return (&npcTemplate)->get()->getLightSaber(); } bool AiAgentImplementation::isStalker() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return false; return false; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().isStalker(); return (&npcTemplate)->get()->isStalker(); } bool AiAgentImplementation::isKiller() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return false; return false; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().isKiller(); return (&npcTemplate)->get()->isKiller(); } unsigned int AiAgentImplementation::getFerocity() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return 0; return 0; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().getFerocity(); return (&npcTemplate)->get()->getFerocity(); } unsigned int AiAgentImplementation::getArmor() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return 0; return 0; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().getArmor(); return (&npcTemplate)->get()->getArmor(); } bool AiAgentImplementation::getDespawnOnNoPlayerInRange() { // server/zone/objects/creature/AiAgent.idl(): return despawnOnNoPlayerInRange; return despawnOnNoPlayerInRange; } int AiAgentImplementation::getNumberOfPlayersInRange() { // server/zone/objects/creature/AiAgent.idl(): return numberOfPlayersInRange; return numberOfPlayersInRange; } String AiAgentImplementation::getFactionString() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return ""; return ""; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().getFaction(); return (&npcTemplate)->get()->getFaction(); } String AiAgentImplementation::getSocialGroup() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return ""; return ""; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().getSocialGroup(); return (&npcTemplate)->get()->getSocialGroup(); } float AiAgentImplementation::getChanceHit() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return false; return false; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().getChanceHit(); return (&npcTemplate)->get()->getChanceHit(); } int AiAgentImplementation::getDamageMin() { // server/zone/objects/creature/AiAgent.idl(): if if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return 0; return 0; // server/zone/objects/creature/AiAgent.idl(): return if (getWeapon() == NULL) // server/zone/objects/creature/AiAgent.idl(): return 0; return 0; // server/zone/objects/creature/AiAgent.idl(): return getWeapon().getMinDamage(); return getWeapon()->getMinDamage(); } int AiAgentImplementation::getDamageMax() { // server/zone/objects/creature/AiAgent.idl(): if if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return 0; return 0; // server/zone/objects/creature/AiAgent.idl(): return if (getWeapon() == NULL) // server/zone/objects/creature/AiAgent.idl(): return 0; return 0; // server/zone/objects/creature/AiAgent.idl(): return getWeapon().getMaxDamage(); return getWeapon()->getMaxDamage(); } int AiAgentImplementation::getBaseXp() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return 0; return 0; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().getBaseXp(); return (&npcTemplate)->get()->getBaseXp(); } unsigned int AiAgentImplementation::getDiet() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return 0; return 0; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().getDiet(); return (&npcTemplate)->get()->getDiet(); } CreatureAttackMap* AiAgentImplementation::getAttackMap() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return null; return NULL; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().getAttacks(); return (&npcTemplate)->get()->getAttacks(); } LootGroupCollection* AiAgentImplementation::getLootGroups() { // server/zone/objects/creature/AiAgent.idl(): return if ((&npcTemplate)->get() == NULL) // server/zone/objects/creature/AiAgent.idl(): return null; return NULL; // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get().getLootGroups(); return (&npcTemplate)->get()->getLootGroups(); } float AiAgentImplementation::getRespawnTimer() { // server/zone/objects/creature/AiAgent.idl(): return respawnTimer; return respawnTimer; } PatrolPoint* AiAgentImplementation::getHomeLocation() { // server/zone/objects/creature/AiAgent.idl(): return homeLocation; return (&homeLocation); } bool AiAgentImplementation::isAiAgent() { // server/zone/objects/creature/AiAgent.idl(): return true; return true; } CreatureTemplate* AiAgentImplementation::getCreatureTemplate() { // server/zone/objects/creature/AiAgent.idl(): return npcTemplate.get(); return (&npcTemplate)->get(); } void AiAgentImplementation::setShowNextPosition(bool val) { // server/zone/objects/creature/AiAgent.idl(): showNextMovementPosition = val; showNextMovementPosition = val; } /* * AiAgentAdapter */ #include "engine/orb/messages/InvokeMethodMessage.h" AiAgentAdapter::AiAgentAdapter(AiAgent* obj) : CreatureObjectAdapter(obj) { } void AiAgentAdapter::invokeMethod(uint32 methid, DistributedMethod* inv) { DOBMessage* resp = inv->getInvocationMessage(); switch (methid) { case RPC_INITIALIZETRANSIENTMEMBERS__: { initializeTransientMembers(); } break; case RPC_FINALIZE__: { finalize(); } break; case RPC_ACTIVATERECOVERY__: { activateRecovery(); } break; case RPC_ACTIVATEMOVEMENTEVENT__: { activateMovementEvent(); } break; case RPC_ACTIVATEWAITEVENT__: { activateWaitEvent(); } break; case RPC_ACTIVATEAWARENESSEVENT__CREATUREOBJECT_: { activateAwarenessEvent(static_cast(inv->getObjectParameter())); } break; case RPC_TRYRETREAT__: { resp->insertBoolean(tryRetreat()); } break; case RPC_DORECOVERY__: { doRecovery(); } break; case RPC_DOATTACK__: { doAttack(); } break; case RPC_DOMOVEMENT__: { doMovement(); } break; case RPC_SETLEVEL__INT_: { setLevel(inv->getSignedIntParameter()); } break; case RPC_SENDBASELINESTO__SCENEOBJECT_: { sendBaselinesTo(static_cast(inv->getObjectParameter())); } break; case RPC_CALCULATEATTACKMINDAMAGE__INT_: { resp->insertSignedInt(calculateAttackMinDamage(inv->getSignedIntParameter())); } break; case RPC_CALCULATEATTACKMAXDAMAGE__INT_: { resp->insertSignedInt(calculateAttackMaxDamage(inv->getSignedIntParameter())); } break; case RPC_CALCULATEATTACKSPEED__INT_: { resp->insertFloat(calculateAttackSpeed(inv->getSignedIntParameter())); } break; case RPC_ISCAMOUFLAGED__CREATUREOBJECT_: { resp->insertBoolean(isCamouflaged(static_cast(inv->getObjectParameter()))); } break; case RPC_ISSCENTMASKED__CREATUREOBJECT_: { resp->insertBoolean(isScentMasked(static_cast(inv->getObjectParameter()))); } break; case RPC_ISCONCEALED__CREATUREOBJECT_: { resp->insertBoolean(isConcealed(static_cast(inv->getObjectParameter()))); } break; case RPC_HANDLEOBJECTMENUSELECT__CREATUREOBJECT_BYTE_: { resp->insertSignedInt(handleObjectMenuSelect(static_cast(inv->getObjectParameter()), inv->getByteParameter())); } break; case RPC_CHECKNEWANGLE__: { checkNewAngle(); } break; case RPC_FILLATTRIBUTELIST__ATTRIBUTELISTMESSAGE_CREATUREOBJECT_: { fillAttributeList(static_cast(inv->getObjectParameter()), static_cast(inv->getObjectParameter())); } break; case RPC_SETNEXTPOSITION__FLOAT_FLOAT_FLOAT_SCENEOBJECT_: { setNextPosition(inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), static_cast(inv->getObjectParameter())); } break; case RPC_NOTIFYPOSITIONUPDATE__QUADTREEENTRY_: { notifyPositionUpdate(static_cast(inv->getObjectParameter())); } break; case RPC_CLEARPATROLPOINTS__: { clearPatrolPoints(); } break; case RPC_INFLICTDAMAGE__TANGIBLEOBJECT_INT_FLOAT_BOOL_BOOL_: { resp->insertSignedInt(inflictDamage(static_cast(inv->getObjectParameter()), inv->getSignedIntParameter(), inv->getFloatParameter(), inv->getBooleanParameter(), inv->getBooleanParameter())); } break; case RPC_INFLICTDAMAGE__TANGIBLEOBJECT_INT_FLOAT_BOOL_STRING_BOOL_: { String xp; resp->insertSignedInt(inflictDamage(static_cast(inv->getObjectParameter()), inv->getSignedIntParameter(), inv->getFloatParameter(), inv->getBooleanParameter(), inv->getAsciiParameter(xp), inv->getBooleanParameter())); } break; case RPC_SENDCONVERSATIONSTARTTO__SCENEOBJECT_: { sendConversationStartTo(static_cast(inv->getObjectParameter())); } break; case RPC_SENDDEFAULTCONVERSATIONTO__SCENEOBJECT_: { sendDefaultConversationTo(static_cast(inv->getObjectParameter())); } break; case RPC_SELECTCONVERSATIONOPTION__INT_SCENEOBJECT_: { selectConversationOption(inv->getSignedIntParameter(), static_cast(inv->getObjectParameter())); } break; case RPC_NOTIFYOBJECTDESTRUCTIONOBSERVERS__TANGIBLEOBJECT_INT_: { resp->insertSignedInt(notifyObjectDestructionObservers(static_cast(inv->getObjectParameter()), inv->getSignedIntParameter())); } break; case RPC_NOTIFYCONVERSEOBSERVERS__CREATUREOBJECT_: { resp->insertSignedInt(notifyConverseObservers(static_cast(inv->getObjectParameter()))); } break; case RPC_NOTIFYATTACK__OBSERVABLE_: { resp->insertSignedInt(notifyAttack(static_cast(inv->getObjectParameter()))); } break; case RPC_NOTIFYCALLFORHELP__OBSERVABLE_MANAGEDOBJECT_: { resp->insertSignedInt(notifyCallForHelp(static_cast(inv->getObjectParameter()), static_cast(inv->getObjectParameter()))); } break; case RPC_DESTROYOBJECTFROMWORLD__BOOL_: { destroyObjectFromWorld(inv->getBooleanParameter()); } break; case RPC_ACTIVATEPOSTURERECOVERY__: { activatePostureRecovery(); } break; case RPC_QUEUEDIZZYFALLEVENT__: { queueDizzyFallEvent(); } break; case RPC_CLEARCOMBATSTATE__BOOL_: { clearCombatState(inv->getBooleanParameter()); } break; case RPC_SETDEFENDER__SCENEOBJECT_: { setDefender(static_cast(inv->getObjectParameter())); } break; case RPC_ADDDEFENDER__SCENEOBJECT_: { addDefender(static_cast(inv->getObjectParameter())); } break; case RPC_REMOVEDEFENDER__SCENEOBJECT_: { removeDefender(static_cast(inv->getObjectParameter())); } break; case RPC_SETDESPAWNONNOPLAYERINRANGE__BOOL_: { setDespawnOnNoPlayerInRange(inv->getBooleanParameter()); } break; case RPC_NOTIFYDESPAWN__ZONE_: { notifyDespawn(static_cast(inv->getObjectParameter())); } break; case RPC_SCHEDULEDESPAWN__: { scheduleDespawn(); } break; case RPC_SCHEDULEDESPAWN__INT_: { scheduleDespawn(inv->getSignedIntParameter()); } break; case RPC_RESPAWN__ZONE_INT_: { respawn(static_cast(inv->getObjectParameter()), inv->getSignedIntParameter()); } break; case RPC_SETHOMELOCATION__FLOAT_FLOAT_FLOAT_SCENEOBJECT_: { setHomeLocation(inv->getFloatParameter(), inv->getFloatParameter(), inv->getFloatParameter(), static_cast(inv->getObjectParameter())); } break; case RPC_SETRESPAWNTIMER__FLOAT_: { setRespawnTimer(inv->getFloatParameter()); } break; case RPC_ISATTACKABLEBY__CREATUREOBJECT_: { resp->insertBoolean(isAttackableBy(static_cast(inv->getObjectParameter()))); } break; case RPC_ISAGGRESSIVETO__CREATUREOBJECT_: { resp->insertBoolean(isAggressiveTo(static_cast(inv->getObjectParameter()))); } break; case RPC_SETOBLIVIOUS__: { setOblivious(); } break; case RPC_SETWATCHOBJECT__SCENEOBJECT_: { setWatchObject(static_cast(inv->getObjectParameter())); } break; case RPC_SETSTALKOBJECT__SCENEOBJECT_: { setStalkObject(static_cast(inv->getObjectParameter())); } break; case RPC_SETFOLLOWOBJECT__SCENEOBJECT_: { setFollowObject(static_cast(inv->getObjectParameter())); } break; case RPC_SETTARGETOBJECT__SCENEOBJECT_: { setTargetObject(static_cast(inv->getObjectParameter())); } break; case RPC_GETFOLLOWOBJECT__: { resp->insertLong(getFollowObject()->_getObjectID()); } break; case RPC_SELECTWEAPON__: { selectWeapon(); } break; case RPC_VALIDATESTATEATTACK__CREATUREOBJECT_STRING_: { String args; resp->insertBoolean(validateStateAttack(static_cast(inv->getObjectParameter()), inv->getAsciiParameter(args))); } break; case RPC_ISRETREATING__: { resp->insertBoolean(isRetreating()); } break; case RPC_ISFLEEING__: { resp->insertBoolean(isFleeing()); } break; case RPC_CLEARDESPAWNEVENT__: { clearDespawnEvent(); } break; case RPC_GETKINETIC__: { resp->insertFloat(getKinetic()); } break; case RPC_GETENERGY__: { resp->insertFloat(getEnergy()); } break; case RPC_GETELECTRICITY__: { resp->insertFloat(getElectricity()); } break; case RPC_GETSTUN__: { resp->insertFloat(getStun()); } break; case RPC_GETBLAST__: { resp->insertFloat(getBlast()); } break; case RPC_GETHEAT__: { resp->insertFloat(getHeat()); } break; case RPC_GETCOLD__: { resp->insertFloat(getCold()); } break; case RPC_GETACID__: { resp->insertFloat(getAcid()); } break; case RPC_GETLIGHTSABER__: { resp->insertFloat(getLightSaber()); } break; case RPC_ISSTALKER__: { resp->insertBoolean(isStalker()); } break; case RPC_ISKILLER__: { resp->insertBoolean(isKiller()); } break; case RPC_GETFEROCITY__: { resp->insertInt(getFerocity()); } break; case RPC_GETARMOR__: { resp->insertInt(getArmor()); } break; case RPC_GETDESPAWNONNOPLAYERINRANGE__: { resp->insertBoolean(getDespawnOnNoPlayerInRange()); } break; case RPC_GETNUMBEROFPLAYERSINRANGE__: { resp->insertSignedInt(getNumberOfPlayersInRange()); } break; case RPC_GETFACTIONSTRING__: { resp->insertAscii(getFactionString()); } break; case RPC_GETSOCIALGROUP__: { resp->insertAscii(getSocialGroup()); } break; case RPC_GETCHANCEHIT__: { resp->insertFloat(getChanceHit()); } break; case RPC_GETDAMAGEMIN__: { resp->insertSignedInt(getDamageMin()); } break; case RPC_GETDAMAGEMAX__: { resp->insertSignedInt(getDamageMax()); } break; case RPC_GETBASEXP__: { resp->insertSignedInt(getBaseXp()); } break; case RPC_GETDIET__: { resp->insertInt(getDiet()); } break; case RPC_GETRESPAWNTIMER__: { resp->insertFloat(getRespawnTimer()); } break; case RPC_ISAIAGENT__: { resp->insertBoolean(isAiAgent()); } break; case RPC_HASLOOT__: { resp->insertBoolean(hasLoot()); } break; case RPC_SETSHOWNEXTPOSITION__BOOL_: { setShowNextPosition(inv->getBooleanParameter()); } break; default: throw Exception("Method does not exists"); } } void AiAgentAdapter::initializeTransientMembers() { (static_cast(stub))->initializeTransientMembers(); } void AiAgentAdapter::finalize() { (static_cast(stub))->finalize(); } void AiAgentAdapter::activateRecovery() { (static_cast(stub))->activateRecovery(); } void AiAgentAdapter::activateMovementEvent() { (static_cast(stub))->activateMovementEvent(); } void AiAgentAdapter::activateWaitEvent() { (static_cast(stub))->activateWaitEvent(); } void AiAgentAdapter::activateAwarenessEvent(CreatureObject* target) { (static_cast(stub))->activateAwarenessEvent(target); } bool AiAgentAdapter::tryRetreat() { return (static_cast(stub))->tryRetreat(); } void AiAgentAdapter::doRecovery() { (static_cast(stub))->doRecovery(); } void AiAgentAdapter::doAttack() { (static_cast(stub))->doAttack(); } void AiAgentAdapter::doMovement() { (static_cast(stub))->doMovement(); } void AiAgentAdapter::setLevel(int lvl) { (static_cast(stub))->setLevel(lvl); } void AiAgentAdapter::sendBaselinesTo(SceneObject* player) { (static_cast(stub))->sendBaselinesTo(player); } int AiAgentAdapter::calculateAttackMinDamage(int level) { return (static_cast(stub))->calculateAttackMinDamage(level); } int AiAgentAdapter::calculateAttackMaxDamage(int level) { return (static_cast(stub))->calculateAttackMaxDamage(level); } float AiAgentAdapter::calculateAttackSpeed(int level) { return (static_cast(stub))->calculateAttackSpeed(level); } bool AiAgentAdapter::isCamouflaged(CreatureObject* target) { return (static_cast(stub))->isCamouflaged(target); } bool AiAgentAdapter::isScentMasked(CreatureObject* target) { return (static_cast(stub))->isScentMasked(target); } bool AiAgentAdapter::isConcealed(CreatureObject* target) { return (static_cast(stub))->isConcealed(target); } int AiAgentAdapter::handleObjectMenuSelect(CreatureObject* player, byte selectedID) { return (static_cast(stub))->handleObjectMenuSelect(player, selectedID); } void AiAgentAdapter::checkNewAngle() { (static_cast(stub))->checkNewAngle(); } void AiAgentAdapter::fillAttributeList(AttributeListMessage* msg, CreatureObject* object) { (static_cast(stub))->fillAttributeList(msg, object); } void AiAgentAdapter::setNextPosition(float x, float z, float y, SceneObject* cell) { (static_cast(stub))->setNextPosition(x, z, y, cell); } void AiAgentAdapter::notifyPositionUpdate(QuadTreeEntry* entry) { (static_cast(stub))->notifyPositionUpdate(entry); } void AiAgentAdapter::clearPatrolPoints() { (static_cast(stub))->clearPatrolPoints(); } int AiAgentAdapter::inflictDamage(TangibleObject* attacker, int damageType, float damage, bool destroy, bool notifyClient) { return (static_cast(stub))->inflictDamage(attacker, damageType, damage, destroy, notifyClient); } int AiAgentAdapter::inflictDamage(TangibleObject* attacker, int damageType, float damage, bool destroy, const String& xp, bool notifyClient) { return (static_cast(stub))->inflictDamage(attacker, damageType, damage, destroy, xp, notifyClient); } void AiAgentAdapter::sendConversationStartTo(SceneObject* player) { (static_cast(stub))->sendConversationStartTo(player); } void AiAgentAdapter::sendDefaultConversationTo(SceneObject* player) { (static_cast(stub))->sendDefaultConversationTo(player); } void AiAgentAdapter::selectConversationOption(int option, SceneObject* obj) { (static_cast(stub))->selectConversationOption(option, obj); } int AiAgentAdapter::notifyObjectDestructionObservers(TangibleObject* attacker, int condition) { return (static_cast(stub))->notifyObjectDestructionObservers(attacker, condition); } int AiAgentAdapter::notifyConverseObservers(CreatureObject* converser) { return (static_cast(stub))->notifyConverseObservers(converser); } int AiAgentAdapter::notifyAttack(Observable* observable) { return (static_cast(stub))->notifyAttack(observable); } int AiAgentAdapter::notifyCallForHelp(Observable* observable, ManagedObject* arg1) { return (static_cast(stub))->notifyCallForHelp(observable, arg1); } void AiAgentAdapter::destroyObjectFromWorld(bool sendSelfDestroy) { (static_cast(stub))->destroyObjectFromWorld(sendSelfDestroy); } void AiAgentAdapter::activatePostureRecovery() { (static_cast(stub))->activatePostureRecovery(); } void AiAgentAdapter::queueDizzyFallEvent() { (static_cast(stub))->queueDizzyFallEvent(); } void AiAgentAdapter::clearCombatState(bool clearDefenders) { (static_cast(stub))->clearCombatState(clearDefenders); } void AiAgentAdapter::setDefender(SceneObject* defender) { (static_cast(stub))->setDefender(defender); } void AiAgentAdapter::addDefender(SceneObject* defender) { (static_cast(stub))->addDefender(defender); } void AiAgentAdapter::removeDefender(SceneObject* defender) { (static_cast(stub))->removeDefender(defender); } void AiAgentAdapter::setDespawnOnNoPlayerInRange(bool val) { (static_cast(stub))->setDespawnOnNoPlayerInRange(val); } void AiAgentAdapter::notifyDespawn(Zone* zone) { (static_cast(stub))->notifyDespawn(zone); } void AiAgentAdapter::scheduleDespawn() { (static_cast(stub))->scheduleDespawn(); } void AiAgentAdapter::scheduleDespawn(int timeToDespawn) { (static_cast(stub))->scheduleDespawn(timeToDespawn); } void AiAgentAdapter::respawn(Zone* zone, int level) { (static_cast(stub))->respawn(zone, level); } void AiAgentAdapter::setHomeLocation(float x, float z, float y, SceneObject* cell) { (static_cast(stub))->setHomeLocation(x, z, y, cell); } void AiAgentAdapter::setRespawnTimer(float resp) { (static_cast(stub))->setRespawnTimer(resp); } bool AiAgentAdapter::isAttackableBy(CreatureObject* object) { return (static_cast(stub))->isAttackableBy(object); } bool AiAgentAdapter::isAggressiveTo(CreatureObject* object) { return (static_cast(stub))->isAggressiveTo(object); } void AiAgentAdapter::setOblivious() { (static_cast(stub))->setOblivious(); } void AiAgentAdapter::setWatchObject(SceneObject* obj) { (static_cast(stub))->setWatchObject(obj); } void AiAgentAdapter::setStalkObject(SceneObject* obj) { (static_cast(stub))->setStalkObject(obj); } void AiAgentAdapter::setFollowObject(SceneObject* obj) { (static_cast(stub))->setFollowObject(obj); } void AiAgentAdapter::setTargetObject(SceneObject* obj) { (static_cast(stub))->setTargetObject(obj); } SceneObject* AiAgentAdapter::getFollowObject() { return (static_cast(stub))->getFollowObject(); } void AiAgentAdapter::selectWeapon() { (static_cast(stub))->selectWeapon(); } bool AiAgentAdapter::validateStateAttack(CreatureObject* target, String& args) { return (static_cast(stub))->validateStateAttack(target, args); } bool AiAgentAdapter::isRetreating() { return (static_cast(stub))->isRetreating(); } bool AiAgentAdapter::isFleeing() { return (static_cast(stub))->isFleeing(); } void AiAgentAdapter::clearDespawnEvent() { (static_cast(stub))->clearDespawnEvent(); } float AiAgentAdapter::getKinetic() { return (static_cast(stub))->getKinetic(); } float AiAgentAdapter::getEnergy() { return (static_cast(stub))->getEnergy(); } float AiAgentAdapter::getElectricity() { return (static_cast(stub))->getElectricity(); } float AiAgentAdapter::getStun() { return (static_cast(stub))->getStun(); } float AiAgentAdapter::getBlast() { return (static_cast(stub))->getBlast(); } float AiAgentAdapter::getHeat() { return (static_cast(stub))->getHeat(); } float AiAgentAdapter::getCold() { return (static_cast(stub))->getCold(); } float AiAgentAdapter::getAcid() { return (static_cast(stub))->getAcid(); } float AiAgentAdapter::getLightSaber() { return (static_cast(stub))->getLightSaber(); } bool AiAgentAdapter::isStalker() { return (static_cast(stub))->isStalker(); } bool AiAgentAdapter::isKiller() { return (static_cast(stub))->isKiller(); } unsigned int AiAgentAdapter::getFerocity() { return (static_cast(stub))->getFerocity(); } unsigned int AiAgentAdapter::getArmor() { return (static_cast(stub))->getArmor(); } bool AiAgentAdapter::getDespawnOnNoPlayerInRange() { return (static_cast(stub))->getDespawnOnNoPlayerInRange(); } int AiAgentAdapter::getNumberOfPlayersInRange() { return (static_cast(stub))->getNumberOfPlayersInRange(); } String AiAgentAdapter::getFactionString() { return (static_cast(stub))->getFactionString(); } String AiAgentAdapter::getSocialGroup() { return (static_cast(stub))->getSocialGroup(); } float AiAgentAdapter::getChanceHit() { return (static_cast(stub))->getChanceHit(); } int AiAgentAdapter::getDamageMin() { return (static_cast(stub))->getDamageMin(); } int AiAgentAdapter::getDamageMax() { return (static_cast(stub))->getDamageMax(); } int AiAgentAdapter::getBaseXp() { return (static_cast(stub))->getBaseXp(); } unsigned int AiAgentAdapter::getDiet() { return (static_cast(stub))->getDiet(); } float AiAgentAdapter::getRespawnTimer() { return (static_cast(stub))->getRespawnTimer(); } bool AiAgentAdapter::isAiAgent() { return (static_cast(stub))->isAiAgent(); } bool AiAgentAdapter::hasLoot() { return (static_cast(stub))->hasLoot(); } void AiAgentAdapter::setShowNextPosition(bool val) { (static_cast(stub))->setShowNextPosition(val); } /* * AiAgentHelper */ AiAgentHelper* AiAgentHelper::staticInitializer = AiAgentHelper::instance(); AiAgentHelper::AiAgentHelper() { className = "AiAgent"; Core::getObjectBroker()->registerClass(className, this); } void AiAgentHelper::finalizeHelper() { AiAgentHelper::finalize(); } DistributedObject* AiAgentHelper::instantiateObject() { return new AiAgent(DummyConstructorParameter::instance()); } DistributedObjectServant* AiAgentHelper::instantiateServant() { return new AiAgentImplementation(); } DistributedObjectAdapter* AiAgentHelper::createAdapter(DistributedObjectStub* obj) { DistributedObjectAdapter* adapter = new AiAgentAdapter(static_cast(obj)); obj->_setClassName(className); obj->_setClassHelper(this); adapter->setStub(obj); return adapter; }