Jump to content
  • 0

Event duel 1x1


Scofield

Question


  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.03
  • Content Count:  265
  • Reputation:   11
  • Joined:  01/11/13
  • Last Seen:  

 

I have this 1x1 duel script, I wanted to leave it 7x7

	// ==============================================================================
// BattleGround System - KvM 1~59
// ==============================================================================
	// Registration NPC's
// *********************************************************************
	prontera,138,223,5    script    Time Guillaume::KvM04R_Guillaume    418,{ // KvM Guillaume
    mes "[^0000FFGuillaume^000000]";
    mes "^0000FFEntre no Chat^000000 para duelar contra outro jogador.";
    close;
	OnInit:
    waitingroom "Duelo! [1x1]",1,"KvM04_BG::OnGuillaumeJoin",1;
    end;
    
OnEnterBG:
    set $@KvM04BG_id1, waitingroom2bg("bat_c01",53,128,0,"KvM04_BG::OnGuillaumeQuit","KvM04_BG::OnGuillaumeDie");
    end;
}
	prontera,140,225,5    script    Time Croix::KvM04R_Croix    414,{ // KvM Croix
    mes "[^FF0000Croix^000000]";
    mes "^FF0000Entre no Chat^000000 para duelar contra outro jogador.";
    close;
	OnInit:
    waitingroom "Duelo! [1x1]",1,"KvM04_BG::OnCroixJoin",1;
    end;
	OnEnterBG:
    set $@KvM04BG_id2, waitingroom2bg("bat_c01",146,55,1,"KvM04_BG::OnCroixQuit","KvM04_BG::OnCroixDie");
    end;
}
	// Light Effects
// *********************************************************************
	bat_c01,54,123,0    script    #bat_c01a    111,{
    end;
	OnKvM04LightA: misceffect 54; end;
