在 tgs1000\init\npc.sdb里加
5 y% K, v' J7 q% q奖品兑换员,奖品兑换员,0,,,,,,,,,,62,81,235,0,0,,,,20000,0,0,0,0,,0,,,,,,,,,,,,,,,TRUE,
; O! w( [, U, k1 w( m5 J在tgs1000\script文件加里创建一个文本 名字:奖品兑换员
) u+ u8 _- L2 B+ U6 V* ^! a4 @% a------------------------------------------------
) d! K* D& w: Lunit 奖品兑换员;2 E) n0 x9 q& A4 f4 H( w
- T. o: T9 P7 e& M
interface& d' z4 O5 G0 [2 Y' s# V
4 F& H2 r4 ^* F3 ^function GetToken (aStr, aToken, aSep : String) : String;9 B% L* D( Y; y$ |) {
function CompareStr (aStr1, aStr2 : String) : Boolean;' t' N; e' O) C. f& L- f4 U
function callfunc (aText: string): string;# n3 d0 O) Y$ U5 T
procedure print (aText: string);
/ c$ o/ I" W) v2 N+ l- U' r. R& `function Random (aScope: integer): integer;
! N. w% l1 D6 s, u# Y0 K. ~3 ifunction Length (aText: string): integer;0 U! X. R, K+ j) ^9 d
procedure Inc (aInt: integer);
6 Z3 W( K0 [* B& @$ wprocedure Dec (aInt: integer);1 j' J# P$ R' u9 T3 I' g! g; G, O
function StrToInt (astr: string): integer;6 E- f% s. j) `5 a/ Z( c, i
function IntToStr (aInt: integer): string;' x1 L# A! c7 T. q2 s8 s
procedure exit;
' E- F/ M6 s/ }procedure OnGetResult (aStr : String);1 p2 D4 G" k6 c5 r1 q+ G
procedure OnLeftClick (aStr : String);
+ T' S. u. P4 t* b' k' ], Mprocedure OnApproach (aStr : String);( r- c: {' G$ V ]1 Y
procedure OnAway (aStr : String);
) X* e3 e5 h B6 u1 n! ]procedure OnArrival (aStr : String);
9 V0 F( u% |- @& ]' ?& Evar5 s2 }( A) ]8 U1 y5 h; B
iCallCount : Integer = 0;
& A" l1 m; j: r/ iimplementation/ W7 O! S+ L6 c
procedure OnAway (aStr : String);- A+ Q7 \5 x0 B# }
var- g$ [9 E% b* m3 V5 {" {5 a8 | J
Str : String;2 {7 ^# B/ m( U0 w
Race : Integer;
& K0 G4 ~1 Z# K) w- pbegin
8 a$ j7 }& @& S. r$ l: P Str := callfunc ('getsenderrace');9 M& J6 S1 H% c/ N3 E- M; L9 p O
Race := StrToInt (Str);
$ @" Y1 \0 {* G5 h, h9 K1 b3 [8 O if Race = 1 then begin
9 u: F( W5 H4 k print ('say 拉拉拉拉,贪财老人来喽...');
" U+ n$ ^( U; C- } exit;1 A( {0 R# n! Q" s" K/ w& k
end;2 o9 X: e% {3 K
end;
4 {. y6 E9 a3 V& q% U4 M" Vprocedure OnApproach (aStr : String);
- Z; ]9 @& B. | E# Vvar
2 v6 c6 | E2 |, K: p( x Str : String;: D5 ?! v: } ^. J5 m% f
Race : Integer;5 Q& T2 I- d2 ?$ t5 J$ R' E) x5 v
begin
6 h2 r4 Y" c7 U/ a3 O7 C, ` d Str := callfunc ('getsenderrace');4 q& n- d6 a) `: [
Race := StrToInt (Str);6 b; ]7 Q: T6 G" G: h" y j1 \
if Race = 1 then begin
) I K# P, {) C, j+ H, b print ('say 各位节日快乐...');
+ {7 p; r1 x% Q0 g# o* ~% W. k exit;
: z0 l& W5 z( @ h. K end;
0 M- K3 W7 t- v: l- x0 Wend;
3 \+ R6 b* d! Uprocedure OnLeftClick (aStr : String);- v K; s: K; e, q2 k( R
var3 M; Y& f* [9 e6 k: I% f: y
Str : String;# o8 L; p7 y; f+ u
begin
- {0 c+ n h* b& \! \, x s- w Str := 'showwindow .\help\奖品兑换员.txt 1';
- M5 e1 x- e; i. l9 [5 @ print (Str);! }( w7 q9 R) w7 Z8 {* e
exit;% n4 c. {% d0 }1 [( @% _: w
end;
0 B8 @$ s1 ]' o; Z2 Tprocedure OnGetResult (aStr : String);; M% Q4 P% W+ t$ o r3 a; `
var
& k5 z+ U& N6 }- R/ H% W Str, Name : String;
7 [* O: \* }3 @( g iRandom, iKind : Integer;1 y( j' Q" ^& l p
begin) D" R2 t! W# S
if aStr = 'jinyuan' then begin% G' g! P9 r Z5 D
Str := callfunc ('getsenderitemexistence 金元:5');
* B# u: F6 }, d& f2 H! X if Str = 'false' then begin
" K3 S/ `+ E6 G, F Str := 'say 哪有免费的午餐?拿5个金元来!';& e4 j+ G9 M+ I2 n, K, V
print (Str);- d; d% D, O& r1 C' x. z
exit;, @ L0 }6 ] A. z5 m/ s
end;
) M* H- B6 U3 V, B$ Z" a1 A if Str = 'true' then begin6 U) W3 G; A; v
Str := 'getsenderitem 金元:5';
! @; R' W9 |! _ print (Str);! r3 |; U P# X, J% l( n
Str := 'say 小子,你的金子是假的!哈哈^_^哈!';
2 V$ e z+ L. k# {3 N2 I1 O v print (str);$ a$ Y" f- ]% E( y
iRandom := Random (5);/ Q$ w6 S$ I) R7 u
if iRandom = 1 then begin9 o" U8 ~- j% f7 |. j
Str := callfunc ('checkenoughspace');
" T9 e8 H; {4 I9 r g if Str = 'false' then begin4 P9 U3 a- ~) O6 e5 i( Y, { Z
print ('say 物品栏已满~');, ]% Y5 X2 f/ v/ j0 R) Q' \: b2 [4 l
exit;0 y+ k" v0 C# }0 t; o
end;* ^3 a8 }# w$ L- q' n% [
iKind := Random (29);) x' B9 W( X j
if iKind = 0 then begin6 b& A$ S* j$ m
Str := 'putsendermagicitem 男子英雄铠甲 @奖品兑换员 4';
, K' M% H# E0 p5 \2 N print (Str);
, H* a$ m) f" R- E. M end;
! q" A9 J7 V8 ?% t& F% L+ s& U if iKind = 1 then begin j) |- G( a: ^1 s6 ^
Str := 'putsendermagicitem 女子英雄铠甲 @奖品兑换员 4';7 x7 B# W e2 r& ^
print (Str);$ D K2 o' |8 X2 `6 r7 `8 C+ u1 ~* k
end;/ c7 J" p5 e! ]* ~9 \ Q5 T& T. w
if iKind = 2 then begin
1 z/ k5 p Q- j3 K Str := 'putsendermagicitem 男子英雄头盔 @奖品兑换员 4';6 u$ w' e. Z8 p$ A% D" }0 I+ h
print (Str);
% f2 B* z6 c, e: a* B+ p8 |! G end;7 P4 O; c/ ~% V" v) R3 }
if iKind = 3 then begin
& i% [ U H% k Str := 'putsendermagicitem 女子英雄头盔 @奖品兑换员 4';
+ q+ p! M- q, S) G' @: s( } print (Str);9 P) M+ g& Y7 L5 r( c" f; M2 u
end;1 s. J. a4 ?8 B7 O6 V& |
if iKind = 4 then begin
2 }# e# G7 y8 R Str := 'putsendermagicitem 男子英雄护腕 @奖品兑换员 4';. i6 m! d' G9 M$ @2 d2 K
print (Str);
$ n) g& Z6 W, l8 v2 B0 j# O1 L5 N end;
. I, [8 ]6 Z" l# w if iKind = 5 then begin
( @: t/ @3 R. L) b" I# J Str := 'putsendermagicitem 女子英雄护腕 @奖品兑换员 4';4 g8 k x" p @ L" _( Z- r
print (Str);! d, K8 e( P2 p, [, H( ]* n, A* {. u1 u
end;3 T) t/ |/ d* F9 Q: L% Z
if iKind = 6 then begin
5 U; J5 d0 c D; S' p4 R Str := 'putsendermagicitem 男子英雄战靴 @奖品兑换员 4';
0 y! S2 G0 N) K1 F0 L print (Str);" C. u Y7 N& T5 v7 i: h( \
end;1 j2 b# U7 k6 V3 e( c' K; K& j
if iKind = 7 then begin
& c) Y' A1 L+ s/ a! D1 B Str := 'putsendermagicitem 女子英雄战靴 @奖品兑换员 4';
7 n7 T3 a: t) E2 |6 w print (Str);
, U. A4 z+ m9 J/ y1 A ^ end;
: S. y( E: X t# l u5 J if iKind = 8 then begin. b2 \* {4 O2 V" i9 W$ r- }
Str := 'putsendermagicitem 百炼三*戟 @奖品兑换员 4';3 I0 Y+ t; i( F/ F! E4 ?) ?
print (Str);
4 {0 K7 Z- S- h" P' k end;
: x) B! m; b9 V) q0 D1 {6 B8 V3 a6 i if iKind = 9 then begin
3 y" i& L ]* a# Y. v' Y. @4 E Str := 'putsendermagicitem 百炼日本刀 @奖品兑换员 4';
( }/ U" U4 d4 _* J$ M, V! L$ F print (Str);
/ A* A3 y; ~; P" s end;8 X& C, {- ~ d6 l( o" M r$ @6 ^
if iKind = 10 then begin" D( A6 j8 O( t y6 S
Str := 'putsendermagicitem 百炼忍者剑 @奖品兑换员 4'; p0 f0 _1 V) E/ H- Y/ P5 ]0 x
print (Str);9 Y: Y. u0 p; j
end;& T) G0 z* }! B: G) X; X
if iKind = 11 then begin1 H" ~4 `! G: J9 b# U3 d
Str := 'putsendermagicitem 白骨魔棒 @奖品兑换员 4';$ x: `2 D* j/ z0 g
print (Str);
' z* G2 L. U, |8 p, P end;
! k) n6 t) ?% a7 ? if iKind = 12 then begin; \3 Q7 D! s$ L3 `$ Z/ y
Str := 'putsendermagicitem 生药 @奖品兑换员 4';
F5 `. w- Y. m8 y3 `9 x B0 J print (Str);
! Y6 K% N( K- i# o+ M end;4 f9 C( I1 y& d2 y0 o9 Y
if iKind = 13 then begin
0 U1 f* v$ [2 E/ l Str := 'putsendermagicitem 男子魔人护腕 @奖品兑换员 4';, H/ v, Z, ?! S; ~
print (Str);
. ?, h) K5 T D2 V+ e end;
. C, W8 x1 I$ G4 [* u$ y! p if iKind = 14 then begin1 E3 R K |6 |& C( s5 A4 d, @8 a0 ~
Str := 'putsendermagicitem 女子魔人护腕 @奖品兑换员 4';
{! ^9 Q! O' ]9 C: |/ q print (Str);9 R( |( U% Z2 ^7 d
end;* `8 N H# a) B
if iKind = 15 then begin+ ]1 v+ ]! g- g; a5 k$ P' x
Str := 'putsendermagicitem 金币 @奖品兑换员 4';
0 l z* M8 R3 o! F: t9 B print (Str);) g5 n, U p/ a7 Y* q. O. ]
end;! D: f$ G$ V- f& u3 T) T6 G9 Z
if iKind = 16 then begin% _$ H/ C. C* p7 B1 `9 X9 c
Str := 'putsendermagicitem 千年水晶原石 @奖品兑换员 4';
2 Q3 e( D' [& B, b/ o# x* s2 n print (Str);
6 \* \8 n: D) N1 z, ` end;5 q7 F; n- A( ^) ^& i: S I6 D( K. l
if iKind = 17 then begin
' L) P/ ^9 e# p8 g+ l Str := 'putsendermagicitem 千年水石 @奖品兑换员 4';' F( L! D* S& Q) ~8 X/ [
print (Str);$ `# j6 h6 r6 `8 o2 M5 p9 g
end;
$ l3 E. ?. n9 [ if iKind = 18 then begin
* r" [' q$ d a Str := 'putsendermagicitem 象牙十字镐 @奖品兑换员 4';
/ x' E! _& v' [/ X print (Str);, t; a$ z1 h' l. j, y
end;8 h9 C8 v7 K( }# G7 P- H8 i# d
if iKind = 19 then begin
) f; v( G0 |( P6 r4 w7 u% q Str := 'putsendermagicitem 男子黄金铠甲 @奖品兑换员 4';' Q; {3 f5 D+ V5 S
print (Str);
3 v+ N2 J2 G! l! Q$ H0 r0 p+ \; F end;
# q+ d4 Q/ U% y z" d# E) Z4 Q' ^ if iKind = 20 then begin. ?, a0 J# O( f6 G
Str := 'putsendermagicitem 女子黄金铠甲 @奖品兑换员 4';: L" N( e4 Z! e/ b8 S
print (Str);6 c# G) K. R! a% ?. s
end;
& o, h! O. Z9 Q7 M1 M/ y$ n' V1 \ if iKind = 21 then begin
+ b, w) S; h" M- p7 B Str := 'putsendermagicitem 男子桂林弓服 @奖品兑换员 4';
6 j: {, ]" ~& v3 K- S+ i print (Str);
' m9 Q5 X8 B8 ^# ]6 C4 W$ u* I end;, O. V# R2 a/ p* H! F
if iKind = 22 then begin; g" Z3 z7 U0 s
Str := 'putsendermagicitem 女子桂林弓服 @奖品兑换员 4';4 V) k1 @0 d9 i) T3 {5 k/ N' F% C
print (Str);6 N: U- ^9 C5 |' H- z
end;$ O6 {4 C1 G) q8 g: W8 X* C1 v
if iKind = 23 then begin
' [9 G" e2 A& o( o Str := 'putsendermagicitem 太极明珠 @奖品兑换员 4';
& E# w5 w( y4 I5 N% E E9 J print (Str);
' _8 Y6 r0 F8 k% c7 h end;
) Y7 n* `& Y, Y' ]7 O# ~# O if iKind = 24 then begin
9 x4 T. t% m5 i5 h6 W. _ Str := 'putsendermagicitem 狐狸内丹 @奖品兑换员 4';
7 _$ r5 E! Q1 e* h! U v; y3 N print (Str);
% T" p( A+ Z: d end; P/ k5 l. F( u
if iKind = 25 then begin
% ^) I, H; J u3 T$ R0 d( n% O8 H4 W$ I Str := 'putsendermagicitem 白玫瑰 @奖品兑换员 4';
' p/ J4 s; V! _4 j/ T print (Str);
1 h% i+ t A9 V8 S2 c9 q end;
& r3 `1 L, `* b& D* @4 G9 R if iKind = 26 then begin
2 a7 Y" j. v7 b! h/ ^* ^ Str := 'putsendermagicitem 红玫瑰 @奖品兑换员 4';
3 D* C& i5 f: K" ]! \ print (Str);
z P& O2 h% j% o S& [ end;; x# a; y/ i* h g
if iKind = 27 then begin7 i& g# i; K! G/ r# @5 K
Str := 'putsendermagicitem 灵动八方 @奖品兑换员 4';
" `: W0 }/ R1 `8 |0 Q print (Str);- t& q5 y- W. F7 [9 C$ M
end;* i1 B* S- [! r) i- a( b; l& ^9 U) p
if iKind = 28 then begin
: n4 ^1 \" A! ]+ F# m Str := 'putsendermagicitem 男子魔人战靴 @奖品兑换员 4';
! Q8 V5 v, ]. | print (Str);/ i ?& j; N; \
end;! Y% S+ R; w+ g2 J
if iKind = 29 then begin
* n! X) Y4 T) p9 T( I# v c; S Str := 'putsendermagicitem 女子魔人战靴 @奖品兑换员 4';4 H7 a% c& g3 K/ c. [0 e. ~
print (Str);
8 t: s- k% [% t/ N- K end;4 R2 P- k; F' ?3 R9 W9 t! `5 X
Str := 'say 本想趁机摸你两把,可你身材太差了~';
5 h2 C" r9 P. K5 j# i; H! L) ~, { print (str);
# j) S: F" w t' D6 T( x9 w$ N' n( O9 a end;' i' K* H( K7 d4 R& ]0 A4 H
exit;8 p( D- R; N/ @8 q7 w5 Y
end;
! h2 [: a' a. f/ }* ~ exit;
3 H$ a w7 e9 K7 H4 n" u2 X end;
2 A1 b3 _* s3 R$ v* f- Aend;& o' p) C* B, i, M+ j! ~. Z
end.
( j( R4 Q: ^* V) l; }' e+ @------------------------------------------------
) U; q! c$ D* M, |' r+ L在tgs1000\script文件夹里得script.sdb里
" Z: g+ J c$ G! f; |/ {/ \1 U最后一行加入% F% ?( I8 o5 S) h
--------------------# u8 ^/ \$ T8 n3 B
130,奖品兑换员.txt,, 1 C) K: c, D/ o2 Z
--------------------2 {% ^' t' m( u/ Y" U
然后在tgs1000\help里建个文本文件 名字: 兑换员
$ e. s* ^, C5 q4 h4 I; R内容如下+ @3 q o: @' i: [5 @; ]! n
------------------------------------------------
/ T( K0 A+ e2 R9 @# U& ?% g<trade>0 v9 D5 Q+ B& P0 N; y$ u' V2 \
<title>奖品兑换员</title>
3 j" i1 | |0 i9 C: x2 G<image name=z81 value=235>
3 x) j4 A; K/ _' d% r% t; |<text>
4 u6 x ]3 ~! O2 a. c* [* a4 s天下没有免费的午餐,努力吧!
$ D( k9 a; H: G4 w7 [" ]6 A</text>
4 ~6 O7 ?; h, V- E2 m& g, q- }<command send='close'>关闭</command>
) z4 u) [. C! {4 z% _. ?, N<command send="jinyuan">天下没有免费的午餐,拿5个金元来!</command>
' P/ H7 } s g) @% d* W- I/ ~4 P</trade>mand send="jinyuan">交换好运来,祝您好运</command># P, @1 b+ W5 t7 e, ]% `+ @
</trade>
! D* q2 X. j. Z* q$ U; `-----------------------------------------------------
0 \/ k# F" Y) {; r7 W然后在NpcSetting目录下建立一个.sdb文件,命名为:奖品兑换员
* R- P+ t. g0 b里面内容写成:
! [6 [) S( q6 Q' a, {% {) d
. s1 [. F% j1 t' C% D6 m- YName,boSelfSay,boMain,MainNumber,HearString,SayString,NeedItem,GiveItem,CountLimit,RecoverTime,DelayTime,
+ @$ ] J+ P* N* k/ I( n1,TRUE,,,,我可是可以换到英雄装备的噢^_^!,,,,,1800,
* C) L& Q' r4 }* _-----------------------------------------------------! Z6 d$ ~, ^, D, d3 Y, s9 j
在tgs1000\Setting文件夹里得CreateNpc1.sdb里加
a' Y- H h; x# L-----------------------------
2 Y& w0 Q( I3 R& e$ G; C) @104,奖品兑换员,524,474,1,5,130,奖品兑换员.sdb,
! H) ?* V/ ]6 j1 l6 ]6 L# @" k |