在 tgs1000\init\npc.sdb里加
- U3 N. P% ?1 w) n奖品兑换员,奖品兑换员,0,,,,,,,,,,62,81,235,0,0,,,,20000,0,0,0,0,,0,,,,,,,,,,,,,,,TRUE,
* \8 G) ]4 Q9 o! s. ]在tgs1000\script文件加里创建一个文本 名字:奖品兑换员
* L" B* o& h! L0 C# d------------------------------------------------
% [; y) v& z. k7 y1 cunit 奖品兑换员;
D6 H3 Y5 n3 ^. `5 a
$ q4 V$ c# f+ E) E5 |interface( }8 b9 v. O6 P. _
( U* e( u( u7 D" P* o1 ~function GetToken (aStr, aToken, aSep : String) : String;
; _! ?2 ?9 m8 C6 h! j) s7 I+ Hfunction CompareStr (aStr1, aStr2 : String) : Boolean;
- S/ U6 v( _9 v8 z) J( C/ wfunction callfunc (aText: string): string;
. ?, d5 p! }8 x! C( R- Z2 U+ _6 oprocedure print (aText: string);
5 F9 f8 b$ x0 {% K9 {4 [9 Qfunction Random (aScope: integer): integer;
% ^( t3 T* t$ {- Q) @: nfunction Length (aText: string): integer;
0 D7 ]2 ?! ?1 n. V' X' j8 aprocedure Inc (aInt: integer);* x$ n1 e0 I1 R% Q' ~: Y j; S L
procedure Dec (aInt: integer);
& V& m" x) n6 P( |) |( bfunction StrToInt (astr: string): integer;( u& i$ t+ K' V* Y. a
function IntToStr (aInt: integer): string;% ^2 p0 l- {; p2 c( V3 p, C* D
procedure exit;, ^2 f# t0 J* `, x
procedure OnGetResult (aStr : String);1 x6 |& K; q- O+ K9 f
procedure OnLeftClick (aStr : String);
8 t; {( e5 A7 C( Rprocedure OnApproach (aStr : String);
& V! z! U: w" f _procedure OnAway (aStr : String);, |, D' q9 `" r4 l( |/ I j+ g
procedure OnArrival (aStr : String);
8 Z* c$ J5 L) s' y9 ivar2 [, |! h* X! l7 ?. z6 {
iCallCount : Integer = 0;) z) U0 I5 j$ [3 u5 \7 @ w5 N
implementation* P4 @7 R3 z1 H7 r
procedure OnAway (aStr : String);& j; H$ u% P6 o5 g8 C7 g
var6 ]2 E, K: @3 r( Q; z; b9 N7 P
Str : String;- F6 R' v0 u1 J) x! j
Race : Integer;
+ d9 w: q# I2 ]; t4 R; x- ^* Ibegin
' C* N$ D# [( M1 F2 ^' T% G2 xStr := callfunc ('getsenderrace');
}; u# y7 t4 y- R" i8 f6 ?Race := StrToInt (Str);! J0 K/ ^4 w( r3 D2 O u2 k9 m; | ?
if Race = 1 then begin3 p! {1 r. X3 G; T
print ('say 拉拉拉拉,贪财老人来喽...');
h! c9 a3 J- \" h4 E5 r0 ]exit;
) g! |6 ^7 ^% fend;
8 Q6 w# M, F u" J, h Kend;
! g V" S L2 n6 n; p8 Mprocedure OnApproach (aStr : String);' h+ V# m! g1 j$ I. d; h- ?4 f
var. W" ~0 Y' v, X: F7 X
Str : String;
1 y w% z X9 q. f6 aRace : Integer;
: ?! u) \, A m# e( ~begin7 T$ M7 ^/ M7 I+ Y6 ?1 f7 k ~; C
Str := callfunc ('getsenderrace');
& y P+ T. b, w l7 _Race := StrToInt (Str);, n" x5 M$ `) E# i; g# j5 L
if Race = 1 then begin7 m$ I) {% I, j7 t- L; y0 o6 g7 \
print ('say 各位节日快乐...');
J: i& [5 v& d6 Y& q |7 G' e) yexit;
% a, O; H0 Q" S1 E& U N" m7 pend;
0 R: Y8 C \0 x& Y* }" Zend;5 s, g; W: m- c2 _" C8 n6 S
procedure OnLeftClick (aStr : String);; Q8 b0 g# S, \- Z2 ]2 @
var
) m+ M5 d5 p3 c# S+ E" I" f3 ?7 dStr : String;
\/ c5 F+ f; O" R( T# Nbegin
% ^% q7 r/ t" D" k' b2 W: bStr := 'showwindow .\help\奖品兑换员.txt 1';
; n- W; H, t. U* E6 Fprint (Str);5 J/ y2 M6 D/ q* N
exit;
0 G+ x' |& M; a* Z- u; C Iend;7 _6 Q' ]* f7 C& E6 p3 c
procedure OnGetResult (aStr : String);: T+ j. L8 o5 R# G2 j
var* ?0 [" t) ~2 c' n3 a9 h
Str, Name : String;
2 f. G3 e; _4 r. siRandom, iKind : Integer;! u7 s& m& G3 y6 V+ T
begin
( ?( O$ r5 d7 t3 Xif aStr = 'jinyuan' then begin
. A3 G$ W1 l8 U* B+ u1 M B7 J$ N Str := callfunc ('getsenderitemexistence 金元:5'); r' v8 q7 a2 s5 {3 K$ |5 {
if Str = 'false' then begin; b3 W/ m, y2 T- g: c) Q% \
Str := 'say 哪有免费的午餐?拿5个金元来!';
' F- @: R% E6 Q print (Str);
; q# Q0 R7 ^; a s. ~. I exit;
5 h4 d% n- h& h, I end;
6 `. g6 K2 z- L( j; X# m if Str = 'true' then begin
: Q' u( i6 M# d5 r* A' ~' _) ] Str := 'getsenderitem 金元:5';
# Z! w7 S) ]1 g print (Str);
- M1 ?, h) w- y, L0 ]9 I( u* x Str := 'say 小子,你的金子是假的!哈哈哈!';. d3 H; l9 c3 t' m! y, q
print (str);
( o+ H0 j* {# v" \6 E% Y- Y! A0 f iRandom := Random (5);
' _) G) t" M0 J/ |$ [4 J: q5 H if iRandom = 1 then begin
; @5 B8 d! }+ V# q1 s Str := callfunc ('checkenoughspace');) i. e8 u, v; U/ F6 s+ P0 T
if Str = 'false' then begin: T* [4 r( [" P: V$ B& `4 b% ?5 X) C
print ('say 物品栏已满~');
% I2 N: L) X# ?- o+ P exit;
% R6 o7 t' E( g" ]2 H end;/ q6 G9 @6 k. ^/ x* m6 K- K
iKind := Random (29);; f& v* p% z" Y' N( }
if iKind = 0 then begin% ]0 d: O- ?8 C/ Q9 Z0 P
Str := 'putsendermagicitem 男子英雄铠甲 @奖品兑换员 4';
0 |3 J8 ~& a& V1 g. q3 O print (Str);
' S6 l. y7 q, R" ?+ W8 i end;
1 \, z/ v: E8 Z, z+ {+ f4 z if iKind = 1 then begin
# {" |, D% @$ k( B Str := 'putsendermagicitem 女子英雄铠甲 @奖品兑换员 4';
3 \# J. _6 m# v4 q print (Str);
/ V9 _4 w. `' w end;
" k r2 O' ]! I, S& w5 A if iKind = 2 then begin
G/ ~5 l' w Y& K' F- E( v Str := 'putsendermagicitem 男子英雄头盔 @奖品兑换员 4';
& P5 [6 M, ^; G: M print (Str);
' [( C5 _% W; f& s6 r end;
3 ?% G" G. C4 g% Q6 x if iKind = 3 then begin4 d3 l/ e) x( c% e- c3 o5 C
Str := 'putsendermagicitem 女子英雄头盔 @奖品兑换员 4';2 X! p- f+ n8 Y0 L
print (Str);* }( F- J0 z( x& B
end;( K# L* v0 ~: d, v9 C- ?
if iKind = 4 then begin4 _- ^7 \; P0 @# g8 I/ q
Str := 'putsendermagicitem 男子英雄护腕 @奖品兑换员 4';
( b' h0 R) A; @0 J* ^: t print (Str);0 a" _/ Z. e* ]4 Q8 d" @, G
end;4 X, x8 Z, m% y& V5 K
if iKind = 5 then begin! u- J5 d# y& R/ d% u
Str := 'putsendermagicitem 女子英雄护腕 @奖品兑换员 4';
) B$ {4 Q! z2 M* f4 e, T; G* t1 j print (Str);
" T) l, A9 h" V V' S4 c end;
( t" [+ ]1 _! q: s5 a; W' l- e( m/ ? if iKind = 6 then begin
" ]$ \9 l/ g0 K/ }5 r Str := 'putsendermagicitem 男子英雄战靴 @奖品兑换员 4';
" c* U0 M0 a7 H print (Str);
% t" |3 l" m$ M: v( T- p4 x end;4 l* g9 g0 N; p0 ^
if iKind = 7 then begin
$ M5 A3 o+ o5 B: m5 n; z Str := 'putsendermagicitem 女子英雄战靴 @奖品兑换员 4';( R7 A V0 l4 a
print (Str);/ c3 e! Q& F* Q. k
end;2 K! @; S% _" V) R w/ H3 Y& D
if iKind = 8 then begin
* }/ G5 Y0 E1 k: A# w Str := 'putsendermagicitem 百炼三*戟 @奖品兑换员 4';
3 `7 V2 m' ]9 n! n print (Str);
. J* d$ N' R3 ` end;! T2 @7 I& T, ^# I7 l4 S
if iKind = 9 then begin
$ j. w A/ }. h Str := 'putsendermagicitem 百炼日本刀 @奖品兑换员 4';
5 Y$ W8 C6 \# \' P! ?& n1 d5 a print (Str);! T4 w: r' b- C( `
end;+ p$ p& y1 d, l2 j8 p+ K* _
if iKind = 10 then begin9 X2 C x+ N3 m* K/ ~1 Z
Str := 'putsendermagicitem 百炼忍者剑 @奖品兑换员 4';
: k% c, B C6 ^1 d8 L$ R: i print (Str);
. ^# X' z2 [' |2 | end;
4 c; ~+ @4 L9 O if iKind = 11 then begin
) q+ ]; @( v9 K: d2 i* o Str := 'putsendermagicitem 白骨魔棒 @奖品兑换员 4';2 c. ]1 C: ]) C0 n, Q* Z0 \
print (Str);
{1 G7 d9 V6 o. |/ D/ d end;; _! W$ N$ r+ t) W. D/ _( h( f G
if iKind = 12 then begin
! Y' j' x. M/ [ Str := 'putsendermagicitem 生
' P- \( o+ h. {8 i, v. H2 G8 } |