summaryrefslogblamecommitdiff
path: root/world/map/npc/items/warpTowels.txt
blob: 77a405b544efa2a567d9d85c6c7f85a1c3a01911 (plain) (tree)
1
2
3
4
5
6
7
8
9
                    
                         
 
                                                         
                               
                         
                                     
                      
                                                                                                                                                                                               

                      
                                              
























                                                   
                                   

                           
                      


                 
                                   

                           
                      


             
                                   

                           
                      


                 
                                   

                           
                      


                      


                                   
                      


                  
                                   

                           
                      


                
                                   

                            
                      


                     
                                   

                            
                      


                
                                   

                            
                      


             
                                   

                           
                           
                      





                                           
                      
 



                                                         
 
              

                    
                                  
               
 
         
                                                                                                                      

                
         
                                                                                             

                
            
                         
                                                                                                                            
                
 
       

                               
 




                              
           
 
// See #TravelConfig
function|script|WarpTowel
{
    set @seconds, TowelLastUsed - (gettimetick(2) - 300);
    if (@seconds > 0 && GM < 1)
        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;

    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
    set @NextLocationMap$, "035-2";
    set @NextLocationX, 20;
    set @NextLocationY, 21;
    goto L_WarpPlayer;

L_Red:
    // Barbarians
    set @NextLocationMap$, "033-1";
    set @NextLocationX, 66;
    set @NextLocationY, 33;
    goto L_WarpPlayer;

L_Green:
    // Candor
    set @NextLocationMap$, "029-1";
    set @NextLocationX, 69;
    set @NextLocationY, 69;
    goto L_WarpPlayer;

L_Blue:
    // Blue Sages
    set @NextLocationMap$, "048-2";
    set @NextLocationX, 26;
    set @NextLocationY, 47;
    goto L_WarpPlayer;

L_Yellow:
    // Tulimshar Mines
    set @NextLocationMap$, "002-1";
    set @NextLocationX, 113;
    set @NextLocationY, 117;
    goto L_WarpPlayer;

L_Purple:
    // Dimonds Inn
    set @NextLocationMap$, "010-1";
    set @NextLocationX, 27;
    set @NextLocationY, 97;
    goto L_WarpPlayer;

L_Orange:
    // Graveyard
    set @NextLocationMap$, "027-1";
    set @NextLocationX, 70;
    set @NextLocationY, 100;
    goto L_WarpPlayer;

L_Pink:
    // Terranite Cave
    set @NextLocationMap$, "012-3";
    set @NextLocationX, 448;
    set @NextLocationY, 66;
    goto L_WarpPlayer;

L_Teal:
    // Mana Seed
    set @NextLocationMap$, "012-3";
    set @NextLocationX, 64;
    set @NextLocationY, 130;
    goto L_WarpPlayer;

L_Lime:
    // Pachua
    set @NextLocationMap$, "006-1";
    set @NextLocationX, 28;
    set @NextLocationY, 97;
    callfunc "MiriamCheat";
    goto L_WarpPlayer;

L_Save:
    // Soul Menhir
    set @NextLocationMap$, getsavepoint(0);
    set @NextLocationX, getsavepoint(1);
    set @NextLocationY, getsavepoint(2);
    goto L_WarpPlayer;

L_WarpPlayer:
    set TowelLastUsed, gettimetick(2);
    warp @NextLocationMap$,@NextLocationX,@NextLocationY;
    goto L_BreakChance;

L_BreakChance:
    if (rand(15))
        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 the botcheck 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:
    set @NextLocationMap$, "";
    set @NextLocationX, 0;
    set @NextLocationY, 0;
    set @warpTowelName$, "";
    return;
}