在 tgs1000\init\npc.sdb里加
! }. s* \/ x* \) a1 V5 z奖品兑换员,奖品兑换员,0,,,,,,,,,,62,81,235,0,0,,,,20000,0,0,0,0,,0,,,,,,,,,,,,,,,TRUE,
. U o" U& b* z" n0 u+ a" I. E! \在tgs1000\script文件加里创建一个文本 名字:奖品兑换员8 L8 n! }' M0 r
------------------------------------------------% x0 O0 w8 \# X$ n: x% R V
unit 奖品兑换员;
5 ]; l2 ?, Q. l# w0 L! U) u' h
! J6 T9 y& C Q9 w+ _3 B8 ?interface3 J! v4 U( Z% s7 J: w
- L2 p; S% C, x, v Sfunction GetToken (aStr, aToken, aSep : String) : String;
9 a! ^7 }& S5 _function CompareStr (aStr1, aStr2 : String) : Boolean;& I4 O6 w1 i! y
function callfunc (aText: string): string;
4 {% I& F; D- `4 Uprocedure print (aText: string);
" z1 _9 C: q7 {" pfunction Random (aScope: integer): integer;- m3 ^( u( z3 @- `( t/ j; B( m
function Length (aText: string): integer;
, e% E% p- b E/ O! k) Uprocedure Inc (aInt: integer);
$ p7 F. h7 D* c" f) |: M9 Lprocedure Dec (aInt: integer);
" \7 ~4 q8 @% z+ M* Q! G1 s; |; ^function StrToInt (astr: string): integer;/ } u: _% C, }' n$ v9 m+ o
function IntToStr (aInt: integer): string;; _5 `2 S6 B' z W- i. C
procedure exit;
; r; q8 D9 q- E) V6 l, \' yprocedure OnGetResult (aStr : String);
/ ~, k7 q- i/ v1 i! \/ Pprocedure OnLeftClick (aStr : String);
/ v Y+ g1 W$ I$ n- Z7 R) Eprocedure OnApproach (aStr : String);
5 w4 @5 B. n4 B7 a$ F9 P( fprocedure OnAway (aStr : String);
2 r* K5 s$ z+ [7 y9 l l. `7 p8 p, Lprocedure OnArrival (aStr : String);6 m: P- Z+ F6 o U3 J
var
6 `* W% P4 g9 `9 [: _+ G* Q( CiCallCount : Integer = 0;
; ?8 I' x' v4 U: R4 rimplementation
% ~6 W! Z( Q/ eprocedure OnAway (aStr : String);% r" ~ d* |5 T! R
var
- x% S/ f1 I3 Q1 R Str : String;6 \& L/ E- W! J' r# O( Q4 H! z& j3 Y% e
Race : Integer;
' a8 E, S' r) z: r4 Hbegin/ P b' T o v6 Q0 a: F
Str := callfunc ('getsenderrace');
! ^$ m: N1 {/ B8 }' m K Race := StrToInt (Str);" P& Y* b1 _, B9 v! V5 k% R. X
if Race = 1 then begin9 t" O8 h6 d& J. a# P! b1 C
print ('say 拉拉拉拉,贪财老人来喽...');+ f4 `3 z% q2 F0 W9 G# |: `: E
exit;
# H+ ~1 T6 c \9 \* Y# m end;: X7 ?7 n" P# L6 {$ t$ ^
end;& Y" u q( `/ J' M! t$ Y9 p9 J
procedure OnApproach (aStr : String);7 D) u7 U. ]8 I! u, }5 l6 \2 M
var# q! ]. D1 L: Q' S
Str : String;3 Y9 A) Q/ W; J- ]5 T0 Z
Race : Integer;
0 L0 t) {) `" ~( ?5 v/ g1 l3 g/ `begin
4 N! I, N) m4 Z9 ?9 z Str := callfunc ('getsenderrace');
2 F M) x/ Y, ^5 Q z Race := StrToInt (Str);. D2 L5 l1 k" F$ F) i3 H
if Race = 1 then begin! M0 P6 X, f; z: I) ]
print ('say 各位节日快乐...');
0 g. ]6 M* F6 x8 P# L# i# { exit;
7 i% Q4 S( P% l end;$ {$ |3 H% l# B5 r- k |1 [
end;
3 C5 }" T5 G# {7 P* Gprocedure OnLeftClick (aStr : String);) w% O8 i% }$ @
var) ?( d3 l, J) |8 z1 M& t
Str : String;3 Y0 F9 H4 ]& ^* j0 [* {2 E4 _
begin1 F0 \* [/ I4 m" `! X m$ _1 [
Str := 'showwindow .\help\奖品兑换员.txt 1';
$ s' s t7 U, ~9 \3 C: Z+ i print (Str);
7 i( X6 E" m; i- h exit;
7 M% D0 {5 u! N! @' qend;
; f' ^3 ?4 a! p" m% s! {procedure OnGetResult (aStr : String);, q* r9 i m% w) P; j
var
' T6 u! C* j, I2 T ^; | Str, Name : String;
2 y7 i i6 y! z: ? iRandom, iKind : Integer;8 T( R0 f' r$ L* w& B
begin
) G0 C. G& e' U9 g& |+ P" Z if aStr = 'jinyuan' then begin
7 x7 R4 p! @) W8 S; w6 M7 E( x Str := callfunc ('getsenderitemexistence 金元:5');
! ~, v3 d- B/ \% W if Str = 'false' then begin5 A9 g- c# i( Q, O; q% P
Str := 'say 哪有免费的午餐?拿5个金元来!';" |0 d# R2 ~9 j' _9 I/ T
print (Str);- ?, b2 T6 P# X
exit;
0 }, z* {8 e7 X1 E% @7 v end;
- D. j0 n3 }6 S3 X# {! O4 n if Str = 'true' then begin1 ?* t) Q5 v7 q
Str := 'getsenderitem 金元:5';
# |# Z) k0 G( R5 W# ] print (Str);
5 e4 z2 q e& w: _ Str := 'say 小子,你的金子是假的!哈哈^_^哈!';
5 h3 M0 _% B# o% d, P" a print (str);
$ R* Y+ f. T! }0 W' K iRandom := Random (5);( }2 y( u/ S. Y
if iRandom = 1 then begin
3 R& @7 H! g+ ^9 z& O Str := callfunc ('checkenoughspace');
) u) A8 T' t. K if Str = 'false' then begin
+ p/ i s; h& }0 }. K7 C print ('say 物品栏已满~');8 S( X4 r" @+ Z" ]" {! z+ F
exit;7 X8 ?: d+ V! T
end; `$ T6 d/ Y9 V
iKind := Random (29);' i; _1 \2 J' u6 K0 i
if iKind = 0 then begin0 `4 N6 r4 v2 z6 v$ C6 p
Str := 'putsendermagicitem 男子英雄铠甲 @奖品兑换员 4';
, N5 c' w1 x+ w print (Str);; I6 g, z5 i6 l! M6 z0 w
end;
8 A# W9 i: x# ^, E. W* k if iKind = 1 then begin
6 k0 E; O. [1 ^' z4 ?- ^& P Str := 'putsendermagicitem 女子英雄铠甲 @奖品兑换员 4';
! j% ?6 q, u5 ?5 M) S print (Str);
$ [) I9 p2 ]1 x f" d! J" y/ v end;- g! x7 f# o2 W5 u+ n3 O) d. i& W. s- O8 a
if iKind = 2 then begin
+ M3 t* p, b( q Str := 'putsendermagicitem 男子英雄头盔 @奖品兑换员 4';1 r3 i! ]9 L: l5 U w2 U; m* p% R
print (Str);7 y/ {: U6 R/ U" k
end;9 r4 {! M2 Q6 e. m0 { Q& D9 v/ I
if iKind = 3 then begin
. ]! l" Y) l# x6 B% w Str := 'putsendermagicitem 女子英雄头盔 @奖品兑换员 4';5 z6 E! z- ^9 n8 d( X
print (Str);1 Q/ F: {1 T5 D5 B
end;2 H0 a3 o" @, S! V
if iKind = 4 then begin
+ O- i8 H$ O' k2 _6 ^ Str := 'putsendermagicitem 男子英雄护腕 @奖品兑换员 4';! R6 h. G5 g# v+ M. S$ B
print (Str);# Z3 [! v+ `# e5 O- J
end;
' L, V* R+ |4 H! [2 D0 k if iKind = 5 then begin0 D4 i, B! o1 ?$ u
Str := 'putsendermagicitem 女子英雄护腕 @奖品兑换员 4';
) l% G6 }& ?0 Y, a. ] print (Str);6 }/ N8 c% o5 m
end;: N) _( u. D9 y, n0 ?, [$ b- k
if iKind = 6 then begin: |5 U1 h6 J4 s# }& m3 T7 h
Str := 'putsendermagicitem 男子英雄战靴 @奖品兑换员 4';
+ X6 v1 t! [( M( E( r print (Str);
1 H9 a+ d8 x, J9 E, H- E' j end;3 \( P: w2 m# F( T X
if iKind = 7 then begin% j2 W; ]0 o4 U% c" w- T
Str := 'putsendermagicitem 女子英雄战靴 @奖品兑换员 4';
) v0 I2 l, W, U$ E6 X \- [ print (Str);% D$ ?# B0 a/ G2 _0 Z4 _
end;; z! B& M- D* s: ]$ l
if iKind = 8 then begin; i6 p* w& A/ i0 A9 ^, e
Str := 'putsendermagicitem 百炼三*戟 @奖品兑换员 4';
+ ^' ~2 A9 k9 q H, M print (Str);
# l4 w: ^3 n- E8 r( d: J, K end;
; ~8 |& `* i; | if iKind = 9 then begin! u) D( |' F! _0 a6 x( @" g: g( }
Str := 'putsendermagicitem 百炼日本刀 @奖品兑换员 4';
1 `; i+ o* Z, N+ \, C @ print (Str);
$ i- m! h0 y7 \- f# z3 L: O$ g% H end;
/ Y! b. k: e- S; q: q4 U* s3 E if iKind = 10 then begin
4 V4 U# a$ ]+ Z& x: R; ` Str := 'putsendermagicitem 百炼忍者剑 @奖品兑换员 4';, m1 w- a7 Y/ V" b- v+ W" h+ v
print (Str);$ K. D- I' Z" c% w1 c1 L
end;" S! C. d$ e4 N3 q
if iKind = 11 then begin) ~5 f) e7 [: @& n
Str := 'putsendermagicitem 白骨魔棒 @奖品兑换员 4';" `" d& y2 N. W
print (Str);* @9 w% c$ G: p6 J
end;
+ Q4 ?6 h6 c$ |& R) ? if iKind = 12 then begin
* p5 a& i2 ^ W; V$ \$ E Str := 'putsendermagicitem 生药 @奖品兑换员 4';9 | q% \! z' b
print (Str);+ P8 U. V) O3 F( M
end;, j' H8 ] J3 T# Y' D% g
if iKind = 13 then begin8 D) ^* e2 B' t
Str := 'putsendermagicitem 男子魔人护腕 @奖品兑换员 4';
, l- f1 ?. r6 @8 t8 N; O) P print (Str);" E3 l- N2 R* h" v3 ?
end;
' b% G7 I1 S$ J |+ w if iKind = 14 then begin4 g$ j" p2 o* _" t+ g
Str := 'putsendermagicitem 女子魔人护腕 @奖品兑换员 4';
6 F a9 _" w( X2 i, o+ X print (Str);
3 K' }& N) s7 l9 L Y X& z9 I end;
4 C% o4 v0 K! g( s4 e' c if iKind = 15 then begin, g* M( L2 }# {( E7 j
Str := 'putsendermagicitem 金币 @奖品兑换员 4';
/ X& S8 q! q/ v' I( X2 l print (Str);& x" ]& j2 Y' r% W o: g9 b
end;6 v. X: N; b% X, d! q6 W' y" h. G0 H
if iKind = 16 then begin/ x! ^- u6 X# S- i% n; _7 X
Str := 'putsendermagicitem 千年水晶原石 @奖品兑换员 4';3 w6 e* G9 f0 o4 X
print (Str);0 b; |5 K$ d+ b! t3 ~+ W* m
end;; D. K6 z% R, [) E. ^% j0 T2 h
if iKind = 17 then begin9 V! I. I9 X) _8 @& }: _. R5 t& ~+ D
Str := 'putsendermagicitem 千年水石 @奖品兑换员 4';
( F! l9 W% l, J print (Str);2 ^* I( o9 r. I3 s
end; g2 \+ t i x8 O6 ]+ E5 a
if iKind = 18 then begin
X3 e1 b" c3 Q* @( N+ w4 W0 M: W Str := 'putsendermagicitem 象牙十字镐 @奖品兑换员 4';
8 {* {+ n5 |2 {$ ]0 s' s ~8 i. r3 G, i print (Str);' W! l9 L$ F' j& M( z2 k$ {
end;% H! o8 z3 }( A/ z
if iKind = 19 then begin2 E6 `8 I1 _! a1 |
Str := 'putsendermagicitem 男子黄金铠甲 @奖品兑换员 4';" M. p4 U5 q0 e2 _7 S$ H
print (Str);
# i$ v; u. z, W6 g1 P end;
' p, L& D- b; } if iKind = 20 then begin9 }" G ]1 v2 j4 L6 p" ^
Str := 'putsendermagicitem 女子黄金铠甲 @奖品兑换员 4';
0 o! U3 e+ ^. \9 t0 X9 X print (Str);( |& H2 `& {2 }, g3 A. E" J& L I
end;
$ z ~6 I0 B& M: ~3 t0 A if iKind = 21 then begin
. N& z% H- N) \$ a4 {* _( b. K Str := 'putsendermagicitem 男子桂林弓服 @奖品兑换员 4';4 L' { t4 x( y/ Y3 M
print (Str);
6 _2 s+ ?* N' L, Q& P" G- r) Y end;6 g& A6 D2 e4 {. t8 r0 I! c
if iKind = 22 then begin
. @2 }1 W3 x8 J- @# \8 |% q Str := 'putsendermagicitem 女子桂林弓服 @奖品兑换员 4';
A& f* l+ ^" p8 Z) a" [- k3 c print (Str);
; f4 }) x, g( p0 e& G' ` end;/ j) C8 U' Q( l& d
if iKind = 23 then begin
5 W0 u2 D$ F0 G- `/ L h. y Str := 'putsendermagicitem 太极明珠 @奖品兑换员 4';
& d/ H- _+ s0 C print (Str);
3 s9 V4 d/ t$ C& A end;
- |1 Z3 `% x6 ]: |: r/ K if iKind = 24 then begin8 V3 w$ K D* {# D* }, d2 }2 y
Str := 'putsendermagicitem 狐狸内丹 @奖品兑换员 4';
& J1 _: e9 z" y1 ^5 H# [ print (Str);
3 m0 l0 {- W. B8 A/ z% W" x end;
1 b$ s% ?+ ~6 f if iKind = 25 then begin
8 v- @& N" D& U; k Str := 'putsendermagicitem 白玫瑰 @奖品兑换员 4';
" R* u: K6 s0 _$ ~3 Z print (Str);
- ?% \" M/ G& Z# B4 _5 x$ V end;
1 {3 m+ f+ l! G) i/ O- w if iKind = 26 then begin4 F( i3 R/ u& U7 ]* Z
Str := 'putsendermagicitem 红玫瑰 @奖品兑换员 4';
9 {+ T3 G: @$ t" m9 h; X5 g+ ? print (Str);
" d1 i( [2 p% H2 M7 n; R! Q* J end;3 L8 K1 {, x: v' D& I5 Z
if iKind = 27 then begin$ L& _0 n) \* m# e7 ], c( g
Str := 'putsendermagicitem 灵动八方 @奖品兑换员 4';
* S) s: X/ |5 C- h9 P5 Z print (Str);6 Z# o& l" x9 R b
end;* T V1 ?) d0 }6 I
if iKind = 28 then begin# q' H- ~* G1 W% u6 D) ^3 n0 D
Str := 'putsendermagicitem 男子魔人战靴 @奖品兑换员 4';1 y/ g( c4 V8 p( ^! p8 \: ]
print (Str);
9 Q# i; I( F6 i/ l- n$ g' w5 Q end;( Y( B" K+ v J2 S. `4 f
if iKind = 29 then begin: A O4 I/ J, j
Str := 'putsendermagicitem 女子魔人战靴 @奖品兑换员 4';+ {0 C {. T+ i/ F# I, N
print (Str);
# L2 O. h* D4 K; D2 t i1 ` end;* ~9 N& X! t3 j$ ~
Str := 'say 本想趁机摸你两把,可你身材太差了~';4 Q! v: h3 F4 S+ l- I( r7 G
print (str); A( P) S, ]. b, H% s. z8 l5 C' P
end;
: o0 A) _/ U$ T/ R5 l exit;
G8 A) f: n: u1 X( ~% |1 E! t d9 U end;% L5 a5 e U- c1 C$ v; D7 m
exit;
) _; \! v$ j5 [" c5 _% K end;: w2 o- n5 c9 S; Z) ~5 d5 U m
end;
2 k+ W7 a2 R0 b& k( Zend.1 E9 E/ n q0 _& E; L3 Z0 V
------------------------------------------------
8 ?" i+ C8 {: W, Q在tgs1000\script文件夹里得script.sdb里
% z4 \, t. B/ E2 X C* M! a$ r: ~/ B; H最后一行加入
1 b! h- k) g2 R0 W--------------------( ]% ~* C9 s) E' h
130,奖品兑换员.txt,,
1 x* Z: c. }3 ~7 X--------------------4 ^% A _2 o( Z" V
然后在tgs1000\help里建个文本文件 名字: 兑换员/ a* S9 a/ H' k1 }. D
内容如下; j% \; X4 _# N7 \# L+ W/ @/ S& i
------------------------------------------------4 e( `, ^$ s' X9 A
<trade>0 z) S& N' ]7 r2 L' Q- U
<title>奖品兑换员</title>1 ^0 E* o/ f' A% {- M5 T/ e* x
<image name=z81 value=235>* x- U0 L8 C+ a1 n, }- x. \
<text>0 o( m' J& i, [4 w5 u, L
天下没有免费的午餐,努力吧!% D4 F0 I/ | M) R* g% D9 ^' D1 @
</text>
. s$ `5 i7 u; P; Z<command send='close'>关闭</command>
* d4 L; B2 R# r7 c) i, d+ z<command send="jinyuan">天下没有免费的午餐,拿5个金元来!</command>
; |9 K/ c9 H0 B8 }, P5 ^, g* ^</trade>mand send="jinyuan">交换好运来,祝您好运</command>. q4 A7 Q' o% E5 T+ N# _
</trade>2 d0 e' N% [8 C! K$ t
-----------------------------------------------------" `5 a9 R% a' n7 `( j/ s
然后在NpcSetting目录下建立一个.sdb文件,命名为:奖品兑换员
' p# j& @! ~; f1 b6 z/ Y里面内容写成:
- N# m6 J2 e0 p& Z' P0 B( ]9 v
) o6 p2 O/ y% i- G- K* Z3 m* X" d' wName,boSelfSay,boMain,MainNumber,HearString,SayString,NeedItem,GiveItem,CountLimit,RecoverTime,DelayTime,
+ Z6 `' r1 E# y% Q2 T& X& D2 W1,TRUE,,,,我可是可以换到英雄装备的噢^_^!,,,,,1800,
5 Q D a0 F5 A5 C-----------------------------------------------------
+ k1 V. N7 k: v# }- W在tgs1000\Setting文件夹里得CreateNpc1.sdb里加
0 z+ i2 c) d" R-----------------------------
! M7 E2 }8 k! k& e104,奖品兑换员,524,474,1,5,130,奖品兑换员.sdb, 2 D) t. ?5 e" I; ~' z0 C
|