Jump to content
Sephus

Hercules Battlegrounds

Recommended Posts

Team Deathmatch doesn't give prize when the game is done. and the warp is not hidden

 

 Script 

Quote

// Battleground Respawn
// *********************************************************************

bat_b02,390,10,0    script    #guitd_respawn    HIDDEN_WARP_NPC,{
    end;

OnBGStart:
    initnpctimer;
    end;

OnBGStop:
    stopnpctimer;
    end;

OnTimer24000:
    specialeffect(EF_SANCTUARY);
    specialeffect(EF_BLESSING);
    specialeffect(EF_INCAGILITY);
    end;

OnTimer25000:
    areapercentheal "bat_b02",382,2,397,17,100,100;
    areawarp "bat_b02",382,2,397,17,"bat_b02",306,138,327,161;
    initnpctimer;
    end;
}

bat_b02,10,290,0    script    #crotd_respawn    HIDDEN_WARP_NPC,{
    end;

OnBGStart:
    initnpctimer;
    end;

OnBGStop:
    stopnpctimer;
    end;

OnTimer24000:
    specialeffect(EF_SANCTUARY);
    specialeffect(EF_BLESSING);
    specialeffect(EF_INCAGILITY);
    end;

OnTimer25000:
    areapercentheal "bat_b02",2,282,17,297,100,100;
    areawarp "bat_b02",2,282,17,297,"bat_b02",72,138,93,161;
    initnpctimer;
    end;
}
 

1.png

Edited by apexro

Share this post


Link to post
Share on other sites

you may check if you have this item in your item db

{
    Id: 7829
    AegisName: "BF_Badge2"
    Name: "Valor Badge"
    Type: 3
    Trade: {
        nodrop: true
        notrade: true
        nocart: true
        nogstorage: true
        nomail: true
        noauction: true
    }
},

Share this post


Link to post
Share on other sites
2 hours ago, astralprojection said:

you may check if you have this item in your item db

{
    Id: 7829
    AegisName: "BF_Badge2"
    Name: "Valor Badge"
    Type: 3
    Trade: {
        nodrop: true
        notrade: true
        nocart: true
        nogstorage: true
        nomail: true
        noauction: true
    }
},

Yes i have it on my DB still dont give prize

Share this post


Link to post
Share on other sites

Probably smoke is busy with new project BladeCP. I imagine he will come back to this after he is done or this project is dropped support.

Share this post


Link to post
Share on other sites
11 hours ago, caspe said:

@Smoke

any solution for this

29p2b7p.jpg

 

10 hours ago, Myriad said:

Probably smoke is busy with new project BladeCP. I imagine he will come back to this after he is done or this project is dropped support.

when i had that issue, player got freeze without warning on screen and eventually will crash.

@Smoke i loved to avail that BladeCP also.  Please take time sir on HBG. 

 

Share this post


Link to post
Share on other sites
On ‎26‎-‎09‎-‎2017 at 8:10 PM, caspe said:

@Smoke

any solution for this

29p2b7p.jpg

 

On ‎26‎-‎09‎-‎2017 at 9:09 PM, Myriad said:

Probably smoke is busy with new project BladeCP. I imagine he will come back to this after he is done or this project is dropped support.

I am busy with real life... part of the reason I made the plugin open-source was that I saw potential for it to have more contributors. As far as the errors for the plugin go, I'll leave it to someone to be generous and fill in the gaps until I find the time.

BladeCP is a side-project of mine (since a year) that I find more interesting, so yes I'm caught between the two and prefer to work on this one when I feel like doing anything RO-related. Sorry :/

Share this post


Link to post
Share on other sites

@Smoke

i have pushed pull request regarding this error

29p2b7p.jpg

setquest causing this error, i think it is related to emulator or setquest need to be updated.

Edited by caspe

Share this post


Link to post
Share on other sites
1 hour ago, caspe said:

Also when player logout with Stone or flag they does not drop it, it is also related to setquest.

I don't think this is related to hBG, rather, some script commands have bad compatibility with characters logging out.

Share this post


Link to post
Share on other sites

I got map-crash two times:
 

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000000000064a170 in hplugin_data_store_validate (type=HPDT_MSD,
    storeptr=0x7ffd28d2e148, initialize=<optimized out>) at HPM.c:239
239     }
(gdb) bt full
#0  0x000000000064a170 in hplugin_data_store_validate (type=HPDT_MSD,
    storeptr=0x7ffd28d2e148, initialize=<optimized out>) at HPM.c:239
No locals.
#1  0x00000000006484ee in hplugins_getFromHPData (type=HPDT_MSD, pluginID=2,
    store=0xfdfdfdfdfdfdfdfd, classid=1) at HPM.c:300
        i = <optimized out>
#2  0x00007fc6a29b2e36 in hBG_send_xy_timer_sub (key=...,
    data=<optimized out>, ap=<optimized out>) at hBG.c:1871
        sd = 0xb49cc00
        hBGsd = 0x0
        bgd = 0x3637edc
        hBGd = 0x93710f4
        output = "\006\000\a\006\006\006\006\006\066\026e\000\000\000\000\000;\3                                                                                                                                                             47\004\000\000\000\000\000\001Z\223\027\000\000\000\000\020\342\322(\375\177\000                                                                                                                                                             \000\061\357c\000\000\000\000\000\000\342\322(\375\177\000\000\251\325e\000\000\                                                                                                                                                             000\000\000\020\342\322(\375\177\000\000\371\321d\000\000\000\000\000`\342\322(\                                                                                                                                                             375\177\000\000\206\032R\000\000\000\000\000;\347\004\000\000\000\000\000\017\00                                                                                                                                                             0\000\000\a\000\000\000`\342\322(\375\177\000\000l?\246\t\000\000\000"
        i = <optimized out>
        m = 894
        idle_announce = 60
        idle_autokick = 120
        __func__ = "hBG_send_xy_timer_sub"
