summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-03-29 17:05:47 +0000
committerMicksha <ms-shaman@gmx.de>2019-03-29 17:05:47 +0000
commit00f7ce5433bb72a246a694dc1d9d6603fac57e06 (patch)
treee9112fcebc5ffd9e80275c67dae0257a721b4975 /npc
parent1f4c8869c01649f8a4b69b278b91b55caa00a7c7 (diff)
downloadserverdata-00f7ce5433bb72a246a694dc1d9d6603fac57e06.tar.gz
serverdata-00f7ce5433bb72a246a694dc1d9d6603fac57e06.tar.bz2
serverdata-00f7ce5433bb72a246a694dc1d9d6603fac57e06.tar.xz
serverdata-00f7ce5433bb72a246a694dc1d9d6603fac57e06.zip
I need a way to get the Master Book.
Uhm, Auldsbel will do for a while, WildX can comment later.
Diffstat (limited to 'npc')
-rw-r--r--npc/008-1/_warps.txt1
-rw-r--r--npc/008-1/auldsbel.txt14
-rw-r--r--npc/008-4-1/_import.txt5
-rw-r--r--npc/008-4-1/_mobs.txt7
-rw-r--r--npc/008-4-1/_warps.txt3
-rw-r--r--npc/008-4-1/boss.txt62
-rw-r--r--npc/_import.txt1
-rw-r--r--npc/items/master_skillbook.txt113
-rw-r--r--npc/scripts.conf1
9 files changed, 207 insertions, 0 deletions
diff --git a/npc/008-1/_warps.txt b/npc/008-1/_warps.txt
index 46e9891d..9ca7640a 100644
--- a/npc/008-1/_warps.txt
+++ b/npc/008-1/_warps.txt
@@ -25,3 +25,4 @@
008-1,233,131,0 warp #008-1_233_131 0,0,008-2-29,36,24
008-1,287,133,0 warp #008-1_287_133 0,0,008-2-30,52,39
008-1,20,85,0 warp #008-1_20_85 0,1,008-1-1,246,85
+008-1,165,171,0 warp #008-1_165_171 0,0,008-4-1,175,19
diff --git a/npc/008-1/auldsbel.txt b/npc/008-1/auldsbel.txt
index cf4cd16e..dc7cf202 100644
--- a/npc/008-1/auldsbel.txt
+++ b/npc/008-1/auldsbel.txt
@@ -6,6 +6,20 @@
// THIS IS A PLACEHOLDER!
008-1,119,114,0 script Auldsbel#008-1 NPC_WIZARD,{
+ // Placeholder please remove
+ if (!MASTERBOOK_PAGES)
+ {
+ inventoryplace MasterBook, 1;
+ getitem MasterBook, 1;
+ MASTERBOOK_PAGES=1;
+ mesc l("Auldsbel discretly stuffs a book on your backpack.");
+ next;
+ speech
+ l("Don't tell anyone about this. Once you kill you a boss, you can try to learn the boss skill by using the book."),
+ l("Beware you have a limited number of pages. Do not let the Legion or the Brotherhood find out you have one."),
+ l("And by the way. I know nothing about this book. And I don't know how to get more pages either.");
+ close;
+ }
speech
l("Hello."),
l("Oh, you look more interested in magic.. the brotherhood did forbid most of the interesting paths of magic, but boring baby spells are still allowed."),
diff --git a/npc/008-4-1/_import.txt b/npc/008-4-1/_import.txt
new file mode 100644
index 00000000..0f706bbc
--- /dev/null
+++ b/npc/008-4-1/_import.txt
@@ -0,0 +1,5 @@
+// Map 008-4-1: Cave Of Trials
+// This file is generated automatically. All manually added changes will be removed when running the Converter.
+"npc/008-4-1/_mobs.txt",
+"npc/008-4-1/_warps.txt",
+"npc/008-4-1/boss.txt",
diff --git a/npc/008-4-1/_mobs.txt b/npc/008-4-1/_mobs.txt
new file mode 100644
index 00000000..ad992a8d
--- /dev/null
+++ b/npc/008-4-1/_mobs.txt
@@ -0,0 +1,7 @@
+// This file is generated automatically. All manually added changes will be removed when running the Converter.
+// Map 008-4-1: Cave Of Trials mobs
+008-4-1,106,73,73,63 monster Cave Maggot 1027,80,30000,2500
+008-4-1,136,71,47,50 monster Thief Slime 1105,35,50000,2500
+008-4-1,101,83,73,30 monster AngryCrafty 1103,60,50000,2500
+008-4-1,100,79,32,31 monster Black Scorpion 1104,14,45000,2500
+008-4-1,94,98,11,9 monster Green Slime 1024,4,500,2500
diff --git a/npc/008-4-1/_warps.txt b/npc/008-4-1/_warps.txt
new file mode 100644
index 00000000..b1a26ad0
--- /dev/null
+++ b/npc/008-4-1/_warps.txt
@@ -0,0 +1,3 @@
+// This file is generated automatically. All manually added changes will be removed when running the Converter.
+// Map 008-4-1: Cave Of Trials warps
+008-4-1,175,18,0 warp #008-4-1_175_18 2,0,008-1,165,170
diff --git a/npc/008-4-1/boss.txt b/npc/008-4-1/boss.txt
new file mode 100644
index 00000000..17b04880
--- /dev/null
+++ b/npc/008-4-1/boss.txt
@@ -0,0 +1,62 @@
+// Evol Script
+// Author:
+// Jesusalva
+// Description:
+// Controls the boss on 008-4-1 and the Master Book Learning
+// see npc/items/master_skillbook.txt for explanation about variables
+
+008-4-1,0,0,0 script #BossCtrl_008-4-1 NPC_HIDDEN,{
+ end;
+
+// Test server: 15 minutes only
+OnTimer900000:
+ if (!debug)
+ end;
+
+// Otherwise, respawn every hour
+OnTimer3600000:
+ stopnpctimer;
+OnInit:
+ $@MB_00841=0;
+ monster "008-4-1", 67, 30, strmobinfo(1, GameBalance), GameBalance, 1, "#BossCtrl_008-4-1::OnBossDeath";
+ end;
+
+OnBossDeath:
+ initnpctimer;
+ // Only the party which defeated the boss can learn the skill
+ getmapxy(.@m$, .@x, .@y, 0);
+ .@party=getcharid(1);
+ if (.@party > 0)
+ {
+ $@MB_00841=.@party;
+ areatimer("008-4-1", .@x-15, .@y-15, .@x+15, .@y+15, 10, "#BossCtrl_008-4-1::OnBossCheck");
+ mapannounce "008-4-1", "Boss deafeated by Party: " + getpartyname(.@party), bc_all;
+ }
+ else
+ {
+ addtimer(10, "#BossCtrl_008-4-1::OnBegin");
+ mapannounce "008-4-1", "Boss deafeated by: " + strcharinfo(0), bc_all;
+ }
+ end;
+
+OnBossCheck:
+ // TODO: Check if you really fought or was just lurking
+ // Check if party is correct
+ if (getcharid(1) != $@MB_00841)
+ end;
+OnBegin:
+ @mb_BossId=GameBalance;
+ @mb_SkillId=MG_COLDBOLT;
+ @mb_ItemId=Manana; // Placeholder
+ @mb_ItemAm=1;
+ addtimer(15000, "#BossCtrl_008-4-1::OnFinish");
+ end;
+
+OnFinish:
+ @mb_BossId=0;
+ @mb_SkillId=0;
+ @mb_ItemId=0;
+ @mb_ItemAm=0;
+ end;
+
+}
diff --git a/npc/_import.txt b/npc/_import.txt
index fe81168d..23aef7f4 100644
--- a/npc/_import.txt
+++ b/npc/_import.txt
@@ -90,6 +90,7 @@
@include "npc/008-2-9/_import.txt"
@include "npc/008-3-0/_import.txt"
@include "npc/008-3-1/_import.txt"
+@include "npc/008-4-1/_import.txt"
@include "npc/test/_import.txt"
@include "npc/testbg/_import.txt"
"npc/_anchors.txt",
diff --git a/npc/items/master_skillbook.txt b/npc/items/master_skillbook.txt
new file mode 100644
index 00000000..d7e7de14
--- /dev/null
+++ b/npc/items/master_skillbook.txt
@@ -0,0 +1,113 @@
+// Evol script.
+// Author:
+// Jesusalva
+// Elvano
+// Description:
+// Contains master skills which can only be learnt after killing boss
+// See also: <link to tmw forum topic>
+// Notes:
+// Not exactly equal as Elvano proposal. I actually care for restrictions you know...
+// Variables:
+// PERMANENT:
+// MASTERBOOK_PAGES - How many pages your Master Book have.
+// Defaults to zero, so you can't @item it.
+// MASTERBOOK_SKILL - An array with the skills you have learnt from Master Book.
+// - It's more flexible this way.
+// TEMPORARY:
+// @mb_BossId - Contains the MobID of the boss your party killed.
+// @mb_SkillId - Contains the SkillID which can be learnt with the boss.
+// @mb_ItemId - Contains the Ink Id to write (or whatever)
+// @mb_ItemAm - How many ink is required to write the skill
+// Remember: @mb_BossId will be reset to zero after 15 seconds from boss death.
+// Or upon logout. Or when changing maps. Temporary variables aren't reliable.
+//
+// @mb_BossId controls if you'll try to LEARN a skill, or READ the book.
+// Remember: A dialog prevents timer events from happening, but doesn't stops the timer.
+// TODO: Currently no way to get skill name from database (add getskillinfo() to server-plugin please)
+// TODO: Reset @mb_* when register_skill() finish
+// TODO: Add Magic Ink
+// TODO: When another party/player kills the boss, book should say so.
+
+- script #MasterBook NPC_HIDDEN,{
+
+
+ function register_skill {
+
+ setnpcdialogtitle l(.book_name$);
+
+ .@mb_lvl=strmobinfo(3, @mb_BossId);
+ mesc l("You just defeated the following boss: @@ (Lv. @@)", strmobinfo(1, @mb_BossId), .@mb_lvl);
+ // Check if all reqs are met
+ // The boss must have a skill
+ if (!@mb_SkillId)
+ {
+ mesc l("But there is no skill to be learnt from this boss.");
+ close;
+ }
+ // You must have free pages
+ if (array_entries(MASTERBOOK_SKILL) >= MASTERBOOK_PAGES)
+ {
+ mesc l("But you ran out of empty pages on this book.");
+ close;
+ }
+ // TODO: Party Level Range
+ // You must be at most 30 levels below the monster level
+ if (BaseLevel+30 < .@mb_lvl)
+ {
+ mesc l("But you are out of the boss level range.");
+ close;
+ }
+ // You must have enough materials
+ if (countitem(@mb_ItemId) < @mb_ItemAm)
+ {
+ mesc l("But you do not have enough Magic Ink. (You need: @@ @@)", @mb_ItemAm, getitemlink(@mb_ItemId));
+ close;
+ }
+
+ // Allow you to check which skills are here to learn
+ mes "";
+ mesc l("You have: @@/@@ @@", countitem(@mb_ItemId), @mb_ItemAm, getitemlink(@mb_ItemId));
+ select
+ rif(!getskilllv(@mb_SkillId), l("Learn Skill")),
+ l("Do not learn");
+ mes "";
+ if (@menu == 1)
+ {
+ delitem @mb_ItemId, @mb_ItemAm;
+ skill(@mb_SkillId, 1, 0);
+ array_push(MASTERBOOK_SKILL, @mb_SkillId);
+ closeclientdialog;
+ dispbottom l("You have learnt the skill.");
+ }
+ close;
+ }
+
+
+ function read_book {
+
+ setnpcdialogtitle l(.book_name$);
+ mesc l("@@/@@ pages used.", array_entries(MASTERBOOK_SKILL), MASTERBOOK_PAGES);
+
+ mesc l("List of known master skills:");
+ mes "";
+ for (.@i = 0; .@i < getarraysize(MASTERBOOK_SKILL); ++.@i) {
+ mesc l("* Skill ID: @@", MASTERBOOK_SKILL[.@i]);
+ }
+ close;
+ }
+
+OnUse:
+ // We assume if @mb_BossId is set, everything else is set, too
+ if (@mb_BossId)
+ register_skill;
+ if (openbook())
+ read_book;
+ closeclientdialog();
+ close;
+
+OnInit:
+ .book_name$ = getitemname(MasterBook);
+ .sex = G_OTHER;
+ .distance = 1;
+ end;
+}
diff --git a/npc/scripts.conf b/npc/scripts.conf
index 8185ef56..a7f39836 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -100,6 +100,7 @@
"npc/items/shovel.txt",
"npc/items/rand_sc_heal.txt",
"npc/items/recipes.txt",
+"npc/items/master_skillbook.txt",
// custom atcommands
"npc/commands/music.txt",