Welcome to the Builder Academy

Question NPC flags - request for new Questmaster flag

More
07 Feb 2018 20:52 #7555 by Sascha
This is a two-layer help request: Help me learn this, and help me with doing it.

One of my beta testers uses a screen reader. I've been writing quests and I'm thinking it would be nice to have an NPC flag that shows [QUESTMASTER] on the output, like:

[799] [TRIGS] A retired hero is waiting for a brave adventurer to step forth. [QUESTMASTER]

How I envision the overall process is:

1) When making a quest using qedit, and you set the NPC as the quest master, it automatically adds the flag to the mob.
2) The flag displays to everyone, so upon entering a room you see that the NPC has a quest attached to it.

That way, players know they should type 'quest list' because a quest may be available for them to complete.

I have a feeling this is a bit complicated, and I'm hesitant to just dive in and start messing with code because we all know my baby-level of coding skills. Can someone do this, and maybe write a short guide like "How to add NPC flags for Dummies" overall? And maybe walk me through it, since I learn best by doing?

Will you stand against the coming Storm? After the Breaking: STORMRIDERS MUD - atbmud.dune.net port 4000

Please Log in or Create an account to join the conversation.

More
07 Feb 2018 21:18 - 07 Feb 2018 21:19 #7558 by JTP
Last edit: 07 Feb 2018 21:19 by JTP.

Please Log in or Create an account to join the conversation.

More
07 Feb 2018 23:10 - 07 Feb 2018 23:13 #7559 by Fizban
To make it show at the end of the line like you described, change this:
Code:
if (AFF_FLAGGED(ch, AFF_DETECT_ALIGN)) { if (IS_EVIL(i)) send_to_char(ch, "(Red Aura) "); else if (IS_GOOD(i)) send_to_char(ch, "(Blue Aura) "); } - send_to_char(ch, "%s", i->player.long_descr); + send_to_char(ch, "%s%s", i->player.long_descr, IS_NPC(i) && GET_MOB_SPEC(i) == questmaster ? "[Questmaster]" : ""); if (AFF_FLAGGED(i, AFF_SANCTUARY)) act("...$e glows with a bright light!", FALSE, i, 0, ch, TO_VICT); if (AFF_FLAGGED(i, AFF_BLIND) && GET_LEVEL(i) < LVL_IMMORT) act("...$e is groping around blindly!", FALSE, i, 0, ch, TO_VICT); return; }

Alternatively rather than changing the send_to_char in question, adding this below it should work as well.
Code:
if (IS_NPC(i) && GET_MOB_SPEC(i) == questmaster) send_to_char(ch, "[Questmaster]");
Last edit: 07 Feb 2018 23:13 by Fizban.
The following user(s) said Thank You: Sascha

Please Log in or Create an account to join the conversation.

More
08 Feb 2018 15:10 #7564 by Fizban
Looks like there's a \r\n built into the i->player.long_descr actually, so adding text to the end of the string isn't as trivial as I'd hoped.

Please Log in or Create an account to join the conversation.

Time to create page: 0.201 seconds