爵位捐献的NPCA代码 有需要的拿去

阿酱2023-09-10 20:07:58469

需要属性改动的自己修改下,这个是开过区的绝对没有什么问题!

program Mir2;

{$I TaoZhuang.pas}


var

s1,s2,s3,s4,s5 : integer;

l1,l2,l3,l4,l5 : integer; //次数限制-变量

n1,n2,n3,n4,n5 : string;

str :string;

num,num1,num2,today,num4 :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

    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,7,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) > 0 then

begin

if This_Player.getV(78,1) = s1 then n1 := This_Player.Name;

if This_Player.getV(78,1) = s2 then n2 := This_Player.Name;

if This_Player.getV(78,1) = s3 then n3 := This_Player.Name;

if This_Player.getV(78,1) = s4 then n4 := This_Player.Name;

if This_Player.getV(78,1) = s5 then n5 := This_Player.Name;

end;

 This_Npc.NpcDialog(This_Player,

//   +'你目前的元宝捐献数为:<'+inttostr(This_Player.GetV(78,1))+'/fcolor=250> \'

//   +'|今日总捐献为:<'+inttostr(GetG(78,7))+'/fcolor=250>       沙城奖池:<'+inttostr(GetG(78,7)/10)+'/fcolor=250>  \' 

//   +'|<排名       攻魔道       捐献数       玩家名/fcolor=151>'

//   +'|<第一名/fcolor=250>: <40-40/FCOLOR=254><        '+ inttostr(s1)+'/fcolor=250>       <'+n1+'/fcolor=249>\'

//   +'|<第二名/fcolor=250>: <30-30/FCOLOR=254><        '+ inttostr(s2)+'/fcolor=250>       <'+n2+'/fcolor=249>\'

//   +'|<第三名/fcolor=250>: <20-20/FCOLOR=254><        '+ inttostr(s3)+'/fcolor=250>       <'+n3+'/fcolor=249>\'

//   +'|<第四名/fcolor=250>: <15-15/FCOLOR=254><        '+ inttostr(s4)+'/fcolor=250>       <'+n4+'/fcolor=249>\'

 //  +'|<第五名/fcolor=250>: <10-10/FCOLOR=254><        '+ inttostr(s5)+'/fcolor=250>       <'+n5+'/fcolor=249>\'

//   +'|<六名后/fcolor=250>: <5-5/FCOLOR=254>  \' 

//   +'|<捐赠后属性自动领取,时效1小时,时间到加1元宝即可,英雄也加./fCOLOR=149> \' 

   +'|<此功能已关闭/fCOLOR=22> \' 

//   +'|<注:每晚00:00自动清空捐献数据!/fCOLOR=22> \' 

//   +'|{cmd}<我要捐献/@jxyb>\'

   );

   end;

   

procedure lqsx;

begin

   if This_Player.GetV(78,1) > 0 then

   begin  

   if This_Player.GetV(78,1) = s1 then 

   begin 

   This_Player.AddPlayerAbil(0, 40,3600);

   This_Player.AddPlayerAbil(1, 40,3600);

   This_Player.AddPlayerAbil(2, 40,3600);

   

   This_Player.AddHeroAbil(0,40,3600);  //英雄一起增加属性,可以删除

   This_Player.AddHeroAbil(1,40,3600);

   This_Player.AddHeroAbil(2,40,3600); 

      This_Player.PlayerNotice('捐献属性领取成功:全属性增加40,时效1小时',2); 

  This_NPC.NpcNotice('土豪:'+This_Player.Name+'获得元宝贡献榜第一名!');

   end else

   if This_Player.GetV(78,1) = s2 then 

   begin 

   This_Player.AddPlayerAbil(0, 30,3600);

   This_Player.AddPlayerAbil(1, 30,3600);

   This_Player.AddPlayerAbil(2, 30,3600);

   

   This_Player.AddHeroAbil(0,30,3600);  //英雄一起增加属性,可以删除

   This_Player.AddHeroAbil(1,30,3600);

   This_Player.AddHeroAbil(2,30,3600); 

      This_Player.PlayerNotice('捐献属性领取成功:全属性增加30,时效1小时',2); 

  This_NPC.NpcNotice('土豪:'+This_Player.Name+'获得元宝贡献榜第二名!');

   end else

   if This_Player.GetV(78,1) = s3 then 

   begin 

   This_Player.AddPlayerAbil(0, 20,3600);

   This_Player.AddPlayerAbil(1, 20,3600);

   This_Player.AddPlayerAbil(2, 20,3600);

   

   This_Player.AddHeroAbil(0,20,3600);  //英雄一起增加属性,可以删除

   This_Player.AddHeroAbil(1,20,3600);

   This_Player.AddHeroAbil(2,20,3600); 

      This_Player.PlayerNotice('捐献属性领取成功:全属性增加20,时效1小时',2); 

  This_NPC.NpcNotice('土豪:'+This_Player.Name+'获得元宝贡献榜第三名!');

   end else

    if This_Player.GetV(78,1) = s4 then 

   begin 

   This_Player.AddPlayerAbil(0, 15,3600);

   This_Player.AddPlayerAbil(1, 15,3600);

   This_Player.AddPlayerAbil(2, 15,3600);

   

   This_Player.AddHeroAbil(0,15,3600);  //英雄一起增加属性,可以删除

   This_Player.AddHeroAbil(1,15,3600);

   This_Player.AddHeroAbil(2,15,3600); 

      This_Player.PlayerNotice('捐献属性领取成功:全属性增加15,时效1小时',2); 

  This_NPC.NpcNotice('土豪:'+This_Player.Name+'获得元宝贡献榜第四名!');

   end else

   if This_Player.GetV(78,1) = s5 then 

   begin 

   This_Player.AddPlayerAbil(0, 10,3600);

   This_Player.AddPlayerAbil(1, 10,3600);

   This_Player.AddPlayerAbil(2, 10,3600);

   

   This_Player.AddHeroAbil(0,10,3600);  //英雄一起增加属性,可以删除

   This_Player.AddHeroAbil(1,10,3600);

   This_Player.AddHeroAbil(2,10,3600); 

      This_Player.PlayerNotice('捐献属性领取成功:全属性增加10,时效1小时',2); 

  This_NPC.NpcNotice('土豪:'+This_Player.Name+'获得元宝贡献榜第五名!');

   end else

   if This_Player.GetV(78,1) < s5 then 

   begin 

   This_Player.AddPlayerAbil(0, 5,3600);

   This_Player.AddPlayerAbil(1, 5,3600);

   This_Player.AddPlayerAbil(2, 5,3600);

   

   This_Player.AddHeroAbil(0,5,3600);  //英雄一起增加属性,可以删除

   This_Player.AddHeroAbil(1,5,3600);

   This_Player.AddHeroAbil(2,5,3600); 

      This_Player.PlayerNotice('捐献属性领取成功:全属性增加5,时效1小时',2); 

   end; 

  end; 

   

