2 This script is part of the Witherspoon quest, that starts in /scorn/mansion/witherspoon_manor_attic.
3 Check the README file in the same directory as this file for more details.
5 Script for Rolanda, in /scorn/houses/rolanda.
7 Support to be called for TIME, TIMER and CUSTOM events.
14 whoami = Crossfire.WhoAmI()
15 whoisother = Crossfire.WhoIsOther()
16 command = Crossfire.WhatIsMessage()
17 event = Crossfire.WhatIsEvent()
18 pl = Crossfire.WhoIsActivator()
22 color = Crossfire.MessageFlag.NDI_BROWN
25 search_chairs = [ [ 0, -1 ], [ 0, 1 ], [ -1, 0 ], [ 1, 0 ] ]
28 '''handle the player giving an item.'''
29 if whoisother.ReadKey(
'special_item') !=
'ghost_dagger':
30 whoami.Say(
'And what am I supposed to do with this %s.'%whoisother.Name)
33 whoami.Say(
'Ohhhhhhhh... This, this dagger...')
34 pl.Message(
'%s puts her hand to her forehead, and staggers.'%whoami.Name)
35 whoami.WriteKey(
'witherspoon_saw_dagger',
'1', 1)
36 whoami.WriteKey(
'witherspoon_seated',
'', 1)
37 whoami.WriteKey(
'explaining_for', pl.Name, 1)
40 '''if fainting, try to find a chair when TIME happens.'''
41 for search
in range(0, len(search_chairs)):
42 x = whoami.X + search_chairs[search][0]
43 y = whoami.Y + search_chairs[search][1]
44 obj = whoami.Map.ObjectAt(x, y)
46 if obj.Name ==
'chair':
47 whoami.WriteKey(
'witherspoon_seated',
'1', 1)
48 whoami.Say(
'Thank you very much.')
49 whoami.WriteKey(
'chair_x',
str(x), 1)
50 whoami.WriteKey(
'chair_y',
str(y), 1)
55 '''trying to move to first found chair.'''
58 whoami.WriteKey(
'witherspoon_seated',
'2', 1)
59 whoami.Map.Print(
'%s sits on the chair.'%whoami.Name, color)
60 whoami.Say(
'I shall explain everything...')
61 whoami.Map.Print(
'%s starts sobbing.'%whoami.Name, color)
62 whoami.CreateTimer(random.randint(5, 10), 1)
64 whoami.Say(
'Please let me sit...')
67 '''explanation of the ghost story. Let Rolanda be still from now on.'''
69 pl = Crossfire.FindPlayer(whoami.ReadKey(
'explaining_for'))
72 whoami.Say(
'Tss, people just aren\'t patient...')
74 pl.WriteKey(
'witherspoon_know_all',
'1', 1)
76 whoami.Say(
'See, this dagger...')
77 whoami.Say(
'Alfred wanted...')
78 whoami.Map.Print(
'%s sighes deeply, and goes on.'%whoami.Name)
79 whoami.Say(
'he wanted to have some, shall I say, different experience, the kind a man and a woman can have together.')
80 whoami.Say(
'And since he likes pain, he asked to suffer, to see if the pain would... excite him.')
81 whoami.Map.Print(
'%s sobs'%whoami.Name)
82 whoami.Say(
'But he didn\'t think he would die!')
83 whoami.Say(
'So I... I hide the body, hoping to forget him.')
84 whoami.Say(
'But now I can\'t forget him! Ever!')
85 pl.Write(
'You wonder what the ghost (Alfred, according to %s) will make of that...'%whoami.Name, color)
86 if pl.QuestGetState(
"scorn/Witherspoon-ghost") <= 40:
87 pl.QuestSetState(
"scorn/Witherspoon-ghost", 50)
89 if event.Subtype == Crossfire.EventType.USER
and command ==
'give':
91 elif event.Subtype == Crossfire.EventType.TIME:
92 if whoami.ReadKey(
'witherspoon_saw_dagger') !=
'':
94 Crossfire.SetReturnValue(1)
95 if whoami.ReadKey(
'witherspoon_seated') ==
'':
97 elif whoami.ReadKey(
'witherspoon_seated') ==
'1':
99 elif event.Subtype == Crossfire.EventType.SAY:
100 if whoami.ReadKey(
'witherspoon_saw_dagger') !=
'':
102 Crossfire.SetReturnValue(1)
103 whoami.Say(
'Ohhhhhhh......')
104 pl.Message(
'%s seems to be ready to faint.'%whoami.Name)
105 elif event.Subtype == Crossfire.EventType.TIMER:
106 if whoami.ReadKey(
'witherspoon_seated') ==
'2':