[战神脚本]拍卖行脚本
请将《Auction.txt》放到目录D:\mud2.0\Mir200\Share\config\下使用变量 G(11,11) 拍卖总流水号 G(11,12) 总拍卖物计数。
私人变量 V(11,1~10)对应1~10个拍品的流水号 11 卖家临时标记 12 卖出物总数 13提取极品
私人变量 S(11,1~10)对应1~10个参与竞拍的流水号 11 买家临时标记 12竞价物总数 13扣费凭证
重要:1,进行变量查重; 2,添加NPC定时执行参数 10-30秒。
procedure _diyitem(id:string);
var wpidx,wppos,zb,zy,lx,sl:string;
begin
zb := getpmitem(id);//名称
zy := getf(zb); //职业
lx := getf(getb(zb));//类型
if This_Player.GetBagItemCount(id) > 0 then
begin
This_Player.Take(id,1);
wppos:=inttostr(This_Player.GetV(11,11));//拍品上架位置
wpidx:=inttostr(GetG(11,11)+1);
WriteIniSectionStr('Auction.txt','物品'+wppos+'',This_Player.Name,wpidx); //写入拍品流水号与人物对应关系。
WriteIniSectionStr('Auction.txt',wpidx,'物品名',id); //按拍品流水号创建字段并写入属性
WriteIniSectionStr('Auction.txt',wpidx,'物品类型',lx);
WriteIniSectionStr('Auction.txt',wpidx,'职业类型',zy);
WriteIniSectionStr('Auction.txt',wpidx,'卖家',This_Player.Name);
WriteIniSectionStr('Auction.txt',wpidx,'拍卖状态','筹备中');
SetG(11,11,GetG(11,11)+1); //全局拍卖流水号+1;
This_Player.SetV(11,strtoint(wppos),strtoint(wpidx));//拍品信息写入玩家变量
This_Player.SetV(11,12,This_Player.GetV(11,12)+1);//卖家上架物品总数+1;
// This_Player.SetV(11,11,0); //栏位标识清零
_wupininfo(wppos);//跳转到拍卖物品设定页面
end else
This_Npc.NpcDialog(This_Player,'你背包里没有<'+id+'>!|{cmd}<返回卖家中心/@myinfo~2>')
end;
procedure CommitItem(AType:word);
var
zb,zy,lx,sl,pm_pos,lwpos,pm_idx,wpname,wpstate,wpidx,lqzt,oname,bname:string;
abil:array of integer;
i,jp:integer;
begin
zb := getpmitem(This_Item.ItemName);//名称
zy := getf(zb); //职业
lx := getf(getb(zb));//类型
sl := getf(getb(getb(zb)));//最大数量
if zb <> '' then
begin
if This_Player.GetV(11,13) < 100000 then//大于10W为提取极品
begin
pm_pos:=inttostr(This_Player.GetV(11,11));//拍品上架位置
pm_idx:=inttostr(GetG(11,11)+1);
if zy = '叠加' then
begin
This_Player.NotifyClientCommitItem(0,'');
This_NPC.NotifyClientUPdBagItem(This_Player,This_Item);
ThreeItem(This_Item.ItemName);
WriteIniSectionStr('Auction.txt',pm_idx,'堆叠上限',sl);
end else
begin
jp:=0;
abil:=This_Item.AddPa1;
abil:=This_Item.AddPa2;
abil:=This_Item.AddPa3;
abil:=This_Item.AddPa4;
abil:=This_Item.AddPa5;
for i:=1 to 5 do
begin
if abil > 0 then
begin
WriteIniSectionStr('Auction.txt',pm_idx,'Abil'+inttostr(i),inttostr(abil));//写极品值
jp:=jp+abil;
end
end
if jp > 0 then WriteIniSectionStr('Auction.txt',pm_idx,'极品','是');
WriteIniSectionStr('Auction.txt','物品'+pm_pos+'',This_Player.Name,pm_idx); //写入拍品流水号与人物对应关系。
WriteIniSectionStr('Auction.txt',pm_idx,'物品名',This_Item.ItemName); //按拍品流水号创建字段并写入属性
WriteIniSectionStr('Auction.txt',pm_idx,'物品类型',lx);
WriteIniSectionStr('Auction.txt',pm_idx,'职业类型',zy);
WriteIniSectionStr('Auction.txt',pm_idx,'卖家',This_Player.Name);
WriteIniSectionStr('Auction.txt',pm_idx,'拍卖状态','筹备中');
This_Player.TakeByClientID(This_Item.ClientItemID);//成功收走物品
This_Player.NotifyClientCommitItem(1,'提交成功');
This_NPC.NotifyClientUPdBagItem(This_Player,This_Item);
SetG(11,11,GetG(11,11)+1); //全局拍卖流水号+1;
This_Player.SetV(11,strtoint(pm_pos),strtoint(pm_idx));//拍品信息写入玩家变量
This_Player.SetV(11,12,This_Player.GetV(11,12)+1);//卖家上架物品总数+1;
// This_Player.SetV(11,11,0); //栏位标识清零
_wupininfo(pm_pos);//跳转到拍卖物品设定页面
end
end else
begin
wpidx:=inttostr(This_Player.GetV(11,13));
wpname:=ReadIniSectionStr('Auction.txt',wpidx,'物品名');
bname:=ReadIniSectionStr('Auction.txt',wpidx,'买家');
oname:=ReadIniSectionStr('Auction.txt',wpidx,'卖家')
wpstate:=ReadIniSectionStr('Auction.txt',wpidx,'拍卖状态');
lqzt:=ReadIniSectionStr('Auction.txt',wpidx,'领取状态');
if (wpname = This_Item.ItemName) and (((bname = This_Player.Name) and (lqzt = '已领取')) or ((oname = This_Player.Name) and ((wpstate='已取消') or (wpstate = '流拍已领')))) then
begin
for i:= 1 to 5 do
begin
abil:=StrToIntDef(ReadIniSectionStr('Auction.txt',wpidx,'Abil'+inttostr(i)),0);
pm_idx:=ReadIniSectionStr('Auction.txt','物品'+inttostr(i)+'',This_Player.Name);
if pm_idx = wpidx then lwpos:=inttostr(i);
end
This_Item.AddPa1:=abil;
This_Item.AddPa2:=abil;
This_Item.AddPa3:=abil;
This_Item.AddPa4:=abil;
This_Item.AddPa5:=abil;
This_Player.NotifyClientCommitItem(0,'极品属性提取成功');
This_NPC.NotifyClientUPdBagItem(This_Player,This_Item);
if This_Player.Name = bname then
begin
WriteIniSectionStr('Auction.txt',wpidx,'领取状态','极品属性已提取');
end else
if This_Player.Name = oname then
begin
WriteIniSectionStr('Auction.txt',wpidx,'领取状态','极品属性已提取');
WriteIniSectionStr('Auction.txt','物品'+lwpos+'',This_Player.Name,'');//取消拍品和人物
This_Player.SetV(11,This_Player.GetV(11,11),0);//清除对应变量值
This_Player.SetV(11,12,This_Player.GetV(11,12)-1);//竞拍物品减一
end
This_Player.SetV(11,13,0);//
if wpstate = '流拍已领' then
begin
_myinfo('2');
end else
_jiesuan(wpidx);
end else
begin
This_Player.NotifyClientCommitItem(0,'极品提取非法!请核对姓名,装备名字是否相符!以及是否提取过该极品属性');
end
end;
end else
begin
This_Player.NotifyClientCommitItem(0,'非法物品!');
This_NPC.NotifyClientUPdBagItem(This_Player,This_Item);
This_NPC.Click_CommitItem(This_Player,1,'请放入你想拍卖的物品');
end
end;
页:
[1]