summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-06-09 17:56:15 +0200
committerBardur Arantsson <bardur@scientician.net>2012-06-09 17:57:00 +0200
commit465063bdf50bdf30b110bb2c37ab114fb68e4662 (patch)
tree83f08fbcae536b1f602c66a39128c0b48d2921b3 /src
parent45f32f85eecbdaca1108542adc9733e9b633d9e5 (diff)
Lua: Move the "monster asked for help" help to C
Diffstat (limited to 'src')
-rw-r--r--src/defines.h1
-rw-r--r--src/help.c15
-rw-r--r--src/q_shroom.c2
3 files changed, 16 insertions, 2 deletions
diff --git a/src/defines.h b/src/defines.h
index 44537732..8a340a4c 100644
--- a/src/defines.h
+++ b/src/defines.h
@@ -4513,6 +4513,7 @@
#define HOOK_APPLY_MAGIC 66
#define HOOK_PLAYER_EXP 67
#define HOOK_BIRTH 68
+#define HOOK_MON_ASK_HELP 69
#define HOOK_LEARN_ABILITY 70
#define HOOK_MOVED 71
#define HOOK_GAME_START 72
diff --git a/src/help.c b/src/help.c
index a19b7b27..6d196060 100644
--- a/src/help.c
+++ b/src/help.c
@@ -14,7 +14,7 @@
#include "angband.h"
#define DESC_MAX 14
-#define TRIGGERED_HELP_MAX 18
+#define TRIGGERED_HELP_MAX 19
#define HELP_VOID_JUMPGATE 0
#define HELP_FOUNTAIN 1
@@ -34,6 +34,7 @@
#define HELP_20TH_LEVEL 15
#define HELP_ID_SPELL_ITM 16
#define HELP_MELEE_SKILLS 17
+#define HELP_MON_ASK_HELP 18
/**
* Game started?
@@ -402,6 +403,10 @@ static bool_ trigger_melee_skills(void *in, void *out) {
return (game_started && (get_melee_skills() > 1));
}
+static bool_ trigger_always(void *in, void *out) {
+ return TRUE;
+}
+
/**
* Trigger-based help items
*/
@@ -584,6 +589,14 @@ static triggered_help_type triggered_help[TRIGGERED_HELP_MAX] =
"and select the switch melee type option.",
NULL
}
+ },
+ { HELP_MON_ASK_HELP,
+ HOOK_MON_ASK_HELP,
+ trigger_always,
+ { "Somebody is speaking to you it seems. You can talk back with the Y key.",
+ "This can lead to quests. You can also give items to 'monsters' with the y key.",
+ NULL
+ }
}
};
diff --git a/src/q_shroom.c b/src/q_shroom.c
index b6e26cdf..4d4d7494 100644
--- a/src/q_shroom.c
+++ b/src/q_shroom.c
@@ -196,7 +196,7 @@ bool_ quest_shroom_speak_hook(char *fmt)
m_name = get_next_arg_str(fmt);
msg_format("%^s asks your help.", m_name);
- exec_lua("ingame_help('monster_chat')");
+ process_hooks_new(HOOK_MON_ASK_HELP, NULL, NULL);
}
else
{