OnKvM04LightB: misceffect 55; end;
OnKvM04LightC: misceffect 56; end;
}
	bat_c01,56,125,0    duplicate(#bat_c01a)    #bat_c01b    111
bat_c01,58,127,0    duplicate(#bat_c01a)    #bat_c01c    111
bat_c01,141,56,0    duplicate(#bat_c01a)    #bat_c01d    111
bat_c01,143,58,0    duplicate(#bat_c01a)    #bat_c01e    111
bat_c01,145,60,0    duplicate(#bat_c01a)    #bat_c01f    111
	// Battleground Engine
// *********************************************************************
	-    script    KvM04_BG    -1,{
    end;
	OnInit:
    setwall "bat_c01",54,122,6,7,0,"batc04wall_a";
    setwall "bat_c01",55,122,5,7,0,"batc04wall_b";
    setwall "bat_c01",140,56,6,7,0,"batc04wall_c";
    setwall "bat_c01",140,57,5,7,0,"batc04wall_d";
    disablenpc "TherapistKvM04a";
    disablenpc "TherapistKvM04b";
    disablenpc "VintenarKvM04a";
    disablenpc "VintenarKvM04b";
    end;
	OnGuillaumeJoin:
OnCroixJoin:
    donpcevent "KvM04_BG::OnReadyCheck";
    end;
	OnGuillaumeQuit:
OnGuillaumeDie:
    if( $@KvM04BG == 2 )
    {
        getmapxy .@m$, .@x, .@y, 0;
        if( .@m$ != "bat_c01" || (.@x >= 50 && .@x <= 58 && .@y >= 123 && .@y <= 131) )
            end; // Killed/Logout on Cementery or outside the map?
	        set .Guillaume_Count, .Guillaume_Count - 1;
        set .Croix_Score, .Croix_Score + 1;
        bg_updatescore "bat_c01",.Guillaume_Score,.Croix_Score;
        if( .Guillaume_Count < 1 ) donpcevent "KvM04_BG::OnCroixWin";
    }
    end;
	OnCroixQuit:
OnCroixDie:
    if( $@KvM04BG == 2 )
    {
        getmapxy .@m$, .@x, .@y, 0;
        if( .@m$ != "bat_c01" || (.@x >= 141 && .@x <= 149 && .@y >= 52 && .@y <= 60) )
            end; // Killed/Logout on Cementery or outside the map?
	        set .Croix_Count, .Croix_Count - 1;
        set .Guillaume_Score, .Guillaume_Score + 1;
        bg_updatescore "bat_c01",.Guillaume_Score,.Croix_Score;
        if( .Croix_Count < 1 ) donpcevent "KvM04_BG::OnGuillaumeWin";
    }
    end;
	OnReadyCheck:
    if( $@KvM04BG )
        end;
	//    if( gettime(3) < 16 || gettime(3) > 22 )
//        end; // 4 to 11 p.m.
	    if( set(.@Guillaume, getwaitingroomstate(6,"KvM04R_Guillaume")) > 0 )
        set $@KvM04_GU$, $@waitingroommembers$[0];
    if( set(.@Croix, getwaitingroomstate(6,"KvM04R_Croix")) > 0 )
        set $@KvM04_CU$, $@waitingroommembers$[0];
	    if( .@Guillaume < 1 || .@Croix < 1 )
    { // Not enough players to start
        set .@Announce$, "Duelo! [1x1] - ";
        if( .@Guillaume )
            set .@Announce$, .@Announce$ + "<" + $@KvM04_GU$ + "> VS <       >";
        else if( .@Croix )
            set .@Announce$, .@Announce$ + "<       > VS <" + $@KvM04_CU$ + ">";
        else
            set .@Announce$, .@Announce$ + "A Arena está liberada.";
	        if( !agitcheck() && $@KvM_Flood < gettimetick(2) )
        {
            announce .@Announce$,0,0xffff00;
            set $@KvM_Flood, gettimetick(2) + 15;
        }
        else
            mapannounce .@Announce$,1,0xffff00;
        end;
    }
	    set $@KvM04BG, 1; // Starting
    donpcevent "KvM04R_Croix::OnEnterBG";
    donpcevent "KvM04R_Guillaume::OnEnterBG";
    donpcevent "KvM04_BG::OnStart";
    end;
	OnStart:
    announce "Duelo! [1x1]  <" + $@KvM04_GU$ + "> VS <" + $@KvM04_CU$ + "> começou!",0,0xffff00;
    enablenpc "TherapistKvM04a";
    enablenpc "TherapistKvM04b";
    disablenpc "VintenarKvM04a";
    disablenpc "VintenarKvM04b";
    set $@KvM04BG_Victory, 0;
    sleep 2000;
    // Warp Teams
    bg_warp $@KvM04BG_id1,"bat_c01",53,128;
    bg_warp $@KvM04BG_id2,"bat_c01",146,55;
    // ScoreBoard
    set .Guillaume_Score, 0;
    set .Croix_Score, 0;
    initnpctimer;
    end;
	OnTimer5000:
    areapercentheal "bat_c01",50,123,58,131,100,100;
    areapercentheal "bat_c01",141,52,149,60,100,100;
    mapannounce "bat_c01","Duelo! [1x1] - A Batalha começará em 25 segundos!",1,0xffff00;
    end;
	OnTimer26000:
    mapannounce "bat_c01","Duelo! [1x1] - A Batalha começará em 4 segundos!",1,0xffff00;
    end;
	OnTimer27000:
    donpcevent "::OnKvM04LightA";
    end;
	OnTimer28000:
    donpcevent "::OnKvM04LightB";
    end;
    
OnTimer29000:
    donpcevent "::OnKvM04LightC";
    end;
	OnTimer30000:
    // Team Members
    set .Guillaume_Count, bg_get_data($@KvM04BG_id1, 0);
    set .Croix_Count, bg_get_data($@KvM04BG_id2, 0);
    if( .Guillaume_Count < 1 || .Croix_Count < 1 )
    {
        set $@KvM04BG_Victory, 3;
        set $@KvM04BG, 3;
        
        set .@Announce$, "Duelo! [1x1] - ";
        if( .Guillaume_Count < 1 && .Croix_Count < 1 )
            set .@Announce$, "<" + $@KvM04_GU$ + "> VS <" + $@KvM04_CU$ + "> cancelado.";
        else if( .Guillaume_Count < 1 )
            set .@Announce$, "<" + $@KvM04_CU$ + "> está com medo de <" + $@KvM04_GU$ + ">...";
        else if( .Croix_Count < 1 )
            set .@Announce$, "<" + $@KvM04_GU$ + "> está com medo de <" + $@KvM04_CU$ + ">...";
	        announce .@Announce$,0,0xffff00;
        stopnpctimer;
        sleep 2000;
        donpcevent "KvM04_BG::OnStop";
        end;
    }
	    set $@KvM04BG, 2; // Playing
    areapercentheal "bat_c01",50,123,58,131,100,100;
    bg_warp $@KvM04BG_id1,"bat_c01",62,119;
    areapercentheal "bat_c01",141,52,149,60,100,100;
    bg_warp $@KvM04BG_id2,"bat_c01",137,64;
    end;
	OnTimer32000:
    mapannounce "bat_c01","Duelo! [1x1] começou!!",1,0xffff00;
    end;
	OnTimer300000:
    mapannounce "bat_c01","Duelo! [1x1] - A Batalha acabará em 30 segundos.",1,0xffff00;
    end;
	OnTimer330000:
    if( .Croix_Count > .Guillaume_Count )
        donpcevent "KvM04_BG::OnCroixWin";
    else if( .Croix_Count < .Guillaume_Count )
        donpcevent "KvM04_BG::OnGuillaumeWin";
    else
    { // Draw Game
        set $@KvM04BG, 3;
        set $@KvM04BG_Victory, 3;
	        stopnpctimer;
        sleep 2000;
        announce "Duelo! [1x1] - <" + $@KvM04_GU$ + "> VS <" + $@KvM04_CU$ + "> terminou em EMPATE.",0,0xffff00;
        donpcevent "KvM04_BG::OnStop";
    }
    end;
	OnGuillaumeWin:
    set $@KvM04BG, 3;
    set $@KvM04BG_Victory, 1;
    
    stopnpctimer;
    sleep 2000;
    announce "Duelo! [1x1] - <" + $@KvM04_GU$ + "> foi o VENCEDOR! <" + $@KvM04_CU$ + "> perdeu.",0,0xffff00;
    donpcevent "KvM04_BG::OnStop";
    end;
	OnCroixWin:
    set $@KvM04BG, 3;
    set $@KvM04BG_Victory, 2;
	    stopnpctimer;
    sleep 2000;
    announce "Duelo! [1x1] - <" + $@KvM04_CU$ + "> foi o VENCEDOR! <" + $@KvM04_GU$ + "> perdeu.",0,0xffff00;
    donpcevent "KvM04_BG::OnStop";
    end;
	OnStop:
    disablenpc "TherapistKvM04a";
    disablenpc "TherapistKvM04b";
    enablenpc "VintenarKvM04a";
    enablenpc "VintenarKvM04b";
    // Warp Teams
    bg_warp $@KvM04BG_id1,"bat_c01",53,128;
    bg_warp $@KvM04BG_id2,"bat_c01",146,55;
    donpcevent "KvM04_BG_Out::OnBegin";
    end;
	OnReset:
    stopnpctimer;
    stopnpctimer "KvM04_BG_Out";
    set .Croix_Count, 0;
    set .Guillaume_Count, 0;
    set .Croix_Score, 0;
    set .Guillaume_Score, 0;
    set $@KvM04_GU$, "";
    set $@KvM04_CU$, "";
    set $@KvM04BG_Victory, 0;
    if( $@KvM04BG_id1 ) { bg_destroy $@KvM04BG_id1; set $@KvM04BG_id1, 0; }
    if( $@KvM04BG_id2 ) { bg_destroy $@KvM04BG_id2; set $@KvM04BG_id2, 0; }
    disablenpc "TherapistKvM04a";
    disablenpc "TherapistKvM04b";
    disablenpc "VintenarKvM04a";
    disablenpc "VintenarKvM04b";
    sleep 1000;
    mapwarp "bat_c01","prontera",155,181;
    sleep 2000;
    maprespawnguildid "bat_c01",0,3; // Just in case someone else
    bg_updatescore "bat_c01",0,0;
    sleep 2000;
    set $@KvM04BG, 0;
    donpcevent "KvM04_BG::OnReadyCheck"; // Maybe a game is ready to start
    end;
}
	-    script    KvM04_BG_Out    -1,{
    end;
	OnBegin:
    initnpctimer;
    end;
	OnTimer3000:
    mapannounce "bat_c01","Duelo! [1x1] fechará em 2 minutos!",1,0xffff00;
    end;
OnTimer90000:
    mapannounce "bat_c01","Duelo! [1x1] fechará em 30 segundos!",1,0xffff00;
    end;
OnTimer110000:
    mapannounce "bat_c01","Duelo! [1x1] fechará em 10 segundos!",1,0xffff00;
    end;
OnTimer120000:
OnClock1600:
    donpcevent "KvM04_BG::OnReset";
    end;
}
	// Battleground Therapist
// *********************************************************************
	bat_c01,51,130,5    script    Treinador::TherapistKvM04a    95,{
    mes "[Treinador]";
    mes "Apenas respire fundo e lute. Você conseguirá vencer!";
    specialeffect2 312;
    close;
}
	bat_c01,148,53,1    script    Treinador::TherapistKvM04b    95,{
    mes "[Treinador]";
    mes "Apenas respire fundo e lute. Você conseguirá vencer!";
    specialeffect2 312;
    close;
}
	// Battleground rewards
// *********************************************************************
	bat_c01,51,130,5    script    Guillaume Vintenar::VintenarKvM04a    419,{
    if( $@KvM04BG_Victory )
    {
        if( $@KvM04BG_Victory == 3 )
        {
            bg_leave;
            warp "prontera",134,120;
            end;
        }
        else if( $@KvM04BG_Victory == Bat_Team )
        { // Victory
            bg_leave;
            warp "prontera",155,181;
            end;
        }
        else
        { // 
            bg_leave;
            warp "prontera",155,181;
            end;
        }
	        bg_leave;
        warp "prontera",155,181;
        end;
    }
    end;
}
	bat_c01,148,53,1    script    Croix Vintenar::VintenarKvM04b    415,{
    if( $@KvM04BG_Victory )
    {
        if( $@KvM04BG_Victory == 3 )
        {
            bg_leave;
            warp "prontera",155,181;
            end;
        }
        else if( $@KvM04BG_Victory == Bat_Team )
        { // Victory
            bg_leave;
            warp "prontera",155,181;
            end;
        }
        else
        { // 
            bg_leave;
            warp "prontera",155,181;
            end;
        }
	        bg_leave;
        warp "prontera",155,181;
        end;
    }
    end;
}
	// MapFlags
// *********************************************************************
bat_c01    mapflag    battleground    2
bat_c01    mapflag    nomemo
bat_c01    mapflag    nosave    SavePoint
bat_c01    mapflag    noteleport
bat_c01    mapflag    nowarp
bat_c01    mapflag    nowarpto
bat_c01    mapflag    noreturn
bat_c01    mapflag    nobranch
bat_c01    mapflag    nopenalty

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

if( .@Guillaume < 1 || .@Croix < 1 )

try change to

if( .@Guillaume < 7 || .@Croix < 7 )

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.03
  • Content Count:  265
  • Reputation:   11
  • Joined:  01/11/13
  • Last Seen:  

Trx.

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