diff --git a/ChangeLog b/ChangeLog index 2ea544fbf..8d93d5fe9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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. diff --git a/python/misc/doNothing.py b/python/misc/doNothing.py new file mode 100644 index 000000000..f57f0b623 --- /dev/null +++ b/python/misc/doNothing.py @@ -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) diff --git a/python/misc/npc_dialog.py b/python/misc/npc_dialog.py index 7bbc08648..01c36e0f3 100644 --- a/python/misc/npc_dialog.py +++ b/python/misc/npc_dialog.py @@ -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: diff --git a/scorn/kar/gork.msg b/scorn/kar/gork.msg new file mode 100644 index 000000000..cc5a4f362 --- /dev/null +++ b/scorn/kar/gork.msg @@ -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!"] + } +]} diff --git a/scorn/kar/gorks3 b/scorn/kar/gorks3 index b40e77541..96e9c1b95 100644 --- a/scorn/kar/gorks3 +++ b/scorn/kar/gorks3 @@ -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 diff --git a/scorn/kar/mork.msg b/scorn/kar/mork.msg new file mode 100644 index 000000000..9713e72bb --- /dev/null +++ b/scorn/kar/mork.msg @@ -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!"] + } +]} diff --git a/scorn/kar/somehouse3 b/scorn/kar/somehouse3 index a56062e27..93b1d6914 100644 --- a/scorn/kar/somehouse3 +++ b/scorn/kar/somehouse3 @@ -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