|
- program mir2;
- var
- s1,s2,s3,s4,s5 : integer;
- l1,l2,l3,l4,l5 : integer; //次数限制-变量
- n1,n2,n3,n4,n5,n6 : string;
- m1,m2,m3,m4,m5,m6 : string;
- num,num1,num2,num3,num4,today :integer;
- sxz1,sxz2,sxz3,sxz4,sxz5,sxz6,sxz7,sxz8,sxz9: integer;
- ybjx1,ybjx2,ybjx3,ybjx4,ybjx5,ybjx6,ybjx7,ybjx8,ybjx9: integer;
- zswj1,zswj2,zswj3,zswj4,zswj5,zswj6,zswj7: integer;
- ltsx6,ltsx7,txdy4,txdy5,sccjl: integer;
- procedure _DoExit;
- begin
- This_Npc.CloseDialog(This_Player);
- end;
- procedure _Exit;
- begin
- This_Npc.CloseDialog(This_Player);
- end;
- procedure domain;
- begin
- today := GetDateNum(GetNow); //定义today为当前日期值
- if This_Player.GetV(78,10) <> today then //查询个人变量78,10 不等于当前日期则清理其他数据
- begin
- This_Player.SetV(78,10,today);
- This_Player.SetV(78,1,0);
- This_Player.SetV(78,2,0);
- end;
- if getg(78,10) <> today then //查询个人变量78,10 不等于当前日期则清理其他数据
- begin
- num3 := GetG(78,6);
- num4 := GetG(78,7);
- SetG(78,7,num4+num3);
- SetG(78,10,today);
- SetG(78,1,0);
- SetG(78,2,0);
- SetG(78,3,0);
- SetG(78,4,0);
- SetG(78,5,0);
- SetG(78,6,0);
- end;
-
- if This_Player.getV(78,1) < 0 then This_Player.SetV(78,1,0); //初始化个人变量
- if This_Player.getV(78,2) < 0 then This_Player.SetV(78,2,0); //初始化个人变量
- num := StrToIntDef(This_NPC.InputStr,-1);
- if getg(78,1) < 0 then //初始化全局变量
- SetG(78,1,0);
- if getg(78,2) < 0 then
- SetG(78,2,0);
- if getg(78,3) < 0 then
- SetG(78,3,0);
- if getg(78,4) < 0 then
- SetG(78,4,0);
- if getg(78,5) < 0 then
- SetG(78,5,0);
- s1 := getg(78,1); //定义变量
- s2 := getg(78,2);
- s3 := getg(78,3);
- s4 := getg(78,4);
- s5 := getg(78,5);
- if This_Player.GetV(78,1) = s1 then
- begin
- m2 := '第一名';
- end
- else
- if This_Player.GetV(78,1) = s2 then
- begin
- m2 := '第二名';
- end
- else
- if This_Player.GetV(78,1) = s3 then
- begin
- m2 := '第三名';
- end
- else
- if This_Player.GetV(78,1) = s4 then
- begin
- m2 := '第四名';
- end
- else
- if This_Player.GetV(78,1) = s5 then
- begin
- m2 := '第五名';
- end
- else
- if (This_Player.GetV(78,1) > 1) and (This_Player.GetV(78,1) < s5) then
- begin
- m2 := '第六名后';
- end
- else m2 := '无';
- This_NPC.NpcDialog(This_Player,
- '每日捐献的<总值>存入<沙奖池>中.<攻城后>领取\'
- +'|今日总捐献:<'+inttostr(GetG(78,6))+'/c=103> 沙奖池累计: <'+inttostr(GetG(78,7)/40)+'/c=243>|\'
- +'|<第一名/c=103>:捐献元宝 <'+inttostr(getg(78,1))+'/c=254> <'+n1+'/c=250>\'
- +'|<第二名/c=103>:捐献元宝 <'+inttostr(getg(78,2))+'/c=254> <'+n2+'/c=250> \'
- +'|<第三名/c=103>:捐献元宝 <'+inttostr(getg(78,3))+'/c=254> <'+n3+'/c=250> \'
- +'|<第四名/c=103>:捐献元宝 <'+inttostr(getg(78,4))+'/c=254> <'+n4+'/c=250>\'
- +'|<第五名/c=103>:捐献元宝 <'+inttostr(getg(78,5))+'/c=254> <'+n5+'/c=250> \'
- +'|<第六名/c=103>:后不显示数据 <每日0点更新捐献/c=red>\'
- +'|您当前捐献元宝:<'+inttostr(This_Player.GetV(78,1))+'/c=254> 排名 [ <'+m2+'/c=250> ] \'
- +'|{cmd}<我要捐献/@jxyb> ^<查看属性/@shuxing>^<领取奖池/@linqujl> ^<关闭/@Exit> '
- );
- end;
- procedure _linqujl;
- begin
- if ( This_Player.IsCastle ) and ( This_Player.IsGuildLord ) then
- begin
- This_Npc.NpcDialog(This_Player,
- '尊敬的<沙巴克城主>您好!|\ \' +
- '当前<沙城池>捐献<元宝>数量为: <'+inttostr(GetG(78,7))+'/c=243> 元宝|\ \' +
- '您可以领取<城池元宝>数量为: <'+inttostr(GetG(78,7)/40)+'/c=243> 元宝|\ \' +
- '<是否领取>:|\ \' +
- '|{cmd}<领取城池元宝/@lqsjc> ^ <返回/@main>|\'
- );
- end else
- begin
- This_Npc.NpcDialog(This_Player,
- '只有沙巴克会长才能进行操作!'
- +'| <返回/@main>') ;
- end;
- end;
- procedure _lqsjc;
- begin
- if ( This_Player.IsCastle ) and ( This_Player.IsGuildLord ) then
- begin
- sccjl := GetG(78,7);
- This_Player.ScriptRequestAddYBNum((GetG(78,7)/10));
- ServerSay('沙巴克城主:[<' + This_Player.Name + '>]领取了沙城池奖励['+inttostr(GetG(78,7)/40)+']元宝!', 70);
- SetG(78,7,0);
- This_Npc.NpcDialog(This_Player,
- '恭喜你领取了沙城池奖励!'
- +'| <返回/@linqujl>') ;
- end else
- begin
- This_Npc.NpcDialog(This_Player,
- '只有沙巴克会长才能进行操作!'
- +'| <返回/@main>') ;
- end;
- end;
- procedure _shuxing;
- begin
- This_NPC.NpcDialog(This_Player,
- '|您当前捐献元宝:<'+inttostr(This_Player.GetV(78,1))+'/c=254> 排名 [ <'+m2+'/c=250> ] \'
- +'|<第一名/c=103>: 提升 <60%> 主属性\'
- +'|<第二名/c=103>: 提升 <50%> 主属性\'
- +'|<第三名/c=103>: 提升 <40%> 主属性\'
- +'|<第四名/c=103>: 提升 <30%> 主属性\'
- +'|<第五名/c=103>: 提升 <20%> 主属性\'
- +'|<六名后/c=103>: 提升 <10%> 主属性\'
- +'|{cmd}<领取属性/@lqsx11> ^<返回/@main>');
- end;
- procedure _lqsx;
- begin
- This_Player.CallOut(This_NPC,1,'lqsx1');
- end;
- procedure _lqsx11;
- begin
- if This_Player.GetV(78,1) > 0 then
- begin
- if (ybjx1 = 0) and (ybjx2 = 0) and (ybjx3 = 0) then
- begin
- sxz1 := 0;
- sxz2 := 0;
- sxz3 := 0;
- sxz4 := 0;
- sxz5 := 0;
- sxz8 := 0;
- sxz9 := 0;
- ybjx1 := 0;
- ybjx2 := 0;
- ybjx3 := 0;
- ybjx4 := 0;
- ybjx5 := 0;
- ybjx6 := 0;
- ybjx7 := 0;
-
-
- begin
-
- if (This_Player.GetV(78,1) = GetG(78,1)) and (This_Player.GetV(78,1) > 0) then
- begin
- ybjx1 := This_Player.MaxDC * 60 / 100
- ybjx2 := This_Player.MaxMC * 60 / 100
- ybjx3 := This_Player.MaxSC * 60 / 100
- This_Player.PlayerNotice('沙城捐献:[第一名]属性已触发',2);
- end;
- if (This_Player.GetV(78,1) = GetG(78,2)) and (This_Player.GetV(78,1) > 0) then
- begin
- ybjx1 := This_Player.MaxDC * 50 / 100
- ybjx2 := This_Player.MaxMC * 50 / 100
- ybjx3 := This_Player.MaxSC * 50 / 100
- This_Player.PlayerNotice('沙城捐献:[第二名]属性已触发',2);
- end;
- if (This_Player.GetV(78,1) = GetG(78,3)) and (This_Player.GetV(78,1) > 0) then
- begin
- ybjx1 := This_Player.MaxDC * 40 / 100
- ybjx2 := This_Player.MaxMC * 40 / 100
- ybjx3 := This_Player.MaxSC * 40 / 100
- This_Player.PlayerNotice('沙城捐献:[第三名]属性已触发!',2);
- end;
- if (This_Player.GetV(78,1) = GetG(78,4)) and (This_Player.GetV(78,1) > 0) then
- begin
- ybjx1 := This_Player.MaxDC * 30 / 100
- ybjx2 := This_Player.MaxMC * 30 / 100
- ybjx3 := This_Player.MaxSC * 30 / 100
- This_Player.PlayerNotice('沙城捐献:[第四名]属性已触发!',2);
- end;
-
- if (This_Player.GetV(78,1) = GetG(78,5)) and (This_Player.GetV(78,1) > 0) then
- begin
- ybjx1 := This_Player.MaxDC * 20 / 100
- ybjx2 := This_Player.MaxMC * 20 / 100
- ybjx3 := This_Player.MaxSC * 20 / 100
- This_Player.PlayerNotice('沙城捐献:[第五名]属性已触发!',2);
- end;
- if (This_Player.GetV(78,1) > 0) and (This_Player.GetV(78,1) < GetG(78,5)) then
- begin
- ybjx1 := This_Player.MaxDC * 10 / 100
- ybjx2 := This_Player.MaxMC * 10 / 100
- ybjx3 := This_Player.MaxSC * 10 / 100
- This_Player.PlayerNotice('沙城捐献:[没排上名次的]属性已触发!',2);
- end;
- if ((This_Player.GetV(78,1) = GetG(78,1)) and (This_Player.GetV(78,1) > 0))
- or ((This_Player.GetV(78,1) = GetG(78,2)) and (This_Player.GetV(78,1) > 0))
- or ((This_Player.GetV(78,1) = GetG(78,3)) and (This_Player.GetV(78,1) > 0))
- or ((This_Player.GetV(78,1) = GetG(78,4)) and (This_Player.GetV(78,1) > 0))
- or ((This_Player.GetV(78,1) = GetG(78,5)) and (This_Player.GetV(78,1) > 0))
- or ((This_Player.GetV(78,1) < GetG(78,5)) and (This_Player.GetV(78,1) > 0)) then
- begin
- sxz1 := zswj1 + ybjx1;
- sxz2 := zswj2 + ybjx2;
- sxz3 := zswj3 + ybjx3;
- sxz4 := zswj4 + txdy4;
- sxz5 := zswj5 + txdy5;
- sxz6 := zswj6 + ltsx6;
- sxz7 := zswj7 + ltsx7;
- This_Player.AddPlayerAbil(0, sxz1, 3600);
- This_Player.AddPlayerAbil(1, sxz2, 3600);
- This_Player.AddPlayerAbil(2, sxz3, 3600);
- This_Player.AddPlayerAbil(4, sxz4, 3600);
- This_Player.AddPlayerAbil(5, sxz5, 3600);
- This_Player.AddPlayerAbil(8, sxz6, 3600);
- This_Player.AddPlayerAbil(9, sxz7, 3600);
- This_Player.CallOut(This_Npc, 60, 'xiaochu');
- This_Player.PlayerNotice('属性增加:攻击 + '+inttostr(sxz1)+'点.魔法 + '+inttostr(sxz2)+'点.道术 .时限1小时',8);
- end;
- end;
- end else
- begin
- This_Player.PlayerNotice('你已经领取过了,稍后领取',2);
- end;
- end else
- begin
- This_Player.PlayerNotice('你还没有捐献记录,无法领取',2);
- end;
- end;
- procedure xiaochu;
- begin
- ybjx1 := 0;
- ybjx2 := 0;
- ybjx3 := 0;
- end;
- procedure _jxyb;
- begin
- This_NPC.InputDialog(This_Player,'请输入捐献元宝数',0,111) ;
- end;
-
- procedure p111;
- begin
- num := StrToIntDef(This_NPC.InputStr,-1);//输入非阿拉伯数字的字符都返回-1
- if This_NPC.InputOK then
- begin
- if (num < 100) or (num > 50000) then
- begin
- This_NPC.NpcDialog(This_Player,'捐献一次至少<100>元宝.总额不能大于<50000>.只能使用阿拉伯<数字>!'
- +'| <返回/@main>') ;
- end
- else if (num >= 100) and (num < 50000) then
- begin
- if This_Player.YBNum >= num then
- begin
-
- num3 := GetG(78,6);
- num3 := num3 + num;
- SetG(78,6,num3);
- This_Player.PsYBConsum(This_NPC,'xin',801,num,1);
- This_Player.CallOut(This_NPC,1,'jxyb');
- This_Player.ScriptRequestSubYBNum(num);
- ServerSay('玩家:['+This_Player.Name+']为沙城捐献了:'+ inttostr(num)+' 元宝!', 3);
- This_NPC.NpcDialog(This_Player,'恭喜你成功捐献:'+ inttostr(num)+' 元宝!'
- +'| <返回/@main>') ;
- end else
- This_NPC.NpcDialog(This_Player,'你没有足够的元宝捐献!'
- +'| <返回/@main>') ;
- end;
- end;
- end;
-
- procedure jxyb;
- begin
- num := StrToIntDef(This_NPC.InputStr,-1);//现在捐献元宝数,输入非阿拉伯数字的字符都返回-1
- num1 := This_Player.getV(78,1); //已捐献元宝数
- num2 :=num + num1; //总捐献元宝
- s1 := getg(78,1); //全局第1
- s2 := getg(78,2); //全局第2
- s3 := getg(78,3); //全局第3
- s4 := getg(78,4); //全局第4
- s5 := getg(78,5); //全局第5
- if num2 > s1 then //如果总捐献大于第一名
- begin
- SetG(78,5,s4);
- SetG(78,4,s3);
- SetG(78,3,s2);
- SetG(78,2,s1);
- SetG(78,1,num2); //第一名 写入你的捐献元宝数
- This_Player.SetV(78,1,num2); //个人变量标记
- This_Player.SetV(78,2,1); //个人变量标记
- n1 := This_Player.Name; //第一名写入你的名字
- end
- else
- if (num2 > s2) and (num2 < s1) then
- begin
- SetG(78,5,s4);
- SetG(78,4,s3);
- SetG(78,3,s2);
- SetG(78,1,s1);
- SetG(78,2,num2);
- This_Player.SetV(78,1,num2);
- This_Player.SetV(78,2,1); //个人变量标记
- n2 := This_Player.Name;
- end
- else
- if (num2 > s3) and (num2 < s2) then
- begin
- SetG(78,5,s4);
- SetG(78,4,s3);
- SetG(78,2,s2);
- SetG(78,1,s1);
- SetG(78,3,num2);
- This_Player.SetV(78,1,num2);
- This_Player.SetV(78,2,1); //个人变量标记
- n3 := This_Player.Name;
- end
- else
- if (num2 > s4) and (num2 < s3) then
- begin
- SetG(78,5,s4);
- SetG(78,3,s3);
- SetG(78,2,s2);
- SetG(78,1,s1);
- SetG(78,4,num2);
- This_Player.SetV(78,1,num2);
- This_Player.SetV(78,2,1); //个人变量标记
- n4 := This_Player.Name;
- end
- else
- if (num2 > s5) and (num2 < s4) then
- begin
- SetG(78,4,s4);
- SetG(78,3,s3);
- SetG(78,2,s2);
- SetG(78,1,s1);
- SetG(78,5,num2);
- This_Player.SetV(78,1,num2);
- This_Player.SetV(78,2,1); //个人变量标记
- n5 := This_Player.Name;
- end
- else
- if num2 < s5 then
- begin
- This_Player.SetV(78,1,num2);
- This_Player.SetV(78,2,1); //个人变量标记
- end;
- end;
-
- function xin(price, num: Integer):boolean;
- begin
- result := true;
- end;
- begin
- domain;
- end.
复制代码
|
上一篇:传奇战神引擎英雄玩家排行榜脚本代码下一篇:传奇沙巴克城堡管理员NPC脚本代码
|