---Type <return> to continue, or q <return> to quit---return
#3  0x00000000006446e1 in db_obj_vforeach (self=0x40d9f08,
    func=0x7fc6a29b2d20 <hBG_send_xy_timer_sub>, args=0x7ffd28d2e2f8)
    at db.c:2070
        argscopy = {{gp_offset = 16, fp_offset = 48,
            overflow_arg_area = 0x7ffd28d2e3d0,
            reg_save_area = 0x7ffd28d2e310}}
        db = 0x40d9f08
        i = <optimized out>
        sum = 0
        node = 0xc0e8c18
        parent = <optimized out>
#4  0x000000000064372c in db_obj_foreach (self=<optimized out>,
    func=<optimized out>) at db.c:2117
        args = {{gp_offset = 16, fp_offset = 48,
            overflow_arg_area = 0x7ffd28d2e3d0,
            reg_save_area = 0x7ffd28d2e310}}
#5  0x00007fc6a29a9374 in hBG_send_xy_timer (tid=<optimized out>,
    tick=<optimized out>, id=<optimized out>, data=<optimized out>)
    at hBG.c:1913
No locals.
#6  0x0000000000652149 in do_timer (tick=<optimized out>) at timer.c:485
        tid = 6
        diff = 0
---Type <return> to continue, or q <return> to quit---return
        __func__ = "do_timer"
#7  0x000000000043a093 in main (argc=1, argv=0x7ffd28d2e548) at core.c:559
        next = <optimized out>
        retval = 0

 

Share this post


Link to post
Share on other sites

How to fix the npc, couse it doesn't working when i try to enter in a queue, only works with command @joinbg... If npc from someone is working well, tell me where's the error please.Thanks

Quote

/**
 * Hercules Script
 *
 * Feature: Hercules Battlegrounds
 * Version: 1.0
 * Author: Smokexyz
 *
 * Description: Hercules Battlegrounds plugin.
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

/**
 * Map Flags
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

bat_room    mapflag    nomemo
bat_room    mapflag    nowarpto
bat_room    mapflag    nobranch
bat_room    mapflag    nopenalty
bat_room    mapflag    noteleport
bat_room    mapflag    nosave    SavePoint
// This mapflag is required to join battleground queues.
bat_room    mapflag    town

function    script    get_arena_id    {
    set .@arena$, getarg(0);

    if (strcmp(.@arena$, "Flavius_CTF") == 0) {
        return 1;
    } else if (strcmp(.@arena$, "Tierra_EOS") == 0) {
        return 2;
    } else if (strcmp(.@arena$, "Tierra_TI") == 0) {
        return 3;
    } else if (strcmp(.@arena$, "Flavius_TD") == 0) {
        return 4;
    } else if (strcmp(.@arena$, "Tierra_Boss") == 0) {
        return 5;
    } else if (strcmp(.@arena$, "Conquest") == 0) {
        return 6;
    } else if (strcmp(.@arena$, "Flavius_SC") == 0) {
        return 7;
    } else if (strcmp(.@arena$, "Tierra_DOM") == 0) {
        return 8;
    } else if (strcmp(.@arena$, "Rush") == 0) {
        return 9;
    }

    return 0;
}
/**
 * Battleground Queue Handler
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-    script    BG_Queue_Handler    FAKE_NPC,{
    end;

OnInit:
    // Arena Configuration
    // All Arena settings are listed below, newer ones can be appended to the arrays.
    // Arenas when listed will be available in the auto-rotation.
    setarray .BG_Arenas$[0],       "Flavius_CTF",    "Tierra_EOS",   "Tierra_TI",     "Flavius_TD", "Tierra_Boss","Conquest",  "Flavius_SC",  "Tierra_DOM",   "Rush";
    // Battleground Arena Name for announcements.
    setarray .BG_Names$[0],      "Capture the Flag","Eye of Storm","Triple Inferno","DeathMatch","Bossnia",  "Conquest",  "Stone Control","Domination",   "Rush";
    // Minimum Players required to start the Battleground.
    setarray .BG_Players_Min[0],        1,               1,               1,              1,            1,           1,             1,             1,            1;
    // Maximum Players per Team
    setarray .BG_Players_Max[0],        35,              35,             35,              35,           35,          50,            35,            35,           30;
    // Battleground announcement colors.
    setarray .BG_Color$[0],         "0x2F9F2D",      "0xAA00FF",      "0xFF0033",     "0x33FF99",   "0x3399FF",  "0xFFA500",    "0x9ACD32",    "0x4169E1",   "0xDDA0DD";
    // Battleground @bgmode interger colors.
    setarray .BG_Color2[0],         0x2F9F2D,      0xAA00FF,      0xFF0033,     0x33FF99,   0x3399FF,  0xFFA500,    0x9ACD32,    0x4169E1,   0xDDA0DD,  0x00FF00;
    // Team Building Mode :
    // 0 = Lineal [Keeps parties together]
    // 1 = Random
    .TeamBuildingMode = 1;

    // Battleground @commands (@joinbg, @leavebg).
    .BGCommandsEnabled = 1; // (1 to enable, 0 to disable)

    // Minimum Level to join the BG queue.
    .BGQueue_Level_Min = 80;

    if (.BGCommandsEnabled) {
        /* Admin / GM Commands */
        bindatcmd "bgstart","BG_Queue_Handler::OnBGStartCommand",99,99;
        bindatcmd "bgstop","BG_Queue_Handler::OnBGStopCommand",99,99;
        bindatcmd "bgmode","BG_Queue_Handler::OnBGModeCommand",99,99;
        bindatcmd "bgsize","BG_Queue_Handler::OnBGSizeCommand",99,99;
        /* Player Commands */
        bindatcmd "joinbg","BG_Queue_Handler::OnDoJoin",0,99;
        bindatcmd "leavebg","BG_Queue_Handler::OnDoLeave",0,99;
    }

    /* * * * * DO NOT TOUCH ANYTHING BELOW THIS LINE * * * * * * * * * * * * * * * */
    .TotalArenas = getarraysize(.BG_Arenas$);
    .BG_Queue = hBG_queue_create("Battleground Arena","BG_Queue_Handler::OnQueueJoinEvent",.BGQueue_Level_Min);
    .FFA_Queue = hBG_queue_create("Free For All Arena","BG_Queue_Handler::OnFFAQueueJoinEvent",.BGQueue_Level_Min);

    // Move to Next Arena
    if ($BG_Index >= .TotalArenas)
        $BG_Index = 0; // Restart Rotation

    .BG_Arena$ = .BG_Arenas$[$BG_Index];
    initnpctimer; // Initiate rotation timer.
    .hBGEnabled$ = "battle_configuration/hBG_enabled";
    end;
    
