Jump to content
  • 0

Party VS Party


blakbord

Question


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   1
  • Joined:  02/10/12
  • Last Seen:  

map,x,x,x    script    Party Vs Party    56,{

function isreq;
    callsub L_check;
    select( "Register ?" );

    if( !getcharid(1) ) {
        mes "you're not in a party";
        close;
    }

    else if( .party1 == getcharid(1) || .party2 == getcharid(1) ) {
        mes "you're already on my list";
        close;
    }

    getpartymember getcharid(1);
    if( $@partymembercount != 3 || !instance_check_party( getcharid(1),3 ) ) {
        mes "you need 3 players online in your party";
       close;
    }

    callsub L_check;
    if( !.party2 )
        .party2 = getcharid(1);
    else
        .party1 = getcharid(1);
    dispbottom "your party is now on my list";
    if( !.party1 || !.party2 ) end;

    .start = 1;
    warpparty .map_event$, x,x, .party1;
    warpparty .map_event$, x,x, .party2;
    initnpctimer;
    end;

OnPCKillEvent:
    .@self = getcharid(3);
    .@killed = killedrid;
    .@is_reg = isreq();
    attachrid( .@killed );
    if( !isreq() ) end;

    getpartymember getcharid(1),1;
    getpartymember getcharid(1),2;
    for( .@i = 0; .@i < $@partymembercount; .@i++ ) {
        if( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
            attachrid( $@partymemberaid[.@i] );
            sleep2 1;
            if( strcharinfo(3) == .map_event$ ) {
                .@is_online += 1;
                if( Hp < 1 )
                    .@count += 1;
            }
        }
    }
    if( .@is_online != .@count ) {
        attachrid( .@killed );
        sleep2( .wait * 1000 );
        atcommand "@alive";
        end;
    }
    else if( !.@is_reg ) end;
    attachrid( .@self );
    sleep2 2;
    announce "team "+ getpartyname( getcharid(1) ) +" win the event !", 0;
    getpartymember getcharid(1);
    getpartymember getcharid(1),1;
    getpartymember getcharid(1),2;
    for( .@i = 0; .@i < $@partymembercount; .@i++ )
        if( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
            getmapxy .@map$, .@x, .@y, 0, $@partymembername$[.@i];
            if( .@map$ == .map_event$ )
                getitem .item_id, .item_count, $@partymemberaid[.@i];
        }
    stopnpctimer;
    sleep 3000;

OnTimer300000:    // 5 min then end of event
    .start = .party1 = .party2 = 0;
    mapwarp .map_event$,"map",x,x;
    end;

L_check:
    if( .start ) end;
    else if( getpartyname( .party1 ) == "null" )
        .party1 = 0;
    else if( getpartyname( .party2 ) == "null" )
        .party2 = 0;
    else if( getpartyname( .party1 ) != "null" ) {
        getpartymember .party1;
        if( $@partymembercount != .count_req || !instance_check_party( .party1,.count_req ) )
            .party1 = 0;
    }
    else if( getpartyname( .party2 ) != "null" ) {
        getpartymember .party2;
        if( $@partymembercount != .count_req || !instance_check_party( .party2,.count_req ) )
            .party2 = 0;
    }
    return;

function isreq {
    if( strcharinfo(3) == .map_event$ && .start && ( getcharid(1) == .party1 || getcharid(1) == .party2 ) ) return 1;
    return 0;
}

OnInit:
    .map_event$ = "map";    // your event map
    .count_req = 1;    // count required in the party to start the event
    .wait = 20;        // time in secs to be rezu
    .item_id = 7539;    // item id gained
    .item_count = 5;    // item count gained


    setmapflag .map_event$,mf_noteleport;
    setmapflag .map_event$,mf_nowarp;
    setmapflag .map_event$,mf_nowarpto;
    setmapflag .map_event$,mf_nomemo;
    setmapflagnosave .map_event$,"prontera",0,0;
    setmapflag .map_event$,mf_partylock;
    setmapflag .map_event$,mf_pvp;
    end;
}

How to add this?

• When the player DIED, it will automatically warp out of the MAP

• When 1 PLAYER LOGOUT the party will automatically be the LOSER

• Add another NPC which can give the SET PRIZE

• When the event is OVER each party will be recall to the NPC EVENT PRIZE GIVER

• Each member of the party that didn't won can have only 1 PRIZE

 

is this POSSIBLE? XD

thanks in advance..

 

NOTE: this script is not mine.. I forgot the LINK.. sorry for this..

Edited by blakbord
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  182
  • Reputation:   22
  • Joined:  12/30/12
  • Last Seen:  

