Exemple #1
0
int SuccUBusScript::chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag) {
	uint dialogueId = tag;

	switch (tag) {
	case MKTAG('S', 'L', 'O', 'W'):
	case MKTAG('T', 'H', 'R', 'T'):
		dialogueId = 70021;

	case MKTAG('S', 'U', 'C', '1'):
		dialogueId = getDialogueId(230009);
		break;

	case MKTAG('S', 'U', 'C', '2'):
		dialogueId = 70117;
		break;

	case MKTAG('S', 'W', 'E', 'R'):
		dialogueId = getRandomNumber(100) > 40 ? 70103 : getDialogueId(230030);
		break;

	default:
		break;
	}

	if (dialogueId) {
		addResponse(dialogueId);
		applyResponse();
		return 2;
	} else {
		return 1;
	}
}
Exemple #2
0
int SuccUBusScript::doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence) {
	if (val1 == 1 && roomScript && roomScript->_scriptId == 101) {
		addResponse(getDialogueId(230239));
		applyResponse();
		return 2;
	}

	return 0;
}
Exemple #3
0
int ParrotScript::chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag) {
	if (tag == MKTAG('B', 'Y', 'Z', 'A')) {
		addResponse(getDialogueId(280246));
		applyResponse();
		return 2;
	} else {
		return 1;
	}
}
Exemple #4
0
int ParrotScript::process(const TTroomScript *roomScript, const TTsentence *sentence) {
	if (processEntries(roomScript, sentence) != 2) {
		int tagId = g_vm->_trueTalkManager->_quotes.find(sentence->_normalizedLine);
		if (!tagId || chooseResponse(roomScript, sentence, tagId) != 2) {
			addResponse(getDialogueId(sentence->checkCategory() ? 280248 : 280235));
			applyResponse();
		}
	}

	return 2;
}
Exemple #5
0
ScriptChangedResult ParrotScript::scriptChanged(const TTroomScript *roomScript, uint id) {
	if (id >= 280000 && id <= 280276) {
		if (id == 280258) {
			if (CTrueTalkManager::_currentNPC) {
				CGameObject *chicken;
				if (CTrueTalkManager::_currentNPC->find("Chicken", &chicken, FIND_PET))
					id = 280147 - getRandomBit();
			}

			id = getDialogueId(id);
		} else {
			if ((id == 280146 || id == 280147) && CTrueTalkManager::_currentNPC) {
				CGameObject *chicken;
				if (!CTrueTalkManager::_currentNPC->find("Chicken", &chicken, FIND_PET))
					id = 280142;
			}

			addResponse(getDialogueId(id));
			if (id == 280192)
				addResponse(getDialogueId(280222));
			applyResponse();
		}
	}

	if (id >= 80000 && id <= 80244) {
		if ((id == 80155 || id == 80156) && CTrueTalkManager::_currentNPC) {
			CGameObject *chicken;
			if (!CTrueTalkManager::_currentNPC->find("Chicken", &chicken, FIND_PET))
				id = 80151;
		}

		addResponse(id);
		if (id == 80201)
			addResponse(getDialogueId(280222));
		applyResponse();
	}

	return (id == 3) ? SCR_2 : SCR_1;
}
Exemple #6
0
ScriptChangedResult SuccUBusScript::scriptChanged(const TTroomScript *roomScript, uint id) {
	if (id == 148)
		CTrueTalkManager::setFlags(3, 1);
	else if (id == 150)
		CTrueTalkManager::setFlags(2, 1);

	if (id >= 230000 && id <= 230245) {
		addResponse(getDialogueId(id));
		applyResponse();
	}
	else if (id >= 70000 && id <= 70243) {
		addResponse(id);
		applyResponse();
	}

	return SCR_2;
}
Exemple #7
0
int SuccUBusScript::process(const TTroomScript *roomScript, const TTsentence *sentence) {
	if (!CTrueTalkManager::getStateValue(1))
		return 2;

	if (roomScript && roomScript->_scriptId == 101)
		_isRoom101 = true;

	int currState = getState();
	if (currState) {
		int currMode = sentence->_field2C;
		bool modeFlag1 = currMode == 11 || currMode == 13;
		bool modeFlag2 = currMode == 12;
		setState(0);

		switch (currState) {
		case 1:
			if (currMode == 3 || currMode == 10)
				return setResponse(70050, 0);
			break;

		case 2:
			if (modeFlag1 || modeFlag2)
				return setResponse(70070 + (getRandomBit() ? 254 : 0), 0);
			break;

		case 3:
			if (currMode == 3 || currMode == 10)
				return setResponse(70074, 0);
			break;

		case 4:
			if (currMode == 4)
				return setResponse(70077, 0);
			if (currMode == 3)
				return setResponse(getDialogueId(230117), 0);
			break;

		case 5:
			if (currMode == 3 || currMode == 10)
				return setResponse(70089, 0);
			break;

		case 6:
			if (modeFlag1)
				return setResponse(70103, 0);
			if (modeFlag2)
				return setResponse(70102, 0);
			break;

		case 7:
			if (modeFlag1)
				return setResponse(getDialogueId(230157), 0);
			break;

		case 8:
			if (modeFlag1)
				return setResponse(getDialogueId(230159), 0);
			break;

		case 9:
			if (modeFlag1)
				return setResponse(getDialogueId(230160), 0);
			break;

		case 10:
			if (modeFlag1)
				return setResponse(getDialogueId(230161), 0);
			break;

		case 11:
			if (modeFlag1)
				return setResponse(getDialogueId(230142), 0);
			break;

		case 12:
			return setResponse(70030, 0);

		default:
			break;
		}
	}

	if (processEntries(&_entries, _entryCount, roomScript, sentence) != 2) {
		uint tagId = g_vm->_trueTalkManager->_quotes.find(sentence->_normalizedLine.c_str());
		if (tagId && chooseResponse(roomScript, sentence, tagId) != 2) {
			addResponse(getDialogueId(230030));
			applyResponse();
		}
	}

	return 2;
}