Jump to content
  • 0

Question

Posted


- script bg_emp#control -1,{
OnInit:
setarray .rewarditem, 673, 5; // reward to the winning team
set .winningscore, 2; // final score to win
set .eventlasting, 1200; // abort the system if there's no progress, 1200 seconds = 20 mins
sleep 1;
disablenpc .rednpcname$;
disablenpc .bluenpcname$;
end;
OnStart:
if ( getwaitingroomstate( 0, .rednpcname$ ) < .minplayer2start || getwaitingroomstate( 0, .bluenpcname$ ) < .minplayer2start ) end;
set .red, waitingroom2bg( "bat_a01", 171,346, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead", .rednpcname$ );
copyarray .team1aid, $@arenamembers, $@arenamembersnum;
set .blue, waitingroom2bg( "bat_a01", 162,50, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead", .bluenpcname$ );
copyarray .team2aid, $@arenamembers, $@arenamembersnum;
delwaitingroom .rednpcname$;
delwaitingroom .bluenpcname$;
disablenpc .rednpcname$;
disablenpc .bluenpcname$;
bg_warp .red, "bat_a01", 171,346;
bg_warp .blue, "bat_a01", 162,50;
setwall "bat_a01", 154,51, 6, 4, 0, "bg_emp_town_blue";
setwall "bat_a01", 164,347, 6, 4, 0, "bg_emp_town_red";
bg_updatescore "bat_a01", 0, 0;
sleep 6000; if ( .inprogress == 0 ) goto L_Abort;
mapannounce "bat_a01", "Rules are simple. The first one to break the opponent's emperium will get a score.", 0;
sleep 3000; if ( .inprogress == 0 ) goto L_Abort;
mapannounce "bat_a01", "Score "+ .winningscore +" rounds to win ! ... GET READY", 0;
sleep 2000; if ( .inprogress == 0 ) goto L_Abort;
while (1) {
for ( .@i = 5; .@i > 0; .@i-- ) {
mapannounce "bat_a01", .@i +"", 0;
sleep 1000; if ( .inprogress == 0 ) goto L_Abort;
}
if ( .score[1] == .winningscore -1 && .score[2] == .winningscore -1 )
mapannounce "bat_a01", "Final Round start!", 0;
else
mapannounce "bat_a01", "Round "+ .round++ +" start!", 0;
bg_monster .red,"bat_a01",171,346, "--ja--",1915, strnpcinfo(3)+"::OnRedDown";
bg_monster .blue,"bat_a01",162,50, "--ja--",1914, strnpcinfo(3)+"::OnBlueDown";
delwall "bg_emp_town_red";
delwall "bg_emp_town_blue";
sleep .eventlasting * 1000; if ( .inprogress == 0 ) goto L_Abort;
.score[ .winside ]++;
bg_updatescore "bat_a01", .score[1], .score[2];
killmonster "bat_a01", strnpcinfo(3)+"::OnRedDown";
killmonster "bat_a01", strnpcinfo(3)+"::OnBlueDown";
if ( .winside )
mapannounce "bat_a01", .empkiller$ +" has Destroy "+( ( .winside == 1 )?"Blue":"Red" )+"'s side Emperium. "+( ( .winside == 1 )?"Red":"Blue" )+" team score a point !", 0;
if ( .score[1] == .winningscore || .score[2] == .winningscore || !.winside ) break;
sleep 5000; if ( .inprogress == 0 ) goto L_Abort;
bg_warp .red, "bat_a01", 171,346;
bg_warp .blue, "bat_a01", 162,50;
setwall "bat_a01", 154,51, 6, 4, 0, "bg_emp_town_blue";
setwall "bat_a01", 164,347, 6, 4, 0, "bg_emp_town_red";
.winside = 0;
}
if ( .winside ) {
mapannounce "bat_a01", ( ( .winside == 1 )?"Red":"Blue" )+" side wins !", 0;
.@size = getarraysize( getd(".team"+ .winside +"aid") );
for ( .@i = 0; .@i < .@size; .@i++ )
getitem .rewarditem[0], .rewarditem[1], getd(".team"+ .winside +"aid["+ .@i +"]" );
} else
mapannounce "bat_a01", "Time Out. Aborting the match.", 0;
sleep 5000;
L_Abort:
bg_warp .red, "prontera", 155,182;
bg_warp .blue, "prontera", 158,182;
bg_destroy .red;
bg_destroy .blue;
delwall "bg_emp_town_red";
delwall "bg_emp_town_blue";
.round = .winside = .score[0] = .score[1] = .inprogress = 0;
end;
OnRedDown: callsub L_EmpDown, 2;
OnBlueDown: callsub L_EmpDown, 1;
L_EmpDown:
.empkiller$ = strcharinfo(0);
.winside = getarg(0);
awake strnpcinfo(3);
OnRedDead:
OnBlueDead:
end;
}

prontera,156,186,5 script gm_start 100,{
if ( getgmlevel() < 99 ) {
mes "I only talk to gm";
close;
}
if ( getvariableofnpc( .inprogress, "bg_emp#control" ) ) {
mes "abort ?";
next;
if ( select ( "Yes", "No" ) == 2 ) close;
awake "bg_emp#control";
killmonster "bat_a01", strnpcinfo(3)+"::OnRedDown";
killmonster "bat_a01", strnpcinfo(3)+"::OnBlueDown";
delwaitingroom getvariableofnpc( .rednpcname$, "bg_emp#control" );
delwaitingroom getvariableofnpc( .bluenpcname$, "bg_emp#control" );
disablenpc getvariableofnpc( .rednpcname$, "bg_emp#control" );
disablenpc getvariableofnpc( .bluenpcname$, "bg_emp#control" );
announce strcharinfo(0) +" has abort the battleground", 0;
close;
}
mes "select how many players to start";
next;
input .@a;
if ( .@a == 0 || .@a > 30 ) close;
set getvariableofnpc( .minplayer2start, "bg_emp#control" ), .@a;
announce strcharinfo(0) +" has hosted "+ .@a +"vs"+ .@a +" battleground", 0;
enablenpc getvariableofnpc( .rednpcname$, "bg_emp#control" );
enablenpc getvariableofnpc( .bluenpcname$, "bg_emp#control" );
donpcevent getvariableofnpc( .rednpcname$, "bg_emp#control" ) +"::OnStart";
donpcevent getvariableofnpc( .bluenpcname$, "bg_emp#control" ) +"::OnStart";
set getvariableofnpc( .inprogress, "bg_emp#control" ), 1;
close;
}

prontera,155,182,5 script Red side#bg_emp 100,{
end;
OnStart:
waitingroom "Red side", getvariableofnpc( .minplayer2start, "bg_emp#control" ) +1, "bg_emp#control::OnStart", getvariableofnpc( .minplayer2start, "bg_emp#control" );
end;
OnInit:
set getvariableofnpc( .rednpcname$, "bg_emp#control" ), strnpcinfo(0);
end;
}

