Jump to content
  • 0

Can someone fix this for me? Thank you =)


Aya

Question


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  125
  • Reputation:   2
  • Joined:  08/27/12
  • Last Seen:  

I am using Annie's custom_bg.txt script. My problem is, inside the Map, when Custom Battle Ground is on goin, when a player died, it will revive in the starting point but with 1 SP and HP. I want it to be, when revive, full HP and SP. Thank you =)

-	script	custom_bg#control	-1,{
OnInit:
set .minplayer2start, 3; // minimum player to start
setarray .rewarditem,
30000, 10, // reward to the winning team
30000, 3; // reward to the losing team
set .startingscore, 15; // score at start
set .eventlasting, 100; // event last 100 seconds
end;
OnStart:
if ( getwaitingroomstate( 0, "red side" ) < .minplayer2start || getwaitingroomstate( 0, "blue side" ) < .minplayer2start ) end;
set .red, waitingroom2bg( "guild_vs3", 13,50, strnpcinfo(0)+"::OnredQuit", strnpcinfo(0)+"::OnredDead", "red side" );
copyarray .team1aid[.@i], $@arenamembers[.@i], $@arenamembersnum;
set .blue, waitingroom2bg( "guild_vs3", 86,50, strnpcinfo(0)+"::OnblueQuit", strnpcinfo(0)+"::OnblueDead", "blue side" );
copyarray .team2aid[.@i], $@arenamembers[.@i], $@arenamembersnum;
delwaitingroom "red side";
delwaitingroom "blue side";
bg_warp .red, "guild_vs3", 13,50;
bg_warp .blue, "guild_vs3", 86,50;
set .score[1], .startingscore;
set .score[2], .startingscore;
bg_updatescore "guild_vs3", .score[1], .score[2];
sleep .eventlasting * 1000;
if ( .score[1] == .score[2] )
mapannounce "guild_vs3", "Draw !", 0;
else if ( .score[1] > .score[2] ) {
	mapannounce "guild_vs3", "red side wins !", 0;
	callsub L_reward, 1, 0;
	callsub L_reward, 2, 2;
}
else if ( .score[1] < .score[2] ) {
	mapannounce "guild_vs3", "blue side wins !", 0;
	callsub L_reward, 2, 0;
	callsub L_reward, 1, 2;
}
bg_warp .red, "revencia", 164,37;
bg_warp .blue, "revencia", 164,37;
bg_destroy .red;
bg_destroy .blue;
donpcevent "red side::OnInit";
donpcevent "blue side::OnInit";
end;
L_reward:
set .@size, getarraysize( getd(".team"+ getarg(0) +"aid") );
for ( set .@i, 0; .@i < .@size; set .@i, .@i +1 )
if ( isloggedin( getd(".team"+ getarg(0) +"aid["+ .@i +"]" ) ) )
getitem .rewarditem[ getarg(1) ], .rewarditem[ getarg(1) +1 ], getd(".team"+ getarg(0) +"aid["+ .@i +"]" );
return;
OnredDead: callsub L_dead, 1;
OnblueDead: callsub L_dead, 2;
L_dead:
set .score[ getarg(0) ], .score[ getarg(0) ] -1;
bg_updatescore "guild_vs3", .score[1], .score[2];
if ( .score[ getarg(0) ] == 0 )
//awake strnpcinfo(0);
areapercentheal "guild_vs3",13,50,86,50,100,100;
end;
OnredQuit: callsub L_quit, 1, .red;
OnblueQuit: callsub L_quit, 2, .blue;
L_quit:
if ( bg_get_data( getarg(1), 0) ) end;
set .score[ getarg(0) ], 0;
awake strnpcinfo(0);
percentheal 100, 100;
end;
}

