用于战神引擎的捐献地图Npc脚本,想下地图,必须要捐献以后才行。没有捐献的玩家无法下地图,脚本是黑墨写的,明文版,可以根据自己的需求,任意修改里面的数据。
部分脚本
var i, num, index, sl: integer; begin index := 0; num := 10; sl := 10; if num > 0 then begin czd := This_Player.GetV(99,99); if czd < num then begin This_Npc.NpcDialog(This_Player,'你不够捐献了~');exit; end if ReadIniSectionStr('元宝捐献.txt','元宝捐献',This_Player.Name) <> '' then begin num := num + strtoint(ReadIniSectionStr('元宝捐献.txt','元宝捐献',This_Player.Name)); end if WriteIniSectionStr('元宝捐献.txt','元宝捐献',This_Player.Name,inttostr(num)) 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; This_Player.SetV(78,1,This_Player.GetV(78,1) + sl); This_Player.DecLF(0, num, false); This_Player.SetV(99,99,This_Player.GetV(99,99) - 10); This_NPC.NpcDialog(This_Player,'恭喜你成功捐献:<'+ inttostr(sl)+'> !' +'|{cmd}<返回首页/@main>') ; This_Player.CallOut(This_Npc, 1, 'ddomain'); end else This_Npc.NpcDialog(This_Player,'未知错误,请联系管理员~'); end else This_Npc.NpcDialog(This_Player,'非法输入,请输入数字~'); end; procedure ddomain; var i, j, x, temp, point :integer; temp_str, show_p_name, show_czd_num, show_str : string; rankczd : Array [1..100] of Integer; rankName : Array [1..100] of String; begin for i:=1 to 100 do begin if ReadIniSectionStr('元宝捐献.txt','捐献列表',inttostr(i)) <> '' then begin show_p_name := ReadIniSectionStr('元宝捐献.txt','捐献列表',inttostr(i)); show_czd_num := ReadIniSectionStr('元宝捐献.txt','元宝捐献',show_p_name); rankczd[i] := strtoint(show_czd_num); rankName[i] := show_p_name; end else break; end if show_p_name <> '' then begin for i:=1 to 100 do begin if rankczd[i] <= 0 then break; for j:=1 to 100 do begin x:=j+1; if (rankczd[j] <= 0) or (rankczd[x] <= 0) then break; if (rankczd[j] < rankczd[x]) and (rankczd[x] > 0) then begin temp := rankczd[j]; rankczd[j] := rankczd[x]; rankczd[x] := temp; temp_str:=rankName[j]; rankName[j] := rankName[x]; rankName[x] := temp_str; end end end end