diff options
-rw-r--r-- | maps/re/016-8.mcache | bin | 0 -> 160 bytes | |||
-rw-r--r-- | npc/000-0-0/chest.txt | 1 | ||||
-rw-r--r-- | npc/000-0-0/sailors.txt | 3 | ||||
-rw-r--r-- | npc/016-1/captain.txt | 6 | ||||
-rw-r--r-- | npc/016-6/main.txt | 4 | ||||
-rw-r--r-- | npc/016-7/main.txt | 3 | ||||
-rw-r--r-- | npc/016-8/_import.txt | 4 | ||||
-rw-r--r-- | npc/016-8/_mobs.txt | 3 | ||||
-rw-r--r-- | npc/016-8/main.txt | 120 | ||||
-rw-r--r-- | npc/_import.txt | 1 | ||||
-rw-r--r-- | npc/functions/maze.txt | 3 |
11 files changed, 145 insertions, 3 deletions
diff --git a/maps/re/016-8.mcache b/maps/re/016-8.mcache Binary files differnew file mode 100644 index 000000000..0a34a1d19 --- /dev/null +++ b/maps/re/016-8.mcache diff --git a/npc/000-0-0/chest.txt b/npc/000-0-0/chest.txt index fdd287303..c574190b8 100644 --- a/npc/000-0-0/chest.txt +++ b/npc/000-0-0/chest.txt @@ -14,6 +14,7 @@ // 2 Has the clothes. 000-0-0,36,34,0 script Chest#002-1 NPC_CHEST_BIG,2,4,{ + if (getq(General_Narrator)) end; .@questState = getq(ShipQuests_Arpan); diff --git a/npc/000-0-0/sailors.txt b/npc/000-0-0/sailors.txt index b06b3a521..ec87d85b4 100644 --- a/npc/000-0-0/sailors.txt +++ b/npc/000-0-0/sailors.txt @@ -7,6 +7,7 @@ 000-0-0,30,34,0 script Elmo#sailors NPC_ELMO,{ OnBegin: + if (getq(General_Narrator)) end; .@q = getq(ShipQuests_Arpan); if (.@q == 0) goto L_Step0; if (.@q == 1) goto L_Step1; @@ -255,6 +256,7 @@ L_Step5: OnSkip: L_Skip: + if (getq(General_Narrator)) end; setq ShipQuests_Arpan, 5; getitem CreasedShirt, 1; getitem CreasedShorts, 1; @@ -262,6 +264,7 @@ L_Skip: equip(CreasedShorts); L_Ready: + if (getq(General_Narrator)) end; //clearitem(); // The dummy does not drop anything :> if (!##VAULT) resetlvl(2); diff --git a/npc/016-1/captain.txt b/npc/016-1/captain.txt index 5421d01a3..9b864ca6c 100644 --- a/npc/016-1/captain.txt +++ b/npc/016-1/captain.txt @@ -166,8 +166,12 @@ L_DoWarp: // 10% base chance of Pirate Attack! // Each level INCREASES this in 0.1%. // So for a level 40 player, chances are 14%. - if (rand(1, 10000) < 1000+(BaseLevel*10)) + if (rand2(1+REBIRTH) && isequippedcnt(CorsairHat, PirateBandana, SailorShirt)) + .@do_nothing = 0; // up to 80% chance to bypass any attack + else if (false && rand(1+(REBIRTH*6), 10000) < 1000+(BaseLevel*10)) addtimer rand(3000,6000), "#MarineShipAttack::OnEvent"; + else if (is_staff() && REBIRTH && BaseLevel >= 32 && $GAME_STORYLINE >= 4 && rand(10000) < 1000+(BaseLevel*12) || true) + addtimer rand(4500,9000), "#MarineShipAttack2::OnEvent"; end; diff --git a/npc/016-6/main.txt b/npc/016-6/main.txt index 6f6200705..afe65c9b6 100644 --- a/npc/016-6/main.txt +++ b/npc/016-6/main.txt @@ -58,6 +58,10 @@ L_CleanUp: killmonster("016-7", "#MarineShipAttack::OnVictory"); monster "016-7", 38, 27, "Pirate Captain", OceanPirate, "#MarineShipAttack::OnVictory"; } + // Clean up frigate ship, if needed. + if (mobcount("016-8", "all") && !getmapusers("016-8")) { + killmonster("016-8", "all"); + } end; } diff --git a/npc/016-7/main.txt b/npc/016-7/main.txt index 7dcf5637c..4021cd730 100644 --- a/npc/016-7/main.txt +++ b/npc/016-7/main.txt @@ -18,7 +18,7 @@ OnEvent: OnStart: // Define number of pirates based on player level. // Player count is not important here, as this is run for every player. - .@c=(BaseLevel/15); + .@c=max(1, (BaseLevel/15)); areamonster "016-7", 23, 25, 51, 30, strmobinfo(1, OceanPirate), OceanPirate, .@c, "#MarineShipAttack::OnPirateDie"; end; @@ -48,7 +48,6 @@ OnReward: // Lv 40 rewards: 400 exp, 40 jxp, 200~600 GP getexp BaseLevel*10, BaseLevel; Zeny=Zeny+BaseLevel*rand2(5,15); - //getitem SailorShirt, 1; // I already tried to do this before...? // 7% chance to get Crazy Rum if (rand2(10000) < 700+(readparam2(bLuk)*3)) getitem CrazyRum, 1; diff --git a/npc/016-8/_import.txt b/npc/016-8/_import.txt new file mode 100644 index 000000000..01f003af6 --- /dev/null +++ b/npc/016-8/_import.txt @@ -0,0 +1,4 @@ +// Map 016-8: Pirate Attack +// This file is generated automatically. All manually added changes will be removed when running the Converter. +"npc/016-8/_mobs.txt", +"npc/016-8/main.txt", diff --git a/npc/016-8/_mobs.txt b/npc/016-8/_mobs.txt new file mode 100644 index 000000000..d8727365c --- /dev/null +++ b/npc/016-8/_mobs.txt @@ -0,0 +1,3 @@ +// This file is generated automatically. All manually added changes will be removed when running the Converter. +// Map 016-8: Pirate Attack mobs +016-8,37,41,14,16 monster Ocean Croc 1133,4,96000,90000 diff --git a/npc/016-8/main.txt b/npc/016-8/main.txt new file mode 100644 index 000000000..e702331dc --- /dev/null +++ b/npc/016-8/main.txt @@ -0,0 +1,120 @@ +// TMW2 script +// Author: +// Jesusalva +// Description: +// Handles pirate attacks + +016-8,0,0,0 script #MarineShipAttack2 NPC_HIDDEN,{ + end; + +OnEvent: + // TODO: Make this an instance? + warp "016-8", 31, 33; + dispbottom l("##1The ship is under a pirate's raid! ##BKill both ship captains before they conclude the loot!"); + // How much time you have depend on how many rebirths you have + .@time = (90 - (REBIRTH*5)) * 1000; + addtimercount "#MarineShip::OnEvent", .@time+1000; + addtimer(.@time, "#MarineShipAttack2::OnDefeat"); + sleep2(1000); + goto OnStart; + +OnDefeat: + warp "000-0-0", 47, 42; + // TODO: Warp you to a deserted island? (alone or with the crew duplicates?) + dispbottom l("The ship was fully plundered and you were thrown in the sea."); + dispbottom l("You now must wait for a passing ship to rescue you and bring you to your original destination."); + // Maybe warp back to Candor instead? + addtimer 90000, "#MarineShipAttack2::OnResumeTravel"; + addtimercount "#MarineShip::OnEvent", 120000; + end; + +OnStart: + // TODO: If "OnDefeat" timer is not set, jump to OnDefeat automatically! + // Define number of pirates based on player level. + // Player count is not important here, as this is run for every player. + .@c=max(1, (BaseLevel/15)-REBIRTH); + areamonster "016-8", 23, 25, 51, 30, strmobinfo(1, OceanPirate), OceanPirate, .@c, "#MarineShipAttack2::OnPirateDie"; + areamonster "016-8", 23, 40, 51, 57, strmobinfo(1, OceanPirate), OceanPirate, .@c, "#MarineShipAttack2::OnPirateDie"; + // And the stronger pirates (Blanc's Crew) + .@r=max(1,REBIRTH); + areamonster "016-8", 23, 40, 47, 57, strmobinfo(1, Thug), Thug, .@r, "#MarineShipAttack2::OnPirateDie"; + areamonster "016-8", 23, 40, 47, 57, strmobinfo(1, Swashbuckler), Swashbuckler, .@r, "#MarineShipAttack2::OnPirateDie"; + areamonster "016-8", 23, 40, 47, 57, strmobinfo(1, Grenadier), Grenadier, .@r, "#MarineShipAttack2::OnPirateDie"; + end; + +OnDie: + // Each OPTIONAL pirate you defeat gives you only 4 seconds! + addtimercount "#MarineShip::OnEvent", 4000; + addtimercount "#MarineShipAttack2::OnDefeat", 4000; + end; + +OnPirateDie: + if (rand2(10000) < REBIRTH) + getitem PirateBandana, 1; + // Each pirate you defeat gives you 8 seconds + addtimercount "#MarineShip::OnEvent", 8000; + addtimercount "#MarineShipAttack2::OnDefeat", 8000; + // If all pirates are dead the bosses spawn + if (!mobcount("016-8", "#MarineShipAttack2::OnPirateDie")) { + // You get 18 seconds to defeat each boss, the first boss is additional time. + addtimercount "#MarineShip::OnEvent", 18000; + addtimercount "#MarineShipAttack2::OnDefeat", 18000; + mapannounce "016-8", l("The frigate and pirate ship captains appear! DEFEAT BOTH BEFORE THE SHIP IS LOOTED!!"), bc_map; + // *** + .@pirate=monster("016-8", 38, 27, "Pirate Captain", Grenadier, 1, "#MarineShipAttack2::OnVictory"); + sc_start SC_INCMHP, 900000, 1000, 10000, SCFLAG_FIXEDTICK|SCFLAG_NOAVOID|SCFLAG_NOICON, .@pirate; + sc_start SC_ATTHASTE_POTION1, 900000, 40, 10000, SCFLAG_FIXEDTICK|SCFLAG_NOAVOID|SCFLAG_NOICON, .@pirate; + sc_start SC_INCHIT, 900000, 1000, 10000, SCFLAG_FIXEDTICK|SCFLAG_NOAVOID|SCFLAG_NOICON, .@pirate; + // *** + .@pirate=monster("016-8", 24, 54, "Frigate Captain", RedFollower, 1, "#MarineShipAttack2::OnVictory"); + sc_start SC_INCMHP, 900000, 1000, 10000, SCFLAG_FIXEDTICK|SCFLAG_NOAVOID|SCFLAG_NOICON, .@pirate; + sc_start SC_ATTHASTE_POTION1, 900000, 40, 10000, SCFLAG_FIXEDTICK|SCFLAG_NOAVOID|SCFLAG_NOICON, .@pirate; + sc_start SC_INCHIT, 900000, 1000, 10000, SCFLAG_FIXEDTICK|SCFLAG_NOAVOID|SCFLAG_NOICON, .@pirate; + // (Re)Spawn support for them as well! + .@c=max(1,REBIRTH) + (BaseLevel/32); + monster "016-8", 40, 28, strmobinfo(1, OceanPirate), OceanPirate, .@c, "#MarineShipAttack2::OnDie"; + monster "016-8", 40, 28, strmobinfo(1, Thug), Thug, .@c, "#MarineShipAttack2::OnDie"; + monster "016-8", 24, 55, strmobinfo(1, OceanPirate), OceanPirate, .@c, "#MarineShipAttack2::OnDie"; + monster "016-8", 24, 55, strmobinfo(1, Swashbuckler), Swashbuckler, .@c, "#MarineShipAttack2::OnDie"; + monster "016-8", 40, 54, strmobinfo(1, Grenadier), Grenadier, .@c, "#MarineShipAttack2::OnDie"; + monster "016-8", 32, 44, strmobinfo(1, OceanPirate), OceanPirate, .@c, "#MarineShipAttack2::OnDie"; // "hiding" one which shows up to protect the bridge + } + end; + +OnVictory: + if (rand2(10000) < REBIRTH+((readparam2(bLuk) + readparam2(bVit)) / 2)) + getitem SailorShirt, 1; + // You need to defeat both captains to win (TODO: Needs testing) + if (mobcount("016-8", "#MarineShipAttack2::OnVictory")) { + addtimercount "#MarineShip::OnEvent", 15000; + addtimercount "#MarineShipAttack2::OnDefeat", 15000; + end; + } + // Give reward and remove reinforcements + areatimer("016-8", 23, 25, 52, 35, 10, "#MarineShipAttack2::OnReward"); + killmonster("016-8", "#MarineShipAttack2::OnDie"); + end; + +OnReward: + // That would give 10% from missing exp, but I didn't like it. + //getexp ((NextBaseExp-BaseExp)/10), 0; + addtimercount "#MarineShip::OnEvent", 3500; + deltimer("#MarineShipAttack2::OnDefeat"); + + // Lv 40 rewards: 800 exp, 80 jxp, 400~600 GP + getexp BaseLevel*20, BaseLevel*2; + Zeny += BaseLevel*rand2(10,15); + // 12% chance to get Crazy Rum + if (rand2(10000) < 1200+(readparam2(bLuk)*3)) + getitem CrazyRum, 1; + dispbottom l("Congratulations!"); + if (isin("016-8", 23, 25, 52, 60)) + addtimer(3000, "#MarineShipAttack2::OnResumeTravel"); + end; + +OnResumeTravel: + if (@timer_navio_running) + warp "016-6", 31, 33; + end; +} + diff --git a/npc/_import.txt b/npc/_import.txt index 1e86ea201..2b9a79696 100644 --- a/npc/_import.txt +++ b/npc/_import.txt @@ -184,6 +184,7 @@ @include "npc/016-1/_import.txt" @include "npc/016-6/_import.txt" @include "npc/016-7/_import.txt" +@include "npc/016-8/_import.txt" @include "npc/017-0/_import.txt" @include "npc/017-1/_import.txt" @include "npc/017-10/_import.txt" diff --git a/npc/functions/maze.txt b/npc/functions/maze.txt index 68a1886f8..40de85c55 100644 --- a/npc/functions/maze.txt +++ b/npc/functions/maze.txt @@ -502,6 +502,9 @@ function script RenewMaze { ///////////////////////////////////////////////////////////////////////////////// // Add Treasure chests +// TODO: We could use npc_duplicate for this nowadays, no? Then we can have +// multiple treasure chests on mazes rather than being boolean, and we can +// also make them usable only once. 030-01,0,0,0 script #T_030-01 NPC_CHEST,{ if (!reachable(.x, .y, 3)) end; callfunc "TreasureBox", 150; // 1.5% extra chance |