~ubuntu-branches/ubuntu/saucy/egoboo-data/saucy

« back to all changes in this revision

Viewing changes to modules/palice.mod/objects/firetrapchest.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
      // Play the trap action
 
10
      tmpargument = ACTIONKD
 
11
      DoAction
 
12
        tmpargument = 0
 
13
        SetBumpHeight
 
14
        // Wait a while
 
15
        tmpargument = 500
 
16
        SetTime
 
17
        // Tell the players...
 
18
        tmpargument = 3
 
19
        SendMessageNear
 
20
        // Spawn the trap particle
 
21
        tmpx = selfx
 
22
        tmpy = selfy
 
23
        tmpdistance = selfz
 
24
        tmpargument = 0
 
25
        SpawnExactParticle
 
26
        // Wake up sleepers
 
27
        tmpargument = [WAKE]
 
28
        tmpdistance = [WAKE]
 
29
        OrderSpecialID
 
30
 
 
31
 
 
32
 
 
33
// Someone is trying to open it
 
34
IfBumped
 
35
  // Can they open the chest?
 
36
  SetTargetToWhoeverBumped
 
37
  IfTargetCanOpenStuff
 
38
 
 
39
 
 
40
    // Is it closed?
 
41
    tmpargument = 0
 
42
    IfStateIs
 
43
 
 
44
 
 
45
      // Are they in front?
 
46
      IfFacingTarget
 
47
 
 
48
 
 
49
        // Make target crouch
 
50
        tmpargument = ACTIONMG
 
51
        TargetDoAction
 
52
 
 
53
 
 
54
        // Check for disarm skill
 
55
        tmpx = 0
 
56
        tmpy = 8192  // 50% chance at 16 Dex
 
57
        tmpargument = [DISA]
 
58
        IfTargetHasSkillID
 
59
          tmpx = rand & 8191 + targetdex
 
60
 
 
61
 
 
62
 
 
63
        // Check if it was disarmed
 
64
        IfXIsMoreThanY
 
65
 
 
66
 
 
67
          // Give some experience
 
68
          tmpargument = 45
 
69
          tmpdistance = EXPROLEPLAY
 
70
          GiveExperienceToTarget
 
71
 
 
72
 
 
73
          // Open it up
 
74
          tmpargument = ACTIONMG
 
75
          DoAction
 
76
            // The trap has been disarmed
 
77
            tmpargument = 4
 
78
            SendMessageNear
 
79
            // Open up for real
 
80
            tmpargument = 1
 
81
            SetState
 
82
            tmpargument = 60
 
83
            SetBumpHeight
 
84
            KeepAction
 
85
            tmpargument = 0
 
86
            tmpdistance = 11025
 
87
            PlaySound
 
88
            // Wait a while
 
89
            tmpargument = 40
 
90
            SetTime
 
91
        Else
 
92
          // Give some experience
 
93
          tmpargument = 5
 
94
          tmpdistance = EXPDARE
 
95
          GiveExperienceToTarget
 
96
 
 
97
 
 
98
          // Play the trap action
 
99
          tmpargument = ACTIONKD
 
100
          DoAction
 
101
            // The trap has been sprung
 
102
            tmpargument = 0
 
103
            SetBumpHeight
 
104
            // Wait a while
 
105
            tmpargument = 500
 
106
            SetTime
 
107
            // Tell the players...
 
108
            tmpargument = 5
 
109
            SendMessageNear
 
110
            // Spawn the trap particle
 
111
            tmpx = selfx
 
112
            tmpy = selfy
 
113
            tmpdistance = selfz
 
114
            tmpargument = 0
 
115
            SpawnExactParticle
 
116
            // Wake up sleepers
 
117
            tmpargument = [WAKE]
 
118
            tmpdistance = [WAKE]
 
119
            OrderSpecialID
 
120
    Else
 
121
      // Wait before allowing a swap
 
122
      IfTimeOut
 
123
        // Reset the timer
 
124
        tmpargument = 40
 
125
        SetTime
 
126
 
 
127
 
 
128
        // Make target crouch
 
129
        tmpargument = ACTIONMG
 
130
        TargetDoAction
 
131
 
 
132
 
 
133
 
 
134
 
 
135
        // Say it's empty...  Or check for false bottom
 
136
        IfStateIs2
 
137
          // Say the chest is empty...
 
138
          tmpargument = 0
 
139
          SendMessageNear
 
140
          // Content... 0 is normal chest, 2 is false bottom
 
141
          GetContent
 
142
          tmpargument = tmpargument & 2
 
143
          SetState
 
144
          IfStateIs2
 
145
            // It has a false bottom
 
146
            tmpargument = [DISA]
 
147
            IfTargetHasSkillID
 
148
              // Character easily finds the false bottom
 
149
              tmpargument = 1
 
150
              SendMessageNear
 
151
 
 
152
 
 
153
              // Figure out what to drop...  Opposite of first drop
 
154
              GetContent
 
155
              tmpargument = tmpargument & 1
 
156
              SetState
 
157
              IfStateIs0
 
158
                DropItems
 
159
              Else
 
160
                tmpargument = selfmoney
 
161
                DropMoney
 
162
 
 
163
 
 
164
 
 
165
              // No more false bottom
 
166
              tmpargument = 0
 
167
              SetContent
 
168
              tmpargument = 2
 
169
              SetState
 
170
            Else
 
171
              // Check wisdom until it is found
 
172
              tmpx = targetwis
 
173
              tmpy = rand & 4095 + 3584  // Need between 14 and 30 wisdom
 
174
              IfXIsMoreThanY
 
175
                // Character finds the false bottom
 
176
                tmpargument = 1
 
177
                SendMessageNear
 
178
 
 
179
 
 
180
                // Figure out what to drop...  Opposite of first drop
 
181
                GetContent
 
182
                tmpargument = tmpargument & 1
 
183
                SetState
 
184
                IfStateIs0
 
185
                  DropItems
 
186
                Else
 
187
                  tmpargument = selfmoney
 
188
                  DropMoney
 
189
 
 
190
 
 
191
 
 
192
                // No more false bottom
 
193
                tmpargument = 0
 
194
                SetContent
 
195
                tmpargument = 2
 
196
                SetState
 
197
          IfStateIs0
 
198
            // No false bottom
 
199
            tmpargument = 2
 
200
            SetState
 
201
 
 
202
 
 
203
 
 
204
 
 
205
        // Drop the contents
 
206
        IfStateIs1
 
207
          // Content...  0 is money, 1 is items
 
208
          GetContent
 
209
          tmpargument = tmpargument & 1
 
210
          SetState
 
211
          IfStateIs0
 
212
            tmpx = selfmoney
 
213
            tmpy = 0
 
214
            IfXIsMoreThanY
 
215
              // Drop the money
 
216
              tmpargument = selfmoney
 
217
              DropMoney
 
218
              tmpargument = 2
 
219
              SendMessageNear
 
220
            Else
 
221
              // No money in a money chest...
 
222
              tmpargument = 0
 
223
              SendMessageNear
 
224
          Else
 
225
            // Found some items
 
226
            DropItems
 
227
            tmpargument = 2
 
228
            SendMessageNear
 
229
          tmpargument = 2
 
230
          SetState
 
231
 
 
232
 
 
233
 
 
234
 
 
235
// All done
 
236
End