在 tgs1000\init\npc.sdb里加# i+ j# U I% V3 g3 D
奖品兑换员,奖品兑换员,0,,,,,,,,,,62,81,235,0,0,,,,20000,0,0,0,0,,0,,,,,,,,,,,,,,,TRUE,$ J! n1 c ~9 ?
在tgs1000\script文件加里创建一个文本 名字:奖品兑换员
: L& Y# }8 L: `& }- ?------------------------------------------------
; g# _5 |9 e9 W( w* _) Qunit 奖品兑换员;- A( e) G) z. B" A
$ n8 b Y* @7 ]( N( v) l4 h/ Hinterface* Q4 h0 z; R& f
^0 M/ t) ?1 u) s, y, \. F: Ifunction GetToken (aStr, aToken, aSep : String) : String;
' ?3 m r7 g' K n; \9 |function CompareStr (aStr1, aStr2 : String) : Boolean;
. U0 Q# j6 P: H- M7 t8 Pfunction callfunc (aText: string): string;4 @# i4 K5 g+ N. M/ D2 O
procedure print (aText: string);. W& r( Y' T( ^( ?. l; d2 x& {: P
function Random (aScope: integer): integer;, q$ W8 a* ~' R) A
function Length (aText: string): integer;5 Y( G! u( Z% I7 |; {" z
procedure Inc (aInt: integer);3 ]( c D7 `/ B. r
procedure Dec (aInt: integer);
" u( H. i+ r1 d% g* X( Hfunction StrToInt (astr: string): integer;' E7 W! m0 l7 c! W+ G
function IntToStr (aInt: integer): string;
: \) k0 a3 B$ }+ E$ t+ D. Z3 Sprocedure exit;
1 V9 R2 K7 d4 A: f* hprocedure OnGetResult (aStr : String);
4 Q0 e% U* [9 U: X8 H$ jprocedure OnLeftClick (aStr : String);
. j6 R n/ P3 c a! w. Oprocedure OnApproach (aStr : String);9 X0 {& U; M9 [9 y6 o
procedure OnAway (aStr : String);
$ g8 e* n- j" Fprocedure OnArrival (aStr : String);/ L7 p# y; d8 x% p- u) k ]+ @* V
var* f4 j6 A8 i: V0 Q/ a4 Q; e( S
iCallCount : Integer = 0;
9 |& G l2 m4 ^9 \1 y+ ]( {# Fimplementation* i4 t( b) l6 J* S% u
procedure OnAway (aStr : String);
# X; c2 E4 Y8 _( }; b1 vvar
" N7 Z; P: ]9 lStr : String;" c4 v1 ] U: n$ d/ _7 w
Race : Integer;
" K; ^& x2 \* N: a, i$ vbegin' O* f0 R8 e, v2 L3 P% E6 p9 r) x
Str := callfunc ('getsenderrace');
2 e' r# A- j+ B5 v! e( bRace := StrToInt (Str);$ B: H$ ^2 Q9 t2 |$ @3 |8 h
if Race = 1 then begin4 [* j5 m7 \, d% }6 h
print ('say 拉拉拉拉,贪财老人来喽...');
6 v4 _8 B) |/ G- \1 _exit;
% \7 B& y( Q6 `. G. [9 T: R3 S6 E# }end;
8 X1 \, x' c- u6 A, ?end;
u$ u9 F- l; s: b. w/ L+ D. Gprocedure OnApproach (aStr : String);
9 B* l- d C8 Z1 y I% _var m* i: \4 y! ]9 ]3 M6 M$ P: E
Str : String;
5 X* j; a" H- z) `0 {8 x. E# NRace : Integer;" C# U% r3 O6 `+ r& T( R
begin
" L+ b; q2 L% E$ a# TStr := callfunc ('getsenderrace');
) W4 A8 S% Y+ f4 ]$ x3 \9 h0 O( R8 sRace := StrToInt (Str);
# {! n( x& y- U0 Y" @/ s+ H: |if Race = 1 then begin& L y, T; N3 {, R3 d' G; }% V
print ('say 各位节日快乐...');1 V8 S2 l3 t0 U; I# ~
exit;
5 Y+ r# t; E/ l" H2 C7 q2 nend;
* c4 G0 s1 \1 c% w4 Z; V+ \end;7 d# l3 |1 e5 T: I8 N5 ?8 z
procedure OnLeftClick (aStr : String);! u$ M6 Y4 g& D/ ~8 B" n' D
var2 A; S3 L0 p. P) k9 n
Str : String;
3 p, X/ K- S" ?6 Q Obegin: W; ]! W! v, m& p' ~, e
Str := 'showwindow .\help\奖品兑换员.txt 1';6 m; X/ B8 A8 z7 {
print (Str);+ S' ]8 b( ^- A4 Q1 a, H
exit;7 ^5 g3 G% Y5 c& t
end;
" U, c8 c: Z2 g( [/ e- a) cprocedure OnGetResult (aStr : String);& s" u- O" F+ i) \& E- X2 x6 [
var4 m# w3 H9 X8 B! w* P
Str, Name : String;6 [& r5 r2 s J$ c
iRandom, iKind : Integer;, V6 ]5 i7 ?1 P; L" d9 C; j# z
begin
9 R+ ^) k' S* \' y0 Pif aStr = 'jinyuan' then begin
3 l" e' i+ {& A Str := callfunc ('getsenderitemexistence 金元:5');
: o/ _ x1 O Z B6 F% X0 n if Str = 'false' then begin- p9 t, I8 o2 _8 }
Str := 'say 哪有免费的午餐?拿5个金元来!';
8 u8 a" h1 {7 { print (Str);
4 D& L) j. f3 `, {/ m: d7 G8 _ exit;
: r- l7 t7 q( I2 t; Z end;
0 P2 h$ V/ z( }, W, w1 A& o if Str = 'true' then begin2 l( @$ W8 i9 k
Str := 'getsenderitem 金元:5';: d u! P* }5 J) V' _& @2 c
print (Str);/ c- k! \& t4 M5 {$ g M
Str := 'say 小子,你的金子是假的!哈哈哈!';
* o5 W1 r: E: M9 F) J- O4 \5 T print (str);' R) w( x/ b7 E# N" x& [
iRandom := Random (5);" R! ~: P5 [" o8 o9 G$ N3 R
if iRandom = 1 then begin
5 ]& g3 u8 P0 Z3 i5 ~ Str := callfunc ('checkenoughspace');
8 @( B. k, K$ u" d- a! ? if Str = 'false' then begin" Y8 I/ ~- O4 p" u2 _/ b2 \
print ('say 物品栏已满~');: E* @7 f1 i. b) V+ T
exit;
: D7 F- x; Q8 L$ o end;
+ _% y2 l1 d9 {0 h# l- o& e3 ` iKind := Random (29);$ E- q- j( z- U( k0 [/ y
if iKind = 0 then begin
; `- J& T8 o. G4 O Str := 'putsendermagicitem 男子英雄铠甲 @奖品兑换员 4';( D2 s. m( }. R0 B/ p+ X0 @) H
print (Str);! n( |9 t- F& u# \; Z& |6 N. l" ^9 S
end;
0 X, B$ A6 A$ B if iKind = 1 then begin0 ^5 u+ w- C1 G6 z
Str := 'putsendermagicitem 女子英雄铠甲 @奖品兑换员 4';
- d% C$ s3 W* j print (Str);
" W/ G- F2 {/ ?" y, e' h, C; v: h2 Q end;
5 D3 `/ K- @9 h& e; d/ K if iKind = 2 then begin
; `4 A4 _! v3 R; T' H2 t( f Str := 'putsendermagicitem 男子英雄头盔 @奖品兑换员 4';8 Y7 U' U2 V/ O/ B
print (Str);4 n6 s$ f( g/ \ [$ K
end;
' D. {: I8 l) u* H" R% F if iKind = 3 then begin
# |8 ^* N* @% { Str := 'putsendermagicitem 女子英雄头盔 @奖品兑换员 4';6 O/ v) Y) g3 y$ k
print (Str);
: ^/ t$ _: F$ e' q' M/ o end;; U2 m) I3 f. G4 O0 q2 k
if iKind = 4 then begin+ d! [$ J% ^7 l, K
Str := 'putsendermagicitem 男子英雄护腕 @奖品兑换员 4';5 z6 v0 n' B- Z; ~- j% I& r
print (Str);
+ E( ]6 F4 } z' f/ s end;
4 C$ c8 I' G2 C- R: i% R if iKind = 5 then begin4 Y. N/ D) {& k& M' \( {
Str := 'putsendermagicitem 女子英雄护腕 @奖品兑换员 4';- L0 \1 ~+ I' ]4 w% Z, H
print (Str);
: h/ N+ |7 d$ d2 D end;
8 Y; A3 t8 r4 F" {' y if iKind = 6 then begin5 l7 v! X- V* X
Str := 'putsendermagicitem 男子英雄战靴 @奖品兑换员 4';; B8 y/ i. D V% ^3 S
print (Str);
% n. }$ M) V/ w0 ? end;- h& J; B2 p% s
if iKind = 7 then begin
" o! Y0 |( ?+ @) z { Str := 'putsendermagicitem 女子英雄战靴 @奖品兑换员 4';! ~) T! z2 Y6 n% C8 m G
print (Str);; ^8 U6 E8 F7 q' F" e W3 s1 U4 M
end;! e2 |' o5 u) c. F/ A
if iKind = 8 then begin
1 G5 N4 q& ]. S1 Z) r( p Str := 'putsendermagicitem 百炼三*戟 @奖品兑换员 4';* ?9 v% X2 v2 h1 G5 k
print (Str);' v" |1 K5 l; ]3 U8 G
end;/ Z2 c% A5 K0 V( B) B. _
if iKind = 9 then begin9 c% J% e: F& [3 {1 _) K: S0 o3 V
Str := 'putsendermagicitem 百炼日本刀 @奖品兑换员 4';
; J6 |, j; G# b5 \ print (Str);/ i' J9 s2 `. R
end;
( D( C! ~3 Z2 I) e8 e9 n) n9 I if iKind = 10 then begin
2 i$ T4 e9 k7 A0 A, T- D8 T' U! y+ b Str := 'putsendermagicitem 百炼忍者剑 @奖品兑换员 4';
. L% N( ]2 c' x% m* k print (Str);
7 ^# `$ k' J5 b8 h# C end;. [+ C" M( l! a! `! y+ B$ X1 X" }
if iKind = 11 then begin
) ]9 L: D5 O5 o6 Y2 q# c; [ Str := 'putsendermagicitem 白骨魔棒 @奖品兑换员 4';( J& c, Y( \) [" z$ |
print (Str);
- F- v# R6 j X* u, R# A( b end;
2 r8 J; N/ p2 U1 \ if iKind = 12 then begin. H; V4 p* J+ o4 r; ^. u
Str := 'putsendermagicitem 生
1 G5 Q3 J# s% L/ _, _ |