// @bgmode <1-10>
OnBGModeCommand:
    .@x = atoi(.@atcmd_parameters$[0]);
    if (.@x <= .TotalArenas+1 && .@x > 0) {
        if (.@x == 1)
            set $BG_Index, rand(.TotalArenas)-1;
        else
            set $BG_Index, .@x-3;
        message strcharinfo(0),"["+.BG_Names$[$BG_Index+1]+"] has been set.";
        donpcevent "BG_Queue_Handler::OnRotate";
        end;
    } else {
        message strcharinfo(0), "Usage: @bgmode <1-"+(.TotalArenas+1)+">";
        dispbottom "#1 - Random",0xFFFFFF;
        for (.@i = 0; .@i<.TotalArenas; .@i++)
            dispbottom "#"+(.@i+2)+" - "+.BG_Names$[.@i],.BG_Color2[.@i];            
        end;
    }
        
// @bgsize <1-10> <min> <max>
OnBGSizeCommand:
    .@x = atoi(.@atcmd_parameters$[0]);
    .@x2 = atoi(.@atcmd_parameters$[1]);
    .@x3 = atoi(.@atcmd_parameters$[2]);
    if (.@x2 == 0 || .@x3 == 0) {
        message strcharinfo(0), "Usage: @bgsize <0-"+.TotalArenas+"> <min players> <max players>";
        dispbottom "#0 - All Arenas",0xFFFFFF;
        for (.@i = 0; .@i<.TotalArenas; .@i++)
            dispbottom "#"+(.@i+1)+" - "+.BG_Names$[.@i],.BG_Color2[.@i];            
        end;
    } else if (.@x2 > .@x3) {
        message strcharinfo(0), "@bgsize failed: min players is higher than max players. ";
        end;
    }    
    if (.@x <= .TotalArenas && .@x > 0) {
        message strcharinfo(0),"["+.BG_Names$[.@x-1]+"] min players is <"+.@x2+"> and max players is <"+.@x3+">.";
        setarray .BG_Players_Min[.@x-1],.@x2;
        setarray .BG_Players_Max[.@x-1],.@x3;
    } else {
        message strcharinfo(0),"[All Arenas] min players is <"+.@x2+"> and max players is <"+.@x3+">.";
        setarray .BG_Players_Min[0],.@x2,.@x2,.@x2,.@x2,.@x2,.@x2,.@x2,.@x2,.@x2;
        setarray .BG_Players_Max[0],.@x3,.@x3,.@x3,.@x3,.@x3,.@x3,.@x3,.@x3,.@x3;
    }
    end;
        
OnBGStartCommand:
    setbattleflag .hBGEnabled$, 1;
    message strcharinfo(0),"A Batalha Campal foi habilitada.";
    donpcevent "BG_Queue_Handler::OnRotate";
    callsub OnEndArena;
OnBGStopCommand:
    setbattleflag .hBGEnabled$, 0;
    message strcharinfo(0),"A Batalha Campal foi desabilitada.";
    .@msg$ = "[Battlegrounds] A Batalha Campal foi desabilitada, aguarde que logo habilitaremos.";
    announce .@msg$, 0, 0x00FFFF, 0x190, 12, 100, 100;
    if ($@Arena_Status != 0)
        donpcevent .BG_Arena$+"::OnMatchEnd";
    callsub OnEndArena;

// @joinbg
OnDoJoin:
    if (getbattleflag(.hBGEnabled$) == 0) {
        message strcharinfo(0),"A Batalha Campal foi desabilitada.";
        end;
    } else if (questprogress(8506,PLAYTIME) == 2) {
        erasequest 8506;
    } else if (questprogress(8506,PLAYTIME) == 1) {
        dispbottom "[Você é um desertor. Você não pode participar até que o tempo de bloqueio acabe.]";
        end;
    }

    hBG_queue_join .BG_Queue;
    end;

