summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/constants.conf2
-rw-r--r--db/re/item_db.conf5
-rw-r--r--npc/002-1/dan.txt2
-rw-r--r--npc/items/shovel.txt29
4 files changed, 33 insertions, 5 deletions
diff --git a/db/constants.conf b/db/constants.conf
index e8aab7562..ff55be80f 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -4394,7 +4394,7 @@ constants_db: {
FX_BLVLUP: 0
FX_JLVLUP: 1
FX_WARPPOINT: 5
- FX_HEALING: 7
+ FX_HEALINGPART: 7
FX_POISON: 8
FX_AFK: 10
FX_CRITICAL: 11
diff --git a/db/re/item_db.conf b/db/re/item_db.conf
index e6a0d6238..1808e1327 100644
--- a/db/re/item_db.conf
+++ b/db/re/item_db.conf
@@ -3194,10 +3194,9 @@ item_db: (
Script: <"
// ShovelQuests_Assigned<MAP$,X,Y> → Coordinates for Treasure Map
if (!ShovelQuests_AssignedX) {
- dispbottom ("You cannot read this map...");
- } else {
- dispbottom ("A treasure is burried in @@, (@@, @@)", ShovelQuests_AssignedMAP$, ShovelQuests_AssignedX, ShovelQuests_AssignedY);
+ callfunc "shovel_genrandtreasure";
}
+ dispbottom l("A treasure is burried in @@, (@@, @@)", ShovelQuests_AssignedMAP$, ShovelQuests_AssignedX, ShovelQuests_AssignedY);
">
},
diff --git a/npc/002-1/dan.txt b/npc/002-1/dan.txt
index 04a04a814..192602c39 100644
--- a/npc/002-1/dan.txt
+++ b/npc/002-1/dan.txt
@@ -91,7 +91,7 @@ OnInit:
// TODO this code below is bad and should be entirely rewritten
002-1,0,0,0 script PiouSpwn NPC_HIDDEN,{
function DanCheck {
- if (player_attached()) {
+ if (playerattached()) {
// Quest not in progress - nothing to do
if (getq(ShipQuests_Dan) != 1)
return;
diff --git a/npc/items/shovel.txt b/npc/items/shovel.txt
index b0b3553c6..7814acd5a 100644
--- a/npc/items/shovel.txt
+++ b/npc/items/shovel.txt
@@ -331,6 +331,18 @@ OnHour00:
}
+function script shovel_randomtreasure {
+ .@id=any(TreasureKey,CoinBag,TreasureKey,SulfurPowder,Coal,
+ IronOre,CopperOre,LeadOre,TinOre,SilverOre,GoldOre,PlatinumOre,IridiumOre,TitaniumOre,
+ Diamond,Ruby,Emerald,Sapphire,Topaz,Amethyst);
+ .@amount=any(1,1,2);
+ getitem .@id, .@amount;
+ narrator S_FIRST_BLANK_LINE,
+ l("You found something!"),
+ l("It's @@ @@.", .@amount, getitemname(.@id));
+ return;
+}
+
function script shovel_addquest {
if (getargcount() < 4)
{
@@ -369,4 +381,21 @@ function script shovel_adddigrect {
return 1;
}
+function script shovel_genrandtreasure {
+ .@m$=any_of("007-1", "011-1", "015-1", "018-1");
+ // Dangerous
+ do {
+ .@x=rand2(20, getmapinfo(MAPINFO_SIZE_X, .@m$)-20);
+ .@y=rand2(20, getmapinfo(MAPINFO_SIZE_Y, .@m$)-20);
+ } while (!checkcell(.@m$, .@x, .@y, cell_chkpass));
+
+ // Success
+ if (checkcell(.@m$, .@x, .@y, cell_chkpass)) {
+ shovel_addquest(.@m$, .@x, .@y, "shovel_randomtreasure");
+ ShovelQuests_AssignedMAP$=.@m$;
+ ShovelQuests_AssignedX=.@x;
+ ShovelQuests_AssignedY=.@y;
+ }
+ return;
+}