revencia,143,30,5 script red side 733,{
end;
OnInit:
waitingroom "Red Team", getvariableofnpc( .minplayer2start, "custom_bg#control" ) +1, "custom_bg#control::OnStart", getvariableofnpc( .minplayer2start, "custom_bg#control" );
end;
}
revencia,143,27,5 script blue side 734,{
end;
OnInit:
waitingroom "Blue Team", getvariableofnpc( .minplayer2start, "custom_bg#control" ) +1, "custom_bg#control::OnStart", getvariableofnpc( .minplayer2start, "custom_bg#control" );
end;
}
guild_vs3 mapflag battleground 2
guild_vs3 mapflag nosave SavePoint
guild_vs3 mapflag nowarp
guild_vs3 mapflag nowarpto
guild_vs3 mapflag noteleport
guild_vs3 mapflag nomemo
guild_vs3 mapflag nopenalty

Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  271
  • Reputation:   7
  • Joined:  01/06/12
  • Last Seen:  

*areapercentheal "<mapname>",<x1>,<y1>,<x2>,<y2>,<hp>,<sp>;
Not exactly limited to battleground use, this will restore HP/SP in a defined area at a percentage.
Example:
areapercentheal "bat_a01",52,208,61,217,100,100;
end;

or try my code thay Im using on my BG

// HEALER
// *****************************************************************
- script bghealbuffs -1,{
OnPCLoadMapEvent:
while (getbrokenid(1)) {
	repair(1);
	set .@i, .@i +1;
}  
getinventorylist;
for (set .@j, 0; .@j < @inventorylist_count; set .@j, .@j + 1) {
if (!@inventorylist_identify[.@j]) {
	delitem2 @inventorylist_id[.@j],1,0,0,0,0,0,0,0;
	getitem @inventorylist_id[.@j],1;
}
}
percentheal 100,100;
skilleffect 34,0; sc_start SC_BLESSING,1800000,10;
skilleffect 29,0; sc_start SC_INCREASEAGI,1800000,10;
}

guild_vs3	mapflag loadevent



the code that I made have heal, agi up,blessing and can repair and identify items

Edited by Thanna
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

Well... my guess would be the issue is here:

OnredDead: callsub L_dead, 1;
OnblueDead: callsub L_dead, 2;
L_dead:
set .score[ getarg(0) ], .score[ getarg(0) ] -1;
bg_updatescore "guild_vs3", .score[1], .score[2];
if ( .score[ getarg(0) ] == 0 )
//awake strnpcinfo(0);
areapercentheal "guild_vs3",13,50,86,50,100,100;
end;

It looks like, it'll only use the heal command when the team that is called, has reached 0 points. But, i don't have much experience with BG scripts, so I can't be certain.

Edited by GmOcean
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  125
  • Reputation:   2
  • Joined:  08/27/12
  • Last Seen:  

*areapercentheal "<mapname>",<x1>,<y1>,<x2>,<y2>,<hp>,<sp>;
Not exactly limited to battleground use, this will restore HP/SP in a defined area at a percentage.
Example:
areapercentheal "bat_a01",52,208,61,217,100,100;
end;

or try my code thay Im using on my BG

// HEALER
// *****************************************************************
- script bghealbuffs -1,{
OnPCLoadMapEvent:
while (getbrokenid(1)) {
	repair(1);
	set .@i, .@i +1;
}  
getinventorylist;
for (set .@j, 0; .@j < @inventorylist_count; set .@j, .@j + 1) {
if (!@inventorylist_identify[.@j]) {
	delitem2 @inventorylist_id[.@j],1,0,0,0,0,0,0,0;
	getitem @inventorylist_id[.@j],1;
}
}
percentheal 100,100;
skilleffect 34,0; sc_start SC_BLESSING,1800000,10;
skilleffect 29,0; sc_start SC_INCREASEAGI,1800000,10;
}

guild_vs3	mapflag loadevent



the code that I made have heal, agi up,blessing and can repair and identify items

Now testing

Not Working. What I want is when I died, it will automatically revive will full HP and SP

Edited by Aya
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

haha, GmOcean,