// @leavebg
OnDoLeave:
    hBG_queue_leave .BG_Queue;
    if (getmapflag(strcharinfo(3),mf_battleground)) {
        hBG_leave;
        warp "SavePoint", 0, 0;
    }
    end;

// Triggers after an arena has ended.
OnEndArena:
    set $@Arena_Status, 0;
    if ($@BG_Team1 == 0 && $@BG_Team2 == 0 && $@BG_Team3 == 0)
        end;
    // Warps teams back to the battle room.
    bg_warp $@BG_Team1,"bat_room",155,150;
    bg_warp $@BG_Team2,"bat_room",155,150;
    bg_warp $@BG_Team3,"bat_room",155,150;
    // Destroy Teams
    if ($@BG_Team1 != 0) hBG_destroy $@BG_Team1; set $@BG_Team1, 0;
    if ($@BG_Team2 != 0) hBG_destroy $@BG_Team2; set $@BG_Team2, 0;
    if ($@BG_Team3 != 0) hBG_destroy $@BG_Team3; set $@BG_Team3, 0;
    // Fall through
// Start Arena rotation.
OnRotate:
// Rotate every n seconds.
OnTimer30000:
    if (getbattleflag(.hBGEnabled$) == 0) end;
    // Restart from index 0, if reached max.
    $BG_Index = $BG_Index + 1;
    if ($BG_Index >= .TotalArenas)
        $BG_Index = 0;

    .BG_Arena$ = .BG_Arenas$[$BG_Index];
    initnpctimer;
    // Fall through
// Called every time someone joins the Queue.
OnQueueJoinEvent:
    // BG Status Types -
    // 0 - Idle, ready to start.
    // 1 - Running, others can join.
    // 2 - Ending, Battleground is clearing up.
    if ($@Arena_Status == 2)
        end;

    .@Queue_Count = hBG_queue_data(.BG_Queue,0);
    switch($@Arena_Status) {
    case 0: // Idle, ready to start.
        // Set total Arena teams
        if (.BG_Arena$ == "Tierra_TI")
            .@TotalTeams = 3;
        else
            .@TotalTeams = 2;

        // Set total minimum Arena players.
        .@Req = .BG_Players_Min[$BG_Index] * .@TotalTeams;

        // Check if the required number of players have been reached, and process.
        if (.@Queue_Count >= .@Req) {
            donpcevent .BG_Arena$ + "::OnBuildTeams";

            // Fill Teams with Queue Members
            if (.@TotalTeams == 3)
                hBG_queue2teams .BG_Queue,.BG_Players_Min[$BG_Index],.BG_Players_Max[$BG_Index],.TeamBuildingMode,$@BG_Team1,$@BG_Team2,$@BG_Team3;
            else
                hBG_queue2teams .BG_Queue,.BG_Players_Min[$BG_Index],.BG_Players_Max[$BG_Index],.TeamBuildingMode,$@BG_Team1,$@BG_Team2;

            // Stop Arena Rotation.
            stopnpctimer;

            // Set BG Status as Ongoing.
            $@Arena_Status = 1;

            .@msg$ = "[Batalha Campal] " + .BG_Names$[$BG_Index] + " começou...";
            announce .@msg$,0,.BG_Color$[$BG_Index],0x190,12,100,100;

            // Start Battleground Events.
            donpcevent .BG_Arena$ + "::OnReady";
        } else { // Required players have not been reached.
            .@msg$ = "[Batalha Campal] "+.BG_Names$[$BG_Index]+" requer mais "+(.@Req - .@Queue_Count)+" jogador(es) para começar.";
            announce .@msg$,0,.BG_Color$[$BG_Index],0x190,12,100,100;
        }
        break;
    case 1: // Running, others can join.
        if (.@Queue_Count > 0) {
            if (.BG_Arena$ == "Tierra_TI") {
                hBG_balance_teams .BG_Queue,.BG_Players_Max[$BG_Index],.TeamBuildingMode,$@BG_Team1,$@BG_Team2,$@BG_Team3;
                .@BG_Count1 = hBG_get_data($@BG_Team1, 0);
                .@BG_Count2 = hBG_get_data($@BG_Team2, 0);
                .@BG_Count3 = hBG_get_data($@BG_Team3, 0);
                .@msg$ = "[Batalha Campal] " + .BG_Names$[$BG_Index] + " está ativa. Blue Team: " + .@BG_Count1 + "/" + .BG_Players_Max[$BG_Index] + ", Red Team: " + .@BG_Count2 + "/" + .BG_Players_Max[$BG_Index] + ", Green Team: " + .@BG_Count3 + "/" + .BG_Players_Max[$BG_Index] + ".";
            } else {
                hBG_balance_teams .BG_Queue,.BG_Players_Max[$BG_Index],.TeamBuildingMode,$@BG_Team1,$@BG_Team2;
                .@BG_Count1 = hBG_get_data($@BG_Team1, 0);
                .@BG_Count2 = hBG_get_data($@BG_Team2, 0);
                .@msg$ = "[Batalha Campal] " + .BG_Names$[$BG_Index] + " está ativa. Blue Team: " + .@BG_Count1 + "/" + .BG_Players_Max[$BG_Index] + ", Red Team: " + .@BG_Count2 + "/" + .BG_Players_Max[$BG_Index] + ".";
            }
            announce .@msg$, 0, .BG_Color$[$BG_Index], 0x190, 12, 100, 100;
        }
    default:
        break;
    }
    end;

