summaryrefslogtreecommitdiff
path: root/npc/items
diff options
context:
space:
mode:
Diffstat (limited to 'npc/items')
-rw-r--r--npc/items/brawling_item.txt15
-rw-r--r--npc/items/mirror.txt18
-rw-r--r--npc/items/pickled_beets.txt9
-rw-r--r--npc/items/purification_potion.txt26
-rw-r--r--npc/items/require_stat.txt17
-rw-r--r--npc/items/rubber_bat.txt10
-rw-r--r--npc/items/scented_candle.txt36
-rw-r--r--npc/items/scissors.txt12
-rw-r--r--npc/items/shock_sweet.txt14
-rw-r--r--npc/items/unreleased_item.txt14
-rw-r--r--npc/items/warpTowels.txt150
11 files changed, 321 insertions, 0 deletions
diff --git a/npc/items/brawling_item.txt b/npc/items/brawling_item.txt
new file mode 100644
index 00000000..9aa06525
--- /dev/null
+++ b/npc/items/brawling_item.txt
@@ -0,0 +1,15 @@
+// Brawling item
+// callfunc "BrawlingItem", slotId;
+function script BrawlingItem {
+ // If you can equip *anything*, this restriction is moot
+ if (has_permission(PERM_USE_ALL_EQUIPMENT, getcharid(3)))
+ return;
+ // Load stat requisites
+ .@me = getarg(0);
+ // If the requirement isn't met, we set an unequip trigger.
+ // The item is now removed.
+ if (getequipid(EQI_HAND_R) > 0)
+ unequip(.@me);
+ return;
+}
+
diff --git a/npc/items/mirror.txt b/npc/items/mirror.txt
new file mode 100644
index 00000000..5cebed68
--- /dev/null
+++ b/npc/items/mirror.txt
@@ -0,0 +1,18 @@
+function script useMirror {
+ goto L_Rand;
+
+L_Rand:
+ .@mirror_rnd = .@mirror_rnd + 1;
+ @style = rand2(1, getarraysize($@hairstyle$)-1);
+ @color = rand2(getarraysize($@haircolor$));
+ if (((getlook(LOOK_HAIR_STYLE) == @style) ||
+ (getlook(LOOK_HAIR_COLOR) == @color)) &&
+ .@mirror_rnd < 15)
+ goto L_Rand;
+ if (@fixedMirror)
+ setlook LOOK_HAIR_STYLE, @style;
+ setlook LOOK_HAIR_COLOR, @color;
+ //if(!@fixedMirror) getitem "SilverMirror", 1; <== this can be used in the future to have a portable hair color changer (like scissors but for the color)
+ @fixedMirror = 0;
+ return;
+}
diff --git a/npc/items/pickled_beets.txt b/npc/items/pickled_beets.txt
new file mode 100644
index 00000000..a1a418c6
--- /dev/null
+++ b/npc/items/pickled_beets.txt
@@ -0,0 +1,9 @@
+function script usePickledBeets {
+ heal 50, 0;
+ if (Class == 1)
+ setlook LOOK_HAIR_COLOR, HC_PURPLE;
+ else if (Class == 2)
+ setlook LOOK_HAIR_COLOR, 18;
+ // add more here for races that have purple
+ return;
+}
diff --git a/npc/items/purification_potion.txt b/npc/items/purification_potion.txt
new file mode 100644
index 00000000..47f84f3b
--- /dev/null
+++ b/npc/items/purification_potion.txt
@@ -0,0 +1,26 @@
+
+function script usePurificationPotion {
+ if (isat("011-1", 88,67))
+ goto L_Wyara_Pond;
+ goto L_NoUse;
+
+L_NoUse:
+ message strcharinfo(0), "You don't know what to do with this.";
+ getitem "PurificationPotion", 1;
+ return;
+
+L_Wyara_Pond:
+ @Q_MASK = NIBBLE_2_MASK;
+ @Q_SHIFT = NIBBLE_2_SHIFT;
+ @Q_status = (QUEST_MAGIC2 & @Q_MASK) >> @Q_SHIFT;
+
+ if (@Q_status < 1)
+ goto L_NoUse;
+ if (@Q_status <= 2)
+ @Q_status = @Q_status + 1;
+
+ message strcharinfo(0), "You pour the potion into the pond.";
+
+ QUEST_MAGIC2 = (QUEST_MAGIC2 & ~(@Q_MASK) | (@Q_status << @Q_SHIFT));
+ return;
+}
diff --git a/npc/items/require_stat.txt b/npc/items/require_stat.txt
new file mode 100644
index 00000000..815f7b5a
--- /dev/null
+++ b/npc/items/require_stat.txt
@@ -0,0 +1,17 @@
+// Unequip if stat not enough
+// callfunc "RequireStat", bDex, 80, EQI_HAND_R;
+function script RequireStat {
+ // If you can equip *anything*, this restriction is moot
+ if (has_permission(PERM_USE_ALL_EQUIPMENT, getcharid(3)))
+ return;
+ // Load stat requisites
+ .@stat = getarg(0);
+ .@min = getarg(1);
+ .@me = getarg(2);
+ .@val = readparam(.@stat);
+ // If the requirement isn't met, we set an unequip trigger.
+ // The item is now removed.
+ if (.@val < .@min)
+ unequip(.@me);
+ return;
+}
diff --git a/npc/items/rubber_bat.txt b/npc/items/rubber_bat.txt
new file mode 100644
index 00000000..a5921674
--- /dev/null
+++ b/npc/items/rubber_bat.txt
@@ -0,0 +1,10 @@
+function script rubberBat {
+ if (gettimetick(2) - @lastbat < 2) goto L_Return;
+ misceffect 403;
+ @lastbat = gettimetick(2);
+ goto L_Return;
+
+L_Return:
+ getitem "RubberBat", 1;
+ return;
+}
diff --git a/npc/items/scented_candle.txt b/npc/items/scented_candle.txt
new file mode 100644
index 00000000..62ed706d
--- /dev/null
+++ b/npc/items/scented_candle.txt
@@ -0,0 +1,36 @@
+- script ScentedCandle NPC32767,{
+ end;
+
+OnEquip:
+ if (@scented_candle == 1) end;
+ goto L_Check;
+
+OnCheck:
+ if (getequipid(equip_head) != 5229) goto L_Removed;
+ goto L_Check;
+
+L_Check:
+ @scented_candle = 1;
+ getmapxy(.@m$, .@x, .@y, 0);
+ .@r = 12;
+
+ .@c=getunits(BL_MOB, .@mbs, false, .@m$, .@x-.@r, .@y-.@r, .@x+.@r, .@y+.@r);
+ for (.@i = 0; .@i < .@c; .@i++) {
+ @target_id=.@mbs[.@i];
+ //if (target(BL_ID, @target_id, 0x20) != 0x20) end; // line of sight
+ if (getunitdata(@target_id, UDT_CLASS) != 1131 && // mana bug
+ getunitdata(@target_id, UDT_CLASS) != 1055 && // butterfly
+ getunitdata(@target_id, UDT_CLASS) != 1049 && // bee
+ getunitdata(@target_id, UDT_CLASS) != 1088) end; // hyvern
+ aggravate @target_id;
+ }
+ addtimer rand(2000), strnpcinfo(0) + "::OnCheck";
+ end;
+
+OnMob:
+ end;
+
+L_Removed:
+ @scented_candle = 0;
+ end;
+}
diff --git a/npc/items/scissors.txt b/npc/items/scissors.txt
new file mode 100644
index 00000000..95d07b8b
--- /dev/null
+++ b/npc/items/scissors.txt
@@ -0,0 +1,12 @@
+function script useScissors {
+ getitem "Scissors", 1;
+ if (rand(3))
+ goto L_Change;
+ message strcharinfo(0), "Whoops!";
+ heal -20 - rand(Hp >> 1), 0; // ???
+ return;
+
+L_Change:
+ setlook LOOK_HAIR_STYLE, rand(1,getarraysize($@hairstyle$)-1);
+ return;
+}
diff --git a/npc/items/shock_sweet.txt b/npc/items/shock_sweet.txt
new file mode 100644
index 00000000..c35ce37f
--- /dev/null
+++ b/npc/items/shock_sweet.txt
@@ -0,0 +1,14 @@
+function script useShockSweet {
+ if (rand(5))
+ goto L_Change;
+ message strcharinfo(0), "Yuck, this tastes like earwax!";
+ heal -20 - (Hp >> 2), 0;
+ return;
+
+L_Change:
+ setlook LOOK_HAIR_COLOR, 122;
+ message strcharinfo(0), "Gah! That was some strong stuff!";
+ sc_start SC_POISON, 1, 20;
+ misceffect 15, strcharinfo(0);
+ return;
+}
diff --git a/npc/items/unreleased_item.txt b/npc/items/unreleased_item.txt
new file mode 100644
index 00000000..de7ac0f0
--- /dev/null
+++ b/npc/items/unreleased_item.txt
@@ -0,0 +1,14 @@
+// Unreleased items
+function script UnreleasedItem {
+ // If the server allows equipping unreleased items or if the active character is staff, do nothing.
+ // If you can equip *anything*, this restriction is moot
+ if (debug || has_permission(PERM_USE_ALL_EQUIPMENT, getcharid(3)))
+ return;
+ .@me=getarg(0);
+ message strcharinfo(0), "You have difficulties equipping this item, as if it is not yet fully in this world.";
+ unequip(.@me);
+ goto L_Return;
+
+L_Return:
+ return;
+}
diff --git a/npc/items/warpTowels.txt b/npc/items/warpTowels.txt
new file mode 100644
index 00000000..a6ffa8d1
--- /dev/null
+++ b/npc/items/warpTowels.txt
@@ -0,0 +1,150 @@
+function script WarpTowel {
+ @seconds = TowelLastUsed - (gettimetick(2) - 1200);
+ if (@seconds > 0 && !is_trusted())
+ goto L_DontPanic;
+ .@zone = getmapinfo(MAPINFO_ZONE);
+ if (.@zone == "Jail")
+ goto L_Prison;
+ // Zone will never be MMO, though
+ if (.@zone == "MMO" || .@zone == "Event")
+ goto L_Forbid;
+ if (getmapflag(getmapname(), mf_noteleport) || getmapflag(getmapname(), mf_nowarp) || isin("009-7",$@fightclub_x1,$@fightclub_y1,$@fightclub_x2,$@fightclub_y2))
+ goto L_Forbid;
+
+ if (@warpTowelName$ == "HitchhikersTowel")
+ goto L_Save;
+ if(@warpTowelName$ == "WhiteHitchhikersTowel")
+ goto L_White;
+ if(@warpTowelName$ == "RedHitchhikersTowel")
+ goto L_Red;
+ if(@warpTowelName$ == "GreenHitchhikersTowel")
+ goto L_Green;
+ if(@warpTowelName$ == "BlueHitchhikersTowel")
+ goto L_Blue;
+ if(@warpTowelName$ == "YellowHitchhikersTowel")
+ goto L_Yellow;
+ if(@warpTowelName$ == "PurpleHitchhikersTowel")
+ goto L_Purple;
+ if(@warpTowelName$ == "OrangeHitchhikersTowel")
+ goto L_Orange;
+ if(@warpTowelName$ == "PinkHitchhikersTowel")
+ goto L_Pink;
+ if(@warpTowelName$ == "TealHitchhikersTowel")
+ goto L_Teal;
+ if(@warpTowelName$ == "LimeHitchhikersTowel")
+ goto L_Lime;
+ goto L_Save;
+
+L_White:
+ // Koga
+ @NextLocationMap$ = "035-2";
+ @NextLocationX = 20;
+ @NextLocationY = 21;
+ goto L_WarpPlayer;
+
+L_Red:
+ // Barbarians
+ @NextLocationMap$ = "033-1";
+ @NextLocationX = 66;
+ @NextLocationY = 33;
+ goto L_WarpPlayer;
+
+L_Green:
+ // Candor
+ @NextLocationMap$ = "029-1";
+ @NextLocationX = 69;
+ @NextLocationY = 69;
+ goto L_WarpPlayer;
+
+L_Blue:
+ // Blue Sages
+ @NextLocationMap$ = "048-2";
+ @NextLocationX = 26;
+ @NextLocationY = 47;
+ goto L_WarpPlayer;
+
+L_Yellow:
+ // Tulimshar Mines
+ @NextLocationMap$ = "002-1";
+ @NextLocationX = 113;
+ @NextLocationY = 117;
+ goto L_WarpPlayer;
+
+L_Purple:
+ // Dimonds Inn
+ @NextLocationMap$ = "010-1";
+ @NextLocationX = 27;
+ @NextLocationY = 97;
+ goto L_WarpPlayer;
+
+L_Orange:
+ // Graveyard
+ @NextLocationMap$ = "027-1";
+ @NextLocationX = 70;
+ @NextLocationY = 100;
+ goto L_WarpPlayer;
+
+L_Pink:
+ // Terranite Cave
+ @NextLocationMap$ = "012-3";
+ @NextLocationX = 448;
+ @NextLocationY = 66;
+ goto L_WarpPlayer;
+
+L_Teal:
+ // Mana Seed
+ @NextLocationMap$ = "012-3";
+ @NextLocationX = 64;
+ @NextLocationY = 130;
+ goto L_WarpPlayer;
+
+L_Lime:
+ // Pachua
+ @NextLocationMap$ = "006-1";
+ @NextLocationX = 28;
+ @NextLocationY = 97;
+ callfunc "MiriamCheat";
+ goto L_WarpPlayer;
+
+L_Save:
+ // Soul Menhir
+ @NextLocationMap$ = getsavepoint(0);
+ @NextLocationX = getsavepoint(1);
+ @NextLocationY = getsavepoint(2);
+ goto L_WarpPlayer;
+
+L_WarpPlayer:
+ TowelLastUsed = gettimetick(2);
+ warp @NextLocationMap$,@NextLocationX,@NextLocationY;
+ goto L_BreakChance;
+
+L_BreakChance:
+ if (rand2(12))
+ goto L_Keep;
+ getitem HitchhikersTowel, 1;
+ 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;
+
+L_Prison:
+ message strcharinfo(0), "Towel : You must be warped by a GM to leave this area.";
+ goto L_Keep;
+
+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;
+
+L_Keep:
+ getitem @warpTowelName$, 1;
+ goto L_End;
+
+L_End:
+ @NextLocationMap$ = "";
+ @NextLocationX = 0;
+ @NextLocationY = 0;
+ @warpTowelName$ = "";
+ return;
+}