areapercentheal is just like areawarp, well if you have made certain kinds of event script, you sure know how to use areawarp command

areapercentheal is just a 1 time healing, restore their hp/sp to x% in the define area

in SVN custom battleground scripts, its use when a round has started, or when a round has ended

https://rathena.svn.sourceforge.net/svnroot/rathena/trunk/npc/custom/battleground/bg_flavius_01.txt

Thanna's method sounds like a hack to me @_@

lol, abusing loadevent mapflag ...

I think just like this will do

OnredDead: callsub L_dead, 1;
OnblueDead: callsub L_dead, 2;
L_dead:
set .score[ getarg(0) ], .score[ getarg(0) ] -1;
bg_updatescore "guild_vs3", .score[1], .score[2];
if ( .score[ getarg(0) ] == 0 )
awake strnpcinfo(0); // please, if this one comment out, the event wont end
sleep2 1500;
percentheal 100,100;
end;

lol

maybe your script should change to callfunc or something, but oh well, looks custom to me

@Aya, try this

custom_bg0.2.txt

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  125
  • Reputation:   2
  • Joined:  08/27/12
  • Last Seen:  

haha, GmOcean,

areapercentheal is just like areawarp, well if you have made certain kinds of event script, you sure know how to use areawarp command

areapercentheal is just a 1 time healing, restore their hp/sp to x% in the define area

in SVN custom battleground scripts, its use when a round has started, or when a round has ended

https://rathena.svn...._flavius_01.txt

Thanna's method sounds like a hack to me @_@

lol, abusing loadevent mapflag ...

I think just like this will do

OnredDead: callsub L_dead, 1;
OnblueDead: callsub L_dead, 2;
L_dead:
set .score[ getarg(0) ], .score[ getarg(0) ] -1;
bg_updatescore "guild_vs3", .score[1], .score[2];
if ( .score[ getarg(0) ] == 0 )
awake strnpcinfo(0); // please, if this one comment out, the event wont end
sleep2 1500;
percentheal 100,100;
end;

lol

maybe your script should change to callfunc or something, but oh well, looks custom to me

@Aya, try this

custom_bg0.2.txt

Thank you for this Annie! <3 you. Now trying it .. =)

It is now working =) I <3 you Annie! ;D :*

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  71
  • Reputation:   1
  • Joined:  10/13/12
  • Last Seen:  

Hi guys pls the script , have error¡???? look... i use rAthena revision 17235 .....     /sob

 

-	script	custom_bg#control	-1,{
OnInit:
	set .minplayer2start, 3; // minimum player to start
	setarray .rewarditem,
	30000, 10, // reward to the winning team
	30000, 3; // reward to the losing team
	set .startingscore, 15; // score at start
	set .eventlasting, 100; // event last 100 seconds
	end;
OnStart:
	if ( getwaitingroomstate( 0, "red side" ) < .minplayer2start || getwaitingroomstate( 0, "blue side" ) < .minplayer2start ) end;
	set .red, waitingroom2bg( "guild_vs3", 13,50, strnpcinfo(0)+"::OnredQuit", strnpcinfo(0)+"::OnredDead", "red side" );
	copyarray .team1aid[.@i], $@arenamembers[.@i], $@arenamembersnum;
	set .blue, waitingroom2bg( "guild_vs3", 86,50, strnpcinfo(0)+"::OnblueQuit", strnpcinfo(0)+"::OnblueDead", "blue side" );
	copyarray .team2aid[.@i], $@arenamembers[.@i], $@arenamembersnum;
	delwaitingroom "red side";
	delwaitingroom "blue side";
	bg_warp .red, "guild_vs3", 13,50;
	bg_warp .blue, "guild_vs3", 86,50;
	set .score[1], .startingscore;
	set .score[2], .startingscore;
	bg_updatescore "guild_vs3", .score[1], .score[2];
	sleep .eventlasting * 1000;
	if ( .score[1] == .score[2] )
	mapannounce "guild_vs3", "Draw !", 0;
	else if ( .score[1] > .score[2] ) {
		mapannounce "guild_vs3", "red side wins !", 0;
		callsub L_reward, 1, 0;
		callsub L_reward, 2, 2;
	}
	else if ( .score[1] < .score[2] ) {
		mapannounce "guild_vs3", "blue side wins !", 0;
		callsub L_reward, 2, 0;
		callsub L_reward, 1, 2;
	}
	bg_warp .red, "prontera", 149,168;
	bg_warp .blue, "prontera", 162,168;
	bg_destroy .red;
	bg_destroy .blue;
	donpcevent "red side::OnInit";
	donpcevent "blue side::OnInit";
	end;
	L_reward:
	set .@size, getarraysize( getd(".team"+ getarg(0) +"aid") );
	for ( set .@i, 0; .@i < .@size; set .@i, .@i +1 )
	if ( isloggedin( getd(".team"+ getarg(0) +"aid["+ .@i +"]" ) ) )
	getitem .rewarditem[ getarg(1) ], .rewarditem[ getarg(1) +1 ], getd(".team"+ getarg(0) +"aid["+ .@i +"]" );
	return;

