Jump to content
  • 0

A script I used on a very old eAthena server of mine


Yukaiii

Question


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  110
  • Reputation:   9
  • Joined:  11/20/13
  • Last Seen:  

Quote

//===================================================
//=  __  __                  __                     =
//= /\ \/\ \                /\ \      __            =
//= \ \ `\\ \    ___     ___\ \ \____/\_\     __    =
//=  \ \ , ` \  / __`\  / __`\ \ '__`\/\ \  /'__`\  =
//=   \ \ \`\ \/\ \_\ \/\ \_\ \ \ \_\ \ \ \/\  __/  =
//=    \ \_\ \_\ \____/\ \____/\ \_,__/\ \_\ \____\ =
//=     \/_/\/_/\/___/  \/___/  \/___/  \/_/\/____/ =
//===================================================
//= Instance PvP                                    =
//= Created by Noobie                                =
//= Created for FlurryRO                            =
//= Language: English                                =
//= Map: 1@pvp                                        =
//= for eAthena                                        =
//= Revision 14006 or above                            =
//===================================================
//= Credits                                            =
//= Masao for his Support on the script                =
//= Davven for creating the used Map                =
//===================================================
//= Version 1.0                                        =
//===================================================
//= Changelog                                        =
//===================================================
//= 0.9                                                =
//= First Version                                    =
//= 1.0                                                =
//= Release~                                        =
//===================================================
// = Settings - Modify them as you feel you should    =
// ==================================================
-    script    PD_Settings    -1,{
OnInit:
    set $PD_Timelimit,600;    // Seconds for entering
    set $PD_Minparty,2;        // # of players a party must have
    //set $PD_ItemID,969;    // ItemID //Not working yet
    end;
}

brasilis,200,258,5    script    Duel PVP    406,{

    set .@name$,"^0000FFPvP Warper^000000";

    getpartymember(getcharid(1)); 
    if(!getcharid(1) || $@partymembercount < $PD_Minparty){
            mes .@name$;
            mes "Make or join the party with exactly "+$PD_Minparty+" member or try again.";
        set PD_makeparty,1;
        close;
    }
    if(PD_makeparty){
        mes .@name$;
        mes "Confirmed. You are in a party. What would you like to do?";
        set PD_makeparty,0;
        next;
    }
    mes .@name$;
    mes "If you have generated the PvP Duel already, you can enter it.";
    next;
    if(getpartyleader(getcharid(1),2) == getcharid(0)){
        select("Generate PvP Duel Instance:Enter the PvP Duel Instance:Return to Brasilis:Cancel");
    } else {
        select(":Enter the PvP Duel Instance:Return to Brasilis:Cancel");
    }
    switch(@menu){
    case 1:
        if(instance_id(1)){
            if(has_instance("1@pvp") == ""){
                mes .@name$;
                mes "Your group is already registered at an other instance."; 
                close;
            }
            mes .@name$;
            mes "Your group is already registered."; 
            mes "Select ^0000FFEnter the Duel^000000 in the main menu to enter."; 
            close;
        }
        mes .@name$;
        mes "^0000FFPvP Duel Instance^000000 - Try to reserve";
        mes "After making a reservation, you have to talk to NPC behind and";
        mes "select the menu 'Enter the Duel' to enter the PvP Duel";
        close2;
        set .@instance_id,instance_create("PvP_Duel",getcharid(1));
        if(.@instance_id < 0){
            mes .@name$;
            mes "Failed to create PvP Duel Intsance."; 
            mes "^FF0000PvP Duel Instances reached its limit.^000000"; 
            mes "Please report this error to an administrator or GM."; 
            close;
        }
        instance_attachmap("1@pvp",.@instance_id);
        instance_set_timeout $PD_Timelimit,600,.@instance_id;
        instance_init .@instance_id;
        instance_attach instance_id(1);
        end;
    case 2:
        if(!instance_id(1) || has_instance("1@pvp") == ""){
            mes .@name$;
            mes "The PvP Duel Instance does not exist.";
            mes "Please confirm with your party leader wether the memorial dungeon";
            mes "has been destructed or if the time given for entering has been expired.";
            close;
        }
        instance_attach instance_id(1);
        set PD_Lastinstid,instance_id(1);
        set PD_map,1;
        set @id,getcharid(1);
        donpcevent instance_npcname("PD_Manager")+"::OnInstanceInit";
        warpparty "1@pvp",51,46,@id;
        //warp has_instance("1@pvp"),0,0;
        close;
    case 3:
        warp "brasilis",195,259;
        close;
    case 4:
        close;
    }
}

1@pvp,0,0,0    script    PD_Manager    -1,{
    end;

OnInstanceInit:
    if(strnpcinfo(3) == "PD_Manager")
        end;
    sleep 3000;
    instance_announce .@instance_id,"Get Ready...",0x00FF00;
    sleep 3000;
    instance_announce .@instance_id,"4",0x00FF00;
    sleep 3000;
    instance_announce .@instance_id,"3",0x00FF00;
    sleep 3000;
    instance_announce .@instance_id,"2",0x00FF00;
    sleep 3000;
    instance_announce .@instance_id,"1",0x00FF00;
    sleep 3000;
    instance_announce .@instance_id,"GO!",0x00FF00;
    atcommand "@pvpon";
    end;

OnPCKillEvent:
    if(PD_map==1){
    //getitem $PD_ItemID,1; //Not working yet
    pvpoff "1@pvp";
    sleep2 1000;
    instance_attach instance_id(1);
    instance_warpall "brasilis",195,259;
    instance_destroy instance_id(1);
    set PD_map,0;
    end;
    }
    end;
OnPCLogoutEvent:
    if(PD_map==1){
    pvpoff "1@pvp";
    instance_attach instance_id(1);
    instance_warpall "brasilis",195,259;
    instance_destroy instance_id(1);
    set PD_map,0;
    end;
}
    end;

OnPCDieEvent:
    if(PD_map==1){
    pvpoff "1@pvp";
    sleep2 1000;
    instance_attach instance_id(1);
    instance_warpall "brasilis",195,259;
    instance_destroy instance_id(1);
    set PD_map,0;
    end;
}
    end;
    
OnPCLoginEvent:
    set PD_map,0;
    end;
}

1@pvp    mapflag    pvp_noparty
1@pvp    mapflag    pvp_noguild
1@pvp    mapflag    partylock
1@pvp    mapflag    nowarp
1@pvp    mapflag    nowarpto

In case anyone wants to make it work on ratena..
Just don't take credit from the creator.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  898
  • Reputation:   119
  • Joined:  05/23/12
  • Last Seen:  

Here u can find all rAthena Script Commands. Loop throw ur script and check it if every script command is correct. https://github.com/rathena/rathena/blob/master/doc/script_commands.txt

 

instance_attach doesnt exists anymore. By creating instance or enter instance. It will automatically attached.

 

Rynbef~

Edited by Rynbef
Complement
  • Like 1
Link to comment
Share on other sites

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.

×
×
  • Create New...