diff options
-rw-r--r-- | db/re/item_db.conf | 8 | ||||
-rw-r--r-- | npc/020-7-1/core.txt | 3 | ||||
-rw-r--r-- | npc/020-7-1/pagefinders.txt | 91 |
3 files changed, 92 insertions, 10 deletions
diff --git a/db/re/item_db.conf b/db/re/item_db.conf index 472778ffd..1dc329255 100644 --- a/db/re/item_db.conf +++ b/db/re/item_db.conf @@ -5827,9 +5827,13 @@ item_db: ( Weight: 450 Def: 1 Loc: "EQP_ACC_L" - EquipLv: 54 + EquipLv: 37 Refine: false - ViewSprite: 1165 + Script: <" + bonus bMaxSP,20; + bonus bSPrecovRate,10; + bonus bMatk,10; + "> }, { Id: 1166 diff --git a/npc/020-7-1/core.txt b/npc/020-7-1/core.txt index 3413ce009..d7d5c755b 100644 --- a/npc/020-7-1/core.txt +++ b/npc/020-7-1/core.txt @@ -3,7 +3,7 @@ // Jesusalva // TMW Org. // Description: -// Core functions +// Core functions (it MUST be loaded first) // Some setup is required @@ -27,3 +27,4 @@ function script BSQuestion { return .@rt; } + diff --git a/npc/020-7-1/pagefinders.txt b/npc/020-7-1/pagefinders.txt index 3fa639c19..75c4375d4 100644 --- a/npc/020-7-1/pagefinders.txt +++ b/npc/020-7-1/pagefinders.txt @@ -11,10 +11,33 @@ // MAIN STATE // FIELD 2: // nº of pages found (0~31) +// FIELD 3: +// nº of duplicates found (for randomness control - capped at 60) 020-7-1,36,39,4 script Ensio NPC_BLUESAGEWORKER_MB,{ function askQuestion; - mesc l("ERROR TODO"); + function helpLogic; + + .@qt=getq2(NivalisQuest_BlueSagePagefinder); + mesn; + if (.@qt == 31) + mesq l("We'd never be able to recover our books so quickly without your help. Thanks!"); + else if (.@qt >= 27) + mesq l("There are only a few pages missing."); + else if (.@qt >= 19) + mesq l("Wow, you already found quite a lot of bookpages. Please keep it up!"); + else if (.@qt >= 9) + mesq l("Thanks for the pages you brought. There are still some missing."); + else if (.@qt) + mesq l("So many bookpages are still missing..."); + else + mesc l("*sigh*"); + if (getq(NivalisQuest_BlueSagePagefinder)) + close; + + next; + mesn; + mesq l("Hello. Did you come here to see the library? There isn't much left... But we're working on recovering the books by collecting the ripped out book pages, sorting them and recreating the books."); askQuestion(); close; @@ -24,19 +47,23 @@ function askQuestion { .@q2=getq2(NivalisQuest_BlueSage); .@q3=getq3(NivalisQuest_BlueSage); .@qs=BSQuestion(getq(NivalisQuest_BlueSage)); - .@qt=getq(NivalisQuest_BlueSagePagefinder); + .@qo=getq(NivalisQuest_BlueSagePagefinder); + .@qt=getq2(NivalisQuest_BlueSagePagefinder); next; mes ""; select - rif(.@qt < 255, "What are you doing?"), + rif(!.@qo, "Can I help you somehow?"), rif(.@qs & BS_QVISITOR, l("Do you know anything about the strange visitor?")), rif(.@qs & BS_QHELPER, l("What's your opinion of Peetu and his work?")), - any(l("I need to leave."), l("See you."), l("Bye.")); + any(l("I need to leave."), l("See you."), l("Bye."), l("Good luck with that. See you in ten years or something.")); mes ""; switch (@menu) { case 1: mesn; - mesq l("TODO!"); + mesq l("Oh, would you? That'd be great! You see, the slimes ate most of the books and it is difficult to retrieve the bookpages. If you feel capable of this task, you could go out to hunt the Blue and White Slimes, to get the @@ back from them.", getitemlink(SpellBookPage)); + if (!countitem(SpellBookPage)) + break; + helpLogic(); break; case 2: mesn; @@ -59,6 +86,56 @@ function askQuestion { close; } +function helpLogic { + do { + inventoryplace ThetaBook, 1; + .@qt=getq2(NivalisQuest_BlueSagePagefinder); + .@qx=getq3(NivalisQuest_BlueSagePagefinder); + next; + mesc l("Donate 1/@@ @@ to Ensio?", countitem(SpellBookPage), getitemlink(SpellBookPage)); + mes ""; + // break(); works, right? + if (askyesno() == ASK_NO) + break; + + delitem SpellBookPage, 1; + if (rand(90 - .@qt) < 36 && .@qx < 60) { + // Old Page + setq3 NivalisQuest_BlueSagePagefinder, .@qx+1; + mesn; + mesq "%%f " + l("Mh, let me see. We already have a copy of this page, but it's helpful nevertheless. Thank you."); + } else { + // Original Page + setq2 NivalisQuest_BlueSagePagefinder, .@qt+1; + mesn; + mesq "%%H " + l("Ah, wonderful! This is a page we haven't found yet!"); + } + getexp 525, 32; // about 3% of exp table. + + // Maybe you've completed the requeriment? + .@qt=getq2(NivalisQuest_BlueSagePagefinder); + if (.@qt >= 31) { + next; + mesn; + mesq l("Amazing. I think you found all the missing pages of which we didn't have a copy. This is a great help! I'll mention this to Nikolai."); + next; + mesn; + mesq l("For now, please accept this @@ as my gratitude.", getitemlink(ThetaBook)); + getitem ThetaBook, 1; + setq1 NivalisQuest_BlueSagePagefinder, 1; + // Get any experience below the 60 failed pages threshold + // But you'll get only ~1% per success because it took you no page + // And you'll always get at least 1% bonus for... reasons. + .@x=60-.@qx; + .@x+=1; + getexp 175*.@x, 10*.@x; + break; + } + + } while (countitem(SpellBookPage)); + return; +} + OnInit: .bsId=BS_NPC07; .sex=G_MALE; @@ -116,7 +193,7 @@ function askQuestion { .@q2=getq2(NivalisQuest_BlueSage); .@q3=getq3(NivalisQuest_BlueSage); .@qs=BSQuestion(getq(NivalisQuest_BlueSage)); - .@qt=getq(NivalisQuest_BlueSagePagefinder); + .@qt=getq2(NivalisQuest_BlueSagePagefinder); next; mes ""; select @@ -211,7 +288,7 @@ function askQuestion { .@q2=getq2(NivalisQuest_BlueSage); .@q3=getq3(NivalisQuest_BlueSage); .@qs=BSQuestion(getq(NivalisQuest_BlueSage)); - .@qt=getq(NivalisQuest_BlueSagePagefinder); + .@qt=getq2(NivalisQuest_BlueSagePagefinder); next; mes ""; select |