OnFFAQueueJoinEvent:
    if ($@FFA_Arena_Status != 0)
        end;

    .@Queue_Count = hBG_queue_data(.FFA_Queue, 0);

    if (.@Queue_Count >= 10) {
        donpcevent "FFA_Arena::OnBuildTeams";
        hBG_queue2teams .FFA_Queue,1,0,$@FFA_Team[0],$@FFA_Team[1],$@FFA_Team[2],$@FFA_Team[3],$@FFA_Team[4],$@FFA_Team[5],$@FFA_Team[6],$@FFA_Team[7],$@FFA_Team[8],$@FFA_Team[9];
        set $@FFA_Arena_Status,1;
        announce "[Battlegrounds] Free For All is commencing.",0,0x483D8B;
        donpcevent "FFA_Arena::OnReady";
    } else {
        announce "[Battlegrounds] Free For All requires " + (10 - .@Queue_Count) + " more player(s) to start.",0,0x483D8B;
    }
    end;
}
/**
 * Battleground Recruiter
 */
-    script    BG_Register    FAKE_NPC,{
    set .@name$, "[^FFA500Battle Recruiter^000000]";
    if (getvariableofnpc(.Ready,"BG_Queue_Handler") == 0)
        donpcevent "BG_Queue_Handler::OnInit";

    mes .@name$;
    mes "Good day, adventurer.";
    mes "I'm a knight from a far country called Maroll Kingdom.";
    next;
    mes .@name$;
    mes "The two princes of the kingdom are now battling for the throne of Maroll, and are in need of experienced soldiers like you.";
    mes "How would you like to lend your power to one of the princes in the Maroll Kingdom?";
    next;
    switch(select("^FFA500Battleground Arenas^000000:^0000FFFree For All Arena^000000:Warp to Battle Room")) {
    case 1:
        mes .@name$;
        mes "Battleground Arenas are different kinds of games where teams fight for victory.";
        mes "What do you want to do?";
        next;
        switch(select("Register:Party Register:Leave Queue:Battleground Help")) {
        case 1:
            if (BaseLevel < .BGQueue_Level_Min) {
                mes .@name$;
                mes "The minimum required level to join a battleground is "+.BGQueue_Level_Min+".";
                close;
            }
            if (questprogress(8506,PLAYTIME) == 2)
                erasequest 8506;

            if (questprogress(8506,PLAYTIME) == 1) {
                mes .@name$;
                mes "You are a Deserter. You can't participate until the indicator goes off.";
                close;
            }

            mes .@name$;
            mes "Let's proceed with the registration...";
            mes "You must wait in any City until BG starts.";
            mes "Close this window to continue...";
            close2;
            hBG_queue_join getvariableofnpc(.BG_Queue,"BG_Queue_Handler");
            end;
        case 2:
            if (getcharid(1) == 0) {
                mes .@name$;
                mes "You are not in a Party.";
                close;
            }

            mes .@name$;
            mes "Let's proceed with the registration,";
            mes "You must wait in any City until the BG starts.";
            mes "* close this window to continue *";
            close2;
            hBG_queue_partyjoin getcharid(1),getvariableofnpc(.BG_Queue,"BG_Queue_Handler");
            end;
        case 3:
            mes .@name$;
            mes "If you are queued, you will be removed from the Battleground queue.";
            mes "Are you sure you want to proceed?";
            next;
            if (select("Yes, leave the queue.:No, I will stay queued.") == 2) {
                mes .@name$;
                mes "Ok, nothing to change.";
                close;
            }

            mes .@name$;
            mes "* close this window to continue *";
            close2;
            hBG_queue_leave getvariableofnpc(.BG_Queue,"BG_Queue_Handler");
            end;
        case 4:
            mes .@name$;
            mes "So which battleground would you like to learn about?";
            next;
            switch(select("Capture the Flag:Team Death Match:Stone Control:Eye of Storm:Bossnia:Domination:Triple Inferno:Conquest:Rush"))
            {
            case 1:
                mes .@name$;
                mes "The objective of the ^990022Flavius Battle CTF^000000 is to score 3 points before your enemy, by capturing their Flag.";
                next;
                mes .@name$;
                mes "To capture a Flag you need to take the Enemy Flag, and bring it to your base.";
                next;
                mes .@name$;
                mes "If your base flag is captured, you need to kill the Flag carrier and take the flag back to your base.";
                next;
                mes .@name$;
                mes "Also make sure to protect the Flag carrier on your team from your enemies.";
                break;
            case 2:
                mes .@name$;
                mes "Both teams start with 100 points.";
                mes "Killing a player costs the team 1 point.";
                mes "Kill all the enemy players to reduce their points until they have none.";
                mes "Protect our army!";
                break;
            case 3:
                mes .@name$;
                mes "Take the stones in the middle of the battlefield and place them at your base.";
                next;
                mes .@name$;
                mes "Each stone will give points to your team over time. First team to reach 99 points wins the game.";
                next;
                mes .@name$;
                mes "Team Stones can also be captured by the enemy team, so protect them well!";
                break;
            case 4:
                mes .@name$;
                mes "There are two bases, located towards the North and South, which teams can capture by holding their position for longer than their opposition.";
                next;
                mes .@name$;
                mes "Each base will give you points every 5 seconds. If your team controls both bases, the amount of points drastically increases.";
                next;
                mes .@name$;
                mes "To get aditional points, capture a flag that spawns in the middle of the map and put it on any of your team Bases.";
                next;
                mes .@name$;
                mes "The first team to reach 99 points wins the match.";
                break;
            case 5:
                mes .@name$;
                mes "Attack the enemy base and destroy each MVP Guardian. To do damage to the guardian your team must capture the Balance Flag in the middle base.";
                next;
                mes .@name$;
                mes "Each team has 5 guardians in total, to be protected or killed.";
                break;
            case 6:
                mes .@name$;
                mes "There are three bases, North, Center and South which teams can capture by holding their position on them.";
                next;
                mes .@name$;
                mes "Each base will give you points for every 5 seconds of domination.";
                next;
                mes .@name$;
                mes "The first team to reach 99 points wins the match.";
                break;
            case 7:
                mes .@name$;
                mes "There are 3 teams in this Arena, all enemies of each other.";
                next;
                mes .@name$;
                mes "Kill the enemy players, collect their skulls and bring them to the Sacrifice Totem to win points.";
                next;
                mes .@name$;
                mes "You can collect your own team skulls and bring them to your Sacrifice Totem to avoid other teams to score.";
                next;
                mes .@name$;
                mes "If you get killed, all your skulls will be dropped on to the floor, including your own skull. First Team to get 80 points wins the battle.";
                break;
            case 8:
                mes .@name$;
                mes "In the Conquest arena,";
                mes "If you are Attacking, destroy the enemy's defenses and their flag.";
                mes "If you are Defending, protect your castle defenses and your flag.";
                break;
            case 9:
                mes .@name$;
                mes "In the Rush arena,";
                mes "Fight to capture the Castle and organize your team to defend it.";
                mes "If you fail on the first capture, kill the defender and take it for your team.";
                break;
            }
            break;
        }
        close;
    case 2:
        mes .@name$;
        mes "The Free For All arena is a killfest between 10 players. There are no teams.";
        mes "The first player to reach 25 kills wins.";
        mes "What would you like to do?";
        next;
        switch(select("Register for FFA Arena:Leave the Queue:Cancel")) {
        case 1:
            if (BaseLevel < .BGQueue_Level_Min) {
                mes .@name$;
                mes "Minimum required level to join a battleground is "+.BGQueue_Level_Min+".";
                close;
            }
            if (questprogress(8506,PLAYTIME) == 2)
                erasequest 8506;

            if (questprogress(8506,PLAYTIME) == 1) {
                mes .@name$;
                mes "You are a deserter. You can't participate until the indicator goes off.";
                close;
            }

            mes .@name$;
            mes "Let's proceed with the registration...";
            mes "You must wait in any city until BG starts.";
            mes "* close this window to continue *";
            close2;
            hBG_queue_join getvariableofnpc(.FFA_Queue,"BG_Queue_Handler");
            end;
        case 2:
            mes .@name$;
            mes "If you are registered, you will be removed.";
            mes "Are you sure?";
            next;
            if (select("Yes, leave queue:No, I will stay") == 2)
            {
                mes .@name$;
                mes "Ok, nothing to change.";
                close;
            }

            mes .@name$;
            mes "* close this window to continue *";
            close2;
            hBG_queue_leave getvariableofnpc(.FFA_Queue,"BG_Queue_Handler");
            end;
        case 3:
            close2;
        }
        break;
    case 3:
        mes .@name$;
        mes "May the blessings of the war Gods be with you.";
        close2;
        warp "bat_room",155,150;
        end;
    }
    end;
}

