From 7d7a0e015d77e2fd018f4d63241dd1008783f46f Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Tue, 28 Apr 2020 17:15:13 -0300 Subject: Guinevere - Automated spawn guards, says the right path for sewers --- npc/042-0/arthur.txt | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++ npc/042-1/door.txt | 2 +- npc/042-3/jail.txt | 3 + 3 files changed, 161 insertions(+), 1 deletion(-) diff --git a/npc/042-0/arthur.txt b/npc/042-0/arthur.txt index 878502077..075a7fa51 100644 --- a/npc/042-0/arthur.txt +++ b/npc/042-0/arthur.txt @@ -196,3 +196,160 @@ OnTouch: + + +042-0,86,27,0 script Guinevere NPC_GUINEVERE,{ + function guinevereSpawn; + .@g=getcharid(2); + .@pos=getguildrole(.@g, getcharid(3)); + if (.@pos > GPOS_VICELEADER) goto L_Refusal; + if ($KAMELOT_QUEST[.@g] & 1) goto L_Hint; + npctalk3 l("Oh, hello %s.", strcharinfo(0)); + +L_Refusal: + mesn; + mesq l("Hello, %s.", strcharinfo(0)); + next; + mesc "["+strcharinfo(0)+"]"; + mesc l("She doesn't seems to trust me... Maybe I should bring a guild vice-leader, or even better, the guild master himself."); + close; + +L_Hint: + mesc l("Guinevere is the King's Wife. If you talk to her, the King will be upset and will send soldiers to you."), 1; + next; + mesc l("However, she may have a better assessment of the current situation better than you and your allies."), 1; + next; + mesc l("Continue anyway? You'll die if your allies cannot protect you!"), 1; + next; + if (askyesno() == ASK_NO) + close; + + // Okay... So here we go (again), spawning monsters + guinevereSpawn(1); + mesn; + mesq l("Ah, %s, a good thing you're here. You must help!", strcharinfo(0)); + next; + guinevereSpawn(1); + mesn; + mesq l("Something very terrible happened."); + next; + guinevereSpawn(2); + mesn; + mesq l("They're back - and they took hold of your majesty - my husband - king Arthur!"); + next; + guinevereSpawn(2); + mesn; + mesq l("Of course, he doesn't likes the fact you're talking to me."); + next; + guinevereSpawn(3); + mesn; + mesq l("*They* couldn't take hold of me, but I'm bound to this castle; I can't leave."); + next; + guinevereSpawn(3); + mesn; + mesq l("They are in the basement, pulling the strings from behind."); + next; + guinevereSpawn(3); + mesn; + mesq l("The way is full of dangers. Not only king soldiers, but the beast has an army of their own!"); + next; + guinevereSpawn(4); + mesn; + mesq l("You need to be very careful. Use the sewers to reach... them."); + next; + guinevereSpawn(4); + mesn; + mesq l("Also, listen well, because there are traps and dangers on the whole way. Their leader sealed themselves in safety."); + next; + guinevereSpawn(5); + mesn; + mesq l("I'm afraid you'll need a key to reach them. But there's a fork on the way."); + next; + guinevereSpawn(3); + mesn; + switch ($KAMELOT_KEYMASK[.@g]) { + case 1: + .@path$=l("West"); break; + case 2: + .@path$=l("North West"); break; + case 4: + .@path$=l("North East"); break; + case 8: + .@path$=l("East"); break; + default: + .@path$=l("ERROR, REPORT ME: Invalid: %d", $KAMELOT_KEYMASK[.@g]); break; + } + mesq l("The key is on the sewer %s path. Be careful. May the light be with you.", b(.@path$)); + if ($KAMELOT_QUEST[.@g] & 2) + close; + next; + guinevereSpawn(5); + mesn; + mesq l("And one more thing..."); + next; + guinevereSpawn(2); + mesn; + mesq l("Take this with you. And please bring Arthur back, the world needs him!"); + $KAMELOT_QUEST[.@g]=$KAMELOT_QUEST[.@g]|2; + // Player Reward for completing this stage + getitem SacredImmortalityPotion, 1; + getitem GuildCoin, 5; + // Guild Reward for completing this stage + .@ggp=100+$KAMELOT_MX[.@g]*4; + .@gxp=$KAMELOT_MX[.@g]*2; + $GUILD_BANK[.@g]+=.@ggp; + guildgetexp(.@gxp); // 2xp per player average level (max 200/300) + // Guild Master Notification + .@gm$=getguildmaster(.@g); + if (!getcharid(3, .@gm$)) end; + .@gma=getcharid(3, .@gm$); + .@gmb=getcharid(0, .@gm$); + if (!isloggedin(.@gma, .@gmb)) end; + message .@gm$, strcharinfo(0)+" cleared Guinevere: Guild GP +"+.@ggp+" Guild XP +"+.@gxp; + close; + +function guinevereSpawn { + .@gcount=getarg(0); + .@g=getcharid(2); + if (.@g < 1) percentheal -100, -100; + .@avg=$KAMELOT_MX[.@g]; + .@m$=getmap(); + for (.@i=0; .@i < .@gcount; .@i++) { + .@mobId=CursedSoldier; + .@mob=areamonster(.@m$, 82, 26, 90, 34, strmobinfo(1, .@mobId), .@mobId, 1, .@label$); + // Reconfigure the monster + setunitdata(.@mob, UDT_LEVEL, .@avg); + setunitdata(.@mob, UDT_STR, 1+.@avg/6); + setunitdata(.@mob, UDT_AGI, 1+.@avg/7); + setunitdata(.@mob, UDT_VIT, 1+.@avg/6); + setunitdata(.@mob, UDT_INT, 1+.@avg/6); + setunitdata(.@mob, UDT_DEX, 1+.@avg/7); + setunitdata(.@mob, UDT_LUK, 1+.@avg/6); + setunitdata(.@mob, UDT_ADELAY, 2072); + setunitdata(.@mob, UDT_ATKRANGE, 1); + // Battle Status + setunitdata(.@mob, UDT_MAXHP, .@avg*20); + setunitdata(.@mob, UDT_HP, .@avg*20); + setunitdata(.@mob, UDT_ATKMIN, .@avg*3); + setunitdata(.@mob, UDT_ATKMAX, .@avg*5); + setunitdata(.@mob, UDT_DEF, 1+.@avg*6/10); + setunitdata(.@mob, UDT_MDEF, 1+.@avg*3/10); + setunitdata(.@mob, UDT_HIT, .@avg*3); // Advised: x3 + setunitdata(.@mob, UDT_FLEE, .@avg*25/10); // Advised: x4 + // Critical calculation + .@min=1; + .@max=max(.@min, min(15, .@avg/6)); + setunitdata(.@mob, UDT_CRIT, rand2(.@min, .@max)); + // Loop through + } + freeloop(false); + return; +} + +OnInit: +OnInstanceInit: + .distance=4; + .sex=G_FEMALE; + end; +} + diff --git a/npc/042-1/door.txt b/npc/042-1/door.txt index 6b56784f0..a24e96eb4 100644 --- a/npc/042-1/door.txt +++ b/npc/042-1/door.txt @@ -29,7 +29,7 @@ OnKillBoss: // Guild Reward for completing this stage .@ggp=300+$KAMELOT_MX[.@g]*4; .@gxp=$KAMELOT_MX[.@g]*5; - $GUILD_BANK[.@g]+=500; + $GUILD_BANK[.@g]+=.@ggp; guildgetexp(.@gxp); // 5xp per player average level (max 500/750) // Announce mapannounce getmap(), strcharinfo(0)+" has found the key for the door!", 0; diff --git a/npc/042-3/jail.txt b/npc/042-3/jail.txt index da738121d..038fe69ed 100644 --- a/npc/042-3/jail.txt +++ b/npc/042-3/jail.txt @@ -66,6 +66,7 @@ function script KamelotLockpick { KamelotLockpick(.x, .y); close; OnInit: +OnInstanceInit: .distance=1; end; } @@ -84,3 +85,5 @@ OnInit: 042-3,38,27,0 duplicate(Cell Door#K01) Cell Door#K12 NPC_NO_SPRITE + + -- cgit v1.2.3-60-g2f50