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-b93c2d0d6712master
parent
d19f6771c6
commit
fb457124b3
|
@ -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
|
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.
|
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.
|
||||||
|
|
||||||
|
|
|
@ -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)
|
|
@ -56,8 +56,10 @@ import Crossfire
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from CFDialog import DialogRule, Dialog
|
from CFDialog import DialogRule, Dialog
|
||||||
|
|
||||||
import cjson
|
import cjson
|
||||||
|
def ruleConnected(character,rule):
|
||||||
|
m = character.Map
|
||||||
|
m.TriggerConnected(rule.connected,1)
|
||||||
event = Crossfire.WhatIsEvent()
|
event = Crossfire.WhatIsEvent()
|
||||||
player = Crossfire.WhoIsActivator()
|
player = Crossfire.WhoIsActivator()
|
||||||
npc = Crossfire.WhoAmI()
|
npc = Crossfire.WhoAmI()
|
||||||
|
@ -78,7 +80,12 @@ speech = Dialog(player, npc, location)
|
||||||
index=0;
|
index=0;
|
||||||
|
|
||||||
for jsonRule in parameters["rules"]:
|
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
|
index=index+1
|
||||||
|
|
||||||
if speech.speak(Crossfire.WhatIsMessage()) == 0:
|
if speech.speak(Crossfire.WhatIsMessage()) == 0:
|
||||||
|
|
|
@ -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!"]
|
||||||
|
}
|
||||||
|
]}
|
|
@ -4,6 +4,9 @@ difficulty 1
|
||||||
region scorn
|
region scorn
|
||||||
width 16
|
width 16
|
||||||
height 16
|
height 16
|
||||||
|
msg
|
||||||
|
Modified: 2007-12-22 tchize
|
||||||
|
endmsg
|
||||||
end
|
end
|
||||||
arch cobblestones2
|
arch cobblestones2
|
||||||
x 2
|
x 2
|
||||||
|
@ -588,6 +591,11 @@ endmsg
|
||||||
x 9
|
x 9
|
||||||
y 8
|
y 8
|
||||||
unaggressive 1
|
unaggressive 1
|
||||||
|
arch event_say
|
||||||
|
name scorn/kar/gork.msg
|
||||||
|
title Python
|
||||||
|
slaying /python/misc/npc_dialog.py
|
||||||
|
end
|
||||||
end
|
end
|
||||||
arch cobblestones2
|
arch cobblestones2
|
||||||
x 9
|
x 9
|
||||||
|
|
|
@ -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!"]
|
||||||
|
}
|
||||||
|
]}
|
|
@ -6,6 +6,7 @@ width 15
|
||||||
height 15
|
height 15
|
||||||
msg
|
msg
|
||||||
Created: 1993-10-15
|
Created: 1993-10-15
|
||||||
|
Modified: 2007-12-22 tchize
|
||||||
endmsg
|
endmsg
|
||||||
end
|
end
|
||||||
arch dirtfloor
|
arch dirtfloor
|
||||||
|
@ -540,6 +541,10 @@ endmsg
|
||||||
x 5
|
x 5
|
||||||
y 9
|
y 9
|
||||||
connected 9
|
connected 9
|
||||||
|
arch event_say
|
||||||
|
title Python
|
||||||
|
slaying /python/misc/doNothing.py
|
||||||
|
end
|
||||||
end
|
end
|
||||||
arch dirtfloor
|
arch dirtfloor
|
||||||
x 5
|
x 5
|
||||||
|
@ -576,6 +581,11 @@ y 9
|
||||||
speed 1.0
|
speed 1.0
|
||||||
friendly 1
|
friendly 1
|
||||||
stand_still 1
|
stand_still 1
|
||||||
|
arch event_say
|
||||||
|
name scorn/kar/mork.msg
|
||||||
|
title Python
|
||||||
|
slaying /python/misc/npc_dialog.py
|
||||||
|
end
|
||||||
end
|
end
|
||||||
arch dirtfloor
|
arch dirtfloor
|
||||||
x 5
|
x 5
|
||||||
|
|
Loading…
Reference in New Issue