用于战神引擎玩家在线悬赏求购Npc脚本,脚本支持3种货币,分别是金币、灵符、元宝,非常方便玩家在线出售自己的闲置装备,并且可以根据自己的需要,设定出售的币种,这个跟摆摊不一样,摆摊的货币无法实现自定义,另外也没有这个Npc方便,这个支持全服交易,脚本的使用方法下面有说明:
请将《悬赏求购.txt》放到目录D:\mud2.0\Mir200\Share\config\下 *
请将《求购物品列表.txt》放到D:\mud2.0\Mir200\Envir\下 *
物品名请自行添加编辑.使用变量V(111,11) G(111,11) 请自行查重



部分脚本
procedure _sold_ok(id:string);
var wpname,mtype,wpstate:string;wpgold,wpnum:integer;
begin
wpname:=ReadIniSectionStr('悬赏求购.txt',id,'物品名');
mtype:=ReadIniSectionStr('悬赏求购.txt',id,'货币类型')
wpgold:=StrToIntDef(ReadIniSectionStr('悬赏求购.txt',id,'收购价'),0);
wpnum:=StrToIntDef(ReadIniSectionStr('悬赏求购.txt',id,'物品数量'),1);
wpstate:=ReadIniSectionStr('悬赏求购.txt',id,'悬赏状态');
if wpstate = '悬赏中' then
begin
if This_Player.GetBagItemCount(wpname) >= wpnum then
begin
This_Player.Take(wpname,wpnum);
if mtype=pm_wphb then
begin
if This_Player.FreeBagNum <= 0 then
begin
This_Player.PlayerNotice('背包已满,请至少空出一个格子!',0);
exit;
end
end
WriteIniSectionStr('悬赏求购.txt',id,'悬赏状态','已成交');
WriteIniSectionStr('悬赏求购.txt',id,'卖家',This_Player.Name);
_jiesuan(id);
recode(id);
// dellist(id);//删除悬赏列表
This_Player.PlayerNotice('卖出'+inttostr(wpnum)+'个'+wpname+',获得了'+inttostr(wpgold)+mtype,2);
_dating('1');
end else
This_Player.PlayerNotice('你并没有'+inttostr(wpnum)+'个'+wpname+'!',0);
end else
This_NPC.NpcDialog(This_Player,'下手晚了,该条悬赏已经不存在!{cmd}<返回/@main>');
end;
procedure _donelog(ipage:string);
var donelog:array [1..102] of string;
j:integer;donerec,donecmd:string;
begin
donerec:='';
for j:=1+(strtoint(ipage)-1)*10 to strtoint(ipage)*10 do
begin
donelog[j]:=ReadIniSectionStr('悬赏求购.txt','历史记录',inttostr(j));
if length(donelog[j]) > 0 then
begin
donerec:=donerec +donelog[j]+'|';
end
end
if length(donelog[100]) > 0 then
begin
for j:=1+(strtoint(ipage)-1)*10 to strtoint(ipage)*10 do
begin
donelog[j]:=donelog[j+1];
end
end
donecmd:='|{cmd}<下一页/@donelog~'+inttostr(strtoint(ipage)+1)+'> ^<返回大厅/@main>'
if strtoint(ipage) > 1 then donecmd:='|{cmd}<上一页/@donelog~'+inttostr(strtoint(ipage)-1)+'> ^<下一页/@donelog~'+inttostr(strtoint(ipage)+1)+'> ^<返回大厅/@main>'
This_Npc.NpcDialog(This_Player,
'|^<悬赏行/fcolor=241> <历史行情/fcolor=250>^^'
+'|<————————————————————/fcolor=247>|'
+donerec
+'<————————————————————/fcolor=247>'
+'|<最多显示100条记录/fcolor=242>'
+donecmd
);
end;
begin
if GetG(111,11) < 100000 then SetG(111,11,100000);
_dating('1');
end.








