everything seems to be right to me?
[code]
Main
{
questname "The Kings Help"
version 1.0
}
state Begin
{
desc "Talk to the king"
action AddNpcText(22, "Welcome to my Castle, you look like a tough person would you mind helping a rich person such as myself?");
action AddNpcInput(22,1, "What's the job?");
action AddNpcInput(22,2, "No thanks");
rule InputNpc(1) goto Conquest
rule InputNpc(2) goto Coward
}
state Coward
{
action AddNpcText(22, "Well if you change your mind, I'll be here");
action Reset();
}
state Conquest
{
desc "prep talk"
action AddNpcText(22, "Ahh. Thats great news! You see I'm in the middle of being invaded and unfortuant for me, none of my guards are ready for the job");
action AddNpcText(22, "But luckily, you showed up! If you're ready, I'll tell you what you must do to save my Castle from being over thrown");
action AddNpcInput(22,1, "Yes enough of this talk, send me now");
action AddNpcInput(22,2, "Not just yet. Let me get ready");
rule InputNpc(1) goto Battle
}
state Battle
{
desc "Kill 100 Soldiers"
action AddNpcText(22, "Theres 100 Imperial Guards. I hope you can take them, come back to me after they're dead");
action SetCoord(200,13,13);
rule KilledNpcs(227,100) goto ReturnToTheKing
}
state ReturnToTheKing
{
desc "Return to the king"
action ShowHint("You slayed the opposing army, return to the King for your reward");
action SetCoord(8,8,12);
action AddNpcText(22, "The Castle is close to being saved, but there is more to be done!");
rule TalkedToNpc(22) goto SecondTask
}
state SecondTask
{
desc "speak to the king"
action AddNpcText(22, "I have a bit of bad news. While you were fighting, my great grand father's crown was stolen!");
action AddNpcText(22, "You must get it back!");
action AddNpcInput(22,1, "I'll get it");
action AddNpcInput(22,2, "Let me catch my breathe");
rule InputNpc(1) goto FindCrown
}
state FindCrown
{
desc "Find the stolen crown"
action AddNpcText(22, "The enemy might be trying to bury it, look for signs of digged up dirt");
action SetCoord(200,13,13);
rule EnterCoord(200,14,14) goto PickUpCrown
}
state PickUpCrown
{
desc "Return to the king with the crown"
action ShowHint("You found the crown, return to the king");
action GiveItems(411,1);
action SetCoord(8,8,12);
action AddNpcText(22, "You found my crown! Thank you so much!!");
rule TalkedToNpc(22) goto OneMoreDeed
}
state OneMoreDeed
{
desc "Finishing off the army"
action AddNpcText(22, "They're weak! Only 25 remain until they'll be forced to retreat. Go! Attack!");
action SetCoord(200,13,13);
rule KilledNpcs(227,25) goto Victory
}
state Victory
{
desc "Return to the King, the war is over"
action SetCoord(8,8,12);
action AddNpcText(22, "You have my many thanks, here is some wealth from the Castle");
action ShowHint("The king hands you 500,000 gold and gives you 2,000,000 EXP!");
action GiveExp(2000000);
action GiveItem(1500000);
rule TalkedToNpc(22) goto ResetQuest
}
state ResetQuest
{
action AddNpcText (22, "Wait, they returned with another army! Please help me again!");
action Reset();
}
[/code]