三千论坛
标题: 神武奖品兑换员脚本 [打印本页]
作者: 异仟年 时间: 2022-9-5 17:33
标题: 神武奖品兑换员脚本
在 tgs1000\init\npc.sdb里加
. \" b8 `- `6 `8 T奖品兑换员,奖品兑换员,0,,,,,,,,,,62,81,235,0,0,,,,20000,0,0,0,0,,0,,,,,,,,,,,,,,,TRUE,
4 k6 J* o5 Y) Z1 a7 `1 n' _: v在tgs1000\script文件加里创建一个文本 名字:奖品兑换员
$ r' g; B0 j9 I2 {# a' f------------------------------------------------7 D8 A: M2 t/ R/ Z$ g- `
unit 奖品兑换员;/ w- [0 y+ `5 C1 h
8 J2 u! F9 U9 P- e
interface
8 T* \) ]; ?7 U* ^% j- n' U4 P: ^8 f7 U% N h" O" H
function GetToken (aStr, aToken, aSep : String) : String;2 w, G% L' m# R* i
function CompareStr (aStr1, aStr2 : String) : Boolean;& b% _$ O2 B. a! Y1 Q6 e
function callfunc (aText: string): string;
* Q+ j/ @2 v+ ~: Y! Kprocedure print (aText: string);
$ \# R8 L+ y _/ q, afunction Random (aScope: integer): integer;
) l7 m3 B! ?$ w5 D# @function Length (aText: string): integer;
5 F3 S _) N) E5 S6 V5 qprocedure Inc (aInt: integer);- a: r4 b7 {3 e" t/ g
procedure Dec (aInt: integer);. k- v; D! b4 L
function StrToInt (astr: string): integer;
: P: l, I6 m. yfunction IntToStr (aInt: integer): string;
0 v/ r" L, P) Nprocedure exit; j0 u; d3 i8 S) ^5 T
procedure OnGetResult (aStr : String); i8 \! B# |& a
procedure OnLeftClick (aStr : String);( r3 \, P0 B/ h# p) ]# }& }; R1 i
procedure OnApproach (aStr : String);- v9 @4 a" e) i7 p) V
procedure OnAway (aStr : String);% |( e' w3 x( Z
procedure OnArrival (aStr : String);
$ {' ~/ [- K" Gvar h: v% Z( m4 m- c' p, {
iCallCount : Integer = 0;
& ^+ z: C% B ~) nimplementation
+ W: V* p7 [' | b! Aprocedure OnAway (aStr : String);1 I$ r* V" J: p' o
var5 ^: n! z+ B# t
Str : String;& D# G" ^6 Y1 @' _% Q' \, T& J
Race : Integer;
9 K: ?% I: H/ _begin4 I; H1 j% z7 P7 c3 A$ D; i2 y3 ~
Str := callfunc ('getsenderrace');
3 o' y3 B4 i! O8 L; x, x Race := StrToInt (Str);5 o* G8 _0 p" Q9 C) i8 L: M
if Race = 1 then begin5 i% j+ y' y N# v# H: J" D5 i7 Y# g$ U
print ('say 拉拉拉拉,贪财老人来喽...'); f$ b; |9 V0 b( s) o8 @1 y
exit;
7 |. k2 A0 ^4 h8 A! N; ~ end;
1 a# _+ {- t! }2 y/ W& qend;
3 b- _' g8 U1 r/ Nprocedure OnApproach (aStr : String);
% S8 t/ h+ r# Z5 x" @* M5 N# Y. cvar+ {9 @' l9 s6 ~& B9 D `
Str : String;; T& `; E& s! f
Race : Integer;
" K9 R/ c+ ]: D- l$ \- e- ibegin
) e7 S3 U- _2 s% S% l8 Y5 t9 Q Str := callfunc ('getsenderrace');- G6 E5 \# q- p7 W9 ]5 z
Race := StrToInt (Str);
1 l! o8 h! T3 ` if Race = 1 then begin4 H3 F1 J- e+ r/ s
print ('say 各位节日快乐...');
: J! ~5 K' h; Q0 }7 y# g) w exit;
5 V/ x8 n9 `2 e @- i. R e end;
* m9 w6 D* Y3 U# {" P1 q7 s+ Zend;
; z9 z6 s) C% `7 i2 m/ bprocedure OnLeftClick (aStr : String);
7 b, }. o# g$ s, O" f. Tvar
- d- g7 o G1 `# O Str : String;* [, j) B& m! X
begin5 C8 d, Z! x% p& {: I+ G
Str := 'showwindow .\help\奖品兑换员.txt 1';3 V: H: q; f- w. p3 a3 ?
print (Str);
+ F8 R% c0 K t ] exit;, a% D1 L8 R. q: _" r5 y) P
end;2 W" H2 f& {: n8 E- H
procedure OnGetResult (aStr : String);
1 Y: n1 ~/ I( I: Q" Z7 Uvar
% B6 `; Y' c8 O3 Z1 x Str, Name : String;
$ w. \9 O6 f4 G+ v- h# c: q; N iRandom, iKind : Integer;- @1 I1 n( e1 X: e
begin
( {4 T1 g: z7 {' j if aStr = 'jinyuan' then begin
& ~) R; U$ i8 t9 |, a Str := callfunc ('getsenderitemexistence 金元:5');0 q. I& _5 U: z4 d: J+ |& y# I* M
if Str = 'false' then begin
4 E% G7 Z! j; c+ o, k) L Str := 'say 哪有免费的午餐?拿5个金元来!';
1 [# ^( F2 G* a, o5 I$ c5 Z, Z print (Str);
; C+ Z: F& I/ w0 |! r. Y exit;4 [2 |# M$ @- o8 L" @6 ^- R7 s
end;; O! K) k/ X0 @ o, L( g
if Str = 'true' then begin
9 _; ?! t. ]0 X- a& e' z2 @, }; N3 t Str := 'getsenderitem 金元:5';3 G# \/ G7 c# g$ L5 @, H _
print (Str);
y, j4 f1 A& h( z( ]' X Str := 'say 小子,你的金子是假的!哈哈^_^哈!'; S& u4 M5 S- H( U# i# P6 P# C4 P
print (str);
& i7 c P0 ~ F- o iRandom := Random (5);
% N8 Y+ L5 Z1 K0 \" T* }' k1 T if iRandom = 1 then begin
( i, S& l1 r$ ]9 [ Str := callfunc ('checkenoughspace');: c" i% B6 b8 \0 M
if Str = 'false' then begin
# S( u6 L. n$ G print ('say 物品栏已满~');
8 q: v6 h& B3 @9 J W exit;
; Q. n7 ^/ p, U. R end;
- p, J7 x& w7 J& m5 m' k9 z/ ]$ o iKind := Random (29);; ^8 ?" v' [( k! T, T( R
if iKind = 0 then begin/ i5 b+ E" O6 Y* _. C! t& u: H
Str := 'putsendermagicitem 男子英雄铠甲 @奖品兑换员 4';
@" g; _8 y1 k7 I% G print (Str);* P, A5 @, K3 m }( _, I
end;
* u' ]6 w3 R' b/ D( W$ c- V if iKind = 1 then begin
( X. Z, z' y8 M, r7 y Str := 'putsendermagicitem 女子英雄铠甲 @奖品兑换员 4';: K; a3 F/ [/ d5 V* G7 x$ I
print (Str);
4 Z6 U0 F$ o- I+ q- k5 B end;
9 K# V3 l3 Z$ h7 d$ U if iKind = 2 then begin( L8 }& g, f" R, ?
Str := 'putsendermagicitem 男子英雄头盔 @奖品兑换员 4';' P. A5 ?2 \3 Y
print (Str);5 U. H# w' p6 V. |& B
end;9 Y6 C) E6 h9 [5 K
if iKind = 3 then begin, m: Q/ y a* H
Str := 'putsendermagicitem 女子英雄头盔 @奖品兑换员 4';
# U6 C$ x6 a2 }6 g. U9 O+ o print (Str);% K$ E2 x$ Y$ }& ?: G6 ?2 U
end;# n1 R/ ]. H( d1 L
if iKind = 4 then begin" _9 C r$ ]( q; z3 k7 t. e, j
Str := 'putsendermagicitem 男子英雄护腕 @奖品兑换员 4';
$ s1 o" b8 D2 R2 l print (Str);
( a* b* N. Y9 c5 H! D end;
6 F8 c+ a: w. p4 { if iKind = 5 then begin
8 Y, ]9 m6 d( j2 E3 g Str := 'putsendermagicitem 女子英雄护腕 @奖品兑换员 4';! g1 h' M9 T( j( ], g( M* F
print (Str);" w$ A% _5 h+ W5 e6 r
end;
( j( @7 F2 d- l3 @ if iKind = 6 then begin4 E: |9 q) z, c
Str := 'putsendermagicitem 男子英雄战靴 @奖品兑换员 4';/ c2 k: y3 `7 ?. C) T6 v6 l
print (Str);
8 g: V1 O6 l0 l+ T( S end;
5 f& O; p g8 D4 L; ^0 B# c5 | if iKind = 7 then begin
! }& f3 i& o, G+ _3 } Str := 'putsendermagicitem 女子英雄战靴 @奖品兑换员 4';
" ~6 P" G% ?# F t( {) h$ g: z print (Str);( \" ?$ B) B& S4 p7 ?0 r
end;: ^5 P( D# [: i1 A/ Z! e
if iKind = 8 then begin
3 @! i* E) n- @; Y" V5 M/ V- t! n Str := 'putsendermagicitem 百炼三*戟 @奖品兑换员 4';
. U8 o; N6 }4 Y5 L6 e4 B) |" v% e print (Str);
7 b- b6 R& R7 o: C% S* O( w end;7 D# \# D. P. B% I6 ]
if iKind = 9 then begin- V- o5 _1 w n: Z/ f( S
Str := 'putsendermagicitem 百炼日本刀 @奖品兑换员 4';8 K. o' u' C0 e1 w
print (Str);9 U1 ?& L& N- \' x9 D3 H- r
end;. t* q6 l1 H3 c F4 t
if iKind = 10 then begin
2 n' n% ?/ @2 q3 S* q: W Str := 'putsendermagicitem 百炼忍者剑 @奖品兑换员 4';: V7 ?0 P) R9 {5 {% ]. Y8 S$ r$ C8 j
print (Str);
- g i2 h; L& X3 l" s: R end;
& h) X. J- y) X( Q( l if iKind = 11 then begin
$ u' _+ c: s7 a1 `$ E8 @ Str := 'putsendermagicitem 白骨魔棒 @奖品兑换员 4';* M5 I" z5 C9 x+ Q Y
print (Str);
/ ~( Q" Z7 W& m3 O: Q! S1 o7 Y end;4 }8 L. G/ m# U& } J" Z) J
if iKind = 12 then begin- ^9 l3 K2 M' N
Str := 'putsendermagicitem 生药 @奖品兑换员 4';/ S; {. U; ]2 y' l
print (Str);! k: h( v/ |: t I
end;4 J& W7 m9 R# _# ], U9 s
if iKind = 13 then begin' Y* [. H9 T/ V2 V- Y8 T5 |2 p
Str := 'putsendermagicitem 男子魔人护腕 @奖品兑换员 4';
1 m9 X) T# B1 ?" O2 Y c. { print (Str);
4 I; Q& k7 S1 n% T, V% I end;
, s+ h S" _8 z0 Z if iKind = 14 then begin3 `- h! d6 I7 e! i" D
Str := 'putsendermagicitem 女子魔人护腕 @奖品兑换员 4';$ J1 i0 I. e& G6 j$ a4 }
print (Str);6 Y' a$ ?% Z3 H# Q
end;
) @3 A1 J, ]1 x) B* o* {2 M- x7 S if iKind = 15 then begin
2 d% d6 r3 K& {; N Str := 'putsendermagicitem 金币 @奖品兑换员 4';
+ p* M3 m9 K0 @; w& L4 G( l print (Str);1 r) y5 x4 n# H' J
end;
6 Q, Z7 Q, G, Q7 h( }- ~- {+ J& | if iKind = 16 then begin, R) W, P( h/ E6 L
Str := 'putsendermagicitem 千年水晶原石 @奖品兑换员 4';7 ~, ], ~& e! p! p
print (Str);1 b+ R( R8 V/ |: i
end;$ Z, K- v& u7 \0 l7 W! A
if iKind = 17 then begin+ X. K0 r j4 ^( \1 { s6 I
Str := 'putsendermagicitem 千年水石 @奖品兑换员 4';
* V" h' [+ D% E5 R+ G print (Str);% g8 l: v* r7 T
end;1 a) g' M4 h7 c! [* n& o
if iKind = 18 then begin
2 p S: n: L0 D1 A3 S4 C Str := 'putsendermagicitem 象牙十字镐 @奖品兑换员 4';
8 V0 N8 G+ C' j9 p7 x print (Str);: [8 m% y: t) j
end;# w1 ~$ q. t: _' W( D
if iKind = 19 then begin
. P5 o7 K8 O; e( U/ a; k' Z9 ~ Str := 'putsendermagicitem 男子黄金铠甲 @奖品兑换员 4';) W2 ~ f4 ^) Y# q/ z5 h
print (Str);
- e* N1 H( e' S; }0 o0 Y {& a end;; p0 C" S8 n/ I! c ]/ r
if iKind = 20 then begin
/ W7 G# @! r& C8 A8 m$ b! i: T Str := 'putsendermagicitem 女子黄金铠甲 @奖品兑换员 4';7 F- n& R" w" [9 z+ R
print (Str);! m" q6 B2 B( d. Z! H
end;
1 d) E2 y0 M$ j( @* q7 E I9 q if iKind = 21 then begin
& b. A" s6 s! Y1 X Str := 'putsendermagicitem 男子桂林弓服 @奖品兑换员 4';$ b" j# W e& `$ F6 h; H; a! t$ K/ g
print (Str);$ Q4 A# `& h" W% {3 c
end;# f1 o# ]+ ~$ g& i9 M; C
if iKind = 22 then begin- L. B3 Q. g$ O
Str := 'putsendermagicitem 女子桂林弓服 @奖品兑换员 4';6 }8 m: z5 d3 }2 h6 L* D
print (Str);
3 J. S: N1 p( o; n8 e end;( m$ m! K) Y' I& j
if iKind = 23 then begin
8 W; e1 ^1 T+ T Str := 'putsendermagicitem 太极明珠 @奖品兑换员 4';$ H7 w8 Y' P" D( q2 v! L4 l2 Y- O
print (Str);' R2 n- n7 h7 R, U
end;. k) I3 w% L7 x0 o, U( C: P+ |
if iKind = 24 then begin* Z# e; A; |; P4 G8 a
Str := 'putsendermagicitem 狐狸内丹 @奖品兑换员 4';
/ ^5 F' t, |/ s9 g: z" R) I print (Str);! p( ]. a+ x, Q8 b* D1 `0 [
end;( b! E( @7 D4 z+ [; F% I3 _
if iKind = 25 then begin. _6 a# J; i! }/ j: S, I, N
Str := 'putsendermagicitem 白玫瑰 @奖品兑换员 4';
5 N6 h3 l! \* o5 s# L5 x print (Str);
6 b) o& f, g3 H1 r2 K% x end;
9 y& W5 p. d! T$ J; m, K) ]) D if iKind = 26 then begin. i* W) |. y Y- [. K- O
Str := 'putsendermagicitem 红玫瑰 @奖品兑换员 4';9 n( X2 d% }- S& A( k% z% Z4 U. I
print (Str);
+ ?2 H9 }5 @3 H2 W, \5 ?' b3 K end;
& H, o+ w, ~7 A; f. `# C+ W if iKind = 27 then begin
o9 d4 {# |9 J' g2 O Str := 'putsendermagicitem 灵动八方 @奖品兑换员 4';; s3 s$ H" m8 g% Z# u1 d% e
print (Str);$ I X! X' Z6 w v
end;
3 K5 e3 v9 Z6 X( Q' Z if iKind = 28 then begin
5 G [- o9 H3 X Str := 'putsendermagicitem 男子魔人战靴 @奖品兑换员 4';# ?$ R& k3 B) D9 g7 R+ E
print (Str);9 H3 V5 Y0 L. u* Q) O5 g
end;
% s+ H3 a# i$ G9 t- b' \( o if iKind = 29 then begin+ c5 C, n% k) I' w* D
Str := 'putsendermagicitem 女子魔人战靴 @奖品兑换员 4';
1 g! Z( A, H7 B7 r: Z print (Str);) [& @' l# I( Y
end;
$ j5 Y {. W. E( {; p( L Str := 'say 本想趁机摸你两把,可你身材太差了~';
4 b) H- G5 w/ m4 V! H print (str);
W: ]& T8 O/ ^7 F end;
; N7 t8 L! o; j! n exit; K k& N2 \% T4 s8 `
end;0 c9 \7 p" D+ p( p1 a
exit;
5 V( w/ l, Y$ c1 X0 { end;
h$ j6 h' z- C, f% v6 u, j) h mend;
6 o7 C. R3 b! C& @7 e% |1 _; Hend.0 Z6 Z, M) A |5 `5 L
------------------------------------------------
9 S+ W! v' D6 e9 E在tgs1000\script文件夹里得script.sdb里( K6 q; s9 p) q. b* m) o
最后一行加入6 S% _* a" B+ q# s5 R T
--------------------
/ J/ t4 J! ^) o/ r130,奖品兑换员.txt,,
p2 y1 R* i, f) l# ?* p--------------------- E. P1 X \, ~/ Y2 n3 Y5 Z, n
然后在tgs1000\help里建个文本文件 名字: 兑换员
1 A: P: Z$ V1 N: R0 s% H内容如下
: Z$ [# r2 z$ ?; n! ^4 ]------------------------------------------------
0 L& N! d* V9 }3 l3 A5 U* s. P; Y# s<trade>
8 H* k( p$ K( i' f<title>奖品兑换员</title>0 o4 @4 L4 T* \+ V( o3 |
<image name=z81 value=235>- U: x# x3 r8 W: y
<text>0 |: B$ i, k. Q, j1 K0 H
天下没有免费的午餐,努力吧!9 ?5 Q# K" r7 J- W! \0 N6 W; T) {
</text>
2 W) v, N2 Z. n$ H8 C5 `<command send='close'>关闭</command>
% S* [1 l) o7 h8 A6 m7 x$ @<command send="jinyuan">天下没有免费的午餐,拿5个金元来!</command># o6 j E Y: ^: Q. B
</trade>mand send="jinyuan">交换好运来,祝您好运</command>3 @( ?+ @2 }( n8 T/ y4 i
</trade>9 Q. X* e m0 F4 w& ?1 C* X; O
-----------------------------------------------------
* W( [1 V+ ?8 J2 r0 {) A然后在NpcSetting目录下建立一个.sdb文件,命名为:奖品兑换员
2 F2 Z' O5 a" w, H1 A里面内容写成:2 O* f0 x' @+ |) O- e
; m& J# c& ]/ e0 ~9 S# @ J
Name,boSelfSay,boMain,MainNumber,HearString,SayString,NeedItem,GiveItem,CountLimit,RecoverTime,DelayTime,7 g1 l7 J& m m- k0 ?9 {
1,TRUE,,,,我可是可以换到英雄装备的噢^_^!,,,,,1800,/ U' \5 l4 M) V0 y
-----------------------------------------------------
" m5 T9 O! [0 s- S在tgs1000\Setting文件夹里得CreateNpc1.sdb里加, I A9 n3 R6 p/ w: c
-----------------------------
. i' Q0 i* U1 \104,奖品兑换员,524,474,1,5,130,奖品兑换员.sdb,
6 [9 t: N, j" n3 Y
欢迎光临 三千论坛 (http://bbs.3000y.com.cn/) |
Powered by Discuz! X3.4 |