From f92ef074086b531aa83ab638516d87478947310d Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Wed, 27 May 2020 18:22:59 +0000 Subject: At least, now you can reach Argaes. Poorly balanced. --- npc/001-1/sophialla.txt | 14 ++ npc/001-2-32/doors.txt | 23 +++- npc/001-2-32/serena.txt | 232 +++++++++++++++++++++++++++------ npc/001-2-34/doors.txt | 2 +- npc/001-2-34/samantha.txt | 38 ++++++ npc/001-2-35/_import.txt | 1 + npc/001-2-35/doors.txt | 19 +++ npc/001-2-35/mapflags.txt | 1 + npc/001-2-36/hector.txt | 1 + npc/001-2-5/tutorial.txt | 8 +- npc/001-3-0/mundane.txt | 4 +- npc/functions/global_event_handler.txt | 2 + npc/functions/scoreboards.txt | 22 ++++ 13 files changed, 319 insertions(+), 48 deletions(-) create mode 100644 npc/001-2-35/doors.txt diff --git a/npc/001-1/sophialla.txt b/npc/001-1/sophialla.txt index d2bb6760..0671307b 100644 --- a/npc/001-1/sophialla.txt +++ b/npc/001-1/sophialla.txt @@ -18,6 +18,7 @@ l("Hello."), l("Can't you see I am reading? If you need something, tell me the secret password."); // TODO: Use a token to know password or whatever + // PS. "Sagratha" is not a typo. select l("Sorry to disturb you."), rif(getq(ArtisQuests_MonaDad) == 3, l("Sagratha is great.")), @@ -31,6 +32,19 @@ l("Look for the hideout, but tell no one about this. Then, say the password again."); compareandsetq General_Brotherhood, 1, 2; } + else if (@menu == 3) + { + mesn; + mesq l("If I just told you, it would not be a password anymore, right?"); + next; + mesn; + mesq l("I'm afraid you'll need to figure that out on your own."); + next; + mesn; + mesq l("This password is very secret. I don't think you would learn it even if you rescued someone missing for weeks."); // FIXME: Provide a decent hint. + next; + mesc l("%s sighs.", .name$); + } speech lg("If you don't know it, just go, please."); diff --git a/npc/001-2-32/doors.txt b/npc/001-2-32/doors.txt index ba33200f..828366d2 100644 --- a/npc/001-2-32/doors.txt +++ b/npc/001-2-32/doors.txt @@ -1,23 +1,38 @@ // Evol scripts. // Author: // Reid +// Jesusalva // Description: // Doors NPCs. 001-2-32,33,29,0 script ToFightRoom#001-2-32 NPC_HIDDEN,0,0,{ OnTouch: - if (mobcount("001-2-35","all") > 0) + if (getq(Artis_Legion_Progress) < 3) { narrator l("You hear some sound behind the door."), - l("Somebody is probably training, better wait for him to finish."); + l("Somebody is probably training, better wait for them to finish."); } else { - warp "001-2-35", 24, 29; + .@q2=getq2(Artis_Legion_Progress); + .@mapn$="atl2@"+getcharid(0); + // FIXME This code is extremely unreliable + if (isinstance(.@q2) && .@q2 >= 0) + { + instance_set_timeout(3600, 3600, .@q2); + warp .@mapn$, 24, 29; + } else { + .@inst = instance_create("ATL "+getcharid(0), getcharid(3), IOT_CHAR); + instance_attachmap("001-2-35", .@inst, false, .@mapn$); + // Instance lasts one hour + instance_set_timeout(3600, 3600, .@inst); + instance_init(.@inst); + setq2 Artis_Legion_Progress, .@inst; + } + } - closeclientdialog; close; } diff --git a/npc/001-2-32/serena.txt b/npc/001-2-32/serena.txt index fa650ef1..8b8f92d4 100644 --- a/npc/001-2-32/serena.txt +++ b/npc/001-2-32/serena.txt @@ -1,50 +1,24 @@ -// Evol scripts. +// The Mana World scripts. // Author: // Reid +// Jesusalva // Description: // Artis's Legion of Aemil officier of the fighting room. +// Note: +// ATL - Artis Training Legion 001-2-32,27,27,0 script Serena NPC_SERENA,{ mesn; mesq lg("Oh darling, what brought you here?"); // TRANSLATORS: Darling - Expresses familiarity or elderliness in relation to PC. - - // - // [ PC]: I was just looking around. - // [NPC]: Did not someone offer guidance? - // [NPC]: Enora was supposed to be helping you... - // [NPC]: ...but, she is young, and often absent-minded; did you ask? - // [NPC]: (Alt.) It seems you rushed ahead of her. Go back and talk to Enora. - // ([Enora]: Beyond here is the fighting room o_o;) - // ([Enora]: I... uh... well, you will need alies in there.) - // ([Enora]: And... you see... this is my good outfit and...) - // ([Enora]: ...I've only just cleaned up in there >.>) - // But if you keep getting stronger; that will be the day. - - // Alt-Ready: - // [NPC]: Beyond here is the Fight Room. - // [NPC]: [conditions]* - // [NPC]: Good-luck | Bonne-chance. - - // (Alt.) [NPC]: I used to be an adventurer, like you. - // [NPC]: But there was no one to join for quests. - // [NPC]: So I enlisted for a post at this chapter. - // [NPC]: But my "friends" joined the Brotherhood! - - // [NPC]: The Brotherhood knows a lot more about monsters. - // [NPC]: But they could not "break the Legion's power" without burning all cities to the ground. - // [NPC]: The cities grow fast, ruining farmers and peasants. - // [NPC]: Our differences lead to friction. - - // Alt-What - // The secret is out: We really did create a mutant. - // None of the members were informed until it went out-of-control. - // [...] - // Muahaha-ha! My beautiful mutant. The city of Artis is mine. - // - - // Alt-Siege - // The city is being attacked. Go help the warriors and town-guard. - + next; + select + l("I wanna fight."), + l("Nothing."); + mes ""; + if (@menu == 1) { + mes l("Just walk right and talk to me. I'll be there in no time."); + mesc l("Challenge time limit: 60 minutes after entering the room."); + } close; OnInit: @@ -53,3 +27,183 @@ OnInit: end; } +001-2-35,26,27,0 script Serena#Ctrl NPC_SERENA,{ + function checkVictory; + + // We can't begin if we're already doing it + if (.atlf) { + // TODO: We should check if the timers are running + //doevent(instance_npcname(.name$)+"::OnVerify"); + if (getq(Artis_Legion_Progress) == 4) + npctalk l("You're already done with the training, so feel free to leave."); + else + npctalk l("Focus on the fight!"); + end; + } + + // Otherwise, begin it + mesn; + mesq l("Are you ready for your training?"); + next; + if (askyesno() == ASK_NO) { + mesn; + mesq l("Oh dear, please come back later then."); + close; + } + @ATLFIGHT=true; + // FALL THROUGH + +OnBegin: + mapannounce getmap(), l("Training Arena, %s, get ready!", strcharinfo(0)), bc_all; + // Save permanent data + .atl_blv=BaseLevel; + .atl_Str=readbattleparam(getcharid(3), UDT_STR); + .atl_Agi=readbattleparam(getcharid(3), UDT_AGI); + .atl_Vit=readbattleparam(getcharid(3), UDT_VIT); + .atl_Int=readbattleparam(getcharid(3), UDT_INT); + .atl_Dex=readbattleparam(getcharid(3), UDT_DEX); + .atl_Luk=readbattleparam(getcharid(3), UDT_LUK); + .atl_Dly=readbattleparam(getcharid(3), UDT_ADELAY); + .atl_Rng=readbattleparam(getcharid(3), UDT_ATKRANGE); + + // Save (b)ase data + .atl_bhp=MaxHp; + .atl_bAtk1=readbattleparam(getcharid(3), UDT_ATKMIN); + .atl_bAtk2=readbattleparam(getcharid(3), UDT_ATKMAX); + .atl_bMatk=readbattleparam(getcharid(3), UDT_MATKMAX); + .atl_bDef=readbattleparam(getcharid(3), UDT_DEF); + .atl_bMdef=readbattleparam(getcharid(3), UDT_MDEF); + .atl_bHit=readbattleparam(getcharid(3), UDT_FLEE)*8/10; + .atl_bFlee=readbattleparam(getcharid(3), UDT_HIT)*7/10; + .atl_bCrit=readbattleparam(getcharid(3), UDT_CRIT); + + // Save (p)rogression data + .atl_php=.atl_bhp/6; + .atl_pAtk1=.atl_bAtk1/12; + .atl_pAtk2=.atl_bAtk2/12; + .atl_pMatk=.atl_bMatk/5; + .atl_pDef=.atl_bDef/5; + .atl_pMdef=.atl_bMdef/5; + .atl_pHit=.atl_bFlee/10; + .atl_pFlee=.atl_bHit/15; + .atl_pCrit=.atl_bCrit/10; + + // Begin the battle + doevent(instance_npcname(.name$)+"::OnGladius"); + addtimer(5000, instance_npcname(.name$)+"::OnVerify"); + closeclientdialog; + close; + +OnGladius: + sleep(800); + // TODO: Coordinates, Helpers? + .@mg=monster(instance_mapname("001-2-35"), any(25, 30, 35), any(29, 35, 40, 46), "Gladiator", any(LegionSwordswoman, LegionHalberdier, LegionLieutenant, LegionLieutenant), 1, instance_npcname(.name$)+"::OnGladius"); + + // Set "permanent" data + setunitdata(.@mg, UDT_ADELAY, .atl_Dly-.atlf); + setunitdata(.@mg, UDT_ATKRANGE, .atl_Rng+cap_value(.atlf/10, 0, 3)); + + // Set base data + setunitdata(.@mg, UDT_LEVEL, .atl_blv+.atlf); + setunitdata(.@mg, UDT_STR, .atl_Str+.atlf); + setunitdata(.@mg, UDT_AGI, .atl_Agi+.atlf); + setunitdata(.@mg, UDT_VIT, .atl_Vit+.atlf); + setunitdata(.@mg, UDT_INT, .atl_Int+.atlf); + setunitdata(.@mg, UDT_DEX, .atl_Dex+.atlf); + setunitdata(.@mg, UDT_LUK, .atl_Luk+.atlf); + + // Set variable data + setunitdata(.@mg, UDT_MAXHP, .atl_bhp+.atl_php*(.atlf-1)); + setunitdata(.@mg, UDT_HP, .atl_bhp+.atl_php*(.atlf-1)); + + setunitdata(.@mg, UDT_ATKMIN, .atl_bAtk1+.atl_pAtk1*(.atlf-1)); + setunitdata(.@mg, UDT_ATKMAX, .atl_bAtk2+.atl_pAtk2*(.atlf-1)); + setunitdata(.@mg, UDT_MATKMIN, .atl_bMatk+.atl_pMatk*(.atlf-1)); + setunitdata(.@mg, UDT_MATKMAX, .atl_bMatk+.atl_pMatk*(.atlf-1)); + setunitdata(.@mg, UDT_DEF, .atl_bDef+.atl_pDef*(.atlf-1)); + setunitdata(.@mg, UDT_MDEF, .atl_Mdef+.atl_pMdef*(.atlf-1)); + setunitdata(.@mg, UDT_HIT, .atl_bHit+.atl_pHit*(.atlf-1)); + setunitdata(.@mg, UDT_FLEE, .atl_bFlee+.atl_pFlee*(.atlf-1)); + setunitdata(.@mg, UDT_CRIT, .atl_bCrit+.atl_pCrit*(.atlf-1)); + + setunitdata(.@mg, UDT_PDODGE, min(30, .atl_Luk/10+(.atlf/3))); + + .atlf+=1; + mapannounce instance_mapname("001-2-35"), ("Training Arena, wave " + .atlf + "!"), bc_all; + maptimer(instance_mapname("001-2-35"), 10, instance_npcname(.name$)+"::OnATLUpdate"); + end; + +OnATLUpdate: + if (.atlf > ATLRANK) + ATLRANK=.atlf; + getexp .atlf*7, .atlf*5; // Provide some reward + end; + +// Check for possible cheats, and update default values +OnVerify: + if (!.atlf) + end; + + if (readbattleparam(getcharid(3), UDT_ATKRANGE) > .atl_Rng) + .atl_Rng=readbattleparam(getcharid(3), UDT_ATKRANGE); + + if (readbattleparam(getcharid(3), UDT_ATKMAX) > .atl_bAtk1) { + .atl_bAtk1=readbattleparam(getcharid(3), UDT_ATKMIN); + .atl_bAtk2=readbattleparam(getcharid(3), UDT_ATKMAX); + .atl_pAtk1=.atl_bAtk1/10; + .atl_pAtk2=.atl_bAtk2/10; + } + + if (readbattleparam(getcharid(3), UDT_DEF) > .atl_bDef) { + .atl_bDef=readbattleparam(getcharid(3), UDT_DEF); + .atl_pDef=.atl_bDef/5; + } + + if (readbattleparam(getcharid(3), UDT_MDEF) > .atl_bMdef) { + .atl_bMdef=readbattleparam(getcharid(3), UDT_MDEF); + .atl_pMdef=.atl_bMdef/5; + } + + if (readbattleparam(getcharid(3), UDT_MATKMAX) > .atl_bMatk) { + .atl_bMatk=readbattleparam(getcharid(3), UDT_MATKMAX); + .atl_pMatk=.atl_bMatk/5; + } + + // TODO: Ignore haste potion effects + // TODO: Update battle statuses on the fly + if (readbattleparam(getcharid(3), UDT_ADELAY) < .atl_bDly) + .atl_bDly=readbattleparam(getcharid(3), UDT_DELAY); + + // Victory conditions + if (getq(Artis_Legion_Progress) == 3) + checkVictory(); + + addtimer(5000, instance_npcname(.name$)+"::OnVerify"); + end; + + // Victory conditions + function checkVictory { + if (.atlf > 3) { + npctalk l("Congratulations, %s. I think this is enough. You can continue fighting to set a good score or report to Lozerk.", strcharinfo(0)); + // Duplicate the dialog in case player miss it + dispbottom l("Congratulations, %s. I think this is enough. You can continue fighting to set a good score or report to Lozerk.", strcharinfo(0)); + setq Artis_Legion_Progress, 4, 0; + } + return; + } + +} + +// Helper function for failure +function script ATLFightEnd { + if (@ATLFIGHT) { + @ATLFIGHT=false; + .@mapn$="atl2@"+getcharid(0); + killmonster(.@mapn$, "all", false); + .@q2=getq2(Artis_Legion_Progress); + set(getvariableofnpc(.atlf, instance_npcname("Serena#Ctrl", .@q2)), 0); + } + return; +} + + diff --git a/npc/001-2-34/doors.txt b/npc/001-2-34/doors.txt index e2ffee1f..6161dfa4 100644 --- a/npc/001-2-34/doors.txt +++ b/npc/001-2-34/doors.txt @@ -10,7 +10,7 @@ 001-2-34,23,29,0 script ToTrainingRoom#001-2-34 NPC_HIDDEN,0,0,{ OnTouch: - .@q2=getq2(ArtisQuests_TrainingLegion); + .@q2=getq2(ArtisQuests_TrainingLegion); // Map name limit: 4 chars (atl1) .@mapn$="atl1@"+getcharid(0); if (isinstance(.@q2) && .@q2 > 0) { diff --git a/npc/001-2-34/samantha.txt b/npc/001-2-34/samantha.txt index a571ccf6..d7fe5c08 100644 --- a/npc/001-2-34/samantha.txt +++ b/npc/001-2-34/samantha.txt @@ -3,12 +3,50 @@ // Reid // Description: // Artis's Legion of Aemil officier of the training room. +// Twin sister of Serena. 001-2-34,29,27,0 script Samantha NPC_SAMANTHA,{ mesn; mesq lg("Look who we have here, did you come for a training session?"); close; + // + // [ PC]: I was just looking around. + // [NPC]: Did not someone offer guidance? + // [NPC]: Enora was supposed to be helping you... + // [NPC]: ...but, she is young, and often absent-minded; did you ask? + // [NPC]: (Alt.) It seems you rushed ahead of her. Go back and talk to Enora. + // ([Enora]: Beyond here is the fighting room o_o;) + // ([Enora]: I... uh... well, you will need alies in there.) + // ([Enora]: And... you see... this is my good outfit and...) + // ([Enora]: ...I've only just cleaned up in there >.>) + // But if you keep getting stronger; that will be the day. + + // Alt-Ready: + // [NPC]: Beyond here is the Fight Room. + // [NPC]: [conditions]* + // [NPC]: Good-luck | Bonne-chance. + + // (Alt.) [NPC]: I used to be an adventurer, like you. + // [NPC]: But there was no one to join for quests. + // [NPC]: So I enlisted for a post at this chapter. + // [NPC]: But my "friends" joined the Brotherhood! + + // [NPC]: The Brotherhood knows a lot more about monsters. + // [NPC]: But they could not "break the Legion's power" without burning all cities to the ground. + // [NPC]: The cities grow fast, ruining farmers and peasants. + // [NPC]: Our differences lead to friction. + + // Alt-What + // The secret is out: We really did create a mutant. + // None of the members were informed until it went out-of-control. + // [...] + // Muahaha-ha! My beautiful mutant. The city of Artis is mine. + // + + // Alt-Siege + // The city is being attacked. Go help the warriors and town-guard. + OnInit: .sex = G_FEMALE; .distance = 3; diff --git a/npc/001-2-35/_import.txt b/npc/001-2-35/_import.txt index 797b852a..fa2c779b 100644 --- a/npc/001-2-35/_import.txt +++ b/npc/001-2-35/_import.txt @@ -1,3 +1,4 @@ // Map 001-2-35: Training Arena // This file is generated automatically. All manually added changes will be removed when running the Converter. +"npc/001-2-35/doors.txt", "npc/001-2-35/mapflags.txt", diff --git a/npc/001-2-35/doors.txt b/npc/001-2-35/doors.txt new file mode 100644 index 00000000..64fcb30f --- /dev/null +++ b/npc/001-2-35/doors.txt @@ -0,0 +1,19 @@ +// Evol scripts. +// Author: +// Jesusalva +// Description: +// Doors NPCs. + +001-2-35,23,29,0 script #001-2-35_23_29 NPC_HIDDEN,0,0,{ + end; + +OnTouch: + if (getq(Artis_Legion_Progress) < 4) { + dispbottom l("I am not a coward. I shall not give up!"); + end; + } + ATLFightEnd(); + warp "001-2-32", 32, 29; + end; +} + diff --git a/npc/001-2-35/mapflags.txt b/npc/001-2-35/mapflags.txt index df3ed6a0..47166d55 100644 --- a/npc/001-2-35/mapflags.txt +++ b/npc/001-2-35/mapflags.txt @@ -1 +1,2 @@ 001-2-35 mapflag town +001-2-35 mapflag nowarpto diff --git a/npc/001-2-36/hector.txt b/npc/001-2-36/hector.txt index d25ca9e3..3b16ca10 100644 --- a/npc/001-2-36/hector.txt +++ b/npc/001-2-36/hector.txt @@ -449,6 +449,7 @@ OnInit: .currentWaveLevel = 1; .fightingActive = 0; + // TODO FIXME translation // here input some sentences "hello noob" like, the npc pick randomly a sentence setarray .mockingGreeting$[0], "Hey noob!", "Hey somethingwholooklikeawarrior...", "Sup' chibi."; setarray .mobID[0],0, Dummy, FireDummy, Dummy; // an array of dummies, one for each training diff --git a/npc/001-2-5/tutorial.txt b/npc/001-2-5/tutorial.txt index 8576db0f..7d9b429f 100644 --- a/npc/001-2-5/tutorial.txt +++ b/npc/001-2-5/tutorial.txt @@ -243,12 +243,16 @@ OnShelfUse: if (openbookshelf()) - read_book; + read_book(); close; OnUse: if (openbook()) - read_book; + read_book(); + close; + +OnRemoteHelp: + read_book(); close; OnInit: diff --git a/npc/001-3-0/mundane.txt b/npc/001-3-0/mundane.txt index 01cde3e8..2d03dbec 100644 --- a/npc/001-3-0/mundane.txt +++ b/npc/001-3-0/mundane.txt @@ -183,13 +183,13 @@ OnInstanceInit: } function script MundaneLogout { - if (getq(ArtisQuests_MonaDad) != 2) end; + if (getq(ArtisQuests_MonaDad) != 2) return; setq ArtisQuests_MonaDad, 1; return; } function script MundaneDeath { - if (getq(ArtisQuests_MonaDad) != 2) end; + if (getq(ArtisQuests_MonaDad) != 2) return; setq ArtisQuests_MonaDad, 1; dispbottom l("What a pity! You've died."); diff --git a/npc/functions/global_event_handler.txt b/npc/functions/global_event_handler.txt index c66637ef..a6d634ed 100644 --- a/npc/functions/global_event_handler.txt +++ b/npc/functions/global_event_handler.txt @@ -30,6 +30,7 @@ OnPCLogoutEvent: callfunc("UnequipCookie"); callfunc("MundaneLogout"); callfunc("fishing_cleanup", @fishing_spot$); + callfunc("ATLFightEnd"); // Variable cleanup @fishing_spot$ = ""; @@ -38,6 +39,7 @@ OnPCLogoutEvent: OnPCDieEvent: callfunc("ForcedUnmount"); callfunc("MundaneDeath"); + callfunc("ATLFightEnd"); end; OnPCBaseLvUpEvent: diff --git a/npc/functions/scoreboards.txt b/npc/functions/scoreboards.txt index 0dd54b23..120425ee 100644 --- a/npc/functions/scoreboards.txt +++ b/npc/functions/scoreboards.txt @@ -101,6 +101,22 @@ function script HallOfAcorns { return; } +function script HallOfATL { + mes ""; + mes l("##BHall Of Artis Legion Training Arena: TOP10##b"); + mesf("1. %s (%d)", $@atl_name$[0], $@atl_value[0]); + mesf("2. %s (%d)", $@atl_name$[1], $@atl_value[1]); + mesf("3. %s (%d)", $@atl_name$[2], $@atl_value[2]); + mesf("4. %s (%d)", $@atl_name$[3], $@atl_value[3]); + mesf("5. %s (%d)", $@atl_name$[4], $@atl_value[4]); + mesf("6. %s (%d)", $@atl_name$[5], $@atl_value[5]); + mesf("7. %s (%d)", $@atl_name$[6], $@atl_value[6]); + mesf("8. %s (%d)", $@atl_name$[7], $@atl_value[7]); + mesf("9. %s (%d)", $@atl_name$[8], $@atl_value[8]); + mesf("10. %s (%d)", $@atl_name$[9], $@atl_value[9]); + return; +} + // HallOfGame() function script HallOfGame { if ($MOST_HEROIC$) @@ -159,6 +175,7 @@ OnInit: .@nb = query_sql("select name, job_level from `char` ORDER BY job_level DESC LIMIT 15", $@hojlvl_name$, $@hojlvl_value); .@nb = query_sql("select name, guild_lv from `guild` ORDER BY guild_lv DESC LIMIT 5", $@hoguild_name$, $@hoguild_value); .@nb = query_sql("SELECT c.name, i.amount FROM `storage` AS i, `char` AS c WHERE i.nameid="+Acorn+" AND i.account_id=c.account_id ORDER BY i.amount DESC LIMIT 15", $@hoa_name$, $@hoa_value); + .@nb = query_sql("SELECT c.name, i.value FROM `char_reg_num_db` AS i, `char` AS c WHERE i.key='ATLRANK' AND i.char_id=c.char_id ORDER BY i.value DESC LIMIT 10", $@atl_name$, $@atl_value); consolemes(CONSOLEMES_DEBUG, "Scoreboards reloaded"); if (!$@SCOREBOARD_BIND) { bindatcmd "scoreboard", "@scoreboard::OnCall", 0, 100, 0; @@ -180,6 +197,7 @@ OnCall: l("Hall Of Job Level"), l("Hall Of Guilds"), l("Hall Of Acorns"), + l("Hall Of Artis Legion Training Arena"), l("Game Statistics"), l("Quit"); mes ""; @@ -205,6 +223,10 @@ OnCall: next; break; case 6: + HallOfATL(); + next; + break; + case 7: HallOfGame(); next; break; -- cgit v1.2.3-60-g2f50