Use the 'talked_to' key to make NPCs stop when talked to.

git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13326 282e977c-c81d-0410-88c4-b93c2d0d6712
master
ryo_saeba 2010-05-29 21:22:45 +00:00
parent ec706b815f
commit c3a992c3ef
1 changed files with 3 additions and 0 deletions

View File

@ -44,6 +44,7 @@ import Crossfire
import os
from CFDialog import DialogRule, Dialog, IncludeRule
import cjson
import random
location = "defaultdialognamespace"
@ -111,4 +112,6 @@ for jsonRule in dialogs:
index = index + 1
if speech.speak(Crossfire.WhatIsMessage()) == 0:
# block the NPC for some time
Crossfire.WhoAmI().WriteKey('talked_to', random.randint(3, 8), 1);
Crossfire.SetReturnValue(1)