summaryrefslogtreecommitdiff
path: root/npc/custom/bgqueue
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-11-06 21:18:12 -0200
committershennetsind <ind@henn.et>2013-11-06 21:18:12 -0200
commit3a3d2297068809d25ca43e19fd2977f97b2728f5 (patch)
tree4a64ef7d311234e950d513759c1510a0e00979d0 /npc/custom/bgqueue
parent64c527880562311c1e5a8b69d67337a0b6838d35 (diff)
downloadhercules-3a3d2297068809d25ca43e19fd2977f97b2728f5.tar.gz
hercules-3a3d2297068809d25ca43e19fd2977f97b2728f5.tar.bz2
hercules-3a3d2297068809d25ca43e19fd2977f97b2728f5.tar.xz
hercules-3a3d2297068809d25ca43e19fd2977f97b2728f5.zip
Follow up eaf04b9a2f0b399027df251c5d19d58d74e24e6a
Adjustments to the team-splitting algorithm Thanks to Haruna! Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'npc/custom/bgqueue')
-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!