Exemple #1
0
void GroupManager::_processGroupDisband(Message* message, DispatchClient* client)
{

    Player* player = gChatManager->getPlayerByAccId(client->getAccountId());

    if(player == NULL)
    {
        gLogger->log(LogManager::DEBUG,"GroupManager::_processGroupDisband: player not found\n");
    }

    if(player->getGroupMemberIndex() == 0xFFFF)
    {
        // target hasnt accepted the invite yet
        return;
    }

    GroupObject* group = getGroupById(player->getGroupId());
    if(group == NULL)
    {
        return;
    }

    if(player != group->getLeader())
    {
        //sendSystemMessage(player, L"@group:must_be_leader");
        group->removeMember(player);
        return;
    }

    group->disband();

}
Exemple #2
0
void GroupManager::_processGroupLeave(Message* message, DispatchClient* client)
{
    Player* player = gChatManager->getPlayerByAccId(client->getAccountId());

    if(player == NULL)
    {
        gLogger->log(LogManager::DEBUG,"GroupManager::_processGroupLeave: player not found\n");
    }

    if(player->getGroupMemberIndex() == 0xFFFF)
    {
        // target hasnt accepted the invite yet
        return;
    }

    GroupObject* group = getGroupById(player->getGroupId());

    if(group == NULL)
    {
        return;
    }

    group->removeMember(player);

}
ConversationScreen* PetTrainingScreenHandler::handleScreen(CreatureObject* conversingPlayer, CreatureObject* conversingNPC, int selectedOption, ConversationScreen* conversationScreen) {

	ManagedReference<PetControlDevice*> controller = conversingNPC->getControlDevice().get().castTo<PetControlDevice*>();
	if (controller == NULL) {
		return NULL;
	}

	if (conversationScreen->getScreenID() == "convoscreenpetinfo") {
		if(conversingNPC->isDroidObject()) {
			// we can technically just re-add the 4 options from base hireling
			DroidObject* droid = cast<DroidObject*>(conversingNPC);
			if (droid->getModule("repair_module") != NULL) {
				conversationScreen->addOption("@hireling/hireling:menu_repair_other","pet_repair_command");
			}
		}
	}

	Locker locker(controller);

	if (conversationScreen->getScreenID() == "pet_repair_command") {
		controller->setTrainingCommand(PetManager::REPAIR);
		return NULL;
	}
	if (conversationScreen->getScreenID() == "pet_formation_1_command") {
		controller->setTrainingCommand(PetManager::FORMATION1);
		return NULL;
	}
	if (conversationScreen->getScreenID() == "pet_formation_2_command") {
		controller->setTrainingCommand(PetManager::FORMATION2);
		return NULL;
	}
	if (conversationScreen->getScreenID() == "pet_attack_command") {
		controller->setTrainingCommand(PetManager::ATTACK);
		return NULL;
	}
	if (conversationScreen->getScreenID() == "pet_guard_command") {
		controller->setTrainingCommand(PetManager::GUARD);
		return NULL;
	}
	if (conversationScreen->getScreenID() == "pet_friend_command") {
		controller->setTrainingCommand(PetManager::FRIEND);
		return NULL;
	}
	if (conversationScreen->getScreenID() == "pet_transfer_command") {
		controller->setTrainingCommand(PetManager::TRANSFER);
		return NULL;
	}
	if (conversationScreen->getScreenID() == "pet_clear_patrol_points_command") {
		controller->setTrainingCommand(PetManager::CLEARPATROLPOINTS);
		return NULL;
	}
	if (conversationScreen->getScreenID() == "pet_get_patrol_point_command") {
		controller->setTrainingCommand(PetManager::GETPATROLPOINT);
		return NULL;
	}
	if (conversationScreen->getScreenID() == "pet_patrol_command") {
		controller->setTrainingCommand(PetManager::PATROL);
		return NULL;
	}
	if (conversationScreen->getScreenID() == "pet_stay_command") {
		controller->setTrainingCommand(PetManager::STAY);
		return NULL;
	}
	if (conversationScreen->getScreenID() == "pet_follow_command") {
		controller->setTrainingCommand(PetManager::FOLLOW);
		return NULL;
	}
	if (conversationScreen->getScreenID() == "pet_follow_other_command") {
		controller->setTrainingCommand(PetManager::FOLLOWOTHER);
		return NULL;
	}
	if (conversationScreen->getScreenID() == "pet_group_command") {
		controller->setTrainingCommand(PetManager::GROUP);
		return NULL;
	}
	if (conversationScreen->getScreenID() == "pet_release_command") {
		controller->setTrainingCommand(PetManager::STORE);
		return NULL;
	}

	locker.release();

	if (conversationScreen->getScreenID() == "pet_leave_group_command") {
		GroupObject* g = conversingNPC->getGroup();
		if (g != NULL) {
			g->removeMember(conversingNPC);
		}
		return NULL;
	}


	return conversationScreen;
}