Make the gork's treasure quest use python for npc dialog. It's now mandatory to go throught full dialog to get the treasure key, knowing password is not enough

git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@8009 282e977c-c81d-0410-88c4-b93c2d0d6712
master
tchize 2007-12-22 13:44:37 +00:00
parent d19f6771c6
commit fb457124b3
7 changed files with 129 additions and 2 deletions

View File

@ -1,3 +1,12 @@
2007-12-22 tchize
A python/misc/doNothing.py
M python/misc/npc_dialog.py
A scorn/kar/gork.msg
M scorn/kar/gorks3
M scorn/kar/somehouse3
A scorn/kar/mork.msg
Make the gork's treasure quest use python for npc dialog. It's now mandatory to go throught full dialog to get the treasure key, knowing password is not enough
2007-12-22 tchize
Add some dialog entries to sigmund, add a password to access scorn (forces newbies in training). No way back to newbie house aftre quitting it, forced into scorn.

View File

@ -0,0 +1,6 @@
#Simple empty script that can be used to disable some actions of items when python is available
import Crossfire
print "Nothing script"
Crossfire.SetReturnValue(1)

View File

@ -56,8 +56,10 @@ import Crossfire
import os
from CFDialog import DialogRule, Dialog
import cjson
def ruleConnected(character,rule):
m = character.Map
m.TriggerConnected(rule.connected,1)
event = Crossfire.WhatIsEvent()
player = Crossfire.WhoIsActivator()
npc = Crossfire.WhoAmI()
@ -78,7 +80,12 @@ speech = Dialog(player, npc, location)
index=0;
for jsonRule in parameters["rules"]:
speech.addRule(DialogRule(jsonRule["match"], jsonRule["pre"], jsonRule["msg"], jsonRule["post"]),index)
if (jsonRule.has_key("connected")):
rule = DialogRule(jsonRule["match"], jsonRule["pre"], jsonRule["msg"], jsonRule["post"],None,ruleConnected);
rule.connected = jsonRule["connected"]
else:
rule = DialogRule(jsonRule["match"], jsonRule["pre"], jsonRule["msg"], jsonRule["post"])
speech.addRule(rule,index)
index=index+1
if speech.speak(Crossfire.WhatIsMessage()) == 0:

40
scorn/kar/gork.msg 100644
View File

@ -0,0 +1,40 @@
{
"location" : "gork_quest",
"rules": [
{
"match" : "hi|hello",
"pre" : [],
"post" : [["gork_speak","hoard"]],
"msg" : ["Youse want Gork's hoards? I crush you..."]
}, {
"match" : "gork|hoard|yes|want",
"pre" : [["gork_speak","hoard"]],
"post" : [["gork_speak","mork"]],
"msg" : ["Gork not like you... I not as nice as Mork."]
}, {
"match" : "mork|nice",
"pre" : [["gork_speak","mork"]],
"post" : [["gork_speak","mork2"]],
"msg" : ["Mork be Gork's friend. Mork live in tower."]
}, {
"match" : "friend",
"pre" : [["gork_speak","mork2"]],
"post" : [["gork_speak","treasure"]],
"msg" : ["Mork share Gork's treasure."]
}, {
"match" : "tower",
"pre" : [["gork_speak","mork2"]],
"post" : [],
"msg" : ["Mork live in tower, Mork big, Mork friend."]
}, {
"match" : "treasure",
"pre" : [["gork_speak","treasure"]],
"post" : [["gork_speak",""],["can_get_key","1"]],
"msg" : ["Only Gork can open treasure door."]
}, {
"match" : "*",
"pre" : [],
"post": [["gork_speak",""]],
"msg" : ["Gork kill you!"]
}
]}

View File

@ -4,6 +4,9 @@ difficulty 1
region scorn
width 16
height 16
msg
Modified: 2007-12-22 tchize
endmsg
end
arch cobblestones2
x 2
@ -588,6 +591,11 @@ endmsg
x 9
y 8
unaggressive 1
arch event_say
name scorn/kar/gork.msg
title Python
slaying /python/misc/npc_dialog.py
end
end
arch cobblestones2
x 9

47
scorn/kar/mork.msg 100644
View File

@ -0,0 +1,47 @@
{
"location" : "gork_quest",
"rules": [
{
"match" : "gork",
"pre" : [["can_get_key","1"]],
"post" : [["mork_speak","gork"]],
"msg" : ["You know Gork? You friend of Gork?"]
}, {
"match" : "yes|friend",
"pre" : [["can_get_key","1"],["mork_speak","gork"]],
"post" : [["mork_speak","key"]],
"msg" : ["I bet Gork send you to get key. Did he?"]
}, {
"match" : "yes",
"pre" : [["can_get_key","1"],["mork_speak","key"]],
"post" : [["mork_speak",""],["can_get_key","0"]],
"msg" : ["Ok, I give you key. Here, it in corner."],
"connected" : 9
}, {
"match" : "hello|hi",
"pre" : [],
"post" : [],
"msg" : ["Geesh, kill all my friends, that's not very nice.
Where did you learn your manners?"]
}, {
"match" : "friends",
"pre" : [],
"post" : [],
"msg" : ["They were just my pals."]
}, {
"match" : "pals",
"pre" : [],
"post" : [],
"msg" : ["I'm tired of talking to you, you racist...
GO AWAY!"]
}, {
"match" : "*",
"pre" : [],
"post" : [],
"msg" : ["Assasin!"]
}
]}

View File

@ -6,6 +6,7 @@ width 15
height 15
msg
Created: 1993-10-15
Modified: 2007-12-22 tchize
endmsg
end
arch dirtfloor
@ -540,6 +541,10 @@ endmsg
x 5
y 9
connected 9
arch event_say
title Python
slaying /python/misc/doNothing.py
end
end
arch dirtfloor
x 5
@ -576,6 +581,11 @@ y 9
speed 1.0
friendly 1
stand_still 1
arch event_say
name scorn/kar/mork.msg
title Python
slaying /python/misc/npc_dialog.py
end
end
arch dirtfloor
x 5