summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/map/maps.conf1
-rw-r--r--db/constants.conf1
-rw-r--r--db/map_index.txt185
-rw-r--r--db/quest_db.conf4
-rw-r--r--maps/re/005-1-1.mcachebin0 -> 67 bytes
-rw-r--r--npc/005-1-1/_import.txt3
-rw-r--r--npc/005-1-1/main.txt413
-rw-r--r--npc/005-5/nylo.txt55
-rw-r--r--npc/_import.txt1
-rw-r--r--npc/functions/array.txt2
10 files changed, 572 insertions, 93 deletions
diff --git a/conf/map/maps.conf b/conf/map/maps.conf
index e1b961e5d..c46e1b3fa 100644
--- a/conf/map/maps.conf
+++ b/conf/map/maps.conf
@@ -41,6 +41,7 @@ map_list: (
"004-1",
"004-2-1",
"004-2",
+ "005-1-1",
"005-1",
"005-2-1",
"005-2",
diff --git a/db/constants.conf b/db/constants.conf
index 7455a42f2..f51d8913e 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -3982,6 +3982,7 @@ constants_db: {
NPC_SCORPIONKINGLANCE: 186
NPC_LIGHTBRINGER: 187
NPC_TEDDYGIRL: 188
+ NPC_CROPS: 189
// LoF Non Animated NPCs
NPC_FORTIUN: 200
diff --git a/db/map_index.txt b/db/map_index.txt
index bc9a379cb..ffcf1c19a 100644
--- a/db/map_index.txt
+++ b/db/map_index.txt
@@ -38,95 +38,96 @@
004-1 38
004-2-1 39
004-2 40
-005-1 41
-005-2-1 42
-005-2 43
-005-3 44
-005-4 45
-005-5 46
-005-6 47
-005-7 48
-006-1 49
-007-1 50
-008-0 51
-008-1 52
-008-2 53
-009-1 54
-009-2 55
-009-3 56
-009-4 57
-009-5 58
-010-1-1 59
-010-1 60
-010-2 61
-011-1 62
-011-2 63
-012-1 64
-012-2 65
-012-3 66
-012-4 67
-012-5 68
-012-6 69
-012-7 70
-014-1 71
-014-2-1 72
-014-2 73
-014-3 74
-014-4 75
-014-5 76
-015-1 77
-015-2 78
-015-3 79
-015-4 80
-015-5 81
-015-6 82
-015-7 83
-016-1 84
-016-6 85
-016-7 86
-017-1 87
-017-2-1 88
-017-2-2 89
-017-2 90
-017-3 91
-017-4 92
-017-5 93
-017-6 94
-018-1-1 95
-018-1 96
-018-2-1 97
-018-2-2 98
-018-2-3 99
-018-2-4 100
-018-2 101
-018-3 102
-018-4-1 103
-018-4-2 104
-018-4 105
-018-5 106
-019-1-1 107
-019-1 108
-019-2 109
-019-3 110
-019-4-1 111
-019-4 112
-020-1 113
-020-2 114
-020-3 115
-020-4 116
-020-5 117
-021-1 118
-021-2 119
-021-3 120
-021-4 121
-022-1 122
-023-1 123
-023-2 124
-024-1 125
-boss 126
-botcheck 127
-sec_pri 128
-soren-2 129
-soren 130
-test 131
-testbg 132
+005-1-1 41
+005-1 42
+005-2-1 43
+005-2 44
+005-3 45
+005-4 46
+005-5 47
+005-6 48
+005-7 49
+006-1 50
+007-1 51
+008-0 52
+008-1 53
+008-2 54
+009-1 55
+009-2 56
+009-3 57
+009-4 58
+009-5 59
+010-1-1 60
+010-1 61
+010-2 62
+011-1 63
+011-2 64
+012-1 65
+012-2 66
+012-3 67
+012-4 68
+012-5 69
+012-6 70
+012-7 71
+014-1 72
+014-2-1 73
+014-2 74
+014-3 75
+014-4 76
+014-5 77
+015-1 78
+015-2 79
+015-3 80
+015-4 81
+015-5 82
+015-6 83
+015-7 84
+016-1 85
+016-6 86
+016-7 87
+017-1 88
+017-2-1 89
+017-2-2 90
+017-2 91
+017-3 92
+017-4 93
+017-5 94
+017-6 95
+018-1-1 96
+018-1 97
+018-2-1 98
+018-2-2 99
+018-2-3 100
+018-2-4 101
+018-2 102
+018-3 103
+018-4-1 104
+018-4-2 105
+018-4 106
+018-5 107
+019-1-1 108
+019-1 109
+019-2 110
+019-3 111
+019-4-1 112
+019-4 113
+020-1 114
+020-2 115
+020-3 116
+020-4 117
+020-5 118
+021-1 119
+021-2 120
+021-3 121
+021-4 122
+022-1 123
+023-1 124
+023-2 125
+024-1 126
+boss 127
+botcheck 128
+sec_pri 129
+soren-2 130
+soren 131
+test 132
+testbg 133
diff --git a/db/quest_db.conf b/db/quest_db.conf
index cb2055088..5e9d9ac95 100644
--- a/db/quest_db.conf
+++ b/db/quest_db.conf
@@ -143,6 +143,10 @@ quest_db: (
Id: 42
Name: "CandorQuest_SailorCure"
},
+{
+ Id: 43
+ Name: "CandorQuest_Marggo"
+},
// ID 51 to 70: Tulimshar quests
{
diff --git a/maps/re/005-1-1.mcache b/maps/re/005-1-1.mcache
new file mode 100644
index 000000000..402aa2949
--- /dev/null
+++ b/maps/re/005-1-1.mcache
Binary files differ
diff --git a/npc/005-1-1/_import.txt b/npc/005-1-1/_import.txt
new file mode 100644
index 000000000..9430192b0
--- /dev/null
+++ b/npc/005-1-1/_import.txt
@@ -0,0 +1,3 @@
+// Map 005-1-1: Candor Island
+// This file is generated automatically. All manually added changes will be removed when running the Converter.
+"npc/005-1-1/main.txt",
diff --git a/npc/005-1-1/main.txt b/npc/005-1-1/main.txt
new file mode 100644
index 000000000..026f11647
--- /dev/null
+++ b/npc/005-1-1/main.txt
@@ -0,0 +1,413 @@
+// TMW2 Scripts
+// Author:
+// Jesusalva
+// Description:
+// Candor - Maggot Extermination Quest
+
+// Added for GonzoDark
+
+005-1-1,30,20,0 script Nylo#Marggo NPC_PLAYER,{
+ // Returns the crop ID to disable
+ // getcropid(x,y)
+ function getcropid {
+ .@x=getarg(0);
+ .@y=getarg(1);
+ .@w=12; // Width of a row
+ .@offx=23; // First X
+ .@offy=22; // First Y
+ .@i=0;
+ // 0 is: 23,22
+ // width: 35-23=12
+ // height is not relevant
+
+ // .@x / .@y
+ // .@w = 12
+ // .@i → Real value
+
+ // For each Y beyond .@offy we add .@w to i
+ .@i+=(.@y-.@offy)*.@w;
+ // Now we add any X beyond .@offx
+ .@i+=(.@x-.@offx);
+ return(sprintf("%03d", .@i))
+ }
+
+ npctalk l("Go kill the maggots!");
+ end;
+
+OnStart:
+ initnpctimer;
+ addtimer(60000, "Nylo#Marggo::OnBegin");
+ mesn;
+ mesq l("The maggots will spawn in @@ at random.", b(l("60 seconds")));
+ mes l("Read the instructions carefully.");
+ next;
+ mesn l("Time Limit");
+ mes l("Campaign starts after 60 seconds. Eight maggots will spawn on the next 100 seconds.");
+ mes l("Four minutes after the warp, or when the last maggot die, it'll be over.");
+ next;
+ mesn l("Victory Conditions");
+ mes l("If you save 80% from the crops or more, you'll get a @@.", getitemlink(RoundLeatherShield));
+ mes l("If you save 60% from the crops or more, you'll get @@ GP.", 300);
+ mes l("== If you decide to complete the quest you cannot repeat it.");
+ next;
+ mes l("Good luck!");
+ close;
+
+OnTimer10000:
+ npctalk "50 seconds!";
+ end;
+
+OnTimer20000:
+ npctalk "40 seconds!";
+ end;
+
+OnTimer30000:
+ npctalk "30 seconds!";
+ end;
+
+OnTimer40000:
+ npctalk "20 seconds!";
+ end;
+
+OnTimer50000:
+ npctalk "10 seconds!";
+ end;
+
+OnTimer55000:
+ npctalk "5 seconds!";
+ end;
+
+OnTimer60000:
+ npctalk "Start!";
+ stopnpctimer;
+ end;
+
+OnBegin:
+ // @MARGGO → (MaggotID, IsAlive)
+ // IsAlive: 1 → yes
+ @MARGGO=htnew;
+ @TOTAL_MRG=0;
+ //@DESTROY=0; // Array of all lost crops
+ // 8 maggots
+ // Minimum 80 sec
+ // Maximum 100 sec
+ addtimer(10, "Nylo#Marggo::OnSpawn");
+ addtimer(850, "Nylo#Marggo::OnInteract");
+ addtimer(180000, "Nylo#Marggo::OnFinish");
+ end;
+
+// Spawn a new maggot until eight maggots were spawn
+OnSpawn:
+ .@ID=getcharid(0);
+ .@MAP$="MRGO@"+str(.@ID);
+ @TOTAL_MRG+=1;
+ if (@TOTAL_MRG < 8)
+ addtimer(rand(10000, 12500), "Nylo#Marggo::OnSpawn");
+
+ .@mobID=areamonster(.@MAP$, 23, 22, 35, 34, l("Maggot"), Maggot, 1, "Nylo#Marggo::OnMurder");
+ htput @MARGGO, .@mobID, 1;
+ end;
+
+// Move all maggots
+OnInteract:
+ .@hti = htiterator(@MARGGO);
+ for(.@key$ = htinextkey(.@hti); hticheck(.@hti); .@key$ = htinextkey(.@hti)) {
+ .@alive=htget(@MARGGO, .@key$);
+ /*
+ if (.@alive == 2)
+ continue;
+ */
+ .@mobId=atoi(.@key$);
+ getmapxy(.@m$, .@x, .@y, UNITTYPE_MOB, .@mobId);
+
+ // Destroy the crop if needed
+ .@cropId$=getcropid(.@x, .@y);
+ if (array_find(@DESTROYED, .@cropId$) == -1) {
+ array_push(@DESTROYED, .@cropId$);
+ disablenpc instance_npcname("#Marggo"+.@cropId$);
+ }
+
+ // Tell the Maggot to walk to a random coordinate
+ // (it may walk backwards due not preserving old data)
+ // This will cause maggot to abort a counter attack and to never stop
+ // If it hits an edge, it'll start moving to the center, may cause odd behavior
+ unitstop(.@mobId);
+ if (.@x == 22 || .@y == 22 || .@x == 36 || .@y == 34)
+ unitwalk(.@mobId, 30, 30);
+ else
+ unitwalk(.@mobId, .@x+any(1, -1), .@y+any(1, -1));
+ }
+ htidelete(.@hti);
+
+ // Continue the cycle
+ if (getmap() ~= "MRGO*" || getmap() ~= "005-1-1")
+ addtimer(850, "Nylo#Marggo::OnInteract");
+ end;
+
+// A maggot was killed
+OnMurder:
+ // I don't know which one was killed, so I cycle every one until I find the dead one
+ .@hti = htiterator(@MARGGO);
+ for(.@key$ = htinextkey(.@hti); hticheck(.@hti); .@key$ = htinextkey(.@hti)) {
+ .@alive=htget(@MARGGO, .@key$);
+ /*
+ if (.@alive == 2)
+ continue;
+ */
+ .@mobId=atoi(.@key$);
+ if (getmapxy(.@m$, .@x, .@y, UNITTYPE_MOB, .@mobId) >= 0)
+ continue;
+
+ // We found the dead monster, mark it as dead and stop this meaningless loop
+ htput .@key$, 0;
+ break;
+ }
+ htidelete(.@hti);
+ if (@TOTAL_MRG >= 8) {
+ if (htsize(@MARGGO) == 0)
+ doevent("Nylo#Marggo::OnFinish");
+ }
+ end;
+
+// You killed all maggots or ran out of time
+OnFinish:
+ htdelete @MARGGO;
+ deltimer("Nylo#Marggo::OnInteract");
+ deltimer("Nylo#Marggo::OnSpawn");
+ deltimer("Nylo#Marggo::OnFinish");
+ .@trueratio=100*getarraysize(@DESTROYED)/169;
+ .@ratio=100-.@trueratio;
+ debugmes l("Player lost @@ crops", getarraysize(@DESTROYED));
+ mesn l("Nylo");
+ mes l("You managed to save @@ % of my crops!", .@ratio);
+ next;
+ if (.@ratio >= 60) {
+ inventoryplace RoundLeatherShield, 1;
+ mesc l("Complete Quest?");
+ mesc l("You won't be able to aim for a better record!");
+ if (askyesno() == ASK_YES) {
+ setq CandorQuest_Marggo, 1;
+ Zeny=Zeny+300;
+ getexp .@ratio*8/10, (.@ratio/3);
+ if (.@ratio >= 80)
+ getitem RoundLeatherShield, 1;
+ }
+ mes "";
+ }
+ mesn l("Nylo");
+ mes l("Thanks for the help!");
+ warp "Save", 0, 0;
+ close;
+
+// Cosmetic
+OnInit:
+ .@npcId = getnpcid(.name$);
+ setunitdata(.@npcId, UDT_HEADTOP, CreasedShirt);
+ setunitdata(.@npcId, UDT_HEADMIDDLE, CreasedShorts);
+ setunitdata(.@npcId, UDT_HEADBOTTOM, NPCEyes);
+ setunitdata(.@npcId, UDT_WEAPON, CandorBoots);
+ setunitdata(.@npcId, UDT_HAIRSTYLE, 26);
+ setunitdata(.@npcId, UDT_HAIRCOLOR, 0);
+
+ .sex = G_MALE;
+ .distance = 4;
+ end;
+OnInstanceInit:
+ .@npcId = getnpcid(instance_npcname(.name$));
+ setunitdata(.@npcId, UDT_HEADTOP, CreasedShirt);
+ setunitdata(.@npcId, UDT_HEADMIDDLE, CreasedShorts);
+ setunitdata(.@npcId, UDT_HEADBOTTOM, NPCEyes);
+ setunitdata(.@npcId, UDT_WEAPON, CandorBoots);
+ setunitdata(.@npcId, UDT_HAIRSTYLE, 26);
+ setunitdata(.@npcId, UDT_HAIRCOLOR, 0);
+ end;
+
+}
+
+/* python
+i=0
+x=23
+y=22
+x2=35
+y2=34
+while y <= y2:
+ print("005-1-1,%d,%d,0 script #Marggo%03d NPC_CROPS,{ end; }"% (x, y, i))
+ x+=1
+ if (x > x2):
+ x=23
+ y+=1
+ i+=1
+
+*/
+
+005-1-1,23,22,0 script #Marggo000 NPC_CROPS,{ end; }
+005-1-1,24,22,0 script #Marggo001 NPC_CROPS,{ end; }
+005-1-1,25,22,0 script #Marggo002 NPC_CROPS,{ end; }
+005-1-1,26,22,0 script #Marggo003 NPC_CROPS,{ end; }
+005-1-1,27,22,0 script #Marggo004 NPC_CROPS,{ end; }
+005-1-1,28,22,0 script #Marggo005 NPC_CROPS,{ end; }
+005-1-1,29,22,0 script #Marggo006 NPC_CROPS,{ end; }
+005-1-1,30,22,0 script #Marggo007 NPC_CROPS,{ end; }
+005-1-1,31,22,0 script #Marggo008 NPC_CROPS,{ end; }
+005-1-1,32,22,0 script #Marggo009 NPC_CROPS,{ end; }
+005-1-1,33,22,0 script #Marggo010 NPC_CROPS,{ end; }
+005-1-1,34,22,0 script #Marggo011 NPC_CROPS,{ end; }
+005-1-1,35,22,0 script #Marggo012 NPC_CROPS,{ end; }
+005-1-1,23,23,0 script #Marggo013 NPC_CROPS,{ end; }
+005-1-1,24,23,0 script #Marggo014 NPC_CROPS,{ end; }
+005-1-1,25,23,0 script #Marggo015 NPC_CROPS,{ end; }
+005-1-1,26,23,0 script #Marggo016 NPC_CROPS,{ end; }
+005-1-1,27,23,0 script #Marggo017 NPC_CROPS,{ end; }
+005-1-1,28,23,0 script #Marggo018 NPC_CROPS,{ end; }
+005-1-1,29,23,0 script #Marggo019 NPC_CROPS,{ end; }
+005-1-1,30,23,0 script #Marggo020 NPC_CROPS,{ end; }
+005-1-1,31,23,0 script #Marggo021 NPC_CROPS,{ end; }
+005-1-1,32,23,0 script #Marggo022 NPC_CROPS,{ end; }
+005-1-1,33,23,0 script #Marggo023 NPC_CROPS,{ end; }
+005-1-1,34,23,0 script #Marggo024 NPC_CROPS,{ end; }
+005-1-1,35,23,0 script #Marggo025 NPC_CROPS,{ end; }
+005-1-1,23,24,0 script #Marggo026 NPC_CROPS,{ end; }
+005-1-1,24,24,0 script #Marggo027 NPC_CROPS,{ end; }
+005-1-1,25,24,0 script #Marggo028 NPC_CROPS,{ end; }
+005-1-1,26,24,0 script #Marggo029 NPC_CROPS,{ end; }
+005-1-1,27,24,0 script #Marggo030 NPC_CROPS,{ end; }
+005-1-1,28,24,0 script #Marggo031 NPC_CROPS,{ end; }
+005-1-1,29,24,0 script #Marggo032 NPC_CROPS,{ end; }
+005-1-1,30,24,0 script #Marggo033 NPC_CROPS,{ end; }
+005-1-1,31,24,0 script #Marggo034 NPC_CROPS,{ end; }
+005-1-1,32,24,0 script #Marggo035 NPC_CROPS,{ end; }
+005-1-1,33,24,0 script #Marggo036 NPC_CROPS,{ end; }
+005-1-1,34,24,0 script #Marggo037 NPC_CROPS,{ end; }
+005-1-1,35,24,0 script #Marggo038 NPC_CROPS,{ end; }
+005-1-1,23,25,0 script #Marggo039 NPC_CROPS,{ end; }
+005-1-1,24,25,0 script #Marggo040 NPC_CROPS,{ end; }
+005-1-1,25,25,0 script #Marggo041 NPC_CROPS,{ end; }
+005-1-1,26,25,0 script #Marggo042 NPC_CROPS,{ end; }
+005-1-1,27,25,0 script #Marggo043 NPC_CROPS,{ end; }
+005-1-1,28,25,0 script #Marggo044 NPC_CROPS,{ end; }
+005-1-1,29,25,0 script #Marggo045 NPC_CROPS,{ end; }
+005-1-1,30,25,0 script #Marggo046 NPC_CROPS,{ end; }
+005-1-1,31,25,0 script #Marggo047 NPC_CROPS,{ end; }
+005-1-1,32,25,0 script #Marggo048 NPC_CROPS,{ end; }
+005-1-1,33,25,0 script #Marggo049 NPC_CROPS,{ end; }
+005-1-1,34,25,0 script #Marggo050 NPC_CROPS,{ end; }
+005-1-1,35,25,0 script #Marggo051 NPC_CROPS,{ end; }
+005-1-1,23,26,0 script #Marggo052 NPC_CROPS,{ end; }
+005-1-1,24,26,0 script #Marggo053 NPC_CROPS,{ end; }
+005-1-1,25,26,0 script #Marggo054 NPC_CROPS,{ end; }
+005-1-1,26,26,0 script #Marggo055 NPC_CROPS,{ end; }
+005-1-1,27,26,0 script #Marggo056 NPC_CROPS,{ end; }
+005-1-1,28,26,0 script #Marggo057 NPC_CROPS,{ end; }
+005-1-1,29,26,0 script #Marggo058 NPC_CROPS,{ end; }
+005-1-1,30,26,0 script #Marggo059 NPC_CROPS,{ end; }
+005-1-1,31,26,0 script #Marggo060 NPC_CROPS,{ end; }
+005-1-1,32,26,0 script #Marggo061 NPC_CROPS,{ end; }
+005-1-1,33,26,0 script #Marggo062 NPC_CROPS,{ end; }
+005-1-1,34,26,0 script #Marggo063 NPC_CROPS,{ end; }
+005-1-1,35,26,0 script #Marggo064 NPC_CROPS,{ end; }
+005-1-1,23,27,0 script #Marggo065 NPC_CROPS,{ end; }
+005-1-1,24,27,0 script #Marggo066 NPC_CROPS,{ end; }
+005-1-1,25,27,0 script #Marggo067 NPC_CROPS,{ end; }
+005-1-1,26,27,0 script #Marggo068 NPC_CROPS,{ end; }
+005-1-1,27,27,0 script #Marggo069 NPC_CROPS,{ end; }
+005-1-1,28,27,0 script #Marggo070 NPC_CROPS,{ end; }
+005-1-1,29,27,0 script #Marggo071 NPC_CROPS,{ end; }
+005-1-1,30,27,0 script #Marggo072 NPC_CROPS,{ end; }
+005-1-1,31,27,0 script #Marggo073 NPC_CROPS,{ end; }
+005-1-1,32,27,0 script #Marggo074 NPC_CROPS,{ end; }
+005-1-1,33,27,0 script #Marggo075 NPC_CROPS,{ end; }
+005-1-1,34,27,0 script #Marggo076 NPC_CROPS,{ end; }
+005-1-1,35,27,0 script #Marggo077 NPC_CROPS,{ end; }
+005-1-1,23,28,0 script #Marggo078 NPC_CROPS,{ end; }
+005-1-1,24,28,0 script #Marggo079 NPC_CROPS,{ end; }
+005-1-1,25,28,0 script #Marggo080 NPC_CROPS,{ end; }
+005-1-1,26,28,0 script #Marggo081 NPC_CROPS,{ end; }
+005-1-1,27,28,0 script #Marggo082 NPC_CROPS,{ end; }
+005-1-1,28,28,0 script #Marggo083 NPC_CROPS,{ end; }
+005-1-1,29,28,0 script #Marggo084 NPC_CROPS,{ end; }
+005-1-1,30,28,0 script #Marggo085 NPC_CROPS,{ end; }
+005-1-1,31,28,0 script #Marggo086 NPC_CROPS,{ end; }
+005-1-1,32,28,0 script #Marggo087 NPC_CROPS,{ end; }
+005-1-1,33,28,0 script #Marggo088 NPC_CROPS,{ end; }
+005-1-1,34,28,0 script #Marggo089 NPC_CROPS,{ end; }
+005-1-1,35,28,0 script #Marggo090 NPC_CROPS,{ end; }
+005-1-1,23,29,0 script #Marggo091 NPC_CROPS,{ end; }
+005-1-1,24,29,0 script #Marggo092 NPC_CROPS,{ end; }
+005-1-1,25,29,0 script #Marggo093 NPC_CROPS,{ end; }
+005-1-1,26,29,0 script #Marggo094 NPC_CROPS,{ end; }
+005-1-1,27,29,0 script #Marggo095 NPC_CROPS,{ end; }
+005-1-1,28,29,0 script #Marggo096 NPC_CROPS,{ end; }
+005-1-1,29,29,0 script #Marggo097 NPC_CROPS,{ end; }
+005-1-1,30,29,0 script #Marggo098 NPC_CROPS,{ end; }
+005-1-1,31,29,0 script #Marggo099 NPC_CROPS,{ end; }
+005-1-1,32,29,0 script #Marggo100 NPC_CROPS,{ end; }
+005-1-1,33,29,0 script #Marggo101 NPC_CROPS,{ end; }
+005-1-1,34,29,0 script #Marggo102 NPC_CROPS,{ end; }
+005-1-1,35,29,0 script #Marggo103 NPC_CROPS,{ end; }
+005-1-1,23,30,0 script #Marggo104 NPC_CROPS,{ end; }
+005-1-1,24,30,0 script #Marggo105 NPC_CROPS,{ end; }
+005-1-1,25,30,0 script #Marggo106 NPC_CROPS,{ end; }
+005-1-1,26,30,0 script #Marggo107 NPC_CROPS,{ end; }
+005-1-1,27,30,0 script #Marggo108 NPC_CROPS,{ end; }
+005-1-1,28,30,0 script #Marggo109 NPC_CROPS,{ end; }
+005-1-1,29,30,0 script #Marggo110 NPC_CROPS,{ end; }
+005-1-1,30,30,0 script #Marggo111 NPC_CROPS,{ end; }
+005-1-1,31,30,0 script #Marggo112 NPC_CROPS,{ end; }
+005-1-1,32,30,0 script #Marggo113 NPC_CROPS,{ end; }
+005-1-1,33,30,0 script #Marggo114 NPC_CROPS,{ end; }
+005-1-1,34,30,0 script #Marggo115 NPC_CROPS,{ end; }
+005-1-1,35,30,0 script #Marggo116 NPC_CROPS,{ end; }
+005-1-1,23,31,0 script #Marggo117 NPC_CROPS,{ end; }
+005-1-1,24,31,0 script #Marggo118 NPC_CROPS,{ end; }
+005-1-1,25,31,0 script #Marggo119 NPC_CROPS,{ end; }
+005-1-1,26,31,0 script #Marggo120 NPC_CROPS,{ end; }
+005-1-1,27,31,0 script #Marggo121 NPC_CROPS,{ end; }
+005-1-1,28,31,0 script #Marggo122 NPC_CROPS,{ end; }
+005-1-1,29,31,0 script #Marggo123 NPC_CROPS,{ end; }
+005-1-1,30,31,0 script #Marggo124 NPC_CROPS,{ end; }
+005-1-1,31,31,0 script #Marggo125 NPC_CROPS,{ end; }
+005-1-1,32,31,0 script #Marggo126 NPC_CROPS,{ end; }
+005-1-1,33,31,0 script #Marggo127 NPC_CROPS,{ end; }
+005-1-1,34,31,0 script #Marggo128 NPC_CROPS,{ end; }
+005-1-1,35,31,0 script #Marggo129 NPC_CROPS,{ end; }
+005-1-1,23,32,0 script #Marggo130 NPC_CROPS,{ end; }
+005-1-1,24,32,0 script #Marggo131 NPC_CROPS,{ end; }
+005-1-1,25,32,0 script #Marggo132 NPC_CROPS,{ end; }
+005-1-1,26,32,0 script #Marggo133 NPC_CROPS,{ end; }
+005-1-1,27,32,0 script #Marggo134 NPC_CROPS,{ end; }
+005-1-1,28,32,0 script #Marggo135 NPC_CROPS,{ end; }
+005-1-1,29,32,0 script #Marggo136 NPC_CROPS,{ end; }
+005-1-1,30,32,0 script #Marggo137 NPC_CROPS,{ end; }
+005-1-1,31,32,0 script #Marggo138 NPC_CROPS,{ end; }
+005-1-1,32,32,0 script #Marggo139 NPC_CROPS,{ end; }
+005-1-1,33,32,0 script #Marggo140 NPC_CROPS,{ end; }
+005-1-1,34,32,0 script #Marggo141 NPC_CROPS,{ end; }
+005-1-1,35,32,0 script #Marggo142 NPC_CROPS,{ end; }
+005-1-1,23,33,0 script #Marggo143 NPC_CROPS,{ end; }
+005-1-1,24,33,0 script #Marggo144 NPC_CROPS,{ end; }
+005-1-1,25,33,0 script #Marggo145 NPC_CROPS,{ end; }
+005-1-1,26,33,0 script #Marggo146 NPC_CROPS,{ end; }
+005-1-1,27,33,0 script #Marggo147 NPC_CROPS,{ end; }
+005-1-1,28,33,0 script #Marggo148 NPC_CROPS,{ end; }
+005-1-1,29,33,0 script #Marggo149 NPC_CROPS,{ end; }
+005-1-1,30,33,0 script #Marggo150 NPC_CROPS,{ end; }
+005-1-1,31,33,0 script #Marggo151 NPC_CROPS,{ end; }
+005-1-1,32,33,0 script #Marggo152 NPC_CROPS,{ end; }
+005-1-1,33,33,0 script #Marggo153 NPC_CROPS,{ end; }
+005-1-1,34,33,0 script #Marggo154 NPC_CROPS,{ end; }
+005-1-1,35,33,0 script #Marggo155 NPC_CROPS,{ end; }
+005-1-1,23,34,0 script #Marggo156 NPC_CROPS,{ end; }
+005-1-1,24,34,0 script #Marggo157 NPC_CROPS,{ end; }
+005-1-1,25,34,0 script #Marggo158 NPC_CROPS,{ end; }
+005-1-1,26,34,0 script #Marggo159 NPC_CROPS,{ end; }
+005-1-1,27,34,0 script #Marggo160 NPC_CROPS,{ end; }
+005-1-1,28,34,0 script #Marggo161 NPC_CROPS,{ end; }
+005-1-1,29,34,0 script #Marggo162 NPC_CROPS,{ end; }
+005-1-1,30,34,0 script #Marggo163 NPC_CROPS,{ end; }
+005-1-1,31,34,0 script #Marggo164 NPC_CROPS,{ end; }
+005-1-1,32,34,0 script #Marggo165 NPC_CROPS,{ end; }
+005-1-1,33,34,0 script #Marggo166 NPC_CROPS,{ end; }
+005-1-1,34,34,0 script #Marggo167 NPC_CROPS,{ end; }
+005-1-1,35,34,0 script #Marggo168 NPC_CROPS,{ end; }
+
+
diff --git a/npc/005-5/nylo.txt b/npc/005-5/nylo.txt
index 73755c83e..701501304 100644
--- a/npc/005-5/nylo.txt
+++ b/npc/005-5/nylo.txt
@@ -138,11 +138,13 @@
speech S_LAST_BLANK_LINE,
l("Visiting the bank too right? We're only a small village but Cynric is the best bank guy I know.");
+ .@q=getq(CandorQuest_Marggo);
do
{
select
l("Yeah, you're right."),
l("You store a large collection of goods. Could you perhaps sell me some?"),
+ rif(!.@q,l("What do you for a living?")),
l("What is banking?");
switch (@menu)
{
@@ -152,6 +154,9 @@
openshop "Nylo#Beer";
break;
case 3:
+ goto L_Main;
+ break;
+ case 4:
nylo_explain;
break;
}
@@ -161,6 +166,56 @@
goodbye;
close;
+L_Main:
+ mesn;
+ mesq l("Well, for a living, I usually tend to the crops.");
+ next;
+ mesn;
+ mes l("I raise them, water them, and then sell them.");
+ mes l("I also brew some of the crops, making Beer. And then I sell to adventurers!");
+ if (BaseLevel < 6)
+ close;
+ next;
+ mesn;
+ mes l("Well, you're an adventurer, and I guess tending to crops isn't your cup of tea.");
+ mes l("But maybe you could help me killing a few maggots?");
+ next;
+ mesn;
+ mes l("Eight Maggots will rinse from the ground and will start destroying the crops.");
+ mes l("You must kill them before the crops are gone. I'll reward you, of course.");
+ next;
+ mesn;
+ mesq l("Interested?");
+ if (askyesno() == ASK_NO) {
+ mes "";
+ mesn;
+ mesq l("Heh. Fair enough.");
+ close;
+ }
+
+ .@ID=getcharid(0);
+ .@MAP$="MRGO@"+str(.@ID);
+
+ // Create the Marggo
+ .@INSTID = instance_create("MRGX@"+(.@ID), 0, IOT_NONE);
+ // Instance already exists
+ if (.@INSTID < 0) {
+ mesn;
+ mesq l("Wait. I remember you. You ruined my crops a few seconds ago!!");
+ next;
+ mesn;
+ mesq l("Shooo, shooo! Give my crops some time to recover, your noob.");
+ close;
+ }
+ // It was just created, so begin Marggo Quest
+ .@instanceMapName$ = instance_attachmap("005-1-1", .@INSTID, 0, .@MAP$);
+ instance_set_timeout(300, 300, .@INSTID);
+ instance_init(.@INSTID);
+ warp .@MAP$, 29, 20;
+ doevent("Nylo#Marggo::OnStart");
+ closeclientdialog;
+ close;
+
OnInit:
.@npcId = getnpcid(.name$);
//setunitdata(.@npcId, UDT_HEADMIDDLE, 1321); // Maybe Nylo could use the whole Candor set...
diff --git a/npc/_import.txt b/npc/_import.txt
index b7b068a12..46e71f2e7 100644
--- a/npc/_import.txt
+++ b/npc/_import.txt
@@ -40,6 +40,7 @@
@include "npc/004-1/_import.txt"
@include "npc/004-2-1/_import.txt"
@include "npc/004-2/_import.txt"
+@include "npc/005-1-1/_import.txt"
@include "npc/005-1/_import.txt"
@include "npc/005-2-1/_import.txt"
@include "npc/005-2/_import.txt"
diff --git a/npc/functions/array.txt b/npc/functions/array.txt
index 0db396ce4..1a106175e 100644
--- a/npc/functions/array.txt
+++ b/npc/functions/array.txt
@@ -298,7 +298,7 @@ function script array_pop {
}
-
+// TODO: Rename to array_append >.<
// array_push(<array>, <value>)
// adds <value> to the end of the array
// returns the new size