//bat_room,161,154,3    duplicate(BG_Register)    Battle Recruiter#bat    4_F_JOB_KNIGHT
prontera,158,192,4    duplicate(BG_Register)    Battle Recruiter#prt    4_F_JOB_KNIGHT
//comodo,173,143,4    duplicate(BG_Register)    Battle Recruiter#cmd    4_F_JOB_KNIGHT
//dewata,210,167,4    duplicate(BG_Register)    Battle Recruiter#dew    4_F_JOB_KNIGHT
//morocc,172,87,1    duplicate(BG_Register)    Battle Recruiter#moc    4_F_JOB_KNIGHT
//geffen,136,56,3    duplicate(BG_Register)    Battle Recruiter#gef    4_F_JOB_KNIGHT
//payon,147,80,6    duplicate(BG_Register)    Battle Recruiter#pay    4_F_JOB_KNIGHT
//alberta,201,120,3    duplicate(BG_Register)    Battle Recruiter#alb    4_F_JOB_KNIGHT
//aldebaran,153,108,5    duplicate(BG_Register)    Battle Recruiter#ald    4_F_JOB_KNIGHT
//izlude,106,114,5    duplicate(BG_Register)    Battle Recruiter#izl    4_F_JOB_KNIGHT
//yuno,141,178,5    duplicate(BG_Register)    Battle Recruiter#yun    4_F_JOB_KNIGHT
//amatsu,192,95,5    duplicate(BG_Register)    Battle Recruiter#ama    4_F_JOB_KNIGHT
//gonryun,148,114,4    duplicate(BG_Register)    Battle Recruiter#gon    4_F_JOB_KNIGHT
//comodo,173,143,4    duplicate(BG_Register)    Battle Recruiter#comodo    4_F_JOB_KNIGHT
//louyang,237,100,4    duplicate(BG_Register)    Battle Recruiter#lou    4_F_JOB_KNIGHT
//ayothaya,153,123,4    duplicate(BG_Register)    Battle Recruiter#ayo    4_F_JOB_KNIGHT
//moc_para01,18,18,6    duplicate(BG_Register)    Battle Recruiter#para    4_F_JOB_KNIGHT

