~ubuntu-branches/ubuntu/precise/egoboo-data/precise

« back to all changes in this revision

Viewing changes to modules/palice.mod/objects/secretchest.obj/script.txt

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2010-04-25 10:20:11 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100425102011-1aosouybjkexdg9v
Tags: 1:2.7.7-1
* New Upstream Release
* Switch to debhelper

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Someone cast an unlock spell
 
2
IfOrdered
 
3
  tmpx = selforder
 
4
  tmpy = 491  // The unique code for an unlock order
 
5
  IfXIsEqualToY
 
6
    // Is it closed?
 
7
    tmpargument = 0
 
8
    IfStateIs
 
9
      // Open it up
 
10
      tmpargument = ACTIONMG
 
11
      DoAction
 
12
        tmpargument = 1
 
13
        SetState
 
14
        tmpargument = 60
 
15
        SetBumpHeight
 
16
        KeepAction
 
17
        tmpargument = 0
 
18
        tmpdistance = 11025
 
19
        PlaySound
 
20
        // Wait a while
 
21
        tmpargument = 40
 
22
        SetTime
 
23
        // Tell the players...
 
24
        tmpargument = 3
 
25
        SendMessageNear
 
26
 
 
27
 
 
28
// Someone is trying to open it
 
29
IfBumped
 
30
  // Can they open the chest?
 
31
  SetTargetToWhoeverBumped
 
32
  IfTargetCanOpenStuff
 
33
 
 
34
 
 
35
    // Is it closed?
 
36
    tmpargument = 0
 
37
    IfStateIs
 
38
 
 
39
 
 
40
      // Are they in front?
 
41
      IfFacingTarget
 
42
 
 
43
 
 
44
        // Make target crouch
 
45
        tmpargument = ACTIONMG
 
46
        TargetDoAction
 
47
 
 
48
 
 
49
        // Give some experience
 
50
        tmpargument = 5
 
51
        tmpdistance = EXPDARE
 
52
        GiveExperienceToTarget
 
53
 
 
54
 
 
55
        // Open it up
 
56
        tmpargument = ACTIONMG
 
57
        DoAction
 
58
          tmpargument = 1
 
59
          SetState
 
60
          tmpargument = 60
 
61
          SetBumpHeight
 
62
          KeepAction
 
63
          tmpargument = 0
 
64
          tmpdistance = 11025
 
65
          PlaySound
 
66
          // Wait a while
 
67
          tmpargument = 40
 
68
          SetTime
 
69
          // Tell the players...
 
70
          tmpargument = 4
 
71
          SendMessageNear
 
72
    Else
 
73
      // Wait before allowing a swap
 
74
      IfTimeOut
 
75
        // Reset the timer
 
76
        tmpargument = 40
 
77
        SetTime
 
78
 
 
79
 
 
80
        // Make target crouch
 
81
        tmpargument = ACTIONMG
 
82
        TargetDoAction
 
83
 
 
84
 
 
85
 
 
86
 
 
87
        // Say it's empty...  Or check for false bottom
 
88
        IfStateIs2
 
89
          // Say the chest is empty...
 
90
          tmpargument = 0
 
91
          SendMessageNear
 
92
          // Content... 0 is normal chest, 2 is false bottom
 
93
          GetContent
 
94
          tmpargument = tmpargument & 2
 
95
          SetState
 
96
          IfStateIs2
 
97
            // It has a false bottom
 
98
            tmpargument = [DISA]
 
99
            IfTargetHasSkillID
 
100
              // Character easily finds the false bottom
 
101
              tmpargument = 1
 
102
              SendMessageNear
 
103
 
 
104
 
 
105
              // Give some experience
 
106
              tmpargument = 15
 
107
              tmpdistance = EXPROLEPLAY
 
108
              GiveExperienceToTarget
 
109
 
 
110
 
 
111
              // Figure out what to drop...  Opposite of first drop
 
112
              GetContent
 
113
              tmpargument = tmpargument & 1
 
114
              SetState
 
115
              IfStateIs0
 
116
                DropItems
 
117
                DropKeys
 
118
              Else
 
119
                tmpargument = selfmoney
 
120
                DropMoney
 
121
 
 
122
 
 
123
 
 
124
              // No more false bottom
 
125
              tmpargument = 0
 
126
              SetContent
 
127
              tmpargument = 2
 
128
              SetState
 
129
            Else
 
130
              // Check wisdom until it is found
 
131
              tmpx = targetwis
 
132
              tmpy = rand & 4095 + 3584  // Need between 14 and 30 wisdom
 
133
              IfXIsMoreThanY
 
134
                // Character finds the false bottom
 
135
                tmpargument = 1
 
136
                SendMessageNear
 
137
 
 
138
 
 
139
                // Give some experience
 
140
                tmpargument = 15
 
141
                tmpdistance = EXPSECRET
 
142
                GiveExperienceToTarget
 
143
 
 
144
 
 
145
                // Figure out what to drop...  Opposite of first drop
 
146
                GetContent
 
147
                tmpargument = tmpargument & 1
 
148
                SetState
 
149
                IfStateIs0
 
150
                  DropItems
 
151
                  DropKeys
 
152
                Else
 
153
                  tmpargument = selfmoney
 
154
                  DropMoney
 
155
 
 
156
 
 
157
 
 
158
                // No more false bottom
 
159
                tmpargument = 0
 
160
                SetContent
 
161
                tmpargument = 2
 
162
                SetState
 
163
          IfStateIs0
 
164
            // No false bottom
 
165
            tmpargument = 2
 
166
            SetState
 
167
 
 
168
 
 
169
 
 
170
 
 
171
        // Drop the contents
 
172
        IfStateIs1
 
173
          // Content...  0 is money, 1 is items
 
174
          GetContent
 
175
          tmpargument = tmpargument & 1
 
176
          SetState
 
177
          IfStateIs0
 
178
            tmpx = selfmoney
 
179
            tmpy = 0
 
180
            IfXIsMoreThanY
 
181
              // Drop the money
 
182
              tmpargument = selfmoney
 
183
              DropMoney
 
184
              tmpargument = 2
 
185
              SendMessageNear
 
186
            Else
 
187
              // No money in a money chest...
 
188
              tmpargument = 0
 
189
              SendMessageNear
 
190
          Else
 
191
            // Found some items
 
192
            DropItems
 
193
            DropKeys
 
194
            tmpargument = 2
 
195
            SendMessageNear
 
196
          tmpargument = 2
 
197
          SetState
 
198
 
 
199
 
 
200
 
 
201
 
 
202
// All done
 
203
End