在 tgs1000\init\npc.sdb里加
& ?. i, l. o2 V. N0 y; T奖品兑换员,奖品兑换员,0,,,,,,,,,,62,81,235,0,0,,,,20000,0,0,0,0,,0,,,,,,,,,,,,,,,TRUE,4 R+ M, t1 ~4 i9 x
在tgs1000\script文件加里创建一个文本 名字:奖品兑换员! G. v! M; r8 H0 O. s
------------------------------------------------' V9 T7 I% {4 \
unit 奖品兑换员;, \- |) {( N# p2 w G5 U7 z
! J% U2 U, r/ G T
interface0 F7 h5 M9 J( h& T1 E
3 V0 O, v. f% t- [& J+ |* [ xfunction GetToken (aStr, aToken, aSep : String) : String;# h; r7 q- d" v% \* y( V1 y m
function CompareStr (aStr1, aStr2 : String) : Boolean;. m( b% l% l1 D( l' q2 h* }
function callfunc (aText: string): string;" {, c; p+ Z1 T A' L
procedure print (aText: string);6 D1 a' V# D$ w
function Random (aScope: integer): integer;
# m; n# R1 ]; E; G5 u5 R! qfunction Length (aText: string): integer;7 ~: ~5 N- \" m# L7 Q( S, w
procedure Inc (aInt: integer);3 q) S% \4 f& |7 [$ l8 ]
procedure Dec (aInt: integer);
3 E: v' R; Z% ~; f; ofunction StrToInt (astr: string): integer;
8 \( A! P& O! dfunction IntToStr (aInt: integer): string;! B6 }* X i- D) ]" T
procedure exit;$ x% ]; l) m8 `* Z& i
procedure OnGetResult (aStr : String);9 \+ |" d( a Y$ W( G2 Z* {: e
procedure OnLeftClick (aStr : String);
$ |1 D( `$ B$ D- zprocedure OnApproach (aStr : String);, {# H! c% i5 L: v2 [: |
procedure OnAway (aStr : String);# {3 A: W7 N+ W/ _. w+ \
procedure OnArrival (aStr : String);
/ @( [, t, h4 o- h1 ?! ?/ r7 Avar( C& D4 l/ A7 O2 E+ p: x" p. i
iCallCount : Integer = 0;
* ^ U$ C( I( J. f, g% Zimplementation/ j7 O' E- Z; M" D: F
procedure OnAway (aStr : String);
# I& ]9 \0 A( K2 N# X1 {2 A( L6 ]& Z# Hvar/ U {1 `" Y6 `; M9 G5 `
Str : String;) E+ Z/ f% x8 E' n( x
Race : Integer;) {( \9 r: G9 N1 v, e) i
begin4 v& a2 A u& ~/ o
Str := callfunc ('getsenderrace');
, b2 o) B7 [" [9 q5 h9 { Race := StrToInt (Str);
! e! N- i: d4 e7 z9 p if Race = 1 then begin
9 t& v. @" _4 o* ] print ('say 拉拉拉拉,贪财老人来喽...');# k1 ~$ O2 _6 W% W( ]. f) u
exit;
" K3 w$ ~0 f4 |# a% X" b end;6 R7 L3 L$ a9 H# G) L9 m
end;
5 \1 ?+ ~/ T$ f& U+ gprocedure OnApproach (aStr : String);: l0 ?; b$ j3 W) ]
var6 Z+ _2 {% I+ ]7 y+ Y, o
Str : String;+ [, x0 j5 n. n& o1 t0 O/ a* z
Race : Integer;
3 X2 p5 H9 G6 c: Fbegin
2 n0 V* C) A1 M2 b& _$ V Str := callfunc ('getsenderrace');
5 n% o: F$ m9 x5 L Race := StrToInt (Str);
: ~# U, @- \# g) p if Race = 1 then begin
0 j! P1 F5 |" _7 i) j: T+ z print ('say 各位节日快乐...');
7 S# ?( t3 a0 O8 |9 t! \! H exit;) w5 Z+ k, ^" ~. B4 L& ^2 u3 x
end;
, q1 [0 E7 F1 V' F8 ]0 c6 ?end;8 @% l% |* P I8 w2 [1 {+ `
procedure OnLeftClick (aStr : String);5 U7 ^4 o: |/ ]# |$ l; m
var( A6 c* z: `6 i, T; t/ n3 a/ f
Str : String;) w; _7 d3 g3 u3 k" F# }6 x
begin
9 P0 [9 X! X% `; d1 @! r B Str := 'showwindow .\help\奖品兑换员.txt 1';) C' i! x5 J) S$ I
print (Str);2 ~" y' m' d4 b
exit;& r. v d' e4 p, |: f3 |
end;6 w% d( O5 ?8 Y4 w; n! Y3 E/ j- X
procedure OnGetResult (aStr : String);
2 v# S& a6 X# yvar
% k2 q! i; [9 A: I- t) v! N Str, Name : String;
, T8 t) ?0 p9 }4 ] iRandom, iKind : Integer;2 b5 C- ?+ E$ H& n) n
begin+ b' L, `& H- J- c8 g
if aStr = 'jinyuan' then begin+ n4 l l5 ^7 s/ |& N6 H1 F
Str := callfunc ('getsenderitemexistence 金元:5');
/ w- b2 ~7 j2 |1 k* G0 e if Str = 'false' then begin; N8 p$ v7 o" F" Q/ Y) ~
Str := 'say 哪有免费的午餐?拿5个金元来!';
& M9 S; }; y3 S- w* I* a3 v print (Str);! D* f2 z, L* J: Y7 p. @) d
exit;
. B4 _& B7 S8 z+ w end;
: U9 |# o" U+ o" U6 [0 Q# ? if Str = 'true' then begin& X5 i! z! B/ [3 s Q/ k
Str := 'getsenderitem 金元:5';# C' c2 N% J/ r% |$ E
print (Str);. y# Y1 F( l$ _" ?) ]2 X) X* @
Str := 'say 小子,你的金子是假的!哈哈^_^哈!';
* V) D$ {* B: y- ^$ }& B" i print (str);
5 }, {) q7 V$ l1 t5 \5 n iRandom := Random (5);
$ x K! X7 X$ m4 w$ K Q if iRandom = 1 then begin
5 T" {4 v G Z$ I% c+ m+ g* Y Str := callfunc ('checkenoughspace');. `/ x+ D$ s% }! Z. l6 i" J; _
if Str = 'false' then begin9 ?1 q E+ }, B+ E$ m; k
print ('say 物品栏已满~');
/ W# J% S# V7 ` exit;
* I0 G& @& y7 p! `& N4 T5 q% A end; |$ G' \% G0 i# g6 u: m( y9 U
iKind := Random (29);. k0 A8 t$ C }
if iKind = 0 then begin
7 X9 q% J& z. {5 }8 }- s$ a) E Str := 'putsendermagicitem 男子英雄铠甲 @奖品兑换员 4';& q; a4 a) f6 Z) H
print (Str);, ~, ]( \& z$ j& _7 ^
end;
7 O$ J1 Z; D: B if iKind = 1 then begin6 s. T% C0 g) R: S" ^0 b: A
Str := 'putsendermagicitem 女子英雄铠甲 @奖品兑换员 4';
' r9 f. q) X* v/ `+ x9 a print (Str);- U% }8 K6 Y. A! u
end;# [+ O/ ^0 X, E1 M7 O
if iKind = 2 then begin8 Y9 d! @/ W# x) l9 w* x( y7 J. w. P
Str := 'putsendermagicitem 男子英雄头盔 @奖品兑换员 4';* `( }, S% T/ G' n: n7 l4 r3 r
print (Str);5 a6 B* B7 J* S7 b) n9 |) a
end;
. |8 H: A" [3 J0 V( e, u( Q2 n if iKind = 3 then begin6 q" @8 E" c7 |' u7 X' c
Str := 'putsendermagicitem 女子英雄头盔 @奖品兑换员 4';8 H2 Q7 Q$ o, c& ^% ~
print (Str);
9 Q9 h, Q% @# Z+ q: E& @8 m end;
9 Q O* p( F) C& D' j( R if iKind = 4 then begin+ R; z6 w% g% ~# n3 h& u2 g
Str := 'putsendermagicitem 男子英雄护腕 @奖品兑换员 4';
7 Q: H3 J5 b$ _ K7 C$ j- I print (Str);
" o6 ?. ^, p% T1 a- B end;! A1 U1 s0 l: \; ?: N9 X
if iKind = 5 then begin
2 l9 r, b" N8 @+ N$ w6 S l Str := 'putsendermagicitem 女子英雄护腕 @奖品兑换员 4';; g+ f( x7 k1 D7 z3 U3 V3 |; z
print (Str);
# v) l, e. j7 v end;
4 r' [" F4 v9 m! l8 k8 y f Y: I7 Y if iKind = 6 then begin, m8 Q8 c& a/ G4 s8 `+ I' M7 ~9 I' }* U
Str := 'putsendermagicitem 男子英雄战靴 @奖品兑换员 4';
A, b7 v D/ u! k: s) h8 r" F print (Str);
- w% C+ ~. J. _6 h1 q end;
) V" {* M6 N4 [2 ?! n( h- q if iKind = 7 then begin
4 T* p1 a$ {$ R9 w3 ^ Str := 'putsendermagicitem 女子英雄战靴 @奖品兑换员 4';; e3 W: w7 S* L
print (Str);" f) a+ G5 Y g- h2 P
end;
: f2 N8 i' y3 n; a- L if iKind = 8 then begin2 O3 W6 [$ I1 x+ V# o$ y. y
Str := 'putsendermagicitem 百炼三*戟 @奖品兑换员 4';
; R8 Z7 i2 Q/ J+ r8 i! ` print (Str);
" A G* \/ z2 M end;# T% L+ h/ G4 i* o
if iKind = 9 then begin
3 Z- ?6 f0 V* b8 e5 S: @ Str := 'putsendermagicitem 百炼日本刀 @奖品兑换员 4';* l, O' n! ?+ d! S9 i
print (Str);) u( _7 X9 K( A4 f! P
end;
; o. `" o% @. F! u if iKind = 10 then begin3 x! \+ a7 l& y9 \- F
Str := 'putsendermagicitem 百炼忍者剑 @奖品兑换员 4';
; X. Q& f& x/ p. A print (Str);
; [1 w' f# D `8 ~; D! K; w' V end;
8 W, `2 i0 V9 P& z if iKind = 11 then begin
% R7 e ~, N: h8 V( @; F Str := 'putsendermagicitem 白骨魔棒 @奖品兑换员 4';
7 e6 I) C; `- ^' j f print (Str);- W& {1 t0 |) R# f H
end;4 N9 K2 \& ]4 l5 b, t/ D' Z
if iKind = 12 then begin3 N% N% R- S! `: g
Str := 'putsendermagicitem 生药 @奖品兑换员 4';& ]* Z+ g1 n- E9 B9 `
print (Str);
5 |+ H. k' f3 k r3 i* G" {8 h end; d$ E; M5 v9 {4 V
if iKind = 13 then begin
U$ R* D. v% g5 f4 j Str := 'putsendermagicitem 男子魔人护腕 @奖品兑换员 4';
: c& P5 h: ?& F print (Str);# T: T/ e* V9 W* b
end;
1 P t8 F0 t: _/ l& _8 T2 c* W if iKind = 14 then begin! f* [! A) @# u8 A
Str := 'putsendermagicitem 女子魔人护腕 @奖品兑换员 4';
% M9 ^, L& d% e print (Str); E4 n# ?% m+ V8 Q: m7 v5 C' W
end;/ J1 b( h! T8 G1 m+ b: U0 q. O3 e# {
if iKind = 15 then begin0 y7 @# O. x$ D' z% ], Z: f) A; n
Str := 'putsendermagicitem 金币 @奖品兑换员 4';" x& e9 z1 w; X+ k1 }
print (Str);/ k0 y, i% a& L( y% ]9 e0 z
end;2 Q5 p5 s+ R+ b/ y1 c) {" M
if iKind = 16 then begin
8 z& i! K' b7 f Str := 'putsendermagicitem 千年水晶原石 @奖品兑换员 4';# y1 i9 B) Y) C* O N3 N
print (Str);
/ q) [- x3 ]( Q end;
9 [3 S3 ?8 U2 { ~! z+ N* m, u if iKind = 17 then begin
7 {6 w8 T+ _7 Y Str := 'putsendermagicitem 千年水石 @奖品兑换员 4';: ?8 l9 E }& W" d
print (Str);
2 p3 U: W: ]$ r0 [! d' L. {& ] end;
0 u; s8 R a( w- c! l. @ if iKind = 18 then begin' V5 g+ p9 f. e' ^
Str := 'putsendermagicitem 象牙十字镐 @奖品兑换员 4';
. T* \- g+ C, h print (Str);
3 C; ^& s3 ?' u2 X, }9 p end;
5 [0 J/ o! W3 q2 Y8 R if iKind = 19 then begin3 [! W U' a& p3 o W: J I( x( J1 i
Str := 'putsendermagicitem 男子黄金铠甲 @奖品兑换员 4';3 _, t- d, |' i1 v+ j/ r
print (Str);/ M$ [+ L/ A" T: U* `" ^
end;* O$ o$ `5 T& l: @7 f$ @ N' V
if iKind = 20 then begin
8 p. K O4 t/ A9 b Str := 'putsendermagicitem 女子黄金铠甲 @奖品兑换员 4';! @! F4 }. k0 x6 K
print (Str);- {6 I2 C5 h% g3 x
end;
. z! l0 L* u [ K ?! ~ if iKind = 21 then begin# @; m r/ `- e: u1 |
Str := 'putsendermagicitem 男子桂林弓服 @奖品兑换员 4';
7 w" t; ^ [+ W' e8 a print (Str);
$ c9 J/ c6 o6 n; N3 v- r* R end;5 a: n3 q" n( Z2 L0 T8 G
if iKind = 22 then begin2 \: D* L: N; I6 R! n
Str := 'putsendermagicitem 女子桂林弓服 @奖品兑换员 4';2 X& D. Z: J: d0 g
print (Str);
. k' n% e6 C: a$ @ end;6 m2 e* N( [0 |. G! D q ?
if iKind = 23 then begin' C8 l; A% F9 u, g/ }) P
Str := 'putsendermagicitem 太极明珠 @奖品兑换员 4';* A; e: ]4 }8 e3 N' a e
print (Str);
8 b4 B8 z$ g l: _) X end;
3 f; N4 \8 B' p+ i if iKind = 24 then begin! q! n) ^+ c1 D6 |* G
Str := 'putsendermagicitem 狐狸内丹 @奖品兑换员 4';
' I7 U! ^1 ~ c3 Q print (Str);& f3 o9 T+ n5 c+ k2 _* h! B- Y
end;- n( L! |- p2 X. f5 k: o
if iKind = 25 then begin5 C0 G% A q( H
Str := 'putsendermagicitem 白玫瑰 @奖品兑换员 4';' H, O# }6 a) r" \* L+ d
print (Str);
( g( t( s* Y$ G9 Q, D: E ^ end;
9 }9 q9 L$ r6 j6 V' P if iKind = 26 then begin
R. u! e, S, A8 c; @; b6 p v Str := 'putsendermagicitem 红玫瑰 @奖品兑换员 4';* B- y3 N. Z3 k3 m! G- w6 K" z' i2 ]
print (Str);
, h; n/ C1 T3 |! L/ F/ V7 b+ z/ o end;1 P1 p8 ?0 K, E3 p: Y
if iKind = 27 then begin ?% f+ s& t# W( W
Str := 'putsendermagicitem 灵动八方 @奖品兑换员 4';% p! A" k4 x5 N; ^
print (Str);0 |! Q3 M* m& w( J7 I
end;
: q/ D. ^: V+ g if iKind = 28 then begin! }: E0 i0 i8 L6 @1 o6 t
Str := 'putsendermagicitem 男子魔人战靴 @奖品兑换员 4';
% U: T& M# ` K w. w* ~$ |; \( | print (Str);
- V+ Z6 j/ U' V' N end;% J/ U( ], b% v! t& W) f
if iKind = 29 then begin; H; k, G! c2 f( ^# A) n# r
Str := 'putsendermagicitem 女子魔人战靴 @奖品兑换员 4';
# B4 E1 V8 ?5 F: G3 T1 D" c8 A print (Str);
4 r+ O4 d5 s# r1 ~% f/ T$ E end;) O9 M8 S$ {# \" Z0 w6 |* p4 U
Str := 'say 本想趁机摸你两把,可你身材太差了~';
1 K8 H$ X1 \. v; A0 ^+ T& u print (str);3 J0 F0 H# ^ Q9 z5 ]
end;, g5 ?6 ]! o# R9 s8 T2 Z& ^
exit;; j5 | Y" H1 [' p3 k1 ^
end;
; d0 S4 a" ^$ R, U) p$ a) \ exit;
: g6 Y0 y: n/ \( m+ G6 ~3 N4 T end;
3 b1 ?7 R& _# o$ }# M' Q1 \end;% D/ @/ i/ h) {2 a
end.
( X- | Z6 R: Y+ D------------------------------------------------: H) h0 l7 J1 P1 [. t8 t$ u7 K
在tgs1000\script文件夹里得script.sdb里
) J( x- d2 I) K3 R最后一行加入
& r* ^( ~7 t/ Z- m% _4 A4 n--------------------
4 Y* |; u8 s+ t130,奖品兑换员.txt,, ) c0 P8 T) u: M7 q L/ @; Z
--------------------
/ r) z! \2 G8 R5 K& @& M然后在tgs1000\help里建个文本文件 名字: 兑换员6 N1 ]& N0 Q2 K, l7 c6 A
内容如下
' i0 v; b* ?2 X8 D( h; |" f------------------------------------------------
0 H1 L( X. V. }8 ~) V" C<trade>
+ P) `6 h2 x& n0 }' O$ V* x) m) n<title>奖品兑换员</title>
2 _& F# t$ ^" |9 X$ a, o<image name=z81 value=235>
* u; E7 \, n) @. l' e H<text>
: C7 L C, U- z8 z# v$ G7 J天下没有免费的午餐,努力吧!
* G) Q6 {) f$ C9 H d# |0 n</text>/ J/ y4 ^; f9 K" q# J
<command send='close'>关闭</command>
& n$ ^8 u! S: _. u/ [<command send="jinyuan">天下没有免费的午餐,拿5个金元来!</command>( R% T: f4 g# U! m, c0 y
</trade>mand send="jinyuan">交换好运来,祝您好运</command>
, e1 u9 l8 l9 i% T</trade>
% p1 |3 P: a; g! m0 }' G-----------------------------------------------------; f' @: m9 r' {3 l
然后在NpcSetting目录下建立一个.sdb文件,命名为:奖品兑换员. ~; X. V2 e% y( U
里面内容写成:
- r+ g. m. F. f: R/ \1 f' d: w" x/ V: Y% B: P% K! \
Name,boSelfSay,boMain,MainNumber,HearString,SayString,NeedItem,GiveItem,CountLimit,RecoverTime,DelayTime,
: H2 _) }" f* T4 W7 _1,TRUE,,,,我可是可以换到英雄装备的噢^_^!,,,,,1800,
) f7 L0 P" c- M-----------------------------------------------------: u* K$ ^. j1 A, ]
在tgs1000\Setting文件夹里得CreateNpc1.sdb里加
$ s. [! y6 |7 i i% |& D3 L-----------------------------$ V& `" i% q5 V9 H
104,奖品兑换员,524,474,1,5,130,奖品兑换员.sdb,
3 _! }4 l3 [6 M& Q |