Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't remove towels from inventory on usage #453

Merged
merged 2 commits into from Feb 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion world/map/npc/002-2/stranger.txt
Expand Up @@ -420,7 +420,6 @@ L_DeletePowder:

L_DyeTowel:
delitem @towelReq$[@towelCheckCount], 1;
callfunc "MultiWarpTowel";
delitem "BottleOfWater", 1;
getitem @warpTowelName$, 1;
mes "He takes your towel, the water and the gem powder, then he turns away and does something you can't see. After a few minutes, he turns to you again.";
Expand Down
1 change: 0 additions & 1 deletion world/map/npc/functions/soul_menhir.txt
Expand Up @@ -11,7 +11,6 @@ function|script|SoulMenhir
L_Towel:
if (TowelLastUsed > (gettimetick(2) - 1800))
goto L_DontPanic;
callfunc "MultiWarpTowel";
set TowelLastUsed, gettimetick(2);
mes "[Soul Menhir]";
mes "(You touch the mysterious stone. Somehow it feels hard and soft at the same time.)";
Expand Down
27 changes: 1 addition & 26 deletions world/map/npc/items/warpTowels.txt
@@ -1,16 +1,14 @@
// See #TravelConfig
function|script|WarpTowel
{
set @seconds, TowelLastUsed - (gettimetick(2) - 1800);
set @seconds, TowelLastUsed - (gettimetick(2) - 1200);
if (@seconds > 0)
goto L_DontPanic;
if (isin("botcheck",25,27,51,47))
goto L_Prison;
if (getmapflag(getmap(), MF_NOSAVE) || getmapflag(getmap(), MF_NOTELEPORT) || getmapflag(getmap(), MF_NOWARP) || isin("009-7",$@fightclub_x1,$@fightclub_y1,$@fightclub_x2,$@fightclub_y2))
goto L_Forbid;

callfunc "MultiWarpTowel";

if (@warpTowelName$ == "HitchhikersTowel")
goto L_Save;
if(@warpTowelName$ == "WhiteHitchhikersTowel")
Expand Down Expand Up @@ -154,26 +152,3 @@ L_End:
set @warpTowelName$, "";
return;
}

function|script|MultiWarpTowel
{
setarray $@warpTowels$, "HitchhikersTowel", "WhiteHitchhikersTowel", "RedHitchhikersTowel", "GreenHitchhikersTowel", "BlueHitchhikersTowel", "YellowHitchhikersTowel", "PurpleHitchhikersTowel", "OrangeHitchhikersTowel", "PinkHitchhikersTowel", "TealHitchhikersTowel", "LimeHitchhikersTowel";
set @towel_count, 0;
set @towel_loop, 0;
goto L_CountTowelLoop;

L_CountTowelLoop:
set @towel_count, (@towel_count + countitem($@warpTowels$[@towel_loop]));
delitem $@warpTowels$[@towel_loop], countitem($@warpTowels$[@towel_loop]);
goto L_DelLoopAgain;

L_DelLoopAgain:
if((@towel_loop + 1) == getarraysize($@warpTowels$))
goto L_Return;
set @towel_loop, (@towel_loop + 1);
goto L_CountTowelLoop;

L_Return:
cleararray $@warpTowels$, "", getarraysize($@warpTowels$);
return;
}