home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Singles (French)
/
Singles-FrenchVersion-Win95.iso
/
data1.cab
/
Statemachine
/
questTrouble8a.lua
< prev
next >
Wrap
Text File
|
2004-03-05
|
2KB
|
62 lines
beginStateMachine()
-- called when questor builds up all known questScripts
onEnter(function(msg)
print("questTrouble8a entered");
setState("initial");
end )
-- on game over: relationship conditions get reset to 0 and all quests are reset to initial
onMsg("questreset", function(msg)
setState("initial");
end )
---------------------------------------------------------------------------------------------------------------------------------------
state("initial")
onMsg("checkCondition", function(msg)
local mike = getParent().getParent().getCharacter(MIKE);
local elaine = getParent().getParent().getCharacter(ELAINE);
if ( elaine.getRelationshipCondition(MIKE, REL_TROUBLE) >= 8 )
then
-- go to talk position
elaine.queueCommand("pm_talkCutscene", "talkCutscene", mike, "questTrouble8a");
setState("talktome");
end
end )
state("talktome")
-- assoon as arrived - start dialog
----------------
onMsg("talking", function(msg)
if (msg.data == "questTrouble8a") then
popupConversation("dialogTrouble8a");
setState("donetalktome");
end
----------------
end )
state("donetalktome");
onMsg("yes", function(msg)
getParent().getParent().getCharacter(MIKE).cancelCurrentActivity();
getParent().getParent().getCharacter(ELAINE).cancelCurrentActivity();
setState("done");
end )
---------------------------------------------------------------------------------------------------------------------------------------
state("done")
-- sackgasse hier
endStateMachine()