Esempio n. 1
0
bool CIdleSummoner::TimerMsg(CTimerMsg *msg) {
	uint nodesCtr = getNodeChangedCtr();
	if (msg->_actionVal == 1 && !petDoorOrBellbotPresent()
			&& nodesCtr > 0 && _fieldD8) {
		if (!compareRoomNameTo("TopOfWell") && !compareRoomNameTo("EmbLobby"))
			return true;

		int region = talkGetDialRegion("BellBot", 1);
		uint delay = region == 1 ? 15000 : 12000;
		uint enterTicks = MIN(getNodeEnterTicks(), _ticks);
		
		CString name;
		uint ticks = getTicksCount() - enterTicks;
		if (ticks > delay) {
			if (region == 1 || getRandomNumber(1) == 1) {
				name = "BellBot";
			} else {
				name = "DoorBot";
			}
			_fieldD8 = nodesCtr;

			if (getRoom()) {
				CSummonBotQueryMsg queryMsg(name);
				if (queryMsg.execute(this)) {
					CSummonBotMsg summonMsg(name, 1);
					summonMsg.execute(this);
				}
			}
		}
	}

	return true;
}
Esempio n. 2
0
void CPetControl::summonBot(const CString &name, int val) {
	CGameManager *gameManager = getGameManager();
	if (gameManager) {
		CRoomItem *room = gameManager->getRoom();

		if (room) {
			CSummonBotMsg summonMsg(name, val);
			summonMsg.execute(room);
		}
	}
}
Esempio n. 3
0
void CPetControl::onSummonBot(const CString &name, int val) {
	CGameObject *bot = findBot(name, getHiddenRoom());
	if (!bot) {
		bot = findBot(name, getRoot());
	}

	if (bot) {
		removeFromInventory(bot, false, false);

		COnSummonBotMsg summonMsg(val);
		summonMsg.execute(bot);
	}
}