{ ***********************
土城跑酷
作者:
内容:在一个特定的时间段开始在土城一定范围内跑动随机得到一定的物品奖励,比如以下脚本
会在每天15:00-15:05 及19:00 -19:05开放
******************************}
program Mir2;
var
WpName : string;
Rdm_int,px, py :Integer;

Procedure _doexit;
begin
This_Npc.CloseDialog(This_Player);
end;

procedure _tcpk;
begin
if This_Player.Level >1 then
begin
This_Player.CallOut(This_Npc, 1, ‘tcpk2’);
This_Player.FlyTo(‘3’,333,333);
This_Npc.NpcDialog(This_Player,
‘请好好把握这幸福的时光。’
);

end;
end;

procedure tcpk2;

begin
Rdm_int := random(100);
px:= This_player.My_X;
py:= This_Player.My_Y;

if ((GetHour = 15) and (GetMin < 5)) or
((GetHour = 15) and (GetMin < 5)) then begin //自己修改开放时间
if (This_Player.MapName = ‘3’) and ( 323 < px ) and (px < 343 )
and (323 < py ) and (py < 343) then //在土城坐标333.333 周围10格内跑动有效
begin if (This_Player.GetV(77,1) <> px) or
(This_Player.GetV(77,2) <> py )then // 移动才会继续触犯以下代码
begin
if This_Player.FreeBagNum >= 2 then
begin
if Rdm_int < 5 then // 5%机会获得以下物品
begin
case random(25) of // 5%机会获得以下25个物品中的一个
0 : WpName := ‘屠龙’;
1 : WpName := ‘嗜魂法杖’;
2 : WpName := ‘逍遥扇’;
3 : WpName := ‘圣战头盔’;
4 : WpName := ‘光芒项链’;
5 : WpName := ‘光芒手镯’;
6 : WpName := ‘光芒戒指’;
7 : WpName := ‘烈焰戒指’;
8 : WpName := ‘烈焰项链’;
9 : WpName := ‘烈焰手镯’;
10: WpName := ‘雷霆项链’;
11 :WpName := ‘传送戒指’;
12: WpName := ‘麻痹戒指’;
13 :WpName := ‘隐身戒指’;
14 :WpName := ‘雷霆手镯’;
15: WpName := ‘防御戒指’;
16: WpName := ‘天师长袍’;
17 :WpName := ‘天尊道袍’;
18: WpName := ‘霓裳羽衣’;
19 :WpName := ‘法神披风’;
20 :WpName := ‘圣战宝甲’;
21: WpName := ‘天魔神甲’;
22 :WpName := ‘噬血术’;
23 :WpName := ‘逐日剑法’;
24: WpName := ‘流星火雨’;
end;

end else if Rdm_int < 10 then
begin
case random(16) of
0 : WpName := ‘屠龙’;
1 : WpName := ‘嗜魂法杖’;
2 : WpName := ‘逍遥扇’;
4 : WpName := ‘圣战项链’;
5 : WpName := ‘圣战手镯’;
6 : WpName := ‘天尊戒指’;
7 : WpName := ‘圣战戒指’;
8 : WpName := ‘天尊项链’;
9 : WpName := ‘天尊手镯’;
10: WpName := ‘法神项链’;
11 :WpName := ‘法神戒指’;
12: WpName := ‘圣战戒指’;
13 :WpName := ‘技巧项链’;
14 :WpName := ‘法神手镯’;
15: WpName := ‘防御戒指’;
end;

end
else if Rdm_int < 20 then
begin
case random(10) of
0 : WpName := ‘青铜腰带’;
1 : WpName := ‘龙牙’;
2 : WpName := ‘龙纹剑’;
3 : WpName := ‘怒斩’;
4 : WpName := ‘黑铁头盔’;
5 : WpName := ‘恶魔铃铛’;
6 : WpName := ‘三眼手镯’;
7 : WpName := ‘泰坦戒指’;
8 : WpName := ‘力量戒指’;
9 : WpName := ‘天尊头盔’;
end;

end
else if Rdm_int < 50 then
begin
case random(13) of
0 : WpName := ‘裁决之杖’;
1 : WpName := ‘骨玉权杖’;
2 : WpName := ‘无极棍’;
3 : WpName := ’10灵符礼包’;
4 : WpName := ‘祝福油’;
5 : WpName := ‘金刚石’;
6 : WpName := ‘1元宝’;
7 : WpName := ‘2元宝’;
8 : WpName := ’10元宝’;
9 : WpName := ‘5元宝’;
10 : WpName := ‘2灵符礼包’;
11 : WpName := ‘5灵符礼包’;
12 : WpName := ‘1灵符礼包’;
end;

end
else if Rdm_int < 99 then
begin
case random(4) of
0 : begin
This_Player.Give(‘经验’,5000);
This_Player.PlayerNotice(‘你获得5000经验!’ , 1);
end;
1 : begin
This_Player.Give(‘经验’,50000);
This_Player.PlayerNotice(‘你获得50000经验!’ , 1);
end;
2 : begin This_Player.Give(‘经验’,500000);
This_Player.PlayerNotice(‘你获得50000经验!’ , 1);
end;
3 : begin This_Player.Give(‘经验’,5000000);
This_Player.PlayerNotice(‘你获得500w经验!’ , 1);
end;
end;
end;

This_Player.Give(WpName , 1);
This_Player.PlayerNotice(
WpName + ‘已放入您的包裹!\’,1);
This_Player.setV(77,1,px);
This_Player.setV(77,2,py) ;
This_Player.CallOut(This_Npc, 2, ‘tcpk2’); // 2秒后循环运行
end else
This_Player.PlayerNotice(
‘你的包裹空间不够!’,1);
This_Player.CallOut(This_Npc, 2, ‘tcpk2’); // 再次符合条件后继续运行
end else
This_Player.PlayerNotice(
‘跑起来才有东西!’,1);
This_Player.CallOut(This_Npc, 2, ‘tcpk2’); //再次符合条件后继续运行
end else
This_Player.PlayerNotice(
‘你跑得太远了!’,1);
This_Player.CallOut(This_Npc, 2, ‘tcpk2’); // 再次符合条件后继续运行
end else
This_Player.PlayerNotice(
‘不在活动时间!’,1);
end;

begin
This_NPC.NpcDialog(This_Player,
‘土城跑酷:\ \’+
‘欢迎来到土城跑酷.\ \’+
‘在土城一定范围内不停移动能随机获得多种物品.\ \’+
‘想要强大就得快人一步、可以在这里跑酷.\ \’+
‘|{cmd}<◆开始跑酷/@tcpk>’);
end.