Jump to content

DeadlySilence

Members
  • Posts

    181
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by DeadlySilence

  1. As requested by Armor, I updated the script a bit.

    The group name of every GM (thus, his/her position on your server) is now shown in front of the name. To enable this feature you have to follow the instructions and apply the patch.

     

    Thanks to Akinari for helping me with the script command and Armor for suggesting this feature.

  2. Ich vermute es ist wegen den Angriffen auf den Server und wegen den Problemen der letzten Tage, als der Server oft offline war. Sehr schade, ich habe dort eine Weile gespielt, nachdem ich einige Jahre pausiert habe, und fand es ganz nett.

  3. I haven't tinkered with the new instances too much yet, but as far as I know all NPCs get cloned to the instance maps, so you can write them once for the basic map and they'll automatically be place in your instance.

    Maybe one of my more skilled colleagues can answer that one :D

  4. Is your character in a party? That's a requirement for instances.

    Alternatively, you could replace case 1 with this code for a more specific error reporting:

                switch(instance_create(.@mdName$)) {
                
                    case -4:
                        mes "[Guard]";
                        mes "No free instances.";
                        close;
                        
                    case -3:
                        mes "[Guard]";
                        mes "Instance already exists.";
                        close;
                    
                    case -2:
                        mes "[Guard]";
                        mes "Party not found.";
                        close;
                        
                    case -1:
                        mes "[Guard]";
                        mes "Invalid type.";
                        close;
                        
                    default:
                        mes "[Guard]";
                        mes "I will open up the tunnel to ^0000ff" + .@mdName$ + "^000000.";
                        close;
                }
    
  5. Ok, so the first step is specifying the instance in your db/[pre-]re/instance_db.txt like this:

    ID,Name,LimitTime,EnterMap,EnterX,EnterY,Map1,Map2,Map3,Map4,Map5,Map6,Map7,Map8
    

    ID is the instance's numerical identifier.

    Name is the instance's name.

    LimitTime is the time in seconds until the instance expires.

    EnterMap, EnterX, EnterY are the maps and coordinates where you enter the instance.

    Map1, ..., Map8 are the real names of the maps (if you want to make an instance of izlude, Map1 would be "izlude").

     

    This results in:

    14,Training Ground,7200,new_1-1,53,111,new_1-1,new_1-2,new_1-3
    

    An instance of the maps new_1-1, new_1-2, and new_1-3 will be created. You will start at new_1-1 at the coordinates 53, 111 with a time limit of 2 hours.

     

    My sample script with the basic commands needed looks like this:

    prontera,150,150,0    script    Instance    100,{
    
        .@mdName$ = "Training Ground";
        
        mes "[Guard]";
        mes "How can I help you?";
        switch(select("Create Instance:Enter Instance:Warp:Destroy Instance")) {
            
            next;
            case 1:
                if (instance_create(.@mdName$) < 0) {
                    mes "^0000ff" + .@mdName$ + "^000000 cannot be opened now.";
                    close;
                }
                mes "[Guard]";
                mes "I will open up the tunnel to ^0000ff" + .@mdName$ + "^000000.";
                mes "I wish you good luck.";
                close;
                
            case 2:
                if (instance_enter(.@mdName$)) {
                    mes "[Guard]";
                    mes "There has been a problem with entering the instance.";
                    close;
                }
                end;
                
            case 3:
                mes "[Guard]";
                mes "Where do you want to go?";
                switch(select("new_1-1:new_1-2:new_1-3")) {
                
                    case 1:
                        close2;
                        if (instance_enter(.@mdName$)) {
                            mes "[Guard]";
                            mes "There has been a problem with entering the instance.";
                            close;
                        }                    
                        warp instance_mapname("new_1-1"), 53, 111;
                        end;
                        
                    case 2:
                        close2;
                        if (instance_enter(.@mdName$)) {
                            mes "[Guard]";
                            mes "There has been a problem with entering the instance.";
                            close;
                        }    
                        warp instance_mapname("new_1-2"), 100, 9;
                        end;
                        
                    case 3:
                        close2;
                        if (instance_enter(.@mdName$)) {
                            mes "[Guard]";
                            mes "There has been a problem with entering the instance.";
                            close;
                        }    
                        warp instance_mapname("new_1-3"), 96, 20;
                        end;            
                }
                
            case 4:
                instance_destroy();
                mes "[Guard]";
                mes "The instance has been destroyed.";
                close;
        }
    }
    

    You specify the instance's name (which is also used in the instance_db) to create and enter the instance.

    The first case in this NPC shows how you can create an instance, simply with instance_create("name from database").

    The second case shows how you enter the instance to the starting point you defined in the database

    The third case is an example how to warp between maps of the same instance.

    And last, but not least, you can destroy an instance with the fourth option.

    • Upvote 1
  6. .@atcmd_command$       =  The name of the @command used.
    .@atcmd_parameters$[]  =  Array containing the given parameters, starting from an index of 0.
    .@atcmd_numparameters  =  The number of parameters defined.
    

    You can get command parameters with .@atcmd_parameters$[index].

    So, @test a b would result in this:

    .@atcmd_command$        = @test
    .@atcmd_parameters$[0]  = a
    .@atcmd_parameters$[1]  = b
    .@atcmd_numparameters   = 2
    
    • Upvote 1
  7. Oh, now that's more complicated as the format you use isn't any standard I know...

    I would suggest to use the format %Y-%m-%d rather than %Y%m%d for the .@tree_water variable.

    If you decide to do this, you could easily use this query:

    query_sql "SELECT DATEDIFF('" + gettimestr("%Y-%m-%d",21) + "','" + .@tree_water + "')", .@tree_change_lvl;
    
    • Upvote 1
  8. The syntax is

    DATEDIFF(first_date, second_date);
    

    and it selects the difference between two dates. It doesn't take arguments regarding the type of difference (e.g. hour, day, month), it always returns the difference in days.

    So the correct syntax for your query would be

    query_sql "SELECT DATEDIFF('2007-06-05','2006-06-05')", .@change_lvl;
    

    and would return 365.

  9. I don't think you can use a WHERE condition in an INSERT query.

    You either have to remove the condition like this:

    query_sql("INSERT INTO `tree_db` (`last_water`) VALUES (" + gettimetick(2) + ")");
    

    or, if you want to update an existing record, use UPDATE:

    query_sql("UPDATE `tree_db` SET `last_water` = " + gettimetick(2) + " WHERE `acc_id` = " + getcharid(3));
    
    • Upvote 1
  10. The problem with your if statement is the missing dot. You are saving the selected value from the SQL query to .@tree_planted but then you use @tree_planted.

    Furthermore, you should always use lower case commands (e.g. if instead of If and else instead of Else), unless the command requires any special case. It should work with upper case, but it is not very pretty.

    • Upvote 2
  11. It seems your rAthena folder has some wrong/missing subversion information. As the message states, the file is not a working copy (thus, it is not in your version control).

    You could try a fresh checkout and move your custom/modified stuff to the new folder and see if further updates work.

×
×
  • Create New...