本文整理汇总了C++中ZoneServer类的典型用法代码示例。如果您正苦于以下问题:C++ ZoneServer类的具体用法?C++ ZoneServer怎么用?C++ ZoneServer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ZoneServer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ProcessServerOP_ZoneShutdown
void ZoneServer::ProcessServerOP_ZoneShutdown(ServerPacket* pack)
{
ServerZoneStateChange_struct* s = (ServerZoneStateChange_struct *) pack->pBuffer;
ZoneServer* zs = 0;
if (s->ZoneServerID != 0)
{
zs = zoneserver_list.FindByID(s->ZoneServerID);
}
else if (s->zoneid != 0)
{
zs = zoneserver_list.FindByZoneID(s->zoneid);
}
else
{
zoneserver_list.SendEmoteMessage(s->adminname, 0, 0, "Error: SOP_ZoneShutdown: neither ID nor name specified");
}
if (zs == 0)
{
zoneserver_list.SendEmoteMessage(s->adminname, 0, 0, "Error: SOP_ZoneShutdown: zoneserver not found");
}
else
{
zs->SendPacket(pack);
}
}
开发者ID:cavedude00,项目名称:eqmacemu,代码行数:26,代码来源:zoneserver_process.cpp
示例2: locker
Vector3 BountyMissionObjectiveImplementation::getTargetPosition() {
Locker locker(&syncMutex);
ManagedReference<MissionObject* > mission = this->mission.get();
if (isPlayerTarget()) {
uint64 targetId = mission->getTargetObjectId();
ZoneServer* zoneServer = getPlayerOwner().get()->getZoneServer();
if (zoneServer != NULL) {
ManagedReference<CreatureObject*> creature = zoneServer->getObject(targetId).castTo<CreatureObject*>();
if (creature != NULL) {
return creature->getWorldPosition();
}
}
} else {
if (targetTask != NULL) {
return targetTask->getTargetPosition();
}
}
Vector3 empty;
return empty;
}
开发者ID:Mesagoppinmypants,项目名称:mtgtestserver,代码行数:25,代码来源:BountyMissionObjectiveImplementation.cpp
示例3: fillObjectMenuResponse
void RingObjectMenuComponent::fillObjectMenuResponse(SceneObject* sceneObject, ObjectMenuResponse* menuResponse, CreatureObject* player) const {
if (!sceneObject->isTangibleObject())
return;
WearableObject* wearable = cast<WearableObject*>(sceneObject);
if (wearable == NULL)
return;
ZoneServer* server = player->getZoneServer();
PlayerObject* ghost = player->getPlayerObject();
if (server == NULL || ghost == NULL)
return;
if (!wearable->isEquipped() && !wearable->isNoTrade()) {
if (ghost->isMarried()) {
menuResponse->addRadialMenuItem(234, 3, "@unity:mnu_divorce"); // Divorce
} else {
uint64 targetID = player->getTargetID();
ManagedReference<CreatureObject*> target = server->getObject(targetID, true).castTo<CreatureObject*>();
if (target != NULL && target->isPlayerCreature())
menuResponse->addRadialMenuItem(22, 3, "@unity:mnu_propose"); // Propose Unity
}
}
TangibleObjectMenuComponent::fillObjectMenuResponse(sceneObject, menuResponse, player);
}
开发者ID:ModTheGalaxy,项目名称:mtgserver,代码行数:29,代码来源:RingObjectMenuComponent.cpp
示例4: sizeof
void ZoneServer::ProcessServerOP_ZoneToZoneRequest(ServerPacket* pack)
{
if (pack->size != sizeof(ZoneToZone_Struct))
{
cout << "Wrong size on ServerOP_ZoneToZoneRequest. Got: " << pack->size << ", Expected: " << sizeof(ZoneToZone_Struct) << endl;
return;
}
ZoneToZone_Struct* ztz = (ZoneToZone_Struct*) pack->pBuffer;
ZoneServer* zsc = 0;
if (GetZoneID() == ztz->current_zone_id)
{
zsc = this;
}
else
zsc = zoneserver_list.FindByZoneID(ztz->current_zone_id);
if(zsc == 0)
return;
if(GetZoneID() == ztz->current_zone_id)
{
/*if (ztz->admin < 80 && ztz->ignorerestrictions < 2 && zoneserver_list.IsZoneLocked(ztz->requested_zone_id))
{
ztz->response = 0;
zsc->SendPacket(pack);
return;
}*/
ZoneServer* zs = zoneserver_list.FindByZoneID(ztz->requested_zone_id);
if(zs)
{
// send to the zoneserver hosting the zone for further processing
EQC::Common::PrintF(CP_WORLDSERVER, "Found a zone already booted for %s\n", ztz->name);
zs->SendPacket(pack);
}
else
{
char zonename[16];
strcpy(zonename,Database::Instance()->GetZoneName(ztz->requested_zone_id,true));
if (zoneserver_list.TriggerBootup(zonename))
{
EQC::Common::PrintF(CP_WORLDSERVER, "Successfully booted a zone for %s\n", ztz->name);
// bootup successful, ready to rock
ztz->response = 1;
}
else
{
EQC::Common::PrintF(CP_WORLDSERVER, "FAILED to boot a zone for %s\n", ztz->name);
// bootup failed, send back error code 0
ztz->response = 0;
}
zsc->SendPacket(pack);
}
}
else
{
EQC::Common::PrintF(CP_WORLDSERVER, "Processing ZTZ for ingress to zone for client %s\n", ztz->name);
// Send the response back to the original zoneserver
zsc->SendPacket(pack);
}
return;
}
开发者ID:cavedude00,项目名称:eqmacemu,代码行数:60,代码来源:zoneserver_process.cpp
示例5: destroyObjectFromWorld
void CityHallZoneComponent::destroyObjectFromWorld(SceneObject* sceneObject, bool sendSelfDestroy) const {
ZoneServer* zoneServer = sceneObject->getZoneServer();
if (zoneServer == NULL || zoneServer->isServerShuttingDown()) {
ZoneComponent::destroyObjectFromWorld(sceneObject, sendSelfDestroy);
return;
}
ManagedReference<CityRegion*> cityRegion = sceneObject->getCityRegion().get();
if (cityRegion != NULL ) {
Locker clocker(cityRegion, sceneObject);
if (cityRegion->getCityHall() == sceneObject) {
cityRegion->setCityHall(NULL);
}
clocker.release();
CityManager* cityManager = zoneServer->getCityManager();
cityManager->destroyCity(cityRegion);
}
ZoneComponent::destroyObjectFromWorld(sceneObject, sendSelfDestroy);
}
开发者ID:ModTheGalaxy,项目名称:mtgserver,代码行数:26,代码来源:CityHallZoneComponent.cpp
示例6: iterator
bool ZSList::SendPacket(uint32 ZoneID, uint16 instanceID, ServerPacket* pack) {
LinkedListIterator<ZoneServer*> iterator(list);
iterator.Reset();
if(instanceID != 0)
{
while(iterator.MoreElements()) {
if(iterator.GetData()->GetInstanceID() == instanceID) {
ZoneServer* tmp = iterator.GetData();
return(tmp->SendPacket(pack));
}
iterator.Advance();
}
}
else
{
while(iterator.MoreElements()) {
if (iterator.GetData()->GetZoneID() == ZoneID
&& iterator.GetData()->GetInstanceID() == 0) {
ZoneServer* tmp = iterator.GetData();
return(tmp->SendPacket(pack));
}
iterator.Advance();
}
}
return(false);
}
开发者ID:Corysia,项目名称:Server,代码行数:27,代码来源:zonelist.cpp
示例7: getPlayer
void LootkitObjectImplementation::createItem() {
for (int i = 0; i<comps.size(); ++i) {
if (components.get(comps.get(i)) == 0) {
return; // Still missing pieces
}
}
ManagedReference<CreatureObject*> player = getPlayer();
if (player != NULL) {
player->sendSystemMessage("@loot_kit:new_item_created");
ManagedReference<SceneObject*> inventory = player->getSlottedObject("inventory");
ZoneServer* zoneServer = server->getZoneServer();
ManagedReference<SceneObject*> rewardObject = zoneServer->createObject(reward.get(System::random(reward.size()-1)), 2);
Locker clocker(inventory, player);
rewardObject->sendTo(player, true);
if (inventory->transferObject(rewardObject, -1, true)) {
//getParent()->removeObject(_this, true);
destroyObjectFromWorld(true);
if (isPersistent())
destroyObjectFromDatabase(true);
}
}
}
开发者ID:Skyyyr,项目名称:GR-Core,代码行数:27,代码来源:LootkitObjectImplementation.cpp
示例8: createChildObjects
void WeaponObjectImplementation::createChildObjects() {
// Create any child objects in a weapon.
ZoneServer* zoneServer = server->getZoneServer();
for (int i = 0; i < templateObject->getChildObjectsSize(); ++i) {
ChildObject* child = templateObject->getChildObject(i);
if (child == NULL)
continue;
ManagedReference<SceneObject*> obj = zoneServer->createObject(
child->getTemplateFile().hashCode(), getPersistenceLevel());
if (obj == NULL)
continue;
ContainerPermissions* permissions = obj->getContainerPermissions();
permissions->setOwner(getObjectID());
permissions->setInheritPermissionsFromParent(true);
permissions->setDefaultDenyPermission(ContainerPermissions::MOVECONTAINER);
permissions->setDenyPermission("owner", ContainerPermissions::MOVECONTAINER);
if (!transferObject(obj, child->getContainmentType())) {
obj->destroyObjectFromDatabase(true);
continue;
}
childObjects.put(obj);
obj->initializeChildObject(_this.getReferenceUnsafeStaticCast());
}
}
开发者ID:Mesagoppinmypants,项目名称:mtgtestserver,代码行数:34,代码来源:WeaponObjectImplementation.cpp
示例9: handle_rc_get_zone_info
void handle_rc_get_zone_info(const std::string &method, const std::string &connection_id, const std::string &request_id, const std::vector<std::string> ¶ms) {
std::string error;
std::map<std::string, std::string> res;
if(params.size() != 1) {
error = "Expected only one zone_id.";
RemoteCallResponse(connection_id, request_id, res, error);
return;
}
ZoneServer *zs = zoneserver_list.FindByID(atoi(params[0].c_str()));
if(zs == nullptr) {
error = "Invalid zone";
RemoteCallResponse(connection_id, request_id, res, error);
return;
}
res["type"] = zs->IsStaticZone() ? "static" : "dynamic";
res["zone_id"] = itoa(zs->GetZoneID());
res["instance_id"] = itoa(zs->GetInstanceID());
res["launch_name"] = zs->GetLaunchName();
res["launched_name"] = zs->GetLaunchedName();
res["short_name"] = zs->GetZoneName();
res["long_name"] = zs->GetZoneLongName();
res["port"] = itoa(zs->GetCPort());
res["player_count"] = itoa(zs->NumPlayers());
RemoteCallResponse(connection_id, request_id, res, error);
}
开发者ID:jcon321,项目名称:Server,代码行数:27,代码来源:remote_call.cpp
示例10: getPlayerOwner
void BountyMissionObjectiveImplementation::handlePlayerKilled(ManagedObject* arg1) {
CreatureObject* killer = NULL;
killer = cast<CreatureObject*>(arg1);
ManagedReference<MissionObject* > mission = this->mission.get();
ManagedReference<CreatureObject*> owner = getPlayerOwner();
if (owner != NULL && killer != NULL) {
if (owner->getObjectID() == killer->getObjectID()) {
//Target killed by player, complete mission.
ZoneServer* zoneServer = owner->getZoneServer();
if (zoneServer != NULL) {
ManagedReference<CreatureObject*> target = zoneServer->getObject(mission->getTargetObjectId()).castTo<CreatureObject*>();
if (target != NULL) {
VisibilityManager::instance()->clearVisibility(target);
owner->getZoneServer()->getPlayerManager()->awardExperience(target, "jedi_general", -30000, true);
}
}
complete();
} else if (mission->getTargetObjectId() == killer->getObjectID() ||
(npcTarget != NULL && npcTarget->getObjectID() == killer->getObjectID())) {
//Player killed by target, fail mission.
owner->sendSystemMessage("@mission/mission_generic:failed"); // Mission failed
killer->sendSystemMessage("You have defeated a bounty hunter, ruining his mission against you!");
fail();
}
}
}
开发者ID:SWGChoice,项目名称:Core3,代码行数:31,代码来源:BountyMissionObjectiveImplementation.cpp
示例11: handle_rc_relay
void handle_rc_relay(const std::string &method, const std::string &connection_id, const std::string &request_id, const std::vector<std::string> ¶ms) {
std::string error;
std::map<std::string, std::string> res;
uint32 zone_id = 0;
uint32 instance_id = 0;
ZoneServer *zs = nullptr;
if(params.size() < 2) {
error = "Missing zone relay params";
RemoteCallResponse(connection_id, request_id, res, error);
return;
}
zone_id = (uint32)atoi(params[0].c_str());
instance_id = (uint32)atoi(params[1].c_str());
if(!zone_id && !instance_id) {
error = "Zone not booted";
RemoteCallResponse(connection_id, request_id, res, error);
return;
}
if(instance_id) {
zs = zoneserver_list.FindByInstanceID(instance_id);
} else {
zs = zoneserver_list.FindByZoneID(zone_id);
}
if(!zs) {
error = "Zone server not found";
RemoteCallResponse(connection_id, request_id, res, error);
return;
}
uint32 sz = (uint32)(request_id.size() + connection_id.size() + method.size() + 3 + 16);
uint32 p_sz = (uint32)params.size() - 2;
for(uint32 i = 0; i < p_sz; ++i) {
auto ¶m = params[i + 2];
sz += (uint32)param.size();
sz += 5;
}
ServerPacket *pack = new ServerPacket(ServerOP_WIRemoteCall, sz);
pack->WriteUInt32((uint32)request_id.size());
pack->WriteString(request_id.c_str());
pack->WriteUInt32((uint32)connection_id.size());
pack->WriteString(connection_id.c_str());
pack->WriteUInt32((uint32)method.size());
pack->WriteString(method.c_str());
pack->WriteUInt32(p_sz);
for(uint32 i = 0; i < p_sz; ++i) {
auto ¶m = params[i + 2];
pack->WriteUInt32((uint32)param.size());
pack->WriteString(param.c_str());
}
zs->SendPacket(pack);
safe_delete(pack);
}
开发者ID:jcon321,项目名称:Server,代码行数:60,代码来源:remote_call.cpp
示例12: if
bool ClientList::SendPacket(const char* to, ServerPacket* pack) {
if (to == 0 || to[0] == 0) {
zoneserver_list.SendPacket(pack);
return true;
}
else if (to[0] == '*') {
// Cant send a packet to a console....
return false;
}
else {
ClientListEntry* cle = FindCharacter(to);
if (cle != nullptr) {
if (cle->Server() != nullptr) {
cle->Server()->SendPacket(pack);
return true;
}
return false;
} else {
ZoneServer* zs = zoneserver_list.FindByName(to);
if (zs != nullptr) {
zs->SendPacket(pack);
return true;
}
return false;
}
}
return false;
}
开发者ID:eqmactop,项目名称:Server,代码行数:28,代码来源:clientlist.cpp
示例13: EXECUTE_TASK_1
void StructureObjectImplementation::notifyLoadFromDatabase() {
TangibleObjectImplementation::notifyLoadFromDatabase();
if (structurePermissionList.getOwner() != getOwnerObjectID()) {
structurePermissionList.setOwner(getOwnerObjectID());
}
if (permissionsFixed == false) {
ManagedReference<StructureObject*> structure = _this.getReferenceUnsafeStaticCast();
EXECUTE_TASK_1(structure, {
ZoneServer* zoneServer = structure_p->getZoneServer();
if (zoneServer == NULL) {
return;
}
if (zoneServer->isServerLoading()) {
this->reschedule(5000);
return;
}
Locker locker(structure_p);
structure_p->migratePermissions();
});
开发者ID:Mesagoppinmypants,项目名称:mtgserver,代码行数:26,代码来源:StructureObjectImplementation.cpp
示例14: if
Reference<SceneObject*> PlanetManagerImplementation::loadSnapshotObject(WorldSnapshotNode* node, WorldSnapshotIff* wsiff, int& totalObjects) {
uint64 objectID = node->getObjectID();
String templateName = wsiff->getObjectTemplateName(node->getNameID());
ZoneServer* zoneServer = server->getZoneServer();
Reference<SceneObject*> object = zoneServer->getObject(objectID);
++totalObjects;
if (ConfigManager::instance()->isProgressMonitorActivated())
printf("\r\tLoading snapshot objects: [%d] / [?]\t", totalObjects);
//Object already exists, exit.
if (object != NULL)
return NULL;
Reference<SceneObject*> parentObject = zoneServer->getObject(node->getParentID());
String serverTemplate = templateName.replaceFirst("shared_", "");
Vector3 position = node->getPosition();
object = zoneServer->createClientObject(serverTemplate.hashCode(), objectID);
object->initializePosition(position.getX(), position.getZ(), position.getY());
object->setDirection(node->getDirection());
if (parentObject != NULL && parentObject->isBuildingObject() && object->isCellObject()) {
CellObject* cell = cast<CellObject*>(object.get());
BuildingObject* building = cast<BuildingObject*>(parentObject.get());
building->addCell(cell, node->getCellID());
}
if (parentObject != NULL)
parentObject->transferObject(object, -1);
else if (node->getParentID() != 0)
error("parent id " + String::valueOf(node->getParentID()));
if (parentObject == NULL) {
//object->insertToZone(zone);
Locker clocker(object);
zone->transferObject(object, -1, true);
}
//Load child nodes
for (int i = 0; i < node->getNodeCount(); ++i) {
WorldSnapshotNode* childNode = node->getNode(i);
if (childNode == NULL)
continue;
loadSnapshotObject(childNode, wsiff, totalObjects);
}
//object->createChildObjects();
return object;
}
开发者ID:Chilastra-Reborn,项目名称:Chilastra-source-code,代码行数:59,代码来源:PlanetManagerImplementation.cpp
示例15: despawnNpcs
void DeliverMissionObjectiveImplementation::despawnNpcs() {
ZoneServer* zoneServer = ServerCore::getZoneServer();
MissionManager* missionManager = zoneServer->getMissionManager();
if (targetSpawnPoint != NULL)
missionManager->freeMissionNpc(targetSpawnPoint);
if (destinationSpawnPoint != NULL)
missionManager->freeMissionNpc(destinationSpawnPoint);
}
开发者ID:Marott1,项目名称:Core3,代码行数:10,代码来源:DeliverMissionObjectiveImplementation.cpp
示例16: getPlayerOwner
void MissionObjectiveImplementation::removeMissionFromPlayer() {
ManagedReference<CreatureObject*> player = getPlayerOwner();
ManagedReference<MissionObject* > mission = this->mission.get();
if (player != NULL) {
ZoneServer* zoneServer = player->getZoneServer();
MissionManager* missionManager = zoneServer->getMissionManager();
missionManager->removeMission(mission, player);
}
}
开发者ID:duffstone01,项目名称:duffEMU,代码行数:11,代码来源:MissionObjectiveImplementation.cpp
示例17: assert
void SceneObjectImplementation::destroyObjectFromDatabase(bool destroyContainedObjects) {
//info("deleting from database", true);
if (isPlayerCreature()) {
assert(0 && "attempting to delete a player creature from database");
}
if(dataObjectComponent != NULL) {
dataObjectComponent->notifyObjectDestroyingFromDatabase();
}
ZoneServer* server = getZoneServer();
server->destroyObjectFromDatabase(getObjectID());
asSceneObject()->setPersistent(0);
if (!destroyContainedObjects)
return;
SortedVector<ManagedReference<SceneObject*> > destroyedObjects;
destroyedObjects.setNoDuplicateInsertPlan();
for (int i = 0; i < getSlottedObjectsSize(); ++i) {
ManagedReference<SceneObject*> object = getSlottedObject(i);
if (destroyedObjects.put(object) != -1) {
Locker locker(object);
object->destroyObjectFromDatabase(true);
}
}
for (int j = 0; j < getContainerObjectsSize(); ++j) {
ManagedReference<SceneObject*> object = getContainerObject(j);
if (destroyedObjects.put(object) != -1) {
Locker locker(object);
object->destroyObjectFromDatabase(true);
}
}
//Remove all child objects from database
for (int i = 0; i < childObjects.size(); ++i) {
ManagedReference<SceneObject*> child = childObjects.get(i);
if (child == NULL)
continue;
Locker locker(child);
child->destroyObjectFromDatabase(true);
}
}
开发者ID:angelsounds777,项目名称:Core3-CU,代码行数:53,代码来源:SceneObjectImplementation.cpp
示例18: getZoneServer
void SceneObjectImplementation::broadcastDestroyPrivate(SceneObject* object, SceneObject* selfObject) {
ZoneServer* zoneServer = getZoneServer();
if (zoneServer != NULL && zoneServer->isServerLoading())
return;
if (parent.get() != NULL) {
ManagedReference<SceneObject*> grandParent = getRootParent().get();
if (grandParent != NULL) {
grandParent->broadcastDestroyPrivate(object, selfObject);
return;
} else {
return;
}
}
if (zone == NULL)
return;
SortedVector<ManagedReference<QuadTreeEntry*> > closeSceneObjects;
int maxInRangeObjectCount = 0;
if (closeobjects == NULL) {
info("Null closeobjects vector in SceneObjectImplementation::broadcastDestroyPrivate", true);
zone->getInRangeObjects(getPositionX(), getPositionY(), 256, &closeSceneObjects, true);
maxInRangeObjectCount = closeSceneObjects.size();
} else {
CloseObjectsVector* vec = (CloseObjectsVector*) closeobjects;
closeSceneObjects.removeAll(vec->size(), 10);
vec->safeCopyTo(closeSceneObjects);
maxInRangeObjectCount = closeSceneObjects.size();
}
for (int i = 0; i < maxInRangeObjectCount; ++i) {
SceneObject* scno = static_cast<SceneObject*>(closeSceneObjects.get(i).get());
ManagedReference<ZoneClientSession*> client = scno->getClient();
if (scno->isVehicleObject() || client != NULL || scno->isMount()) {
object->sendDestroyTo(scno);
}
}
}
开发者ID:angelsounds777,项目名称:Core3-CU,代码行数:50,代码来源:SceneObjectImplementation.cpp
示例19: sizeof
void ZSList::SendEmoteMessageRaw(const char* to, uint32 to_guilddbid, int16 to_minstatus, uint32 type, const char* message) {
if (!message)
return;
ServerPacket* pack = new ServerPacket;
pack->opcode = ServerOP_EmoteMessage;
pack->size = sizeof(ServerEmoteMessage_Struct)+strlen(message)+1;
pack->pBuffer = new uchar[pack->size];
memset(pack->pBuffer, 0, pack->size);
ServerEmoteMessage_Struct* sem = (ServerEmoteMessage_Struct*) pack->pBuffer;
if (to) {
if (to[0] == '*') {
Console* con = console_list.FindByAccountName(&to[1]);
if (con)
con->SendEmoteMessageRaw(to, to_guilddbid, to_minstatus, type, message);
delete pack;
return;
}
strcpy((char *) sem->to, to);
}
else {
sem->to[0] = 0;
}
sem->guilddbid = to_guilddbid;
sem->minstatus = to_minstatus;
sem->type = type;
strcpy(&sem->message[0], message);
char tempto[64]={0};
if(to)
strn0cpy(tempto,to,64);
pack->Deflate();
if (tempto[0] == 0) {
SendPacket(pack);
if (to_guilddbid == 0)
console_list.SendEmoteMessageRaw(type, message);
}
else {
ZoneServer* zs = FindByName(to);
if (zs != 0)
zs->SendPacket(pack);
else
SendPacket(pack);
}
delete pack;
}
开发者ID:Corysia,项目名称:Server,代码行数:48,代码来源:zonelist.cpp
示例20: getPlayerOwner
void BountyMissionObjectiveImplementation::handlePlayerKilled(ManagedObject* arg1) {
CreatureObject* killer = NULL;
killer = cast<CreatureObject*>(arg1);
ManagedReference<MissionObject* > mission = this->mission.get();
ManagedReference<CreatureObject*> owner = getPlayerOwner();
if(mission == NULL)
return;
if (owner != NULL && killer != NULL) {
if (owner->getObjectID() == killer->getObjectID()) {
//Target killed by player, complete mission.
ZoneServer* zoneServer = owner->getZoneServer();
if (zoneServer != NULL) {
ManagedReference<CreatureObject*> target = zoneServer->getObject(mission->getTargetObjectId()).castTo<CreatureObject*>();
if (target != NULL) {
int minXpLoss = -50000;
int maxXpLoss = -500000;
VisibilityManager::instance()->clearVisibility(target);
int xpLoss = mission->getRewardCredits() * -2;
if (xpLoss > minXpLoss)
xpLoss = minXpLoss;
else if (xpLoss < maxXpLoss)
xpLoss = maxXpLoss;
owner->getZoneServer()->getPlayerManager()->awardExperience(target, "jedi_general", xpLoss, true);
StringIdChatParameter message("base_player","prose_revoke_xp");
message.setDI(xpLoss * -1);
message.setTO("exp_n", "jedi_general");
target->sendSystemMessage(message);
}
}
complete();
} else if (mission->getTargetObjectId() == killer->getObjectID() ||
(npcTarget != NULL && npcTarget->getObjectID() == killer->getObjectID())) {
//Player killed by target, fail mission.
owner->sendSystemMessage("@mission/mission_generic:failed"); // Mission failed
killer->sendSystemMessage("You have defeated a bounty hunter, ruining his mission against you!");
fail();
}
}
}
开发者ID:Mesagoppinmypants,项目名称:mtgserver,代码行数:47,代码来源:BountyMissionObjectiveImplementation.cpp
注:本文中的ZoneServer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论