战神引擎手游传奇SF会员充值奖励脚本
摘 要:通过读取玩家充值RMB来给予一定的奖励。本脚本为了方便操作只给了几个礼包,玩家可以自己制作礼包,或自行修改给予的东西。自制礼包可以放在PsItemScript中
格式参考其中的脚本。
1 修改你的比例在runquest.pas的这一段
This_Player.ScriptRequestAddYBNum(AwardCodeType);//这是你的充值元宝到账数额,我设置的是1:10
This_Player.setv(88,88,AwardCodeType/10+czs); // 通过设置v(88,88)变量来达到累积充值,我设置的是1:10 ,取上面元宝数/10即可得到你的充值数
This_Player.AddLF(1,AwardCodeType/10); //给元宝的同时给予除10的灵符
This_Player.give('金刚石',AwardCodeType/10); //给元宝的同时给予除10的金刚石,没有限制包裹 不想写了 你们自己看着要不要这个
This_Player.PlayerNotice('你获得元宝'+inttostr(AwardCodeType)+',灵符'+inttostr(AwardCodeType/10)+',金刚石'+inttostr(AwardCodeType/10)+'!',2);
其他的基本不用修改!!
2:NPC脚本如下:
PROGRAM Mir2; var sum:Integer; sum1:Integer; sum2:Integer; sum3:Integer; sum4:Integer; Procedure _doexit; begin This_Npc.CloseDialog(This_Player); end; procedure domain; begin begin if This_Player.GetV(88,88)< 1 then begin This_Player.setV(88,88,0) sum := This_Player.getV(88,88); end else sum := This_Player.getV(88,88); end; This_NPC.NpcDialog(This_Player, '当前累积总充值'+inttostr(sum)+'元,'+' '+'充值比例:元宝1:10,金刚石1:1,灵符1:1!\|' +'<初级赞助/c=red>'+' '+'累积充值100元可以领取'+' '+'<领取/@lq1>\|' +'<中级赞助/c=red>'+' '+'累积充值200元可以领取'+' '+'<领取/@lq2>\|' +'<高级赞助/c=red>'+' '+'累积充值300元可以领取'+' '+'<领取/@lq3>\|' +'<顶级赞助/c=red>'+' '+'累积充值500元可以领取'+' '+'<领取/@lq4>\|' ); end; procedure _lq1; begin begin if This_Player.getV(88,1) < 0 then begin This_Player.setV(88,1,0) sum1:= This_Player.getV(88,1); end else sum1:= This_Player.getV(88,1); end; if sum >= 100 then begin if sum1 < 1 then begin if This_Player.FreeBagNum >= 2 then begin This_Player.Give('100灵符礼包' , 1); This_NPC.NpcDialog(This_Player, '装备已放入您的包裹!'); This_Player.setV(88,1,sum1 + 1) ; end else This_NPC.NpcDialog(This_Player, '没有足够的包裹空间!\'); end else This_NPC.NpcDialog(This_Player, '你已经领过一次了!'); end else This_NPC.NpcDialog(This_Player, '你充值不够100元!'); end; procedure _lq2; begin begin if This_Player.getV(88,2) < 0 then begin This_Player.setV(88,2,0) sum2:= This_Player.getV(88,2); end else sum2:= This_Player.getV(88,2); end; if sum >= 200 then begin if sum2 < 1 then begin if This_Player.FreeBagNum >= 2 then begin This_Player.Give('200灵符礼包' , 1); This_NPC.NpcDialog(This_Player, '装备已放入您的包裹!'); This_Player.setV(88,2,sum2 + 1) ; end else This_NPC.NpcDialog(This_Player, '没有足够的包裹空间!\'); end else This_NPC.NpcDialog(This_Player, '你已经领过一次了!'); end else This_NPC.NpcDialog(This_Player, '你充值不够200元!'); end; procedure _lq3; begin begin if This_Player.getV(88,3) < 0 then begin This_Player.setV(88,3,0) sum3:= This_Player.getV(88,3); end else sum3:= This_Player.getV(88,3); end; if sum >= 300 then begin if sum3 < 1 then begin if This_Player.FreeBagNum >= 2 then begin This_Player.Give('500灵符礼包' , 1); This_NPC.NpcDialog(This_Player, '装备已放入您的包裹!'); This_Player.setV(88,3,sum3 + 1) ; end else This_NPC.NpcDialog(This_Player, '没有足够的包裹空间!\'); end else This_NPC.NpcDialog(This_Player, '你已经领过一次了!'); end else This_NPC.NpcDialog(This_Player, '你充值不够300元!'); end; procedure _lq4; begin begin if This_Player.getV(88,4) < 0 then begin This_Player.setV(88,4,0) sum4:= This_Player.getV(88,4); end else sum4:= This_Player.getV(88,4); end; if sum >= 500 then begin if sum4 < 1 then begin if This_Player.FreeBagNum >= 2 then begin This_Player.Give('1000灵符礼包' , 1); This_NPC.NpcDialog(This_Player, '装备已放入您的包裹!'); This_Player.setV(88,4,sum4 + 1) ; end else This_NPC.NpcDialog(This_Player, '没有足够的包裹空间!\'); end else This_NPC.NpcDialog(This_Player, '你已经领过一次了!'); end else This_NPC.NpcDialog(This_Player, '你充值不够500元!'); end; begin domain ; end. 3.升级触发(RunQuest.pas)脚本代码如下: procedure AwardCodeExecCallBack(ExecRes: Integer; const CodeStr: string; AwardCodeType, ActiveParam: Integer); var czs : integer; begin //AWARDCODE_EXEC_ERROR = 0; //AWARDCODE_EXEC_QUERY = 1; //AWARDCODE_EXEC_UPDATE = 2; //AWARDCODE_EXEC_ADD = 3; //AWARDCODE_EXEC_DEL = 4; // //This_Player.PlayerNotice('ExecRes:' + inttostr(ExecRes) + '!',0); //This_Player.PlayerNotice('AwardCodeType:' + inttostr(AwardCodeType) + '!',0); //This_Player.PlayerNotice('ActiveParam:' + inttostr(ActiveParam) + '!',0); begin if This_Player.GetV(88,88)< 0 then begin This_Player.setV(88,88,0) czs := This_Player.getV(88,88); end else czs := This_Player.getV(88,88); end; case ExecRes of 0 : begin SetAwardCodeCDTime(); This_Player.PlayerNotice('卡密无效!',0); end; 1 : begin if ActiveParam = 1 then This_Player.SetAwardCodeActiveParam(CodeStr, -1) else if ActiveParam = 2 then begin if getActiveItem(AwardCodeType) = '' then This_Player.PlayerNotice('该激活码未配置物品!',0) else if This_Player.FreeBagNum >= 1 then This_Player.SetAwardCodeActiveParam(CodeStr, -2) else This_Player.PlayerNotice('包裹空间不足!',0); end else This_Player.PlayerNotice('该卡密已使用!',0); end; 2 : begin This_Player.SetS(23,1,0); This_Player.SetS(23,2,0); if ActiveParam = -1 then begin This_Player.ScriptRequestAddYBNum(AwardCodeType); This_Player.setv(88,88,AwardCodeType/10+czs); This_Player.AddLF(1,AwardCodeType/10); This_Player.give('金刚石',AwardCodeType/10); This_Player.PlayerNotice('你获得元宝'+inttostr(AwardCodeType)+',灵符'+inttostr(AwardCodeType/10)+',金刚石'+inttostr(AwardCodeType/10)+'!',2); end else if ActiveParam = -2 then This_Player.Give(getActiveItem(AwardCodeType),1); end; 5 : This_Player.PlayerNotice('卡密操作失败!',0); end; end;
- 上一篇:战神引擎传奇手游私服设置开区补偿脚本
- 下一篇:战神引擎充值给予奖励