prontera,158,182,5 script Blue side#bg_emp 100,{
end;
OnStart:
waitingroom "Blue side", getvariableofnpc( .minplayer2start, "bg_emp#control" ) +1, "bg_emp#control::OnStart", getvariableofnpc( .minplayer2start, "bg_emp#control" );
end;
OnInit:
set getvariableofnpc( .bluenpcname$, "bg_emp#control" ), strnpcinfo(0);
end;
}

bat_a01 mapflag battleground 2
bat_a01 mapflag nosave SavePoint
bat_a01 mapflag nowarp
bat_a01 mapflag nowarpto
bat_a01 mapflag noteleport
bat_a01 mapflag nomemo
bat_a01 mapflag nopenalty
bat_a01 mapflag nobranch
bat_a01 mapflag noicewall

i saw some problem in the event.

1. the registration is too easy.

- some player with bad intention on the event or just ruin the game can join.

- [can we make it a party registration but still they will warp to the place where the waiting room is located. like party vs party script]

2. GM can only activate it,

- can we make it an automated event

3. the script have no security check on those player who are just afk in the event.

- can we put a time check if the player still afk in the event area.

4. the respawn area of the dead player.

- can we put it outside the emperium/crystal location because in the script if the player died they just respawn where there crystal located. result is the enemy easily killed or spam a AOE skill to kill the player.

5. the emperium/crystal HP.

- can we change it? or its default?.

6. a custom Flag for the event.

- it's good also to put a custom flag where the logo of the winner of the event will be put in that custom flag.

2 answers to this question

Recommended Posts

Posted

http://rathena.org/board/topic/72372-bg-type-emperium-breaking/#entry149895

there is a reason why I didn't reply in that topic because I ran into some problem

I also started to get several PMs requested to make adjustment to my script

and here it is

there seems to be several type of request about this kind of battleground scripts

so currently its quite hard for me to decide either I should

1. event has to be activated by GM

- can set how many people to participate manually, but GM must present to activate it

2. event runs automatically

- this waitingroom system needs to gather all members ...

if the waitingroom is not full (means not enough players) the event couldn't start

3. event auto-restart itself after the game finish

- just like you request ... but I dunno how to set the configuration for public release

actually, I can write them out if this is done individually

means,

I made minor edit for this member,

and make another adjustment for that member,

and another modification for another member

but this is really not my style

you see, like my other public release script like private mvp room

which has a setting section, which almost every server is satisfy using this script

-> 1 script = all server happy, no matter you are high rate or low rate server

the same goes to my mission board script

-> 1 script = all admin happily setup themself, no matter you are high rate or low rate server

and my goal is to create a script something like this

because this will be a public release script, not some paid service script !!

there's a big difference when writing a script for public release or paid service script

when making a paid service script ( although I never do paid service )

the user just have to script the feature according to the request,

no other feature is needed unless asked

however, when releasing a public release script,

I have to take into consideration that my script has to be satisfy for all users on the board

and it does significantly challenge my scripting skill a little more to make a setting satisfy for all

back to the question

by gathering up all the PMs regarding this battleground script request

these 3 features are most commonly ask

before few hours ago, I can't seem to find a way how to script it to satisfy everyone with some kind of setting

and this has been bugging me for a few days how to write it out

although this is not my first written battleground script ( I've done several before, like this )

but this is truly the one that is getting a lot attention and start to spam my PM box about it

just few hours ago when that reply comes up

my own mission board script has given me some inspiration how to do this ...

finally ...

I never thought about using some kind of algorithm in event script before

because from my experience,

event script is event script, algorithm script is algorithm script, both are separated

as I've done at least 20 pvp/gvg scripts before, it never involved any algorithm ( unless list out top players )

and right now I have the idea how to write this out using the same algorithm that I used in mission board into this script

haiz ... I feel like I'm spouting nonsense, that doesn't relate anything to topic

tomorrow I'll make a proper reply

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...