This commit is contained in:
Vlad committed 2026-04-13 15:08:38 +06:00
commit 422ff1fbe3
25 files changed
+1697 -6

No files matched your search

+17 -1
View File
@@ -138,6 +138,23 @@ namespace ZL {
return game->inventory.hasItem(id);
});
api.set_function("start_dialogue",
[game](const std::string& dialogueId) {
if (!game->requestDialogueStart(dialogueId)) {
std::cerr << "[script] start_dialogue failed for id: " << dialogueId << "\n";
}
});
api.set_function("set_dialogue_flag",
[game](const std::string& flag, int value) {
game->setDialogueFlag(flag, value);
});
api.set_function("get_dialogue_flag",
[game](const std::string& flag) {
return game->getDialogueFlag(flag);
});
// receive_npc_gift(npc_index)
api.set_function("receive_npc_gift", [game](int npcIndex) {
std::cout << "[script] receive_npc_gift: npc index " << npcIndex << std::endl;
@@ -158,7 +175,6 @@ namespace ZL {
std::cout << "[script] NPC " << npc->npcName << " already gave gift\n";
return;
}
if (npc->giftItem.id.empty()) {
std::cerr << "[script] receive_npc_gift: NPC has no gift\n";
return;