用于战神引擎的声望捐献自定义Npc脚本,脚本从1.80战神合击版本里面提取来的,默认使用3.0插件,玩家通过声望捐献以后,主体和英雄都可以获得对应的攻魔道属性+暴击+HP血量增加,脚本带了Gm后台清理功能,但Npc上清理了,还要在删除一下对应的文件,脚本和素材都提取出来了。
元宝捐献.txt文件放到D:\mud2.0\Mir200\Share\config这个文件夹。开区之前里面的内容全部清空。

部分脚本
procedure _GMredata;
begin
This_Npc.NpcDialog(This_Player,
'<元宝及沙捐> 都将被清空'+
'|请先删除config目录下的元宝捐献.txt 文件内容!!'+
'|{cmd}<我已删除,开始清空/@ActionData>'
)
end;
procedure _ActionData;
var i:integer;
begin
SetG(99,29,0);
SetG(78,6,0);
SetG(78,7,0);
This_Player.SetV(99,15,0);
for i:=1 to 10 do
begin
if rankName[i] <> '' then
rankName[i]:='';
if rankInt[i] <> 0 then
rankInt[i]:=0;
end;
This_Npc.NpcDialog(This_Player,' 数据清空完毕!!')
end;
procedure _YBJX;
begin
//This_Npc.InputDialog(This_Player,'输入捐献元宝数量',0,100);
This_Npc.InputDialog(This_Player,'输入捐献声望数量',0,100);
end;
procedure P100;
var i, temp_yb, index, sl: integer;
begin
index:=0;
temp_yb:=StrToIntDef(This_Npc.InputStr,-1);
sl:=StrToIntDef(This_Npc.InputStr,-1);
if temp_yb > 0 then
begin
if This_Player.MyShengwan <= temp_yb then
begin
This_Npc.NpcDialog(This_Player,'你的声望不够捐献了~');exit;
end
if ReadIniSectionStr('元宝捐献.txt','元宝捐献',This_Player.Name) <> '' then
begin
temp_yb:=temp_yb + strtoint(ReadIniSectionStr('元宝捐献.txt','元宝捐献',This_Player.Name));
end
if WriteIniSectionStr('元宝捐献.txt','元宝捐献',This_Player.Name,inttostr(temp_yb)) then
begin
for i:=1 to 100 do
begin
if ReadIniSectionStr('元宝捐献.txt','捐献列表',inttostr(i)) = This_Player.Name then
begin
index:=i;
break;
end
end
if index > 0 then
begin
WriteIniSectionStr('元宝捐献.txt','捐献列表',inttostr(index),This_Player.Name);
end
else
begin
SetG(99,29,GetG(99,29)+1);
WriteIniSectionStr('元宝捐献.txt','捐献列表',inttostr(GetG(99,29)),This_Player.Name);
end
SetG(78,7,GetG(78,7) +sl /100*30);
SetG(78,6,GetG(78,6)+sl);
This_Player.SetV(99,15,This_Player.GetV(99,15) + sl);
This_Player.MyShengwan := This_Player.MyShengwan - strtoint(This_Npc.InputStr);
//This_Player.ScriptRequestSubYBNum(strtoint(This_Npc.InputStr));
//ServerSay('玩家:['+This_Player.Name+']为沙城捐献了:'+ inttostr(sl)+' 元宝!', 3);
//ServerSay('恭喜玩家:['+This_Player.Name+']成功捐献了:'+ inttostr(sl)+' 声望获得永久属性加成!', 3);
ServerSayPlus('恭喜玩家'+This_Player.Name+'成功捐献了:'+ inttostr(sl)+' 点声望获得永久属性加成!');
This_NPC.NpcDialog(This_Player,'恭喜你成功捐献:'+ inttostr(sl)+' 声望!'
+'| <返回首页/@main>') ;
domain;
end
else
This_Npc.NpcDialog(This_Player,'未知错误,请联系管理员~');
end
else
This_Npc.NpcDialog(This_Player,'非法输入,请输入数字~');
end;
begin
if GetG(78,6) < 0 then SetG(78,6,0);
if GetG(78,7) < 0 then SetG(78,7,0);
if GetG(99,29) < 0 then SetG(99,29,0);
if This_Player.GetV(99,15) < 0 then This_Player.SetV(99,15,0);
domain;
end.








