用于战神引擎手游版本的灵符商店Npc脚本,玩家可以用灵符购买装备物品,脚本默认只有三个特级,但是明文版的,可以任意修改里面的出售的内容和出售的价格。
部分脚本
program mir2; {$I common.pas} procedure _DoExit; begin This_Npc.CloseDialog(This_Player); end; procedure _Exit; begin This_Npc.CloseDialog(This_Player); end; procedure _Normal; var temp : integer; begin temp := random(2); if temp = 1 then begin This_Npc.NpcDialog(This_Player, '感谢,我可以为你做什么吗?我这里出售的都是最抢手的物品,\并且我可是盟重省独家经营哦!\ ' +'|{cmd}<灵符购买/@lingfuBuy>\' +'|{cmd}<退出/@doexit>' ); end else begin This_Npc.NpcDialog(This_Player, '感谢,我可以为你做什么吗?我这里出售的都是最抢手的物品,\并且我可是盟重省独家经营哦!\' +'|{cmd}<灵符购买/@lingfuBuy>\' +'|{cmd}<退出/@doexit>' ); end; end; function geiLinfItemName(itemId : integer):string; begin result := ''; case itemId of 1 : result := '麻痹戒指'; 2 : result := '隐身戒指'; 3 : result := '复活戒指'; end; end; function needLFnum(itemId : integer):integer; begin result := 0; case itemId of 1 : result := 2888; 2 : result := 1888; 3 : result := 2888; end; end; procedure _lingfuBuy; var str : string; i : integer; begin str := ''; for i:=1 to 23 do begin str := str + '<' + geiLinfItemName(i) + '/@buyLFitem_Dlg~' + inttostr(i) + '>' if (i mod 2) = 1 then str := str + '^' else str := str + '|'; end; This_Npc.NpcDialog(This_Player, '请选择你要购买的物品\ \|{cmd}' +str +'{cmd}<返回/@main>' ); end; procedure _buyLFitem_Dlg(strId : string); var str : string; i : integer; begin str := ''; i := StrToIntDef(strId,0); This_Npc.NpcDialog(This_Player, '购买<' + geiLinfItemName(i) + '/c=red>需要<' + inttostr(needLFnum(i)) + '灵符/c=red>,|你确定使用' + inttostr(needLFnum(i)) + '灵符购买' + geiLinfItemName(i) + '吗?\ \' +'|{cmd}<确认购买' + geiLinfItemName(i) + '/@buyLFitem~' + strId + '>' +'{cmd}<返回/@lingfuBuy>' ); end; procedure _buyLFitem(strId : string); var itemId , needLf: integer; iName : string; begin itemId := StrToIntDef(strId , 0); needLf := needLFnum(itemId); iName := geiLinfItemName(itemId); if iName <> '' then begin if This_Player.FreeBagNum > 0 then begin if This_Player.MyLFnum >= needLf then begin This_Player.DecLF(10001, needLf, false); This_Player.Give(iName,1); This_Npc.NpcDialog(This_Player, '恭喜你获得:' + iName + '!' +'|{cmd}<继续购买' + iName + ' /@buyLFitem~' + strId + '>' +'|{cmd}<返回/@lingfuBuy>' ); end else This_Npc.NpcDialog(This_Player, '灵符数量不足,无法购买!' +'{cmd}<返回/@main>' ); end else This_Npc.NpcDialog(This_Player, '包裹空间不足,无法购买!' +'{cmd}<返回/@main>' ); end; end; procedure _baijin; begin This_Npc.NpcDialog(This_Player, '这是我刚学会的技能,你可要替我保守这个秘密,我可以把六个白金积分捆成一个白金积分包。\捆一次需要支付10万金币,\你要不要也让我帮你捆一包啊?\' +'|{cmd}<帮我捆白金积分/@baijin1>\ \' +'|{cmd}<返回/@main>' ); end; procedure _baijin1; begin if This_Player.GetBagItemCount('白金积分') < 6 then begin This_Npc.NpcDialog(This_Player, '你没有足够的白金积分啊!' ); end else if This_Player.GoldNum >= 100000 then begin This_Player.DecGold(100000); This_Player.Take('白金积分',6); This_Player.Give('白金积分包',1); This_Npc.NpcDialog(This_Player, '已经捆好了,还需不需要继续捆?\ \' +'|{cmd}<继续捆/@baijin1>\ \' +'|{cmd}<返回/@main>' ); end else begin This_Npc.NpcDialog(This_Player, '你没有足够金币,我也帮不了你啊!' ); end; end; procedure _buy; begin This_Npc.NpcDialog(This_Player, '你需要哪种物品呢?\ \ \|{cmd}<返回/@main>' ); This_Npc.Click_Buy(This_Player); end; procedure _Sell; begin This_Npc.NpcDialog(This_Player, '我们出售蜡烛,护身符,卷轴,修复油等.\ \ \|{cmd}<返回/@main>' ); This_Npc.Click_Sell(This_Player); end; procedure _S_Repair; begin This_Npc.NpcDialog(This_Player, '你这家伙,你可太幸运了,我正好有材料做特殊修补\但费用是普通的3倍!' ); This_Npc.Click_SRepair(This_Player); end; procedure RepairDone; begin This_Npc.NpcDialog(This_Player, '怎么样,修好了吧?看起来比新的还值钱!\ \' + '|{cmd}<返回/@main>' ); end; procedure SRepairDone; begin This_Npc.NpcDialog(This_Player, '看上去它已经修好了...\请好好的使用它.\ \' + '|{cmd}<返回/@main>' ); end;