From 02a8147c5a2f7338311d4c0427759cdc11fc5fbf Mon Sep 17 00:00:00 2001
From: Jesusaves <cpntb1@ymail.com>
Date: Mon, 7 Dec 2020 20:46:38 -0300
Subject: Update Croconut script, by MineGamer request

---
 npc/items/croconut.txt | 36 +++++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 17 deletions(-)

diff --git a/npc/items/croconut.txt b/npc/items/croconut.txt
index 5525b269b..39c420316 100644
--- a/npc/items/croconut.txt
+++ b/npc/items/croconut.txt
@@ -6,23 +6,28 @@
 // Description:
 //    Allows to cut a Croconut in multiple parts.
 
-000-0,0,0,0	script	Croconut	NPC_HIDDEN,{
+-	script	Croconut	NPC_HIDDEN,{
     close;
 
 OnUse:
-    mesn "Narrator";
     mesc l("Do you want to cut this @@?", getitemlink(Croconut));
-    next;
 
-    menu
-        l("Yes."), L_Weapon,
-        l("No."), -;
-
-    getitem Croconut, 1;
+    select
+        l("Yes."),
+        l("No.");
+    mes "";
+    closeclientdialog;
+    switch (@menu) {
+    case 1:
+        goto L_Weapon;
+    case 2:
+        getitem Croconut, 1;
+        close;
+    }
     close;
 
 L_Weapon:
-    .@r=rand(1,5);
+    .@r=rand2(1,5);
     switch (.@r) {
         case 1:
         case 2:
@@ -35,10 +40,7 @@ L_Weapon:
     }
 
 L_TooWeak:
-    mes "";
-    mesn "Narrator";
-
-    .@q = rand(5);
+    .@q = rand2(5);
     if (readparam2(bStr) > 30)
         .@q = .@q + 1;
     if (readparam2(bStr) > 60)
@@ -52,23 +54,23 @@ L_TooWeak:
     if ( (.@q > 6) ) goto L_Good;
 
 L_TooWeakLost:
-    mesc l("Ops! You destroyed your @@.", getitemlink(Croconut));
+    dispbottom l("Ops! You destroyed your @@.", getitemlink(Croconut));
     close;
 
 L_TooWeakFail:
-    mesc l("Well... you did not succeed in opening this @@.", getitemlink(Croconut));
+    dispbottom l("Well... you did not succeed in opening this @@.", getitemlink(Croconut));
 
     getitem Croconut, 1;
     close;
 
 L_Weak:
-    mesc l("You opened the @@ in two parts, but you crushed one of them.", getitemlink(Croconut));
+    dispbottom l("You opened the @@ in two parts, but you crushed one of them.", getitemlink(Croconut));
 
     getitem HalfCroconut, 1;
     close;
 
 L_Good:
-     mesc l("You perfectly cut your @@ into two edible parts.", getitemlink(Croconut));
+     dispbottom l("You perfectly cut your @@ into two edible parts.", getitemlink(Croconut));
 
     getitem HalfCroconut, 2;
     close;
-- 
cgit v1.2.3-70-g09d2