summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-03-26 00:34:18 -0300
committerJesusaves <cpntb1@ymail.com>2018-03-26 00:34:18 -0300
commit35056b7702f0f21f84d4d16f15e807a545a34b54 (patch)
tree6a3af4856214e60cb96be6faac9d11260f91feda
parent9d2fd73cef8de24d03121bdde2fd4fb3b803a2f9 (diff)
parent7233ced3d5edaf1799e7bf5fa2961111128b9e5d (diff)
downloadserverdata-jesusalva/fishing.tar.gz
serverdata-jesusalva/fishing.tar.bz2
serverdata-jesusalva/fishing.tar.xz
serverdata-jesusalva/fishing.zip
Merge branch 'master' into jesusalva/fishingjesusalva/fishing
-rwxr-xr-x.tools/scripts/init.sh2
-rw-r--r--npc/001-1/manhole.txt16
-rw-r--r--npc/001-1/salem.txt2
-rw-r--r--npc/001-1/xilaxa.txt28
-rw-r--r--npc/001-2-19/lloyd.txt4
-rw-r--r--npc/001-2-4/books.txt6
-rw-r--r--npc/001-2-6/books.txt339
-rw-r--r--npc/008-1/confused-tree.txt2
-rw-r--r--npc/_anchors.txt33
-rw-r--r--npc/_import.txt1
-rw-r--r--npc/commands/warp.txt96
-rw-r--r--npc/functions/doors.txt7
-rw-r--r--npc/functions/game-rules.txt6
-rw-r--r--npc/functions/goodbye.txt138
-rw-r--r--npc/functions/openbook.txt18
-rw-r--r--npc/functions/shops.txt11
-rw-r--r--npc/functions/warp.txt48
-rw-r--r--npc/scripts.conf1
-rw-r--r--sql-files/main.sql4
-rw-r--r--sql-files/upgrades/2018-02-26--15-57.sql6
-rw-r--r--sql-files/upgrades/index.txt1
21 files changed, 435 insertions, 334 deletions
diff --git a/.tools/scripts/init.sh b/.tools/scripts/init.sh
index 6effb177..d6af8a5b 100755
--- a/.tools/scripts/init.sh
+++ b/.tools/scripts/init.sh
@@ -156,7 +156,7 @@ function do_init_data {
mkdir shared
cd ..
rm -rf server-data
- cp -r serverdata server-data
+ cp -r ${CI_PROJECT_NAME:=serverdata} server-data
ls -la server-data
check_error $?
}
diff --git a/npc/001-1/manhole.txt b/npc/001-1/manhole.txt
index f2bae5f0..77616cf1 100644
--- a/npc/001-1/manhole.txt
+++ b/npc/001-1/manhole.txt
@@ -20,11 +20,9 @@
l("..."),
l("Do you want to enter in sewer?"));
- if (askyesno() == 1) {
- cwarp("001-3-0", 152, 56);
- }
-
- bye;
+ closeclientdialog();
+ if (askyesno() == 1) slide_or_warp("001-3-0", 152, 56);
+ close;
OnInit:
.sex = G_OTHER;
@@ -43,11 +41,9 @@ OnInit:
l("..."),
l("Do you want to enter in sewer?"));
- if (askyesno() == 1) {
- cwarp("001-3-0", 196, 36);
- }
-
- bye;
+ closeclientdialog();
+ if (askyesno() == 1) slide_or_warp("001-3-0", 196, 36);
+ close;
OnInit:
.sex = G_OTHER;
diff --git a/npc/001-1/salem.txt b/npc/001-1/salem.txt
index cb6dfb69..c8ea3ab8 100644
--- a/npc/001-1/salem.txt
+++ b/npc/001-1/salem.txt
@@ -146,7 +146,7 @@ L_SalemMenuShop:
L_AboutPious:
speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
- l("Ah, the locals like keeping them as pets.");
+ l("Ah, the locals like keeping them as pets."),
l("With proper training, a piou can become a good friend and faithful companion in your adventures.");
if (getq(ArtisQuests_CatchPiou) >= 2)
diff --git a/npc/001-1/xilaxa.txt b/npc/001-1/xilaxa.txt
index 5b7ec398..f6f1189c 100644
--- a/npc/001-1/xilaxa.txt
+++ b/npc/001-1/xilaxa.txt
@@ -6,28 +6,12 @@
001-1,52,44,0 script Xilaxa#001-1 NPC_UKAR_MALE_LEGION_ARTIS,{
- function face_to_PC {
- getmapxy(.@map$, .@cx, .@cy, 0);
- @Devis_old_dir = .dir;
- npc_turntoxy(.@cx, .@cy);
-
- return;
- }
-
- function local_close {
- if (@Devis_old_dir != .dir)
- {
- .dir = @Devis_old_dir;
- }
- npc_resumemove;
-
- close;
- }
-
- npc_pausemove;
- face_to_PC;
- npctalkonce goodbye_msg();
- local_close;
+ npc_pausemove();
+ getmapxy(.@map$, .@cx, .@cy, 0);
+ npc_turntoxy(.@cx, .@cy);
+ npctalkonce("Hello.");
+ npc_resumemove();
+ close;
OnTimer1000:
dographmovestep;
diff --git a/npc/001-2-19/lloyd.txt b/npc/001-2-19/lloyd.txt
index 20381d92..9dfd97de 100644
--- a/npc/001-2-19/lloyd.txt
+++ b/npc/001-2-19/lloyd.txt
@@ -194,8 +194,8 @@
enora_quest;
break;
case 2:
- openstorage;
- closeclientdialog;
+ closeclientdialog();
+ openstorage();
close;
break;
case 3:
diff --git a/npc/001-2-4/books.txt b/npc/001-2-4/books.txt
index e0932405..f4282f67 100644
--- a/npc/001-2-4/books.txt
+++ b/npc/001-2-4/books.txt
@@ -87,12 +87,14 @@ OnInit:
OnShelfUse:
if (openbookshelf())
read_book;
- bye;
+ closeclientdialog();
+ close;
OnUse:
if (openbook())
read_book;
- bye;
+ closeclientdialog();
+ close;
OnInit:
.book_name$ = getitemname(FishingGuideVolI);
diff --git a/npc/001-2-6/books.txt b/npc/001-2-6/books.txt
index 53091bdf..975a1809 100644
--- a/npc/001-2-6/books.txt
+++ b/npc/001-2-6/books.txt
@@ -1,49 +1,53 @@
// Evol scripts.
// Authors:
+// gumi
+// Jesusalva
// Reid
// WildX
// Description:
-// Aemil
+// Aemil books
001-2-6,39,41,0 script #001-2-6-Book1 NPC_NO_SPRITE,{
function read_book {
- mes "";
- mes col("Master Piou sat on a tree,", 9);
- mes col("Holding a cheese in his beak.", 9);
- mes col("Master Fluffy was attracted by the odour,", 9);
- mes col("And tried to attract him thus.", 9);
- next;
- mes col("\"Mister Piou, good day to you.", 9);
- mes col("You are a handsome and good looking bird!", 9);
- mes col("In truth, if your song is as beautiful as your plumage,", 9);
- mes col("You are the Phoenix of this forest.\"", 9);
- next;
- mes col("Hearing these words the Piou felt great joy,", 9);
- mes col("And to demonstrate his beautiful voice,", 9);
- mes col("He opened his mouth wide and let drop his prey.", 9);
- mes col("The Fluffy seized it and said:", 9);
- next;
- mes col("\"My good Sir,", 9);
- mes col("Know that every flatterer,", 9);
- mes col("Lives at the expense of those who take him seriously:", 9);
- mes col("This is a lesson that is worth a cheese no doubt.\"", 9);
- next;
- mes col("The Piou, embarrassed and confused,", 9);
- mes col("Swore, though somewhat later, that he would never be ", 9);
- mes col("tricked thus again.", 9);
- next;
- mes col("-- " + l("Aesop"), 9);
+ setnpcdialogtitle(l(.book_name$));
+
+ narrator(S_FIRST_BLANK_LINE | S_NO_NPC_NAME,
+ l("Master Piou sat on a tree,"),
+ l("Holding a cheese in his beak."),
+ l("Master Fluffy was attracted by the odour,"),
+ l("And tried to attract him thus."),
+
+ l("\"Mister Piou, good day to you."),
+ l("You are a handsome and good looking bird!"),
+ l("In truth, if your song is as beautiful as your plumage,"),
+ l("You are the Phoenix of this forest.\""),
+
+ l("Hearing these words the Piou felt great joy,"),
+ l("And to demonstrate his beautiful voice,"),
+ l("He opened his mouth wide and let drop his prey."),
+ l("The Fluffy seized it and said:"),
+
+ l("\"My good Sir,"),
+ l("Know that every flatterer,"),
+ l("Lives at the expense of those who take him seriously:"),
+ l("This is a lesson that is worth a cheese no doubt.\""),
+
+ l("The Piou, embarrassed and confused,"),
+ l("Swore, though somewhat later, that he would never be "),
+ l("tricked thus again."),
+
+ "-- " + l("Aesop"));
}
OnShelfUse:
if (openbookshelf())
- read_book;
+ read_book();
close;
OnUse:
if (openbook())
- read_book;
+ read_book();
close;
OnInit:
@@ -56,47 +60,49 @@ OnInit:
001-2-6,48,41,0 script #001-2-6-Book2 NPC_NO_SPRITE,{
function read_book {
- mes "";
- mes col("Poem is making the words dance", 9);
- mes col("Words become music and glance", 9);
- mes col("Over lovers under a starry night", 9);
- mes col("Whose eyes listen under Moonlight", 9);
- next;
- mes col("No matter the grammar", 9);
- mes col("If words beat in rhythm", 9);
- mes col("Find an order with them", 9);
- mes col("As on anvil strikes the hammer", 9);
- next;
- mes col("No matter the spelling", 9);
- mes col("Just say something sparkling", 9);
- mes col("If not, how could CrazyKatiektch", 9);
- mes col("Say her love to glamourous Gliktch?", 9);
- next;
- mes col("True be or not true be", 9);
- mes col("That's not the question", 9);
- mes col("And rhyming is not too", 9);
- mes col("If you don't like to", 9);
- mes col("Share your mind is your mission", 9);
- mes col("Whatever inside can be", 9);
- next;
- mes col("Don't be shy, you are nice", 9);
- mes col("From your mind, break the ice", 9);
- mes col("Whatever your idea", 9);
- mes col("It's the good one and, ahem!", 9);
- mes col("That makes everybody", 9);
- mes col("Able to write a poem", 9);
- next;
- mes col("-- " + l("Nard"), 9);
+ setnpcdialogtitle(l(.book_name$));
+
+ narrator(S_FIRST_BLANK_LINE | S_NO_NPC_NAME,
+ l("Poem is making the words dance"),
+ l("Words become music and glance"),
+ l("Over lovers under a starry night"),
+ l("Whose eyes listen under Moonlight"),
+
+ l("No matter the grammar"),
+ l("If words beat in rhythm"),
+ l("Find an order with them"),
+ l("As on anvil strikes the hammer"),
+
+ l("No matter the spelling"),
+ l("Just say something sparkling"),
+ l("If not, how could CrazyKatiektch"),
+ l("Say her love to glamourous Gliktch?"),
+
+ l("True be or not true be"),
+ l("That's not the question"),
+ l("And rhyming is not too"),
+ l("If you don't like to"),
+ l("Share your mind is your mission"),
+ l("Whatever inside can be"),
+
+ l("Don't be shy, you are nice"),
+ l("From your mind, break the ice"),
+ l("Whatever your idea"),
+ l("It's the good one and, ahem!"),
+ l("That makes everybody"),
+ l("Able to write a poem"),
+
+ "-- " + l("Nard"));
}
OnShelfUse:
if (openbookshelf())
- read_book;
+ read_book();
close;
OnUse:
if (openbook())
- read_book;
+ read_book();
close;
OnInit:
@@ -109,25 +115,27 @@ OnInit:
001-2-6,43,39,0 script #001-2-6-Book3 NPC_NO_SPRITE,{
function read_book {
- mes "";
- mes col("Hush now and hear the chorus of the woods", 9);
- mes col("Bent trees whistling with the beat of the drum", 9);
- mes col("With no choir master nor voice to be sung", 9);
- mes col("The music of the trees floats through the breeze", 9);
- mes col("Sleep well my angel but don't follow along", 9);
- mes col("Because the voices of death sing a sweet song", 9);
- next;
- mes col("-- " + l("Princess Slayer"), 9);
+ setnpcdialogtitle(l(.book_name$));
+
+ narrator(S_FIRST_BLANK_LINE | S_NO_NPC_NAME,
+ l("Hush now and hear the chorus of the woods"),
+ l("Bent trees whistling with the beat of the drum"),
+ l("With no choir master nor voice to be sung"),
+ l("The music of the trees floats through the breeze"),
+ l("Sleep well my angel but don't follow along"),
+ l("Because the voices of death sing a sweet song"),
+
+ "-- " + l("Princess Slayer"));
}
OnShelfUse:
if (openbookshelf())
- read_book;
+ read_book();
close;
OnUse:
if (openbook())
- read_book;
+ read_book();
close;
OnInit:
@@ -140,7 +148,7 @@ OnInit:
001-2-6,54,28,0 script #001-2-6-Book4 NPC_NO_SPRITE,{
function read_book {
- narrator S_FIRST_BLANK_LINE,
+ narrator(S_FIRST_BLANK_LINE,
l("Aemil was once a magnificent land unknown to us all."),
l("Before the end of the Mana War, a band of adventurers formed in the Ancean region of Argaes from those who had lost their homes and families."),
l("They sailed from Hurnscald to Tulimshar and then Nivalis, the last permanent settlements of humans."),
@@ -152,16 +160,195 @@ OnInit:
l("They eventually found a new land after much hardship and named it Aurora, after its beautiful sunrise."),
l("A great city, eventually to become larger than the cities of Ancea, rose on the coast of Aemil. This city was named Esperia."),
l("However..."),
- l("The end of the story got erased, probably because of the sea water. Some pages are still missing. Thus much is lost to time, including the author's name.");
+ l("The end of the story got erased, probably because of the sea water. Some pages are still missing. Thus much is lost to time, including the author's name."));
}
OnUse:
if (openoldbook())
- read_book;
+ read_book();
+ close;
+
+OnInit:
+ .sex = G_OTHER;
+ .distance = 1;
+ end;
+}
+
+001-2-6,57,41,0 script #001-2-6-Book5 NPC_NO_SPRITE,{
+
+ function read_book {
+ setnpcdialogtitle(l(.book_name$));
+
+ narrator(S_FIRST_BLANK_LINE | S_NO_NPC_NAME,
+ l("So you have now a pet, who is loyal to you. It'll follow you everywhere, but there are two things you must know."),
+ l("Do not let intimacy and hunger get to zero. If any of those get to zero, it'll leave you forever."),
+ l("Pious must keep a strict diet composed of Piberries."),
+ l("However, you should only give food when it's hungry, otherwise it'll believe you're a bad owner and intimacy will decrease."),
+ l("To perform most actions, like feeding and renaming, just right-click it. You can even put it back on the egg if its following gets too annoying."),
+ l("Give your pet a nice name, and keep it healthy, and you'll be a successful pet owner!"),
+ l("When you intimacy is high, it'll increase your stats and who knows, might even help you in combat!"),
+ l("...And if you're still trying to check your pet stats, just hover it with your mouse. Thanks."),
+
+ "-- " + l("Animals Protection Agency of Aemil"));
+ }
+
+OnShelfUse:
+ if (openbookshelf())
+ read_book();
+ close;
+
+OnUse:
+ if (openbook())
+ read_book();
close;
OnInit:
+ .book_name$ = "Fluffy Animals who Love Their Owners";
.sex = G_OTHER;
.distance = 1;
end;
}
+
+001-2-6,44,44,0 script #001-2-6-Book6 NPC_NO_SPRITE,{
+
+ function read_book {
+ setnpcdialogtitle(l(.book_name$));
+
+ narrator(S_FIRST_BLANK_LINE | S_NO_NPC_NAME,
+ l("World Story For Dummies, Vol I - Ancean Era: From Keshlam to an Empire"),
+ l("The collection of four books entitled “World Story For Dummies” is based on the uncessable work from the Ukar scholars, thanks to whom this wouldn't be possible."),
+ l("The “Ancean Era” is a term used to defined the time period between the beginning of recorded history and the events at the Mana Tree, and thanks to Ukar scholars, this is widely accepted as year 1 on all Gasaron."),
+ l("The first human settlement to develop an advanced political structure and to become a city-state was Keshlam."),
+ l("Keshlam expanded rapidly under the rule of King Janeb the Founder, and soon annexed the whole Ancea continent - excluding solely the Land Of Fire - to its domains, creating the Platinum Kingdom."),
+ l("Three cities developed on the eastern side of Ancea: Tulimshar, Hurnscald and Nivalis."),
+ l("The Platinum Kingdom grew and prospered, and drew most of the human population to the safety of the walls of Keshlam, Tulimshar, Hurnscald and Nivalis."),
+
+ l("-- Continues on Volume II --"));
+ }
+
+OnShelfUse:
+ if (openbookshelf())
+ read_book();
+ close;
+
+OnUse:
+ if (openbook())
+ read_book();
+ close;
+
+OnInit:
+ .book_name$ = "World Story For Dummies, Vol I";
+ .sex = G_OTHER;
+ .distance = 1;
+ end;
+}
+
+001-2-6,53,44,0 script #001-2-6-Book7 NPC_NO_SPRITE,{
+
+ function read_book {
+ setnpcdialogtitle(l(.book_name$));
+
+ narrator(S_FIRST_BLANK_LINE | S_NO_NPC_NAME,
+ l("World Story For Dummies, Vol II - Ancean Era: Revolutions and Independence"),
+ l("On the year 206CCE, after a long crisis of succession, a minor noble only known as Queen Platyna the Red came to inherit the Platinum Crown."),
+ l("Due to neglect with day-to-day administration, which she delegated to her council, and uncontrolled expenses, the kingdom faced its first economic crisis."),
+ l("With the growth of the Kingdom halted, slow maintenance, and two great famines which killed over half the human population, the council decided to seize power and depose Platyna the Red."),
+ l("On March 213CCE, Chancellor Benjamin Frost, with support of the council, proclaimed the Republic of Ancea. This event would become known as the Blue Revolution."),
+ l("Frost held the title of Lord Prince of the Republic for eighteen months, when the council deposed him and declared itself head of the state."),
+ l("The Republic of Ancea ceased to exist officially in August 216CCE, when the cities of Tulimshar, Hurnscald and Nivalis installed their own independent governments."),
+ l("The council, however, neglected day-to-day administration duties, and focused their efforts in regaining control of the rest of Ancea."),
+ l("This led Keshlam into rapid decline and its citizen began to emigrate to the other Cities. By the end of the Ancean Era, Keshlam City was a quarter of the original size."),
+
+ l("-- Continues on Volume III --"));
+ }
+
+OnShelfUse:
+ if (openbookshelf())
+ read_book();
+ close;
+
+OnUse:
+ if (openbook())
+ read_book();
+ close;
+
+OnInit:
+ .book_name$ = "World Story For Dummies, Vol II";
+ .sex = G_OTHER;
+ .distance = 1;
+ end;
+}
+
+001-2-6,44,47,0 script #001-2-6-Book8 NPC_NO_SPRITE,{
+
+ function read_book {
+ setnpcdialogtitle(l(.book_name$));
+
+ narrator(S_FIRST_BLANK_LINE | S_NO_NPC_NAME,
+ l("World Story For Dummies, Vol III - Aemilean Era: The Mana Tree and The Mana War"),
+ l("Aemilean Era. Tulimshar, Hurnscald and Nivalis held power of their surrounding lands, except for the Land Of Fire and Keshlam City."),
+ l("All races were in peace until the Humans set forth to discover the Source of Magic, based on Ukar scholars studies."),
+ l("Free Mana travels in many directions, and this search took several years before the expedition finally found the right direction to follow."),
+ l("A large tree was found in a deep cave underneath the island of Candor. Despise the darkness of the cave and absence of leaves, the tree grew strong. It gave light off itself and its energy empowered the wizards."),
+ l("The tree was entitled The Mana Tree, and the Wizard Order took control over Candor Island. They learnt to control the mana flow, and limited its use, claiming Magic to be too dangerous for public use."),
+ l("This action was met with widespread opposition from all races, and a war broke. The tritans led the offensive, in attempts to keep the tree untouched and mana available for all."),
+ l("Unable to win, the tritans attacked Hurnscald. While human troops moved in attempts to avoid its fall, the Kralog and Ukar joined the tritans and they took the city."),
+ l("The next and final battle happened at Candor. Wizards attacks from both sides near the Mana Tree provoked a Mana Storm. A Great Quake shook the earth of Ancea and the land began to split. Geography changed, and Keshlan vanished from the map."),
+ l("The Mana Tree was lost, the caves entrances destroyed, and the Wizard Order was split in two: One part was on Candor, and other at the Magic Tower."),
+ l("After this war, the Raijin race was born. A race born of Magic. Humans encapsulated in a Mana storm and altered forever."),
+
+ l("-- Continues on Volume IV --"));
+ }
+
+OnShelfUse:
+ if (openbookshelf())
+ read_book();
+ close;
+
+OnUse:
+ if (openbook())
+ read_book();
+ close;
+
+OnInit:
+ .book_name$ = "World Story For Dummies, Vol III";
+ .sex = G_OTHER;
+ .distance = 1;
+ end;
+}
+
+001-2-6,53,47,0 script #001-2-6-Book9 NPC_NO_SPRITE,{
+
+ function read_book {
+ setnpcdialogtitle(l(.book_name$));
+
+ narrator(S_FIRST_BLANK_LINE | S_NO_NPC_NAME,
+ l("World Story For Dummies, Vol IV - Aemilean Era: The Fleet of Ancea"),
+ l("After the Mana War, the Ancea continent was mostly destroyed. It would take years to nature start repairing the damage of the event."),
+ l("A band of adventurers formed in Argaes from those who had lost their homes and families. They visited the three permanent human settlements: Tulimshar, Hurnscald and Nivalis."),
+ l("They gathered merchants and warriors to join them in a journey to find new lands to live in. Tulimshar's merchant lords gave them ships to sail east."),
+ l("The newly created Fleet of Ancea travelled so far that they were never heard from again. They found a continent, present on legends of explorers who never came back."),
+ l("They named this continent as Aemil, in honour of one of such explorers. The area they docked in was called Aurora, after its beautiful sunrise."),
+ l("The first village build was named Esperia. Aurora region was very fertile, and for this reason they moved towards countryside and built farms."),
+ l("In hopes of one day reconnect with the people of Ancea and establish a trade between the two continents, The City of Artis was founded. The Aemil Continent has then grown without contact with the people of Ancea."),
+
+ "-- " + l("The Ukar Historical Association on Aemil"));
+ }
+
+OnShelfUse:
+ if (openbookshelf())
+ read_book();
+ close;
+
+OnUse:
+ if (openbook())
+ read_book();
+ close;
+
+OnInit:
+ .book_name$ = "World Story For Dummies, Vol IV";
+ .sex = G_OTHER;
+ .distance = 1;
+ end;
+}
+
diff --git a/npc/008-1/confused-tree.txt b/npc/008-1/confused-tree.txt
index 202fb53c..eab5ee79 100644
--- a/npc/008-1/confused-tree.txt
+++ b/npc/008-1/confused-tree.txt
@@ -703,7 +703,7 @@
OnClick:
tree_panel();
- bye;
+ end;
OnTalkNearby:
diff --git a/npc/_anchors.txt b/npc/_anchors.txt
new file mode 100644
index 00000000..121f33a8
--- /dev/null
+++ b/npc/_anchors.txt
@@ -0,0 +1,33 @@
+// This file is generated automatically. All manually added changes will be removed when running the Converter.
+
+- script __anchors__ 32767,{
+OnInit:
+ .ht = htnew();
+ htput(.ht, "^ALCH", "001-2-26 32 40");
+ htput(.ht, "^ALIG|^HID", "000-2-4 36 30");
+ htput(.ht, "^ART", "001-1 89 86");
+ htput(.ht, "^BLACK|SMITH", "001-2-27 35 32");
+ htput(.ht, "^CITY|^HALL", "001-2-7 36 41");
+ htput(.ht, "^DRA|ISLAND", "000-1 62 111");
+ htput(.ht, "^FIRST|^DECK1?$", "000-2-0 23 28");
+ htput(.ht, "^HARB|^MASTER", "001-2-16 28 32");
+ htput(.ht, "^HOLD$", "000-2-2 42 31");
+ htput(.ht, "^LEG", "001-2-33 34 42");
+ htput(.ht, "^LIB", "001-2-4 42 35");
+ htput(.ht, "^LIGHT", "001-2-0 37 32");
+ htput(.ht, "^MERCH|^BANK", "001-2-19 28 30");
+ htput(.ht, "^MOON", "001-2-2 40 34");
+ htput(.ht, "^NARD", "000-2-3 21 28");
+ htput(.ht, "^NOBLE1?$", "001-2-1 37 37");
+ htput(.ht, "^NOBLE2$", "001-2-10 40 37");
+ htput(.ht, "^NOBLE3$", "001-2-11 45 33");
+ htput(.ht, "^NOBLE4$", "001-2-12 34 32");
+ htput(.ht, "^NOBLE5$", "001-2-15 34 38");
+ htput(.ht, "^RED|PLUSH|^INN", "001-2-28 30 35");
+ htput(.ht, "^SECOND|^DECK2$", "000-2-1 67 32");
+ htput(.ht, "^SHIP2$", "001-2-21 23 28");
+ htput(.ht, "^START2$", "000-0-0 26 28");
+ htput(.ht, "^START3$", "000-0-1 26 28");
+ htput(.ht, "^START|^BEGIN", "000-0 22 24");
+ htput(.ht, "^WARE", "001-2-18 37 31");
+}
diff --git a/npc/_import.txt b/npc/_import.txt
index 1718dc71..92d7f2a0 100644
--- a/npc/_import.txt
+++ b/npc/_import.txt
@@ -73,3 +73,4 @@
@include "npc/008-2-9/_import.txt"
@include "npc/test/_import.txt"
@include "npc/testbg/_import.txt"
+"npc/_anchors.txt",
diff --git a/npc/commands/warp.txt b/npc/commands/warp.txt
index e64b87db..03c32803 100644
--- a/npc/commands/warp.txt
+++ b/npc/commands/warp.txt
@@ -17,37 +17,37 @@
end;
OnCall:
- .@request$ = strtoupper(strip(.@atcmd_parameters$[0])); // sanitize
- .@map$ = "";
- .@x = 0;
- .@y = 0;
+ .@params$ = strtoupper(strip(implode(.@atcmd_parameters$[0], " ")));
+ .@request$ = replacestr(.@params$, " ", "");
- for (.@i = 0; .@i < .count; .@i += 2)
+ cleararray($@regexmatch$[1], "", 3);
+ if (.@params$ ~= "^(.+) ([0-9]+) ([0-9]+)$")
{
- if (.@request$ ~= .aliases$[.@i])
- {
- sscanf .aliases$[.@i + 1], "%s %d %d", .@map$, .@x, .@y;
- break;
- }
+ .@request$ = replacestr(strip($@regexmatch$[1]), " ", "");
+ .@req_x = atoi(strip($@regexmatch$[2]));
+ .@req_y = atoi(strip($@regexmatch$[3]));
}
- if (.@map$ == "")
+ .@ht = getvariableofnpc(.ht, "__anchors__");
+ .@it = htiterator(.@ht);
+ for (.@key$ = htinextkey(.@it); hticheck(.@it); .@key$ = htinextkey(.@it))
{
- .@map$ = .@atcmd_parameters$[0];
+ if (.@request$ ~= .@key$)
+ {
+ sscanf(htget(.@ht, .@key$, ""), "%s %d %d", .@map$, .@x, .@y);
+ break;
+ }
}
+ htidelete(.@it);
- if (.@atcmd_parameters$[2] != "")
- {
- .@x = atoi(.@atcmd_parameters$[1]);
- .@y = atoi(.@atcmd_parameters$[2]);
- }
+ .@map$ = .@map$ ? .@map$ : .@request$;
+ .@x = .@req_y ? .@req_x : .@x;
+ .@y = .@req_y ? .@req_y : .@y;
// FIXME: here getmapusers() is used only to check if the map exists
// replace this when/if we get a dedicated function for that
if (getmapusers(.@map$) < 0)
- {
end; // invalid map
- }
while (!checkcell(.@map$, .@x, .@y, cell_chkpass))
{
@@ -57,60 +57,12 @@ OnCall:
++.@e;
}
- cwarp .@map$, .@x, .@y; // XXX: maybe here use a slide_or_warp function
+ slide_or_warp(.@map$, .@x, .@y);
+ end;
OnInit:
- setarray .aliases$[0],
-
- // ARTIS
- "^ART", "001-1 89 86", // artis town square
- "^LIGHT", "001-2-0 37 32", // light armor shop
- "^NOBLE1?$", "001-2-1 37 37", // noble house 1
- "^NOBLE2$", "001-2-10 40 38", // noble house 2
- "^NOBLE3$", "001-2-11 45 33", // noble house 3
- "^NOBLE4$", "001-2-12 34 32", // noble house 4
- "^NOBLE5$", "001-2-15 34 38", // noble house 5
- "^MOON", "001-2-2 39 34", // moon's house
- "^LIB", "001-2-4 49 37", // library
- "^CITY|^HALL", "001-2-7 36 38", // city hall
- "^HARB|^MASTER", "001-2-16 32 33", // harbourmaster
- "^WARE", "001-2-18 39 31", // warehouse
- "^MERCH|^BANK", "001-2-19 29 31", // merchant hall
- "^SHIP2$", "001-2-21 30 28", // la johanne (artis)
- "^ALCH", "001-2-26 30 32", // alchemist
- "^BLACK|SMITH", "001-2-27 35 32", // blacksmith
- "^RED|PLUSH|^INN", "001-2-28 32 32", // red plush inn
- "^LEG", "001-2-33 34 36", // legion
-
- // PROLOGUE
- "^START|^BEGIN", "000-0 22 24", // starting point
- "^START2$", "000-0-0 26 28", // starting point step 2
- "^START3$", "000-0-1 26 28", // starting point step 3
- "^DRA|ISLAND", "000-1 77 110", // drasil island
- "^FIRST|^DECK1?$", "000-2-0 27 27", // first deck
- "^SECOND|^DECK2$", "000-2-1 53 33", // second deck
- "^HOLD$", "000-2-2 43 30", // hold
- "^NARD", "000-2-3 21 27", // nard's room
- "^ALIG|^HID", "000-2-4 36 29", // alige's hideout
-
- // WOODLAND
- "^HURN", "008-1 79 64", // hurnscald: town square
- "^CELE", "008-2-0 25 27", // hurnscald: celestia
- "^HMER", "008-2-1 33 39", // hurnscald: merchant guild
- "^RUST", "008-2-2 37 30", // hurnscald: inn
- "^ARRO|^ARCH", "008-2-6 27 29", // hurnscald: archery shop
- "^A?POT", "008-2-7 34 27", // hurnscald: potion shop
- "^HBLA", "008-2-8 36 34", // hurnscald: forge
- "^HHAL|^HCIT", "008-2-10 36 31", // hurnscald: city hall
- "HOSP|CLIN", "008-2-13 25 31"; // hurnscald: clinic / hospital
-
- .count = getarraysize(.aliases$[0]);
-
if (debug > 0)
- {
- bindatcmd "w", "@w::OnCall", 0, 2, 0;
- end;
- }
-
- bindatcmd "w", "@w::OnCall", 1, 2, 1;
+ bindatcmd("w", "@w::OnCall", 0, 2, 0);
+ else
+ bindatcmd("w", "@w::OnCall", 1, 2, 1);
}
diff --git a/npc/functions/doors.txt b/npc/functions/doors.txt
index c1b6565e..4cca24e3 100644
--- a/npc/functions/doors.txt
+++ b/npc/functions/doors.txt
@@ -7,6 +7,10 @@
// none
function script doorTouch {
+ getmapxy(.@pc_map$, .@pc_x, .@pc_y, UNITTYPE_PC); // get char location
+ if (.@pc_y < .y)
+ end;
+
if (getareausers() <= 1)
{
.dir = 2;
@@ -17,6 +21,9 @@ function script doorTouch {
}
function script doorUnTouch {
+ if (.dir != 2 && .dir != 6)
+ end;
+
if (getareausers(.map$) == 0)
{
.dir = 4;
diff --git a/npc/functions/game-rules.txt b/npc/functions/game-rules.txt
index f633ee5f..0a9f6569 100644
--- a/npc/functions/game-rules.txt
+++ b/npc/functions/game-rules.txt
@@ -46,12 +46,14 @@ OnCall:
OnUseBook:
if (openbook())
read_book;
- bye;
+ closeclientdialog();
+ close;
OnShelfUse:
if (openbookshelf())
read_book;
- bye;
+ closeclientdialog();
+ close;
OnInit:
.book_name$ = "The Book of Laws";
diff --git a/npc/functions/goodbye.txt b/npc/functions/goodbye.txt
index 0e8dfc2e..6c8879c5 100644
--- a/npc/functions/goodbye.txt
+++ b/npc/functions/goodbye.txt
@@ -1,19 +1,13 @@
// Evol functions.
// Authors:
-// gumi
// Reid
-// Description:
-// script terminator functions
+// goodbye
+// displays a canned message and quits
-// goodbye_msg
-// Tell a random goodbye sentence.
-// Variables:
-// .@rand = Random number between the number of "goodbye" choice.
-
-function script goodbye_msg {
- setarray .byemsg$[0],
+function script goodbye {
+ setarray(.@byemsg$[0],
l("See you!"),
l("See you later!"),
l("See you soon!"),
@@ -26,127 +20,9 @@ function script goodbye_msg {
l("Talk to you later!"),
l("Have a good day!"),
l("Cheers!"),
- l("Take care!");
-
- return .byemsg$[rand(getarraysize(.byemsg$))];
-}
-
-
-
-// cwarp
-// Closes the dialog, then warps the player.
-// You almost always want to use this instead of `warp`.
-// usage:
-// cwarp;
-// cwarp x, y;
-// cwarp map, x, y;
-
-function script cwarp {
- .@map$ = getarg(0, "");
- .@x = getarg(1, 0);
- .@y = getarg(2, 0);
-
- if (getargcount() > 0 && getargcount() < 3)
- {
- .@npc$ = strnpcinfo(0);
- .@map$ = getvariableofnpc(.map$, .@npc$);
- .@x = getarg(0);
- .@y = getarg(1);
- }
-
- getmapxy .@pc_map$, .@pc_x, .@pc_y, UNITTYPE_PC; // get char location
-
- closeclientdialog;
-
- if (getargcount() < 1)
- {
- warp .@pc_map$, .@pc_x, .@pc_y; // no arguments, just refresh
- close;
- }
+ l("Take care!"));
- if (.@map$ == .@pc_map$)
- {
- if (.@pc_x == .@x && .@pc_y == .@y)
- {
- close; // same location, don't move
- }
-
- else
- {
- slide .@x, .@y; // same map, slide instead of full warp
- close;
- }
- }
-
- warp .@map$, .@x, .@y; // different map, warp to given location
+ closeclientdialog();
+ npctalkonce(.@byemsg$[rand(getarraysize(.@byemsg$))]);
close;
}
-
-
-
-// cshop
-// closes the dialog, then opens a shop
-// if no npc is given, calls "#<npc> $"
-
-function script cshop {
- closeclientdialog;
- shop getarg(0, "#" + strnpcinfo(0) + " $");
- //close; => the shop buildin already sends close, and is a terminator itself
-}
-
-
-
-// cstorage
-// closes the dialog, then opens storage
-
-function script cstorage {
- closeclientdialog;
- openstorage;
- close;
-}
-
-
-
-// bye
-// closes the dialog without waiting for the player to press close
-// can also display an emote
-
-function script bye {
- .@emote = getarg(0, -1);
- closeclientdialog;
-
- if (.@emote >= 0)
- emotion .@emote;
-
- close;
-}
-
-
-
-// goodbye
-// same as bye, but also displays a canned message
-// can also display an emote
-
-function script goodbye {
- npctalkonce(goodbye_msg());
- bye getarg(0, -1);
-}
-
-
-
-// goodbye2
-// Waits for the player to press close, displays a canned message,
-// ends execution.
-// Can also display an emote
-
-function script goodbye2 {
- .@emote = getarg(0, -1);
-
- close2;
- npctalkonce(goodbye_msg());
-
- if (.@emote >= 0)
- emotion .@emote;
-
- end;
-}
diff --git a/npc/functions/openbook.txt b/npc/functions/openbook.txt
index 0278415c..cb1a0b11 100644
--- a/npc/functions/openbook.txt
+++ b/npc/functions/openbook.txt
@@ -3,26 +3,24 @@
// Reid
// Description:
// Narrator dialogue to show the selected book.
-// Variables:
-// @book_name$ = The name of the book to read.
function script openbook {
- .@book_name$ = "\"" + l(getarg(0, getvariableofnpc(.book_name$, strnpcinfo(0)))) + "\"";
+ .@book_name$ = getarg(0, getvariableofnpc(.book_name$, strnpcinfo(0)));
- narrator S_LAST_NEXT,
- l("You open a book named @@.", .@book_name$),
- l("Do you want to read it?");
+ narrator(S_LAST_NEXT,
+ l("You open a book named \"%s\".", .@book_name$),
+ l("Do you want to read it?"));
return (select("Yes.", "No.") == 1);
}
function script openbookshelf {
- .@book_name$ = "\"" + l(getarg(0, getvariableofnpc(.book_name$, strnpcinfo(0)))) + "\"";
+ .@book_name$ = getarg(0, getvariableofnpc(.book_name$, strnpcinfo(0)));
- narrator S_LAST_NEXT,
+ narrator(S_LAST_NEXT,
l("You see a dust covered book on the shelf..."),
- l("The name of the book is @@.", .@book_name$),
- l("Do you want to read it?");
+ l("The name of the book is \"%s\".", .@book_name$),
+ l("Do you want to read it?"));
return (select("Yes.", "No.") == 1);
}
diff --git a/npc/functions/shops.txt b/npc/functions/shops.txt
index 79890e81..8962997e 100644
--- a/npc/functions/shops.txt
+++ b/npc/functions/shops.txt
@@ -1,13 +1,18 @@
// Evol functions.
// Author:
// 4144
+// Jesusalva
// Description:
// Shops utility functions
-// Variables:
-// none
+
+
+
+// restoreshopitem(<item nameid>, <amount>{, <price>})
+// adds back an item to the sell list if less than the specified amount
+// returns true
function script restoreshopitem {
if (shopcount(getarg(0)) < getarg(1))
- sellitem getarg(0), -1, getarg(1);
+ sellitem(getarg(0), getarg(2, -1), getarg(1));
return;
}
diff --git a/npc/functions/warp.txt b/npc/functions/warp.txt
new file mode 100644
index 00000000..dd09d713
--- /dev/null
+++ b/npc/functions/warp.txt
@@ -0,0 +1,48 @@
+// Evol functions.
+// Authors:
+// gumi
+
+
+// slide_or_warp
+// Slides the player instead of warping, when possible.
+// usage:
+// slide_or_warp({<aid>});
+// slide_or_warp(<x>, <y>{, <aid>});
+// slide_or_warp("<map>", <x>, <y>{, <aid>});
+
+function script slide_or_warp {
+ if (getargcount() <= 1) {
+ .@aid = getarg(1, 0);
+ } else {
+ if (getargcount() >= 3 && getdatatype(getarg(0)) & DATATYPE_STR) {
+ .@map$ = getarg(0);
+ .@x = getarg(1);
+ .@y = getarg(2);
+ .@aid = getarg(3, 0);
+ } else {
+ .@x = getarg(0);
+ .@y = getarg(1);
+ .@aid = getarg(2, 0);
+ }
+ }
+
+ if (!isloggedin(.@aid)) {
+ if ((.@aid = playerattached()) == 0) {
+ debugmes("slide_or_warp: no player attached!");
+ return false;
+ }
+ }
+
+ getmapxy(.@pc_map$, .@pc_x, .@pc_y, UNITTYPE_PC, .@aid); // get char location
+ .@cid = getcharid(CHAR_ID_CHAR, strcharinfo(PC_NAME, .@aid)); // FIXME: [Hercules] make it so you can pass account id directly to getcharid
+
+ if (getargcount() < 1) {
+ warpchar(.@pc_map$, .@pc_x, .@pc_y, .@cid); // no arguments, just refresh
+ } else if (.@map$ == .@pc_map$ && (.@pc_x != .@x || .@pc_y != .@y)) {
+ slide(.@x, .@y); // same map, slide instead of full warp
+ // FIXME: make slide take GID as optional arg
+ } else {
+ warpchar(.@map$, .@x, .@y, .@cid); // different map, warp to given location
+ }
+ return true;
+}
diff --git a/npc/scripts.conf b/npc/scripts.conf
index 83fb0348..3bb929a9 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -11,6 +11,7 @@
"npc/functions/string.txt",
"npc/functions/RNGesus.txt",
"npc/functions/math.txt",
+"npc/functions/warp.txt",
// Misc functions
"npc/functions/main.txt",
diff --git a/sql-files/main.sql b/sql-files/main.sql
index 12607531..5546c027 100644
--- a/sql-files/main.sql
+++ b/sql-files/main.sql
@@ -889,6 +889,7 @@ INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1489588190); -- 2017-03-1
INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1496588640); -- 2017-06-04--15-04.sql
INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1496588700); -- 2017-06-04--15-05.sql
INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1509835214); -- 2017-11-04--10-39.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1519671456); -- 2018-02-26--15-57.sql
--
-- Table structure for table `storage`
--
@@ -959,12 +960,13 @@ CREATE TABLE IF NOT EXISTS `rodex_mail` (
`sender_id` INT(11) NOT NULL,
`receiver_name` VARCHAR(30) NOT NULL,
`receiver_id` INT(11) NOT NULL,
- `receiver_accountid` INT(11) NOT NULL,
+ `receiver_accountid` INT(11) NOT NULL,
`title` VARCHAR(50) NOT NULL,
`body` VARCHAR(510) NOT NULL,
`zeny` BIGINT(20) NOT NULL,
`type` TINYINT(8) UNSIGNED NOT NULL,
`is_read` TINYINT(8) NOT NULL,
+ `sender_read` TINYINT(2) NOT NULL,
`send_date` INT(11) NOT NULL,
`expire_date` INT(11) NOT NULL,
`weight` INT(11) NOT NULL,
diff --git a/sql-files/upgrades/2018-02-26--15-57.sql b/sql-files/upgrades/2018-02-26--15-57.sql
new file mode 100644
index 00000000..a2090bb3
--- /dev/null
+++ b/sql-files/upgrades/2018-02-26--15-57.sql
@@ -0,0 +1,6 @@
+#1519671456
+
+ALTER TABLE `rodex_mail`
+ ADD COLUMN `sender_read` TINYINT(2) NOT NULL DEFAULT '0' AFTER `is_read`;
+
+INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1519671456 , 'No');
diff --git a/sql-files/upgrades/index.txt b/sql-files/upgrades/index.txt
index 494e9bf1..976df13f 100644
--- a/sql-files/upgrades/index.txt
+++ b/sql-files/upgrades/index.txt
@@ -42,3 +42,4 @@
2017-06-04--15-04.sql
2017-06-04--15-05.sql
2017-11-04--10-39.sql
+2018-02-26--15-57.sql