Exemplo 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;
}
Exemplo n.º 2
0
bool CCellPointButton::EnterViewMsg(CEnterViewMsg *msg) {
	_regionNum = talkGetDialRegion(_npcName, _dialNum);
	return true;
}