/**
 * General Guillaume
 */
bat_room,160,159,3    script    General Guillaume#hBG    4_M_KY_KIYOM,{
    cutin "bat_kiyom2",2;
    set .@name$, "[General Guillaume]";
    mes .@name$;
    mes "Hot-blooded adventurer, we need the aid of your abilities to win this battle.";
    next;
    cutin "bat_kiyom1",2;
    mes .@name$;
    mes "Our great king, Marcel Marollo VII, is very sick lately. His Majesty has declared to choose either me or Prince Croix as the next king amongst his 9 sons.";
    next;
    mes .@name$;
    mes "Two kings can't share a nation!";
    mes "Only the one victorious from his majesty's appointed battle will be enthroned.";
    next;
    mes .@name$;
    mes "This is however, not just a battle between us. This battle will determine the future of this country. I pledge on my honor to prove that I'm the one who can protect this Maroll from outside threats.";
    next;
    mes .@name$;
    mes "I'll be the one who will capture the flag!";
    close2;
    cutin "",255;
    end;
}

/**
 * Prince Croix
 */
bat_room,160,140,3    script    Prince Croix#hBG    4_M_CRU_CRUA,{
    cutin "bat_crua1",2;
    set .@name$, "[Prince Croix]";
    mes .@name$;
    mes "Wise adventurer, why don't you lend us your power for victory?";
    next;
    cutin "bat_crua2",2;
    mes .@name$;
    mes "I do not wish to shed blood, but I have no choice but to fight for the possibility of peace and for the sake of my people.";
    next;
    mes .@name$;
    mes "General Guillaume may have an advantage in this battle as he is the great general of Maroll, but that doesn't automatically mean he'll win. I want to win this battle so that I can grant a better future for my people.";
    next;
    mes .@name$;
    mes "For Maroll!";
    close2;
    cutin "",255;
    end;
}

/**
 * Battleground Dummy Guards
 */
bat_room,161,141,3    script    Prince Croix's Aid::bat_aid    4_M_CRU_HEAD,{ end; }
bat_room,161,139,3    duplicate(bat_aid)    Prince Croix's Aid::bat_aid2    4_M_CRU_HEAD
bat_room,161,160,3    duplicate(bat_aid)    General Guillaume's Aid::bat_aid3    4_M_KY_HEAD
bat_room,161,158,3    duplicate(bat_aid)    General Guillaume's Aid::bat_aid4    4_M_KY_HEAD

/**
 * Battleground Flags
 */
-    script    Guillaume camp#bat    1_FLAG_LION,{ end; }
-    script    Croix camp#bat    1_FLAG_EAGLE,{ end; }

/**
 *  Battleground Exit Teleporter
 */
bat_room,148,150,4    script    Teleporter#bat    4_F_TELEPORTER,{
    set .@name$, "[Teleporter]";
    mes .@name$;
    mes "Do you wish to leave the battlefield? Use my service to return to town.";
    next;
    if (select("I wish to leave.:I wish to stay.") == 2) {
        mes .@name$;
        mes "I'll be here whenever you're in need of my service.";
        close;
    }

    switch(@ArenaPVP_out) {
        // Rune Midgard Republic
        case 1: warp "prontera",149,92; break;
        case 2: warp "payon",165,98; break;
        case 3: warp "morocc",153,94; break;
        case 4: warp "umbala",121,143; break;
        case 5: warp "comodo",196,140; break;
        case 6: warp "niflheim",214,193; break;
        case 7: warp "aldebaran",143,111; break;
        case 8: warp "geffen",107,53; break;
        // Schwarzard Republic
        case 9: warp "yuno",151,177; break;
        case 10: warp "hugel",99,143; break;
        case 11: warp "lighthalzen",167,93; break;
        case 12: warp "einbroch",70,194; break;
        case 13: warp "einbech",168,130; break;
        // Arunafelz Republic
        case 14: warp "rachel",118,114; break;
        case 15: warp "veins",207,122; break;
        // Islands
        case 16: warp "nameless_n",161,179; break;
        case 17: warp "louyang",213,106; break;
        case 18: warp "gonryun",154,111; break;
        case 19: warp "ayothaya",148,109; break;
        case 20: warp "moscovia",229,195; break;
        case 21: warp "xmas",151,127; break;
        case 22: warp "amatsu",203,107; break;
        case 23: warp "izlude",126,114; break;
        case 24: warp "brasilis",195,211; break;
        case 25: warp "manuk",279,214; break;
        case 26: warp "splendide",200,174; break;
        // Anyplace else
        default:
            set .@spoint$, getsavepoint(0);
            set .@x, getsavepoint(1);
            set .@y, getsavepoint(2);
            mes .@name$;
            mes "You will be sent back to " + .@spoint$ + ".";
            close2;
            warp .@spoint$, .@x, .@y;
            break;
    }

    set @ArenaPVP_out, 0;
    end;
}

// Battleground Restauradora

