用于战神引擎的沙城捐献Npc脚本,相比之前的捐献脚本,这个做了增强,增加奖池功能,捐献以后,有%30可以进入奖池。攻沙后获得,脚本使用了自定义对话框,需要配合fh.pas和jxdata.txt文件来用,jxdata.txt文件放到D:\mud2.0\Mir200\Share\config文件夹下面。fh.pas需要根据自己的版本,针对性的植入脚本。不能支持覆盖。


部分脚本
program Mir2;
{$I fh.pas}
var
rankName : Array [1..100] of String; rankInt : Array [1..100] of integer;
procedure _Exit;
begin
This_Npc.CloseDialog(This_Player);
end;
procedure domain;
var
i,j,x,temp,num1,today : integer;
showName, showPoint, temp_str, gmlog : string;
begin
today := GetDateNum(GetNow); //定义today为当前日期值
if This_Player.GetV(78,10) <> today then //查询个人变量78,10 不等于当前日期则清理其他数据
begin
This_Player.SetV(78,10,today);
This_Player.SetV(78,1,0);
This_Player.SetV(78,2,0);
end;
if getg(78,10) <> today then //查询个人变量78,10 不等于当前日期则清理其他数据
begin
SetG(78,10,today);
SetG(78,6, 0);
end;
for i:=1 to 100 do
begin
if ReadIniSectionStr('jxdata.txt','playerId',inttostr(i)) = '' then
break;
showName:=ReadIniSectionStr('jxdata.txt','playerId',inttostr(i));
showPoint:=ReadIniSectionStr('jxdata.txt','playerList',showName);
rankName[i]:=showName;
rankInt[i]:=strtoint(showPoint);
end
if showName <> '' then
begin
for i:=1 to 100 do
begin
if rankInt[i] <= 0 then
break;
for j:=1 to 100 do
begin
x:=j+1;
if (rankInt[j] <= 0) or (rankInt[x] <= 0) then
break;
if (rankInt[j] < rankInt[x]) and (rankInt[x] > 0) then
begin
temp := rankInt[j];
rankInt[j] := rankInt[x];
rankInt[x] := temp;
temp_str:=rankName[j];
rankName[j] := rankName[x];
rankName[x] := temp_str;
end
end
end
end
temp_str:='';
for i:=1 to 6 Do
begin
if rankName[i] <> '' then
temp_str:=temp_str+'|<第'+inttostr(i)+'名 :/fcolor=103> <'+rankName[i]+ '/fcolor=250> <' + inttostr(rankInt[i])+'/fcolor=253>'
else
temp_str:=temp_str+'|<第'+inttostr(i)+'名 :/fcolor=103> <空缺>'
end








