pajodex Posted May 3, 2018 Posted May 3, 2018 View File Rune War - Battleground Quote //===== rAthena Script ======================================= //= Rune War - (from Ragnarok Event v2) //=============== by: ============================= //= pajodex //===== Current Version: ===================================== //= 1.0 //===== Compatible With: ===================================== //= rAthena Project (pajodex) //===== Description: ========================================= /* Rune War (from Ragnarok Event v2) Battleground script that runs OnClockxxxx time on server. An npc will appear at prontera for registration. After some time RegistrationNPC will disappear. All registered players will be divided into 2 teams. Players have to eliminate the enemy to gain points. Team with the most points accumulated wins. A rune will be spawned at the center of the map. Runes similar to Dota 2. * disclaimer * this runs like the War Over Rune but it is my own version. Since this is free, i did not add any special features. Enjoy! */ //=====******** Note ********================================= //= if you find bugs or problem, please do tell DM me at //= Discord (pajodex#1328) or rAthena (pajodex) //= open for suggestions //===== Additional Comments: ================================= /* 1.0 - Initial release */ //============================================================= Rune Config: // ============= // Rune Settings // ============= // Rune names (in-order) setarray .Rune$[1], "Invisibility", "Haste", "Double Damage", "Illusion", "Regeneration"; // NPC View ID if server in renewal mode setarray .npc_view_re[1], 2450, 2696, 2697, 2702, 2703; // NPC View ID if server in pre-renewal mode setarray .npc_view_pre[1], 1120, 1096, 1582, 1388, 1031; // Rune effect duration (seconds) .duration = 20; // Respawn time of rune after being pick-ed up (minutes) .respawn_time = 1; Main Config: // ============= // Game Settings // ============= // How many players to start? // default = 4 (2v2) .minplayers = 4; // How long, in mins, for players to register_time // default = 3 mins .register_time = 3; // How many mins before rune is spawned // default : 1 min .runespawn = 1; // Event duration in minutes.. // default : 10 mins .duration = 10; // Reward settings setarray .rwd[0], 501, 10, // win team reward 501, 5; // lose team reward Hi guys, This is originally my Ragnarok Event v2 which was supposed to be a paid script.. but... I changed my mind.. I renamed it to Rune War.. Enjoy! Submitter pajodex Submitted 05/03/2018 Category PvP, GvG, WoE, Battleground Video Content Author pajodex Quote
Stolao Posted May 3, 2018 Posted May 3, 2018 *cough* press the attack *cough* Looks quite fun I must say. Quote
pajodex Posted May 3, 2018 Author Posted May 3, 2018 1 hour ago, Stolao said: *cough* press the attack *cough* Looks quite fun I must say. quite an excitement Quote
Zycron Posted May 13, 2018 Posted May 13, 2018 I put this on my server let it run no Npc ever appeared so I went in and added a on onclock fir every hour still have never seen npc appear to start event did I do something wrong? Quote
pajodex Posted May 13, 2018 Author Posted May 13, 2018 Never encountered that.. Check your mapserver for errors.. Here is an update : https://github.com/pajodex/ScriptCollections/blob/master/RuneWar.txt I saw a line which is not needed.. maybe it caused the error. @Zycron Quote
pajodex Posted May 13, 2018 Author Posted May 13, 2018 3 hours ago, Zycron said: No errors at all on my end that's what is weird Did you try the new version i linked above? Quote
Huggies Posted August 7, 2018 Posted August 7, 2018 (edited) Is there any ways not to disable Kienna NPC (https://github.com/rathena/rathena/blob/master/npc/quests/skills/rogue_skills.txt). While Rune Wars is held in the map prt_are01? Lastly, is there any way can stop the winner players from camping at loser team spawn point? loser team will be dead once respawn in. Edited August 7, 2018 by Huggies Quote
Snoopy90 Posted May 23, 2019 Posted May 23, 2019 (edited) I get this error. Please help me Quote [Error]: Loading NPC file: npc/devil/event/runewar.txt script error on npc/devil/event/runewar.txt line 302 parse_simpleexpr: unexpected character 297 : 298 : OnRedDie: callsub L_die, "Red"; 299 : OnBlueDie: callsub L_die, "Blue"; 300 : L_die: 301 : if( getcharid(4) == .red) * 302 : +'+'.bluepoints; 303 : else if( getcharid(4) == .blue) 304 : ++.redpoints; 305 : bg_updatescore strnpcinfo(4), .redpoints, .bluepoints; 306 : announce getarg(0) +" team member has died!", bc_npc | bc_map | bc_blue; 307 : sleep2 1250; [Error]: script error on npc/devil/event/runewar.txt line 322 parse_simpleexpr: unexpected character 317 : mes "Sorry, event is on-going."; 318 : close; 319 : } 320 : mes "Do you want to join the queue?"; 321 : next; * 322 : while ( .aid[.@i] != getcharid(3) && .@i < .size ) +'+'.@i; 323 : if ( .@i < .size ) { 324 : mes "You already join the queue."; 325 : close; 326 : } 327 : select "Join"; This s my script //===== rAthena Script ======================================= //= Rune War - (from Ragnarok Event v2) //=============== by: ============================= //= pajodex //===== Current Version: ===================================== //= 1.0 //===== Compatible With: ===================================== //= rAthena Project (pajodex) //===== Description: ========================================= /* Rune War (from Ragnarok Event v2) Battleground script that runs OnClockxxxx time on server. An npc will appear at prontera for registration. After some time RegistrationNPC will disappear. All registered players will be divided into 2 teams. Players have to eliminate the enemy to gain points. Team with the most points accumulated wins. A rune will be spawned at the center of the map. Runes similar to Dota 2. * disclaimer * this runs like the War Over Rune but it is my own version. Since this is free, i did not add any special features. Enjoy! */ //=====******** Note ********================================= //= if you find bugs or problem, please do tell DM me at //= Discord (pajodex#1328) or rAthena (pajodex) //= open for suggestions //===== Additional Comments: ================================= /* 1.0 - Initial release */ //============================================================= function script F_ShuffleNumbers { deletearray getarg(2); .@static = getarg(0); .@range = getarg(1) +1 - .@static; .@count = getarg(3, .@range); if (.@range <= 0 || .@count <= 0) return 0; if (.@count > .@range) .@count = .@range; for (.@i = 0; .@i < .@range; ++.@i) .@temparray[.@i] = .@i; for (.@i = 0; .@i < .@count; ++.@i) { .@rand = rand(.@range); set getelementofarray( getarg(2), .@i ), .@temparray[.@rand] + .@static; .@temparray[.@rand] = .@temparray[--.@range]; } return .@count; } prt_are01,150,150,0 script Rune#11 100,1,1,{ end; OnStart: .rune = rand(1,5); if(!checkre(0)) setnpcdisplay strnpcinfo(3), .npc_view_re[.rune]; else setnpcdisplay strnpcinfo(3), .npc_view_pre[.rune]; end; OnTouch: if( getvariableofnpc( .start, "runewar#main" ) == 1 ) { if(!.getrune) { if(.rune == 1) { skill "AS_CLOAKING",10,1; sc_start SC_CLOAKING, (.duration * 1000), 10; specialeffect2 120; } if(.rune == 2) { sc_start SC_SPEEDUP0,(.duration * 1000),25; specialeffect2 507; } if(.rune == 3) { sc_start SC_INCATKRATE,(.duration * 1000), 100; sc_start SC_INCMATKRATE,(.duration * 1000), 100; specialeffect2 220; } if(.rune == 4) { getmapxy( .@map$,.@x,.@y,0,strcharinfo(0) ); clone .@map$,.@X,.@y,"",getcharid(0),getcharid(0),"",1,.duration; clone .@map$,.@X,.@y,"",getcharid(0),getcharid(0),"",1,.duration; specialeffect2 65; } if(.rune == 5) { sc_start4 SC_REGENERATION,(.duration * 1000),-10,1,0,0; percentheal 10, 0; specialeffect2 EF_HEAL; } mapannounce strnpcinfo(4), strcharinfo(0)+ " has picked up ["+.Rune$[.rune]+"] rune.", bc_blue; setnpcdisplay strnpcinfo(3), HIDDEN_WARP_NPC; .getrune = 1; attachnpctimer; initnpctimer; } } end; OnTimer6000: sc_end SC_CLOAKING; sc_end SC_REGENERATION; end; OnTimer60000: .countTimer++; if(.countTimer == .respawn_time) { stopnpctimer; detachnpctimer; .rune = rand(1,5); .countTimer = .getrune = 0; if(!checkre(0)) setnpcdisplay strnpcinfo(3), .npc_view_re[.rune]; else setnpcdisplay strnpcinfo(3), .npc_view_pre[.rune]; } setnpctimer 0; end; OnInit: // ============= // Rune Settings // ============= // Rune names (in-order) setarray .Rune$[1], "Invisibility", "Haste", "Double Damage", "Illusion", "Regeneration"; // NPC View ID if server in renewal mode setarray .npc_view_re[1], 2450, 2696, 2697, 2702, 2703; // NPC View ID if server in pre-renewal mode setarray .npc_view_pre[1], 1120, 1096, 1582, 1388, 1031; // Rune effect duration (seconds) .duration = 20; // Respawn time of rune after being pick-ed up (minutes) .respawn_time = 1; // disable npc on start of server disablenpc "Rune#11"; end; } prt_are01,0,0,0 script runewar#main 100,{ OnInit: // ============= // Game Settings // ============= // How many players to start? // default = 4 (2v2) .minplayers = 4; // How long, in mins, for players to register_time // default = 3 mins .register_time = 3; // How many mins before rune is spawned // default : 1 min .runespawn = 1; // Event duration in minutes.. // default : 10 mins .duration = 10; // Reward settings setarray .rwd[0], 501, 10, // win team reward 501, 5; // lose team reward disablenpc "rwr"; setwall strnpcinfo(4), 210, 151, 4, 4, 0, "RWarWall#1"; setwall strnpcinfo(4), 89, 151, 4, 4, 0, "RWarWall#2"; bindatcmd "startrune",strnpcinfo(3)+"::OnAtCmd",0,60; end; // OnClock timers OnClock0000: OnClock0300: OnClock0600: OnClock0900: OnClock1200: OnClock1500: OnClock1800: OnClock2100: OnAtCmd: if( .start == 1 ) end; announce "[ Rune War ] : Registration will start in 3 mins.",0; sleep 6000; announce "[ Rune War ] : Registration will start in 2 mins.",0; sleep 6000; announce "[ Rune War ] : Registration will start in 1 min.",0; sleep 6000; announce "[ Rune War ] : You may now proceed to prontera if you want to join.",0; enablenpc "rwr"; announce "[ Rune War ] : Registration ends in "+ .register_time +" mins.",0; sleep .register_time * 60000; if( getvariableofnpc(.size, "rwr") < .minplayers ) { announce "[ Rune War ] : Too few players registered.",0; sleep 5000; announce "[ Rune War ] : Terminating event.",0; end; } else donpcevent "rwr::OnStart"; announce "[ Rune War ] : Rune War will start in a few moment.",0; end; OnStart: .start = 1; sleep 5000; disablenpc "rwr"; .red = bg_create ( strnpcinfo(4), 251, 149, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDie" ); .blue = bg_create ( strnpcinfo(4), 47, 149, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDie" ); callfunc "F_ShuffleNumbers", 0, getarraysize(.aid_)-1, .@r; for ( .@i = 0; .@i < getarraysize(.aid_); ++.@i ) { attachrid .aid_[.@r[.@i]]; bg_join ( .@i % 2 )? .red : .blue; } detachrid; sleep 1000; announce "Kill as much enemy as you can to earn points.", bc_npc | bc_map | bc_blue; sleep 1000; announce "Team who gains most points until event ends wins.", bc_npc | bc_map | bc_blue; sleep 1000; announce "Start battle!", bc_npc | bc_map | bc_blue; bg_warp .red, strnpcinfo(4),200,150; bg_warp .blue, strnpcinfo(4),100,150; sleep .runespawn * 60000; enablenpc "Rune#11"; donpcevent "Rune#11::OnStart"; announce "A Power Rune has spawn at the center of the map.", bc_npc | bc_map | bc_blue; sleep ( .duration - .runespawn ) * 60000; if( .redpoints > .bluepoints ) callsub L_reward, .red, .blue, "Red"; else if( .bluepoints > .redpoints ) callsub L_reward, .blue, .red, "Blue"; else if( .bluepoints = .redpoints ) announce "Battle ended up with a tie!", bc_npc | bc_map | bc_blue; mapwarp strnpcinfo(4),"prontera",150,180,0; .redpoints = .bluepoints = .start = 0; bg_updatescore strnpcinfo(4), 0, 0; bg_destroy .red; bg_destroy .blue; disablenpc "Rune#11"; end; L_reward: announce getarg(2) +" team has won!", bc_npc | bc_map | bc_blue; bg_get_data getarg(0), 1; for ( .@i = 0; .@i < $@arenamemberscount; ++.@i ) getitem .rwd[0],.rwd[1], $@arenamembers[.@i]; sleep 1; bg_get_data getarg(1), 1; for ( .@i = 0; .@i < $@arenamemberscount; ++.@i ) getitem .rwd[2],.rwd[3], $@arenamembers[.@i]; return; OnRedQuit: callsub L_Quit, .red, "Red"; OnBlueQuit: callsub L_Quit, .blue, "Blue"; L_Quit: if ( bg_get_data( getarg(0), 0 ) ) end; announce "All "+ getarg(2) +" team members has Quit!", bc_npc | bc_map | bc_blue; sleep 1000; callsub L_reward, ( getarg(0) == .red ) ? .red : .blue, ( getarg(0) == .red ) ? .blue : .red, ( getarg(0) == .red ) ? "Red" : "Blue"; awake instance_npcname( strnpcinfo(0) ); end; OnRedDie: callsub L_die, "Red"; OnBlueDie: callsub L_die, "Blue"; L_die: if( getcharid(4) == .red) ++.bluepoints; else if( getcharid(4) == .blue) ++.redpoints; bg_updatescore strnpcinfo(4), .redpoints, .bluepoints; announce getarg(0) +" team member has died!", bc_npc | bc_map | bc_blue; sleep2 1250; percentheal 100, 100; sleep2 5000; warp strnpcinfo(4), ( getcharid(4) == .red ) ? 200 : 100, 150; end; } prontera,150,185,0 script Rune War Register::rwr 100,{ .@name$ = strcharinfo(0); .@start = getvariableofnpc(.start, "runewar#main"); if(.@start == 1) { mes "Sorry, event is on-going."; close; } mes "Do you want to join the queue?"; next; while ( .aid[.@i] != getcharid(3) && .@i < .size ) ++.@i; if ( .@i < .size ) { mes "You already join the queue."; close; } select "Join"; mes "You have to stay to this map"; close2; .aid[ .size++ ] = getcharid(3); for ( .@i = 0; .@i < .size; ++.@i ) { if ( !isloggedin( .aid[.@i] ) ) { deletearray .aid[.@i], 1; --.@i; --.size; } else { attachrid .aid[.@i]; if ( strcharinfo(3) != strnpcinfo(4) ) { deletearray .aid[.@i], 1; --.@i; --.size; } } } detachrid; announce .@name$ +" has joined Rune War.", bc_npc | bc_area | bc_blue; end; OnStart: copyarray getvariableofnpc( .aid_, "runewar#main" ), .aid, .size; donpcevent "runewar#main::OnStart"; deletearray .aid; .size = 0; end; } prt_are01 mapflag battleground 2 Edited May 23, 2019 by Snoopy90 Quote
pajodex Posted May 23, 2019 Author Posted May 23, 2019 1 hour ago, Snoopy90 said: I get this error. Please help me transfer all ++ to end of the variables.. Quote .bluepoints++; .redpoints++; .@i++; Quote
Xiao Posted July 1, 2019 Posted July 1, 2019 Hello @pajodex I have error in line 238, can help please. Thanks Quote
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.