map,x,x,x    script    Party Vs Party    56,{

function isreq;
    callsub L_check;
    select( "Register ?" );

    if( !getcharid(1) ) {
        mes "you're not in a party";
        close;
    }

    else if( .party1 == getcharid(1) || .party2 == getcharid(1) ) {
        mes "you're already on my list";
        close;
    }

    getpartymember getcharid(1);
    if( $@partymembercount != 3 || !instance_check_party( getcharid(1),3 ) ) {
        mes "you need 3 players online in your party";
       close;
    }

    callsub L_check;
    if( !.party2 )
        .party2 = getcharid(1);
    else
        .party1 = getcharid(1);
    dispbottom "your party is now on my list";
    if( !.party1 || !.party2 ) end;

    .start = 1;
    warpparty .map_event$, x,x, .party1;
    warpparty .map_event$, x,x, .party2;
    initnpctimer;
    end;

OnPCKillEvent:
    .@self = getcharid(3);
    .@killed = killedrid;
    .@is_reg = isreq();
    attachrid( .@killed );
    if( !isreq() ) end;

    getpartymember getcharid(1),1;
    getpartymember getcharid(1),2;
    for( .@i = 0; .@i < $@partymembercount; .@i++ ) {
        if( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
            attachrid( $@partymemberaid[.@i] );
            sleep2 1;
            if( strcharinfo(3) == .map_event$ ) {
                .@is_online += 1;
                if( Hp < 1 )
                    .@count += 1;
            }
        }
    }
    if( .@is_online != .@count ) {
        attachrid( .@killed );
        sleep2( .wait * 1000 );
        atcommand "@alive";
        end;
    }
    else if( !.@is_reg ) end;
    attachrid( .@self );
    sleep2 2;
    announce "team "+ getpartyname( getcharid(1) ) +" win the event !", 0;
    getpartymember getcharid(1);
    getpartymember getcharid(1),1;
    getpartymember getcharid(1),2;
    for( .@i = 0; .@i < $@partymembercount; .@i++ )
        if( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
            getmapxy .@map$, .@x, .@y, 0, $@partymembername$[.@i];
            if( .@map$ == .map_event$ )
                getitem .item_id, .item_count, $@partymemberaid[.@i];
        }
    stopnpctimer;
    sleep 3000;

OnTimer300000:    // 5 min then end of event
    .start = .party1 = .party2 = 0;
    mapwarp .map_event$,"map",x,x;
    end;

L_check:
    if( .start ) end;
    else if( getpartyname( .party1 ) == "null" )
        .party1 = 0;
    else if( getpartyname( .party2 ) == "null" )
        .party2 = 0;
    else if( getpartyname( .party1 ) != "null" ) {
        getpartymember .party1;
        if( $@partymembercount != .count_req || !instance_check_party( .party1,.count_req ) )
            .party1 = 0;
    }
    else if( getpartyname( .party2 ) != "null" ) {
        getpartymember .party2;
        if( $@partymembercount != .count_req || !instance_check_party( .party2,.count_req ) )
            .party2 = 0;
    }
    return;

function isreq {
    if( strcharinfo(3) == .map_event$ && .start && ( getcharid(1) == .party1 || getcharid(1) == .party2 ) ) return 1;
    return 0;
}

OnInit:
    .map_event$ = "map";    // your event map
    .count_req = 1;    // count required in the party to start the event
    .wait = 20;        // time in secs to be rezu
    .item_id = 7539;    // item id gained
    .item_count = 5;    // item count gained


    setmapflag .map_event$,mf_noteleport;
    setmapflag .map_event$,mf_nowarp;
    setmapflag .map_event$,mf_nowarpto;
    setmapflag .map_event$,mf_nomemo;
    setmapflagnosave .map_event$,"prontera",0,0;
    setmapflag .map_event$,mf_partylock;
    setmapflag .map_event$,mf_pvp;
    end;
}

Can anyone Help me?

• How can i make the player when DIED, it will automatically warp out of the MAP?

• And when 1 PLAYER LOGOUT the party will automatically be the LOSER

• Then after the event is OVER each party will be recall to the NPC EVENT PRIZE GIVER

• I want to add another NPC which can give the SET PRIZE

• also the loser can have only 1 PRIZE

 

is this POSSIBLE? XD

thanks in advance..

 

 

1. How can i make the player when DIED, it will automatically warp out of the MAP?

<mapname> mapflag nosave SavePoint

2. And when 1 PLAYER LOGOUT the party will automatically be the LOSER

Use

OnPCLogoutEvent:

to trigger the end of the event, and get the party of the character strcharinfo(1) who logout and have it lose the game.

3. Then after the event is OVER each party will be recall to the NPC EVENT PRIZE GIVER

Use

warpparty "<to_mapname>",<x>,<y>,<party_id>,{"<from_mapname>"};

4. I want to add another NPC which can give the SET PRIZE

Just create another NPC and use a Global permanent variable

set $item_count, <amount>;

You can use that variable on any NPC.

5. also the loser can have only PRIZE

Warp the losing party on another map which gives the losing price.

Edited by Boom
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   1
  • Joined:  02/10/12
  • Last Seen:  

 

2. And when 1 PLAYER LOGOUT the party will automatically be the LOSER

Use

OnPCLogout

to trigger the end of the event, and get the party of the character strcharinfo(1) who logout and have it lose the game.

 

4. I want to add another NPC which can give the SET PRIZE

Just create another NPC and use a Global permanent variable

set $item_count, <amount>;

You can use that variable on any NPC.

5. also the loser can have only PRIZE

Warp the losing party on another map which gives the losing price.

 

 

i didn't get this part.. and im going to search for this to know more with scripting..

can you give me an example flow for this? thx for helping Boom..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  182
  • Reputation:   22
  • Joined:  12/30/12
  • Last Seen:  

OnPCLogoutEvent:

is a label triggered when a player logs out. You must check where this player logs out (the map where your PVP event is) so as not to affect other players logging out on other map.

 

Sample workflow:

OnPCLogoutEvent:
getmapxy .@mapnvz$,.@xnvz,.@ynvz,0;
if ( .@mapnvz$ == "<mapname>") {
<what you need to do>
}

You can use the global permanent variable you set on another NPC:

getitem 671, $item_count;

 

Initialize the variable on the OnInit label on your Party vs Party script:

OnInit:
    .map_event$ = "map";    // your event map
...
...
set $item_count, <amount>;
Edited by Boom
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   1
  • Joined:  02/10/12
  • Last Seen:  

@boom man my head is aching with this script.. sorry.. but can you make it for me? im not good with this..
Thanks in advance..

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...