From bea0ca3f06002372f264a89378e54020945cb336 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Wed, 22 Dec 2021 18:14:34 -0300 Subject: Partially rewrite Cyndala, she is more mentally stable now. --- npc/003-6/cyndala.txt | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'npc') diff --git a/npc/003-6/cyndala.txt b/npc/003-6/cyndala.txt index fa901575c..05d7f8896 100644 --- a/npc/003-6/cyndala.txt +++ b/npc/003-6/cyndala.txt @@ -28,7 +28,7 @@ .@q = getq(TulimsharQuest_Cyndala); select l("Excuse me."), - l("Could you bleach my clothes?"), + l("Could you bleach my equipment?"), l("What can you say about dyes?"), rif(.@q > 0, l("I would like to order some dye.")), rif(is_staff(), "Technical problem, gimme info about an item."); @@ -116,12 +116,24 @@ function item_is_bleachable if (.@item_index < 0) return false; + // Collect the item ID + delinventorylist(); getinventorylist(); + .@x=@inventorylist_id[.@id]; + + // Debug info if (is_staff()) mesf "Item Index %d (%s) - ID %d", .@item_index, getitemlink(@inventorylist_id[.@item_index]), @inventorylist_id[.@item_index]; + // No duplicates + if (countitem(.@x) > 1) { + mesc l("You are carrying duplicates of the same item. Sorry, but I have no idea which one you want to tweak."), 1; + return false; + } + + // Must have a card, d'oh if (@inventorylist_card1[.@item_index] == 0) return false; @@ -145,9 +157,10 @@ function remove_cards_from_item return; } + .@item_id = @inventorylist_id[.@item_index]); speech S_LAST_NEXT, - l("Your mind is set? You will probably lose the dye or card during this process. You're bleaching a %s by the way.", getitemlink(@inventorylist_id[.@item_index])); + l("Your mind is set? You will probably lose all the dyes and/or cards during on the item during this process. You're bleaching a %s by the way.", getitemlink(.@item_id); switch (askyesno()) { case ASK_YES: @@ -155,10 +168,14 @@ function remove_cards_from_item l("Ok, let me see..."), l("..."); - if (rand2(1, 1000) > readparam2(bLuk)) + // FIXME: Register this on picklog + if (rand2(1, 800) > readparam2(bLuk)) { failedremovecardsindex .@item_index, 1; - else + logmes("Deleted Cards from item: "+.@item_id); + } else { successremovecardsindex(.@item_index); + logmes("Removed Cards from item: "+.@item_id); + } // First option slot of weapon: Raises STR in 5 // setequipoption(EQI_HAND_R, 1, VAR_STRAMOUNT, 5); -- cgit v1.2.3-60-g2f50