Jump to content

Question

Posted

help can anyone do this to me that before you warp to that map u need to finish the npc Requirments 

example

level 2 quest room before you can warp to level2 quest room u need to finish some quest to the npc that will warp you in level2 questroom map  

like break the seal but this the map before the npc warp you to the level 2 quest room you need to finish the quest first 

3 answers to this question

Recommended Posts

Posted

You can add a check if a certain player finished the first one or not. So something like this :

 

1. Upon completing the first quest, set a character or account base variable to 1.

set Done, 1;

2. Add a check on the warper script and if it comply with the variable Done. Warp that player

if ( Done ) 
    warp <map name>,<x>,<y>;
Posted

Try this one : 

 

prontera,150,150,0    script    Sample    100,{
    
    set .@npc$, "[ " +strnpcinfo(1)+ " ]";
    setarray .@id[0], 7227,100,7179,100; // <item id>, <amount>
    set .@reward, 1604;
    set .@size, getarraysize(.@id);

    if ( Done ) {
        mes "You already finished the quest";
        // warp "<map>", <x>, <y>;
        close;
    }

    mes "Requirements : ";
    for ( set .@j, 0; .@j < .@size; set .@j, .@j + 2 )
        mes .@id[.@j+1]+ "x " +getitemname(.@id[.@j]);

    next;

    for ( set .@i, 0; .@i < .@size; set .@i, .@i + 2 ) {
        if ( countitem( .@id[ .@i ] ) < .@id[ .@i + 1 ] ) {
            mes "You don't meet the requirements";
            close;
        }
        delitem .@id[.@i], .@id[.@i + 1];
    }

    mes "Done!";
    close2;
    getitem .@reward, 1;
    set Done, 1;    
    end;
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...