-    script    Restauradora    4_F_SISTER,{
    mes "[Restauradora]";
    mes "Se recomponha, nem tudo está perdido.";
    mes "Seus ferimentos se recuperaram.";
    if( getgroupid() == 1) { //Nível de GM necessário para utilizar o comando.
        skilleffect 74,0;
        percentheal 100,100;
        sc_start SC_MAGNIFICAT,300000,5;
        sc_start SC_GLORIA,300000,5;
        sc_start SC_IMPOSITIO,300000,5;
        sc_start 32,  480000, 10;
        sc_start 30,  480000, 10;
            sc_start SC_FOOD_STR,90000,3;
            sc_start SC_FOOD_AGI,90000,3;
            sc_start SC_FOOD_VIT,90000,3;
            sc_start SC_FOOD_INT,90000,3;
            sc_start SC_FOOD_DEX,90000,3;
            sc_start SC_FOOD_LUK,90000,3;
            repairall;
            close2;
            openstorage;
        end;
        }
        
    specialeffect(EF_HEAL2, AREA, playerattached()); percentheal 100,100;
    specialeffect(EF_INCAGILITY, AREA, playerattached()); sc_start SC_INC_AGI,300000,10;
    specialeffect(EF_BLESSING, AREA, playerattached()); sc_start SC_BLESSING,300000,10;
    repairall;
    close2;
    openstorage;
    end;
}

// Battleground Restauradora Duplicates
// bg_conquest Restauradora

schg_cas06,260,383,5    duplicate(Restauradora)    Restauradora#cq1    4_F_SISTER
schg_cas06,299,383,3    duplicate(Restauradora)    Restauradora#cq2    4_F_SISTER
schg_cas07,86,315,5    duplicate(Restauradora)    Restauradora#cq3    4_F_SISTER
schg_cas07,117,315,3    duplicate(Restauradora)    Restauradora#cq4    4_F_SISTER
schg_cas08,23,50,6    duplicate(Restauradora)    Restauradora#cq5    4_F_SISTER
schg_cas08,92,50,4    duplicate(Restauradora)    Restauradora#cq6    4_F_SISTER
arug_cas06,26,385,5    duplicate(Restauradora)    Restauradora#cq7    4_F_SISTER
arug_cas06,122,361,5    duplicate(Restauradora)    Restauradora#cq8    4_F_SISTER
arug_cas07,304,342,3    duplicate(Restauradora)    Restauradora#cq9    4_F_SISTER
arug_cas07,304,305,1    duplicate(Restauradora)    Restauradora#cq0    4_F_SISTER
arug_cas08,310,154,6    duplicate(Restauradora)    Restauradora#cqa    4_F_SISTER
arug_cas08,333,154,4    duplicate(Restauradora)    Restauradora#cqb    4_F_SISTER

prontera,150,150,4    duplicate(Restauradora)    Restauradora#cqb1    4_F_SISTER

// bg_flavius_ctf Restauradora

bat_b02,390,13,5    duplicate(Restauradora)    Restauradora#ctf1    4_F_SISTER
bat_b02,10,293,5    duplicate(Restauradora)    Restauradora#ctf2    4_F_SISTER

// bg_flavius_sc Restauradora

bat_b04,390,13,5    duplicate(Restauradora)    Restauradora#sc1    4_F_SISTER
bat_b04,10,293,5    duplicate(Restauradora)    Restauradora#sc2    4_F_SISTER

// bg_flavius_td Restauradora

bat_b03,390,13,5    duplicate(Restauradora)    Restauradora#td1    4_F_SISTER
bat_b03,10,293,5    duplicate(Restauradora)    Restauradora#td2    4_F_SISTER

// bg_rush Restauradora

rush_cas01,198,230,6    duplicate(Restauradora)    Restauradora#rh1    4_F_SISTER
rush_cas01,198,226,6    duplicate(Restauradora)    Restauradora#rh2    4_F_SISTER
rush_cas02,142,50,6    duplicate(Restauradora)    Restauradora#rh3    4_F_SISTER
rush_cas02,142,46,6    duplicate(Restauradora)    Restauradora#rh4    4_F_SISTER
rush_cas03,60,17,4    duplicate(Restauradora)    Restauradora#rh5    4_F_SISTER
rush_cas03,64,17,4    duplicate(Restauradora)    Restauradora#rh6    4_F_SISTER
rush_cas04,266,292,6    duplicate(Restauradora)    Restauradora#rh7    4_F_SISTER
rush_cas04,266,288,6    duplicate(Restauradora)    Restauradora#rh8    4_F_SISTER

// bg_tierra_boss Restauradora

bat_a03,53,377,3    duplicate(Restauradora)    Restauradora#tb1    4_F_SISTER
bat_a03,45,18,3    duplicate(Restauradora)    Restauradora#tb2    4_F_SISTER

// bg_tierra_dom Restauradora

bat_a04,53,377,3    duplicate(Restauradora)    Restauradora#DOM1    4_F_SISTER
bat_a04,45,18,3    duplicate(Restauradora)    Restauradora#DOM2    4_F_SISTER

// bg_tierra_eoe Restauradora

bat_a02,53,377,3    duplicate(Restauradora)    Restauradora#eoe1    4_F_SISTER
bat_a02,45,18,3    duplicate(Restauradora)    Restauradora#eoe2    4_F_SISTER

// bg_tierra_ti Restauradora

region_8,7,52,5    duplicate(Restauradora)    Restauradora#ti_1    4_F_SISTER
region_8,52,92,3    duplicate(Restauradora)    Restauradora#ti_2    4_F_SISTER
region_8,92,52,3    duplicate(Restauradora)    Restauradora#ti_3    4_F_SISTER

 

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.