end;

procedure _jxyb; 

begin    

        This_NPC.InputDialog(This_Player,'请输入你要买的数额',0,111) ;

end;

 

procedure p111;

begin

   num4 := GetG(78,7);

   num :=  StrToIntDef(This_NPC.InputStr,-1);//输入非阿拉伯数字的字符都返回-1

   if This_NPC.InputOK  then             

    begin

        if (num < 1) or  (num > 65534)  then 

       begin 

       This_NPC.NpcDialog(This_Player,'捐献一次至少1元宝,总额不能大于65534,只能使用阿拉伯数字!') ;

       end 

        else if (num >= 1) and (num1 < 65535) then

         begin

           if  This_Player.YBNum >= num then 

           begin

                This_Player.PsYBConsum(This_NPC,'xin',20001,num,1);

                

               This_Player.CallOut(This_NPC,1,'jxyb'); 

       SetG(78,7,num4+num);

           end else

           This_NPC.NpcDialog(This_Player,'你没有足够的元宝捐献!' +'{cmd}<返回/@main>') ;

         end;

    end; 

 end;

 

 

 

procedure jxyb;

begin

num :=  StrToIntDef(This_NPC.InputStr,-1);//输入非阿拉伯数字的字符都返回-1

if This_Player.getV(78,1) < 0 then 

   This_Player.SetV(78,1,0);

num1 := This_Player.getV(78,1);

num2 :=num + num1;

s1 := getg(78,1);

s2 := getg(78,2);       

s3 := getg(78,3);    

s4 := getg(78,4);

s5 := getg(78,5);