OnredDead: callsub L_dead, 1;
OnblueDead: callsub L_dead, 2;
	L_dead:
	set .score[ getarg(0) ], .score[ getarg(0) ] -1;
	bg_updatescore "guild_vs3", .score[1], .score[2];
	if ( .score[ getarg(0) ] == 0 )
	//awake strnpcinfo(0);
	areapercentheal "guild_vs3",13,50,86,50,100,100;
sleep2 1500;
percentheal 100,100;
	end;

OnredQuit: callsub L_quit, 1, .red;
OnblueQuit: callsub L_quit, 2, .blue;
	L_quit:
	if ( bg_get_data( getarg(1), 0) ) end;
	set .score[ getarg(0) ], 0;
	awake strnpcinfo(0);
	percentheal 100, 100;
	end;
}

prontera,149,168,5 script red side 101,{
	end;
OnInit:
	waitingroom "Red Team", getvariableofnpc( .minplayer2start, "custom_bg#control" ) +1, "custom_bg#control::OnStart", getvariableofnpc( .minplayer2start, "custom_bg#control" );
	end;
}
prontera,162,168,5 script blue side#custom_bg 101,{
	end;
OnInit:
	waitingroom "Blue Team", getvariableofnpc( .minplayer2start, "custom_bg#control" ) +1, "custom_bg#control::OnStart", getvariableofnpc( .minplayer2start, "custom_bg#control" );
	end;
}
guild_vs3 mapflag battleground 2
guild_vs3 mapflag nosave SavePoint
guild_vs3 mapflag nowarp
guild_vs3 mapflag nowarpto
guild_vs3 mapflag noteleport
guild_vs3 mapflag nomemo
guild_vs3 mapflag nopenalty


 

 

index.php?action=dlattach;topic=45052.0;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  76
  • Reputation:   2
  • Joined:  06/07/12
  • Last Seen:  

Hi how to make this become automated?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   0
  • Joined:  04/25/14
  • Last Seen:  

Annie, how to set delay for all players who have used this script as well as minimum lvl? Pls help


OR how to make this automated?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  68
  • Topics Per Day:  0.02
  • Content Count:  173
  • Reputation:   0
  • Joined:  06/07/14
  • Last Seen:  

How to load this? Manually via @loadnpc? :(


What's the problem with this script? http://pastebin.com/raw.php?i=krgCVKtR

 

I only changed maps and coordinates then the blue team chatroom appears to only have (1/1) chatroom limit and the other appears to have the correct limit. Pls help

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  43
  • Reputation:   0
  • Joined:  02/17/12
  • Last Seen:  

Hi AnnieRuru!!

 

Im using your custom_bg02.txt script. I was wondering how will I add a function that would automatically exit all players from the battlegrounds after receiving there respective rewards. Great Script BTW :D

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