summaryrefslogtreecommitdiff
path: root/world/map/npc/items
diff options
context:
space:
mode:
Diffstat (limited to 'world/map/npc/items')
-rw-r--r--world/map/npc/items/anchor_stone.txt56
-rw-r--r--world/map/npc/items/maps.txt9
-rw-r--r--world/map/npc/items/rubber_bat.txt5
-rw-r--r--world/map/npc/items/rubber_duck.txt5
-rw-r--r--world/map/npc/items/scissors.txt1
-rw-r--r--world/map/npc/items/shovel.txt5
-rw-r--r--world/map/npc/items/silver_bell.txt6
-rw-r--r--world/map/npc/items/warpTowels.txt15
8 files changed, 83 insertions, 19 deletions
diff --git a/world/map/npc/items/anchor_stone.txt b/world/map/npc/items/anchor_stone.txt
new file mode 100644
index 00000000..c1ea722b
--- /dev/null
+++ b/world/map/npc/items/anchor_stone.txt
@@ -0,0 +1,56 @@
+function|script|useAnchorStone
+{
+ addtimer 0, "AS_Core::OnUse";
+ return;
+}
+
+-|script|AS_Core|32767
+{
+ end;
+
+OnUse:
+ if ( @StoneName$ == "AnchorStone" ) goto L_AnchorStone;
+ if ( @StoneName$ == "AnchoredAnchorStone" ) goto L_AnchoredAnchorStone;
+ goto L_Close;
+
+L_AnchorStone:
+ mes "\"You really want to bind the [@@" + AnchorStone + "|@@] to this place?\"";
+ menu
+ "No", L_Close,
+ "Yes", L_AS_Yes;
+
+L_AS_Yes:
+ set AnchorStoneDest, getmaphash(getmap()); // since a hash could be negative I take a separate variable for that since shifting would destroy the sign bit and create a different hash
+ set AnchorStoneDestCoord, gety() << AS_Y_SHIFT | getx() << AS_X_SHIFT;
+
+ delitem AnchorStone, 1;
+ getitem AnchoredAnchorStone, 1;
+ close;
+
+L_AnchoredAnchorStone:
+ if ((AnchorStoneDest < 1) && (AnchorStoneDest > -1)) goto L_AAS_Error;
+ mes "\"You want to recall to the place the [@@" + AnchoredAnchorStone + "|@@] is bound to?\"";
+ menu
+ "No", L_Close,
+ "Yes", L_AAS_Yes;
+
+L_AAS_Yes:
+ warp getmapnamefromhash(AnchorStoneDest), (AnchorStoneDestCoord & AS_X_MASK >> AS_X_SHIFT), (AnchorStoneDestCoord & AS_Y_MASK >> AS_Y_SHIFT);
+
+ goto L_AAStoAS;
+
+L_AAS_Error:
+ mes "\"Something went wrong the [@@" + AnchoredAnchorStone + "|@@] lost its destination and turns back to normal.\"";
+ goto L_AAStoAS;
+
+L_AAStoAS:
+ set AnchorStoneDest, 0;
+ set AnchorStoneDestCoord, 0;
+
+ delitem AnchoredAnchorStone, 1;
+ getitem AnchorStone, 1;
+ close;
+
+L_Close:
+ close;
+}
diff --git a/world/map/npc/items/maps.txt b/world/map/npc/items/maps.txt
new file mode 100644
index 00000000..29d54e7d
--- /dev/null
+++ b/world/map/npc/items/maps.txt
@@ -0,0 +1,9 @@
+function|script|readMap
+{
+ message strcharinfo(0), "You have no clue how to use this item yet.";
+ goto L_Return;
+
+L_Return:
+ set @MapName$, "";
+ return;
+}
diff --git a/world/map/npc/items/rubber_bat.txt b/world/map/npc/items/rubber_bat.txt
index 0bf80ede..ea569a22 100644
--- a/world/map/npc/items/rubber_bat.txt
+++ b/world/map/npc/items/rubber_bat.txt
@@ -1,12 +1,11 @@
function|script|rubberBat
{
- if (gettimetick(2) - @lastbat < 2) goto L_Return;
+ if (gettimetick(2) - @lastsound < 2) goto L_Return;
misceffect 403;
- set @lastbat, gettimetick(2);
+ set @lastsound, gettimetick(2);
goto L_Return;
L_Return:
- getitem "RubberBat", 1;
// debugmes "Check";
if ($DOOMSDAY == 3)
addtimer 10, "#TMWFinalExam::OnRubberBat";
diff --git a/world/map/npc/items/rubber_duck.txt b/world/map/npc/items/rubber_duck.txt
index 3f591c15..8a822752 100644
--- a/world/map/npc/items/rubber_duck.txt
+++ b/world/map/npc/items/rubber_duck.txt
@@ -1,11 +1,10 @@
function|script|rubberDuck
{
- if (gettimetick(2) - @lastbat < 2) goto L_Return;
+ if (gettimetick(2) - @lastsound < 2) goto L_Return;
misceffect 406;
- set @lastbat, gettimetick(2);
+ set @lastsound, gettimetick(2);
goto L_Return;
L_Return:
- getitem "RubberDucky", 1;
return;
}
diff --git a/world/map/npc/items/scissors.txt b/world/map/npc/items/scissors.txt
index fbf3b344..2e12c6b1 100644
--- a/world/map/npc/items/scissors.txt
+++ b/world/map/npc/items/scissors.txt
@@ -1,6 +1,5 @@
function|script|useScissors
{
- getitem "Scissors", 1;
if (rand(3))
goto L_Change;
message strcharinfo(0), "Whoops!";
diff --git a/world/map/npc/items/shovel.txt b/world/map/npc/items/shovel.txt
new file mode 100644
index 00000000..b706f1fe
--- /dev/null
+++ b/world/map/npc/items/shovel.txt
@@ -0,0 +1,5 @@
+function|script|useShovel
+{
+ message strcharinfo(0), "You have no clue how to use this item yet.";
+ return;
+}
diff --git a/world/map/npc/items/silver_bell.txt b/world/map/npc/items/silver_bell.txt
index 8a791bff..07623426 100644
--- a/world/map/npc/items/silver_bell.txt
+++ b/world/map/npc/items/silver_bell.txt
@@ -1,12 +1,10 @@
function|script|SilverBellSound
{
- if (gettimetick(2) - @lastsilverbell < 20) goto L_Return;
+ if (gettimetick(2) - @lastsound < 2) goto L_Return;
misceffect 404;
- set @lastsilverbell, gettimetick(2);
+ set @lastsound, gettimetick(2);
goto L_Return;
L_Return:
- getitem "SilverBell", 1;
-// debugmes "Check";
return;
}
diff --git a/world/map/npc/items/warpTowels.txt b/world/map/npc/items/warpTowels.txt
index 77a405b5..7ea7ec17 100644
--- a/world/map/npc/items/warpTowels.txt
+++ b/world/map/npc/items/warpTowels.txt
@@ -117,26 +117,25 @@ L_WarpPlayer:
goto L_BreakChance;
L_BreakChance:
- if (rand(15))
- goto L_Keep;
- getitem "HitchhikersTowel", 1;
+ if (@warpTowelName$ != "HitchhikersTowel" && rand(15) < 1)
+ goto L_Break;
goto L_End;
L_Forbid:
message strcharinfo(0), "Towel : This area is protected by a force that doesn't tolerate the power of the Towel.";
- goto L_Keep;
+ goto L_End;
L_Prison:
message strcharinfo(0), "Towel : You must be warped by a GM to leave the botcheck area.";
- goto L_Keep;
+ goto L_End;
L_DontPanic:
callfunc "HumanTime";
message strcharinfo(0), "Towel : Your towel is still too low on power to jump again. Try again in ##B"+ @time$ + "##b.";
- goto L_Keep;
+ goto L_End;
-L_Keep:
- getitem @warpTowelName$, 1;
+L_Break:
+ delitem @warpTowelName$, 1;
goto L_End;
L_End: