Aya Posted November 9, 2012 Group: Members Topic Count: 35 Topics Per Day: 0.01 Content Count: 125 Reputation: 2 Joined: 08/27/12 Last Seen: June 7, 2023 Share Posted November 9, 2012 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 Quote Link to comment Share on other sites More sharing options...
Thanna Posted November 9, 2012 Group: Members Topic Count: 45 Topics Per Day: 0.01 Content Count: 271 Reputation: 7 Joined: 01/06/12 Last Seen: May 16, 2015 Share Posted November 9, 2012 (edited) *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 November 9, 2012 by Thanna Quote Link to comment Share on other sites More sharing options...
GmOcean Posted November 9, 2012 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted November 9, 2012 (edited) 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 November 9, 2012 by GmOcean Quote Link to comment Share on other sites More sharing options...
Aya Posted November 9, 2012 Group: Members Topic Count: 35 Topics Per Day: 0.01 Content Count: 125 Reputation: 2 Joined: 08/27/12 Last Seen: June 7, 2023 Author Share Posted November 9, 2012 (edited) *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 November 9, 2012 by Aya Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted November 9, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted November 9, 2012 (edited) 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 November 9, 2012 by AnnieRuru Quote Link to comment Share on other sites More sharing options...
Aya Posted November 9, 2012 Group: Members Topic Count: 35 Topics Per Day: 0.01 Content Count: 125 Reputation: 2 Joined: 08/27/12 Last Seen: June 7, 2023 Author Share Posted November 9, 2012 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 :* Quote Link to comment Share on other sites More sharing options...
OmarAcero Posted May 3, 2013 Group: Members Topic Count: 25 Topics Per Day: 0.01 Content Count: 71 Reputation: 1 Joined: 10/13/12 Last Seen: September 11, 2021 Share Posted May 3, 2013 Hi guys pls the script , have error¡???? look... i use rAthena revision 17235 ..... - 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 Quote Link to comment Share on other sites More sharing options...
dhaisuke Posted September 30, 2013 Group: Members Topic Count: 27 Topics Per Day: 0.01 Content Count: 76 Reputation: 2 Joined: 06/07/12 Last Seen: May 6, 2020 Share Posted September 30, 2013 Hi how to make this become automated? Quote Link to comment Share on other sites More sharing options...
cassie24 Posted June 26, 2014 Group: Members Topic Count: 25 Topics Per Day: 0.01 Content Count: 60 Reputation: 0 Joined: 04/25/14 Last Seen: October 31, 2014 Share Posted June 26, 2014 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? Quote Link to comment Share on other sites More sharing options...
c2greentea Posted July 10, 2014 Group: Members Topic Count: 68 Topics Per Day: 0.02 Content Count: 173 Reputation: 0 Joined: 06/07/14 Last Seen: December 17, 2014 Share Posted July 10, 2014 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 Quote Link to comment Share on other sites More sharing options...
GMKoji Posted December 1, 2014 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 43 Reputation: 0 Joined: 02/17/12 Last Seen: October 11, 2015 Share Posted December 1, 2014 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 Quote Link to comment Share on other sites More sharing options...
Question
Aya
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 =)
Link to comment
Share on other sites
10 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.