summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/custom/bgqueue/flavius.txt100
-rw-r--r--npc/instances/EndlessTower.txt8
-rw-r--r--npc/other/hugel_bingo.txt2
-rw-r--r--npc/other/turbo_track.txt2
-rw-r--r--npc/quests/first_class/tu_acolyte.txt2
-rw-r--r--npc/quests/quests_ein.txt4
-rw-r--r--npc/quests/quests_juperos.txt2
-rw-r--r--npc/quests/quests_moscovia.txt2
-rw-r--r--npc/quests/thana_quest.txt4
-rw-r--r--npc/re/merchants/refine.txt14
-rw-r--r--npc/re/quests/eden/86-90.txt2
-rw-r--r--npc/re/quests/eden/91-99.txt2
-rw-r--r--npc/re/quests/quests_dicastes.txt2
-rw-r--r--npc/re/quests/quests_malangdo.txt2
14 files changed, 108 insertions, 40 deletions
diff --git a/npc/custom/bgqueue/flavius.txt b/npc/custom/bgqueue/flavius.txt
index b3db9f81d..778feb55d 100644
--- a/npc/custom/bgqueue/flavius.txt
+++ b/npc/custom/bgqueue/flavius.txt
@@ -3,18 +3,20 @@
//===== By: ==================================================
//= L0ne_W0lf
//===== Current Version: =====================================
-//= 1.4
+//= 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.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]
//============================================================
@@ -36,20 +38,86 @@ OnPlayerListReady:
queueopt($@Guill_QueueBG1,HQO_OnLogout,"start#bat_b01::OnGuillaumeQuit");
queueopt($@Croix_QueueBG1,HQO_OnLogout,"start#bat_b01::OnCroixQuit");
- set .@it,queueiterator($@bg_queue_id);
set .@i, 0;
- for( set .@member, qiget(.@it); qicheck(.@it); set .@member,qiget(.@it) ) {
- if( .@i % 2 == 0 ) {
- bg_join_team($@FlaviusBG1_id1,.@member);
- queueadd($@Guill_QueueBG1,.@member);
- } else {
- bg_join_team($@FlaviusBG1_id2,.@member);
- queueadd($@Croix_QueueBG1,.@member);
+ copyarray .@bg_member[0],$@bg_member[0],$@bg_member_size;
+ copyarray .@bg_member_group[0],$@bg_member_group[0],$@bg_member_size;
+ copyarray .@bg_member_type[0],$@bg_member_type[0],$@bg_member_size;
+
+ freeloop(1);
+ // 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] == .@bg_groups[.@j]) && (.@bg_member_type[.@i] == .@bg_types[.@j]) ) {
+ set .@bg_count[.@j], .@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!
+ // Type doesn't matter here for precedence checks, but also needs to be sorted the same way along with groups
+ for (set .@i, 0; .@i < getarraysize(.@bg_groups); set .@i, .@i + 1) {
+ for (set .@j, 0; .@j < (getarraysize(.@bg_groups) - .@i); set .@j, .@j + 1) {
+ if (.@bg_count[.@j] < .@bg_count[.@j+1]){
+ set .@temp1, .@bg_groups[.@j];
+ set .@temp2, .@bg_types[.@j];
+ set .@temp3, .@bg_count[.@j];
+ set .@bg_groups[.@j], .@bg_groups[.@j+1];
+ set .@bg_types[.@j], .@bg_types[.@j+1];
+ set .@bg_count[.@j], .@bg_count[.@j+1];
+ set .@bg_groups[.@j+1], .@temp1;
+ set .@bg_types[.@j+1], .@temp2;
+ set .@bg_count[.@j+1], .@temp3;
+ }
+ }
+ }
+
+ // Add the groups to the queues! :D
+ for (set .@i, 0; .@i < getarraysize(.@bg_groups); set .@i, .@i + 1){
+ if (queuesize($@Croix_QueueBG1) <= queuesize($@Guill_QueueBG1)){ // Catch'em all and add to the queue!
+ for (set .@j, 0; .@j < getarraysize(.@bg_member); set .@j, .@j + 1) {
+ if ( (.@bg_groups[.@i] == .@bg_member_group[.@j]) && (.@bg_types[.@i] == .@bg_member_type[.@j]) ) {
+ bg_join_team($@FlaviusBG1_id1,.@bg_member[.@j]);
+ queueadd($@Croix_QueueBG1, .@bg_member[.@j]);
+ }
+ }
+ }
+ else {
+ for (set .@j, 0; .@j < getarraysize(.@bg_member); set .@j, .@j + 1) {
+ if ( (.@bg_groups[.@i] == .@bg_member_group[.@j]) && (.@bg_types[.@i] == .@bg_member_type[.@j]) ) {
+ bg_join_team($@FlaviusBG1_id2,.@bg_member[.@j]);
+ queueadd($@Guill_QueueBG1, .@bg_member[.@j]);
+ }
+ }
+ }
+ }
+ // Don't forget the people that go on their own!
+ for (set .@i, 0; .@i <= getarraysize(.@bg_member); set .@i, .@i+1) {
+ if (.@bg_member_group[.@i] == 0) { // Get alone people only
+ if (queuesize($@Croix_QueueBG1) <= queuesize($@Guill_QueueBG1)) {
+ bg_join_team($@FlaviusBG1_id1,.@bg_member[.@i]);
+ queueadd($@Croix_QueueBG1, .@bg_member[.@i]);
+ }
+ else {
+ bg_join_team($@FlaviusBG1_id2,.@bg_member[.@i]);
+ queueadd($@Guill_QueueBG1, .@bg_member[.@i]);
+ }
}
- set .@i,.@i + 1;
}
- qiclear(.@it);
+ freeloop(0);
set $@FlaviusBG1, 1;
set $@FlaviusBG1_Victory, 0;
diff --git a/npc/instances/EndlessTower.txt b/npc/instances/EndlessTower.txt
index 7d1bee6aa..e39cfbbff 100644
--- a/npc/instances/EndlessTower.txt
+++ b/npc/instances/EndlessTower.txt
@@ -1252,7 +1252,7 @@ OnTimer5000:
end;
}
-1@tower,12,393,0 script 1FGate102tower 45,2,2,{
+1@tower,12,393,0 script 1FGate102tower WARPNPC,2,2,{
end;
OnInstanceInit:
@@ -1323,7 +1323,7 @@ L_Display:
1@tower,184,51,0 duplicate(1FGate102tower) 23FGate102tower WARPNPC,2,2
1@tower,270,51,0 duplicate(1FGate102tower) 24FGate102tower WARPNPC,2,2
-1@tower,355,51,0 script 25FGate102tower 45,2,2,{
+1@tower,355,51,0 script 25FGate102tower WARPNPC,2,2,{
end;
OnInstanceInit:
@@ -1347,7 +1347,7 @@ OnTimer120000:
end;
}
-1@tower,355,51,0 script 25FGate102tower-2 45,2,2,{
+1@tower,355,51,0 script 25FGate102tower-2 WARPNPC,2,2,{
end;
OnInstanceInit:
@@ -2244,4 +2244,4 @@ OnTimer1000:
stopnpctimer;
donpcevent instance_npcname("#Effect30")+"::OnEnable";
end;
-} \ No newline at end of file
+}
diff --git a/npc/other/hugel_bingo.txt b/npc/other/hugel_bingo.txt
index 2bd8f1d55..0a47b4f00 100644
--- a/npc/other/hugel_bingo.txt
+++ b/npc/other/hugel_bingo.txt
@@ -276,7 +276,7 @@ OnTimer460000:
end;
}
-que_bingo,49,125,0 script 1a#bingo 139,1,1,{
+que_bingo,49,125,0 script 1a#bingo HIDDEN_WARP_NPC,1,1,{
end;
OnInit:
diff --git a/npc/other/turbo_track.txt b/npc/other/turbo_track.txt
index b135cd093..dea910aa3 100644
--- a/npc/other/turbo_track.txt
+++ b/npc/other/turbo_track.txt
@@ -1918,7 +1918,7 @@ turbo_n_1,222,45,0 duplicate(TurboHint_4#tt_main) #n1NoWayOut5 -1,1,1
turbo_n_1,222,61,0 duplicate(TurboHint_4#tt_main) #n1NoWayOut6 -1,1,1
turbo_n_1,222,65,0 duplicate(TurboHint_4#tt_main) #n1NoWayOut7 -1,1,1
-- script cos_end#tt_main 01,{
+- script cos_end#tt_main -1,{
function GetNumber;
OnTouch:
set .@w$,callfunc("F_tt");
diff --git a/npc/quests/first_class/tu_acolyte.txt b/npc/quests/first_class/tu_acolyte.txt
index fde13dbae..c788462bd 100644
--- a/npc/quests/first_class/tu_acolyte.txt
+++ b/npc/quests/first_class/tu_acolyte.txt
@@ -1778,7 +1778,7 @@ prt_monk,223,123,3 script Eavesdrop#tu HIDDEN_NPC,{
}
}
-sec_in02,17,156,3 script 1st Job Quest Reset 726,{
+sec_in02,17,156,3 script 1st Job Quest Reset 4_F_JOB_BLACKSMITH,{
callfunc "F_GM_NPC";
mes "[1st Job Quest]";
mes "Which would you like to reset?";
diff --git a/npc/quests/quests_ein.txt b/npc/quests/quests_ein.txt
index 243c47fc7..51d7e5869 100644
--- a/npc/quests/quests_ein.txt
+++ b/npc/quests/quests_ein.txt
@@ -4073,7 +4073,7 @@ ein_in01,67,242,3 script Zelmeto 4_M_REPAIR,{
}
}
-ein_in01,49,232,3 script 2nd Control Panel#ins 111,{
+ein_in01,49,232,3 script 2nd Control Panel#ins HIDDEN_NPC,{
if ((EinFactory == 1) || (EinFactory == 2)) {
changequest 8017,8018;
set EinFactory,2;
@@ -4088,7 +4088,7 @@ ein_in01,49,232,3 script 2nd Control Panel#ins 111,{
end;
}
-ein_in01,108,217,3 script 3rd Pressure Governor#1 111,{
+ein_in01,108,217,3 script 3rd Pressure Governor#1 HIDDEN_NPC,{
if ((EinFactory == 3) || (EinFactory == 4)) {
changequest 8019,8020;
set EinFactory,4;
diff --git a/npc/quests/quests_juperos.txt b/npc/quests/quests_juperos.txt
index b46c8a82c..3c51ead24 100644
--- a/npc/quests/quests_juperos.txt
+++ b/npc/quests/quests_juperos.txt
@@ -4904,7 +4904,7 @@ OnTimer26000:
donpcevent "GuardEnd#ufe::OnDisable";
}
-jupe_ele,41,33,0 script 4F Enter#ufe 45,4,4,{
+jupe_ele,41,33,0 script 4F Enter#ufe WARPNPC,4,4,{
OnInit:
disablenpc "4F Enter#ufe";
end;
diff --git a/npc/quests/quests_moscovia.txt b/npc/quests/quests_moscovia.txt
index 6f00c6e7c..d868926b6 100644
--- a/npc/quests/quests_moscovia.txt
+++ b/npc/quests/quests_moscovia.txt
@@ -9298,7 +9298,7 @@ moc_pryd04,126,120,0 script Soldier#rus26 4_M_RUSMAN1,{
//----------------------------------------------------------------------------
// Marozka's Dungeon (Golden Thread)
//----------------------------------------------------------------------------
-mosk_dun01,45,250,3 script 1#rus27 45,3,3,{
+mosk_dun01,45,250,3 script 1#rus27 WARPNPC,3,3,{
end;
OnTouch:
warp "mosk_que",49,22;
diff --git a/npc/quests/thana_quest.txt b/npc/quests/thana_quest.txt
index bb70a4166..8aebaae31 100644
--- a/npc/quests/thana_quest.txt
+++ b/npc/quests/thana_quest.txt
@@ -868,7 +868,7 @@ L_Request:
return;
}
-tha_t02,227,163,0 script 3rdf_warp#tt 45,1,1,{
+tha_t02,227,163,0 script 3rdf_warp#tt WARPNPC,1,1,{
end;
OnInit:
disablenpc "3rdf_warp#tt";
@@ -2310,4 +2310,4 @@ OnTouch:
}
mes "A mysterious power is blocking my path.";
close;
-} \ No newline at end of file
+}
diff --git a/npc/re/merchants/refine.txt b/npc/re/merchants/refine.txt
index fa1853520..fa5bab042 100644
--- a/npc/re/merchants/refine.txt
+++ b/npc/re/merchants/refine.txt
@@ -102,10 +102,10 @@ function script refinenew {
set .@material,6224; //Bradium
set .@price,100000;
switch(getequipweaponlv(.@part)) {
- case 1: set .@safe,17; break;
- case 2: set .@safe,16; break;
- case 3: set .@safe,15; break;
- case 4: set .@safe,14; break;
+ case 1: set .@safe,10; break;
+ case 2: set .@safe,10; break;
+ case 3: set .@safe,10; break;
+ case 4: set .@safe,10; break;
}
mes "["+ getarg(0) +"]";
mes "Hmm a weapon, is that ok?";
@@ -115,7 +115,7 @@ function script refinenew {
set .@type$,"armor";
set .@material,6223; //Carnium
set .@price,100000;
- set .@safe,14;
+ set .@safe,10;
mes "["+ getarg(0) +"]";
mes "Hmm an armor, is that ok?";
mes "If you want to refine this armor,";
@@ -187,7 +187,7 @@ function script refinenew {
if (rand(100) < 80) {
mes "["+ getarg(0) +"]";
mes "Clang! Clang! Clang! Clang!";
- downrefitem .@part;
+ downrefitem .@part, 3; // Failed refine attempts decrease the item's refine level by 3
next;
emotion (!rand(5))?e_cash:e_omg;
mes "["+ getarg(0) +"]";
@@ -296,7 +296,7 @@ function script refinenew {
if (rand(100) < 80) {
mes "["+ getarg(0) +"]";
mes "Clang! Clang! Clang! Clang!";
- downrefitem .@part;
+ downrefitem .@part, 3; // Failed refine attempts decrease the item's refine level by 3
next;
emotion (!rand(5))?e_cash:e_omg;
mes "["+ getarg(0) +"]";
diff --git a/npc/re/quests/eden/86-90.txt b/npc/re/quests/eden/86-90.txt
index 60bbac0e2..1fced3a16 100644
--- a/npc/re/quests/eden/86-90.txt
+++ b/npc/re/quests/eden/86-90.txt
@@ -13,7 +13,7 @@
//= 1.3 Updated to match the official script. [Euphy]
//============================================================
-moc_para01,48,175,3 script 4_M_04-90 Mission Board 857,{
+moc_para01,48,175,3 script 4_M_04-90 Mission Board 4_BOARD3,{
if (countitem(6219) < 1) {
mes "Wait a minute!";
mes "-You need to have an-";
diff --git a/npc/re/quests/eden/91-99.txt b/npc/re/quests/eden/91-99.txt
index 0c3c6b12f..62a6512f6 100644
--- a/npc/re/quests/eden/91-99.txt
+++ b/npc/re/quests/eden/91-99.txt
@@ -13,7 +13,7 @@
//= 1.3 Updated to match the official script. [Euphy]
//============================================================
-moc_para01,48,177,3 script 4_F_02-99 Mission Board 857,{
+moc_para01,48,177,3 script 4_F_02-99 Mission Board 4_BOARD3,{
if (countitem(6219) < 1) {
mes "Wait a minute!";
mes "-You need to have an-";
diff --git a/npc/re/quests/quests_dicastes.txt b/npc/re/quests/quests_dicastes.txt
index 020aff699..9375cf27b 100644
--- a/npc/re/quests/quests_dicastes.txt
+++ b/npc/re/quests/quests_dicastes.txt
@@ -436,7 +436,7 @@ dic_in01,254,119,0 script Item Storage#01 CLEAR_NPC,{
end;
}
-sec_in02,10,42,1 script 13.3 Related Reset 449,{
+sec_in02,10,42,1 script 13.3 Related Reset 4_MAN_BENKUNI,{
callfunc "F_GM_NPC";
mes "[Reset]";
mes "Resets all quest windows including daily and map quests for 13.3.";
diff --git a/npc/re/quests/quests_malangdo.txt b/npc/re/quests/quests_malangdo.txt
index ea03d66bb..62b356c23 100644
--- a/npc/re/quests/quests_malangdo.txt
+++ b/npc/re/quests/quests_malangdo.txt
@@ -2468,7 +2468,7 @@ OnTouch:
close;
}
-malangdo,246,184,0 script 1st Rate Point 111,{
+malangdo,246,184,0 script 1st Rate Point HIDDEN_NPC,{
if (checkweight(1201,1) == 0) {
mes " - Notice !! -";
mes " - Since you have too many items - ";