summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/custom/bgqueue/flavius.txt38
1 files changed, 19 insertions, 19 deletions
diff --git a/npc/custom/bgqueue/flavius.txt b/npc/custom/bgqueue/flavius.txt
index 45b261175..778feb55d 100644
--- a/npc/custom/bgqueue/flavius.txt
+++ b/npc/custom/bgqueue/flavius.txt
@@ -3,19 +3,20 @@
//===== By: ==================================================
//= L0ne_W0lf
//===== Current Version: =====================================
-//= 1.5
+//= 1.5b
//===== Description: =========================================
//= [AEGIS Conversion]
//= Flavius Battleground.
//= - Winning Team: 9 badges
//= - Losing Team: 3 badge
//===== Additional Comments: =================================
-//= 1.0 First Version.
-//= 1.1 Fixed pink crystal spawning as blue. [L0ne_W0lf]
-//= 1.2 Updated 'waitingroom' to support required zeny/lvl. [Kisuka]
-//= 1.3 Removed MaxLvl check in waitingrooms. Replaced setwall with setcell.
-//= 1.4 Attempt at implementing BG Queue [Ind/Hercules]
-//= 1.5 Attempt at implementing BG Queue team-algorithm [jaBote]
+//= 1.0 First Version.
+//= 1.1 Fixed pink crystal spawning as blue. [L0ne_W0lf]
+//= 1.2 Updated 'waitingroom' to support required zeny/lvl. [Kisuka]
+//= 1.3 Removed MaxLvl check in waitingrooms. Replaced setwall with setcell.
+//= 1.4 Attempt at implementing BG Queue [Ind/Hercules]
+//= 1.5 Attempt at implementing BG Queue team-algorithm [jaBote]
+//= 1.5b Adjustments to the team-splitting algorithm [Haruna]
//============================================================
@@ -47,24 +48,23 @@ OnPlayerListReady:
// Counting all participants and determining sizes, condensing .@bg_member_group
set .@nogroupcount, 0;
for (set .@i, 0; .@i < getarraysize(.@bg_member); set .@i, .@i + 1) {
+ if (.@bg_member_group[.@i] == 0) { // Just count them
+ set .@nogroupcount, .@nogroupcount + 1;
+ continue;
+ }
// check if .@bg_member_group and .@bg_member_type already exists on these groups.
- for (set .@j, 0; .@j <= getarraysize(.@bg_groups); set .@j, .@j + 1) { // <= since it has to start working even if the array is still blank
- if (.@bg_member_group[.@i] == 0) { // Just count them
- set .@nogroupcount, .@nogroupcount + 1;
- break;
- }
- else if ( (.@bg_member_group[.@i] == .@bg_groups[.@j]) && (.@bg_member_type[.@i] == .@bg_types[.@j]) ) {
+ for (set .@j, 0; .@j < getarraysize(.@bg_groups); set .@j, .@j + 1) { // <= since it has to start working even if the array is still blank
+ if ( (.@bg_member_group[.@i] == .@bg_groups[.@j]) && (.@bg_member_type[.@i] == .@bg_types[.@j]) ) {
set .@bg_count[.@j], .@bg_count[.@j] + 1;
break;
}
- else if (.@j == (getarraysize(.@bg_groups)) ) { // It isn't there, insert a new entry at j+1 since j is the last known member
- set .@bg_groups[.@j], .@bg_member_group[.@i];
- set .@bg_types[.@j], .@bg_member_type[.@i];
- set .@bg_count[.@j], 1;
- break;
- }
// Else keep running the loop until we find there's a group already made or make a new one
}
+ if (.@j == (getarraysize(.@bg_groups)) ) { // It isn't there, insert a new entry at j
+ set .@bg_groups[.@j], .@bg_member_group[.@i];
+ set .@bg_types[.@j], .@bg_member_type[.@i];
+ set .@bg_count[.@j], 1;
+ }
}
// Now, sorting the group arrays from amount of population descending! Bubble sort powers, I call upon thee!