From 3114643fabfde05ee7e559535bfa1c0ea9259b2e Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 29 Aug 2019 22:03:34 -0300 Subject: Minimal core functions for 018-6-1 Elenium Mines --- npc/018-6-1/main.txt | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 npc/018-6-1/main.txt (limited to 'npc/018-6-1/main.txt') diff --git a/npc/018-6-1/main.txt b/npc/018-6-1/main.txt new file mode 100644 index 000000000..cbaed9897 --- /dev/null +++ b/npc/018-6-1/main.txt @@ -0,0 +1,98 @@ +// TMW2 Scripts +// Author: +// Jesusalva +// Description: +// Controls Elenium Mines, specially the instances + +// Main Controller for Instanced maps +018-6-1,0,0,0 script #01861_InstCtrl NPC_HIDDEN,{ + end; + +// Map, x, y, width, height, mob, amount +function AreaMonsterB { + .@m$=getarg(0); + .@x1=getarg(1); + .@x2=.@x1+getarg(3); + .@y1=getarg(2); + .@y2=.@y1+getarg(4); + .@mi=getarg(5); + .@am=getarg(6); + areamonster(.@m$, .@x1, .@y1, .@x2, .@y2, strmobinfo(1, .@mi), .@mi, .@am, instance_npcname(.name$)+"::OnKill"+.@mi); + return; +} + +// (var, value) +function SetIfVoid { + if (!getarg(0)) + return getarg(1); + return 0; +} + +// Bifs won't respawn +OnKill1226: +OnKill1227: +OnKill1228: + end; + +// Others: Wait 30 seconds and respawn +OnKill1178: + .@mi=SetIfVoid(.@mi, 1178); +OnKill1051: + .@mi=SetIfVoid(.@mi, 1051); +OnKill1074: + .@mi=SetIfVoid(.@mi, 1074); +OnKill1123: + .@mi=SetIfVoid(.@mi, 1123); +OnKill1176: + .@mi=SetIfVoid(.@mi, 1176); +OnKill1026: + .@mi=SetIfVoid(.@mi, 1026); + + // Common utils + getmapxy(.@m$, .@x, .@y, 0); + sleep(30000); + AreaMonsterB(.@m$, .@x-2, .@y-2, 4, 4, .@mi, 1); + end; + +OnInstanceInit: + // Generate map ID + getmapxy(.@m$, .@x, .@y, UNITTYPE_NPC); + + // Bif monsters + AreaMonsterB(.@m$, 40, 49, 7, 8, BigEleniumBif, 5); + AreaMonsterB(.@m$, 95, 51, 7, 8, BigEleniumBif, 5); + AreaMonsterB(.@m$, 145, 83, 6, 5, EleniumBif, 5); + AreaMonsterB(.@m$, 62, 86, 6, 5, EleniumBif, 5); + AreaMonsterB(.@m$, 65, 130, 6, 5, EleniumBif, 5); + AreaMonsterB(.@m$, 125, 158, 6, 5, SmallEleniumBif, 4); + AreaMonsterB(.@m$, 129, 183, 6, 5, SmallEleniumBif, 4); + AreaMonsterB(.@m$, 34, 181, 5, 5, SmallEleniumBif, 4); + + // Common Monsters + AreaMonsterB(.@m$, 80, 172, 54, 25, BlackSlime, 16); + AreaMonsterB(.@m$, 89, 167, 54, 25, DarkLizard, 8); + AreaMonsterB(.@m$, 96, 103, 56, 29, BlackScorpion, 18); + AreaMonsterB(.@m$, 101, 105, 54, 25, MountainSnake, 10); + AreaMonsterB(.@m$, 70, 45, 44, 25, WickedMushroom, 14); + AreaMonsterB(.@m$, 68, 45, 31, 21, Archant, 7); + end; + +} +///////////////////////////// +018-6-1,83,26,0 script #ToForgottenChamber NPC_SUMMONING_CIRC,0,0,{ + dispbottom l("It looks dangerous."); + end; + +OnTouch: + Exception("TODO"); + end; + +OnInit: + disablenpc .name$; + end; + +} + + + + -- cgit v1.2.3-70-g09d2 From 88aaf2154475ef7c9d0e411b06d52d82c3c177e0 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 30 Aug 2019 14:47:53 -0300 Subject: More main, core logics, needed for Forgotten Arc --- db/re/map_zone_db.conf | 4 ++++ npc/017-1/townhall.txt | 2 +- npc/018-6-0/_import.txt | 1 + npc/018-6-0/main.txt | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ npc/018-6-1/main.txt | 8 +++++++- npc/items/teleporter.txt | 2 +- 6 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 npc/018-6-0/main.txt (limited to 'npc/018-6-1/main.txt') diff --git a/db/re/map_zone_db.conf b/db/re/map_zone_db.conf index 871e8b228..95455f729 100644 --- a/db/re/map_zone_db.conf +++ b/db/re/map_zone_db.conf @@ -609,5 +609,9 @@ zones: ( disabled_items: { } + + disabled_commands: { + pvpon: 100 + } } ) diff --git a/npc/017-1/townhall.txt b/npc/017-1/townhall.txt index f005c52b1..05e613eb8 100644 --- a/npc/017-1/townhall.txt +++ b/npc/017-1/townhall.txt @@ -86,7 +86,7 @@ function script BarbaraInstCheck { instance_attachmap("018-6-0", .@inst, false, .@map0$); instance_attachmap("018-6-1", .@inst, false, .@map1$); instance_attachmap("018-6-2", .@inst, false, .@map2$); - //instance_attachmap("018-6-3", .@inst, false, .@map3$); + instance_attachmap("018-6-3", .@inst, false, .@map3$); // Instance lasts two hours instance_set_timeout(7200, 7200, .@inst); instance_init(.@inst); diff --git a/npc/018-6-0/_import.txt b/npc/018-6-0/_import.txt index 45be6bdab..0e2c16f0e 100644 --- a/npc/018-6-0/_import.txt +++ b/npc/018-6-0/_import.txt @@ -1,2 +1,3 @@ // Map 018-6-0: Sanctuary - Forgotten Chamber // This file is generated automatically. All manually added changes will be removed when running the Converter. +"npc/018-6-0/main.txt", diff --git a/npc/018-6-0/main.txt b/npc/018-6-0/main.txt new file mode 100644 index 000000000..2e12efceb --- /dev/null +++ b/npc/018-6-0/main.txt @@ -0,0 +1,48 @@ +// TMW2 Scripts +// Author: +// Jesusalva +// Description: +// Controls Forgotten Chamber + +///////////////////////////// +018-6-1,83,26,0 script #ToForgottenShrine NPC_SUMMONING_CIRC,0,0,{ + dispbottom l("It looks dangerous."); + end; + +OnTouch: + .@q=getq(LoFQuest_Barbara); + if (.@q >= 2) { + warp BarbaraInstCheck(3), 31, 151; + //warp BarbaraInstCheck(0), 90+any(-1, 1), 90+any(-1,1); + } else { + Exception("ERROR, YOU SHOULD NOT BEEN SEEING THIS. 018-6-1.TFC"); + } + end; + +OnInit: +OnInstanceInit: + disablenpc .name$; + end; + +} + +///////////////////////////// +018-6-1,83,26,0 script #FromEleniumMines NPC_SUMMONING_CIRC,0,0,{ + dispbottom l("It should bring me back."); + end; + +OnTouch: + .@q=getq(LoFQuest_Barbara); + if (.@q < 10) { + warp BarbaraInstCheck(1), 83, 28; + //warp BarbaraInstCheck(0), 90+any(-1, 1), 90+any(-1,1); + } else { + warp "018-6-1", 83, 28; + } + end; +} + + + + + diff --git a/npc/018-6-1/main.txt b/npc/018-6-1/main.txt index cbaed9897..a12bb8672 100644 --- a/npc/018-6-1/main.txt +++ b/npc/018-6-1/main.txt @@ -84,7 +84,13 @@ OnInstanceInit: end; OnTouch: - Exception("TODO"); + .@q=getq(LoFQuest_Barbara); + if (.@q >= 1) { + warp BarbaraInstCheck(0), 90, 91; + //warp BarbaraInstCheck(0), 90+any(-1, 1), 90+any(-1,1); + } else { + Exception("ERROR, YOU SHOULD NOT BEEN SEEING THIS. 018-6-1.TFC"); + } end; OnInit: diff --git a/npc/items/teleporter.txt b/npc/items/teleporter.txt index 01a1af586..592817a75 100644 --- a/npc/items/teleporter.txt +++ b/npc/items/teleporter.txt @@ -33,7 +33,7 @@ OnUse: // It have at least 20% chance to break // Chances begin at 100%, and lower in 0.01% each second - // It will never be below 20%, which happens after 7000 seconds + // It will never be below 20%, which happens after 8000 seconds .@adj_breakrate=max(2000, 10000-(gettimetick(2)-TELEPORTER_TIME) ); //debugmes "Adjusted break ratio: %d", .@adj_breakrate; if (rand(0,10000) > .@adj_breakrate) -- cgit v1.2.3-70-g09d2 From 562263c15c5d2f7176f36454dadc61cf1a4b2f53 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 31 Aug 2019 00:31:36 -0300 Subject: Regenerate maps. Add a file with comments of internal state of Barbara quest. --- npc/015-8-1/_import.txt | 2 +- npc/018-6-0/ctrl | 29 +++++++++++++++++++++++++++++ npc/018-6-1/main.txt | 1 + npc/functions/game-rules.txt | 2 +- 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 npc/018-6-0/ctrl (limited to 'npc/018-6-1/main.txt') diff --git a/npc/015-8-1/_import.txt b/npc/015-8-1/_import.txt index d2ae0e8bb..016ede10f 100644 --- a/npc/015-8-1/_import.txt +++ b/npc/015-8-1/_import.txt @@ -1,4 +1,4 @@ -// Map 015-8-1: Cave Of Trials +// Map 015-8-1: Abandoned Ruins // This file is generated automatically. All manually added changes will be removed when running the Converter. "npc/015-8-1/campaign.txt", "npc/015-8-1/puzzle.txt", diff --git a/npc/018-6-0/ctrl b/npc/018-6-0/ctrl new file mode 100644 index 000000000..e1f7f6140 --- /dev/null +++ b/npc/018-6-0/ctrl @@ -0,0 +1,29 @@ +LoFQuest_Barbara +q1 + q3 + +-------------------------- +0 Quest not assigned +1 Quest was assigned + 0 No cutscene seen + 1 The wounded soldier seen + 2 The footprints seen +2 Forgotten Chamber Puzzle is in progress (warp on) + 0 No puzzle solved + 1 West puzzle solved (&) (west lever) + 2 East puzzle solved (&) (east lever) + 3 South puzzle unlocked (w/e lever) + 4 South puzzle node (e/w lever) + 5 South puzzle solved, access to shrine granted +3 Forgotten Shrine has been allowed (warp on / remember to reenable NPCs on resume) + Bitwise boss fights: + 1, 2, 4, 8, 16, 32, 64, 128, 256 (enable warps as win) + → Once the main shrine was reached: set to 511, Mana Stone story + & 512 => Boss defeated, cutscene ended, magic apple now visible +4 Ambush finished, return to elenium mines +5 Barbara captured +6 Reward claimed, Barbara Arrested +7 Reward claimed, Barbara NOT Arrested + +Field 2: Instance ID + diff --git a/npc/018-6-1/main.txt b/npc/018-6-1/main.txt index a12bb8672..89658dee9 100644 --- a/npc/018-6-1/main.txt +++ b/npc/018-6-1/main.txt @@ -99,6 +99,7 @@ OnInit: } +///////////////////////////// Minievents diff --git a/npc/functions/game-rules.txt b/npc/functions/game-rules.txt index e3242c53d..baa60f14c 100644 --- a/npc/functions/game-rules.txt +++ b/npc/functions/game-rules.txt @@ -29,7 +29,7 @@ function script GameRules { l("8. ##BThe use of real money is prohibited##b for ingame stuff, except by sponsoring."), l("9. ##BAdmit when you're wrong.##b Users trying to lie to or fool GMs will get no pity from them."), l("10. ##BDo not logout##b at Botcheck area or at Jail. We cannot unjail an offline player. The opposite of rule 9: If you believe you're right, keep your ground and explain calmly what happened. We'll calmly analyse the situation. If you were jailed without guilt, an apology will be sent to you, provided this rule is not broken."), - l("11. If you believe a GM is not being fair, or you believe your defense is being ignored, request a ##BCouncil Trial##b. It's your right. In a Council Trial, we'll have multiple people giving the veredict. Any player may be called to compose the council. All admins shall take part in it. An arragment relative to time and date is to be made."); + l("11. If you believe you are Not Guilty, but the GM deemed you guilty, request a ##BCouncil Trial##b. It's your right. In a Council Trial, we'll have multiple people giving the veredict. Any player may be called to compose the council. All admins shall take part in it. An arragment relative to time, date, and number of counsellors is to be made."); return; } -- cgit v1.2.3-70-g09d2 From 4c5fa3f86c7db895dab7dee6dcda8eefafe33f4e Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 31 Aug 2019 00:35:08 -0300 Subject: Minimal retry control on Forgotten Arcs. It's starting to get ready to receive logic. --- npc/018-6-1/main.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'npc/018-6-1/main.txt') diff --git a/npc/018-6-1/main.txt b/npc/018-6-1/main.txt index 89658dee9..5a1331aaf 100644 --- a/npc/018-6-1/main.txt +++ b/npc/018-6-1/main.txt @@ -85,9 +85,19 @@ OnInstanceInit: OnTouch: .@q=getq(LoFQuest_Barbara); + .@q2=getq2(LoFQuest_Barbara); + .@q3=getq3(LoFQuest_Barbara); if (.@q >= 1) { warp BarbaraInstCheck(0), 90, 91; - //warp BarbaraInstCheck(0), 90+any(-1, 1), 90+any(-1,1); + // Complete the first arc if possible + if (.@q == 1) { + setq1 LoFQuest_Barbara, 2; + setq3 LoFQuest_Barbara, 0; + } + // Update M0 NPCs based on quest state + if (.@q3 == 5) + enablenpc instance_npcname("#ToForgottenShrine", .@q2); + } else { Exception("ERROR, YOU SHOULD NOT BEEN SEEING THIS. 018-6-1.TFC"); } -- cgit v1.2.3-70-g09d2