summaryrefslogblamecommitdiff
path: root/npc/items/teleporter.txt
blob: 85da81188c0707af39d8d9232f94f562c8e183d7 (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                                      





                                                                                








                                                                      



                                                           



                                                                                            

         



                                                                                                   

         
                                                   
 
        
                           

                                                       
 

          
       
                         



                                                           
                                                                 
     



                
                         


                                                           
                              
                                                                 
     

                
 
// TMW2 scripts.
// Authors:
//    Pyndragon
//    Jesusalva
// Description:
//    Hand Teleporter (also saves coordinates - @memo)

-	script	LoF Teleporter	NPC_HIDDEN,{
    close;

    // Checks if you can warp
    function loftel_check {
        getmapxy(.@m$, .@x, .@y);
        return (readparam(Hp) < readparam(MaxHp) && !getmapflag(.@m$, mf_town));
    }

L_Cooldown:
    mesn;
    mesc l("This teleporter is currently recharging.");
    mesc l("You can use it again in @@.", FuzzyTime(TELEPORTER_TIME));
    close;

OnUse:
    if (TELEPORTER_TIME > gettimetick(2))
        goto L_Cooldown;
    if (readparam(Hp) < readparam(MaxHp)) {
        dispbottom l("You are hurt, and cannot use this.");
        end;
    }
    if (BaseLevel < 20) {
        dispbottom l("This is too powerful to you. Get level 20 before attempting to use.");
        end;
    }

    mesn;
    mesc l("Ozthokk, a great sage from the Land Of Fire, holds secrets of time and space travel.");
    mesc l("This is not magic, it is science!");
    mes "";
    mesc l("PS. Additional reagents may be required for warps.");
    next;

    .@x=reputation("Hurns")+countitem(TimeFlask)-1;

    menu
        l("Don't warp"), -,
        l("Land Of Fire Village (@@m)", 50-.@x), L_LoF,
        l("Save Point (@@m)", 30-.@x), L_Save;

    close;

L_Save:
    if (loftel_check()) {
        dispbottom l("You are hurt, and cannot use this.");
    } else {
	    doevent "shake::OnGM";
        warp "Save", 0, 0;
        TELEPORTER_TIME=gettimetick(2)+min((60*30)-(.@x*60), 30);
    }
    closedialog;
    end;

L_LoF:
    if (loftel_check()) {
        dispbottom l("You are hurt, and cannot use this.");
    } else {
	    doevent "shake::OnGM";
        warp "017-1", 120, 89;
        TELEPORTER_TIME=gettimetick(2)+min((60*50)-(.@x*60), 30);
    }
    closedialog;
    end;
}