diff options
author | Fedja Beader <fedja@protonmail.ch> | 2023-06-05 16:06:02 +0000 |
---|---|---|
committer | Jesusalva Jesusalva <jesusalva@themanaworld.org> | 2023-06-05 16:06:02 +0000 |
commit | b083d8a204c4b49a76c75c8ecdaa7e1df5bfea6d (patch) | |
tree | 51d664d1b261b9b4171f168d3beceabd53b593da | |
parent | 09aeeefba094564cc733a715db7044eb2be7a0b5 (diff) | |
download | serverdata-b083d8a204c4b49a76c75c8ecdaa7e1df5bfea6d.tar.gz serverdata-b083d8a204c4b49a76c75c8ecdaa7e1df5bfea6d.tar.bz2 serverdata-b083d8a204c4b49a76c75c8ecdaa7e1df5bfea6d.tar.xz serverdata-b083d8a204c4b49a76c75c8ecdaa7e1df5bfea6d.zip |
Baktar should give players clues as to what he would like to receive.
Hopefully this does not explode.
-rw-r--r-- | npc/020-4/baktar.txt | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/npc/020-4/baktar.txt b/npc/020-4/baktar.txt index 4472c5322..771972354 100644 --- a/npc/020-4/baktar.txt +++ b/npc/020-4/baktar.txt @@ -13,8 +13,33 @@ .@q=getq(NivalisQuest_Baktar); if (!.@q) goto L_Start; + + + // Select one random item, check if it was delivered, else say how much he misses it + .@size = htsize(.TULIMITEM); + .@index = rand2(0, .@size - 1); // -1 because firstkey is already valid, thus size-1 is last key + + .@iterator = htiterator(.TULIMITEM); + .@item_id_string$ = htifirstkey(.@iterator); + for (.@i = 0; .@i < .@index; .@i++) { + // not sure if there is a way to advance the iterator other than retrieving .@index number of keys first. + .@item_id_string$ = htinextkey(.@iterator); + } + htidelete(.@iterator); + + .@q2=getq2(NivalisQuest_Baktar); + .@m = htget(.TULIMITEM, .@item_id_string$, 0); + + .@item_string$ = getitemlink(atoi(.@item_id_string$)); + if (.@q2 & .@m) + npctalk l("Thank you for the %s, I really appreciate it. %%1", .@item_string$); + else + npctalk l("Oh, how I miss %s from Tulimshar...%%J", .@item_string$); + + if (.@q == 2) goto L_Braknar; + goto L_Collector; L_Start: @@ -51,6 +76,7 @@ L_Start: next; mesn; mesq l("The doctor told me to move here after I got tuberculosis... But I like Tulimshar so much! Please bring me Tulimshar souvenirs, I'll pay you well!"); + close; |