神武奖品兑换员脚本
-
在 tgs1000\init\npc.sdb里加
奖品兑换员,奖品兑换员,0,,,,,,,,,,62,81,235,0,0,,,,20000,0,0,0,0,,0,,,,,,,,,,,,,,,TRUE,
在tgs1000\script文件加里创建一个文本 名字:奖品兑换员
------------------------------------------------
unit 奖品兑换员;interface
function GetToken (aStr, aToken, aSep : String) : String;
function CompareStr (aStr1, aStr2 : String) : Boolean;
function callfunc (aText: string): string;
procedure print (aText: string);
function Random (aScope: integer): integer;
function Length (aText: string): integer;
procedure Inc (aInt: integer);
procedure Dec (aInt: integer);
function StrToInt (astr: string): integer;
function IntToStr (aInt: integer): string;
procedure exit;
procedure OnGetResult (aStr : String);
procedure OnLeftClick (aStr : String);
procedure OnApproach (aStr : String);
procedure OnAway (aStr : String);
procedure OnArrival (aStr : String);
var
iCallCount : Integer = 0;
implementation
procedure OnAway (aStr : String);
var
Str : String;
Race : Integer;
begin
Str := callfunc ('getsenderrace');
Race := StrToInt (Str);
if Race = 1 then begin
print ('say 拉拉拉拉,贪财老人来喽...');
exit;
end;
end;
procedure OnApproach (aStr : String);
var
Str : String;
Race : Integer;
begin
Str := callfunc ('getsenderrace');
Race := StrToInt (Str);
if Race = 1 then begin
print ('say 各位节日快乐...');
exit;
end;
end;
procedure OnLeftClick (aStr : String);
var
Str : String;
begin
Str := 'showwindow .\help\奖品兑换员.txt 1';
print (Str);
exit;
end;
procedure OnGetResult (aStr : String);
var
Str, Name : String;
iRandom, iKind : Integer;
begin
if aStr = 'jinyuan' then begin
Str := callfunc ('getsenderitemexistence 金元:5');
if Str = 'false' then begin
Str := 'say 哪有免费的午餐?拿5个金元来!';
print (Str);
exit;
end;
if Str = 'true' then begin
Str := 'getsenderitem 金元:5';
print (Str);
Str := 'say 小子,你的金子是假的!哈哈^_^哈!';
print (str);
iRandom := Random (5);
if iRandom = 1 then begin
Str := callfunc ('checkenoughspace');
if Str = 'false' then begin
print ('say 物品栏已满~');
exit;
end;
iKind := Random (29);
if iKind = 0 then begin
Str := 'putsendermagicitem 男子英雄铠甲 @奖品兑换员 4';
print (Str);
end;
if iKind = 1 then begin
Str := 'putsendermagicitem 女子英雄铠甲 @奖品兑换员 4';
print (Str);
end;
if iKind = 2 then begin
Str := 'putsendermagicitem 男子英雄头盔 @奖品兑换员 4';
print (Str);
end;
if iKind = 3 then begin
Str := 'putsendermagicitem 女子英雄头盔 @奖品兑换员 4';
print (Str);
end;
if iKind = 4 then begin
Str := 'putsendermagicitem 男子英雄护腕 @奖品兑换员 4';
print (Str);
end;
if iKind = 5 then begin
Str := 'putsendermagicitem 女子英雄护腕 @奖品兑换员 4';
print (Str);
end;
if iKind = 6 then begin
Str := 'putsendermagicitem 男子英雄战靴 @奖品兑换员 4';
print (Str);
end;
if iKind = 7 then begin
Str := 'putsendermagicitem 女子英雄战靴 @奖品兑换员 4';
print (Str);
end;
if iKind = 8 then begin
Str := 'putsendermagicitem 百炼三叉戟 @奖品兑换员 4';
print (Str);
end;
if iKind = 9 then begin
Str := 'putsendermagicitem 百炼日本刀 @奖品兑换员 4';
print (Str);
end;
if iKind = 10 then begin
Str := 'putsendermagicitem 百炼忍者剑 @奖品兑换员 4';
print (Str);
end;
if iKind = 11 then begin
Str := 'putsendermagicitem 白骨魔棒 @奖品兑换员 4';
print (Str);
end;
if iKind = 12 then begin
Str := 'putsendermagicitem 生药 @奖品兑换员 4';
print (Str);
end;
if iKind = 13 then begin
Str := 'putsendermagicitem 男子魔人护腕 @奖品兑换员 4';
print (Str);
end;
if iKind = 14 then begin
Str := 'putsendermagicitem 女子魔人护腕 @奖品兑换员 4';
print (Str);
end;
if iKind = 15 then begin
Str := 'putsendermagicitem 金币 @奖品兑换员 4';
print (Str);
end;
if iKind = 16 then begin
Str := 'putsendermagicitem 千年水晶原石 @奖品兑换员 4';
print (Str);
end;
if iKind = 17 then begin
Str := 'putsendermagicitem 千年水石 @奖品兑换员 4';
print (Str);
end;
if iKind = 18 then begin
Str := 'putsendermagicitem 象牙十字镐 @奖品兑换员 4';
print (Str);
end;
if iKind = 19 then begin
Str := 'putsendermagicitem 男子黄金铠甲 @奖品兑换员 4';
print (Str);
end;
if iKind = 20 then begin
Str := 'putsendermagicitem 女子黄金铠甲 @奖品兑换员 4';
print (Str);
end;
if iKind = 21 then begin
Str := 'putsendermagicitem 男子桂林弓服 @奖品兑换员 4';
print (Str);
end;
if iKind = 22 then begin
Str := 'putsendermagicitem 女子桂林弓服 @奖品兑换员 4';
print (Str);
end;
if iKind = 23 then begin
Str := 'putsendermagicitem 太极明珠 @奖品兑换员 4';
print (Str);
end;
if iKind = 24 then begin
Str := 'putsendermagicitem 狐狸内丹 @奖品兑换员 4';
print (Str);
end;
if iKind = 25 then begin
Str := 'putsendermagicitem 白玫瑰 @奖品兑换员 4';
print (Str);
end;
if iKind = 26 then begin
Str := 'putsendermagicitem 红玫瑰 @奖品兑换员 4';
print (Str);
end;
if iKind = 27 then begin
Str := 'putsendermagicitem 灵动八方 @奖品兑换员 4';
print (Str);
end;
if iKind = 28 then begin
Str := 'putsendermagicitem 男子魔人战靴 @奖品兑换员 4';
print (Str);
end;
if iKind = 29 then begin
Str := 'putsendermagicitem 女子魔人战靴 @奖品兑换员 4';
print (Str);
end;
Str := 'say 本想趁机摸你两把,可你身材太差了~';
print (str);
end;
exit;
end;
exit;
end;
end;
end.
------------------------------------------------
在tgs1000\script文件夹里得script.sdb里
最后一行加入
--------------------
130,奖品兑换员.txt,,
--------------------
然后在tgs1000\help里建个文本文件 名字: 兑换员
内容如下
------------------------------------------------
<trade>
<title>奖品兑换员</title>
<image name=z81 value=235>
<text>
天下没有免费的午餐,努力吧!
</text>
<command send='close'>关闭</command>
<command send="jinyuan">天下没有免费的午餐,拿5个金元来!</command>
</trade>mand send="jinyuan">交换好运来,祝您好运</command>
</trade>
-----------------------------------------------------
然后在NpcSetting目录下建立一个.sdb文件,命名为:奖品兑换员
里面内容写成:Name,boSelfSay,boMain,MainNumber,HearString,SayString,NeedItem,GiveItem,CountLimit,RecoverTime,DelayTime,
1,TRUE,,,,我可是可以换到英雄装备的噢^_^!,,,,,1800,
-----------------------------------------------------
在tgs1000\Setting文件夹里得CreateNpc1.sdb里加
-----------------------------
104,奖品兑换员,524,474,1,5,130,奖品兑换员.sdb,