For those intrested this is the entire script atm in my .lua file..
Code: Select all
isDone = false;
givenQuest = false;
function key()
setMouseItem(spawn("skull_key").item);
givenQuest = true;
end
function shop2()
setMouseItem(spawn("long_sword").item);
end
function checkquest()
if counter_2.counter:getValue() == 1 then
nextPage = "questfinished"
else
nextPage = "questinprogress"
end
end
function showDemoDialogue(sender)
if ( isDone == true ) then
return;
end
local startPage = nil;
if ( givenQuest == false ) then
startPage = "first";
givenQuest = false;
else
startPage = "return";
end
local dialogue = {
lockParty = true,
startPage = startPage,
pages = {
{
id = "first",
speakerName = "Talo'gaz",
speakerMessage = "O'ye! You look like a tough lot, prehaps I could get you to check on something for me.",
responses = {
{ text = "Guess that depends on what it is..", nextPage = "onabout" },
{ text = "We don't have time for this..", nextPage = "goodbye" },
}
},
{
id = "onabout",
speakerName = "Talo'gaz",
speakerMessage = "I think someone has been getting into the graves out back and pull up the bodies for fun, could I get you to go look around back there?",
responses = {
{ text = "Sure we have nothing better to do with out time.", nextPage = "key" },
{ text = "Why don't you check it out?", nextPage = "toobusy"},
{ text = "We don't have time to run errans at the moment.", nextPage = "goodbye"},
}
},
{
id = "return",
speakerName = "Talo'gaz",
speakerMessage = "Have you finished those errans?",
responses = {
{ text = "Yes we have", onSelect = self.go.id .. ".script.checkquest" },
{ text = "Nope just passing through..", nextPage = "goodbye" },
}
},
{
id = "questinprogress",
speakerName = "Talo'gaz",
speakerMessage = "No you havn't, otherwise my key would have come back to me.",
responses = {
{ text = "<Leave awkwardly because you got caught lying>", nextPage = "awkward" },
}
},
{
id = "questfinished",
speakerName = "Talo'gaz",
speakerMessage = "Thank goodness, what was it?",
responses = {
{ text = "<Lie> It was just some kids pulling a prank on you.", nextPage = "reward" },
{ text = "<Truth> The bodies seem to be reanimating, we had to fight one of them off because it attacked us.", nextPage = "reward2" },
}
},
{
id = "key",
speakerName = "Talo'gaz",
speakerMessage = "Thanks here's the key to open the gate.",
responses = {
{ text = "Thanks.", onSelect = self.go.id .. ".script.key" },
}
},
{
id = "reward",
speakerName = "Talo'gaz",
speakerMessage = "Oh dear, just as I thought.. Bet it was the child from around the corner.. Well thanks for your help, take this it should help some with your journeys.",
responses = {
{ text = "Thanks.", onSelect = self.go.id .. ".script.shop2" },
}
},
{
id = "reward2",
speakerName = "Talo'gaz",
speakerMessage = "Oh dear, worse than I thought.. Guess I need to put up some enchantments.. Well thanks for your help, take this it should help some with your journeys.",
responses = {
{ text = "Thanks.", onSelect = self.go.id .. ".script.shop2" },
}
},
{
id = "goodbye",
speakerName = "Talo'gaz",
speakerMessage = "Until next time..",
responses = {
{ text = "<Leave>" },
}
},
}
}
GTKGui.Dialogue.startDialogue(dialogue);
end
function hideDemoDialogue()
GTKGui.Dialogue.hideDialogue();
end
The dialogue is just place holding until I can get this to work better..