Main
{
questname "The Cursed Kingdom"
version 1.1
}
### STATE 1: Begin the Story ###
State Begin
{
desc "Speak to the Royal Guard"
action AddNpcText(57, "Adventurer, we need your help! A dark curse is spreading through the kingdom, originating from the Skeleton Crypt.");
action AddNpcText(57, "The King believes an ancient cursed relic is responsible. We need you to uncover the truth and stop this before it's too late!");
action AddNpcInput(57, 1, "What must I do?");
action AddNpcInput(57, 2, "This sounds too dangerous for me.");
rule InputNpc(1) goto InvestigateCrypt
rule InputNpc(2) goto DeclineQuest
}
### STATE 2: Investigate the Crypt ###
State InvestigateCrypt
{
desc "Investigate the Skeleton Crypt"
action AddNpcText(57, "You must venture into the Skeleton Crypt. The relic is guarded by dark forces.");
action AddNpcText(57, "Defeat 10 Skeleton Warriors and locate the cursed relic. Be careful, and may the gods protect you!");
action ShowHint("[The Cursed Kingdom] Objective: Defeat 10 Skeleton Warriors and locate the cursed relic.");
rule KilledNpcs(19, 10) goto FoundRelic
}
### STATE 3: Found the Cursed Relic ###
State FoundRelic
{
desc "Return the cursed relic to the Royal Guard"
action ShowHint("[The Cursed Kingdom] You have found the cursed relic!");
action GiveItem(472, 1);
action AddNpcText(57, "You found it? Incredible! Will you return it to me? I fear you might have touched it already for too long...");
rule GotItems(472, 1) goto ReturnRelic
}
### STATE 4: Discover the Next Steps ###
State ReturnRelic
{
desc "Speak to the King"
action RemoveItem(472, 1);
action AddNpcText(57, "This is beyond my knowledge. You must bring the relic to the King immediately!");
action AddNpcInput(57, 1, "Iâll take it to the King.");
rule InputNpc(1) goto SpeakToKing
}
State SpeakToKing
{
desc "Seek the Kingâs wisdom"
action AddNpcText(8, "You have done well, brave adventurer. But this cursed relic is only part of the problem.");
action AddNpcText(8, "Three powerful artifacts are needed to seal the curse: the Shield of Light, the Sword of Valor, and the Heart of Purity.");
action AddNpcText(8, "You must recover these one at a time. Return to me after you find each artifact to proceed further.");
action AddNpcInput(8, 1, "I will begin the search.");
action AddNpcInput(8, 2, "I need time to prepare.");
rule InputNpc(1) goto RetrieveArtifacts
rule InputNpc(2) goto PauseQuest
}
### STATE 5: Retrieve the Artifacts ###
State RetrieveArtifacts
{
desc "Recover the first ancient artifact"
action AddNpcText(8, "The Shield of Light is guarded by a Cyclops deep within Cyclops Cave. Recover it and return to me.");
action ShowHint("[The Cursed Kingdom] Objective: Retrieve the Shield of Light.");
rule EnterCoord(78, 10, 10) goto ShieldObtained
}
### STATE 6: Encounter the Villain ###
State ShieldObtained
{
desc "Speak to the mysterious figure"
action ShowHint("[The Cursed Kingdom] You found the Shield of Light!");
action GiveItem(56, 1);
action AddNpcText(129, "Ah, so youâve found the first artifact. Donât think this will be easy, adventurer.");
action AddNpcText(129, "You may have bested the Cyclops, but the other artifacts are far better guarded.");
action AddNpcText(129, "Turn back now, or suffer the curse yourself!");
action AddNpcInput(129, 1, "Who are you?");
action AddNpcInput(129, 2, "I wonât stop.");
rule InputNpc(1) goto VillainLeaves
rule InputNpc(2) goto VillainThreat
}
State VillainLeaves
{
desc "Return to the King"
action AddNpcText(129, "Youâll find out soon enough. Now, begone.");
action ShowHint("[The Cursed Kingdom] Return to the King with the Shield of Light.");
rule GotItems(56, 1) goto ReturnToKing
}
State VillainThreat
{
desc "Return to the King"
action AddNpcText(129, "We shall meet again, adventurer. Your struggle will only amuse me further.");
action ShowHint("[The Cursed Kingdom] Return to the King with the Shield of Light.");
rule GotItems(56, 1) goto ReturnToKing
}
### STATE 7: Next Artifacts ###
State ReturnToKing
{
desc "Recover the next artifact"
action AddNpcText(8, "The Shield of Light! Well done. Now, you must retrieve the Sword of Valor.");
action AddNpcText(8, "It is hidden in the Haunted Mansion, guarded by restless spirits. Be prepared for battle!");
action ShowHint("[The Cursed Kingdom] Objective: Retrieve the Sword of Valor.");
rule EnterCoord(236, 15, 20) goto SwordObtained
}
State SwordObtained
{
desc "Prepare for the final battle"
action ShowHint("[The Cursed Kingdom] You found the Sword of Valor!");
action GiveItem(281, 1);
action AddNpcText(8, "Two artifacts down, one remains. The Heart of Purity is guarded by a powerful demon in the Fire Void.");
action AddNpcText(8, "Prepare yourself for a final battle!");
rule EnterCoord(45, 8, 8) goto BossBattle
}
### STATE 8: Final Artifact Boss ###
State BossBattle
{
desc "Defeat the Demon Guardian"
action AddNpcText(129, "Youâve made it this far? Impressive. But this is where your journey ends.");
action AddNpcText(129, "Face me, and letâs see if youâre worthy of the Heart of Purity!");
action ShowHint("[The Cursed Kingdom] Defeat the Demon Guardian!");
rule KilledNpcs(129, 1) goto FinalVictory
}
State FinalVictory
{
desc "Return to the King for your reward"
action GiveItem(418, 1);
action ShowHint("[The Cursed Kingdom] You defeated the Demon Guardian and claimed the Heart of Purity!");
rule GotItems(418, 1) goto FinalReward
}
### STATE 9: Final Reward ###
State FinalReward
{
desc "Speak to the King"
action AddNpcText(8, "Youâve done it! The curse is lifted, and the kingdom is saved.");
action AddNpcText(8, "Take this reward, and may your bravery be remembered for ages.");
action GiveExp(50000);
action GiveItem(1, 10000); // Gold
action GiveItem(682, 1); // Special Spell Reward
action ShowHint("[The Cursed Kingdom] Quest Complete: 50,000 EXP, 10,000 Gold, and a Shield Spell!");
action End();
}
### STATE 10: Decline Quest ###
State DeclineQuest
{
desc "Decline the King's request"
action AddNpcText(57, "I see. Let me know if you change your mind. The kingdom depends on you.");
action Reset();
}
### STATE 11: Pause Quest ###
State PauseQuest
{
desc "Pause the storyline"
action AddNpcText(8, "Take your time to prepare, adventurer. The fate of the kingdom awaits.");
action Reset();
}