if num2 > s1 then 

 begin

    if (num1 < s5) or (num1 = s5) 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,num1+num); 

    n5 := n4;

    n4 := n3; 

    n3 := n2;

    n2 := n1;

    n1 := This_Player.Name;

    This_Player.CallOut(This_NPC,1,'lqsx');

    domain;

     end else 

     if num1 = s4 then 

      begin 

    SetG(78,4,s3);

    SetG(78,3,s2);

    SetG(78,2,s1);

    SetG(78,1,num2);   

    This_Player.SetV(78,1,num1+num); 

    n4 := n3; 

    n3 := n2;

    n2 := n1;

    n1 := This_Player.Name;

    This_Player.CallOut(This_NPC,1,'lqsx');

    domain;

     end else

     if num1 = s3 then 

      begin 

    SetG(78,3,s2);

    SetG(78,2,s1);

    SetG(78,1,num2);   

    This_Player.SetV(78,1,num1+num); 

    n3 := n2;

    n2 := n1;

    n1 := This_Player.Name;

    This_Player.CallOut(This_NPC,1,'lqsx');

    domain;

     end else

      if num1 = s2 then 

      begin 

    SetG(78,2,s1);

    SetG(78,1,num2);   

    This_Player.SetV(78,1,num1+num); 

    n2 := n1;

    n1 := This_Player.Name;

    This_Player.CallOut(This_NPC,1,'lqsx');

    domain;

     end else

      if num1 = s1 then 

      begin 

    SetG(78,1,num2);   

    This_Player.SetV(78,1,num1+num); 

    n1 := This_Player.Name;

    This_Player.CallOut(This_NPC,1,'lqsx');

    domain;

     end;

     

         

 end else 

 if (s2 < num2) and ((num2< s1) or (num2 = s1)) then

 begin

    if (num1 < s5) or (num1 = s5) then

    begin 

    SetG(78,5,s4);

    SetG(78,4,s3);

    SetG(78,3,s2);

    SetG(78,2,num2);   

    This_Player.SetV(78,1,num1+num); 

    n5 := n4;

    n4 := n3; 

    n3 := n2;

    n2 := This_Player.Name;

    This_Player.CallOut(This_NPC,1,'lqsx');

    domain;

     end else 

     if num1 = s4 then 

      begin 

    SetG(78,4,s3);

    SetG(78,3,s2);

    SetG(78,2,num2);   

    This_Player.SetV(78,1,num1+num); 

    n4 := n3; 

    n3 := n2;

    n2 := This_Player.Name;

    This_Player.CallOut(This_NPC,1,'lqsx');

    domain;

     end else

     if num1 = s3 then 

      begin 

    SetG(78,3,s2);

    SetG(78,2,num2);   

    This_Player.SetV(78,1,num1+num); 

    n3 := n2;

    n2 := This_Player.Name;

    This_Player.CallOut(This_NPC,1,'lqsx');

    domain;

     end else

      if num1 = s2 then 

      begin 

    SetG(78,2,num2);   

    This_Player.SetV(78,1,num1+num); 

    n2 := This_Player.Name;

    This_Player.CallOut(This_NPC,1,'lqsx');

    domain;

     end;               


end else 

if (s3 < num2) and ((num2< s2) or (num2 = s2)) then

 begin

    if (num1 < s5) or (num1 = s5) then

    begin 

    SetG(78,5,s4);

    SetG(78,4,s3); 

    SetG(78,3,num2);   

    This_Player.SetV(78,1,num1+num); 

    n5 := n4;

    n4 := n3; 

    n3 := This_Player.Name;

    This_Player.CallOut(This_NPC,1,'lqsx');

    domain;

     end else 

     if num1 = s4 then 

      begin 

    SetG(78,4,s3);

    SetG(78,3,num2);   

    This_Player.SetV(78,1,num1+num); 

    n4 := n3; 

    n3 := This_Player.Name;

    This_Player.CallOut(This_NPC,1,'lqsx');

    domain;

     end else

     if num1 = s3 then 

      begin 

    SetG(78,3,num2);   

    This_Player.SetV(78,1,num1+num); 

    n3 := This_Player.Name;

    This_Player.CallOut(This_NPC,1,'lqsx');

    domain;

     end;                           

end else 

if (s4 < num2) and ((num2< s3) or (num2 = s3)) then

 begin

    if (num1 < s5) or (num1 = s5) then

    begin 

    SetG(78,5,s4); 

    SetG(78,4,num2);   

    This_Player.SetV(78,1,num1+num); 

    n5 := n4;

    n4 := This_Player.Name;

    This_Player.CallOut(This_NPC,1,'lqsx');

    domain;

     end else 

     if num1 = s4 then 

      begin 

    SetG(78,4,num2);   

    This_Player.SetV(78,1,num1+num); 

    

    n4 := This_Player.Name;

    This_Player.CallOut(This_NPC,1,'lqsx');

    domain;

     end;                   

end else 

if (s5 < num2) and ((num2< s4) or (num2 = s5)) then

                                              begin

                                           SetG(78,5,num2);

                                          This_Player.SetV(78,1,num1+num);

                                           n5:=This_Player.Name;

                                           This_Player.CallOut(This_NPC,1,'lqsx');

    domain;


end else 

if num2 < s5 then  

begin

This_Player.SetV(78,1,num1+num);

This_Player.CallOut(This_NPC,1,'lqsx');

    domain;

end;

end;


 function xin(price, num: Integer):boolean; 

begin

   result := true; 

end;

{

procedure Execute;

begin

   if (GetHour = 0) and (GetMin < 1) then

   begin

    This_Player.SetV(78,1,0);

    SetG(78,1,0);   

SetG(78,2,0);   

SetG(78,3,0);   

SetG(78,4,0);   

SetG(78,5,0); 

SetG(78,7,0);   

end;

end; 

}


begin

    if GetG(78,7) < 0 then

    begin

        SetG(78,7,0);  

    end;

  

domain;

end. 


文章评论

OSAAA-游戏经验分享是一个专注于手游技巧,PC游戏和单机游戏的技术交流平台.提供原创博客,游戏攻略,游戏问答,游戏指南与提示等.用户可以在这里分享游戏资讯,评论,资源,脚本,视频,教程,经验心得等。
请先 登录 再评论,如果还未注册,请先 注册