用于战神引擎玩家银行Npc脚本系统,玩家可以自由存取金币和元宝,也可以得利息,利息还不低,之前在一个版本看到了这个脚本,忘记提取了,今天遇到了,提取出来了,脚本非常的有意思,吸引玩家通过存元宝获得额外的利息。增加游戏的可玩性。
部分脚本
begin num2:= This_Player.getS(808,2) ; num7:= This_Player.YBNum; num6 := StrToIntDef(This_NPC.InputStr,-1);//输入非阿拉伯数字的字符都返回-1 if This_NPC.InputOK then begin if num6 > num2 then begin This_NPC.NpcDialog(This_Player,'你当前账户金额不足<$' + inttostr(num6) + '金币>!') ; end else if (num6 < 1) or (num6 > 100000000) then begin This_NPC.NpcDialog(This_Player,'只能使用阿拉伯数字,输入1-1亿数字!') ; end else if (num6+num7) > 5000000000 then begin This_NPC.NpcDialog(This_Player,'当前输入数字大于你的元宝背包容量!') ; end else if num2 >= num6 then begin This_Player.ScriptRequestAddYBNum(num6); This_Player.setS(808,2,num2-num6); This_NPC.NpcDialog(This_Player,'已为您取出<$' + inttostr(num6) + '元宝>请你查收!') ; end; end; end; procedure _yuanbao1; BEGIN This_NPC.InputDialog(This_Player,'请输入你要储蓄金额',0,1012) ; END; procedure P1012; //存元宝 var num6,num7,num8,sum :integer; begin sum:= GetDateNum(GetNow); num8:=GetDateNum(GetNow); num2:= This_Player.getS(808,2) ; num7:= This_Player.YBNum; num6 := StrToIntDef(This_NPC.InputStr,-1);//输入非阿拉伯数字的字符都返回-1 if This_NPC.InputOK then begin if (num6 < 10) or (num6 > 100000000) then begin This_NPC.NpcDialog(This_Player,'只能使用阿拉伯数字,输入10-1亿内数字!') ; end else if (num1+ num6) > 1000000000 then begin This_NPC.NpcDialog(This_Player,'当前输入数字大于最大储蓄金额请重新输入!') ; end else if num7 < num6 then begin This_NPC.NpcDialog(This_Player,'你当前没有<$' + inttostr(num6) + '元宝>无法存储请重新输入!') ; end else if num7 >= num6 then begin if (This_Player.GetS(808,10) <> 1) and (num6 >= num2) then begin This_Player.setS(808,10,1) //定义记录时间 This_Player.setS(808,12,sum) //定义记录时间 11变量 This_Player.setS(808,14,sum) //定义记录时间 14变量 This_Player.ScriptRequestSubYBNum(num6); This_Player.setS(808,2,num2+num6); This_Player.CallOut(This_NPC,1,'domain'); end else This_Player.setS(808,10,1) This_Player.ScriptRequestSubYBNum(num6); This_Player.setS(808,2,num2+num6); This_Player.CallOut(This_NPC,1,'domain'); end ; end; end; begin domain; end.