summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-05-02 10:55:27 -0300
committerJesusaves <cpntb1@ymail.com>2019-05-02 10:55:27 -0300
commit46bbdfe15230da4d8abe41faf04c32fb42c3ad84 (patch)
tree55f277983d2f547fce985956daab75b5533c382f
parent9a348a1fadefb5481f08b4891091fdabd6abc4ec (diff)
downloadserverdata-46bbdfe15230da4d8abe41faf04c32fb42c3ad84.tar.gz
serverdata-46bbdfe15230da4d8abe41faf04c32fb42c3ad84.tar.bz2
serverdata-46bbdfe15230da4d8abe41faf04c32fb42c3ad84.tar.xz
serverdata-46bbdfe15230da4d8abe41faf04c32fb42c3ad84.zip
Use Exception() in some places
-rw-r--r--db/constants.conf2
-rw-r--r--npc/002-5/main.txt3
-rw-r--r--npc/functions/fishing.txt2
-rw-r--r--npc/functions/instances.txt6
-rw-r--r--npc/functions/inventoryplace.txt3
-rw-r--r--npc/functions/mobhunter.txt8
-rw-r--r--npc/functions/util.txt11
7 files changed, 20 insertions, 15 deletions
diff --git a/db/constants.conf b/db/constants.conf
index 161b6ee39..be7a25d74 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -4291,6 +4291,8 @@ constants_db: {
RB_SPEECH: 4
RB_ISFATAL: 8
RB_PLEASEREPORT: 16
+ RB_IRCBROADCAST: 32
+ RB_GLOBALANNOUNCE: 64
RB_DEFAULT: 19 // dispbottom + debugmes + pleasereport
comment__: "Being actions"
diff --git a/npc/002-5/main.txt b/npc/002-5/main.txt
index bd06fe579..22269552e 100644
--- a/npc/002-5/main.txt
+++ b/npc/002-5/main.txt
@@ -30,11 +30,10 @@ L_Tulim:
end;
L_Error:
- debugmes "ERROR: PLAYER INVALID PC_DEST ON #NardShip: " + PC_DEST$;
PC_DEST$ = "";
@timer_navio_running = 0;
warp "000-1", 22, 22;
- dispbottom l("An error on your travel happened. Please report.");
+ Exception("PLAYER INVALID PC_DEST ON #NardShip: " + PC_DEST$, RB_DEFAULT | RB_ISFATAL);
end;
}
diff --git a/npc/functions/fishing.txt b/npc/functions/fishing.txt
index e84b11cef..b09cb0d48 100644
--- a/npc/functions/fishing.txt
+++ b/npc/functions/fishing.txt
@@ -76,7 +76,7 @@ function script fishing {
};
freeloop(false);
}
- debugmes("[FISH] Initialized with %d common and %d rare fishes", getarraysize(.@common_fish), getarraysize(.@rare_fish));
+ //debugmes("[FISH] Initialized with %d common and %d rare fishes", getarraysize(.@common_fish), getarraysize(.@rare_fish));
.@npc$ = strnpcinfo(0); // the full name of the fishing spot
diff --git a/npc/functions/instances.txt b/npc/functions/instances.txt
index ee9c3081e..86d08d0a5 100644
--- a/npc/functions/instances.txt
+++ b/npc/functions/instances.txt
@@ -15,14 +15,14 @@ OnInstRestart:
// Candor Instance (we do all tests for debugmes here)
.CANDOR_INSTID = instance_create("002-1@CandorInst", 0, IOT_NONE);
if (.CANDOR_INSTID < 0) {
- debugmes "Error: No instance ID";
+ Exception("CANDY Instance ID failed", RB_DEBUGMES|RB_IRCBROADCAST);
} else {
//debugmes("created new instance id: %s", str(.CANDOR_INSTID));
.CANDOR1$=instance_attachmap("002-1", .CANDOR_INSTID, 0, "002-1@Candor");
- if (.CANDOR1$ == "") debugmes "Error: Map 002-1 CANDY failed";
+ if (.CANDOR1$ == "") Exception("Map 002-1 CANDY failed", RB_DEBUGMES|RB_IRCBROADCAST);
.CANDOR3$=instance_attachmap("002-3", .CANDOR_INSTID, 0, "002-3@Candor");
- if (.CANDOR3$ == "") debugmes "Error: Map 002-3 CANDY failed";
+ if (.CANDOR3$ == "") Exception("Map 002-3 CANDY failed", RB_DEBUGMES|RB_IRCBROADCAST);
debugmes "Nard's Ship in Candor instance is set.";
instance_set_timeout(1000000, 1000000, .CANDOR_INSTID);
diff --git a/npc/functions/inventoryplace.txt b/npc/functions/inventoryplace.txt
index 4a5e08cad..76cdad21f 100644
--- a/npc/functions/inventoryplace.txt
+++ b/npc/functions/inventoryplace.txt
@@ -13,8 +13,7 @@ function script inventoryplace {
if (.@argc % 2 != 0)
{
- debugmes "inventoryplace: Wrong argument count.";
- close;
+ Exception("inventoryplace: Wrong argument count.", RB_SPEECH|RB_ISFATAL|RB_PLEASEREPORT|RB_DEBUGMES);
}
for (.@i = .@j = 0; .@i < .@argc; .@i += 2)
diff --git a/npc/functions/mobhunter.txt b/npc/functions/mobhunter.txt
index 464a88ef9..e7bf03421 100644
--- a/npc/functions/mobhunter.txt
+++ b/npc/functions/mobhunter.txt
@@ -30,9 +30,7 @@ function script GHQ_GetQuestIDByMonsterID {
return 8;
break;
default:
- debugmes "Invalid mob ID: " + getarg(0);
- dispbottom l("ERROR, Please report: GHQ GQID: Invalid ID: @@", getarg(0));
- return 0;
+ return Exception("GHQ GQID: Invalid ID: "+getarg(0), RB_DEFAULT^RB_PLEASEREPORT|RB_ISFATAL);
break;
}
@@ -66,9 +64,7 @@ function script GHQ_GetMonsterIDByQuestID {
return MountainSnake;
break;
default:
- debugmes "Invalid quest ID: " + getarg(0);
- dispbottom l("ERROR, Please report: GHQ GMID: Invalid ID: @@", getarg(0));
- return 0;
+ return Exception("GHQ GMID: Invalid ID: "+getarg(0), RB_DEFAULT^RB_PLEASEREPORT|RB_ISFATAL);
break;
}
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index 3f4ab0a09..1c6652a7e 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -667,9 +667,18 @@ function script Exception {
if (.@gf & RB_SPEECH)
mesc("ERROR, REPORT ME! "+.@msg$, 1);
- if (.@gf & RB_PLEASEREPORT)
+ if (.@gf & RB_IRCBROADCAST)
+ channelmes("#world", "Error in script: "+.@msg$);
+
+ if (.@gf & RB_GLOBALANNOUNCE)
+ announce("Error in script: "+.@msg$, bc_all);
+
+ if (.@gf & RB_PLEASEREPORT|RB_DISPBOTTOM)
dispbottom("Please take a screenshot and report this bug, explaining how it happened.");
+ if (.@gf & RB_PLEASEREPORT|RB_SPEECH)
+ mesc("Please take a screenshot and report this bug, explaining how it happened."), 1;
+
if (.@gf & RB_ISFATAL) {
if (.@gf & RB_SPEECH) {
mesc l("This error is fatal."), 1;